{
  "id": "studio-04988ea5-ae43-47bb-bbd0-4da071200a70",
  "scope": "studio_project",
  "source_of_truth": "supabase.studio_artifacts",
  "source_path": "studio_artifacts/04988ea5-ae43-47bb-bbd0-4da071200a70",
  "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": "production-implementation-plan",
  "schema_version": "implementation-plan.v1",
  "title": "Bezel Workflow production-implementation-plan",
  "summary": "production-implementation-plan 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:31.494845+00:00",
  "updated_at": "2026-05-09T13:17:30.522+00:00",
  "format_source": "supabase_json",
  "content_shape": [
    "kind",
    "repo",
    "phases",
    "posture",
    "project",
    "created_by",
    "updated_at",
    "schema_version",
    "source_memory_id",
    "autopilot_next_slice",
    "architecture_decision_ref"
  ],
  "content_data": {
    "kind": "production-implementation-plan",
    "repo": "/Users/justinking/Vaults/Projects/bezel-api",
    "phases": [
      {
        "id": "W0",
        "name": "Contracts and Boundaries",
        "objective": "Establish same-repo separate-layer architecture and machine-readable contracts.",
        "deliverables": [
          "runtime-boundary-spec approved",
          "repo/module layout approved",
          "FLOW.json contract package",
          "compiler test fixtures"
        ],
        "verification": [
          "contract tests pass",
          "FLOW fixture compiles to valid PlanIntake",
          "no secrets in fixtures"
        ]
      },
      {
        "id": "W1",
        "name": "Flow Compiler MVP",
        "objective": "Compile sequential and fan-out FLOW.json into existing Bezel API plan/task graph.",
        "deliverables": [
          "packages/workflow-contracts",
          "packages/workflow-compiler",
          "tests for validation and graph compilation"
        ],
        "verification": [
          "compiler output passes validatePlanIntake",
          "fan-out dependencies are correct",
          "cycle/missing dependency errors are deterministic"
        ]
      },
      {
        "id": "W2",
        "name": "Runtime Metadata and Timeline",
        "objective": "Preserve enough step metadata for human run timelines without leaking sensitive task input.",
        "deliverables": [
          "task metadata strategy",
          "workflow event extensions if needed",
          "dashboard-safe read model"
        ],
        "verification": [
          "timeline reads show flow/step labels, connector/action, status, claim events",
          "task input remains absent from public read APIs"
        ]
      },
      {
        "id": "W3",
        "name": "Connector Manifest and Local Connector Runner",
        "objective": "Add manifest-driven connector action execution locally for first connectors.",
        "deliverables": [
          "connector manifest schema",
          "HTTP connector",
          "Gmail/Sheets/HubSpot manifest skeletons",
          "local runner interface"
        ],
        "verification": [
          "manifest validation tests",
          "local HTTP action executes against mock server",
          "credential refs resolve through local adapter without raw secret persistence"
        ]
      },
      {
        "id": "W4",
        "name": "Router Agent / Flow Engine Loop",
        "objective": "Introduce persistent Router behavior over structured completions, retries, failures, and fan-in.",
        "deliverables": [
          "router loop contract",
          "completion consumption behavior",
          "retry/failure policy enforcement"
        ],
        "verification": [
          "router advances sequential flow",
          "router handles parallel completion order",
          "router returns expired/failed work to appropriate path"
        ]
      },
      {
        "id": "W5",
        "name": "Workflow Product Surface",
        "objective": "Build the human-readable surface: create/edit/test/activate flow, connector setup, run timeline.",
        "deliverables": [
          "initial product screen in apps/dashboard or apps/workflow",
          "manual test execution",
          "run timeline",
          "connector credential setup shell"
        ],
        "verification": [
          "user can create a valid flow without writing JSON",
          "manual run emits timeline",
          "invalid flow shows actionable validation errors"
        ]
      },
      {
        "id": "W6",
        "name": "Production Hardening",
        "objective": "Make local-first Workflow reliable enough to operate real internal automations.",
        "deliverables": [
          "persistence strategy",
          "backup/export/import",
          "credential audit logs",
          "rate limit handling",
          "run cancellation",
          "retry controls",
          "operational runbook"
        ],
        "verification": [
          "restart recovery",
          "idempotency checks",
          "claim lease tests",
          "connector failure tests",
          "security audit for secret leakage"
        ]
      },
      {
        "id": "W7",
        "name": "Hosted Runtime Alignment",
        "objective": "Map local Workflow contracts cleanly onto Bezel API hosted routes for multi-tenant operation.",
        "deliverables": [
          "hosted adapter",
          "API route extensions as needed",
          "SDK support",
          "production smoke covering compiled FLOW run"
        ],
        "verification": [
          "same FLOW fixture runs locally and hosted",
          "SDK types compile",
          "live smoke passes without task input leakage"
        ]
      }
    ],
    "posture": "Production product track, not demo. The plan must produce durable local-first and hosted-compatible workflow automation, with testable runtime contracts at each slice.",
    "project": "Bezel Workflow",
    "created_by": "atlas-codex",
    "updated_at": "2026-05-09T13:17:30.522Z",
    "schema_version": "implementation-plan.v1",
    "source_memory_id": "99edd8d2-5780-43a2-bbd0-03982353768a",
    "autopilot_next_slice": {
      "id": "W0-S1",
      "scope": [
        "packages/workflow-contracts",
        "packages/workflow-compiler tests if package is created in same slice"
      ],
      "title": "Create workflow contract package and FLOW fixture tests",
      "hold_conditions": [
        "Do not build visual UI until contracts compile and tests pass.",
        "Do not add hosted API routes until local compiler contract is stable."
      ],
      "expected_changes": [
        "schema/types for FLOW.json",
        "sample invoice fan-out fixture",
        "validation tests",
        "compiler stub or minimal compiler to PlanIntake"
      ]
    },
    "architecture_decision_ref": "3a1bb081-67f9-41ae-9600-a91fbb14ecda"
  },
  "sections": [
    {
      "title": "Phases",
      "level": 2,
      "body": "- Contracts and Boundaries: id: string, name: string, objective: string, deliverables: object, verification: object\n- Flow Compiler MVP: id: string, name: string, objective: string, deliverables: object, verification: object\n- Runtime Metadata and Timeline: id: string, name: string, objective: string, deliverables: object, verification: object\n- Connector Manifest and Local Connector Runner: id: string, name: string, objective: string, deliverables: object, verification: object\n- Router Agent / Flow Engine Loop: id: string, name: string, objective: string, deliverables: object, verification: object\n- Workflow Product Surface: id: string, name: string, objective: string, deliverables: object, verification: object\n- Production Hardening: id: string, name: string, objective: string, deliverables: object, verification: object\n- Hosted Runtime Alignment: id: string, name: string, objective: string, deliverables: object, verification: object"
    }
  ],
  "html_path": "projects/redkey-bezel-workflow-d7ee6565/artifacts/production-implementation-plan-04988ea5.html",
  "json_path": "projects/redkey-bezel-workflow-d7ee6565/artifacts/production-implementation-plan-04988ea5.json"
}