@henryqw/pi-subagent 18.0.0 → 22.0.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.
- package/CONTEXT.md +76 -24
- package/README.md +116 -142
- package/dist/composition.d.ts +11 -0
- package/dist/composition.js +107 -0
- package/dist/direct-herdr.d.ts +17 -0
- package/dist/direct-herdr.js +219 -0
- package/dist/ephemeral.d.ts +2 -2
- package/dist/ephemeral.js +7 -7
- package/dist/git-runtime.d.ts +110 -0
- package/dist/git-runtime.js +472 -0
- package/dist/herdr-runtime.d.ts +137 -0
- package/dist/herdr-runtime.js +1228 -0
- package/dist/index.d.ts +11 -5
- package/dist/index.js +20 -16
- package/dist/integration-git.d.ts +59 -0
- package/dist/integration-git.js +484 -0
- package/dist/launch-runtime.d.ts +54 -0
- package/dist/launch-runtime.js +195 -0
- package/dist/process.d.ts +9 -0
- package/dist/process.js +11 -0
- package/dist/runner.d.ts +356 -0
- package/dist/runner.js +2710 -0
- package/dist/schema.d.ts +2234 -0
- package/dist/schema.js +1236 -0
- package/dist/store.d.ts +50 -0
- package/dist/store.js +288 -0
- package/dist/working-evidence.d.ts +25 -0
- package/dist/working-evidence.js +261 -0
- package/docs/adr/001-composable-ephemeral-execution.md +3 -3
- package/docs/delegation-routing.html +89 -0
- package/docs/delegation-routing.svg +78 -0
- package/docs/orchestration-architecture.html +238 -0
- package/docs/orchestration-architecture.svg +189 -0
- package/docs/orchestration.md +122 -331
- package/example.png +0 -0
- package/examples/roles/implementer.md +2 -3
- package/extensions/admission.ts +66 -0
- package/extensions/config.ts +51 -37
- package/extensions/isolated.ts +638 -0
- package/extensions/result-transport.ts +13 -103
- package/extensions/role-tools.ts +11 -11
- package/extensions/subagent-command.ts +167 -0
- package/extensions/subagent.ts +264 -540
- package/extensions/task-name.ts +1 -2
- package/extensions/workflow.ts +60 -96
- package/package.json +19 -11
- package/skills/pi-subagent/SKILL.md +35 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">
|
|
5
|
+
<title>Delegation routing and checked task lifecycle</title>
|
|
6
|
+
<link href="https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Geist:wght@400;500;600&family=Geist+Mono:wght@400;500;600&display=swap" rel="stylesheet">
|
|
7
|
+
<style>
|
|
8
|
+
* { box-sizing: border-box; } body { margin: 0; padding: 32px; background: #f0eee9; color: #101828; font-family: 'Geist', sans-serif; }
|
|
9
|
+
main { max-width: 1280px; margin: auto; } h1 { font: 400 28px 'Instrument Serif', serif; margin: 0 0 16px; }
|
|
10
|
+
svg { display: block; width: 100%; height: auto; }
|
|
11
|
+
</style>
|
|
12
|
+
</head>
|
|
13
|
+
<body><main><h1>Delegation routing and checked task lifecycle</h1>
|
|
14
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="720" viewBox="0 0 1280 720" role="img" aria-labelledby="delegation-routing-title delegation-routing-desc">
|
|
15
|
+
<title id="delegation-routing-title">Delegation routing and checked task lifecycle</title>
|
|
16
|
+
<desc id="delegation-routing-desc">A read-only Role runs direct in the current workspace; implementation uses an isolated checked graph. In that graph workers produce a checked candidate, Main stages and validates the combined tip, then explicitly promotes it. Interruptions retain work for recovery and revalidation.</desc>
|
|
17
|
+
<defs>
|
|
18
|
+
<marker id="routing-arrow" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto"><polygon points="0 0,8 3,0 6" fill="#4c5665"/></marker>
|
|
19
|
+
<marker id="routing-arrow-accent" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto"><polygon points="0 0,8 3,0 6" fill="#1d4ed8"/></marker>
|
|
20
|
+
<marker id="routing-arrow-link" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto"><polygon points="0 0,8 3,0 6" fill="#4c5665"/></marker>
|
|
21
|
+
</defs>
|
|
22
|
+
<rect width="1280" height="720" fill="#f0eee9"/>
|
|
23
|
+
<text x="48" y="60" fill="#6a7282" font-family="'Geist Mono',monospace" font-size="8" letter-spacing="1.5">PI SUBAGENT / ROUTING + LIFECYCLE</text>
|
|
24
|
+
<text x="48" y="99" fill="#101828" font-family="'Instrument Serif',serif" font-size="28">One explicit mode; only checked work can be promoted</text>
|
|
25
|
+
<text x="48" y="126" fill="#4c5665" font-family="'Geist',sans-serif" font-size="12">Direct work returns an observed result. Isolated changesets yield a candidate that Main must validate and promote.</text>
|
|
26
|
+
<!-- Routes and transitions are drawn before nodes. -->
|
|
27
|
+
<line x1="224" y1="212" x2="248" y2="212" stroke="#4c5665" marker-end="url(#routing-arrow)"/>
|
|
28
|
+
<path d="M336 268 V296 Q336 304 328 304 H192 Q184 304 184 312 V352" fill="none" stroke="#4c5665" marker-end="url(#routing-arrow)"/>
|
|
29
|
+
<path d="M424 212 H488 Q496 212 496 220 V352" fill="none" stroke="#1d4ed8" stroke-width="1.4" marker-end="url(#routing-arrow-accent)"/>
|
|
30
|
+
<line x1="560" y1="400" x2="624" y2="400" stroke="#4c5665" marker-end="url(#routing-arrow)"/>
|
|
31
|
+
<line x1="784" y1="400" x2="848" y2="400" stroke="#4c5665" marker-end="url(#routing-arrow)"/>
|
|
32
|
+
<line x1="1008" y1="400" x2="1072" y2="400" stroke="#1d4ed8" stroke-width="1.4" marker-end="url(#routing-arrow-accent)"/>
|
|
33
|
+
<!-- Interruption / re-entry paths use separate attach points. -->
|
|
34
|
+
<line x1="448" y1="448" x2="448" y2="512" stroke="#4c5665" stroke-dasharray="5,4" marker-end="url(#routing-arrow)"/>
|
|
35
|
+
<line x1="512" y1="512" x2="512" y2="448" stroke="#4c5665" stroke-dasharray="5,4" marker-end="url(#routing-arrow)"/>
|
|
36
|
+
<line x1="896" y1="448" x2="896" y2="512" stroke="#4c5665" stroke-dasharray="5,4" marker-end="url(#routing-arrow)"/>
|
|
37
|
+
<line x1="960" y1="512" x2="960" y2="448" stroke="#4c5665" stroke-dasharray="5,4" marker-end="url(#routing-arrow)"/>
|
|
38
|
+
<!-- Arrow labels have an 8px gap to their strokes. -->
|
|
39
|
+
<g fill="#4c5665" font-family="'Geist Mono',monospace" font-size="8" text-anchor="middle">
|
|
40
|
+
<rect x="256" y="284" width="48" height="12" rx="2" fill="#f0eee9"/><text x="280" y="293">YES</text>
|
|
41
|
+
<rect x="432" y="192" width="72" height="12" rx="2" fill="#f0eee9"/><text x="468" y="201" fill="#1d4ed8">NO / GRAPH</text>
|
|
42
|
+
<rect x="568" y="380" width="48" height="12" rx="2" fill="#f0eee9"/><text x="592" y="389">CHECK</text>
|
|
43
|
+
<rect x="792" y="380" width="48" height="12" rx="2" fill="#f0eee9"/><text x="816" y="389">STAGE</text>
|
|
44
|
+
<rect x="1016" y="380" width="48" height="12" rx="2" fill="#f0eee9"/><text x="1040" y="389" fill="#1d4ed8">VERIFY</text>
|
|
45
|
+
<rect x="384" y="472" width="56" height="12" rx="2" fill="#f0eee9"/><text x="412" y="481">PAUSE</text>
|
|
46
|
+
<rect x="520" y="472" width="56" height="12" rx="2" fill="#f0eee9"/><text x="548" y="481">RESUME</text>
|
|
47
|
+
<rect x="816" y="472" width="72" height="12" rx="2" fill="#f0eee9"/><text x="852" y="481">MAIN DRIFT</text>
|
|
48
|
+
<rect x="968" y="472" width="72" height="12" rx="2" fill="#f0eee9"/><text x="1004" y="481">RECHECK</text>
|
|
49
|
+
</g>
|
|
50
|
+
<!-- Mode selection. -->
|
|
51
|
+
<rect x="80" y="180" width="144" height="64" rx="24" fill="#ffffff" stroke="#101828"/>
|
|
52
|
+
<text x="152" y="217" text-anchor="middle" fill="#101828" font-family="'Geist',sans-serif" font-size="12" font-weight="600">Delegate task</text>
|
|
53
|
+
<polygon points="336,156 424,212 336,268 248,212" fill="#ffffff" stroke="#101828"/>
|
|
54
|
+
<text x="336" y="208" text-anchor="middle" fill="#101828" font-family="'Geist',sans-serif" font-size="12" font-weight="600">Direct</text>
|
|
55
|
+
<text x="336" y="226" text-anchor="middle" fill="#101828" font-family="'Geist',sans-serif" font-size="12" font-weight="600">eligible?</text>
|
|
56
|
+
<!-- Direct is intentionally a single terminal branch: no worktree or candidate. -->
|
|
57
|
+
<text x="80" y="336" fill="#6a7282" font-family="'Geist Mono',monospace" font-size="8" letter-spacing="1">DIRECT</text>
|
|
58
|
+
<rect x="80" y="352" width="208" height="96" rx="8" fill="#ffffff" stroke="#101828"/>
|
|
59
|
+
<text x="184" y="384" text-anchor="middle" fill="#101828" font-family="'Geist',sans-serif" font-size="12" font-weight="600">Herdr tabs</text>
|
|
60
|
+
<text x="184" y="406" text-anchor="middle" fill="#4c5665" font-family="'Geist',sans-serif" font-size="12">Current workspace</text>
|
|
61
|
+
<text x="184" y="428" text-anchor="middle" fill="#4c5665" font-family="'Geist',sans-serif" font-size="12">Observe result</text>
|
|
62
|
+
<text x="80" y="477" fill="#4c5665" font-family="'Geist',sans-serif" font-size="12">Single · parallel · chain</text>
|
|
63
|
+
<!-- Isolated changeset rail. -->
|
|
64
|
+
<text x="400" y="336" fill="#6a7282" font-family="'Geist Mono',monospace" font-size="8" letter-spacing="1">ISOLATED / CHECKED CHANGESET</text>
|
|
65
|
+
<rect x="400" y="352" width="160" height="96" rx="8" fill="#ffffff" stroke="#101828"/>
|
|
66
|
+
<text x="480" y="387" text-anchor="middle" fill="#101828" font-family="'Geist',sans-serif" font-size="12" font-weight="600">Saved + working</text>
|
|
67
|
+
<text x="480" y="411" text-anchor="middle" fill="#4c5665" font-family="'Geist',sans-serif" font-size="12">Durable ID</text>
|
|
68
|
+
<text x="480" y="429" text-anchor="middle" fill="#4c5665" font-family="'Geist',sans-serif" font-size="12">Owned worktree</text>
|
|
69
|
+
<rect x="624" y="352" width="160" height="96" rx="8" fill="#ffffff" stroke="#101828"/>
|
|
70
|
+
<text x="704" y="390" text-anchor="middle" fill="#101828" font-family="'Geist',sans-serif" font-size="12" font-weight="600">Ready candidate</text>
|
|
71
|
+
<text x="704" y="416" text-anchor="middle" fill="#4c5665" font-family="'Geist',sans-serif" font-size="12">Clean commit + checks</text>
|
|
72
|
+
<rect x="848" y="352" width="160" height="96" rx="8" fill="#ffffff" stroke="#101828"/>
|
|
73
|
+
<text x="928" y="390" text-anchor="middle" fill="#101828" font-family="'Geist',sans-serif" font-size="12" font-weight="600">Staged by Main</text>
|
|
74
|
+
<text x="928" y="416" text-anchor="middle" fill="#4c5665" font-family="'Geist',sans-serif" font-size="12">Exact candidate tip</text>
|
|
75
|
+
<rect x="1072" y="352" width="160" height="96" rx="8" fill="#1d4ed8" fill-opacity="0.08" stroke="#1d4ed8"/>
|
|
76
|
+
<text x="1152" y="390" text-anchor="middle" fill="#101828" font-family="'Geist',sans-serif" font-size="12" font-weight="600">Promoted by Main</text>
|
|
77
|
+
<text x="1152" y="416" text-anchor="middle" fill="#4c5665" font-family="'Geist',sans-serif" font-size="12">After combined checks</text>
|
|
78
|
+
<!-- Recovery states do not erase or bypass exact checks. -->
|
|
79
|
+
<text x="400" y="497" fill="#6a7282" font-family="'Geist Mono',monospace" font-size="8" letter-spacing="1">WAIT / RECOVERY</text>
|
|
80
|
+
<rect x="400" y="512" width="160" height="72" rx="8" fill="#e6e4de" stroke="#4c5665" stroke-dasharray="5,4"/>
|
|
81
|
+
<text x="480" y="541" text-anchor="middle" fill="#101828" font-family="'Geist',sans-serif" font-size="12" font-weight="600">Needs attention</text>
|
|
82
|
+
<text x="480" y="562" text-anchor="middle" fill="#4c5665" font-family="'Geist',sans-serif" font-size="12">Status / retry</text>
|
|
83
|
+
<rect x="848" y="512" width="160" height="72" rx="8" fill="#e6e4de" stroke="#4c5665" stroke-dasharray="5,4"/>
|
|
84
|
+
<text x="928" y="541" text-anchor="middle" fill="#101828" font-family="'Geist',sans-serif" font-size="12" font-weight="600">Revalidate</text>
|
|
85
|
+
<text x="928" y="562" text-anchor="middle" fill="#4c5665" font-family="'Geist',sans-serif" font-size="12">Restage if needed</text>
|
|
86
|
+
<line x1="48" y1="648" x2="1232" y2="648" stroke="#101828" stroke-opacity="0.12"/>
|
|
87
|
+
<text x="48" y="674" fill="#4c5665" font-family="'Geist Mono',monospace" font-size="8" letter-spacing="1">GUARD</text>
|
|
88
|
+
<text x="128" y="674" fill="#101828" font-family="'Geist',sans-serif" font-size="12">No fallback between modes. Failed validation retains evidence; abort requires no retained work.</text>
|
|
89
|
+
</svg></main></body></html>
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1280" height="720" viewBox="0 0 1280 720" role="img" aria-labelledby="delegation-routing-title delegation-routing-desc">
|
|
3
|
+
<title id="delegation-routing-title">Delegation routing and checked task lifecycle</title>
|
|
4
|
+
<desc id="delegation-routing-desc">A read-only Role runs direct in the current workspace; implementation uses an isolated checked graph. In that graph workers produce a checked candidate, Main stages and validates the combined tip, then explicitly promotes it. Interruptions retain work for recovery and revalidation.</desc>
|
|
5
|
+
<defs>
|
|
6
|
+
<style>@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Geist:wght@400;500;600&family=Geist+Mono:wght@400;500;600&display=swap');</style>
|
|
7
|
+
<marker id="routing-arrow" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto"><polygon points="0 0,8 3,0 6" fill="#4c5665"/></marker>
|
|
8
|
+
<marker id="routing-arrow-accent" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto"><polygon points="0 0,8 3,0 6" fill="#1d4ed8"/></marker>
|
|
9
|
+
<marker id="routing-arrow-link" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto"><polygon points="0 0,8 3,0 6" fill="#4c5665"/></marker>
|
|
10
|
+
</defs>
|
|
11
|
+
<rect width="1280" height="720" fill="#f0eee9"/>
|
|
12
|
+
<text x="48" y="60" fill="#6a7282" font-family="'Geist Mono',monospace" font-size="8" letter-spacing="1.5">PI SUBAGENT / ROUTING + LIFECYCLE</text>
|
|
13
|
+
<text x="48" y="99" fill="#101828" font-family="'Instrument Serif',serif" font-size="28">One explicit mode; only checked work can be promoted</text>
|
|
14
|
+
<text x="48" y="126" fill="#4c5665" font-family="'Geist',sans-serif" font-size="12">Direct work returns an observed result. Isolated changesets yield a candidate that Main must validate and promote.</text>
|
|
15
|
+
<!-- Routes and transitions are drawn before nodes. -->
|
|
16
|
+
<line x1="224" y1="212" x2="248" y2="212" stroke="#4c5665" marker-end="url(#routing-arrow)"/>
|
|
17
|
+
<path d="M336 268 V296 Q336 304 328 304 H192 Q184 304 184 312 V352" fill="none" stroke="#4c5665" marker-end="url(#routing-arrow)"/>
|
|
18
|
+
<path d="M424 212 H488 Q496 212 496 220 V352" fill="none" stroke="#1d4ed8" stroke-width="1.4" marker-end="url(#routing-arrow-accent)"/>
|
|
19
|
+
<line x1="560" y1="400" x2="624" y2="400" stroke="#4c5665" marker-end="url(#routing-arrow)"/>
|
|
20
|
+
<line x1="784" y1="400" x2="848" y2="400" stroke="#4c5665" marker-end="url(#routing-arrow)"/>
|
|
21
|
+
<line x1="1008" y1="400" x2="1072" y2="400" stroke="#1d4ed8" stroke-width="1.4" marker-end="url(#routing-arrow-accent)"/>
|
|
22
|
+
<!-- Interruption / re-entry paths use separate attach points. -->
|
|
23
|
+
<line x1="448" y1="448" x2="448" y2="512" stroke="#4c5665" stroke-dasharray="5,4" marker-end="url(#routing-arrow)"/>
|
|
24
|
+
<line x1="512" y1="512" x2="512" y2="448" stroke="#4c5665" stroke-dasharray="5,4" marker-end="url(#routing-arrow)"/>
|
|
25
|
+
<line x1="896" y1="448" x2="896" y2="512" stroke="#4c5665" stroke-dasharray="5,4" marker-end="url(#routing-arrow)"/>
|
|
26
|
+
<line x1="960" y1="512" x2="960" y2="448" stroke="#4c5665" stroke-dasharray="5,4" marker-end="url(#routing-arrow)"/>
|
|
27
|
+
<!-- Arrow labels have an 8px gap to their strokes. -->
|
|
28
|
+
<g fill="#4c5665" font-family="'Geist Mono',monospace" font-size="8" text-anchor="middle">
|
|
29
|
+
<rect x="256" y="284" width="48" height="12" rx="2" fill="#f0eee9"/><text x="280" y="293">YES</text>
|
|
30
|
+
<rect x="432" y="192" width="72" height="12" rx="2" fill="#f0eee9"/><text x="468" y="201" fill="#1d4ed8">NO / GRAPH</text>
|
|
31
|
+
<rect x="568" y="380" width="48" height="12" rx="2" fill="#f0eee9"/><text x="592" y="389">CHECK</text>
|
|
32
|
+
<rect x="792" y="380" width="48" height="12" rx="2" fill="#f0eee9"/><text x="816" y="389">STAGE</text>
|
|
33
|
+
<rect x="1016" y="380" width="48" height="12" rx="2" fill="#f0eee9"/><text x="1040" y="389" fill="#1d4ed8">VERIFY</text>
|
|
34
|
+
<rect x="384" y="472" width="56" height="12" rx="2" fill="#f0eee9"/><text x="412" y="481">PAUSE</text>
|
|
35
|
+
<rect x="520" y="472" width="56" height="12" rx="2" fill="#f0eee9"/><text x="548" y="481">RESUME</text>
|
|
36
|
+
<rect x="816" y="472" width="72" height="12" rx="2" fill="#f0eee9"/><text x="852" y="481">MAIN DRIFT</text>
|
|
37
|
+
<rect x="968" y="472" width="72" height="12" rx="2" fill="#f0eee9"/><text x="1004" y="481">RECHECK</text>
|
|
38
|
+
</g>
|
|
39
|
+
<!-- Mode selection. -->
|
|
40
|
+
<rect x="80" y="180" width="144" height="64" rx="24" fill="#ffffff" stroke="#101828"/>
|
|
41
|
+
<text x="152" y="217" text-anchor="middle" fill="#101828" font-family="'Geist',sans-serif" font-size="12" font-weight="600">Delegate task</text>
|
|
42
|
+
<polygon points="336,156 424,212 336,268 248,212" fill="#ffffff" stroke="#101828"/>
|
|
43
|
+
<text x="336" y="208" text-anchor="middle" fill="#101828" font-family="'Geist',sans-serif" font-size="12" font-weight="600">Direct</text>
|
|
44
|
+
<text x="336" y="226" text-anchor="middle" fill="#101828" font-family="'Geist',sans-serif" font-size="12" font-weight="600">eligible?</text>
|
|
45
|
+
<!-- Direct is intentionally a single terminal branch: no worktree or candidate. -->
|
|
46
|
+
<text x="80" y="336" fill="#6a7282" font-family="'Geist Mono',monospace" font-size="8" letter-spacing="1">DIRECT</text>
|
|
47
|
+
<rect x="80" y="352" width="208" height="96" rx="8" fill="#ffffff" stroke="#101828"/>
|
|
48
|
+
<text x="184" y="384" text-anchor="middle" fill="#101828" font-family="'Geist',sans-serif" font-size="12" font-weight="600">Herdr tabs</text>
|
|
49
|
+
<text x="184" y="406" text-anchor="middle" fill="#4c5665" font-family="'Geist',sans-serif" font-size="12">Current workspace</text>
|
|
50
|
+
<text x="184" y="428" text-anchor="middle" fill="#4c5665" font-family="'Geist',sans-serif" font-size="12">Observe result</text>
|
|
51
|
+
<text x="80" y="477" fill="#4c5665" font-family="'Geist',sans-serif" font-size="12">Single · parallel · chain</text>
|
|
52
|
+
<!-- Isolated changeset rail. -->
|
|
53
|
+
<text x="400" y="336" fill="#6a7282" font-family="'Geist Mono',monospace" font-size="8" letter-spacing="1">ISOLATED / CHECKED CHANGESET</text>
|
|
54
|
+
<rect x="400" y="352" width="160" height="96" rx="8" fill="#ffffff" stroke="#101828"/>
|
|
55
|
+
<text x="480" y="387" text-anchor="middle" fill="#101828" font-family="'Geist',sans-serif" font-size="12" font-weight="600">Saved + working</text>
|
|
56
|
+
<text x="480" y="411" text-anchor="middle" fill="#4c5665" font-family="'Geist',sans-serif" font-size="12">Durable ID</text>
|
|
57
|
+
<text x="480" y="429" text-anchor="middle" fill="#4c5665" font-family="'Geist',sans-serif" font-size="12">Owned worktree</text>
|
|
58
|
+
<rect x="624" y="352" width="160" height="96" rx="8" fill="#ffffff" stroke="#101828"/>
|
|
59
|
+
<text x="704" y="390" text-anchor="middle" fill="#101828" font-family="'Geist',sans-serif" font-size="12" font-weight="600">Ready candidate</text>
|
|
60
|
+
<text x="704" y="416" text-anchor="middle" fill="#4c5665" font-family="'Geist',sans-serif" font-size="12">Clean commit + checks</text>
|
|
61
|
+
<rect x="848" y="352" width="160" height="96" rx="8" fill="#ffffff" stroke="#101828"/>
|
|
62
|
+
<text x="928" y="390" text-anchor="middle" fill="#101828" font-family="'Geist',sans-serif" font-size="12" font-weight="600">Staged by Main</text>
|
|
63
|
+
<text x="928" y="416" text-anchor="middle" fill="#4c5665" font-family="'Geist',sans-serif" font-size="12">Exact candidate tip</text>
|
|
64
|
+
<rect x="1072" y="352" width="160" height="96" rx="8" fill="#1d4ed8" fill-opacity="0.08" stroke="#1d4ed8"/>
|
|
65
|
+
<text x="1152" y="390" text-anchor="middle" fill="#101828" font-family="'Geist',sans-serif" font-size="12" font-weight="600">Promoted by Main</text>
|
|
66
|
+
<text x="1152" y="416" text-anchor="middle" fill="#4c5665" font-family="'Geist',sans-serif" font-size="12">After combined checks</text>
|
|
67
|
+
<!-- Recovery states do not erase or bypass exact checks. -->
|
|
68
|
+
<text x="400" y="497" fill="#6a7282" font-family="'Geist Mono',monospace" font-size="8" letter-spacing="1">WAIT / RECOVERY</text>
|
|
69
|
+
<rect x="400" y="512" width="160" height="72" rx="8" fill="#e6e4de" stroke="#4c5665" stroke-dasharray="5,4"/>
|
|
70
|
+
<text x="480" y="541" text-anchor="middle" fill="#101828" font-family="'Geist',sans-serif" font-size="12" font-weight="600">Needs attention</text>
|
|
71
|
+
<text x="480" y="562" text-anchor="middle" fill="#4c5665" font-family="'Geist',sans-serif" font-size="12">Status / retry</text>
|
|
72
|
+
<rect x="848" y="512" width="160" height="72" rx="8" fill="#e6e4de" stroke="#4c5665" stroke-dasharray="5,4"/>
|
|
73
|
+
<text x="928" y="541" text-anchor="middle" fill="#101828" font-family="'Geist',sans-serif" font-size="12" font-weight="600">Revalidate</text>
|
|
74
|
+
<text x="928" y="562" text-anchor="middle" fill="#4c5665" font-family="'Geist',sans-serif" font-size="12">Restage if needed</text>
|
|
75
|
+
<line x1="48" y1="648" x2="1232" y2="648" stroke="#101828" stroke-opacity="0.12"/>
|
|
76
|
+
<text x="48" y="674" fill="#4c5665" font-family="'Geist Mono',monospace" font-size="8" letter-spacing="1">GUARD</text>
|
|
77
|
+
<text x="128" y="674" fill="#101828" font-family="'Geist',sans-serif" font-size="12">No fallback between modes. Failed validation retains evidence; abort requires no retained work.</text>
|
|
78
|
+
</svg>
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Pi Subagent checked execution architecture</title>
|
|
7
|
+
<link href="https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Geist:wght@400;500;600&family=Geist+Mono:wght@400;500;600&display=swap" rel="stylesheet">
|
|
8
|
+
<style>
|
|
9
|
+
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
|
10
|
+
:root {
|
|
11
|
+
--paper: #f0eee9;
|
|
12
|
+
--ink: #101828;
|
|
13
|
+
--muted: #4c5665;
|
|
14
|
+
}
|
|
15
|
+
body {
|
|
16
|
+
min-height: 100vh;
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
padding: 48px 32px;
|
|
21
|
+
background: var(--paper);
|
|
22
|
+
color: var(--ink);
|
|
23
|
+
font-family: 'Geist', sans-serif;
|
|
24
|
+
}
|
|
25
|
+
.frame { width: 100%; max-width: 1280px; }
|
|
26
|
+
.eyebrow {
|
|
27
|
+
margin-bottom: 8px;
|
|
28
|
+
color: var(--muted);
|
|
29
|
+
font: 500 8px 'Geist Mono', monospace;
|
|
30
|
+
letter-spacing: .18em;
|
|
31
|
+
text-transform: uppercase;
|
|
32
|
+
}
|
|
33
|
+
h1 {
|
|
34
|
+
margin-bottom: 24px;
|
|
35
|
+
color: var(--ink);
|
|
36
|
+
font: 400 28px 'Instrument Serif', serif;
|
|
37
|
+
letter-spacing: -.02em;
|
|
38
|
+
line-height: 1.15;
|
|
39
|
+
}
|
|
40
|
+
svg { display: block; width: 100%; height: auto; }
|
|
41
|
+
</style>
|
|
42
|
+
</head>
|
|
43
|
+
<body>
|
|
44
|
+
<main class="frame">
|
|
45
|
+
<p class="eyebrow">Architecture · Secure paved road</p>
|
|
46
|
+
<h1>Checked work reaches Main through one guarded path</h1>
|
|
47
|
+
|
|
48
|
+
<svg width="1280" height="720" viewBox="0 0 1280 720" xmlns="http://www.w3.org/2000/svg" role="img" aria-labelledby="orchestration-architecture-title orchestration-architecture-desc">
|
|
49
|
+
<title id="orchestration-architecture-title">Pi Subagent checked execution architecture</title>
|
|
50
|
+
<desc id="orchestration-architecture-desc">Architecture diagram showing Pi Main resolving each task-selected Role just in time, returning bounded text to durable state, and sending changesets through isolated Herdr work, direct checks, optional judgment, and guarded Main integration.</desc>
|
|
51
|
+
<defs>
|
|
52
|
+
<style>
|
|
53
|
+
.zone { fill: #e6e4de; stroke: #101828; stroke-opacity: .141; stroke-width: 1; }
|
|
54
|
+
.zone-protected { fill: #1d4ed8; fill-opacity: .05; stroke: #1d4ed8; stroke-opacity: .50; stroke-width: 1; stroke-dasharray: 4 4; }
|
|
55
|
+
.zone-label { fill: #6a7282; font: 500 8px 'Geist Mono', monospace; letter-spacing: .16em; }
|
|
56
|
+
.node-mask { fill: #f0eee9; }
|
|
57
|
+
.node { fill: #ffffff; stroke: #101828; stroke-width: 1; }
|
|
58
|
+
.node-input { fill: #4c5665; fill-opacity: .10; stroke: #6a7282; stroke-width: 1; }
|
|
59
|
+
.node-store { fill: #101828; fill-opacity: .05; stroke: #4c5665; stroke-width: 1; }
|
|
60
|
+
.node-focal { fill: #1d4ed8; fill-opacity: .08; stroke: #1d4ed8; stroke-width: 1.2; }
|
|
61
|
+
.tag { fill: none; stroke: #101828; stroke-opacity: .34; stroke-width: .8; }
|
|
62
|
+
.tag-focal { fill: none; stroke: #1d4ed8; stroke-opacity: .55; stroke-width: .8; }
|
|
63
|
+
.tag-text { fill: #6a7282; font: 500 8px 'Geist Mono', monospace; letter-spacing: .08em; text-anchor: middle; }
|
|
64
|
+
.tag-text-focal { fill: #1d4ed8; font: 500 8px 'Geist Mono', monospace; letter-spacing: .08em; text-anchor: middle; }
|
|
65
|
+
.name { fill: #101828; font: 600 12px 'Geist', sans-serif; text-anchor: middle; }
|
|
66
|
+
.sub { fill: #4c5665; font: 400 8px 'Geist Mono', monospace; text-anchor: middle; }
|
|
67
|
+
.edge { fill: none; stroke: #4c5665; stroke-width: 1.2; marker-end: url(#arrow); }
|
|
68
|
+
.edge-approved { fill: none; stroke: #1d4ed8; stroke-width: 1.2; marker-end: url(#arrow-accent); }
|
|
69
|
+
.edge-audit { fill: none; stroke: #4c5665; stroke-width: 1; stroke-dasharray: 5 4; marker-end: url(#arrow); }
|
|
70
|
+
.edge-blocked { fill: none; stroke: #6a7282; stroke-width: 1; stroke-dasharray: 5 4; }
|
|
71
|
+
.label-mask { fill: #f0eee9; }
|
|
72
|
+
.label { fill: #4c5665; font: 500 8px 'Geist Mono', monospace; letter-spacing: .04em; text-anchor: middle; }
|
|
73
|
+
.label-approved { fill: #1d4ed8; font: 500 8px 'Geist Mono', monospace; letter-spacing: .04em; text-anchor: middle; }
|
|
74
|
+
.stop { fill: #f0eee9; stroke: #6a7282; stroke-width: 1.2; }
|
|
75
|
+
.stop-mark { stroke: #6a7282; stroke-width: 1.2; }
|
|
76
|
+
.legend { fill: #101828; font: 400 12px 'Geist', sans-serif; }
|
|
77
|
+
.legend-label { fill: #6a7282; font: 500 8px 'Geist Mono', monospace; letter-spacing: .16em; }
|
|
78
|
+
</style>
|
|
79
|
+
<marker id="arrow" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
|
|
80
|
+
<polygon points="0 0,8 3,0 6" fill="#4c5665"/>
|
|
81
|
+
</marker>
|
|
82
|
+
<marker id="arrow-accent" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
|
|
83
|
+
<polygon points="0 0,8 3,0 6" fill="#1d4ed8"/>
|
|
84
|
+
</marker>
|
|
85
|
+
<marker id="arrow-link" markerWidth="8" markerHeight="6" refX="7" refY="3" orient="auto">
|
|
86
|
+
<polygon points="0 0,8 3,0 6" fill="#1d4ed8"/>
|
|
87
|
+
</marker>
|
|
88
|
+
</defs>
|
|
89
|
+
|
|
90
|
+
<rect width="1280" height="720" fill="#f0eee9"/>
|
|
91
|
+
|
|
92
|
+
<!-- Trust zones -->
|
|
93
|
+
<rect class="zone" x="248" y="96" width="344" height="448" rx="8"/>
|
|
94
|
+
<rect class="label-mask" x="260" y="100" width="152" height="16" rx="2"/>
|
|
95
|
+
<text class="zone-label" x="268" y="112">MAIN CONTROL PLANE</text>
|
|
96
|
+
|
|
97
|
+
<rect class="zone" x="624" y="96" width="304" height="448" rx="8"/>
|
|
98
|
+
<rect class="label-mask" x="636" y="100" width="164" height="16" rx="2"/>
|
|
99
|
+
<text class="zone-label" x="644" y="112">TASK EXECUTION CHANNELS</text>
|
|
100
|
+
|
|
101
|
+
<rect class="zone-protected" x="960" y="96" width="280" height="472" rx="8"/>
|
|
102
|
+
<rect class="label-mask" x="972" y="100" width="196" height="16" rx="2"/>
|
|
103
|
+
<text class="zone-label" x="980" y="112">PROTECTED MAIN REPOSITORY</text>
|
|
104
|
+
|
|
105
|
+
<!-- Approved and audit paths -->
|
|
106
|
+
<line class="edge" x1="216" y1="216" x2="280" y2="216"/>
|
|
107
|
+
<line class="edge" x1="560" y1="216" x2="656" y2="216"/>
|
|
108
|
+
<line class="edge" x1="420" y1="272" x2="420" y2="400"/>
|
|
109
|
+
<line class="edge" x1="776" y1="272" x2="776" y2="336"/>
|
|
110
|
+
<line class="edge-approved" x1="776" y1="448" x2="776" y2="472"/>
|
|
111
|
+
<line class="edge-audit" x1="656" y1="424" x2="560" y2="424"/>
|
|
112
|
+
<line class="edge-approved" x1="896" y1="516" x2="992" y2="516"/>
|
|
113
|
+
<path class="edge-audit" d="M1068 560 V584 Q1068 592 1060 592 H428 Q420 592 420 584 V512"/>
|
|
114
|
+
|
|
115
|
+
<!-- Forbidden routes stop before crossing -->
|
|
116
|
+
<path class="edge-blocked" d="M704 272 V296 Q704 304 696 304 H624"/>
|
|
117
|
+
<circle class="stop" cx="624" cy="304" r="8"/>
|
|
118
|
+
<line class="stop-mark" x1="620" y1="300" x2="628" y2="308"/>
|
|
119
|
+
<line class="stop-mark" x1="628" y1="300" x2="620" y2="308"/>
|
|
120
|
+
|
|
121
|
+
<line class="edge-blocked" x1="896" y1="420" x2="952" y2="420"/>
|
|
122
|
+
<circle class="stop" cx="952" cy="420" r="8"/>
|
|
123
|
+
<line class="stop-mark" x1="948" y1="416" x2="956" y2="424"/>
|
|
124
|
+
<line class="stop-mark" x1="956" y1="416" x2="948" y2="424"/>
|
|
125
|
+
|
|
126
|
+
<!-- Connector labels -->
|
|
127
|
+
<rect class="label-mask" x="220" y="196" width="56" height="12" rx="2"/>
|
|
128
|
+
<text class="label" x="248" y="204">EXECUTE</text>
|
|
129
|
+
|
|
130
|
+
<rect class="label-mask" x="580" y="196" width="56" height="12" rx="2"/>
|
|
131
|
+
<text class="label" x="608" y="204">LAUNCH</text>
|
|
132
|
+
|
|
133
|
+
<rect class="label-mask" x="428" y="324" width="72" height="12" rx="2"/>
|
|
134
|
+
<text class="label" x="464" y="332">CHECKPOINT</text>
|
|
135
|
+
|
|
136
|
+
<rect class="label-mask" x="784" y="296" width="72" height="12" rx="2"/>
|
|
137
|
+
<text class="label" x="820" y="304">DISPATCH</text>
|
|
138
|
+
|
|
139
|
+
<rect class="label-mask" x="788" y="452" width="72" height="12" rx="2"/>
|
|
140
|
+
<text class="label-approved" x="824" y="460">CHANGESET</text>
|
|
141
|
+
|
|
142
|
+
<rect class="label-mask" x="572" y="400" width="72" height="12" rx="2"/>
|
|
143
|
+
<text class="label" x="608" y="408">TEXT RESULT</text>
|
|
144
|
+
|
|
145
|
+
<rect class="label-mask" x="916" y="496" width="56" height="12" rx="2"/>
|
|
146
|
+
<text class="label-approved" x="944" y="504">VERIFY</text>
|
|
147
|
+
|
|
148
|
+
<rect class="label-mask" x="628" y="284" width="96" height="12" rx="2"/>
|
|
149
|
+
<text class="label" x="676" y="292">NO CONTROL API</text>
|
|
150
|
+
|
|
151
|
+
<rect class="label-mask" x="900" y="400" width="48" height="12" rx="2"/>
|
|
152
|
+
<text class="label" x="924" y="408">NO BYPASS</text>
|
|
153
|
+
|
|
154
|
+
<rect class="label-mask" x="696" y="572" width="80" height="12" rx="2"/>
|
|
155
|
+
<text class="label" x="736" y="580">AUDIT RESULT</text>
|
|
156
|
+
|
|
157
|
+
<!-- Opaque node masks -->
|
|
158
|
+
<rect class="node-mask" x="40" y="160" width="176" height="112" rx="6"/>
|
|
159
|
+
<rect class="node-mask" x="280" y="160" width="280" height="112" rx="6"/>
|
|
160
|
+
<rect class="node-mask" x="280" y="400" width="280" height="112" rx="6"/>
|
|
161
|
+
<rect class="node-mask" x="656" y="160" width="240" height="112" rx="6"/>
|
|
162
|
+
<rect class="node-mask" x="656" y="336" width="240" height="112" rx="6"/>
|
|
163
|
+
<rect class="node-mask" x="656" y="472" width="240" height="72" rx="6"/>
|
|
164
|
+
<rect class="node-mask" x="992" y="472" width="216" height="88" rx="6"/>
|
|
165
|
+
|
|
166
|
+
<!-- Request -->
|
|
167
|
+
<rect class="node-input" x="40" y="160" width="176" height="112" rx="6"/>
|
|
168
|
+
<rect class="tag" x="52" y="172" width="40" height="16" rx="2"/>
|
|
169
|
+
<text class="tag-text" x="72" y="184">INPUT</text>
|
|
170
|
+
<text class="name" x="128" y="216">Checked request</text>
|
|
171
|
+
<text class="sub" x="128" y="240">TASK DAG · CHECKS · BUDGET</text>
|
|
172
|
+
|
|
173
|
+
<!-- Main control plane -->
|
|
174
|
+
<rect class="node-focal" x="280" y="160" width="280" height="112" rx="6"/>
|
|
175
|
+
<rect class="tag-focal" x="292" y="172" width="40" height="16" rx="2"/>
|
|
176
|
+
<text class="tag-text-focal" x="312" y="184">MAIN</text>
|
|
177
|
+
<text class="name" x="420" y="212">Pi Subagent</text>
|
|
178
|
+
<text class="sub" x="420" y="236">PREFLIGHTS ROLE + MODEL PAIRS</text>
|
|
179
|
+
<text class="sub" x="420" y="252">RESOLVES AGAIN AT LAUNCH</text>
|
|
180
|
+
|
|
181
|
+
<rect class="node-store" x="280" y="400" width="280" height="112" rx="6"/>
|
|
182
|
+
<rect class="tag" x="292" y="412" width="48" height="16" rx="2"/>
|
|
183
|
+
<text class="tag-text" x="316" y="424">AUDIT</text>
|
|
184
|
+
<text class="name" x="420" y="452">Durable request state</text>
|
|
185
|
+
<text class="sub" x="420" y="476">CONFIG/PI-SUBAGENT/STATE</text>
|
|
186
|
+
<text class="sub" x="420" y="492">STRICT SCHEMA · RECOVERY EVIDENCE</text>
|
|
187
|
+
|
|
188
|
+
<!-- Task-selected Role and execution channels -->
|
|
189
|
+
<rect class="node" x="656" y="160" width="240" height="112" rx="6"/>
|
|
190
|
+
<rect class="tag" x="668" y="172" width="40" height="16" rx="2"/>
|
|
191
|
+
<text class="tag-text" x="688" y="184">ROLE</text>
|
|
192
|
+
<text class="name" x="776" y="212">Current configured Role</text>
|
|
193
|
+
<text class="sub" x="776" y="236">TASK-SELECTED · RESOLVED JIT</text>
|
|
194
|
+
<text class="sub" x="776" y="252">TOOLS · SKILLS · MCP POLICY</text>
|
|
195
|
+
|
|
196
|
+
<rect class="node-store" x="656" y="336" width="240" height="112" rx="6"/>
|
|
197
|
+
<rect class="tag" x="668" y="348" width="56" height="16" rx="2"/>
|
|
198
|
+
<text class="tag-text" x="696" y="360">CHANNEL</text>
|
|
199
|
+
<text class="name" x="776" y="388">Text or changeset execution</text>
|
|
200
|
+
<text class="sub" x="776" y="412">BOUNDED TEXT · ISOLATED HERDR</text>
|
|
201
|
+
<text class="sub" x="776" y="428">MAIN DRIFT FAILS CLOSED</text>
|
|
202
|
+
|
|
203
|
+
<!-- Live-worker changeset gate -->
|
|
204
|
+
<rect class="node" x="656" y="472" width="240" height="72" rx="6"/>
|
|
205
|
+
<rect class="tag" x="668" y="484" width="40" height="16" rx="2"/>
|
|
206
|
+
<text class="tag-text" x="688" y="496">CHECK</text>
|
|
207
|
+
<text class="name" x="776" y="508">Changeset checks + judgment</text>
|
|
208
|
+
<text class="sub" x="776" y="528">LIVE WORKER · REBASE · EXACT PATCH</text>
|
|
209
|
+
|
|
210
|
+
<!-- Protected Main repository -->
|
|
211
|
+
<rect class="node-focal" x="992" y="472" width="216" height="88" rx="6"/>
|
|
212
|
+
<rect class="tag-focal" x="1004" y="484" width="40" height="16" rx="2"/>
|
|
213
|
+
<text class="tag-text-focal" x="1024" y="496">GATE</text>
|
|
214
|
+
<text class="name" x="1100" y="520">Guarded Main integration</text>
|
|
215
|
+
<text class="sub" x="1100" y="544">IDENTITY FENCE · DECLARED ORDER</text>
|
|
216
|
+
|
|
217
|
+
<!-- Legend -->
|
|
218
|
+
<line x1="40" y1="640" x2="1240" y2="640" stroke="#101828" stroke-opacity=".141" stroke-width=".8"/>
|
|
219
|
+
<text class="legend-label" x="40" y="672">LEGEND</text>
|
|
220
|
+
|
|
221
|
+
<line class="edge-approved" x1="136" y1="668" x2="184" y2="668"/>
|
|
222
|
+
<text class="legend" x="200" y="672">approved checked path</text>
|
|
223
|
+
|
|
224
|
+
<line class="edge-audit" x1="396" y1="668" x2="444" y2="668"/>
|
|
225
|
+
<text class="legend" x="460" y="672">durable audit record</text>
|
|
226
|
+
|
|
227
|
+
<line class="edge-blocked" x1="660" y1="668" x2="700" y2="668"/>
|
|
228
|
+
<circle class="stop" cx="708" cy="668" r="8"/>
|
|
229
|
+
<line class="stop-mark" x1="704" y1="664" x2="712" y2="672"/>
|
|
230
|
+
<line class="stop-mark" x1="712" y1="664" x2="704" y2="672"/>
|
|
231
|
+
<text class="legend" x="728" y="672">blocked before boundary</text>
|
|
232
|
+
|
|
233
|
+
<rect class="zone-protected" x="988" y="660" width="32" height="16" rx="4"/>
|
|
234
|
+
<text class="legend" x="1036" y="672">trust boundary</text>
|
|
235
|
+
</svg>
|
|
236
|
+
</main>
|
|
237
|
+
</body>
|
|
238
|
+
</html>
|