{
  "id": "studio-3cbb6697-5f33-4d4a-911f-788dcefd75fc",
  "scope": "studio_project",
  "source_of_truth": "supabase.studio_artifacts",
  "source_path": "studio_artifacts/3cbb6697-5f33-4d4a-911f-788dcefd75fc",
  "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": "runtime-boundary-spec",
  "schema_version": "runtime-boundary.v1",
  "title": "Bezel Workflow runtime-boundary-spec",
  "summary": "runtime-boundary-spec artifact · for Bezel Workflow · status draft",
  "status": "draft",
  "version": 1,
  "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:17:30.868051+00:00",
  "updated_at": "2026-05-09T13:17:30.522+00:00",
  "format_source": "supabase_json",
  "content_shape": [
    "kind",
    "repo",
    "project",
    "decision",
    "created_by",
    "updated_at",
    "hosted_rule",
    "layer_model",
    "n8n_contrast",
    "boundary_tests",
    "schema_version",
    "local_first_rule",
    "source_memory_id",
    "architecture_decision_ref"
  ],
  "content_data": {
    "kind": "runtime-boundary-spec",
    "repo": "/Users/justinking/Vaults/Projects/bezel-api",
    "project": "Bezel Workflow",
    "decision": "Build Bezel Workflow and Bezel API in the same repo/build stream while preserving separate human-product and agent-runtime layers.",
    "created_by": "atlas-codex",
    "updated_at": "2026-05-09T13:17:30.522Z",
    "hosted_rule": "Hosted/multi-tenant behavior should use Bezel API routes and database/HCS boundaries. Local behavior can bypass hosted network calls only behind an adapter that implements the same contract.",
    "layer_model": [
      {
        "owns": [
          "Flow builder",
          "workflow templates",
          "connector configuration UX",
          "credential setup UX",
          "manual/test execution UX",
          "run timeline",
          "failure remediation views",
          "approval/policy controls"
        ],
        "layer": "Bezel Workflow Product",
        "audience": "humans building and operating automations",
        "must_not_own": [
          "claim arbitration internals",
          "raw HCS message writing",
          "agent API-key auth semantics",
          "low-level task graph authoring as primary UX"
        ]
      },
      {
        "owns": [
          "FLOW.json schema",
          "connector manifest schema",
          "credential reference schema",
          "run event schema",
          "step output/error contracts",
          "flow-to-plan compiler contract"
        ],
        "layer": "Workflow Contracts",
        "audience": "both product compiler and runtime",
        "must_not_own": [
          "browser UI",
          "database-specific SQL",
          "hosted-only assumptions"
        ]
      },
      {
        "owns": [
          "workspace tenancy",
          "roles",
          "queues",
          "agents",
          "workflow_definitions",
          "workflow_runs",
          "tasks",
          "task_dependencies",
          "task_claims",
          "claim lifecycle",
          "workflow event reads",
          "Lite HCS claim proofs"
        ],
        "layer": "Bezel API Runtime",
        "audience": "agents and runtime clients",
        "must_not_own": [
          "human visual builder decisions",
          "marketing/product positioning",
          "manual canvas editing behavior"
        ]
      },
      {
        "owns": [
          "connector action manifests",
          "trigger adapters",
          "OAuth/API credential resolution",
          "response normalization",
          "self-healing policy execution",
          "structured completion payloads"
        ],
        "layer": "Connector Runtime",
        "audience": "agents executing integration work",
        "must_not_own": [
          "raw permanent credential storage in workflow rows",
          "unbounded autonomous code changes without policy"
        ]
      }
    ],
    "n8n_contrast": {
      "n8n_queue_mode": "n8n main receives triggers/webhooks, creates workflow executions, Redis queues execution IDs, and workers pull whole executions.",
      "bezel_pull_model": "Bezel queues claimable work by role/topic/step; agents pull according to capacity; Router/Flow Engine consumes structured completions and dispatches next work."
    },
    "boundary_tests": [
      "A Flow can compile to today’s PlanIntake-like task graph without UI-specific fields leaking into runtime tasks.",
      "A run timeline can render from sanitized workflow events without reading task input payloads.",
      "A connector action can execute locally and hosted through the same manifest/action contract.",
      "A credential reference can be resolved locally or hosted without changing FLOW.json."
    ],
    "schema_version": "runtime-boundary.v1",
    "local_first_rule": "Local dogfooding may call local packages/functions directly or local HTTP endpoints, but product code should preserve the same contracts that hosted Bezel API will consume later.",
    "source_memory_id": "99edd8d2-5780-43a2-bbd0-03982353768a",
    "architecture_decision_ref": "3a1bb081-67f9-41ae-9600-a91fbb14ecda"
  },
  "sections": [
    {
      "title": "Decision",
      "level": 2,
      "body": "Build Bezel Workflow and Bezel API in the same repo/build stream while preserving separate human-product and agent-runtime layers."
    }
  ],
  "html_path": "projects/redkey-bezel-workflow-d7ee6565/artifacts/runtime-boundary-spec-3cbb6697.html",
  "json_path": "projects/redkey-bezel-workflow-d7ee6565/artifacts/runtime-boundary-spec-3cbb6697.json"
}