{
  "id": "studio-cd49c553-6331-4d00-9673-29d4d8af49ce",
  "scope": "studio_project",
  "source_of_truth": "supabase.studio_artifacts",
  "source_path": "studio_artifacts/cd49c553-6331-4d00-9673-29d4d8af49ce",
  "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": "repo-module-layout-spec",
  "schema_version": "repo-layout.v1",
  "title": "Bezel Workflow repo-module-layout-spec",
  "summary": "repo-module-layout-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.999499+00:00",
  "updated_at": "2026-05-09T13:17:30.522+00:00",
  "format_source": "supabase_json",
  "content_shape": [
    "kind",
    "repo",
    "project",
    "created_by",
    "guardrails",
    "updated_at",
    "schema_version",
    "proposed_layout",
    "source_memory_id",
    "dependency_direction",
    "near_term_recommendation",
    "architecture_decision_ref",
    "current_repo_observations"
  ],
  "content_data": {
    "kind": "repo-module-layout-spec",
    "repo": "/Users/justinking/Vaults/Projects/bezel-api",
    "project": "Bezel Workflow",
    "created_by": "atlas-codex",
    "guardrails": [
      "Do not put workflow product UX fields directly into existing PlanIntake unless they are runtime-relevant.",
      "Do not let connector implementations depend on browser UI state.",
      "Do not add hosted-only credential assumptions to FLOW.json.",
      "Do not duplicate claim lifecycle logic outside store/runtime adapters."
    ],
    "updated_at": "2026-05-09T13:17:30.522Z",
    "schema_version": "repo-layout.v1",
    "proposed_layout": [
      {
        "path": "packages/workflow-contracts",
        "purpose": "FLOW.json, connector manifest, credential reference, run event, and compiler input/output contracts. May start inside packages/contracts if we want fewer packages, but the boundary should be explicit."
      },
      {
        "path": "packages/workflow-compiler",
        "purpose": "Compiles human-authored FLOW.json into Bezel API runtime plans/tasks/dependencies. Pure package, no DB/network."
      },
      {
        "path": "packages/connectors",
        "purpose": "Connector manifests and local connector action implementations. Keep connector SDK/runtime code separate from the API HTTP layer."
      },
      {
        "path": "packages/local-runtime",
        "purpose": "Local-first execution adapter for dogfooding: storage, queue, claims, and connector execution behind the same runtime interfaces. Can be deferred if apps/api local HTTP is sufficient."
      },
      {
        "path": "apps/workflow",
        "purpose": "Human Workflow product UI if/when apps/dashboard becomes too small. Until then, apps/dashboard can host early product screens."
      },
      {
        "path": "apps/api",
        "purpose": "Hosted/multi-tenant API routes, auth, migrations, runtime wiring, and production smoke."
      }
    ],
    "source_memory_id": "99edd8d2-5780-43a2-bbd0-03982353768a",
    "dependency_direction": [
      "apps/workflow or apps/dashboard -> packages/workflow-contracts",
      "apps/workflow or apps/dashboard -> packages/workflow-compiler",
      "apps/api -> packages/workflow-contracts",
      "apps/api -> packages/store",
      "packages/workflow-compiler -> packages/workflow-contracts and packages/contracts",
      "packages/connectors -> packages/workflow-contracts",
      "packages/contracts must not import UI/app packages"
    ],
    "near_term_recommendation": "Start with packages/workflow-contracts and packages/workflow-compiler. Add packages/connectors once FLOW can reference connector actions. Use apps/dashboard only for the first internal operational surface until a dedicated Workflow UI is justified.",
    "architecture_decision_ref": "3a1bb081-67f9-41ae-9600-a91fbb14ecda",
    "current_repo_observations": [
      "Repo is already an npm workspace monorepo with apps/* and packages/*.",
      "Existing runtime packages: packages/contracts, packages/store, packages/sdk-js, packages/hcs-writer.",
      "Existing apps: apps/api and apps/dashboard.",
      "Current PlanIntake contract is low-level: name plus tasks with role_id/input/depends_on.",
      "Current API already exposes workflow run/task/event reads suitable for a dashboard-safe timeline."
    ]
  },
  "sections": [
    {
      "title": "Artifact Shape",
      "level": 2,
      "body": "- kind: repo-module-layout-spec\n- repo: /Users/justinking/Vaults/Projects/bezel-api\n- project: Bezel Workflow\n- created by: atlas-codex\n- guardrails: 4 items\n- updated at: 2026-05-09T13:17:30.522Z\n- schema version: repo-layout.v1\n- proposed layout: 6 items\n- source memory id: 99edd8d2-5780-43a2-bbd0-03982353768a\n- dependency direction: 7 items\n- near term recommendation: Start with packages/workflow-contracts and packages/workflow-compiler. Add packages/connectors once FLOW can reference connector actions. Use apps/dashboard only for the first internal operational surface until a dedicated Workflow UI is justified.\n- architecture decision ref: 3a1bb081-67f9-41ae-9600-a91fbb14ecda"
    }
  ],
  "html_path": "projects/redkey-bezel-workflow-d7ee6565/artifacts/repo-module-layout-spec-cd49c553.html",
  "json_path": "projects/redkey-bezel-workflow-d7ee6565/artifacts/repo-module-layout-spec-cd49c553.json"
}