{
  "schema_version": 2,
  "diagram_type": "workflow",
  "meta": {
    "title": "Launch Gate Pipeline",
    "output": "04-launch-gates.html",
    "quality_profile": "showcase"
  },
  "lanes": [
    { "id": "gates", "label": "pass-v3.sh gate v12" },
    { "id": "queues", "label": "Queues + driver" },
    { "id": "grading", "label": "Grading" },
    { "id": "credit", "label": "Credit" },
    { "id": "exceptions", "label": "Abort / stop", "variant": "exception" }
  ],
  "phases": [
    { "id": "preflight", "label": "Preflight", "fromCol": 0, "toCol": 1 },
    { "id": "n1", "label": "N=1 proof", "fromCol": 2, "toCol": 3, "variant": "emphasis" },
    { "id": "run", "label": "Run + verify", "fromCol": 4, "toCol": 5, "variant": "dashed" }
  ],
  "mainPath": ["sha_gate", "micro_lock", "n1_run", "shape_gate", "ledger_row", "queue", "driver", "grading_lane", "credit_row"],
  "nodes": [
    { "id": "sha_gate", "lane": "gates", "col": 0, "type": "security", "label": "Approved-driver sha", "sublabel": "APPROVED-DRIVERS.json; sha + pile glob" },
    { "id": "micro_lock", "lane": "gates", "col": 1, "type": "security", "label": "Micro-slice lock", "sublabel": "slice 240, cap 1,950, max_tokens 1024-1536" },
    { "id": "n1_run", "lane": "gates", "col": 2, "type": "backend", "label": "N=1 run", "sublabel": "1 task; backend==SEAT, thinking off, not truncated" },
    { "id": "shape_gate", "lane": "gates", "col": 3, "type": "security", "label": "Check 13 shape gate", "sublabel": "FAIL aborts; live :npu-slicer required" },
    { "id": "ledger_row", "lane": "gates", "col": 4, "type": "database", "label": "Ledger launch row", "sublabel": "pass-v3 appends {kind: launch}", "tag": "by: unknown possible" },
    { "id": "queue", "lane": "queues", "col": 4, "type": "backend", "label": "Full pile via queue", "sublabel": "QUEUE-A/B1/B2, pile3-queue.sh" },
    { "id": "driver", "lane": "queues", "col": 5, "type": "backend", "label": "Driver r36b run", "sublabel": "summary.json self-count = UNVERIFIED" },
    { "id": "grading_lane", "lane": "grading", "col": 5, "type": "external", "label": "Independent grading lane", "sublabel": "Codex lane that did not build the run; VERIFIED.md STATUS: DONE" },
    { "id": "credit_row", "lane": "credit", "col": 5, "type": "database", "label": "Credit", "sublabel": "fixed denominator; SUBSTANCE/FORM/SETUP apart" },
    { "id": "abort", "lane": "exceptions", "col": 1, "type": "security", "label": "Abort", "sublabel": "unlisted sha / override / FAIL shape" },
    { "id": "queue_stop", "lane": "exceptions", "col": 5, "type": "messagebus", "label": "QUEUE-STOP", "sublabel": "runs/QUEUE-STOP halts launches" }
  ],
  "edges": [
    { "from": "sha_gate", "to": "micro_lock", "label": "listed", "variant": "emphasis", "role": "main" },
    { "from": "micro_lock", "to": "n1_run", "label": "env injected", "variant": "emphasis", "role": "main" },
    { "from": "n1_run", "to": "shape_gate", "label": "records.jsonl", "variant": "emphasis", "role": "main" },
    { "from": "shape_gate", "to": "ledger_row", "label": "pass or WARN", "variant": "emphasis", "role": "main" },
    { "from": "ledger_row", "to": "queue", "label": "shard queued", "variant": "emphasis", "role": "main" },
    { "from": "queue", "to": "driver", "label": "one pass per seat", "variant": "emphasis", "role": "main" },
    { "from": "driver", "to": "grading_lane", "label": "records.jsonl + final patch", "variant": "emphasis", "role": "main" },
    { "from": "grading_lane", "to": "credit_row", "label": "VERIFIED only", "variant": "emphasis", "role": "main" },
    { "from": "sha_gate", "to": "abort", "label": "unlisted sha", "variant": "security", "role": "error" },
    { "from": "shape_gate", "to": "abort", "label": "FAIL or no live_18097", "variant": "security", "role": "error" },
    { "from": "queue_stop", "to": "queue", "label": "exit before launch", "variant": "dashed", "role": "branch" }
  ],
  "cards": [
    { "dot": "emerald", "title": "What the gates prove", "items": ["The driver file matches an allowlisted sha and pile scope", "G8/WAVE2 launches carry the micro-slice budgets", "N=1 call shape passes Check 13 and sliced through :npu-slicer", "The output parses as a patch; the launch has a ledger row"] },
    { "dot": "rose", "title": "What they do not", "items": ["Intent or plan adherence", "OWNER (single writer) is prose only", "The model served behind a seat name", "Who writes the allowlist row"] },
    { "dot": "amber", "title": "Measured", "items": ["r36b self-count CT39 39/39; independent 0/39", "r36b self-count Floor-v2 25/30; independent 0/30", "Driver self-counts are UNVERIFIED until VERIFIED.md says DONE"] }
  ]
}
