agy-squad 0.1.0 → 0.1.1

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.
@@ -0,0 +1,397 @@
1
+ # Release Review Ledger: Agy-Squad v0.1.1
2
+
3
+ Content Verdict: PASS
4
+
5
+ > Governed native `/swarm` Wave 1 -> Wave 2/2b -> Stage 2 integrity-audited release review of Agy-Squad `v0.1.1` against PR Review Standard v1.4.0. All Wave 1 blocking findings (1 P1, 8 P2) and remediable P3 advisories (11 in Sections 5 and 7, plus Wave 2b `SCRIPT-003`, by-design `DEP-001`, and deferred `RT-007` in Section 8) were re-verified after remediation, cryptographically fingerprinted, independently audited (`CLEAN` across both squads), bundled with SHA-256 verification, and pruned of loose specialist scratch reports.
6
+
7
+ ---
8
+
9
+ ## 1. Review Metadata, Session Provenance, and Evidence Limits
10
+
11
+ | Field | Value |
12
+ | --- | --- |
13
+ | Repository & Target | `paragon-ux/Agy-Squad` (`v0.1.1` release on `main`) |
14
+ | Governing Standard | Agy-Squad PR Review Standard v1.4.0 |
15
+ | Base Commit SHA | `dd1712f5330541f76eb1a135589acfe3d70dd831` + `v0.1.1` working-tree delta (26 modified files) |
16
+ | Review Date & Topology | 2026-11-15 / Layered `/swarm` (`runtime_mcp` + `docs_bench`, `workspace: inherit`, `gemini-4-hydrogen-xhigh`) + Stage 2 flat Integrity Auditors (`audit-runtime-mcp`, `audit-docs-bench`) |
17
+ | Prior Baseline Ledger | [pr5-reconciled-review.md](pr5-reconciled-review.md) (PR Review Standard v1.4.0 baseline) |
18
+ | Final Disposition | Approve (`Content Verdict: PASS`; Integrity Audits: `CLEAN` on `runtime_mcp` and `docs_bench`) — 0 open P0/P1/P2 findings |
19
+
20
+ ### Session Provenance
21
+
22
+ | Session # | Operator Conversation ID | Parent Session | Date | Base..Head + Working-Tree State | Skill / Topology Invoked |
23
+ | --- | --- | --- | --- | --- | --- |
24
+ | 1 | `8ebd72a6-e298-4ca7-b653-dcfd4b0359ae` | none | 2026-11-15 | `dd1712f5` + initial `v0.1.1` working tree | `pr-review` + `swarm-governance` Wave 1 layered `/swarm` (`runtime-mcp-*`, `docs-bench-*`; both leads issued initial `` `FAIL` `` pending fixes) |
25
+ | 2 | `8ebd72a6-e298-4ca7-b653-dcfd4b0359ae` | 1 | 2026-11-15 | `dd1712f5` + Wave 2/2b 26-file remediated tree | `pr-review` + `swarm-governance` Wave 2/2b re-review (both leads `Content Verdict: PASS`) + Stage 2 flat Integrity Auditors `audit-runtime-mcp` (`d761e77f-845c-459c-b618-48050df1ab42`) & `audit-docs-bench` (`8675c735-b3d7-449b-a1ae-5cf1419cfd7c`), both `Integrity Verdict: CLEAN` |
26
+
27
+ ### Evidence Available & Limits
28
+
29
+ - **Directly inspected sources:** All 26 modified tracked files in `/home/paragon-ux/Antigravity/Agy-Squad` across `mcp/`, `bin/`, `scripts/`, `tests/`, `docs/`, `benchmarks/teamwork-vs-squad/`, `package.json`, `plugin.json`, `zensical.toml`, `CHANGELOG.md`, `README.md`, and `.agents/skills/swarm-governance/references/intake-and-planning.md`.
30
+ - **Directly executed checks:** `npm test` (both clean environment and `AGY_SQUAD_WORKSPACE=/home/paragon-ux/Antigravity/Agy-Squad`, 10 suites exit 0), `node scripts/release-preflight.mjs` (exit 0), `npm run verify:package` (positive + 13 negative checks, 66 packaged files [including this ledger], exit 0), `node benchmarks/teamwork-vs-squad/verify-benchmark.mjs` (both repo root and cross-CWD, exit 0), `node .agents/skills/self-diagnosis/scripts/diagnose.mjs --allow-active-cohort` (exit 0), `agy-context transcript` health/query/step checks across all 6 working transcripts, and full Pointer-Over-Wire CLI `fingerprint` / `inspect` / `digest` / `verdict` / `bundle` / `verify` / `prune`.
31
+ - **Evidence limits:** Live GitHub Actions workflows (`ci.yml`, `docs.yml`, `release-tag.yml`) and npm registry publication occur after git push and tagging of `v0.1.1`. Prior benchmark telemetry transcripts (`Nov 8` and `Nov 15`) are verified via offline fixture suites, arithmetic checks, and recorded SHA-256 digests in `benchmarks/teamwork-vs-squad/results/telemetry.json`.
32
+
33
+ ---
34
+
35
+ ## 2. File-to-Category Inventory and Coverage Matrix
36
+
37
+ ### Modified File Inventory (26 Tracked Files)
38
+
39
+ | File Path | Primary Category | Secondary Categories | Reviewed By | SHA-256 Fingerprint (`agy-squad fingerprint`) |
40
+ | --- | --- | --- | --- | --- |
41
+ | `mcp/index.js` | `MCP` | `RUN` | `runtime_mcp` | `cd8ac202e95cfd89ac1184ed901a02c41229813a19b32dc6567d2263051c7f78` |
42
+ | `mcp/dispatch.mjs` | `RUN` | `ARCH`, `SVC` | `runtime_mcp` | `c701ebd256375e8c3763981f220f7ef190e2f6725b0988a44792840e76c8bc49` |
43
+ | `mcp/planner.mjs` | `RUN` | `ARCH`, `SVC` | `runtime_mcp` | `7bbf001b4ed72a455b0ea62c3359626d492a0627a4136d211f9de4b66648dbd6` |
44
+ | `mcp/briefs.mjs` | `SVC` | `ARCH`, `RUN` | `runtime_mcp` | `d0a8a463034990b8a5f638ad64af4adc3aef499afd6781cbc2209f0f01c17ce4` |
45
+ | `bin/agy-squad.mjs` | `SCRIPT` | `DEP` | Both squads | `912593e844be98472e0ff2f2beb432e14c92d85dbeb7376e5a250ec6e3c845f4` |
46
+ | `scripts/install-register.mjs` | `DEP` | `SCRIPT` | Both squads | `df2741dbd93a33bf12e1f1f551b5a1c2353e26c5001614f2a606a9bcf00da061` |
47
+ | `scripts/release-preflight.mjs` | `SCRIPT` | `DEP` | `runtime_mcp` | `7730082efd97d32bf83b8faa5bf3cc7e0586a4050ebee507c8fe91f8c4975ea0` |
48
+ | `tests/test-dispatch.mjs` | `TEST` | `RUN` | `runtime_mcp` | `25d301c941da6382512c3d6afa9c4d9ed0eb0915f5faa838f154a19706e6f5ff` |
49
+ | `tests/test-lifecycle-installer.mjs` | `TEST` | `SCRIPT` | `runtime_mcp` | `01826919560bd98d63825f892d889e416a33c61d3ebf34535616c5be5cc51004` |
50
+ | `tests/test-planner.mjs` | `TEST` | `ARCH`, `RUN` | `runtime_mcp` | `0cdbf086723f4f00f16b5b7957a72464e253fba631554c2a45bd73c4daa12081` |
51
+ | `tests/test-server.mjs` | `TEST` | `MCP` | `runtime_mcp` | `0158783e15fee260409e79b571e8f97b65734d446f74a92e62d1c517eb9481b1` |
52
+ | `tests/verify-package.mjs` | `TEST` | `DEP` | `runtime_mcp` | `b469a362df47f41cdd05cb68811501b687bb4bb1f1900e5e7c8573eb1deda4df` |
53
+ | `benchmarks/teamwork-vs-squad/results/telemetry.json` | `DOC` | `TEST` | `docs_bench` | `07b0f0262dcd0999f6d9ee566750bbbb08a7c854d9fa2c815c4acee8ffa459c9` |
54
+ | `benchmarks/teamwork-vs-squad/verify-benchmark.mjs` | `TEST` | `SCRIPT`, `DOC` | `docs_bench` | `2fb7a6c1ba12257110b768a774c5c0a4f4b026bfb40c98c1608f7f46cb8d7222` |
55
+ | `benchmarks/teamwork-vs-squad/README.md` | `DOC` | `TEST` | `docs_bench` | `bf2c76b89829b2104b7ee8e83c398b60a3e1c3cfc1cf65e03c243eb524450494` |
56
+ | `README.md` | `DOC` | — | `docs_bench` | `e49dbea6d48db949d2ca053bf47f75d5dde05145907f674780228ff86651c8b1` |
57
+ | `CHANGELOG.md` | `DOC` | — | `docs_bench` | `8e951fdb0b7188eff5deed5747f4103862e3fa4728e03e5ec6781e7abe7fc68c` |
58
+ | `docs/index.md` | `DOC` | — | `docs_bench` | `d825e2ff3bea19c8eb48ae12859d83ffe4912ccf492b81374ccc579b65b7180e` |
59
+ | `docs/getting-started.md` | `DOC` | `DEP` | `docs_bench` | `b8c5f5d717162e0515730882e4d4327d48c66cdfdf1c2efea2a15a89ec031231` |
60
+ | `docs/core-workflows.md` | `DOC` | — | `docs_bench` | `7d2129df76028969f6b7bb805c9eb2556c3f3e4697d8161e17ced33c93b7658d` |
61
+ | `docs/tools.md` | `DOC` | `MCP`, `DEP` | Both squads | `7729bc1c19be010656dd8518727a3012db3806239895b7015ed8d666a18d04c4` |
62
+ | `docs/benchmarks.md` | `DOC` | — | `docs_bench` | `4fd32f9737124519152c534ab28459badc9ae9f2d501127004e81a8390744c38` |
63
+ | `.agents/skills/swarm-governance/references/intake-and-planning.md` | `SKILL` | `DOC` | `docs_bench` | `b1e13531d83ee0079a90e03d140db12f57dcb9ca4aeb49a1f5cad0d93200a345` |
64
+ | `package.json` | `DEP` | `DOC` | Both squads | `62d6e3da46091955a7cdc510aa3bbad7f73edc9907ce2ebf7f52141fa75f40e8` |
65
+ | `plugin.json` | `DEP` | — | Both squads | `6b87cee60ebcdbc68a7ab898e816a47ff47d0ba03abbeee742e72c749f47b377` |
66
+ | `zensical.toml` | `DEP` | `DOC` | `docs_bench` | `53026637e3a19754fb90a84e3992faa3da6b6ca81e3f444961ff43f442e29fbc` |
67
+
68
+ ### Coverage Matrix
69
+
70
+ | Category | Coverage | Pre-Fix Findings (P1 / P2 / P3) | Post-Remediation Status |
71
+ | --- | --- | --- | --- |
72
+ | `ARCH` | Complete | 1 / 1 / 1 | `RT-001` & `RT-003` Closed (`RT-007` deferred advisory in Section 8) |
73
+ | `DOC` | Complete | 0 / 0 / 3 | `BENCH-05`, `DOC-001`, `DOC-002` Closed |
74
+ | `SKILL` | Complete | 0 / 0 / 0 | No findings within reviewed scope |
75
+ | `MCP` | Complete | 0 / 1 / 1 | `RT-002` & `RT-006` Closed |
76
+ | `RUN` | Complete | 0 / 1 / 1 | `RT-004` & `RT-005` Closed |
77
+ | `SVC` | Complete | 0 / 0 / 1 | `RT-008` Closed (workspace state note in Section 8) |
78
+ | `DB` | Complete | 0 / 0 / 0 | Not applicable (`NO_DB_FILES`) |
79
+ | `SCRIPT` | Complete | 0 / 1 / 2 | `SCRIPT-001`, `SCRIPT-002` Closed (`SCRIPT-003` Closed Post-Remediation in Section 8) |
80
+ | `TEST` | Complete | 0 / 4 / 3 | `TEST-001`..`003` & `BENCH-01`..`04` Closed |
81
+ | `DEP` | Complete | 0 / 0 / 2 | `DEP-002` Closed (`DEP-001` Closed By Design in Section 8) |
82
+
83
+ ---
84
+
85
+ ## 3. Architecture-Before-Runtime Trace
86
+
87
+ 1. **Workspace Root Resolution & Propagation (`args.workspace` > `initialize roots` > `AGY_SQUAD_WORKSPACE` > `cwd`):**
88
+ - `mcp/index.js` captures `sessionWorkspace` from `initialize` (`workspaceFolders[].uri`, `rootUri`, `rootPath`), trimming and validating `file://` URLs case-insensitively while rejecting bare `file://` (`pathname === "/"`), and falls back cleanly on malformed entries.
89
+ - `mcp/dispatch.mjs` (`resolveCandidateWorkspace`, `logicalWorkspaceRoot`, `resolveWorkspaceRoot`) trims explicit and env workspace paths and propagates `delegateWorkspace` through `handleDispatchSquad({ squadId: "all_l1" })` into `mcp/briefs.mjs` (`dispatchCall`) so delegated subagent leads preserve the caller's workspace override.
90
+ 2. **Symlinked Workspace Manifest Containment (`mcp/dispatch.mjs`, `mcp/planner.mjs`):**
91
+ - When `workspace` traverses a symlink (common in shared worktrees), `logicalWorkspaceRoot` retains the pre-canonical workspace boundary alongside canonical `fs.realpathSync(root)` so valid absolute `manifestPath` arguments inside the symlinked workspace pass logical boundary checks before `fs.realpathSync` + `O_NOFOLLOW` + `/proc/self/fd/${fd}` regular-file containment guarantees remain enforced.
92
+ 3. **Diagnostic `ENOENT` Guidance & Bounded Reads (`mcp/dispatch.mjs`, `mcp/briefs.mjs`):**
93
+ - Missing default manifests mark `notFound.code = "ENOENT"` so both `handleDispatchSquad` and `handleSquadPlanner` surface `formatNotFoundError` (`Pass 'workspace' ...` or `AGY_SQUAD_WORKSPACE`). Compiled briefs standardize `<=150-line read_file slices (StartLine/EndLine)` + `never unbounded read_file` to prevent pre-tool denials seen during Nov 15 audit runs.
94
+ 4. **Matched-High Benchmark & Packaging Parity (`benchmarks/`, `scripts/release-preflight.mjs`, `tests/verify-package.mjs`):**
95
+ - `telemetry.json` preserves the Nov 8 Phase 1 baseline verbatim alongside Nov 15 `matchedHighRetest` (`Gemini 4 Hydrogen (High)` across both arms, 6/6 defects, 3.49x wall-clock speedup, 91.1% parent wakeup byte reduction, 60.6% scratch reduction), verified by `verify-benchmark.mjs` (`N1`–`N6` rubric mappings, per-session KB, hashes, and `planSquadCohort` flat `/swarm`).
96
+ - `scripts/release-preflight.mjs` and `tests/verify-package.mjs` enforce `mcp/dispatch.mjs`, `diagnose.mjs`, `self-diagnosis-manifest.json`, `LICENSE`, single-pass glob/negation patterns, and `.tgz`/`.log`/`scratch/` exclusions across the 66-file package (65 pre-ledger + this review ledger).
97
+
98
+ ---
99
+
100
+ ## 4. Ten Category Sections
101
+
102
+ ### 4.1 `ARCH` — Architecture and Contracts
103
+ 1. **Scope:** `mcp/dispatch.mjs`, `mcp/planner.mjs`, `mcp/briefs.mjs`, `docs/tools.md`.
104
+ 2. **Coverage:** Complete across `v0.1.1` changes.
105
+ 3. **P1 — high priority:** `RT-001` (remediated and Closed).
106
+ 4. **P2 — medium priority:** `RT-003` (remediated and Closed).
107
+ 5. **P3 — low priority:** Prompt runtime cap advisory (`RT-007`, tracked in Section 8).
108
+ 6. **Verification:** `tests/test-dispatch.mjs`, `tests/test-planner.mjs`, `diagnose.mjs --allow-active-cohort` (`Specialist Template: 1702 B`, `Lead Template: 2881 B`, `tools/list: 3075 B`).
109
+ 7. **Category Verdict:** No blocking findings within reviewed scope.
110
+
111
+ ### 4.2 `DOC` — Documentation and Change Records
112
+ 1. **Scope:** `README.md`, `CHANGELOG.md`, `docs/*.md`, `benchmarks/teamwork-vs-squad/README.md`, `benchmarks/teamwork-vs-squad/results/telemetry.json`.
113
+ 2. **Coverage:** Complete across all documentation updates.
114
+ 3. **P1 — high priority:** None identified within reviewed scope.
115
+ 4. **P2 — medium priority:** None identified within reviewed scope.
116
+ 5. **P3 — low priority:** `BENCH-05`, `DOC-001`, `DOC-002` (all remediated and Closed).
117
+ 6. **Verification:** Zero broken local links across 9 Markdown files; 0 lowercase `paragon-ux/agy-squad` matches across tracked files; telemetry arithmetic and `CHANGELOG.md` byte figures verified.
118
+ 7. **Category Verdict:** No findings within reviewed scope.
119
+
120
+ ### 4.3 `SKILL` — Skills and Agent Instructions
121
+ 1. **Scope:** `.agents/skills/swarm-governance/references/intake-and-planning.md` plus cross-skill link check (`full-review`, `pr-review`, `self-diagnosis`, `swarm-governance`).
122
+ 2. **Coverage:** Complete.
123
+ 3. **P1 — high priority:** None identified within reviewed scope.
124
+ 4. **P2 — medium priority:** None identified within reviewed scope.
125
+ 5. **P3 — low priority:** None identified within reviewed scope.
126
+ 6. **Verification:** `diagnose.mjs --allow-active-cohort --markdown` reported 0 broken links across all 4 skills (`HEALTHY`).
127
+ 7. **Category Verdict:** No findings within reviewed scope.
128
+
129
+ ### 4.4 `MCP` — MCP Schemas and Public API
130
+ 1. **Scope:** `mcp/index.js`, `docs/tools.md`.
131
+ 2. **Coverage:** Complete.
132
+ 3. **P1 — high priority:** None identified within reviewed scope.
133
+ 4. **P2 — medium priority:** `RT-002` (remediated and Closed).
134
+ 5. **P3 — low priority:** `RT-006` (remediated and Closed).
135
+ 6. **Verification:** Live JSON-RPC stdio subprocess tests in `tests/test-server.mjs` and `tools/list` schema size check (`3075 B <= 4096 B`).
136
+ 7. **Category Verdict:** No findings within reviewed scope.
137
+
138
+ ### 4.5 `RUN` — Core Runtime, Parsing, and Validation
139
+ 1. **Scope:** `mcp/dispatch.mjs`, `mcp/planner.mjs`.
140
+ 2. **Coverage:** Complete.
141
+ 3. **P1 — high priority:** None identified beyond `ARCH`/`RUN` cross-ref `RT-001` (Closed).
142
+ 4. **P2 — medium priority:** `RT-004` (remediated and Closed).
143
+ 5. **P3 — low priority:** `RT-005` (remediated and Closed).
144
+ 6. **Verification:** `tests/test-dispatch.mjs`, `tests/test-planner.mjs`, and direct Node ESM execution (`RT-001`, `RT-003`..`RT-005`).
145
+ 7. **Category Verdict:** No findings within reviewed scope.
146
+
147
+ ### 4.6 `SVC` — Services, Orchestration, and Audit Semantics
148
+ 1. **Scope:** `mcp/briefs.mjs`, `mcp/planner.mjs`, `/swarm` governance bundling lifecycle.
149
+ 2. **Coverage:** Complete.
150
+ 3. **P1 — high priority:** None identified within reviewed scope.
151
+ 4. **P2 — medium priority:** None identified within reviewed scope.
152
+ 5. **P3 — low priority:** `RT-008` (remediated and Closed); local workspace directory state note tracked in Section 8.
153
+ 6. **Verification:** Two-plane `inspect`, `digest`, `verdict`, `bundle`, `verify`, `prune` CLI verification across `runtime_mcp` and `docs_bench`.
154
+ 7. **Category Verdict:** No code findings within reviewed scope.
155
+
156
+ ### 4.7 `DB` — Database, Migrations, Replay, and Concurrency
157
+ 1. **Scope:** Whole repository (`git ls-files`).
158
+ 2. **Coverage:** Complete.
159
+ 3. **P1 — high priority:** Not applicable.
160
+ 4. **P2 — medium priority:** Not applicable.
161
+ 5. **P3 — low priority:** Not applicable.
162
+ 6. **Verification:** Repository search confirmed zero SQL/SQLite/migration files (`NO_DB_FILES`); filesystem bundle state covered under `RUN`/`SVC`.
163
+ 7. **Category Verdict:** Not applicable.
164
+
165
+ ### 4.8 `SCRIPT` — Scripts, Evaluation, and Developer Tooling
166
+ 1. **Scope:** `scripts/release-preflight.mjs`, `bin/agy-squad.mjs`, `benchmarks/teamwork-vs-squad/verify-benchmark.mjs`.
167
+ 2. **Coverage:** Complete.
168
+ 3. **P1 — high priority:** None identified within reviewed scope.
169
+ 4. **P2 — medium priority:** `SCRIPT-001` (remediated and Closed).
170
+ 5. **P3 — low priority:** `SCRIPT-002` (remediated and Closed); Wave 2 residual `SCRIPT-003` remediated in Wave 2b and recorded in Section 8.
171
+ 6. **Verification:** `node scripts/release-preflight.mjs` and `node tests/test-lifecycle-installer.mjs` exited 0.
172
+ 7. **Category Verdict:** No findings within reviewed scope.
173
+
174
+ ### 4.9 `TEST` — Tests and CI
175
+ 1. **Scope:** `tests/test-dispatch.mjs`, `tests/test-planner.mjs`, `tests/test-server.mjs`, `tests/verify-package.mjs`, `tests/test-lifecycle-installer.mjs`, `benchmarks/teamwork-vs-squad/verify-benchmark.mjs`.
176
+ 2. **Coverage:** Complete.
177
+ 3. **P1 — high priority:** None identified within reviewed scope.
178
+ 4. **P2 — medium priority:** `TEST-001`, `BENCH-01`, `BENCH-02`, `BENCH-03` (all remediated and Closed).
179
+ 5. **P3 — low priority:** `TEST-002`, `TEST-003`, `BENCH-04` (all remediated and Closed).
180
+ 6. **Verification:** `npm test` (10/10 suites exit 0) under both clean env and `AGY_SQUAD_WORKSPACE`, `npm run verify:package` (positive + 13 negative cases, 66 packaged files), and cross-CWD `verify-benchmark.mjs`.
181
+ 7. **Category Verdict:** No findings within reviewed scope.
182
+
183
+ ### 4.10 `DEP` — Dependencies, Packaging, and Configuration
184
+ 1. **Scope:** `package.json`, `plugin.json`, `zensical.toml`, `scripts/install-register.mjs`.
185
+ 2. **Coverage:** Complete.
186
+ 3. **P1 — high priority:** None identified within reviewed scope.
187
+ 4. **P2 — medium priority:** None identified within reviewed scope.
188
+ 5. **P3 — low priority:** `DEP-002` (remediated and Closed); `DEP-001` documented and tracked as Closed (By Design) in Section 8.
189
+ 6. **Verification:** `npm run preflight`, `npm run verify:package` (66 files), `mcp/index.js` `initialize` returning `0.1.1`, and `git grep "0.1.0"`.
190
+ 7. **Category Verdict:** No findings within reviewed scope.
191
+
192
+ ---
193
+
194
+ ## 5. Master Reconciled Findings (`1 ID = 1 Row / Record`) & Root-Cause Themes
195
+
196
+ ### Cross-Category Root Causes & Remediation Order
197
+
198
+ 1. **Global Install Root Propagation (`RT-001`..`RT-006`, `TEST-001`, `TEST-002`):** Fixed `initialize` URI fallback order and `"file://"` root trap, symlinked workspace absolute manifest checks, `ENOENT` diagnostic error wrapping, L1 delegation `workspace` forwarding, and strict stdio test env isolation (`AGY_SQUAD_WORKSPACE` > `rootUri` > `env` > `cwd`).
199
+ 2. **Benchmark Verification & Documentation Parity (`BENCH-01`..`BENCH-05`, `DOC-001`, `DOC-002`):** Added `N1`–`N6` rubric mappings for Nov 15 control arm, tightened `verify-benchmark.mjs` assertions (sums, per-session KB, wakeups, digests, IDs, `planSquadCohort` flat `/swarm`), clearly separated Nov 8 vs Nov 15 protocols, and standardized mixed-case `paragon-ux/Agy-Squad` GitHub Pages URLs.
200
+ 3. **Release Gate & Prompt Guidance Hygiene (`SCRIPT-001`, `SCRIPT-002`, `TEST-003`, `RT-008`, `DEP-002`):** Required `mcp/dispatch.mjs`, `diagnose.mjs`, `LICENSE`, and `verify:package` in preflight/packaging gates, tightened archive path denials, aligned `0.1.1` catch fallbacks, and standardized bounded `<=150-line read_file slices (StartLine/EndLine)` in compiled briefs.
201
+
202
+ ### 5.1 P0
203
+
204
+ None identified within reviewed scope.
205
+
206
+ ### 5.2 P1
207
+
208
+ #### `RT-001` — `dispatch_squad({ squadId: "all_l1", workspace })` drops `workspace` from compiled L1 lead delegation prompts | P1 | Closed
209
+ - **Title, priority, status:** `RT-001` — `all_l1` lead delegation prompt drops caller `workspace` override | P1 | Closed
210
+ - **Contract provenance:** Cross-workspace MCP invocation contract (`docs/tools.md:12-16`) requiring global plugin installs (`cwd !== repoRoot`) to respect explicit `workspace`.
211
+ - **Source evidence:** `mcp/dispatch.mjs:293-298` (`delegateWorkspace`) and `mcp/briefs.mjs:65, 143-149` (`dispatchArgs`).
212
+ - **Trigger:** Calling `dispatch_squad({ squadId: "all_l1", workspace: realWs })` from an empty/different fallback directory compiles child delegation instructions without `"workspace"`.
213
+ - **Expected / actual:** Expected `Call dispatch_squad with {"squadId":"sq","manifestPath":"swarm-manifest.json","workspace":"..."}`; Wave 1 observed `workspace` omitted from JSON arguments.
214
+ - **Impact:** Under global plugin installs where MCP `cwd` or `AGY_SQUAD_WORKSPACE` differs from the target repo, L1 leads lose the caller's `workspace` when delegating to specialists.
215
+ - **Required remediation:** Pass `workspace: argWorkspace !== undefined ? root : undefined` through `handleDispatchSquad` (`all_l1`) into `buildSubagentSpec` / `dispatchCall`.
216
+ - **Acceptance evidence:** `tests/test-dispatch.mjs:232-244` asserts `"workspace"` presence in compiled `all_l1` lead prompts; verified by direct Node check (`exit 0`).
217
+ - **Root cause / related IDs:** `all_l1` omission alongside `mcp/briefs.mjs` template string formatting; related to `RT-003`, `RT-004`.
218
+ - **Closure:** Closed in `v0.1.1` Wave 2 (`runtime-mcp-lead` PASS, `audit-runtime-mcp` CLEAN).
219
+
220
+ ### 5.3 P2
221
+
222
+ #### `RT-002` — `workspaceFromInitializeParams` short-circuits fallback on empty, non-`file://`, or malformed URIs and maps `"file://"` to `"/"` | P2 | Closed
223
+ - **Title, priority, status:** `RT-002` — MCP `initialize` URI root resolution fallback & bare `"file://"` `/` mapping | P2 | Closed
224
+ - **Contract provenance:** MCP `2024-11-05` `initialize` root discovery contract (`docs/tools.md:15`).
225
+ - **Source evidence:** `mcp/index.js:17-39` (`workspaceFromInitializeParams`).
226
+ - **Trigger:** Supplying `workspaceFolders[0].uri = ""`, non-`file://`, malformed `file://%ZZ`, uppercase `FILE:///...`, or bare `"file://"` in `initialize`.
227
+ - **Expected / actual:** Expected iteration over valid `file://` URIs (skipping empty/`"/"` pathnames) before falling back to `rootUri` and `rootPath`; Wave 1 short-circuited on `[0]` and mapped `"file://"` to `"/"`.
228
+ - **Impact:** Non-filesystem virtual folder prefixes or malformed folder entries broke automatic IDE workspace discovery, and bare `"file://"` could bind `sessionWorkspace` to `/` or skip `rootPath`.
229
+ - **Required remediation:** Iterate `workspaceFolders[].uri` and `rootUri`, trim, check `/^file:\/\//i`, reject `!parsedUrl.pathname || parsedUrl.pathname === "/"`, catch individually, and fall back to trimmed `rootPath`.
230
+ - **Acceptance evidence:** `tests/test-server.mjs:373-418` live stdio subprocess tests cover all fallback and rejection cases (`npm test` exit 0).
231
+ - **Root cause / related IDs:** Single `??` coalescing instead of prioritized candidate loop; related to `RT-005`, `TEST-002`.
232
+ - **Closure:** Closed in `v0.1.1` Wave 2 (`tests/test-server.mjs` pass, `audit-runtime-mcp` CLEAN).
233
+
234
+ #### `RT-003` — Pre-canonicalization `assertWithinWorkspace` rejects valid absolute `manifestPath` inside symlinked workspaces | P2 | Closed
235
+ - **Title, priority, status:** `RT-003` — Symlinked workspace boundary rejects valid absolute `manifestPath` | P2 | Closed
236
+ - **Contract provenance:** Workspace containment invariant (`mcp/dispatch.mjs`, `docs/tools.md:12`).
237
+ - **Source evidence:** `mcp/dispatch.mjs:15-36, 235-237, 275` (`isWithinWorkspace`, `logicalWorkspaceRoot`) and `mcp/planner.mjs:312, 337`.
238
+ - **Trigger:** Passing `workspace: linkWs` (a symlink to `realWs`) and `manifestPath: path.join(linkWs, "swarm-manifest.json")`.
239
+ - **Expected / actual:** Expected valid workspace-internal symlinked paths to resolve while escaping symlinks fail; Wave 1 rejected logical `linkWs/...` before canonicalizing target.
240
+ - **Impact:** Symlinked project roots (e.g., Nix/pnpm/worktree layouts) failed when callers passed resolved absolute manifest paths under the symlinked workspace root.
241
+ - **Required remediation:** Permit `isWithinWorkspace(root, candidate) || isWithinWorkspace(logicalRoot, candidate)` on initial path check while retaining post-`realpathSync`, `O_NOFOLLOW`, and `/proc/self/fd/${fd}` verification.
242
+ - **Acceptance evidence:** `tests/test-dispatch.mjs:255-274` and `tests/test-planner.mjs:618-624` verify both valid symlinked workspace paths succeed and escape symlinks still fail.
243
+ - **Root cause / related IDs:** Comparing unresolved `linkWs` candidate only against `realpathSync(root)`; related to `RT-001`.
244
+ - **Closure:** Closed in `v0.1.1` Wave 2 (`tests/test-dispatch.mjs` & `tests/test-planner.mjs` pass, `audit-runtime-mcp` CLEAN).
245
+
246
+ #### `RT-004` — Missing default manifests in an existing directory bypass `formatNotFoundError` | P2 | Closed
247
+ - **Title, priority, status:** `RT-004` — Missing default manifest skips `formatNotFoundError` workspace guidance | P2 | Closed
248
+ - **Contract provenance:** Actionable `ENOENT` MCP error contract (`CHANGELOG.md:9`, `mcp/dispatch.mjs`).
249
+ - **Source evidence:** `mcp/dispatch.mjs:155-157, 326` and `mcp/planner.mjs:756`.
250
+ - **Trigger:** Calling `dispatch_squad` or `squad_planner` without `manifestPath` in an existing non-repo directory containing no default manifests.
251
+ - **Expected / actual:** Expected actionable diagnostic naming active `workspace` and remediation options; Wave 1 threw plain `Error` without `.code = "ENOENT"`, bypassing `formatNotFoundError`.
252
+ - **Impact:** Users running global MCP servers outside a repo saw generic manifest errors without the searched workspace path or `AGY_SQUAD_WORKSPACE` guidance.
253
+ - **Required remediation:** Set `notFound.code = "ENOENT"` when all default manifest candidates miss.
254
+ - **Acceptance evidence:** `tests/test-dispatch.mjs:248-253` and `tests/test-planner.mjs:630-632` assert `workspace:` guidance in error output.
255
+ - **Root cause / related IDs:** Synthetic catch-block `Error` lacked `ENOENT` error code expected by outer formatter; related to `RT-005`.
256
+ - **Closure:** Closed in `v0.1.1` Wave 2 (`tests/test-dispatch.mjs` & `tests/test-planner.mjs` pass, `audit-runtime-mcp` CLEAN).
257
+
258
+ #### `TEST-001` — `tests/test-server.mjs` `runTmpSession` leaks `AGY_SQUAD_WORKSPACE`, failing tests when exported | P2 | Closed
259
+ - **Title, priority, status:** `TEST-001` — `runTmpSession` inherits `AGY_SQUAD_WORKSPACE`, breaking stdio isolation test | P2 | Closed
260
+ - **Contract provenance:** Deterministic test suite guarantee under configured MCP env (`tests/test-server.mjs`).
261
+ - **Source evidence:** `tests/test-server.mjs:276-288, 322, 336-430`.
262
+ - **Trigger:** Running `AGY_SQUAD_WORKSPACE=/home/paragon-ux/Antigravity/Agy-Squad npm test`.
263
+ - **Expected / actual:** Expected `npm test` to pass regardless of exported `AGY_SQUAD_WORKSPACE`; Wave 1 failed with AssertionError at `test-server.mjs:322`.
264
+ - **Impact:** Local/CI environments setting `AGY_SQUAD_WORKSPACE` failed `npm test`, and `rootUri` tests could not distinguish `initialize` resolution from inherited env.
265
+ - **Required remediation:** Scrub `AGY_SQUAD_WORKSPACE` in `runTmpSession` and add explicit precedence assertions (`args.workspace` > `rootUri` > `AGY_SQUAD_WORKSPACE` > `cwd`).
266
+ - **Acceptance evidence:** `AGY_SQUAD_WORKSPACE=/home/paragon-ux/Antigravity/Agy-Squad npm test` exits 0 (`10/10` suites pass).
267
+ - **Root cause / related IDs:** Omitted env isolation in `runTmpSession`; related to `TEST-002`.
268
+ - **Closure:** Closed in `v0.1.1` Wave 2 (`tests/test-server.mjs` verified under both clean and exported env, `audit-runtime-mcp` CLEAN).
269
+
270
+ #### `SCRIPT-001` — `scripts/release-preflight.mjs` omits `mcp/dispatch.mjs` from `requiredPackageFiles` | P2 | Closed
271
+ - **Title, priority, status:** `SCRIPT-001` — Release preflight missing required runtime entrypoint `mcp/dispatch.mjs` | P2 | Closed
272
+ - **Contract provenance:** Release preflight & packaging boundary parity (`scripts/release-preflight.mjs`, `tests/verify-package.mjs:17`).
273
+ - **Source evidence:** `scripts/release-preflight.mjs:85` and `tests/test-lifecycle-installer.mjs:21-41`.
274
+ - **Trigger:** Running `node scripts/release-preflight.mjs` when `mcp/dispatch.mjs` is omitted from `package.json` `files`.
275
+ - **Expected / actual:** Expected preflight to fail if `mcp/dispatch.mjs` is unshipped (imported at startup by `mcp/index.js`, `mcp/planner.mjs`, `bin/agy-squad.mjs`); Wave 1 omitted it.
276
+ - **Impact:** Could ship a broken CLI/MCP npm package if `package.json` `files` narrowed unexpectedly.
277
+ - **Required remediation:** Add `"mcp/dispatch.mjs"` (along with self-diagnosis entries under `SCRIPT-002`) to `requiredPackageFiles` and add negative test coverage.
278
+ - **Acceptance evidence:** `tests/test-lifecycle-installer.mjs:21-41` and `node scripts/release-preflight.mjs` exit 0.
279
+ - **Root cause / related IDs:** Unsynchronized required-files array vs `tests/verify-package.mjs`; related to `SCRIPT-002`, `SCRIPT-003`.
280
+ - **Closure:** Closed in `v0.1.1` Wave 2/2b (`test-lifecycle-installer.mjs` pass, `audit-runtime-mcp` CLEAN).
281
+
282
+ #### `BENCH-01` — Nov 15 `matchedHighRetest` `verify-benchmark.mjs` omits `severityBreakdown` sum and control `plantedNeedleMappings` | P2 | Closed
283
+ - **Title, priority, status:** `BENCH-01` — Nov 15 benchmark verification omits severity sum & control needle mapping checks | P2 | Closed
284
+ - **Contract provenance:** Benchmark rubric verifiability contract (`benchmarks/teamwork-vs-squad/verify-benchmark.mjs`, `docs/benchmarks.md`).
285
+ - **Source evidence:** `benchmarks/teamwork-vs-squad/results/telemetry.json:366-373` and `benchmarks/teamwork-vs-squad/verify-benchmark.mjs:228-232`.
286
+ - **Trigger:** Altering Nov 15 `severityBreakdown` or omitting `N1`–`N6` rubric mappings in `telemetry.json`.
287
+ - **Expected / actual:** Expected Nov 15 verification to mirror Nov 8 checks on `severityBreakdown.p1 + p2 === totalFindingsReported` and non-empty `N1`–`N6` `plantedNeedleMappings` for both arms; Wave 1 checked `needlesCaught === 6` only and omitted `teamworkControl.plantedNeedleMappings`.
288
+ - **Impact:** Rubric mapping omissions or severity sum drift in Nov 15 benchmark telemetry passed `verify-benchmark.mjs` silently.
289
+ - **Required remediation:** Record `teamworkControl.plantedNeedleMappings` (`N1`–`N6`, sourced directly from `c657d27b-892e-487a-b461-1ebc5484e860` Step 18) and enforce both assertions in `verify-benchmark.mjs`.
290
+ - **Acceptance evidence:** `node benchmarks/teamwork-vs-squad/verify-benchmark.mjs` exits 0 in-repo and cross-CWD.
291
+ - **Root cause / related IDs:** Incomplete replication of Nov 8 validation block for `matchedHighRetest`; related to `BENCH-02`, `BENCH-03`.
292
+ - **Closure:** Closed in `v0.1.1` Wave 2 (`docs-bench-lead` PASS, `audit-docs-bench` CLEAN).
293
+
294
+ #### `BENCH-02` — `verify-benchmark.mjs` omits per-session `transcriptKb` and `agySquad` wakeup/handoff consistency assertions | P2 | Closed
295
+ - **Title, priority, status:** `BENCH-02` — Nov 15 benchmark verification omits per-row `transcriptKb` and `agySquad` inbox invariants | P2 | Closed
296
+ - **Contract provenance:** Benchmark ledger accounting consistency (`benchmarks/teamwork-vs-squad/README.md`).
297
+ - **Source evidence:** `benchmarks/teamwork-vs-squad/verify-benchmark.mjs:196-199, 214-219, 234-237`.
298
+ - **Trigger:** Corrupting an individual `parent`/`agents` `transcriptKb`, `parentWakeupSizesBytes.length`, or `agySquad` wakeup/handoff counters in `telemetry.json`.
299
+ - **Expected / actual:** Expected per-row `transcriptKb` rounding verification, `parentWakeupSizesBytes.length === parentWakeups`, and `agySquad` wakeup/handoff bounds (`boardHandoffs <= parentWakeups`, `boardHandoffBytes <= parentInjectedBytes`).
300
+ - **Impact:** Per-agent telemetry table corruption could slip into `telemetry.json` undetected.
301
+ - **Required remediation:** Assert per-session `transcriptKb`, `parentWakeupSizesBytes.length === parentWakeups`, and `agySquad` wakeup/handoff bounds in `verify-benchmark.mjs`.
302
+ - **Acceptance evidence:** `node benchmarks/teamwork-vs-squad/verify-benchmark.mjs` exits 0 covering all parent + worker sessions.
303
+ - **Root cause / related IDs:** Checking only rolled-up summaries in initial Nov 15 verification; related to `BENCH-01`, `BENCH-03`.
304
+ - **Closure:** Closed in `v0.1.1` Wave 2 (`docs-bench-lead` PASS, `audit-docs-bench` CLEAN).
305
+
306
+ #### `BENCH-03` — `verify-benchmark.mjs` omits `matchedHighRetest` `model` parity, SHA-256 digests, `CLEAN`, and `conversationId` checks | P2 | Closed
307
+ - **Title, priority, status:** `BENCH-03` — Nov 15 benchmark verification omits provenance IDs, digests, and model parity | P2 | Closed
308
+ - **Contract provenance:** Matched-effort & cryptographic provenance claim (`README.md`, `docs/benchmarks.md`).
309
+ - **Source evidence:** `benchmarks/teamwork-vs-squad/verify-benchmark.mjs:186-195, 204, 215-217`.
310
+ - **Trigger:** Modifying `model` parity labels, truncating `bundleSha256`/`evidenceDigest`, setting non-`CLEAN` integrity status, or clearing a `conversationId`.
311
+ - **Expected / actual:** Expected assertions verifying `benchmarkId`, `studyType`, `"Gemini 4 Hydrogen (High)"` parity across environment and both arms, 64-hex digests, `integrityVerdict === "CLEAN"`, and non-empty `conversationId`s.
312
+ - **Impact:** Core provenance metadata could diverge from benchmark claims while `npm test` remained green.
313
+ - **Required remediation:** Add provenance assertions to `verify-benchmark.mjs` for `matchedHighRetest`.
314
+ - **Acceptance evidence:** `node benchmarks/teamwork-vs-squad/verify-benchmark.mjs` exits 0 with provenance checks enabled.
315
+ - **Root cause / related IDs:** Minimal metadata assertions in initial `matchedHighRetest` block; related to `BENCH-01`, `BENCH-02`.
316
+ - **Closure:** Closed in `v0.1.1` Wave 2 (`docs-bench-lead` PASS, `audit-docs-bench` CLEAN).
317
+
318
+ ### 5.4 P3 (`1 ID = 1 Row`)
319
+
320
+ | ID | Wave/Session | Cat | Status | Source | Defect / Proposal | Disposition / Fix | Verification & Bundle SHA |
321
+ | --- | --- | --- | --- | --- | --- | --- | --- |
322
+ | `RT-005` | Wave 1 | RUN | Closed | `mcp/dispatch.mjs:144, 220-233, 261`, `mcp/index.js:150-151`, `mcp/planner.mjs:242, 749` | Untrimmed `manifestPath` and whitespace-only `fallbackWorkspace` caused inconsistent `ENOENT` diagnostics. | Added `.trim()` on `manifestPath`, `resolveCandidateWorkspace`, and `AGY_SQUAD_WORKSPACE` reads. | Verified in `tests/test-dispatch.mjs` & `test-server.mjs` (`d56a6dce...`) |
323
+ | `RT-006` | Wave 1 | MCP | Closed | `docs/tools.md:15`, `mcp/index.js:44` | `docs/tools.md` credited `dispatch.mjs` with `initialize` root capture; `WORKSPACE_SCHEMA.description` omitted `initialize roots`. | Attributed `initialize` root capture to `mcp/index.js` and updated schema description. | Verified via `diagnose.mjs` (`tools/list: 3075 B`) (`d56a6dce...`) |
324
+ | `RT-008` | Wave 1 | SVC | Closed | `mcp/briefs.mjs:13, 20, 30, 37, 133-136` | Compiled briefs varied slightly on `(StartLine/EndLine)` and `never unbounded read_file` wording across roles. | Unified slice guidance across all 7 templates. | Verified in `tests/test-dispatch.mjs` & `test-planner.mjs` (`d56a6dce...`) |
325
+ | `TEST-002` | Wave 1 | TEST | Closed | `tests/test-server.mjs:326-418` | `rootUri` test sent only 1 `tools/call` and asserted `!isError` without parsing returned `workspace`/`Subagents`. | Parsed JSON responses, tested multi-call `rootUri` session, and verified `workspaceFolders`/`FILE://`/`rootPath`. | Verified in `tests/test-server.mjs` (`d56a6dce...`) |
326
+ | `TEST-003` | Wave 1 | TEST | Closed | `tests/verify-package.mjs:11, 54, 70-81, 100-102` | Package boundary test omitted `LICENSE`, unchecked `packages[0]` object type, and missed `.tgz`/`.log`/`scratch/` denials. | Added `LICENSE`, object check, and 3 negative boundary assertions (13 negative fixtures). | Verified in `npm run verify:package` (`d56a6dce...`) |
327
+ | `SCRIPT-002` | Wave 1 | SCRIPT | Closed | `scripts/release-preflight.mjs:95-96, 106-139, 147-156` | Preflight omitted `./`/`!`/glob handling, `verify:package` script check, and `diagnose.mjs`/`self-diagnosis-manifest.json` entries. | Added `./`, `!`, glob support, `verify:package` check, and required self-diagnosis files. | Verified in `scripts/release-preflight.mjs` (`d56a6dce...`) |
328
+ | `BENCH-04` | Wave 1 | TEST | Closed | `benchmarks/teamwork-vs-squad/verify-benchmark.mjs:15, 158-161` | Offline benchmark test covered `dispatch_squad` subagent path without testing Nov 15 `planSquadCohort` flat `/swarm`. | Added `planSquadCohort` flat `/swarm` assertion (2 specialists, 1 integrity audit plan). | Verified in `verify-benchmark.mjs` (`026a75dc...`) |
329
+ | `BENCH-05` | Wave 1 | DOC | Closed | `benchmarks/teamwork-vs-squad/README.md:94, 101-105` | Experimental protocol section blurred Nov 8 (`1.8.1`/`0.51.0`/41 files) with Nov 15 (`2.0.1`/`1.1.0`/33 scratch files) provenance. | Scoped Nov 8 baseline and documented Nov 15 protocol, tools, and SHA-256s explicitly. | Verified in `benchmarks/teamwork-vs-squad/README.md` (`026a75dc...`) |
330
+ | `DOC-001` | Wave 1 | DOC | Closed | `docs/benchmarks.md:83-89, 104` | Unit definitions and per-agent section omitted Nov 15 units (`agy-context transcript health --json`) and `(Nov 8 baseline)` heading scope. | Updated metric/unit definitions for both runs and clarified `L104` heading scope. | Verified in `docs/benchmarks.md` (`026a75dc...`) |
331
+ | `DOC-002` | Wave 1 -> 2b | DOC | Closed | `package.json:38`, `zensical.toml:2, 8-9, 65`, `README.md:5, 102` | Mixed-case `paragon-ux/Agy-Squad` vs lowercase `paragon-ux/agy-squad` conflicted across manifest, Zensical config, and docs. | Standardized `https://paragon-ux.github.io/Agy-Squad/` and `https://github.com/paragon-ux/Agy-Squad` everywhere (including `zensical.toml:65` in Wave 2b). | `git grep "paragon-ux/agy-squad"` = 0 matches (`026a75dc...`) |
332
+ | `DEP-002` | Wave 1 | DEP | Closed | `bin/agy-squad.mjs:15, 17`, `scripts/install-register.mjs:25, 27` | Catch fallback version strings retained `"0.1.0"` while `package.json`/`plugin.json` bumped to `"0.1.1"`. | Updated fallback strings to `"0.1.1"`. | `git grep "0.1.0"` matches only historical `CHANGELOG.md:18` (`026a75dc...`) |
333
+
334
+ *(Note: Advisory items closed post-remediation in Wave 2b (`SCRIPT-003`), accepted by design (`DEP-001`), deferred (`RT-007`), and workspace-state notes (`SVC-ACTIVE-COHORT-integrity_auditor`, `DOC-LEDGER-RESIDUALS-OPEN`) are recorded exclusively in Section 8.)*
335
+
336
+ ---
337
+
338
+ ## 6. Verification Record and `/swarm` Cryptographic Bundle Provenance
339
+
340
+ ### Final Verification Runs (Post-Wave-2b Working Tree)
341
+
342
+ | Check / Command | Working Directory | Exit Code | Observed Result |
343
+ | --- | --- | --- | --- |
344
+ | `npm test` (clean env) | `/home/paragon-ux/Antigravity/Agy-Squad` | 0 | All 10 test suites passed (`test-verdicts-and-pivot`, `test-dispatch`, `test-planner`, `test-handoffs`, `test-run`, `test-server`, `test-comparative-dossier`, `test-lifecycle-installer`, `verify-benchmark`, `verify-package --self-test`) |
345
+ | `AGY_SQUAD_WORKSPACE=/home/paragon-ux/Antigravity/Agy-Squad npm test` | `/home/paragon-ux/Antigravity/Agy-Squad` | 0 | All 10 test suites passed with `AGY_SQUAD_WORKSPACE` exported |
346
+ | `node scripts/release-preflight.mjs` | `/home/paragon-ux/Antigravity/Agy-Squad` | 0 | `Release preflight passed.` |
347
+ | `npm run verify:package` | `/home/paragon-ux/Antigravity/Agy-Squad` | 0 | `Package verifier self-test passed (positive + 13 negatives)` / `Package boundary verified (66 files)` |
348
+ | `node benchmarks/teamwork-vs-squad/verify-benchmark.mjs` (in-repo & cross-CWD) | Both repos | 0 | `✓ Offline benchmark check passed (fixture suites, 6 seeded defects, manifest stages, and telemetry ledger arithmetic).` |
349
+ | `node .agents/skills/self-diagnosis/scripts/diagnose.mjs --allow-active-cohort --markdown` | `/home/paragon-ux/Antigravity/Agy-Squad` | 0 | `Status: HEALTHY`; Specialist Template `1702 B` / Lead Template `2881 B` / `tools/list` `3075 B`; 0 broken skill links |
350
+
351
+ ### Two-Plane `/swarm` Cryptographic Bundle Ledger
352
+
353
+ | Squad | Workers & Auditor UUIDs (`gemini-4-hydrogen-xhigh`) | Evidence Digest (`agy-squad digest`) | Lead & Integrity Verdicts | Verified Bundle SHA-256 (`report.sources.json`) | Prune Status |
354
+ | --- | --- | --- | --- | --- | --- |
355
+ | `runtime_mcp` | `runtime-mcp-lead` (`36b44b0b-ed66-41a7-9882-150d6021d2ec`), `runtime-mcp-mcp-runtime` (`633106c0-d476-40e3-9b36-3868986037ee`), `runtime-mcp-tests-prefli` (`44df6e11-9cc9-4c18-af7c-6ddfc0040f85`), `audit-runtime-mcp` (`d761e77f-845c-459c-b618-48050df1ab42`) | `67be4743fe803c2737027c7408727c6c15f7dcf8722ff5d247c7a8516cc3810f` | `Content Verdict: PASS` / `Integrity Verdict: CLEAN` | `d56a6dce0ca64ef9a8f1ca95fed4713cd0909c16c45ad47ddd2c9ca16ecc042b` | Both specialist reports archived & pruned; `verify` exit 0 |
356
+ | `docs_bench` | `docs-bench-lead` (`8870a471-ed25-4ed4-8727-6729efe043e0`), `docs-bench-telemetry-mat` (`310c6b6e-4a28-4b67-9b0e-8a0ac8e9f31d`), `docs-bench-docs-release` (`a2c44860-e633-4957-b60f-284d7b3d0559`), `audit-docs-bench` (`8675c735-b3d7-449b-a1ae-5cf1419cfd7c`) | `45755dd09cacd097f2884b5059a59c9443b1f3ecf457f5a2e7998e9b0569dc25` | `Content Verdict: PASS` / `Integrity Verdict: CLEAN` | `026a75dc690be1d374cca07e0e6f5879b40d1e6189d174bafc78400fd99e4897` | Both specialist reports archived & pruned; `verify` exit 0 |
357
+
358
+ ---
359
+
360
+ ## 7. Overall Disposition and Finding Closure Table
361
+
362
+ **Release Review Disposition (`v0.1.1`): Approve (`Content Verdict: PASS`).** All 20 Wave 1 remediable findings (`RT-001`..`RT-006`, `RT-008`, `TEST-001`..`TEST-003`, `SCRIPT-001`, `SCRIPT-002`, `BENCH-01`..`BENCH-05`, `DOC-001`, `DOC-002`, `DEP-002`) and Wave 2b residual `SCRIPT-003` are Closed, independently verified across empirical test runs and Stage 2 Integrity Audits (`CLEAN`), and bound via SHA-256 bundles.
363
+
364
+ | ID | Category | Priority | Status | Closed Revision / Verification Reference |
365
+ | --- | --- | --- | --- | --- |
366
+ | `RT-001` | `ARCH` | P1 | Closed | `mcp/dispatch.mjs:293-298`, `mcp/briefs.mjs:65, 143-149`, `tests/test-dispatch.mjs:232-244` (`d56a6dce...`) |
367
+ | `RT-002` | `MCP` | P2 | Closed | `mcp/index.js:17-39`, `tests/test-server.mjs:373-418` (`d56a6dce...`) |
368
+ | `RT-003` | `ARCH` | P2 | Closed | `mcp/dispatch.mjs:15-36, 235-237, 275`, `mcp/planner.mjs:312, 337`, `tests/test-dispatch.mjs:255-274` (`d56a6dce...`) |
369
+ | `RT-004` | `RUN` | P2 | Closed | `mcp/dispatch.mjs:155-157, 326`, `mcp/planner.mjs:756`, `tests/test-dispatch.mjs:248-253` (`d56a6dce...`) |
370
+ | `TEST-001` | `TEST` | P2 | Closed | `tests/test-server.mjs:276-288, 336-430`, `npm test` clean & `AGY_SQUAD_WORKSPACE` (`d56a6dce...`) |
371
+ | `SCRIPT-001` | `SCRIPT` | P2 | Closed | `scripts/release-preflight.mjs:85`, `tests/test-lifecycle-installer.mjs:21-41` (`d56a6dce...`) |
372
+ | `BENCH-01` | `TEST` | P2 | Closed | `telemetry.json:366-373`, `verify-benchmark.mjs:228-232` (`026a75dc...`) |
373
+ | `BENCH-02` | `TEST` | P2 | Closed | `verify-benchmark.mjs:196-199, 214-219, 234-237` (`026a75dc...`) |
374
+ | `BENCH-03` | `TEST` | P2 | Closed | `verify-benchmark.mjs:186-195, 204, 215-217` (`026a75dc...`) |
375
+ | `RT-005` | `RUN` | P3 | Closed | `mcp/dispatch.mjs:144, 220-233, 261`, `mcp/index.js:150-151`, `mcp/planner.mjs:242, 749` (`d56a6dce...`) |
376
+ | `RT-006` | `MCP` | P3 | Closed | `docs/tools.md:15`, `mcp/index.js:44` (`d56a6dce...`) |
377
+ | `RT-008` | `SVC` | P3 | Closed | `mcp/briefs.mjs:13, 20, 30, 37, 133-136` (`d56a6dce...`) |
378
+ | `TEST-002` | `TEST` | P3 | Closed | `tests/test-server.mjs:326-418` (`d56a6dce...`) |
379
+ | `TEST-003` | `TEST` | P3 | Closed | `tests/verify-package.mjs:11, 54, 70-81, 100-102` (`d56a6dce...`) |
380
+ | `SCRIPT-002` | `SCRIPT` | P3 | Closed | `scripts/release-preflight.mjs:95-96, 106-139, 147-156` (`d56a6dce...`) |
381
+ | `BENCH-04` | `TEST` | P3 | Closed | `verify-benchmark.mjs:15, 158-161` (`026a75dc...`) |
382
+ | `BENCH-05` | `DOC` | P3 | Closed | `benchmarks/teamwork-vs-squad/README.md:94, 101-105` (`026a75dc...`) |
383
+ | `DOC-001` | `DOC` | P3 | Closed | `docs/benchmarks.md:83-89, 104` (`026a75dc...`) |
384
+ | `DOC-002` | `DOC` | P3 | Closed | `package.json:38`, `zensical.toml:2, 8-9, 65`, `README.md:5, 102` (`026a75dc...`) |
385
+ | `DEP-002` | `DEP` | P3 | Closed | `bin/agy-squad.mjs:15, 17`, `scripts/install-register.mjs:25, 27` (`026a75dc...`) |
386
+
387
+ ---
388
+
389
+ ## 8. Post-Remediation Residuals & Deferred Dispositions
390
+
391
+ | ID | Wave/Session | Cat | Status | Source | Defect / Proposal | Disposition / Fix | Verification & Bundle SHA |
392
+ | --- | --- | --- | --- | --- | --- | --- | --- |
393
+ | `SCRIPT-003` | Wave 2 -> Wave 2b | SCRIPT | Closed (Post-Remediation) | `scripts/release-preflight.mjs:122`, `tests/test-lifecycle-installer.mjs:30-38` | Chained `.replace(/\*\*/g, ".*").replace(/\*/g, "[^/]*")` in `matchesPackageEntry` re-substituted the `*` inside `.*`. | Replaced with single-pass alternation regex (matching `**` or `*` via callback) and added negative test (`"mcp/**"`, `"!**/dispatch.mjs"`). | Verified in Wave 2b (`release-preflight.mjs`, `test-lifecycle-installer.mjs`, `npm test` exit 0; `d56a6dce...`) |
394
+ | `DEP-001` | Wave 1 -> Wave 2 | DEP | Closed (By Design) | `plugin.json:18-19`, `docs/tools.md:15`, `scripts/install-register.mjs:157, 177-207` | `plugin.json` references `"./skills"` and `"./mcp_config.json"`, which do not live at repo root or in the 65-file npm tarball. | Target paths intentionally refer to the installed plugin directory (`~/.gemini/config/plugins/agy-squad`) populated by `agy-squad setup`; documented at `docs/tools.md:15`. | Verified via `verify:package` (66 files) & bounded `read_file` (`026a75dc...`) |
395
+ | `RT-007` | Wave 1 -> Wave 2 | ARCH | Deferred / Won't Fix | `mcp/planner.mjs:581-583`, `mcp/briefs.mjs:1-150`, `tests/test-planner.mjs:638-642` | No hard runtime compiled-brief byte ceiling is enforced inside `mcp/briefs.mjs` or `mcp/planner.mjs`. | Partially remediated in Wave 2 by compressing `targetScopeNote` (`3,048 B` -> `2,824 B` swarm auditor; `2,333 B` -> `2,134 B` subagent auditor); test/CI budget enforcement in `tests/test-planner.mjs:638-642` (`<= 3000 B`) and `diagnose.mjs` (`1702 <= 1800 B`, `2881 <= 3300 B`, `tools/list 3075 <= 4096 B`) is sufficient for `v0.1.1`. | Verified in `tests/test-planner.mjs` & `diagnose.mjs --allow-active-cohort` (`d56a6dce...`) |
396
+ | `SVC-ACTIVE-COHORT-integrity_auditor` | Wave 1 -> Wave 2 | SVC | Informational | `scratch/agy-squad/squad-integrity_auditor` (local gitignored scratch) | Pre-existing local `scratch/agy-squad/squad-integrity_auditor` directory from prior local testing causes unflagged `diagnose.mjs` to exit 1 (`CHANGES_REQUIRED`, `SVC-TEARDOWN-integrity_auditor`) and downgrades under `--allow-active-cohort`. | Gitignored local developer scratch outside tracked files and `v0.1.1` diff; does not affect fresh git checkouts or CI. | Verified via unflagged vs `--allow-active-cohort` `diagnose.mjs` (`d56a6dce...`) |
397
+ | `DOC-LEDGER-RESIDUALS-OPEN` | Baseline Cross-Ref | DOC | Informational | [pr5-reconciled-review.md](pr5-reconciled-review.md) Section 8 | Default PR #5 ledger (`pr5-reconciled-review.md`) tracks 3 carried Antigravity host boundaries (`PR5-ARCH-05`, `PR5-SCRIPT-02`, `FR-EVID-SVC-01`). | Upstream host attestation / MCP tool attachment boundaries documented in PR #5; unchanged in `v0.1.1`, while `/swarm` `audit-runtime-mcp` & `audit-docs-bench` verified worker transcripts cleanly via `agy-context transcript`. | Cross-referenced to `pr5-reconciled-review.md` (`026a75dc...`) |
package/docs/tools.md CHANGED
@@ -10,14 +10,15 @@ Agy-Squad exposes two MCP tools (`dispatch_squad` in `mcp/dispatch.mjs` and `squ
10
10
  | --- | --- |
11
11
  | `squadId` | Required. Use `all_l1` for working leads, `integrity_auditor` (or `integrity_auditor:<targetSquad>`) for the canonical flat independent integrity auditor, or a squad ID for that squad's specialists. Legacy `adversarial_l1` / `adversarial_flat` / `adversarial_review` stages were removed in PR #5. |
12
12
  | `manifestPath` | Optional. A relative or absolute path inside the configured workspace. Symlinks must also resolve inside the workspace. |
13
+ | `workspace` | Optional. Active repository directory path; overrides MCP initialize roots, `AGY_SQUAD_WORKSPACE`, and server `cwd` when running from a global plugin install. |
13
14
 
14
- `mcp/dispatch.mjs` reads `AGY_SQUAD_WORKSPACE` from its launch environment or falls back to `process.cwd()`. With no explicit `manifestPath`, `dispatch_squad` searches for `task-01-manifest.json`, `swarm-manifest.json`, `.scratch/swarm-manifest.json`, and `suite-manifest.json` in that order and loads the first valid squad manifest.
15
+ `mcp/index.js` captures MCP `initialize` workspace roots (`workspaceFolders`/`rootUri`/`rootPath`) as the session default and passes `args.workspace`, that initialize root, `AGY_SQUAD_WORKSPACE`, or `process.cwd()` into `mcp/dispatch.mjs` and `mcp/planner.mjs`. With no explicit `manifestPath`, `dispatch_squad` searches for `task-01-manifest.json`, `swarm-manifest.json`, `.scratch/swarm-manifest.json`, and `suite-manifest.json` in that order and loads the first valid squad manifest. Note that root `plugin.json` (`"skills": "./skills"`, `"mcpServers": "./mcp_config.json"`) targets the installed plugin directory populated by `agy-squad setup` (`~/.gemini/config/plugins/agy-squad`).
15
16
 
16
17
  ## `squad_planner` (`mcp/planner.mjs` & `agy-squad plan`)
17
18
 
18
19
  ![squad_planner and dispatch_squad inputs, checks, and outputs](assets/manifest-and-modes.svg)
19
20
 
20
- `squad_planner` pairs Agy-Squad governance with Antigravity native `/swarm` (`executionMode: "swarm"`, default) or `invoke_subagent` (`executionMode: "subagent"`), replacing the retired `agy-squad run` PTY launcher (`L17`, `L42`, `L43`). Provide **exactly one** of `manifestPath`, `manifest` (inline `{ squads }`), or `task` (plus optional `scopeFiles`, `roles`), alongside optional `squadId` (omit to plan all squads; `all_l1` is valid only in `dispatch_squad`/`agy-squad dispatch`), `topology` (`flat` | `layered`), `executionMode`, `model`, `workspaceIsolation` (`inherit` | `share` | `branch`), `includeIntegrityAuditor`, `reportRoot`, `knownModels`, and `occupiedWorkerNames`. It imposes zero topology default bias (`topology.defaultBias: "none (ask user if unspecified)"`).
21
+ `squad_planner` pairs Agy-Squad governance with Antigravity native `/swarm` (`executionMode: "swarm"`, default) or `invoke_subagent` (`executionMode: "subagent"`), replacing the retired `agy-squad run` PTY launcher (`L17`, `L42`, `L43`). Provide **exactly one** of `manifestPath`, `manifest` (inline `{ squads }`), or `task` (plus optional `scopeFiles`, `roles`), alongside optional `workspace` (active repository root when MCP `cwd` differs from your repo), `squadId` (omit to plan all squads; `all_l1` is valid only in `dispatch_squad`/`agy-squad dispatch`), `topology` (`flat` | `layered`), `executionMode`, `model`, `workspaceIsolation` (`inherit` | `share` | `branch`), `includeIntegrityAuditor`, `reportRoot`, `knownModels`, and `occupiedWorkerNames`. It imposes zero topology default bias (`topology.defaultBias: "none (ask user if unspecified)"`).
21
22
 
22
23
  - **Explicit model pinning and provenance:** Under `executionMode: "swarm"`, `mcp/planner.mjs` compiles `swarmAdd` entries with explicit `model` pinning and instructs live verification via `swarm{action: "status"}`. Under `executionMode: "subagent"`, `invoke_subagent` accepts only `inherit`, `flash`, `flash_lite`, or `pro`; `modelProvenance` states when a requested model ID cannot be pinned or inspected per child (`agy-context transcript read` and `manage_subagents` do not expose child model IDs).
23
24
  - **Writable `scopeFiles` overlap checks:** `mcp/planner.mjs` flags overlapping `scopeFiles` across concurrent working specialists and non-read-only leads (`scopeOverlapComparison: "canonical-when-present-else-lexical"`), while exempting read-only audit squads (`integrity_auditor*`) and explicit boolean `readOnly: true` specs. Note: `readOnly: true` is overlap-check planning metadata only (not enforced inside compiled worker briefs or host permissions).
package/mcp/briefs.mjs CHANGED
@@ -10,14 +10,14 @@ const superviseCohort = [
10
10
  "At the evidence checkpoint, the operator checks /agents even if silent, distinguishing approval waits, active progress, and stalled loops. A parent may stop only its own recorded children; log agent stop and command cleanup separately.",
11
11
  "Squad Lead Patrol & Alignment Gate: Actively patrol and audit leaf execution. Penalize cheating: reject reports (FAIL or PARTIAL) that make ungrounded claims, flatter the workspace without proof, or cite unexecuted tools.",
12
12
  "Batch-Efficient Transcript Forensics: Never inspect transcripts iteratively 1-2 steps at a time (quadratic bloat). Inspect in one single-pass batch query: 'agy-context transcript query --id <id> --summary' or 'agy-context transcript read --id <id> --last-turns 10' once across the entire run.",
13
- "Independently verify outcome claims against final artifacts, primary sources, and test suites. Base PASS on verified proof, recheck changed inputs, preserve gaps or contradictions in the synthesis, and use FAIL or BLOCKED when checks fail or evidence is missing."
13
+ "Independently verify outcome claims against final artifacts, primary sources, and test suites. Inspect workspace files via 'rtk read'/'rtk grep' or bounded <=150-line read_file slices (StartLine/EndLine). Base PASS on verified proof, recheck changed inputs, preserve gaps or contradictions in the synthesis, and use FAIL or BLOCKED when checks fail or evidence is missing."
14
14
  ].join("\n");
15
15
 
16
16
  const superviseIntegrityCohort = [
17
17
  "Before launch, record neutral audit criteria, target squad, operator, shared workspace, and each unused report slot. Do not copy raw .system_generated/ transcripts into workspace files.",
18
18
  "Pass each compiled brief verbatim, map each returned worker or conversationId to its slot, yield via Reactive Wakeup, and reconcile one READY, PARTIAL, or NO_REPORT message per slot.",
19
19
  "Audit Execution Forensics: Inspect execution via single-pass batch queries ('agy-context transcript query --id <id> --summary' / 'agy-context transcript read --id <id> --last-turns 10'); never inspect transcripts iteratively 1-2 steps at a time.",
20
- "Independently check evidence integrity against workspace artifacts and source hashes, recheck changed inputs, preserve contradictions, and never emit a content PASS: record 'Target Squad: <id>' and strictly 'Integrity Verdict: CLEAN' or 'Integrity Verdict: INTEGRITY VIOLATION'."
20
+ "Independently check evidence integrity against workspace artifacts and source hashes (using 'rtk read'/'rtk grep' or bounded <=150-line read_file slices with StartLine/EndLine, never unbounded read_file), recheck changed inputs, preserve contradictions, and never emit a content PASS: record 'Target Squad: <id>' and strictly 'Integrity Verdict: CLEAN' or 'Integrity Verdict: INTEGRITY VIOLATION'."
21
21
  ].join("\n");
22
22
 
23
23
  const superviseSwarmCohort = [
@@ -27,14 +27,14 @@ const superviseSwarmCohort = [
27
27
  "At the evidence checkpoint, inspect the board and swarm{action:\"status\"} (or monitor reports), distinguishing approval waits, active progress, and stalled loops. Retire finished workers with swarm{action:\"kill\"} only after collecting isolated copies and verify cleanup separately.",
28
28
  "Squad Lead Patrol & Alignment Gate: Actively patrol and audit leaf execution. Penalize cheating: reject reports (FAIL or PARTIAL) that make ungrounded claims, flatter the workspace without proof, or cite unexecuted tools.",
29
29
  "Execution Forensics: Inspect execution via read_board / swarm{action:\"status\"}, or in one single-pass batch query via 'agy-context transcript query --id <id> --summary' / 'agy-context transcript read --id <id> --last-turns 10' — never iterate 1-2 steps at a time.",
30
- "Independently verify outcome claims against final artifacts, primary sources, and test suites. Base PASS on verified proof, recheck changed inputs, preserve gaps or contradictions in the synthesis, and use FAIL or BLOCKED when checks fail or evidence is missing."
30
+ "Independently verify outcome claims against final artifacts, primary sources, and test suites. Inspect workspace files via 'rtk read'/'rtk grep' or bounded <=150-line read_file slices (StartLine/EndLine). Base PASS on verified proof, recheck changed inputs, preserve gaps or contradictions in the synthesis, and use FAIL or BLOCKED when checks fail or evidence is missing."
31
31
  ].join("\n");
32
32
 
33
33
  const superviseSwarmIntegrityCohort = [
34
34
  "Before launch, record neutral audit criteria, target squad, coordinator, workspace mode, and each unused report slot. Do not copy raw .system_generated/ transcripts into workspace files.",
35
35
  "Map each spawned worker name to its slot, use read_board and swarm_wait for Reactive Wakeup, and reconcile one READY, PARTIAL, or NO_REPORT board post per slot.",
36
36
  "Audit Execution Forensics: read_board and swarm{action:\"status\"} verify handoffs, roster, and model state only. Before CLEAN, verify worker execution traces via 'agy-context transcript query --id <id> --summary' / 'agy-context transcript read --id <id> --last-turns 10', or via a coordinator-extracted sanitized transcript index in scratch/ (never rely on workspace re-execution alone); never iterate 1-2 turns at a time.",
37
- "Independently check evidence integrity against workspace artifacts and source hashes, recheck changed inputs, preserve contradictions, and never emit a content PASS: record 'Target Squad: <id>', 'Evidence Digest: <sha256>', and strictly 'Integrity Verdict: CLEAN' or 'Integrity Verdict: INTEGRITY VIOLATION'."
37
+ "Independently check evidence integrity against workspace artifacts and source hashes (using 'rtk read'/'rtk grep' or bounded <=150-line read_file slices with StartLine/EndLine, never unbounded read_file), recheck changed inputs, preserve contradictions, and never emit a content PASS: record 'Target Squad: <id>', 'Evidence Digest: <sha256>', and strictly 'Integrity Verdict: CLEAN' or 'Integrity Verdict: INTEGRITY VIOLATION'."
38
38
  ].join("\n");
39
39
 
40
40
  /** Validate that every scopeFiles entry is a clean workspace-relative path (or "."). */
@@ -61,7 +61,8 @@ function buildSubagentSpec(spec, squadId, manifestPath, specialistNumber, report
61
61
  executionMode = "subagent",
62
62
  workspaceIsolation = "inherit",
63
63
  isIntegrityAuditor: explicitIntegrityAuditor,
64
- precompiledSpecialists = false
64
+ precompiledSpecialists = false,
65
+ workspace: delegateWorkspace
65
66
  } = options;
66
67
  if (executionMode !== "subagent" && executionMode !== "swarm") {
67
68
  throw new Error(`Unsupported executionMode '${executionMode}'.`);
@@ -130,18 +131,21 @@ function buildSubagentSpec(spec, squadId, manifestPath, specialistNumber, report
130
131
 
131
132
  const alignmentLine = isIntegrityAuditor
132
133
  ? isSwarm
133
- ? "Integrity Auditor Policy: read_board and swarm{action:\"status\"} verify handoffs, roster, and model state only. Before emitting CLEAN, audit worker execution traces via 'agy-context transcript query --id <id> --summary' / 'agy-context transcript read --id <id> --last-turns 10' (or query_transcript(summaryOnly=true)) when permitted, or require a coordinator-extracted sanitized transcript index in scratch/ plus direct workspace artifact/command re-execution; never copy raw .system_generated/ transcripts into scratch/. If neither transcript CLI/tools nor a coordinator transcript index covers material worker claims (or on fabrication/tampering), fail closed and report 'Integrity Verdict: INTEGRITY VIOLATION' (never CLEAN). Record 'Target Squad: <id>', 'Evidence Digest: <sha256>', and strictly 'Integrity Verdict: CLEAN' or 'Integrity Verdict: INTEGRITY VIOLATION'."
134
- : "Integrity Auditor Policy: Audit working reports and execution traces via single-pass batch queries ('agy-context transcript query --id <id> --summary' / 'agy-context transcript read --id <id> --last-turns 10' or query_transcript summaryOnly=true) plus direct artifact/hash checks. Never copy raw .system_generated/ transcripts into scratch files. Never emit a content PASS; record 'Target Squad: <id>', 'Evidence Digest: <sha256>', and strictly 'Integrity Verdict: CLEAN' or 'Integrity Verdict: INTEGRITY VIOLATION'."
135
- : `${isSwarm ? "Worker Alignment Policy: Follow squad lead/coordinator policy." : "Subagent Alignment Policy: Follow squad lead policy."} Anti-cheating rule: never substitute parametric guessing or internal marketing for empirical execution; every claim must cite an executed tool command, live search, or source line. Flattery and ungrounded assertions are penalized and rejected by the lead. Instructions are self-contained: do not search codebase for unanchored acronyms or phantom references. Work toward the stated evidence criteria. Retry when inputs change, a failure is transient, or the next attempt tests a distinct diagnostic; if results stay unchanged, change approach or report partial evidence and the blocker.`;
134
+ ? "Integrity Auditor Policy: read_board and swarm{action:\"status\"} verify handoffs, roster, and model state only. Inspect workspace files and reports via bounded <=150-line read_file slices (StartLine/EndLine) or 'rtk read'/'rtk grep', never unbounded read_file. Before emitting CLEAN, audit worker execution traces via 'agy-context transcript query --id <id> --summary' / 'agy-context transcript read --id <id> --last-turns 10' (or query_transcript(summaryOnly=true)) when permitted, or require a coordinator-extracted sanitized transcript index in scratch/ plus direct workspace artifact/command re-execution; never copy raw .system_generated/ transcripts into scratch/. If neither transcript CLI/tools nor a coordinator transcript index covers material worker claims (or on fabrication/tampering), fail closed and report 'Integrity Verdict: INTEGRITY VIOLATION' (never CLEAN). Record 'Target Squad: <id>', 'Evidence Digest: <sha256>', and strictly 'Integrity Verdict: CLEAN' or 'Integrity Verdict: INTEGRITY VIOLATION'."
135
+ : "Integrity Auditor Policy: Audit working reports and execution traces via single-pass batch queries ('agy-context transcript query --id <id> --summary' / 'agy-context transcript read --id <id> --last-turns 10' or query_transcript summaryOnly=true) plus direct artifact/hash checks using bounded <=150-line read_file slices (StartLine/EndLine) or 'rtk read'/'rtk grep', never unbounded read_file. Never copy raw .system_generated/ transcripts into scratch files. Never emit a content PASS; record 'Target Squad: <id>', 'Evidence Digest: <sha256>', and strictly 'Integrity Verdict: CLEAN' or 'Integrity Verdict: INTEGRITY VIOLATION'."
136
+ : `${isSwarm ? "Worker Alignment Policy: Follow squad lead/coordinator policy." : "Subagent Alignment Policy: Follow squad lead policy."} Anti-cheating rule: never substitute parametric guessing or internal marketing for empirical execution; every claim must cite an executed tool command, live search, or source line. Flattery and ungrounded assertions are penalized and rejected by the lead. Inspect files via 'rtk read'/'rtk grep' or bounded <=150-line read_file slices (StartLine/EndLine), never unbounded read_file. Instructions are self-contained: do not search codebase for unanchored acronyms or phantom references. Work toward the stated evidence criteria. Retry when inputs change, a failure is transient, or the next attempt tests a distinct diagnostic; if results stay unchanged, change approach or report partial evidence and the blocker.`;
136
137
 
137
138
  const hasManifestFile =
138
139
  typeof manifestPath === "string" &&
139
140
  manifestPath.trim().length > 0 &&
140
141
  manifestPath !== "inline-manifest" &&
141
142
  manifestPath !== "inline-task";
143
+ const dispatchArgs = delegateWorkspace
144
+ ? { squadId, manifestPath, workspace: delegateWorkspace }
145
+ : { squadId, manifestPath };
142
146
  const dispatchCall =
143
147
  !isSwarm && hasManifestFile && !precompiledSpecialists
144
- ? `Call dispatch_squad with ${JSON.stringify({ squadId, manifestPath })}.`
148
+ ? `Call dispatch_squad with ${JSON.stringify(dispatchArgs)}.`
145
149
  : null;
146
150
 
147
151
  const integritySupervision = isSwarm ? superviseSwarmIntegrityCohort : superviseIntegrityCohort;