arkaos 4.32.0 → 4.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/README.md +1 -1
  2. package/THE-ARKAOS-GUIDE.md +1 -1
  3. package/VERSION +1 -1
  4. package/arka/SKILL.md +1 -1
  5. package/arka/skills/forge/references/workflows.md +10 -0
  6. package/config/claude-agents/architect.md +1 -1
  7. package/config/claude-agents/backend-dev.md +1 -1
  8. package/config/claude-agents/devops-eng.md +1 -1
  9. package/config/claude-agents/frontend-dev.md +1 -1
  10. package/config/claude-agents/ops-lead.md +1 -1
  11. package/config/claude-agents/pm-director.md +1 -1
  12. package/config/claude-agents/strategy-director.md +1 -1
  13. package/config/hooks/session-start.sh +1 -1
  14. package/config/skills-curated.yaml +2 -2
  15. package/config/skills-provenance.yaml +7 -0
  16. package/config/statusline.sh +6 -1
  17. package/core/hooks/session_start.py +69 -28
  18. package/departments/dev/agents/architect.yaml +1 -0
  19. package/departments/dev/agents/backend-dev.yaml +1 -0
  20. package/departments/dev/agents/devops-eng.yaml +1 -0
  21. package/departments/dev/agents/frontend-dev.yaml +1 -0
  22. package/departments/dev/agents/tech-lead.yaml +1 -0
  23. package/departments/dev/skills/diagram/SKILL.md +175 -0
  24. package/departments/dev/skills/diagram/examples/archify-repo-grid.architecture.json +57 -0
  25. package/departments/dev/skills/diagram/vendor/LICENSE +22 -0
  26. package/departments/dev/skills/diagram/vendor/SKILL.md +367 -0
  27. package/departments/dev/skills/diagram/vendor/assets/template.html +11470 -0
  28. package/departments/dev/skills/diagram/vendor/bin/archify.mjs +600 -0
  29. package/departments/dev/skills/diagram/vendor/bin/open-artifact.mjs +67 -0
  30. package/departments/dev/skills/diagram/vendor/examples/agent-run.lifecycle.json +71 -0
  31. package/departments/dev/skills/diagram/vendor/examples/agent-tool-call.workflow.json +111 -0
  32. package/departments/dev/skills/diagram/vendor/examples/async-job-roundtrip.sequence.json +62 -0
  33. package/departments/dev/skills/diagram/vendor/examples/cache-miss-request.sequence.json +82 -0
  34. package/departments/dev/skills/diagram/vendor/examples/deployment-release.lifecycle.json +50 -0
  35. package/departments/dev/skills/diagram/vendor/examples/event-stream.dataflow.json +58 -0
  36. package/departments/dev/skills/diagram/vendor/examples/incident-response.workflow.json +65 -0
  37. package/departments/dev/skills/diagram/vendor/examples/product-analytics.dataflow.json +77 -0
  38. package/departments/dev/skills/diagram/vendor/examples/production-deployment.architecture.json +70 -0
  39. package/departments/dev/skills/diagram/vendor/examples/release-delivery.workflow.json +63 -0
  40. package/departments/dev/skills/diagram/vendor/examples/web-app.architecture.json +47 -0
  41. package/departments/dev/skills/diagram/vendor/package-lock.json +80 -0
  42. package/departments/dev/skills/diagram/vendor/package.json +28 -0
  43. package/departments/dev/skills/diagram/vendor/recipes/scenarios.mjs +350 -0
  44. package/departments/dev/skills/diagram/vendor/renderers/architecture/grid.mjs +62 -0
  45. package/departments/dev/skills/diagram/vendor/renderers/architecture/render-architecture.mjs +490 -0
  46. package/departments/dev/skills/diagram/vendor/renderers/dataflow/README.md +93 -0
  47. package/departments/dev/skills/diagram/vendor/renderers/dataflow/render-dataflow.mjs +396 -0
  48. package/departments/dev/skills/diagram/vendor/renderers/lifecycle/README.md +103 -0
  49. package/departments/dev/skills/diagram/vendor/renderers/lifecycle/render-lifecycle.mjs +482 -0
  50. package/departments/dev/skills/diagram/vendor/renderers/sequence/README.md +96 -0
  51. package/departments/dev/skills/diagram/vendor/renderers/sequence/render-sequence.mjs +357 -0
  52. package/departments/dev/skills/diagram/vendor/renderers/shared/cli.mjs +176 -0
  53. package/departments/dev/skills/diagram/vendor/renderers/shared/generated-validators.mjs +13 -0
  54. package/departments/dev/skills/diagram/vendor/renderers/shared/geometry.mjs +992 -0
  55. package/departments/dev/skills/diagram/vendor/renderers/shared/layout-report.mjs +40 -0
  56. package/departments/dev/skills/diagram/vendor/renderers/shared/utils.mjs +156 -0
  57. package/departments/dev/skills/diagram/vendor/renderers/shared/validator.mjs +40 -0
  58. package/departments/dev/skills/diagram/vendor/renderers/workflow/README.md +114 -0
  59. package/departments/dev/skills/diagram/vendor/renderers/workflow/render-workflow.mjs +598 -0
  60. package/departments/dev/skills/diagram/vendor/schemas/README.md +93 -0
  61. package/departments/dev/skills/diagram/vendor/schemas/architecture.schema.json +125 -0
  62. package/departments/dev/skills/diagram/vendor/schemas/common.schema.json +62 -0
  63. package/departments/dev/skills/diagram/vendor/schemas/dataflow.schema.json +240 -0
  64. package/departments/dev/skills/diagram/vendor/schemas/lifecycle.schema.json +260 -0
  65. package/departments/dev/skills/diagram/vendor/schemas/sequence.schema.json +205 -0
  66. package/departments/dev/skills/diagram/vendor/schemas/workflow.schema.json +351 -0
  67. package/departments/dev/skills/diagram/vendor/scripts/check-render-output.mjs +774 -0
  68. package/departments/dev/skills/diagram/vendor/scripts/generate-validators.mjs +66 -0
  69. package/departments/dev/skills/diagram/vendor/scripts/render-examples.mjs +26 -0
  70. package/departments/dev/skills/spec/SKILL.md +19 -0
  71. package/departments/ops/agents/ops-lead.yaml +1 -0
  72. package/departments/pm/agents/pm-director.yaml +1 -0
  73. package/departments/strategy/agents/strategy-director.yaml +1 -0
  74. package/harness/codex/AGENTS.md +1 -1
  75. package/harness/copilot/copilot-instructions.md +1 -1
  76. package/harness/cursor/rules/arkaos.mdc +2 -2
  77. package/harness/gemini/GEMINI.md +1 -1
  78. package/harness/opencode/AGENTS.md +1 -1
  79. package/harness/zed/.rules +1 -1
  80. package/installer/autoupdate.js +249 -0
  81. package/installer/cli.js +7 -0
  82. package/installer/core-snapshot.js +5 -1
  83. package/installer/doctor.js +11 -0
  84. package/installer/index.js +11 -0
  85. package/installer/update.js +11 -0
  86. package/knowledge/agents-registry-v2.json +9 -1
  87. package/knowledge/skills-manifest.json +14 -1
  88. package/package.json +3 -2
  89. package/pyproject.toml +1 -1
  90. package/scripts/auto-update.sh +188 -0
  91. package/scripts/skill_validator.py +10 -2
  92. package/scripts/tools/docs_stats.py +8 -2
