Turn any idea, plan, or codebase into a beautiful interactive diagram. An agent skill for Claude Code, Codex, and more.
HTML agent-skillsai-agentsarchitecture-diagramclaude-codeclaude-skillscodexcoding-agentsdeepseek-harnessdeveloper-toolsdiagramsdiagrams-as-codedsh-pluginflowchartllmmermaidopencodesequence-diagramsoftware-architecturesystem-designvisualization
Refine lifecycle diagram state model
tt-a1i39c959de93b1
diff --git a/archify.zip b/archify.zipindex 6c174b6b..ba9e56fa 100644Binary files a/archify.zip and b/archify.zip differdiff --git a/archify/examples/agent-run.lifecycle.json b/archify/examples/agent-run.lifecycle.jsonindex 99390015..9ddac295 100644--- a/archify/examples/agent-run.lifecycle.json+++ b/archify/examples/agent-run.lifecycle.json@@ -5,46 +5,47 @@"title": "Agent Run Lifecycle","subtitle": "State machine for planning, tool execution, human approval, retries, and terminal outcomes","output": "examples/lifecycle-agent-run.html",- "viewBox": [980, 500]+ "viewBox": [980, 530]},"lanes": [- { "id": "main", "label": "Main lifecycle" },- { "id": "waiting", "label": "Wait states" },- { "id": "exceptions", "label": "Exceptions + recovery" }+ { "id": "main", "label": "Active lifecycle" },+ { "id": "waiting", "label": "Suspended states" },+ { "id": "exceptions", "label": "Recovery loop" },+ { "id": "terminal", "label": "Terminal outcomes" }],"states": [{ "id": "queued", "type": "start", "label": "Queued", "sublabel": "request accepted", "lane": "main", "col": 0, "tag": "entry" },{ "id": "planning", "type": "active", "label": "Planning", "sublabel": "build task graph", "lane": "main", "col": 1, "tag": "model" },{ "id": "executing", "type": "active", "label": "Executing", "sublabel": "tool calls", "lane": "main", "col": 2, "tag": "work" },{ "id": "reviewing", "type": "decision", "label": "Reviewing", "sublabel": "quality gate", "lane": "main", "col": 3, "tag": "check" },- { "id": "completed", "type": "success", "label": "Completed", "sublabel": "final response", "lane": "main", "col": 5, "tag": "terminal" },{ "id": "approval", "type": "waiting", "label": "Needs Approval", "sublabel": "human gate", "lane": "waiting", "col": 3, "tag": "pause" },{ "id": "blocked", "type": "waiting", "label": "Blocked", "sublabel": "missing input", "lane": "waiting", "col": 4, "tag": "wait" },{ "id": "failed", "type": "failure", "label": "Failed", "sublabel": "recoverable error", "lane": "exceptions", "col": 2, "tag": "retryable" },- { "id": "cancelled", "type": "failure", "label": "Cancelled", "sublabel": "user stopped", "lane": "exceptions", "col": 3, "tag": "terminal" },- { "id": "expired", "type": "failure", "label": "Expired", "sublabel": "timeout", "lane": "exceptions", "col": 4, "tag": "terminal" }+ { "id": "completed", "type": "success", "label": "Completed", "sublabel": "final response", "lane": "terminal", "col": 5, "tag": "success" },+ { "id": "cancelled", "type": "failure", "label": "Cancelled", "sublabel": "user stopped", "lane": "terminal", "col": 3, "tag": "terminal" },+ { "id": "expired", "type": "failure", "label": "Expired", "sublabel": "timeout", "lane": "terminal", "col": 4, "tag": "terminal" }],"transitions": [{ "from": "queued", "to": "planning", "variant": "emphasis", "route": "straight" },{ "from": "planning", "to": "executing", "variant": "emphasis", "route": "straight" },{ "from": "executing", "to": "reviewing", "variant": "emphasis", "route": "straight" },- { "from": "reviewing", "to": "completed", "variant": "emphasis", "route": "straight" },- { "from": "executing", "to": "approval", "label": "approval required", "note": "policy gate", "variant": "security", "fromSide": "bottom", "toSide": "left", "via": [[396, 196], [490, 196]], "labelAt": [442, 186] },- { "from": "approval", "to": "reviewing", "label": "approved", "variant": "dashed", "fromSide": "top", "toSide": "bottom", "route": "straight", "labelAt": [578, 202] },- { "from": "reviewing", "to": "blocked", "label": "needs input", "variant": "default", "route": "drop", "labelAt": [618, 180] },- { "from": "executing", "to": "failed", "label": "tool error", "variant": "security", "fromSide": "bottom", "toSide": "top", "route": "straight", "labelAt": [426, 290] },- { "from": "failed", "to": "planning", "label": "retry", "note": "bounded", "variant": "dashed", "fromSide": "left", "toSide": "bottom", "route": "left-channel", "channelX": 236, "labelAt": [236, 382] },- { "from": "blocked", "to": "expired", "label": "timeout", "variant": "security", "fromSide": "bottom", "toSide": "top", "route": "straight", "labelAt": [728, 318] },- { "from": "approval", "to": "cancelled", "label": "cancel", "variant": "security", "fromSide": "bottom", "toSide": "top", "route": "straight", "labelAt": [578, 318] }+ { "from": "reviewing", "to": "completed", "label": "success", "variant": "emphasis", "fromSide": "right", "toSide": "top", "via": [[846, 99], [846, 371]], "labelAt": [846, 220] },+ { "from": "executing", "to": "approval", "label": "approval required", "note": "policy gate", "variant": "security", "fromSide": "bottom", "toSide": "left", "via": [[396, 180], [490, 180]], "labelAt": [442, 170] },+ { "from": "approval", "to": "reviewing", "variant": "dashed", "fromSide": "top", "toSide": "bottom", "route": "straight" },+ { "from": "reviewing", "to": "blocked", "label": "needs input", "variant": "default", "route": "drop", "labelAt": [618, 164] },+ { "from": "executing", "to": "failed", "label": "tool error", "variant": "security", "fromSide": "bottom", "toSide": "top", "route": "straight", "labelAt": [426, 258] },+ { "from": "failed", "to": "planning", "label": "retry", "note": "bounded", "variant": "dashed", "fromSide": "left", "toSide": "bottom", "route": "left-channel", "channelX": 236, "labelAt": [236, 326] },+ { "from": "blocked", "to": "expired", "label": "timeout", "variant": "security", "fromSide": "bottom", "toSide": "top", "route": "straight", "labelAt": [728, 340] },+ { "from": "approval", "to": "cancelled", "label": "cancel", "variant": "security", "fromSide": "bottom", "toSide": "top", "route": "straight", "labelAt": [578, 340] }],"cards": [{"dot": "emerald","title": "Main Path","items": [- "Main states are Queued, Planning, Executing, Reviewing, and Completed",- "The hot path stays in one lane and reads left to right",- "Completed is the only success terminal state"+ "Queued, Planning, Executing, and Reviewing are active run states",+ "A clean run reads left to right before exiting to an outcome",+ "A successful review exits into the terminal outcome lane"]},{@@ -60,9 +61,9 @@"dot": "rose","title": "Terminal + Recovery","items": [- "Failed is recoverable while retry budget remains",- "Cancelled and Expired are terminal failure states",- "Error transitions are separated from the happy path"+ "Failed loops back while retry budget remains",+ "Completed, Cancelled, and Expired are visually grouped as outcomes",+ "Terminal states do not point back into active execution"]}]diff --git a/archify/renderers/lifecycle/README.md b/archify/renderers/lifecycle/README.mdindex 162d5fb9..c0e294ce 100644--- a/archify/renderers/lifecycle/README.md+++ b/archify/renderers/lifecycle/README.md@@ -38,10 +38,11 @@ archify/schemas/lifecycle.schema.json## Design Rules-- Use lanes for lifecycle layers: main path, wait states, exception/recovery- paths, terminal states.+- Use lanes for lifecycle layers: active run states, suspended states,+ recovery loops, and terminal outcomes.- Place states with lane IDs and column indexes.-- Keep the happy path left-to-right in one lane when possible.+- Keep the active path left-to-right, then exit into a distinct terminal+ outcome when the lifecycle ends.- Use `success` for terminal success, `failure` for failure/terminal error,`waiting` for pauses, and `decision` for gates.- Use `emphasis` for the main transition path.diff --git a/archify/renderers/lifecycle/render-lifecycle.mjs b/archify/renderers/lifecycle/render-lifecycle.mjsindex 4c791575..e22f9aaf 100644--- a/archify/renderers/lifecycle/render-lifecycle.mjs+++ b/archify/renderers/lifecycle/render-lifecycle.mjs@@ -16,12 +16,12 @@ const layout = {laneX: 32,laneY: 44,laneW: 914,- laneGap: 14,+ laneGap: 10,laneTitleH: 20,- laneH: 112,+ laneH: 92,colXs: [96, 246, 396, 546, 696, 846],nodeW: 112,- nodeH: 56+ nodeH: 54};const typeClass = {diff --git a/examples/images/archify-lifecycle.png b/examples/images/archify-lifecycle.pngindex f9058560..4139ed47 100644Binary files a/examples/images/archify-lifecycle.png and b/examples/images/archify-lifecycle.png differdiff --git a/examples/lifecycle-agent-run.html b/examples/lifecycle-agent-run.htmlindex 5bbcec50..b0e8eac6 100644--- a/examples/lifecycle-agent-run.html+++ b/examples/lifecycle-agent-run.html@@ -448,7 +448,7 @@<!-- Main Diagram --><div class="diagram-container">- <svg viewBox="0 0 980 500">+ <svg viewBox="0 0 980 530"><!-- Definitions --><defs><marker id="arrowhead" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">@@ -473,122 +473,125 @@<!-- Lifecycle lanes --><path d="M 32 64 L 946 64" class="a-default" stroke-width="0.8" stroke-dasharray="3,8"/>- <text x="32" y="58" class="t-dim" font-size="10" font-weight="600">01 / Main lifecycle</text>+ <text x="32" y="58" class="t-dim" font-size="10" font-weight="600">01 / Active lifecycle</text>- <path d="M 32 190 L 946 190" class="a-default" stroke-width="0.8" stroke-dasharray="3,8"/>- <text x="32" y="184" class="t-dim" font-size="10" font-weight="600">02 / Wait states</text>+ <path d="M 32 166 L 946 166" class="a-default" stroke-width="0.8" stroke-dasharray="3,8"/>+ <text x="32" y="160" class="t-dim" font-size="10" font-weight="600">02 / Suspended states</text>- <path d="M 32 316 L 946 316" class="a-default" stroke-width="0.8" stroke-dasharray="3,8"/>- <text x="32" y="310" class="t-dim" font-size="10" font-weight="600">03 / Exceptions + recovery</text>+ <path d="M 32 268 L 946 268" class="a-default" stroke-width="0.8" stroke-dasharray="3,8"/>+ <text x="32" y="262" class="t-dim" font-size="10" font-weight="600">03 / Recovery loop</text>++ <path d="M 32 370 L 946 370" class="a-default" stroke-width="0.8" stroke-dasharray="3,8"/>+ <text x="32" y="364" class="t-dim" font-size="10" font-weight="600">04 / Terminal outcomes</text><!-- Transition paths -->- <path d="M 152 110 L 190 110" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>- <path d="M 302 110 L 340 110" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>- <path d="M 452 110 L 490 110" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>- <path d="M 602 110 L 790 110" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>- <path d="M 396 138 L 396 196 L 490 196 L 490 236" class="a-security" stroke-width="1.4" marker-end="url(#arrowhead-security)"/>- <path d="M 546 208 L 546 138" class="a-dashed" stroke-width="1.4" marker-end="url(#arrowhead-dashed)"/>- <path d="M 602 110 L 602 163 L 640 163 L 640 236" class="a-default" stroke-width="1.4" marker-end="url(#arrowhead)"/>- <path d="M 396 138 L 396 334" class="a-security" stroke-width="1.4" marker-end="url(#arrowhead-security)"/>- <path d="M 340 362 L 236 362 L 236 138 L 246 138" class="a-dashed" stroke-width="1.4" marker-end="url(#arrowhead-dashed)"/>- <path d="M 696 264 L 696 334" class="a-security" stroke-width="1.4" marker-end="url(#arrowhead-security)"/>- <path d="M 546 264 L 546 334" class="a-security" stroke-width="1.4" marker-end="url(#arrowhead-security)"/>+ <path d="M 152 100 L 190 100" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>+ <path d="M 302 100 L 340 100" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>+ <path d="M 452 100 L 490 100" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>+ <path d="M 602 100 L 846 99 L 846 371 L 846 379" class="a-emphasis" stroke-width="1.8" marker-end="url(#arrowhead-emphasis)"/>+ <path d="M 396 127 L 396 180 L 490 180 L 490 202" class="a-security" stroke-width="1.4" marker-end="url(#arrowhead-security)"/>+ <path d="M 546 175 L 546 127" class="a-dashed" stroke-width="1.4" marker-end="url(#arrowhead-dashed)"/>+ <path d="M 602 100 L 602 141 L 640 141 L 640 202" class="a-default" stroke-width="1.4" marker-end="url(#arrowhead)"/>+ <path d="M 396 127 L 396 277" class="a-security" stroke-width="1.4" marker-end="url(#arrowhead-security)"/>+ <path d="M 340 304 L 236 304 L 236 127 L 246 127" class="a-dashed" stroke-width="1.4" marker-end="url(#arrowhead-dashed)"/>+ <path d="M 696 229 L 696 379" class="a-security" stroke-width="1.4" marker-end="url(#arrowhead-security)"/>+ <path d="M 546 229 L 546 379" class="a-security" stroke-width="1.4" marker-end="url(#arrowhead-security)"/><!-- States -->- <rect x="40" y="82" width="112" height="56" rx="6" class="c-mask"/>- <rect x="40" y="82" width="112" height="56" rx="6" class="c-frontend" stroke-width="1.5"/>- <text x="96" y="103" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Queued</text>- <text x="96" y="119" class="t-muted" font-size="7" text-anchor="middle">request accepted</text>- <text x="96" y="127" class="t-frontend" font-size="7" text-anchor="middle">entry</text>-- <rect x="190" y="82" width="112" height="56" rx="6" class="c-mask"/>- <rect x="190" y="82" width="112" height="56" rx="6" class="c-backend" stroke-width="1.5"/>- <text x="246" y="103" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Planning</text>- <text x="246" y="119" class="t-muted" font-size="7" text-anchor="middle">build task graph</text>- <text x="246" y="127" class="t-backend" font-size="7" text-anchor="middle">model</text>-- <rect x="340" y="82" width="112" height="56" rx="6" class="c-mask"/>- <rect x="340" y="82" width="112" height="56" rx="6" class="c-backend" stroke-width="1.5"/>- <text x="396" y="103" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Executing</text>- <text x="396" y="119" class="t-muted" font-size="7" text-anchor="middle">tool calls</text>- <text x="396" y="127" class="t-backend" font-size="7" text-anchor="middle">work</text>-- <rect x="490" y="82" width="112" height="56" rx="6" class="c-mask"/>- <rect x="490" y="82" width="112" height="56" rx="6" class="c-security" stroke-width="1.5"/>- <text x="546" y="103" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Reviewing</text>- <text x="546" y="119" class="t-muted" font-size="7" text-anchor="middle">quality gate</text>- <text x="546" y="127" class="t-security" font-size="7" text-anchor="middle">check</text>-- <rect x="790" y="82" width="112" height="56" rx="6" class="c-mask"/>- <rect x="790" y="82" width="112" height="56" rx="6" class="c-database" stroke-width="1.5"/>- <text x="846" y="103" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Completed</text>- <text x="846" y="119" class="t-muted" font-size="7" text-anchor="middle">final response</text>- <text x="846" y="127" class="t-database" font-size="7" text-anchor="middle">terminal</text>-- <rect x="490" y="208" width="112" height="56" rx="6" class="c-mask"/>- <rect x="490" y="208" width="112" height="56" rx="6" class="c-cloud" stroke-width="1.5"/>- <text x="546" y="229" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Needs Approval</text>- <text x="546" y="245" class="t-muted" font-size="7" text-anchor="middle">human gate</text>- <text x="546" y="253" class="t-cloud" font-size="7" text-anchor="middle">pause</text>-- <rect x="640" y="208" width="112" height="56" rx="6" class="c-mask"/>- <rect x="640" y="208" width="112" height="56" rx="6" class="c-cloud" stroke-width="1.5"/>- <text x="696" y="229" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Blocked</text>- <text x="696" y="245" class="t-muted" font-size="7" text-anchor="middle">missing input</text>- <text x="696" y="253" class="t-cloud" font-size="7" text-anchor="middle">wait</text>-- <rect x="340" y="334" width="112" height="56" rx="6" class="c-mask"/>- <rect x="340" y="334" width="112" height="56" rx="6" class="c-security" stroke-width="1.5"/>- <text x="396" y="355" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Failed</text>- <text x="396" y="371" class="t-muted" font-size="7" text-anchor="middle">recoverable error</text>- <text x="396" y="379" class="t-security" font-size="7" text-anchor="middle">retryable</text>-- <rect x="490" y="334" width="112" height="56" rx="6" class="c-mask"/>- <rect x="490" y="334" width="112" height="56" rx="6" class="c-security" stroke-width="1.5"/>- <text x="546" y="355" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Cancelled</text>- <text x="546" y="371" class="t-muted" font-size="7" text-anchor="middle">user stopped</text>- <text x="546" y="379" class="t-security" font-size="7" text-anchor="middle">terminal</text>-- <rect x="640" y="334" width="112" height="56" rx="6" class="c-mask"/>- <rect x="640" y="334" width="112" height="56" rx="6" class="c-security" stroke-width="1.5"/>- <text x="696" y="355" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Expired</text>- <text x="696" y="371" class="t-muted" font-size="7" text-anchor="middle">timeout</text>- <text x="696" y="379" class="t-security" font-size="7" text-anchor="middle">terminal</text>+ <rect x="40" y="73" width="112" height="54" rx="6" class="c-mask"/>+ <rect x="40" y="73" width="112" height="54" rx="6" class="c-frontend" stroke-width="1.5"/>+ <text x="96" y="94" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Queued</text>+ <text x="96" y="110" class="t-muted" font-size="7" text-anchor="middle">request accepted</text>+ <text x="96" y="116" class="t-frontend" font-size="7" text-anchor="middle">entry</text>++ <rect x="190" y="73" width="112" height="54" rx="6" class="c-mask"/>+ <rect x="190" y="73" width="112" height="54" rx="6" class="c-backend" stroke-width="1.5"/>+ <text x="246" y="94" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Planning</text>+ <text x="246" y="110" class="t-muted" font-size="7" text-anchor="middle">build task graph</text>+ <text x="246" y="116" class="t-backend" font-size="7" text-anchor="middle">model</text>++ <rect x="340" y="73" width="112" height="54" rx="6" class="c-mask"/>+ <rect x="340" y="73" width="112" height="54" rx="6" class="c-backend" stroke-width="1.5"/>+ <text x="396" y="94" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Executing</text>+ <text x="396" y="110" class="t-muted" font-size="7" text-anchor="middle">tool calls</text>+ <text x="396" y="116" class="t-backend" font-size="7" text-anchor="middle">work</text>++ <rect x="490" y="73" width="112" height="54" rx="6" class="c-mask"/>+ <rect x="490" y="73" width="112" height="54" rx="6" class="c-security" stroke-width="1.5"/>+ <text x="546" y="94" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Reviewing</text>+ <text x="546" y="110" class="t-muted" font-size="7" text-anchor="middle">quality gate</text>+ <text x="546" y="116" class="t-security" font-size="7" text-anchor="middle">check</text>++ <rect x="490" y="175" width="112" height="54" rx="6" class="c-mask"/>+ <rect x="490" y="175" width="112" height="54" rx="6" class="c-cloud" stroke-width="1.5"/>+ <text x="546" y="196" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Needs Approval</text>+ <text x="546" y="212" class="t-muted" font-size="7" text-anchor="middle">human gate</text>+ <text x="546" y="218" class="t-cloud" font-size="7" text-anchor="middle">pause</text>++ <rect x="640" y="175" width="112" height="54" rx="6" class="c-mask"/>+ <rect x="640" y="175" width="112" height="54" rx="6" class="c-cloud" stroke-width="1.5"/>+ <text x="696" y="196" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Blocked</text>+ <text x="696" y="212" class="t-muted" font-size="7" text-anchor="middle">missing input</text>+ <text x="696" y="218" class="t-cloud" font-size="7" text-anchor="middle">wait</text>++ <rect x="340" y="277" width="112" height="54" rx="6" class="c-mask"/>+ <rect x="340" y="277" width="112" height="54" rx="6" class="c-security" stroke-width="1.5"/>+ <text x="396" y="298" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Failed</text>+ <text x="396" y="314" class="t-muted" font-size="7" text-anchor="middle">recoverable error</text>+ <text x="396" y="320" class="t-security" font-size="7" text-anchor="middle">retryable</text>++ <rect x="790" y="379" width="112" height="54" rx="6" class="c-mask"/>+ <rect x="790" y="379" width="112" height="54" rx="6" class="c-database" stroke-width="1.5"/>+ <text x="846" y="400" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Completed</text>+ <text x="846" y="416" class="t-muted" font-size="7" text-anchor="middle">final response</text>+ <text x="846" y="422" class="t-database" font-size="7" text-anchor="middle">success</text>++ <rect x="490" y="379" width="112" height="54" rx="6" class="c-mask"/>+ <rect x="490" y="379" width="112" height="54" rx="6" class="c-security" stroke-width="1.5"/>+ <text x="546" y="400" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Cancelled</text>+ <text x="546" y="416" class="t-muted" font-size="7" text-anchor="middle">user stopped</text>+ <text x="546" y="422" class="t-security" font-size="7" text-anchor="middle">terminal</text>++ <rect x="640" y="379" width="112" height="54" rx="6" class="c-mask"/>+ <rect x="640" y="379" width="112" height="54" rx="6" class="c-security" stroke-width="1.5"/>+ <text x="696" y="400" class="t-primary" font-size="10" font-weight="600" text-anchor="middle">Expired</text>+ <text x="696" y="416" class="t-muted" font-size="7" text-anchor="middle">timeout</text>+ <text x="696" y="422" class="t-security" font-size="7" text-anchor="middle">terminal</text><!-- Transition labels -->+ <rect x="822.85" y="209" width="46.300000000000004" height="16" rx="4" class="c-mask"/>+ <text x="846" y="220" class="t-backend" font-size="8" text-anchor="middle">success</text>+ <rect x="394.35" y="159" width="95.30000000000001" height="27" rx="4" class="c-mask"/>+ <text x="442" y="170" class="t-security" font-size="8" text-anchor="middle">approval required</text>+ <text x="442" y="181" class="t-dim" font-size="7" text-anchor="middle">policy gate</text>- <rect x="394.35" y="175" width="95.30000000000001" height="27" rx="4" class="c-mask"/>- <text x="442" y="186" class="t-security" font-size="8" text-anchor="middle">approval required</text>- <text x="442" y="197" class="t-dim" font-size="7" text-anchor="middle">policy gate</text>- <rect x="552.4" y="191" width="51.2" height="16" rx="4" class="c-mask"/>- <text x="578" y="202" class="t-messagebus" font-size="8" text-anchor="middle">approved</text>- <rect x="585.05" y="169" width="65.9" height="16" rx="4" class="c-mask"/>- <text x="618" y="180" class="t-muted" font-size="8" text-anchor="middle">needs input</text>- <rect x="395.5" y="279" width="61" height="16" rx="4" class="c-mask"/>- <text x="426" y="290" class="t-security" font-size="8" text-anchor="middle">tool error</text>- <rect x="212.85" y="371" width="46.300000000000004" height="27" rx="4" class="c-mask"/>- <text x="236" y="382" class="t-messagebus" font-size="8" text-anchor="middle">retry</text>- <text x="236" y="393" class="t-dim" font-size="7" text-anchor="middle">bounded</text>- <rect x="704.85" y="307" width="46.300000000000004" height="16" rx="4" class="c-mask"/>- <text x="728" y="318" class="t-security" font-size="8" text-anchor="middle">timeout</text>- <rect x="557.3" y="307" width="41.400000000000006" height="16" rx="4" class="c-mask"/>- <text x="578" y="318" class="t-security" font-size="8" text-anchor="middle">cancel</text>+ <rect x="585.05" y="153" width="65.9" height="16" rx="4" class="c-mask"/>+ <text x="618" y="164" class="t-muted" font-size="8" text-anchor="middle">needs input</text>+ <rect x="395.5" y="247" width="61" height="16" rx="4" class="c-mask"/>+ <text x="426" y="258" class="t-security" font-size="8" text-anchor="middle">tool error</text>+ <rect x="212.85" y="315" width="46.300000000000004" height="27" rx="4" class="c-mask"/>+ <text x="236" y="326" class="t-messagebus" font-size="8" text-anchor="middle">retry</text>+ <text x="236" y="337" class="t-dim" font-size="7" text-anchor="middle">bounded</text>+ <rect x="704.85" y="329" width="46.300000000000004" height="16" rx="4" class="c-mask"/>+ <text x="728" y="340" class="t-security" font-size="8" text-anchor="middle">timeout</text>+ <rect x="557.3" y="329" width="41.400000000000006" height="16" rx="4" class="c-mask"/>+ <text x="578" y="340" class="t-security" font-size="8" text-anchor="middle">cancel</text><!-- Legend -->- <text x="220" y="432" class="t-primary" font-size="10" font-weight="600">Legend</text>- <rect x="220" y="444" width="14" height="9" rx="2" class="c-backend" stroke-width="1"/>- <text x="240" y="452" class="t-muted" font-size="7">active state</text>- <rect x="325" y="444" width="14" height="9" rx="2" class="c-cloud" stroke-width="1"/>- <text x="345" y="452" class="t-muted" font-size="7">waiting</text>- <rect x="415" y="444" width="14" height="9" rx="2" class="c-database" stroke-width="1"/>- <text x="435" y="452" class="t-muted" font-size="7">terminal success</text>- <rect x="560" y="444" width="14" height="9" rx="2" class="c-security" stroke-width="1"/>- <text x="580" y="452" class="t-muted" font-size="7">failure / gate</text>- <path d="M 690 452 L 724 452" class="a-dashed" stroke-width="1.4" marker-end="url(#arrowhead-dashed)"/>- <text x="733" y="455" class="t-muted" font-size="7">retry / async</text>+ <text x="220" y="466" class="t-primary" font-size="10" font-weight="600">Legend</text>+ <rect x="220" y="478" width="14" height="9" rx="2" class="c-backend" stroke-width="1"/>+ <text x="240" y="486" class="t-muted" font-size="7">active state</text>+ <rect x="325" y="478" width="14" height="9" rx="2" class="c-cloud" stroke-width="1"/>+ <text x="345" y="486" class="t-muted" font-size="7">waiting</text>+ <rect x="415" y="478" width="14" height="9" rx="2" class="c-database" stroke-width="1"/>+ <text x="435" y="486" class="t-muted" font-size="7">terminal success</text>+ <rect x="560" y="478" width="14" height="9" rx="2" class="c-security" stroke-width="1"/>+ <text x="580" y="486" class="t-muted" font-size="7">failure / gate</text>+ <path d="M 690 486 L 724 486" class="a-dashed" stroke-width="1.4" marker-end="url(#arrowhead-dashed)"/>+ <text x="733" y="489" class="t-muted" font-size="7">retry / async</text></svg></div>@@ -600,9 +603,9 @@<h3>Main Path</h3></div><ul>- <li>• Main states are Queued, Planning, Executing, Reviewing, and Completed</li>- <li>• The hot path stays in one lane and reads left to right</li>- <li>• Completed is the only success terminal state</li>+ <li>• Queued, Planning, Executing, and Reviewing are active run states</li>+ <li>• A clean run reads left to right before exiting to an outcome</li>+ <li>• A successful review exits into the terminal outcome lane</li></ul></div>@@ -624,9 +627,9 @@<h3>Terminal + Recovery</h3></div><ul>- <li>• Failed is recoverable while retry budget remains</li>- <li>• Cancelled and Expired are terminal failure states</li>- <li>• Error transitions are separated from the happy path</li>+ <li>• Failed loops back while retry budget remains</li>+ <li>• Completed, Cancelled, and Expired are visually grouped as outcomes</li>+ <li>• Terminal states do not point back into active execution</li></ul></div></div>