{
  "id": "studio-b2ca193f-12a3-4b97-bba9-a394cc6d4582",
  "scope": "studio_project",
  "source_of_truth": "supabase.studio_artifacts",
  "source_path": "studio_artifacts/b2ca193f-12a3-4b97-bba9-a394cc6d4582",
  "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": "flow-to-plan-compiler-spec",
  "schema_version": "compiler-spec.v1",
  "title": "Bezel Workflow flow-to-plan-compiler-spec",
  "summary": "flow-to-plan-compiler-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:31.239889+00:00",
  "updated_at": "2026-05-09T13:17:30.522+00:00",
  "format_source": "supabase_json",
  "content_shape": [
    "kind",
    "repo",
    "input",
    "tests",
    "project",
    "purpose",
    "output_v1",
    "created_by",
    "updated_at",
    "schema_version",
    "compiler_stages",
    "source_memory_id",
    "runtime_metadata_needed",
    "architecture_decision_ref",
    "compatibility_with_existing_api"
  ],
  "content_data": {
    "kind": "flow-to-plan-compiler-spec",
    "repo": "/Users/justinking/Vaults/Projects/bezel-api",
    "input": "FLOW.json",
    "tests": [
      "compiles a sequential two-step flow",
      "compiles trigger -> extraction -> three-way fan-out -> fan-in summary",
      "rejects duplicate step ids",
      "rejects missing dependencies",
      "rejects unresolved connector action",
      "emits credential requirements without secret values",
      "emits PlanIntake accepted by existing validatePlanIntake"
    ],
    "project": "Bezel Workflow",
    "purpose": "Translate human-authored FLOW.json into the agent-readable runtime plan accepted by Bezel API/local runtime.",
    "output_v1": "PlanIntake-compatible graph: { name, tasks: [{ id, title, role_id, input, depends_on }] } plus safe runtime metadata where supported.",
    "created_by": "atlas-codex",
    "updated_at": "2026-05-09T13:17:30.522Z",
    "schema_version": "compiler-spec.v1",
    "compiler_stages": [
      {
        "stage": "parse",
        "checks": [
          "valid JSON",
          "schema version supported",
          "required fields present"
        ]
      },
      {
        "stage": "semantic validation",
        "checks": [
          "unique step ids",
          "dependency targets exist",
          "no cycles unless loop construct explicitly supported",
          "connector/action exists",
          "credential refs declared",
          "role names resolvable or provisionable"
        ]
      },
      {
        "stage": "normalization",
        "actions": [
          "expand templates",
          "normalize role names",
          "attach connector/action metadata",
          "derive task titles",
          "mark redaction policy"
        ]
      },
      {
        "stage": "graph compilation",
        "actions": [
          "map steps to tasks",
          "map depends_on to task_dependencies",
          "represent fan-out as sibling tasks",
          "represent fan-in as downstream task depending on all fan-out siblings"
        ]
      },
      {
        "stage": "runtime packaging",
        "actions": [
          "emit PlanIntake payload",
          "emit timeline metadata",
          "emit credential reference requirements",
          "emit warnings for human review"
        ]
      }
    ],
    "source_memory_id": "99edd8d2-5780-43a2-bbd0-03982353768a",
    "runtime_metadata_needed": [
      "flow_id",
      "flow_version",
      "step_id",
      "step_type",
      "connector",
      "action",
      "credential_ref",
      "human_label",
      "redaction_policy",
      "self_heal_policy"
    ],
    "architecture_decision_ref": "3a1bb081-67f9-41ae-9600-a91fbb14ecda",
    "compatibility_with_existing_api": {
      "current_gap": "Existing PlanIntake task input can carry connector/action metadata, but first-class metadata columns would improve run timeline and avoid mixing runtime inputs with product metadata.",
      "low_risk_start": "Compile metadata into task.input.__bezel initially, then migrate to explicit task metadata columns once the behavior is proven.",
      "preferred_production_path": "Add explicit task metadata JSONB or workflow_step metadata columns after the schema is stable."
    }
  },
  "sections": [
    {
      "title": "Artifact Shape",
      "level": 2,
      "body": "- kind: flow-to-plan-compiler-spec\n- repo: /Users/justinking/Vaults/Projects/bezel-api\n- input: FLOW.json\n- tests: 7 items\n- project: Bezel Workflow\n- purpose: Translate human-authored FLOW.json into the agent-readable runtime plan accepted by Bezel API/local runtime.\n- output v1: PlanIntake-compatible graph: { name, tasks: [{ id, title, role_id, input, depends_on }] } plus safe runtime metadata where supported.\n- created by: atlas-codex\n- updated at: 2026-05-09T13:17:30.522Z\n- schema version: compiler-spec.v1\n- compiler stages: 5 items\n- source memory id: 99edd8d2-5780-43a2-bbd0-03982353768a"
    }
  ],
  "html_path": "projects/redkey-bezel-workflow-d7ee6565/artifacts/flow-to-plan-compiler-spec-b2ca193f.html",
  "json_path": "projects/redkey-bezel-workflow-d7ee6565/artifacts/flow-to-plan-compiler-spec-b2ca193f.json"
}