@@ -0,0 +1,71 @@
1
+ {
2
+ "schema_version": 1,
3
+ "diagram_type": "lifecycle",
4
+ "meta": {
5
+ "title": "Agent Run Lifecycle",
6
+ "subtitle": "State machine for planning, tool execution, human approval, retries, and terminal outcomes",
7
+ "output": "examples/lifecycle-agent-run.html",
8
+ "viewBox": [980, 660],
9
+ "animation": "trace",
10
+ "quality_profile": "showcase",
11
+ "views": [
12
+ { "id": "main-lifecycle", "label": "Main lifecycle", "focus": ["queued", "planning", "executing", "reviewing", "completed"], "note": "Follow the ordered phases from accepted request to completed response." },
13
+ { "id": "human-waits", "label": "Human and input waits", "focus": ["executing", "approval", "reviewing", "blocked"], "note": "See where the run pauses without becoming terminal." },
14
+ { "id": "recovery-and-exits", "label": "Recovery and terminal exits", "focus": ["executing", "failed", "blocked", "cancelled", "expired"], "note": "Separate retryable failure from cancellation and expiry." }
15
+ ]
16
+ },
17
+ "lanes": [
18
+ { "id": "main", "label": "Lifecycle phases" },
19
+ { "id": "waiting", "label": "Interruptions" },
20
+ { "id": "exceptions", "label": "Recovery loop" },
21
+ { "id": "terminal", "label": "Terminal exits" }
22
+ ],
23
+ "states": [
24
+ { "id": "queued", "type": "start", "label": "Queued", "sublabel": "request accepted", "lane": "main", "col": 0, "step": "01", "tag": "entry" },
25
+ { "id": "planning", "type": "active", "label": "Planning", "sublabel": "build task graph", "lane": "main", "col": 1, "step": "02", "tag": "model" },
26
+ { "id": "executing", "type": "active", "label": "Executing", "sublabel": "tool calls", "lane": "main", "col": 2, "step": "03", "tag": "work" },
27
+ { "id": "reviewing", "type": "decision", "label": "Reviewing", "sublabel": "quality gate", "lane": "main", "col": 3, "step": "04", "tag": "check" },
28
+ { "id": "completed", "type": "success", "label": "Completed", "sublabel": "final response", "lane": "main", "col": 4, "step": "05", "tag": "done" },
29
+ { "id": "approval", "type": "waiting", "label": "Needs Approval", "sublabel": "human gate", "lane": "waiting", "col": 0, "tag": "pause" },
30
+ { "id": "blocked", "type": "waiting", "label": "Blocked", "sublabel": "missing input", "lane": "waiting", "col": 1, "tag": "wait" },
31
+ { "id": "failed", "type": "failure", "label": "Failed", "sublabel": "recoverable error", "lane": "exceptions", "col": 0, "yOffset": 78, "tag": "retryable" },
32
+ { "id": "cancelled", "type": "failure", "label": "Cancelled", "sublabel": "user stopped", "lane": "terminal", "col": 0, "tag": "terminal" },
33
+ { "id": "expired", "type": "failure", "label": "Expired", "sublabel": "timeout", "lane": "terminal", "col": 1, "tag": "terminal" }
34
+ ],
35
+ "transitions": [
36
+ { "id": "approval-needed", "from": "executing", "to": "approval", "variant": "security", "fromSide": "bottom", "toSide": "top", "route": "straight" },
37
+ { "id": "review-blocked", "from": "reviewing", "to": "blocked", "variant": "default", "route": "drop" },
38
+ { "id": "execution-failed", "from": "executing", "to": "failed", "variant": "security", "fromSide": "left", "toSide": "left", "via": [[320, 157], [320, 385]] },
39
+ { "id": "block-expired", "from": "blocked", "to": "expired", "variant": "security", "fromSide": "bottom", "toSide": "top", "route": "straight" },
40
+ { "id": "approval-cancelled", "from": "approval", "to": "cancelled", "variant": "security", "fromSide": "bottom", "toSide": "top", "via": [[480, 336], [480, 432], [402, 432]] }
41
+ ],
42
+ "cards": [
43
+ {
44
+ "dot": "emerald",
45
+ "title": "Main Path",
46
+ "items": [
47
+ "The run has five ordered phases from queue to completion",
48
+ "The primary lifecycle is carried by one horizontal rail",
49
+ "Completion is a phase, not a detached side box"
50
+ ]
51
+ },
52
+ {
53
+ "dot": "amber",
54
+ "title": "Human + Input Gates",
55
+ "items": [
56
+ "Approval pauses execution without ending the run",
57
+ "Blocked waits for missing user input",
58
+ "Wait states can resume back into planning or execution"
59
+ ]
60
+ },
61
+ {
62
+ "dot": "rose",
63
+ "title": "Terminal + Recovery",
64
+ "items": [
65
+ "Failed loops back while retry budget remains",
66
+ "Cancelled and Expired are exits from the lifecycle",
67
+ "Terminal exits do not point back into active execution"
68
+ ]
69
+ }
70
+ ]
71
+ }
@@ -0,0 +1,111 @@
1
+ {
2
+ "schema_version": 1,
3
+ "diagram_type": "workflow",
4
+ "meta": {
5
+ "title": "Agent Tool Call Workflow",
6
+ "subtitle": "Renderer-driven workflow prototype with lanes, anchored nodes, and orthogonal edges",
7
+ "animation": "trace",
8
+ "visual_preset": "signal-flow",
9
+ "quality_profile": "showcase",
10
+ "views": [
11
+ {
12
+ "id": "happy-path",
13
+ "label": "Request to result",
14
+ "focus": ["user", "chat", "planner", "router", "approval", "tool", "external", "final"],
15
+ "note": "Follow the successful request from user intent to the final reply."
16
+ },
17
+ {
18
+ "id": "safety-gate",
19
+ "label": "Policy and recovery",
20
+ "focus": ["router", "approval", "blocked", "retry"],
21
+ "note": "See where risky work stops, waits for consent, or returns for revision."
22
+ },
23
+ {
24
+ "id": "evidence-loop",
25
+ "label": "Evidence and memory",
26
+ "focus": ["external", "store", "trace"],
27
+ "note": "Isolate the durable trace and context path behind the visible answer."
28
+ }
29
+ ],
30
+ "output": "examples/workflow-agent-tool-call-rendered.html",
31
+ "viewBox": [720, 900]
32
+ },
33
+ "lanes": [
34
+ { "id": "ui", "label": "User Interface" },
35
+ { "id": "agent", "label": "Agent Runtime" },
36
+ { "id": "policy", "label": "Policy Boundary" },
37
+ { "id": "exceptions", "label": "Exception Handling", "variant": "exception" },
38
+ { "id": "tools", "label": "Tool Execution" },
39
+ { "id": "trace", "label": "Observability" }
40
+ ],
41
+ "phases": [
42
+ { "id": "intake", "label": "Intake", "fromCol": 0, "toCol": 1 },
43
+ { "id": "reasoning", "label": "Plan + route", "fromCol": 2, "toCol": 3, "variant": "emphasis" },
44
+ { "id": "execution", "label": "Execute + report", "fromCol": 4, "toCol": 5, "variant": "dashed" }
45
+ ],
46
+ "groups": [
47
+ { "id": "agent_loop", "label": "Planning loop", "lane": "agent", "fromCol": 2, "toCol": 3, "variant": "emphasis" },
48
+ { "id": "tool_work", "label": "Tool work", "lane": "tools", "fromCol": 4, "toCol": 5, "variant": "dashed" },
49
+ { "id": "exception_path", "label": "Human or policy stop", "lane": "exceptions", "fromCol": 3, "toCol": 5, "variant": "security" }
50
+ ],
51
+ "mainPath": ["user", "chat", "planner", "router", "approval", "tool", "external", "final"],
52
+ "nodes": [
53
+ { "id": "user", "lane": "ui", "col": 0, "type": "external", "label": "User", "sublabel": "asks for work" },
54
+ { "id": "chat", "lane": "ui", "col": 1, "type": "frontend", "label": "Chat Surface", "sublabel": "thread + files" },
55
+ { "id": "final", "lane": "ui", "col": 5, "type": "backend", "label": "Final Reply", "sublabel": "answer + changes" },
56
+ { "id": "planner", "lane": "agent", "col": 2, "type": "backend", "label": "Agent Planner", "sublabel": "plan next step", "tag": "context aware" },
57
+ { "id": "router", "lane": "agent", "col": 3, "type": "backend", "label": "Tool Router", "sublabel": "choose capability" },
58
+ { "id": "approval", "lane": "policy", "col": 3, "type": "security", "label": "Approval Gate", "sublabel": "scope + consent", "tag": "block risky ops" },
59
+ { "id": "blocked", "lane": "exceptions", "col": 4, "type": "security", "label": "Blocked", "sublabel": "wait or reject" },
60
+ { "id": "retry", "lane": "exceptions", "col": 5, "type": "messagebus", "label": "Retry Path", "sublabel": "revise request" },
61
+ { "id": "tool", "lane": "tools", "col": 4, "type": "messagebus", "label": "Tool Call", "sublabel": "shell / browser / MCP", "tag": "structured result" },
62
+ { "id": "external", "lane": "tools", "col": 5, "type": "cloud", "label": "External API", "sublabel": "network service" },
63
+ { "id": "store", "lane": "trace", "col": 1, "type": "database", "label": "Context Store", "sublabel": "repo + memory" },
64
+ { "id": "trace", "lane": "trace", "col": 4, "type": "database", "label": "Trace Log", "sublabel": "events + output" }
65
+ ],
66
+ "edges": [
67
+ { "id": "request-chat", "from": "user", "to": "chat", "variant": "default" },
68
+ { "id": "plan-request", "from": "chat", "to": "planner", "label": "plan", "variant": "emphasis", "fromSide": "bottom", "toSide": "top", "route": "drop", "labelSegment": 1 },
69
+ { "id": "planner-route", "from": "planner", "to": "router", "variant": "default" },
70
+ { "id": "approval-check", "from": "router", "to": "approval", "label": "needs approval?", "variant": "security", "fromSide": "bottom", "toSide": "top", "route": "drop", "labelSegment": 0, "labelDx": 34, "labelDy": 18 },
71
+ { "id": "approved-tool", "from": "approval", "to": "tool", "variant": "emphasis", "fromSide": "left", "toSide": "left", "route": "return-left" },
72
+ { "id": "approval-denied", "from": "approval", "to": "blocked", "label": "denied", "variant": "security", "role": "error", "fromSide": "bottom", "toSide": "top", "route": "drop", "labelSegment": 1, "labelDy": 12 },
73
+ { "id": "retry-request", "from": "blocked", "to": "retry", "variant": "dashed", "role": "branch" },
74
+ { "id": "tool-external-call", "from": "tool", "to": "external", "variant": "default" },
75
+ { "id": "external-reply", "from": "external", "to": "final", "variant": "emphasis", "role": "return", "fromSide": "right", "toSide": "right", "route": "outside-right", "width": 1.2 },
76
+ { "id": "record-result", "from": "external", "to": "trace", "label": "record result", "variant": "dashed", "fromSide": "bottom", "toSide": "bottom", "route": "bottom-channel", "labelSegment": 1 },
77
+ { "id": "write-trace-memory", "from": "store", "to": "trace", "label": "trace + memory", "variant": "dashed", "labelAt": [365, 735] }
78
+ ],
79
+ "cards": [
80
+ {
81
+ "dot": "cyan",
82
+ "title": "Renderer Rules",
83
+ "items": [
84
+ "Lanes and columns determine node placement",
85
+ "Edges attach to explicit node anchors",
86
+ "Cross-lane paths use orthogonal routing",
87
+ "Short adjacent links stay unlabeled"
88
+ ]
89
+ },
90
+ {
91
+ "dot": "rose",
92
+ "title": "Workflow Semantics",
93
+ "items": [
94
+ "Approval is a first-class policy step",
95
+ "Consent gates are visible in the main path",
96
+ "External calls stay inside the tool lane",
97
+ "Trace writes are separate from the hot path"
98
+ ]
99
+ },
100
+ {
101
+ "dot": "emerald",
102
+ "title": "Why It Matters",
103
+ "items": [
104
+ "This is closer to a diagram_type renderer",
105
+ "The graph can be edited without SVG surgery",
106
+ "Layout rules can be tested and improved",
107
+ "A future IR can reuse this shape directly"
108
+ ]
109
+ }
110
+ ]
111
+ }
@@ -0,0 +1,62 @@
1
+ {
2
+ "schema_version": 1,
3
+ "diagram_type": "sequence",
4
+ "meta": {
5
+ "title": "Async Job Roundtrip",
6
+ "subtitle": "Acknowledgement, queueing, background work, retries, callback, polling, and final consistency",
7
+ "output": "examples/async-job-roundtrip.html",
8
+ "viewBox": [820, 920],
9
+ "animation": "trace",
10
+ "visual_preset": "signal-flow",
11
+ "quality_profile": "showcase",
12
+ "views": [
13
+ { "id": "accept-and-enqueue", "label": "Accept without blocking", "focus": ["client", "api", "queue"], "note": "The API acknowledges quickly after durable enqueue." },
14
+ { "id": "work-and-retry", "label": "Background work and retry", "focus": ["queue", "worker", "provider"], "note": "Timeouts re-enter the queue instead of holding the original request open." },
15
+ { "id": "observe-final-state", "label": "Observe final consistency", "focus": ["worker", "store", "notify", "client", "api"], "note": "Webhook delivery is primary; polling remains a bounded fallback." }
16
+ ]
17
+ },
18
+ "participants": [
19
+ { "id": "client", "type": "external", "label": "Client", "sublabel": "mobile app" },
20
+ { "id": "api", "type": "backend", "label": "Jobs API", "sublabel": "request edge" },
21
+ { "id": "queue", "type": "messagebus", "label": "Queue", "sublabel": "durable work" },
22
+ { "id": "worker", "type": "backend", "label": "Worker", "sublabel": "background" },
23
+ { "id": "provider", "type": "cloud", "label": "Provider", "sublabel": "external API" },
24
+ { "id": "store", "type": "database", "label": "Job Store", "sublabel": "source of truth" },
25
+ { "id": "notify", "type": "messagebus", "label": "Notifier", "sublabel": "webhook" }
26
+ ],
27
+ "segments": [
28
+ { "from": 150, "to": 288, "label": "Accept" },
29
+ { "from": 306, "to": 538, "label": "Background work" },
30
+ { "from": 554, "to": 800, "label": "Notify + reconcile" }
31
+ ],
32
+ "messages": [
33
+ { "from": "client", "to": "api", "y": 180, "label": "POST /jobs", "variant": "emphasis" },
34
+ { "from": "api", "to": "queue", "y": 222, "label": "enqueue job", "variant": "emphasis" },
35
+ { "from": "api", "to": "client", "y": 264, "label": "202 + job id", "variant": "return" },
36
+ { "from": "queue", "to": "worker", "y": 326, "label": "deliver", "variant": "emphasis" },
37
+ { "from": "worker", "to": "provider", "y": 368, "label": "perform work", "variant": "default" },
38
+ { "from": "provider", "to": "worker", "y": 410, "label": "result / timeout", "variant": "return" },
39
+ { "from": "worker", "to": "queue", "y": 452, "label": "retry if timeout", "variant": "dashed" },
40
+ { "from": "worker", "to": "store", "y": 494, "label": "persist final state", "variant": "emphasis" },
41
+ { "from": "worker", "to": "notify", "y": 566, "label": "job.completed", "variant": "dashed" },
42
+ { "from": "notify", "to": "client", "y": 608, "label": "signed webhook", "variant": "dashed" },
43
+ { "from": "client", "to": "api", "y": 650, "label": "GET /jobs/:id", "variant": "default" },
44
+ { "from": "api", "to": "store", "y": 692, "label": "read status", "variant": "default" },
45
+ { "from": "store", "to": "api", "y": 734, "label": "completed", "variant": "return" },
46
+ { "from": "api", "to": "client", "y": 776, "label": "200 final result", "variant": "return" }
47
+ ],
48
+ "activations": [
49
+ { "participant": "api", "from": 174, "to": 272, "type": "backend" },
50
+ { "participant": "queue", "from": 216, "to": 334, "type": "messagebus" },
51
+ { "participant": "worker", "from": 320, "to": 574, "type": "backend" },
52
+ { "participant": "provider", "from": 362, "to": 416, "type": "cloud" },
53
+ { "participant": "store", "from": 488, "to": 742, "type": "database" },
54
+ { "participant": "notify", "from": 560, "to": 616, "type": "messagebus" },
55
+ { "participant": "api", "from": 644, "to": 784, "type": "backend" }
56
+ ],
57
+ "cards": [
58
+ { "dot": "cyan", "title": "Fast Acknowledgement", "items": ["The caller receives a durable job id before work begins", "Queue ownership is visible in the acceptance contract", "The original connection does not wait for provider latency"] },
59
+ { "dot": "orange", "title": "Bounded Recovery", "items": ["Timeouts re-enter the queue with a retry policy", "Final state is persisted before notification", "The job store remains the source of truth"] },
60
+ { "dot": "emerald", "title": "Two Observation Paths", "items": ["A signed webhook announces completion", "Status polling is a fallback, not a second workflow", "Both paths converge on the same final state"] }
61
+ ]
62
+ }
@@ -0,0 +1,82 @@
1
+ {
2
+ "schema_version": 1,
3
+ "diagram_type": "sequence",
4
+ "meta": {
5
+ "title": "Cache Miss Request Sequence",
6
+ "subtitle": "Frontend request path with auth, cache fallback, persistence, and async trace",
7
+ "output": "examples/sequence-cache-miss-request.html",
8
+ "viewBox": [820, 760],
9
+ "animation": "trace",
10
+ "quality_profile": "showcase",
11
+ "views": [
12
+ { "id": "request-and-auth", "label": "Request and identity", "focus": ["user", "web", "api", "auth"], "note": "Follow the user request through the authentication check." },
13
+ { "id": "cache-fallback", "label": "Cache fallback", "focus": ["api", "redis", "db"], "note": "See the cache miss and the source-of-truth query it triggers." },
14
+ { "id": "return-and-trace", "label": "Return and trace", "focus": ["db", "api", "redis", "trace", "web", "user"], "note": "Separate response latency from the non-blocking observability write." }
15
+ ]
16
+ },
17
+ "participants": [
18
+ { "id": "user", "type": "external", "label": "User", "sublabel": "browser session" },
19
+ { "id": "web", "type": "frontend", "label": "Web App", "sublabel": "React UI" },
20
+ { "id": "api", "type": "backend", "label": "API", "sublabel": "request handler" },
21
+ { "id": "auth", "type": "security", "label": "Auth", "sublabel": "JWT verify" },
22
+ { "id": "redis", "type": "database", "label": "Redis", "sublabel": "cache" },
23
+ { "id": "db", "type": "database", "label": "Postgres", "sublabel": "source of truth" },
24
+ { "id": "trace", "type": "messagebus", "label": "Trace", "sublabel": "async event" }
25
+ ],
26
+ "segments": [
27
+ { "from": 150, "to": 295, "label": "Request" },
28
+ { "from": 315, "to": 505, "label": "Fallback" },
29
+ { "from": 525, "to": 665, "label": "Response + trace" }
30
+ ],
31
+ "messages": [
32
+ { "id": "open-page", "from": "user", "to": "web", "y": 185, "label": "open page", "variant": "default" },
33
+ { "id": "dashboard-request", "from": "web", "to": "api", "y": 228, "label": "GET /dashboard", "variant": "emphasis" },
34
+ { "id": "verify-jwt", "from": "api", "to": "auth", "y": 270, "label": "verify JWT", "variant": "security" },
35
+ { "id": "auth-claims", "from": "auth", "to": "api", "y": 305, "label": "claims ok", "variant": "return" },
36
+ { "id": "cache-read", "from": "api", "to": "redis", "y": 354, "label": "read cache", "variant": "default" },
37
+ { "id": "cache-miss", "from": "redis", "to": "api", "y": 391, "label": "miss", "variant": "return" },
38
+ { "id": "profile-query", "from": "api", "to": "db", "y": 443, "label": "query profile + metrics", "variant": "emphasis" },
39
+ { "id": "profile-rows", "from": "db", "to": "api", "y": 489, "label": "rows", "variant": "return" },
40
+ { "id": "cache-write", "from": "api", "to": "redis", "y": 536, "label": "set cache", "variant": "dashed" },
41
+ { "id": "trace-emit", "from": "api", "to": "trace", "y": 580, "label": "emit trace", "variant": "dashed" },
42
+ { "id": "dashboard-response", "from": "api", "to": "web", "y": 625, "label": "200 JSON", "variant": "return" },
43
+ { "id": "page-render", "from": "web", "to": "user", "y": 662, "label": "render", "variant": "return" }
44
+ ],
45
+ "activations": [
46
+ { "participant": "web", "from": 220, "to": 668, "type": "frontend" },
47
+ { "participant": "api", "from": 228, "to": 632, "type": "backend" },
48
+ { "participant": "auth", "from": 265, "to": 310, "type": "security" },
49
+ { "participant": "redis", "from": 349, "to": 398, "type": "database" },
50
+ { "participant": "db", "from": 438, "to": 496, "type": "database" },
51
+ { "participant": "trace", "from": 575, "to": 630, "type": "messagebus" }
52
+ ],
53
+ "cards": [
54
+ {
55
+ "dot": "emerald",
56
+ "title": "Happy Path",
57
+ "items": [
58
+ "The main request is Web App -> API -> data source -> response",
59
+ "Return messages are quieter than forward calls",
60
+ "Activation bars make ownership duration visible"
61
+ ]
62
+ },
63
+ {
64
+ "dot": "rose",
65
+ "title": "Policy + Fallback",
66
+ "items": [
67
+ "JWT verification is colored as a security interaction",
68
+ "Cache miss is visible without overpowering the main path",
69
+ "Database access only appears after cache fallback"
70
+ ]
71
+ },
72
+ {
73
+ "dot": "orange",
74
+ "title": "Async Trace",
75
+ "items": [
76
+ "Trace emission is dashed and secondary",
77
+ "It does not block the response path",
78
+ "The diagram separates user-facing latency from observability"
79
+ ]
80
+ }
81
+ ]
82
+ }
@@ -0,0 +1,50 @@
1
+ {
2
+ "schema_version": 1,
3
+ "diagram_type": "lifecycle",
4
+ "meta": {
5
+ "title": "Deployment Release Lifecycle",
6
+ "subtitle": "Queued, building, verifying, approval, promotion, health regression, rollback, and terminal outcomes",
7
+ "output": "examples/deployment-release.html",
8
+ "viewBox": [980, 680],
9
+ "animation": "trace",
10
+ "visual_preset": "signal-flow",
11
+ "quality_profile": "showcase",
12
+ "views": [
13
+ { "id": "promotion-rail", "label": "Promotion rail", "focus": ["queued", "building", "verifying", "ready", "live"], "note": "Follow the deployment object from accepted change to healthy production." },
14
+ { "id": "approval-gate", "label": "Approval gate", "focus": ["verifying", "approval", "cancelled", "ready"], "note": "Approval pauses promotion and can terminate the release cleanly." },
15
+ { "id": "rollback-outcomes", "label": "Rollback outcomes", "focus": ["ready", "rollback", "failed", "live", "paused", "rolled_back"], "note": "Separate pre-promotion failure from post-promotion health regression." }
16
+ ]
17
+ },
18
+ "lanes": [
19
+ { "id": "main", "label": "Release phases" },
20
+ { "id": "waiting", "label": "Approval + health wait" },
21
+ { "id": "recovery", "label": "Rollback controller" },
22
+ { "id": "terminal", "label": "Terminal exits" }
23
+ ],
24
+ "states": [
25
+ { "id": "queued", "type": "start", "label": "Queued", "sublabel": "change accepted", "lane": "main", "col": 0, "step": "01", "tag": "pending" },
26
+ { "id": "building", "type": "active", "label": "Building", "sublabel": "immutable image", "lane": "main", "col": 1, "step": "02", "tag": "running" },
27
+ { "id": "verifying", "type": "decision", "label": "Verifying", "sublabel": "tests + policy", "lane": "main", "col": 2, "step": "03", "tag": "gate" },
28
+ { "id": "ready", "type": "waiting", "label": "Ready", "sublabel": "promotion pending", "lane": "main", "col": 3, "step": "04", "tag": "approved" },
29
+ { "id": "live", "type": "success", "label": "Live", "sublabel": "production healthy", "lane": "main", "col": 4, "step": "05", "tag": "success" },
30
+ { "id": "approval", "type": "waiting", "label": "Needs Approval", "sublabel": "release owner", "lane": "waiting", "col": 0, "tag": "pause" },
31
+ { "id": "rollback", "type": "active", "label": "Rolling Back", "sublabel": "last good image", "lane": "recovery", "col": 1, "tag": "automatic" },
32
+ { "id": "paused", "type": "waiting", "label": "Health Paused", "sublabel": "SLO regression", "lane": "waiting", "col": 2, "tag": "observe" },
33
+ { "id": "cancelled", "type": "failure", "label": "Cancelled", "sublabel": "approval denied", "lane": "terminal", "col": 0, "tag": "terminal" },
34
+ { "id": "failed", "type": "failure", "label": "Failed", "sublabel": "rollback failed", "lane": "terminal", "col": 1, "tag": "terminal" },
35
+ { "id": "rolled_back", "type": "success", "label": "Rolled Back", "sublabel": "service restored", "lane": "terminal", "col": 2, "tag": "terminal" }
36
+ ],
37
+ "transitions": [
38
+ { "from": "verifying", "to": "approval", "variant": "security", "route": "straight", "fromSide": "bottom", "toSide": "top" },
39
+ { "from": "approval", "to": "cancelled", "variant": "security", "route": "straight", "fromSide": "bottom", "toSide": "top" },
40
+ { "from": "ready", "to": "rollback", "variant": "security", "route": "straight", "fromSide": "bottom", "toSide": "top" },
41
+ { "from": "rollback", "to": "failed", "variant": "security", "route": "straight", "fromSide": "bottom", "toSide": "top" },
42
+ { "from": "live", "to": "paused", "variant": "dashed", "route": "straight", "fromSide": "bottom", "toSide": "top" },
43
+ { "from": "paused", "to": "rolled_back", "variant": "emphasis", "route": "straight", "fromSide": "bottom", "toSide": "top" }
44
+ ],
45
+ "cards": [
46
+ { "dot": "cyan", "title": "Promotion Rail", "items": ["The release object moves through five ordered phases", "Verification and approval remain distinct states", "Live means production health is currently proven"] },
47
+ { "dot": "amber", "title": "Wait States", "items": ["Human approval can pause without consuming a worker", "A health regression pauses further rollout", "Every wait exposes the event required to continue"] },
48
+ { "dot": "rose", "title": "Explicit Endings", "items": ["Denied approval ends as Cancelled", "Rollback controller failure ends as Failed", "Successful rollback is a terminal restored outcome"] }
49
+ ]
50
+ }
@@ -0,0 +1,58 @@
1
+ {
2
+ "schema_version": 1,
3
+ "diagram_type": "dataflow",
4
+ "meta": {
5
+ "title": "Order Event-stream Topology",
6
+ "subtitle": "Named events, ordered topics, processors, consumer groups, state, replay, and dead letters",
7
+ "output": "examples/event-stream.html",
8
+ "viewBox": [1080, 780],
9
+ "animation": "trace",
10
+ "visual_preset": "signal-flow",
11
+ "quality_profile": "showcase",
12
+ "views": [
13
+ { "id": "order-transit", "label": "Order event transit", "focus": ["checkout", "orders", "validate", "state", "fulfillment"], "note": "Follow an order from producer through ordered processing to fulfillment." },
14
+ { "id": "payment-transit", "label": "Payment event transit", "focus": ["billing", "payments", "enrich", "state", "analytics"], "note": "Track payment facts into the shared materialized state and analytics." },
15
+ { "id": "failure-and-replay", "label": "Failure and replay", "focus": ["validate", "enrich", "dlq", "replay", "ops"], "note": "Isolate dead letters, operator review, and controlled replay ownership." }
16
+ ]
17
+ },
18
+ "stages": [
19
+ { "label": "Producers" },
20
+ { "label": "Transit" },
21
+ { "label": "Processors" },
22
+ { "label": "State + recovery" },
23
+ { "label": "Consumers" }
24
+ ],
25
+ "nodes": [
26
+ { "id": "checkout", "type": "frontend", "label": "Checkout API", "sublabel": "order producer", "stage": 0, "row": 0, "tag": "team commerce" },
27
+ { "id": "billing", "type": "backend", "label": "Billing API", "sublabel": "payment producer", "stage": 0, "row": 2, "tag": "team money" },
28
+ { "id": "orders", "type": "messagebus", "label": "orders.v1", "sublabel": "12 partitions", "stage": 1, "row": 0, "tag": "key: order_id" },
29
+ { "id": "payments", "type": "messagebus", "label": "payments.v2", "sublabel": "8 partitions", "stage": 1, "row": 2, "tag": "key: order_id" },
30
+ { "id": "validate", "type": "backend", "label": "Order Validate", "sublabel": "group fulfillment", "stage": 2, "row": 0, "tag": "ordered" },
31
+ { "id": "enrich", "type": "backend", "label": "Payment Enrich", "sublabel": "group analytics", "stage": 2, "row": 2, "tag": "at-least-once" },
32
+ { "id": "state", "type": "database", "label": "Order State", "sublabel": "materialized view", "stage": 3, "row": 1, "tag": "idempotent" },
33
+ { "id": "dlq", "type": "messagebus", "label": "events.dlq", "sublabel": "poison events", "stage": 3, "row": 4, "tag": "7-day retention" },
34
+ { "id": "fulfillment", "type": "backend", "label": "Fulfillment", "sublabel": "shipping workflow", "stage": 4, "row": 0, "tag": "consumer" },
35
+ { "id": "analytics", "type": "database", "label": "Analytics", "sublabel": "streaming facts", "stage": 4, "row": 2, "tag": "consumer" },
36
+ { "id": "replay", "type": "security", "label": "Replay Tool", "sublabel": "approved batch", "stage": 4, "row": 4, "tag": "operator gate" },
37
+ { "id": "ops", "type": "external", "label": "On-call", "sublabel": "DLQ owner", "stage": 4, "row": 3, "yOffset": -18, "tag": "SRE" }
38
+ ],
39
+ "flows": [
40
+ { "from": "checkout", "to": "orders", "label": "OrderPlaced", "classification": "schema v1", "variant": "emphasis", "route": "straight" },
41
+ { "from": "billing", "to": "payments", "label": "PaymentCaptured", "classification": "schema v2", "variant": "emphasis", "route": "straight" },
42
+ { "from": "orders", "to": "validate", "label": "ordered orders", "classification": "consumer group", "variant": "emphasis", "route": "straight" },
43
+ { "from": "payments", "to": "enrich", "label": "payment facts", "classification": "at-least-once", "variant": "emphasis", "route": "straight" },
44
+ { "from": "validate", "to": "state", "label": "valid order", "classification": "idempotent", "variant": "emphasis", "route": "vertical-channel" },
45
+ { "from": "enrich", "to": "state", "label": "enriched payment", "classification": "idempotent", "variant": "default", "route": "vertical-channel" },
46
+ { "from": "state", "to": "fulfillment", "label": "ready orders", "classification": "read model", "variant": "emphasis", "route": "vertical-channel" },
47
+ { "from": "state", "to": "analytics", "label": "order facts", "classification": "non-PII", "variant": "default", "route": "vertical-channel" },
48
+ { "from": "validate", "to": "dlq", "label": "invalid event", "classification": "dead letter", "variant": "security", "fromSide": "top", "toSide": "top", "via": [[530, 80], [20, 80], [20, 550], [745, 550]], "labelAt": [300, 550] },
49
+ { "from": "enrich", "to": "dlq", "label": "poison event", "classification": "dead letter", "variant": "security", "route": "bottom-channel", "labelDy": 30 },
50
+ { "from": "dlq", "to": "ops", "label": "failure sample", "classification": "restricted", "variant": "security", "route": "vertical-channel" },
51
+ { "from": "dlq", "to": "replay", "label": "approved replay", "classification": "audited batch", "variant": "dashed", "route": "straight", "labelDy": 30 }
52
+ ],
53
+ "cards": [
54
+ { "dot": "amber", "title": "Transit Contract", "items": ["Every event and topic is named", "Partition keys preserve per-order ordering", "Consumer groups expose processing ownership"] },
55
+ { "dot": "emerald", "title": "State + Delivery", "items": ["Processors write an idempotent materialized view", "Fulfillment and analytics consume distinct assets", "At-least-once delivery never implies duplicate business effects"] },
56
+ { "dot": "rose", "title": "Failure Ownership", "items": ["Poison events land in a retained dead-letter topic", "On-call inspects samples before replay", "Replay is gated, batched, and auditable"] }
57
+ ]
58
+ }
@@ -0,0 +1,65 @@
1
+ {
2
+ "schema_version": 1,
3
+ "diagram_type": "workflow",
4
+ "meta": {
5
+ "title": "Incident Response Runbook",
6
+ "subtitle": "Detection, triage, mitigation, communication, escalation, and recovery proof",
7
+ "output": "examples/incident-response.html",
8
+ "animation": "trace",
9
+ "visual_preset": "signal-flow",
10
+ "quality_profile": "showcase",
11
+ "views": [
12
+ { "id": "detect-and-triage", "label": "Detect and establish command", "focus": ["alert", "page", "triage", "declare"], "note": "Follow the first minutes from signal to an owned incident." },
13
+ { "id": "mitigate-and-verify", "label": "Mitigate and prove recovery", "focus": ["triage", "contain", "recover", "verify", "close"], "note": "Keep mitigation separate from the evidence required to close." },
14
+ { "id": "escalate-and-communicate", "label": "Escalation and communication", "focus": ["declare", "escalate", "update", "rollback"], "note": "See who is paged, what stakeholders hear, and when rollback begins." }
15
+ ]
16
+ },
17
+ "lanes": [
18
+ { "id": "signals", "label": "Signals" },
19
+ { "id": "responders", "label": "Incident Command" },
20
+ { "id": "mitigation", "label": "Service Mitigation" },
21
+ { "id": "recovery", "label": "Recovery Evidence" },
22
+ { "id": "communication", "label": "Stakeholder Communication" },
23
+ { "id": "exceptions", "label": "Escalation + Rollback", "variant": "exception" }
24
+ ],
25
+ "phases": [
26
+ { "id": "detect", "label": "Detect", "fromCol": 0, "toCol": 1 },
27
+ { "id": "respond", "label": "Triage + mitigate", "fromCol": 2, "toCol": 3, "variant": "emphasis" },
28
+ { "id": "recover", "label": "Verify + close", "fromCol": 4, "toCol": 5, "variant": "dashed" }
29
+ ],
30
+ "groups": [
31
+ { "id": "command", "label": "Incident command", "lane": "responders", "fromCol": 1, "toCol": 3, "variant": "emphasis" },
32
+ { "id": "exception_actions", "label": "If impact persists", "lane": "exceptions", "fromCol": 3, "toCol": 5, "variant": "security" }
33
+ ],
34
+ "mainPath": ["alert", "page", "triage", "contain", "recover", "verify", "close"],
35
+ "nodes": [
36
+ { "id": "alert", "lane": "signals", "col": 0, "type": "messagebus", "label": "SLO Alert", "sublabel": "burn rate" },
37
+ { "id": "page", "lane": "responders", "col": 1, "width": 76, "type": "external", "label": "Page On-call", "sublabel": "acknowledge" },
38
+ { "id": "triage", "lane": "responders", "col": 2, "width": 64, "type": "backend", "label": "Triage", "sublabel": "scope impact" },
39
+ { "id": "declare", "lane": "responders", "col": 3, "type": "security", "label": "Declare", "sublabel": "assign commander", "tag": "SEV-1/2" },
40
+ { "id": "contain", "lane": "mitigation", "col": 3, "width": 72, "type": "backend", "label": "Contain", "sublabel": "stop growth" },
41
+ { "id": "recover", "lane": "mitigation", "col": 4, "width": 52, "type": "cloud", "label": "Recover", "sublabel": "restore" },
42
+ { "id": "verify", "lane": "recovery", "col": 5, "type": "database", "label": "Verify", "sublabel": "SLO + traces", "tag": "15 min stable" },
43
+ { "id": "close", "lane": "communication", "col": 5, "type": "external", "label": "Resolve", "sublabel": "final update" },
44
+ { "id": "update", "lane": "communication", "col": 3, "type": "frontend", "label": "Status Update", "sublabel": "impact + ETA" },
45
+ { "id": "escalate", "lane": "exceptions", "col": 3, "width": 72, "type": "security", "label": "Escalate", "sublabel": "specialist" },
46
+ { "id": "rollback", "lane": "exceptions", "col": 5, "type": "messagebus", "label": "Rollback", "sublabel": "last good" }
47
+ ],
48
+ "edges": [
49
+ { "from": "alert", "to": "page", "label": "page", "variant": "emphasis", "route": "drop", "fromSide": "bottom", "toSide": "top" },
50
+ { "from": "page", "to": "triage", "route": "bottom-channel", "fromSide": "bottom", "toSide": "bottom" },
51
+ { "from": "triage", "to": "contain", "variant": "emphasis", "route": "drop", "fromSide": "bottom", "toSide": "top" },
52
+ { "from": "contain", "to": "recover", "route": "bottom-channel", "fromSide": "bottom", "toSide": "bottom" },
53
+ { "from": "recover", "to": "verify", "variant": "emphasis", "route": "drop", "fromSide": "bottom", "toSide": "top" },
54
+ { "from": "verify", "to": "close", "variant": "emphasis", "route": "drop", "fromSide": "bottom", "toSide": "top" },
55
+ { "from": "triage", "to": "declare", "variant": "security" },
56
+ { "from": "declare", "to": "update", "variant": "dashed", "fromSide": "top", "toSide": "left", "via": [[430, 16], [20, 16], [20, 615]] },
57
+ { "from": "update", "to": "escalate", "variant": "security", "route": "drop", "fromSide": "bottom", "toSide": "top" },
58
+ { "from": "verify", "to": "rollback", "variant": "security", "role": "error", "route": "outside-right", "fromSide": "right", "toSide": "right" }
59
+ ],
60
+ "cards": [
61
+ { "dot": "rose", "title": "Ownership First", "items": ["A page is not an incident until someone owns command", "Severity and scope are explicit before mitigation spreads", "Escalation names the missing expertise"] },
62
+ { "dot": "emerald", "title": "Recovery Is Evidence", "items": ["Mitigation can reduce impact without proving recovery", "SLOs and traces must stay healthy for a fixed window", "The final update follows verification, not optimism"] },
63
+ { "dot": "cyan", "title": "Communication Contract", "items": ["Stakeholders receive impact, action, and next update time", "Rollback remains visible as a deliberate response", "Every branch has an owner and observable exit"] }
64
+ ]
65
+ }