{
  "id": "studio-3a1bb081-67f9-41ae-9600-a91fbb14ecda",
  "scope": "studio_project",
  "source_of_truth": "supabase.studio_artifacts",
  "source_path": "studio_artifacts/3a1bb081-67f9-41ae-9600-a91fbb14ecda",
  "source_kind": "supabase_json",
  "visibility": "internal",
  "renderer_id": "design_doc.dreamborn-forge.generated.v1",
  "design_system": "dreamborn-design-system:forge",
  "generated_at": "2026-05-10T18:19:39.277Z",
  "artifact_type": "architecture-decision",
  "schema_version": "architecture-decision.v1",
  "title": "Bezel Workflow architecture-decision",
  "summary": "architecture-decision artifact · for Bezel Workflow · status draft",
  "status": "draft",
  "version": 2,
  "phase_id": null,
  "project_id": "d7ee6565-842e-4d74-9eda-84c2ed2fe1d6",
  "project_slug": "redkey-bezel-workflow-d7ee6565",
  "project_title": "Bezel Workflow",
  "client_id": "redkey",
  "platform_project_id": null,
  "created_at": "2026-05-09T13:05:47.723817+00:00",
  "updated_at": "2026-05-09T13:10:42.919+00:00",
  "format_source": "supabase_json",
  "content_shape": [
    "kind",
    "project",
    "decision",
    "rationale",
    "decided_at",
    "boundary_rule",
    "product_split",
    "repo_decision",
    "next_artifacts",
    "schema_version",
    "repo_recommendation"
  ],
  "content_data": {
    "kind": "architecture-decision",
    "project": "Bezel Workflow",
    "decision": "Keep Bezel Workflow and Bezel API together in the Bezel API repo/build stream, but treat them as separate products/layers: Bezel Workflow is the human-readable workflow product; Bezel API is the agent-readable runtime/API product.",
    "rationale": [
      "This matches the Bezel two-world model: humans work in product surfaces; agents consume structured runtime contracts.",
      "Bezel API already owns the agent-readable primitives: accounts, workspaces, roles, queues, agents, plans, workflow runs, tasks, dependencies, claims, leases, release/reclaim, terminal outcomes, workflow events, and Lite HCS claim proofs.",
      "Bezel Workflow should not duplicate the runtime. It should translate human-authored flows into machine-readable runtime plans and render machine events back into human workflow status.",
      "This preserves one execution kernel while allowing the product UI, positioning, and UX to feel like a Zapier/n8n replacement rather than an API dashboard.",
      "The Bezel API project is actively being built and already contains the runtime primitives Bezel Workflow needs, so keeping them together avoids duplicate schema/auth/claim/event/runtime work.",
      "The product boundary still matters: Bezel Workflow should be designed as the Zapier/n8n-facing human product while Bezel API remains the agent-readable execution substrate."
    ],
    "decided_at": "2026-05-09T13:05:47.350Z",
    "boundary_rule": "Humans never author low-level task graphs directly once the Workflow product exists. They author Flows. Bezel Workflow compiles Flows into Bezel API runtime plans. Agents never consume human prose workflow screens; they consume Bezel API contracts.",
    "product_split": {
      "agent_readable_product": {
        "name": "Bezel API",
        "owns": [
          "Runtime schemas and contracts",
          "Plan materialization into workflow runs, tasks, and dependencies",
          "Role and queue resolution",
          "Agent registration and API-key authentication",
          "Claim-next, renew, release, complete, fail, cancel lifecycle",
          "Workflow event stream and Lite HCS proof boundary",
          "Connector execution contracts and structured completion payloads"
        ],
        "outputs_to_human_product": [
          "workflow run summaries",
          "task status rows without sensitive inputs",
          "event timeline rows",
          "claim/proof references",
          "structured remediation objects"
        ]
      },
      "human_readable_product": {
        "name": "Bezel Workflow",
        "owns": [
          "Flow builder and workflow templates",
          "Connector setup and credential configuration UX",
          "Run timeline and operational status views",
          "Human-readable error/remediation surfaces",
          "Approvals and policy controls",
          "Product positioning against Zapier, n8n, Make, and Temporal"
        ],
        "outputs_to_runtime": [
          "FLOW.json",
          "connector credential references",
          "policy and approval settings",
          "runtime plan submissions"
        ]
      }
    },
    "repo_decision": {
      "rule": "Do not create a separate Bezel Workflow repo yet. Build Workflow and API together while preserving explicit product/runtime boundaries.",
      "canonical_repo": "/Users/justinking/Vaults/Projects/bezel-api",
      "separation_model": [
        "Separate artifacts and product language in Studio.",
        "Separate package/module boundaries inside the repo where practical.",
        "Separate human UI/Workflow concerns from runtime API contracts.",
        "Shared contracts for FLOW.json, claims, events, connector manifests, and credential references.",
        "Avoid routing local-first Workflow dogfooding through hosted API calls unless the feature explicitly targets hosted/multi-tenant runtime."
      ],
      "future_split_condition": "Only split repos if Bezel Workflow becomes a separately deployed product with a different release cadence or ownership model from Bezel API."
    },
    "next_artifacts": [
      "runtime-boundary-spec for same-repo separate-layer architecture",
      "repo/module layout spec for Bezel Workflow inside bezel-api",
      "FLOW.json schema",
      "flow-to-plan compiler spec",
      "connector credential UX/data spec",
      "workflow run timeline UX spec"
    ],
    "schema_version": "architecture-decision.v1",
    "repo_recommendation": {
      "now": "Keep Bezel Workflow implementation coupled to bezel-api plus the chosen UI/control-surface repo. Do not create a separate runtime repo yet.",
      "later_split_condition": "Split only if the human product surface becomes a separately deployed application with distinct ownership/release cadence while Bezel API remains the shared runtime."
    }
  },
  "sections": [
    {
      "title": "Decision",
      "level": 2,
      "body": "Keep Bezel Workflow and Bezel API together in the Bezel API repo/build stream, but treat them as separate products/layers: Bezel Workflow is the human-readable workflow product; Bezel API is the agent-readable runtime/API product."
    }
  ],
  "html_path": "projects/redkey-bezel-workflow-d7ee6565/artifacts/architecture-decision-3a1bb081.html",
  "json_path": "projects/redkey-bezel-workflow-d7ee6565/artifacts/architecture-decision-3a1bb081.json"
}