{
  "schema_version": 2,
  "diagram_type": "workflow",
  "meta": {
    "title": "Bambu Print Monitor — Runtime Workflow",
    "animation": "trace",
    "quality_profile": "showcase",
    "viewBox": [1300, 676],
    "views": [
      {
        "id": "start-and-capture",
        "label": "Start and capture",
        "focus": ["cloud_poll", "start_gate", "engage", "capture"],
        "note": "Follow the two-sample RUNNING gate into five-second evidence capture."
      },
      {
        "id": "health-and-seal",
        "label": "Health and seal",
        "focus": ["capture", "seal", "publish"],
        "note": "See terminal debounce, atomic sealing, and the bounded public status write. Pause and degraded recovery are detailed in the lifecycle view."
      },
      {
        "id": "defect-review",
        "label": "Defect review",
        "focus": ["capture", "bridge", "review"],
        "note": "Only a validated alert with a matching snapshot reaches Telegram and a human."
      }
    ]
  },
  "lanes": [
    { "id": "cloud", "label": "Bambu Cloud read" },
    { "id": "monitor", "label": "Lifecycle + evidence" },
    { "id": "public", "label": "Status publication" },
    { "id": "exceptions", "label": "Health + alert exceptions", "variant": "exception" }
  ],
  "phases": [
    { "id": "observe", "label": "Observe", "fromCol": 0, "toCol": 1 },
    { "id": "record", "label": "Record + supervise", "fromCol": 2, "toCol": 3, "variant": "emphasis" },
    { "id": "expose", "label": "Seal + expose", "fromCol": 4, "toCol": 5, "variant": "dashed" }
  ],
  "groups": [
    { "id": "start_gate_group", "label": "Conservative start gate", "lane": "cloud", "fromCol": 0, "toCol": 1, "variant": "emphasis" },
    { "id": "private_evidence", "label": "Owner-only evidence", "lane": "monitor", "fromCol": 2, "toCol": 4, "variant": "security" }
  ],
  "mainPath": ["cloud_poll", "start_gate", "engage", "capture", "seal", "publish", "serve"],
  "nodes": [
    { "id": "cloud_poll", "lane": "cloud", "col": 0, "type": "cloud", "label": "Cloud Poll", "tag": "GET / 5s" },
    { "id": "start_gate", "lane": "cloud", "col": 1, "type": "security", "label": "Start Gate", "tag": "2 / 15s" },
    { "id": "engage", "lane": "monitor", "col": 2, "type": "backend", "label": "Engage Job", "tag": ".partial" },
    { "id": "capture", "lane": "monitor", "col": 3, "type": "backend", "label": "Capture", "tag": "JPEG + score" },
    { "id": "seal", "lane": "monitor", "col": 4, "type": "database", "label": "Seal Bundle", "tag": "atomic" },
    { "id": "publish", "lane": "public", "col": 4, "type": "backend", "label": "Publish Status", "tag": "bearer ingest" },
    { "id": "serve", "lane": "public", "col": 5, "type": "frontend", "label": "Serve Status", "tag": "current + last" },
    { "id": "bridge", "lane": "exceptions", "col": 4, "type": "security", "label": "Validate Alert", "tag": "claim once" },
    { "id": "review", "lane": "exceptions", "col": 5, "type": "external", "label": "Human Review", "tag": "Telegram" }
  ],
  "edges": [
    { "id": "poll-gate", "from": "cloud_poll", "to": "start_gate", "label": "fresh RUNNING", "variant": "emphasis", "role": "main" },
    { "id": "gate-engage", "from": "start_gate", "to": "engage", "label": "2 same-job samples ≤15s", "variant": "emphasis", "role": "main" },
    { "id": "engage-capture", "from": "engage", "to": "capture", "label": "start", "variant": "emphasis", "role": "main" },
    { "id": "capture-seal", "from": "capture", "to": "seal", "label": "terminal debounce / idle timeout", "variant": "emphasis", "role": "main" },
    { "id": "seal-publish", "from": "seal", "to": "publish", "label": "sealed status + selected frame", "variant": "emphasis", "role": "main" },
    { "id": "publish-serve", "from": "publish", "to": "serve", "label": "public GET / HEAD", "variant": "emphasis", "role": "main" },
    { "id": "capture-bridge", "from": "capture", "to": "bridge", "label": "alert + matching snapshot", "variant": "security", "role": "async" },
    { "id": "bridge-review", "from": "bridge", "to": "review", "label": "exact alert + media", "variant": "security", "role": "main" }
  ]
}
