@mmerterden/multi-agent-pipeline 17.1.0 → 17.4.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/CHANGELOG.md +194 -0
- package/README.md +7 -0
- package/README.tr.md +7 -0
- package/docs/token-budget-history.md +22 -0
- package/install/_dev-only-files.mjs +1 -0
- package/install/codex.mjs +18 -1
- package/install/copilot.mjs +17 -1
- package/package.json +1 -1
- package/pipeline/agents/code-reviewer.md +35 -1
- package/pipeline/commands/multi-agent/autopilot-on/SKILL.md +9 -1
- package/pipeline/lib/autopilot-state.sh +34 -0
- package/pipeline/multi-agent-refs/_dev-context.md +10 -0
- package/pipeline/multi-agent-refs/analysis/locked.md +4 -4
- package/pipeline/multi-agent-refs/analysis/redesign.md +8 -0
- package/pipeline/multi-agent-refs/analysis/render.md +2 -1
- package/pipeline/multi-agent-refs/analysis/review.md +9 -0
- package/pipeline/multi-agent-refs/android-guide.md +14 -0
- package/pipeline/multi-agent-refs/audit-guide.md +12 -0
- package/pipeline/multi-agent-refs/backend-guide.md +10 -0
- package/pipeline/multi-agent-refs/channels/confluence.md +11 -0
- package/pipeline/multi-agent-refs/channels/issue-comment.md +12 -0
- package/pipeline/multi-agent-refs/channels/jira.md +10 -0
- package/pipeline/multi-agent-refs/channels/pr-review-actions.md +13 -0
- package/pipeline/multi-agent-refs/channels/pr.md +37 -0
- package/pipeline/multi-agent-refs/component-dispatch.md +11 -0
- package/pipeline/multi-agent-refs/component-generation.md +11 -0
- package/pipeline/multi-agent-refs/conventions-defaults.md +15 -0
- package/pipeline/multi-agent-refs/cross-cli-contract.md +65 -0
- package/pipeline/multi-agent-refs/features/analysis-jira.md +11 -0
- package/pipeline/multi-agent-refs/features/code-graph.md +40 -0
- package/pipeline/multi-agent-refs/features/design-conformance.md +24 -0
- package/pipeline/multi-agent-refs/features/doctor.md +10 -0
- package/pipeline/multi-agent-refs/features/external-context-injection.md +7 -0
- package/pipeline/multi-agent-refs/features/jira-context.md +9 -0
- package/pipeline/multi-agent-refs/features/model-fallback.md +10 -0
- package/pipeline/multi-agent-refs/features/review-file-set.md +132 -0
- package/pipeline/multi-agent-refs/features/skill-conformance.md +13 -0
- package/pipeline/multi-agent-refs/features/url-enrichment.md +9 -0
- package/pipeline/multi-agent-refs/features/visual-evidence.md +42 -0
- package/pipeline/multi-agent-refs/generate-issue.md +7 -0
- package/pipeline/multi-agent-refs/issue-jira-triad.md +9 -0
- package/pipeline/multi-agent-refs/knowledge.md +6 -0
- package/pipeline/multi-agent-refs/multi-repo-integration-build.md +13 -0
- package/pipeline/multi-agent-refs/phases/modes.md +7 -0
- package/pipeline/multi-agent-refs/phases/operations.md +9 -0
- package/pipeline/multi-agent-refs/phases/phase-0-init.md +1 -1
- package/pipeline/multi-agent-refs/phases/phase-4-review.md +31 -23
- package/pipeline/multi-agent-refs/phases.md +11 -0
- package/pipeline/multi-agent-refs/picker-contract.md +12 -0
- package/pipeline/multi-agent-refs/platform-parity.md +10 -0
- package/pipeline/multi-agent-refs/progress-contract.md +10 -0
- package/pipeline/multi-agent-refs/setup/firebase.md +9 -0
- package/pipeline/multi-agent-refs/swiftui-guide.md +17 -0
- package/pipeline/multi-agent-refs/tracker-contract.md +12 -0
- package/pipeline/multi-agent-refs/web-guide.md +10 -0
- package/pipeline/multi-agent-refs/wiki-capture.md +11 -0
- package/pipeline/schemas/prefs.schema.json +4 -0
- package/pipeline/schemas/review-file-exclusions.json +137 -0
- package/pipeline/schemas/reviewer-output.schema.json +27 -1
- package/pipeline/schemas/token-budget.json +10 -19
- package/pipeline/scripts/autopilot-intake.mjs +5 -1
- package/pipeline/scripts/autopilot-runner.mjs +6 -1
- package/pipeline/scripts/autopilot-status.sh +3 -2
- package/pipeline/scripts/capture-evidence.sh +79 -11
- package/pipeline/scripts/diff-risk-score.mjs +1 -36
- package/pipeline/scripts/gen-ref-toc.mjs +279 -0
- package/pipeline/scripts/git-path.mjs +63 -0
- package/pipeline/scripts/glob-match.mjs +62 -0
- package/pipeline/scripts/graph-mermaid.mjs +251 -0
- package/pipeline/scripts/review-file-filter.mjs +180 -0
- package/pipeline/scripts/skill-conformance.mjs +1 -31
- package/pipeline/scripts/validate-analysis-doc.mjs +53 -0
- package/pipeline/scripts/validate-reviewer.mjs +90 -1
- package/pipeline/scripts/verify-citations.mjs +346 -0
package/CHANGELOG.md
CHANGED
|
@@ -14,6 +14,200 @@ Internal file-layout changes that don't affect the slash-command surface are sti
|
|
|
14
14
|
|
|
15
15
|
---
|
|
16
16
|
|
|
17
|
+
## [17.4.0] - 2026-09-15
|
|
18
|
+
|
|
19
|
+
Phase 4 now answers two questions it could not answer before: does the evidence a
|
|
20
|
+
review cites actually exist, and which files did the reviewer read.
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
|
|
24
|
+
- `verify-citations.mjs`: resolves every `file:line` a run claims against git
|
|
25
|
+
rather than against the writer. Reads reviewer findings, triage
|
|
26
|
+
accepted/deferred/rejected, analysis `repoEvidence` buckets and markdown prose,
|
|
27
|
+
checks the path with `git cat-file` and the line against the blob's real
|
|
28
|
+
length. Exit 0/1/2/64.
|
|
29
|
+
- Phase 4 runs it with `--worktree`: a fix made during a review round is
|
|
30
|
+
uncommitted, so pinning to HEAD would call every citation to it invented.
|
|
31
|
+
- The analysis pre-dispatch gate runs it pinned to a commit, because a
|
|
32
|
+
document cites repos it only reads.
|
|
33
|
+
- Until now the only check was a regex asking whether a row LOOKED like a
|
|
34
|
+
citation, which `Foo.swift:9999` satisfies in a repo with no Foo.swift.
|
|
35
|
+
- `review-file-filter.mjs` and `schemas/review-file-exclusions.json`: Phase 4
|
|
36
|
+
Step 1.85 decides what the reviewers read before the diff cap decides what
|
|
37
|
+
fits. The cap truncates the largest files first, so a regenerated lockfile was
|
|
38
|
+
not merely wasted budget - it was what survived while real code was cut. 45
|
|
39
|
+
generic patterns (generated trees, lockfiles, recorded snapshots, vendored
|
|
40
|
+
source, build output, binary assets); every exclusion carries its reason and
|
|
41
|
+
the glob that matched. Fails open: an unreadable pattern list reviews
|
|
42
|
+
everything and says so.
|
|
43
|
+
- `fileCoverage[]` on `reviewer-output.schema.json` (v1.3.0), enforced by
|
|
44
|
+
`validate-reviewer.mjs --coverage`. A reviewer that opened one file of ten and
|
|
45
|
+
one that read all ten returned the identical empty `findings[]`; now each file
|
|
46
|
+
in the set gets a `reviewed` or `skipped` verdict, and `skipped` owes a reason.
|
|
47
|
+
- `graph-mermaid.mjs`: draws the blast radius `graph-affected.mjs` already
|
|
48
|
+
measures, as a mermaid flowchart in the PR body's impact section. GitHub
|
|
49
|
+
renders it natively, so the diagram costs no renderer and no dependency. Over
|
|
50
|
+
the node ceiling it reports what was left out rather than quietly drawing a
|
|
51
|
+
small radius for a large change.
|
|
52
|
+
- `validate-analysis-doc.mjs` check 2d-2: a sequence-diagram participant that
|
|
53
|
+
appears nowhere else in the document, and a named service that appears in no
|
|
54
|
+
diagram, are both reported.
|
|
55
|
+
- Shared modules `glob-match.mjs` and `git-path.mjs`. Two glob matchers would
|
|
56
|
+
duplicate meaning, not code: the day they disagree, a file is excluded from the
|
|
57
|
+
review and still counted in the conformance denominator.
|
|
58
|
+
|
|
59
|
+
### Fixed
|
|
60
|
+
|
|
61
|
+
- `verify-citations` read `wiki.example.com:8443` out of any URL with a port and
|
|
62
|
+
called it an absolute path. An analysis document is made of Confluence, Jira
|
|
63
|
+
and Figma links, so the gate would have failed every real document with the
|
|
64
|
+
wrong reason. URLs are stripped first, and an extension must start with a
|
|
65
|
+
letter so `v1.2:30` is not a path either.
|
|
66
|
+
- `review-file-filter` dropped every non-ASCII filename. With `core.quotePath` on
|
|
67
|
+
git prints a Turkish name as `"G\303\266r..."`, which matches no glob and
|
|
68
|
+
resolves to no file - so it did not fail, it vanished from the denominator.
|
|
69
|
+
- `smoke-own-punctuation.sh` and `smoke-personal-data.sh` used `git grep` and
|
|
70
|
+
`git ls-files` without `--untracked` / `--others`, so a brand-new file was
|
|
71
|
+
invisible until committed. The run that would have caught a violation was
|
|
72
|
+
always the run after the one that introduced it.
|
|
73
|
+
- `analysis/locked.md` heading said 36 decisions over a list of 37, with nothing
|
|
74
|
+
counting.
|
|
75
|
+
|
|
76
|
+
### Changed
|
|
77
|
+
|
|
78
|
+
- `phase-4-review.md` was compressed to stay under its ceiling rather than
|
|
79
|
+
raising it. Two passages moved to the refs that own them:
|
|
80
|
+
`features/design-conformance.md` gained "Why this runs as a gate", and
|
|
81
|
+
`cross-cli-contract.md` gained "Panel diversity per host" with the per-host
|
|
82
|
+
reviewer table it had been describing in prose.
|
|
83
|
+
|
|
84
|
+
## [17.3.0] - 2026-09-14
|
|
85
|
+
|
|
86
|
+
A three-pass review of 17.2.0 found two things it had declared finished. Both
|
|
87
|
+
were the same shape: a chain fixed on one side and left broken on the other.
|
|
88
|
+
|
|
89
|
+
### Fixed
|
|
90
|
+
|
|
91
|
+
- **Web was a platform the chain did not agree on.** 17.1.0 gave
|
|
92
|
+
`run-ui-tests.sh` a web arm and taught `probe-evidence-capability.sh` to open
|
|
93
|
+
tier 1 and tier 2 for web; `visualEvidence.platform` has carried `"web"` all
|
|
94
|
+
along. `capture-evidence.sh` never learned it and answered **exit 2**, a usage
|
|
95
|
+
error. So a UI change in a Playwright repo picked a tier the probe had opened
|
|
96
|
+
and got back a failure Phase 3 reads as a phase failure rather than the gap it
|
|
97
|
+
is. `capture-evidence.sh` now has a web arm on all three verbs.
|
|
98
|
+
|
|
99
|
+
Web does not share the iOS/Android recording model, and forcing it to would
|
|
100
|
+
record the same run twice: Playwright and Cypress write the video themselves.
|
|
101
|
+
`video start` writes a marker, `video stop` harvests the newest video under
|
|
102
|
+
`test-results/` or `cypress/videos/` written **after** it, and re-encodes webm
|
|
103
|
+
to h264 for the same reason the iOS arm re-encodes. The marker is what stops a
|
|
104
|
+
video from yesterday's run being attached as today's evidence, which is worse
|
|
105
|
+
than attaching nothing because a present artefact does not get re-checked.
|
|
106
|
+
`fit` gained `webm`, which had been falling through to the pass-through arm and
|
|
107
|
+
reaching the uploader at full size.
|
|
108
|
+
- **Continuous mode's node half still named one host.** 17.2.0 fixed the shell
|
|
109
|
+
side and closed the class. `autopilot-runner.mjs` was still resolving its three
|
|
110
|
+
siblings from `~/.claude/scripts`, and `autopilot-intake.mjs` looked for
|
|
111
|
+
`jira-search.sh` there behind an `existsSync` guard whose else-branch is
|
|
112
|
+
`return []` - on a Copilot-only or Codex-only host that is an **empty Jira
|
|
113
|
+
queue with no error**. Both resolve from their own directory now.
|
|
114
|
+
- **A sentence in `phase-0-init.md` contradicted the code three lines above it**
|
|
115
|
+
("no simulator on web or backend, so the probe does not run", under a branch
|
|
116
|
+
that sets `EVIDENCE_PLATFORM=web` and runs the probe).
|
|
117
|
+
|
|
118
|
+
### Added
|
|
119
|
+
|
|
120
|
+
- `visualEvidence.webBaseUrl` - the address a web capture points the browser at.
|
|
121
|
+
Web is the one evidence platform that needs one. Absent, the capture reports a
|
|
122
|
+
gap with that reason instead of guessing a port. Per-run override: `--url`.
|
|
123
|
+
- `features/visual-evidence.md` section 4.6, the web contract.
|
|
124
|
+
- `smoke-visual-evidence.sh` section 3d: for every platform the probe will open,
|
|
125
|
+
the capture script must answer with a reason or an artefact, never exit 2. Nine
|
|
126
|
+
assertions including a live harvest of a real webm and its h264 verdict; seven
|
|
127
|
+
of them fail against 17.2.0's code.
|
|
128
|
+
- **A gate for the rule the manifest could not see.** `dependencies: {}` was
|
|
129
|
+
already tested; a shipped script shelling out to a bare `npx <pkg>` is a
|
|
130
|
+
runtime dependency the manifest never shows, fetched from the network on the
|
|
131
|
+
user's machine. `test/project.test.mjs` now fails any `npx` invocation without
|
|
132
|
+
`--no-install`, allowing only our own `@mmerterden/multi-agent-*` packages.
|
|
133
|
+
|
|
134
|
+
### Notes
|
|
135
|
+
|
|
136
|
+
- 17.2.0 was tagged but never published; npm goes 17.1.0 to 17.3.0.
|
|
137
|
+
- Five of this release's new assertions did not fire the first time they were
|
|
138
|
+
mutated. `grep -q installTemplates` was satisfied by `installTemplatesX`, the
|
|
139
|
+
host-resolver test only exercised the same-tree shortcut and never reached the
|
|
140
|
+
three-root loop, and the depth mutation targeted a file that is level 1 for
|
|
141
|
+
every reader. All fixed, all re-mutated, all red.
|
|
142
|
+
|
|
143
|
+
## [17.2.0] - 2026-09-14
|
|
144
|
+
|
|
145
|
+
Three published rules we were measurably breaking, a budget tier that could not
|
|
146
|
+
fire, and continuous mode discovering that two other host trees exist.
|
|
147
|
+
|
|
148
|
+
### Added
|
|
149
|
+
|
|
150
|
+
- **The 500-line SKILL.md rule.** Anthropic's guidance is a line count; ours was
|
|
151
|
+
a token count, and the difference is not cosmetic: all sixteen files over 500
|
|
152
|
+
lines were PASSING the token gate, because short lines and code blocks are
|
|
153
|
+
cheap at chars/4 and expensive to read (`api-security-best-practices` is 910
|
|
154
|
+
lines at 5,882 tokens against a 6,000 ceiling). `LINE_HARD_CAP` is a second
|
|
155
|
+
axis, not a tighter number on the first. The sixteen are frozen at their
|
|
156
|
+
current length in a closed grace list that only ratchets down, and
|
|
157
|
+
`test/skill-token-budget.test.mjs` is what makes "closed" enforceable.
|
|
158
|
+
- **`smoke-ref-depth.sh`.** Reference depth was spent every release and measured
|
|
159
|
+
never. The published rule asks for one level; the tree is three, and the
|
|
160
|
+
mechanism is written into our own gates - both the token-budget remedy and the
|
|
161
|
+
grace-list message told authors to move reasoning into a lazily loaded
|
|
162
|
+
reference and both said it as if the move were free. It is not: it spends a
|
|
163
|
+
level. The gate freezes the maximum at 3, lowers the ceiling when the tree
|
|
164
|
+
gets flatter, and fails any pointer naming a file that does not exist. Both
|
|
165
|
+
remedy texts now name the cost.
|
|
166
|
+
- **`gen-ref-toc.mjs` + `smoke-ref-toc.sh`.** A generated table of contents on
|
|
167
|
+
every reference over 100 lines (39 files, 297 anchors), refreshed rather than
|
|
168
|
+
hand-maintained, because a stale contents list is worse than none. Three sets
|
|
169
|
+
are excluded on measurement: a ToC puts 5 of 8 phase docs over their max and
|
|
170
|
+
the aggregate 1,533 tokens over, takes always-loaded `rules.md` from 59,908 to
|
|
171
|
+
60,997 against a 60,000 ceiling, and the analysis refs 2,298 over theirs.
|
|
172
|
+
Those files are loaded whole, so the navigation buys nothing. The exclusion is
|
|
173
|
+
derived from the three budgets, never hand-listed.
|
|
174
|
+
- **`smoke-autopilot-hosts.sh`.** Continuous mode on a Copilot-only or
|
|
175
|
+
Codex-only machine.
|
|
176
|
+
|
|
177
|
+
### Fixed
|
|
178
|
+
|
|
179
|
+
- **The warn tier that could not fire.** `warn_tokens` was a stored number
|
|
180
|
+
maintained by hand and it rotted twice the same way: reset at v13.6.0 with
|
|
181
|
+
five lines permanently amber, six of eight amber again by v17.1.0. It is gone
|
|
182
|
+
from the schema. The gate derives it per phase from that phase's own git
|
|
183
|
+
history as `median + 3*MAD`, anchored on HEAD rather than the working tree -
|
|
184
|
+
the first version anchored on the working tree, which made the threshold
|
|
185
|
+
follow the measurement so it could never fire, the exact defect being removed.
|
|
186
|
+
- **The ceiling that could only go up.** A `max_tokens` more than 25% above what
|
|
187
|
+
the document measures is now stale and fails, naming the number to lower it
|
|
188
|
+
to. Ceilings ratchet down, which the SKILL.md grace list always did and this
|
|
189
|
+
budget never had.
|
|
190
|
+
- **Continuous mode's hard-coded host paths.** `autopilot-on` read the launchd
|
|
191
|
+
plist template from `$HOME/.claude/templates/`, a tree only
|
|
192
|
+
`install/claude.mjs` creates and no path rewrite retargets, so on a
|
|
193
|
+
Copilot-only or Codex-only machine it rendered a launchd job from a file the
|
|
194
|
+
host does not have; `autopilot-status` lost its whole spend section the same
|
|
195
|
+
way. `ma_ap_asset` resolves across the three roots, and both installers now
|
|
196
|
+
ship `templates/`. The state root stays shared on purpose - two CLIs on one
|
|
197
|
+
machine must read ONE queue - and the gate asserts that too.
|
|
198
|
+
- **A leak scan that skipped the likeliest tree.** `smoke-autopilot-default-off`
|
|
199
|
+
asserted nothing outside the three autopilot commands references the runner,
|
|
200
|
+
but read only `commands/` and `multi-agent-refs/`, not `skills/`, where the
|
|
201
|
+
Copilot orchestrator is a 713-line inline file.
|
|
202
|
+
|
|
203
|
+
### Changed
|
|
204
|
+
|
|
205
|
+
- The 23,769-character `note` in `token-budget.json` moved to
|
|
206
|
+
`docs/token-budget-history.md`. The schema is 1,668 characters and describes
|
|
207
|
+
the rules instead of the past.
|
|
208
|
+
- `cross-cli-contract.md` gains section 4.4: what continuous mode does on each
|
|
209
|
+
host, and why the state root is the one thing that is not per-host.
|
|
210
|
+
|
|
17
211
|
## [17.1.0] - 2026-09-14
|
|
18
212
|
|
|
19
213
|
Continuous mode, and three things that were computed correctly and shown to
|
package/README.md
CHANGED
|
@@ -240,6 +240,13 @@ the real failure instead: configured, but launchd holds no job.
|
|
|
240
240
|
Sleep is held **only on AC**. A queue that flattens a laptop off the charger is a
|
|
241
241
|
bug; on battery the assertion is released and work resumes when you plug in.
|
|
242
242
|
|
|
243
|
+
**The three commands ship to all three CLIs and behave identically there**, because
|
|
244
|
+
what they control is not a CLI feature: it is a launchd user agent whose tick
|
|
245
|
+
spawns a `claude --bg` child regardless of which CLI you typed the command in.
|
|
246
|
+
Continuous mode therefore needs the `claude` binary on `PATH` everywhere. The
|
|
247
|
+
queue and the repo selection live in `~/.claude/autopilot/` on every host, on
|
|
248
|
+
purpose - two CLIs on one machine must read one queue, not two.
|
|
249
|
+
|
|
243
250
|
## Stacks
|
|
244
251
|
|
|
245
252
|
Stack skills ship as versioned plugins in the [`mmerterden/multi-agent-plugins`](https://github.com/mmerterden/multi-agent-plugins) marketplace. Select a stack per-repo:
|
package/README.tr.md
CHANGED
|
@@ -241,6 +241,13 @@ Uyku **yalnızca prizdeyken** engellenir. Prizde olmayan bir laptop'u boşaltan
|
|
|
241
241
|
kuyruk hatadır; bataryada assertion bırakılır ve prize takınca kaldığı yerden
|
|
242
242
|
devam eder.
|
|
243
243
|
|
|
244
|
+
**Üç komut da üç CLI'a birden kurulur ve hepsinde aynı şekilde çalışır**, çünkü
|
|
245
|
+
kontrol ettikleri şey bir CLI özelliği değil: tick'i `claude --bg` çocuğu doğuran
|
|
246
|
+
bir launchd kullanıcı ajanı, ve komutu hangi CLI'da yazdığın bunu değiştirmiyor.
|
|
247
|
+
Dolayısıyla sürekli mod her hostta `claude` binary'sinin `PATH`'te olmasını
|
|
248
|
+
istiyor. Kuyruk ve repo seçimi her hostta `~/.claude/autopilot/` altında durur;
|
|
249
|
+
bu bilinçli - bir makinedeki iki CLI tek kuyruk okumalı, iki değil.
|
|
250
|
+
|
|
244
251
|
## Stack'ler
|
|
245
252
|
|
|
246
253
|
Stack skill'leri [`mmerterden/multi-agent-plugins`](https://github.com/mmerterden/multi-agent-plugins) marketplace'inde versiyonlu plugin'ler olarak gönderilir. Repo başına bir stack seç:
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Token budget history
|
|
2
|
+
|
|
3
|
+
Every ceiling change in `pipeline/schemas/token-budget.json`, with the reason
|
|
4
|
+
that was written at the time. It lives here rather than inside the schema for a
|
|
5
|
+
plain reason: it had grown to 23,769 characters, larger than four of the eight
|
|
6
|
+
documents it governs, inside a file whose job is to hold eight numbers.
|
|
7
|
+
|
|
8
|
+
It is kept rather than dropped because the reasons are the audit trail - they
|
|
9
|
+
are what separates a considered raise from threshold-chasing, and reading them
|
|
10
|
+
end to end is what made the pattern visible: almost every entry says "the
|
|
11
|
+
smallest step that clears it", which sets the ceiling to the measurement and is
|
|
12
|
+
why six of the eight phases ended up at 99-100% of their own limit.
|
|
13
|
+
|
|
14
|
+
As of v17.1.0 the rules changed. `warn` is no longer stored at all - the gate
|
|
15
|
+
computes it per phase from that phase's own git history. `max` stays a committed
|
|
16
|
+
constant, and a ceiling that sits more than 25% above the measurement now FAILS
|
|
17
|
+
as stale, so reclaimed space is banked instead of being left as room to drift
|
|
18
|
+
back into. The ceiling can still be raised; it can no longer be raised for free.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
Token estimate = ceil(chars / 4). Per-phase budget rule: warn = current+10% (rounded to nearest 50), max = current+25%. Gives ~6 edit cycles of headroom before warn trips - intentionally quiet under normal maintenance, loud when a phase grows unusually. Only the active phase is loaded (lazy). Recalibrated at v10.0.0 after the validator/consistency/simplifier/lesson gate contracts landed in phases 1-4. Recalibrated again at v10.9.0 after the verify-by-test (Phase 4 Step 3.7), update-check (Phase 0 Step 0.6), immutable-test (Phase 3 GREEN) and redTests re-entry contracts landed - Step 3.7 prose was compressed to a pointer into refs/features/verify-by-test.md before the recalibration. Total bumped 50000 -> 51000 at v12.5.0 after the worktree residue/traversal-prune contract (Phase 0 + Phase 5 heal) and the Reflexion causal-diagnosis contract (Phase 4 lesson memory) landed; the prose was compressed first (161 tokens reclaimed) and every per-phase max still passes - only the aggregate needed room. Recalibrated again at v13.6.0 after the install-relative path correction: an instruction that names `pipeline/scripts/x` resolves only from a repo checkout, and a run happens in the user's worktree, so 157 references across these docs moved to `$HOME/.claude/...` at +5 bytes each - 196 tokens of pure correctness cost. Same discipline as before: prose was compressed FIRST (149 tokens reclaimed, by pointing Phase 1's Figma tier table at the Phase 0 probe that already resolved it and Phase 4's Codex constraints at the always-loaded AGENTS.md block), and only then were the budgets moved. Five warn lines had been permanently amber, which makes the amber tier useless as a signal, so every warn was reset to the documented current+10% and the four maxes that the new warn would have collided with were reset to current+25%. Aggregate 51000 -> 51500. Total bumped 51500 -> 52200 at v14.0.0 after Phase 4 Review entered the four --dev mode phase sets and the criteria-resolution contract (Step 1.78) landed. Same discipline as every prior bump: prose was compressed FIRST, 820 tokens reclaimed, before the number moved. Two of those compressions are structural rather than cosmetic - the hardcoded SwiftUI interaction list in Step 1.5 and the SwiftUI convention paragraph in Step 2.8 were transcriptions of rules that now live in a scoped registry, so keeping them here would have re-created the drift this release exists to remove, and the third moved the Step 1.78 full contract into refs/features/skill-conformance.md leaving a pointer. What remains is contract text that cannot be inferred: the manifest's four consumer-visible parts, the conformance checklist the reviewers must return, and the fail-closed semantics. Every per-phase max still passes (phase-4 12405/14750); only the aggregate needed room. Total bumped 52200 -> 52700 at v14.1.0 after two more contracts landed: stack skill routing (Phase 3 pre-flight step 9) and worktree finalize (Phase 6 step 9). Compression came first, as always, and twice: 224 tokens out of Phase 3 by pointing its criteria-ledger and routing steps at their feature files instead of restating them, and 190 out of Phase 6 by moving the finalize contract into refs/features/worktree-finalize.md and leaving the invocation plus the exit-3 semantics. Both new contracts follow the pattern the earlier ones set: the phase doc carries the call and the decision, the feature file carries the reasoning, and the feature files are outside this budget because it loops only the eight phase-N-* keys. Every per-phase max still passes (phase-3 7677/8950, phase-6 5223/6150 and both under warn); only the aggregate needed room. Total bumped 52700 -> 52750 for the Phase 0 Step 3 branch-persistence correction: the step wrote the legacy `projects[].branches` while the TTL filter two sections below read `global.recentBranches`, and both spots named a `{name, lastUsed}` shape the schema rejects (`branch` required, `additionalProperties: false`), so the recent-branch picker option could never populate and a literal implementation would have failed prefs validation. Naming the right target, the right key and the legacy field to avoid costs 41 tokens over the one line it replaces. Compression came first and was applied three times to the replacement text itself, from 120 tokens down to 66, by moving the rationale out of the phase doc entirely: the reasoning now lives where it is enforced, in the migrate-prefs carry-forward comment and the smoke-pref-migration f7 block, leaving the phase doc with only the instruction. 50 was the smallest step that clears it; phase-0-init sits at 10893/12400, far under its own max, so this is purely an aggregate ceiling. v15.0.0: total 52750 -> 53100, the stack-skill tables in phase-1/2/4 now carry plugin-namespaced names (ai-<stack>-toolkit:<skill>) - functional prefixes, ~170 tokens. v15.10.0: total 53350 -> 53950 for the memory-recall + context-offload contracts (Phase 1 two-block durable-knowledge injection and its telemetry, Phase 3 build-log offload pipe, Phase 4 ranked prior art, offload pipe and recall telemetry). Compression came first and twice, taking the new prose from 1168 tokens to 580: the reasoning behind the two blocks lives in multi-agent-refs/prompt-assembly.md and the reasoning behind the offload filter lives in the offload-ref.sh header, both outside this budget, so the phase docs carry only the call, the pref that gates it and the one fact an agent cannot infer - that the evidence gate still reads the whole build log, so offloading changes what is read, never what counts as a verified pass. Every per-phase max still passes (phase-3 7985/8950, phase-4 12997/14750); phase-3 and phase-4 crossed their warn lines and are left amber on purpose, because that is the signal that those two docs are the next ones needing structural compression rather than another bump. v15.13.0: total 53950 -> 54050 for the prefs-to-flag bridges. Five settings had shipped declared-but-inert: contextOffload.minLines and .tailLines (fixed in 15.11.0), learningsLedger.maxBriefEntries, and testGap.scanTree and .promoteSeverity - the last two declared in the schema AND implemented as flags in the scanner, with nothing in between reading the pref and passing the flag. Wiring three of them costs the phase docs 94 tokens, which is the wiring itself and not prose: two `--max` substitutions and a three-line GAP_FLAGS block. Compression came first and twice, as always: the rationale that would have sat in phase-5 now lives in the header of smoke-prefs-consumed.sh, the gate that makes this class fail a build instead of shipping, and a `--severity-promote` table row was dropped because the invocation above it now shows the flag and names the pref that triggers it, which the row did not. 100 was the smallest step that clears it. Every per-phase max still passes; phase-3 and phase-4 remain amber on purpose. v15.14.0: total 54050 -> 54400 for the supported-version gate. Phase 0 Step 0.6 stopped being purely advisory: a release can now publish an npm dist-tag `required` that names the oldest runnable version, and below it the run halts instead of nagging. What the phase doc has to carry is the part an agent cannot infer - the third stdout field, that the halt is identical in autopilot, and that the run must NOT continue on the freshly updated install because its docs were already loaded from the old version. Compression came first, as always, and took the new prose from 469 tokens to 337: the rationale for the floor, the exemption list, the fail-open rules and the `npm dist-tag add` recipe all moved to multi-agent-refs/rules.md "Supported Version Gate" (loaded by 25 commands, outside this budget) and to the header of require-supported-version.sh, leaving the phase doc with the call, the decision table and the halt. 350 was the smallest step that clears it. Every per-phase max still passes (phase-0-init 11230/12400); phase-3 and phase-4 remain amber on purpose. v15.17.0: total 54400 -> 54900 for the Phase 1 analysis-document step. Phase 2 and Phase 3 pre-flights had BLOCKED on `analysis/<feature>-<platform>.md` since v9.0.0 while nothing produced it, so a full run either aborted at Phase 2 or the model ignored its own BLOCKING contract; Step 4 is the producer. What the phase doc carries is only what cannot be inferred: the when-table (taskType x Figma reference), the four refs in load order, the two artefacts, and that the doc validator fails closed. Compression came first and took the step from 745 tokens to 497: the history of why the gap existed moved to the CHANGELOG, the per-ref one-line descriptions moved into the refs' own headers, and the autopilot carve-out collapsed to one clause. The 17.4k-token analysis engine itself is NOT in this budget - it moved out of commands/ into multi-agent-refs/analysis/{locked,evidence,synthesis,render}.md, loaded on demand, which also took analysis/SKILL.md from 18081 to 5974 tokens and retired its lint grace entry. 500 was the smallest step that clears it; phase-1-analysis sits at 4338/4600 and is amber on purpose, like phase-3 and phase-4. v15.18.0: total 54900 -> 55250 for analysis mode. Three phase docs gained a mode branch that cannot be inferred: Phase 4 reviews a document instead of a diff (validator, the one question reviewers answer, the open-question walk), and Phase 6 publishes instead of committing. Compression came first and was applied twice to the new prose and once to old: the Phase 4 branch went from 320 tokens to 180 and the Phase 6 branch from 190 to 120 by pointing at multi-agent-refs/analysis/{resolve,render}.md, which now hold the walks themselves, and the front-matter parse contract stopped being spelled out in both pre-flights. The analysis engine keeps leaving this budget rather than entering it: intake joined locked/evidence/synthesis/render/resolve in multi-agent-refs/analysis/, which is what let analysis/SKILL.md drop under the 6000 hard cap after its grace entry was retired. 350 was the smallest step that clears it; phase-4 and phase-6 are amber on purpose, as phase-1 and phase-3 already were. v15.20.0: total 55250 -> 55500 for the TDD bridge. Phase 3 pre-flight read the analysis doc's concept table and even said test method names come from it, while nothing read Section 15 - so the RED step invented tests and the analysis test matrix never reached development. Phase 3 step 5b now loads it into state.dev.testPlan[] and Phase 4 step 1.45 cross-checks every planned row against a real test, which is what turns "analysis quality is output quality" from a slogan into a finding. Compression came first on both blocks, 300 tokens down to 175, by dropping the enumerated failure modes to one line each and the rationale to one clause; the reasoning lives in the CHANGELOG. 250 was the smallest step that clears it. v15.21.0: total 55500 -> 55800 for the post-analysis confirmation. Phase 2 gained Step 0.9, the last human checkpoint before Phase 3: derived values are shown for confirmation and only Section 20 rows are asked, through the resolve engine that already exists in refs. It belongs here rather than Phase 4 because Phase 4 runs after development, where an answer arrives too late to change anything. Compression came first and twice, 430 tokens down to 250, by collapsing the derived-vs-asked explanation to one sentence each and moving the walk itself to multi-agent-refs/analysis/resolve.md, which Phase 4 and analysis-resolve already mount. 300 was the smallest step that clears it. v15.22.0: total 55800 -> 55900 for the analyst-toolkit hooks. Phase 1 Step 4 now names the two prefs that decide whether a document is produced at all and how deep it goes (forceFull, mode) - the first of those had shipped declared-but-inert and smoke-prefs-consumed caught it - and Phase 4 triage gained one clause: a finding that blames a third-party library asks evidence-github whether it is already open upstream, which turns it into a deferred item with a citation instead of Phase 3 rework on code that is not ours. Compression came first and three times, taking the new prose from 220 tokens to 110, and the Phase 1d evidence contract itself never entered this budget - it lives in multi-agent-refs/analysis/evidence.md beside the phases it belongs to. 100 was the smallest step that clears it, leaving 34 tokens of headroom. phase-4 stays amber and the debt named at v15.10.0 stands: it is the doc that needs structural compression rather than another bump, and the two candidates are the inline triage JSON shape and the 3.4 telemetry block, both of which restate something already authoritative elsewhere. v16.0.0: total 55900 -> 56350 for the depth picker. `--dev` and the four dev-* commands are gone; depth is Phase 0 Step 7.5, which costs phase-0-init a step it did not have. Compression came first and three times, taking the step from 530 tokens to 300: the question wording, the per-taskType recommendation and the mode tables all live in phases/modes.md (outside this budget), so the phase doc carries only what an agent cannot infer - that the step runs after Step 7 and why, who is exempt, that ASK_CHOICE_DEFAULT must be passed explicitly because ask-choice.sh takes the FIRST option on a non-TTY, and that Short flips the Phase 1/2 tiles late rather than pre-marking them. The phase-4 telemetry block named as compression debt at v15.22.0 was collapsed to an emit() helper (-27) and the four dev-* mode files left the tree entirely, but neither offsets a genuinely new phase step. 450 was the smallest step that clears it, leaving 119 tokens of headroom. phase-4 remains amber and its other named candidate, the inline triage JSON shape, was left alone on purpose: it is the prompt the triage agent is handed, not a restatement for readers. v16.2.0: total 56350 -> 56600 for the spec-freshness and reuse-tag contracts. Phase 3 step 3 had compared `state.run.lastAnalysisDigest` since it was written, against a key nothing ever set and that the state schema did not declare, so the staleness branch was unreachable and every run reported fresh by default. Phase 1 now persists the digest and a `base_commit` anchor, and step 3 gained the repo-drift half the digest cannot see: a reused document keeps a matching digest precisely because its evidence inputs did not change, while the code underneath it moved. The second contract is the Section 14 tag reaching development: Phase 2 carries it onto the todo as `sourceTag` and Phase 3 treats it as an instruction, which is what stops a Reuse row from being re-implemented. Compression came first and took the four additions from 380 tokens to 214, by moving every rationale clause out of the phase docs: why the commit anchor exists rather than a digest recomputation lives in this note and the CHANGELOG, and the schema descriptions carry the field semantics. The baseline had 9 tokens of headroom, so no addition of any size could have fit without a bump. 250 was the smallest step that clears it, leaving 45 tokens. phase-3 and phase-4 remain amber. v16.13.0: total 57600 -> 57700 for the code-graph injection and the fable-rung switch. Phase 1 gained Step 2.6 (query the graph, hand Explore a ranked starting set), Phase 7 gained the post-branch graph refresh, and Phase 0 Step 0 gained one line: a prefs switch that resolves every preferredModel: fable persona to opus for the run, which also collapses the Phase 4 Claude Code panel from three reviewers to two. Compression came first and mostly structurally: of roughly 1,630 tokens of new contract text, 1,310 never entered this budget at all - the whole code-graph contract lives in multi-agent-refs/features/code-graph.md (604) and the fable switch's scope table, per-host effects and cost-accounting consequence live in features/model-fallback.md (+707), leaving the phase docs with the call, the pref that gates it and the one fact an agent cannot infer. Phase 4 was compressed on top of that: its TLDR restated the reviewer matrix 270 lines below it, so 36 tokens came back and the doc nets +6 despite carrying two new clauses. One of those clauses is a correction rather than a feature - the consensus rule still said reviewerCount is 2 on Claude Code, which stopped being true when the third reviewer landed in 16.12.0, and the cross-CLI smoke never caught it because it reads the matrix line instead. 100 was the smallest step that clears it, leaving 54 tokens. phase-3 and phase-4 remain amber. v16.17.0: total 57700 -> 57850 for the platform-parity cross-check. Phase 4 gained Step 1.8: when dev-context carries a counterpart app repo, the review compares the change against the other platform on four axes. Compression came first and structurally, as always - of roughly 1,610 tokens of new contract text, 1,490 never entered this budget at all, because the four axes, the file cap, the graph-query recipe, the read-only prohibitions and the rule that an extractor miss may not be reported as an absence all live in multi-agent-refs/platform-parity.md. The step itself was then cut from ~200 tokens to 120 by deleting everything the ref already owns, leaving the trigger, the pointer and the two facts an agent must not infer: the counterpart repo is read-only, and parity findings are never blocking. The baseline had 13 tokens of headroom, so no addition of any size could have fit without a bump. 150 was the smallest step that clears it, leaving 35 tokens. phase-3 and phase-4 remain amber, and phase-4's structural-compression debt still stands. v16.20.0: phase-4-review max 14750 -> 15150 and total 58250 -> 60250 for the cross-round review delta, the scope self-check handoff and the circuit-breaker wiring. Compression came first and structurally: of roughly 3,900 tokens of new contract text, 2,700 never entered this budget at all - the previous-round-findings block, the scope-self-check block, the Step 3.8 state merge, telemetry and picker wording live in multi-agent-refs/features/review-delta.md, and the scope-check record rules and consumers in features/scope-check.md - so the phase docs carry the call, the pref that gates it and the exit table. The Phase 3 stability rule and the trigger-3 write were cut twice more before the bump; phase-3 stays under its max (8692/8950). Phase 4 is the first per-phase max raised since v10.9.0: the doc gained three steps that cannot be inferred (a per-round triage file, a prefix block that changes what reviewers report, and a halt condition), and its structural-compression debt (the inline triage JSON shape, named at v15.10.0) still stands and is the next candidate. 15150 and 60250 were the smallest steps that clear it, leaving 25 and 45 tokens. v16.23.0: phase-0-init max 12400 -> 12500 and total 60250 -> 60500 for the widget-registration call and the accounting gate. Phase 0 gained the `tiles` call and the exit-3 rule, Phase 7 gained the run report; together they are contract an agent cannot infer - which call registers this host's widget, and that a completion is refused without recorded spend. Compression came first and twice, taking the new prose from 472 tokens to 255: the per-host call list moved into tracker-contract.md "The card is not the widget" and the record-then-rerun recovery into "Accounting is a gate", both outside this budget, leaving the phase docs with the call and the one fact that cannot be looked up. 100 and 250 were the smallest steps that clear it, leaving 74 and 40 tokens. phase-3 and phase-4 remain amber. v16.24.0: total 60500 -> 60750 for visual evidence. Four phase docs gained one instruction each that cannot be inferred: Phase 0 keeps the issue's own images as the pre-fix evidence, Phase 3 captures the fixed state (there and not Phase 5, because every autopilot and --local entry drops Phase 5), Phase 5 hosts the flow recording when it runs, and Phase 6 blocks on a required artefact that is neither attached nor explained. Compression came first and twice, 42 tokens back, and the contract itself never entered this budget: the trigger matrix, the three video tiers, the size-degradation ladder and both render shapes live in multi-agent-refs/features/visual-evidence.md. phase-0-init cleared its own max without a bump. 250 was the smallest step that clears the aggregate. phase-3 and phase-4 remain amber. v17.0.0: phase-0-init max 13000 -> 13100 and total 62400 -> 62500 for the evidence-verdict writer. Phase 0 Step 7.7 probed with `--platform "$PLATFORM"`, a variable no phase document ever assigned, and it was gated on `visualEvidence.required`, which no phase document ever wrote - five readers, zero writers - so the step, Phase 3's capture and Phase 6's blocker were all unreachable and the pipeline reported nothing wrong. The step now writes the verdict and derives the platform from the stack, skipping the probe with a recorded reason when there is no device platform rather than passing the empty string the probe refuses with exit 2. Compression came first and three times, 30 tokens back from the Step 7.7 index rule that restated Step 7.5 verbatim and 55 from the new block itself; the reasoning never entered this budget, because who writes the verdict and how the platform is derived live in features/visual-evidence.md sections 1a and 1b. phase-3-dev max 9250 -> 9300 in the same change: it reads the platform back from state and re-decides the provisional verdict before capturing, which is the half of the fix that makes Phase 3 honest rather than merely reachable. Compressed three times first, 29 tokens back, by pointing its Phase-5 rationale and its tier mapping at visual-evidence.md sections 3 and 4.3 where both already live. 100, 50 and 150 were the smallest steps that clear it, leaving 24, 15 and 26 tokens. phase-3 and phase-4 remain amber. v17.1.0: total 62550 -> 62600 for the Figma/toolkit MCP distinction and web as an evidence platform. Three phase docs said "MCP forbidden" without qualifying it, while the gate that enforces it (smoke-no-mcp-in-dev-phases.sh) has always matched `figma` and nothing else - so the prose banned the screenshot, xcodebuild and UI-test tools that Phase 3 Steps 3.4 and 3.55 actually call, which is one way a run reaches Phase 7 with no evidence. Phase 0 gained one `web` arm in the platform derivation, now that run-ui-tests.sh has a web arm to derive it for. Compression came first and three times, taking the new prose from 175 tokens to 30: the reasoning moved to rules.md, whose own seven-row Figma phase matrix was deleted in the same pass because it duplicated rules/figma-pipeline.md "Phase access matrix" two paragraphs below this file's own instruction not to duplicate that rule file - 74 tokens back there, which is why phase-3-dev cleared its max without a bump (9298/9300). 50 was the smallest step that clears the aggregate, leaving 37 tokens. phase-3 and phase-4 remain amber. v17.1.0 (2): total 62600 -> 62700 for the plan reaching the task widget. Phase 2 computed tasks[], their order and their dependsOn[] edges, stored them, and used them to drive Phase 3's ready-task picker - and none of it was visible on the surface the user actually watches; the card had drawn sub-phases for releases, the widget never had. Phase 2 gains one call. Compression came first and twice: the tasks[]-to-todos[] jq blob left the phase doc for plan-todos.sh `set`, which now accepts a planning-output document directly (-28, and it removes a mapping two files defined, of which this was the untested copy), and the new step's own prose was cut from 116 tokens to 61. The parsing of the plan itself never entered this budget - it lives in phase-tracker.sh `plan`, which owns the sub-phase structure it writes. 100 was the smallest step that clears it, leaving 75 tokens. phase-3 and phase-4 remain amber.
|
|
@@ -62,6 +62,7 @@ const DEV_ONLY_TOOLING = Object.freeze([
|
|
|
62
62
|
"lint-personas.mjs", // imports install/_codex-agents.mjs, which never ships to scripts/
|
|
63
63
|
"lint-mcp-refs.mjs",
|
|
64
64
|
"check-md-links.mjs",
|
|
65
|
+
"gen-ref-toc.mjs", // regenerates the repo's own reference tree; an install has no pipeline/
|
|
65
66
|
"validate-schemas.mjs", // validates the repo's own schema files, needs ajv
|
|
66
67
|
"sync-parity-check.sh",
|
|
67
68
|
"benchmark-phase-0.sh",
|
package/install/codex.mjs
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
import { existsSync, readFileSync, readdirSync, rmSync } from "fs";
|
|
21
|
-
import { join } from "path";
|
|
21
|
+
import { dirname, join } from "path";
|
|
22
22
|
|
|
23
23
|
import {
|
|
24
24
|
copyDir,
|
|
@@ -206,6 +206,7 @@ export function installCodex(ctx) {
|
|
|
206
206
|
const CODEX_SCRIPTS = join(CODEX_DIR, "scripts");
|
|
207
207
|
const CODEX_LIB = join(CODEX_DIR, "lib");
|
|
208
208
|
const CODEX_SCHEMAS = join(CODEX_DIR, "schemas");
|
|
209
|
+
const CODEX_TEMPLATES = join(CODEX_DIR, "templates");
|
|
209
210
|
const CODEX_RULES = join(CODEX_DIR, "rules");
|
|
210
211
|
const CODEX_SKILL_REFS = join(CODEX_MA_REFS, "skills");
|
|
211
212
|
|
|
@@ -221,6 +222,7 @@ export function installCodex(ctx) {
|
|
|
221
222
|
installTree("lib", pipelineSrc, CODEX_LIB, useSymlinks);
|
|
222
223
|
installTree("schemas", pipelineSrc, CODEX_SCHEMAS, useSymlinks);
|
|
223
224
|
installTree("rules", pipelineSrc, CODEX_RULES, useSymlinks);
|
|
225
|
+
installTemplates(pipelineSrc, CODEX_TEMPLATES, useSymlinks);
|
|
224
226
|
writeAgentsMd(join(CODEX_DIR, "AGENTS.md"));
|
|
225
227
|
ensureSharedPreferences(home, pipelineSrc);
|
|
226
228
|
registerMcpServer("codex", "Codex CLI");
|
|
@@ -501,6 +503,21 @@ function installScripts(pipelineSrc, dest, useSymlinks) {
|
|
|
501
503
|
// path from the caller's side, so they stay byte-identical.
|
|
502
504
|
const REWRITTEN_TREES = new Set(["rules"]);
|
|
503
505
|
|
|
506
|
+
function installTemplates(pipelineSrc, dest, useSymlinks) {
|
|
507
|
+
// Lives under install/, not pipeline/, so installTree cannot reach it. Only
|
|
508
|
+
// install/claude.mjs laid it down before, which left autopilot-on reading the
|
|
509
|
+
// launchd plist template from a directory a Codex-only host never had.
|
|
510
|
+
const src = join(dirname(pipelineSrc), "install", "templates");
|
|
511
|
+
if (!existsSync(src)) return;
|
|
512
|
+
if (!useSymlinks) {
|
|
513
|
+
ensureRealDir(dest);
|
|
514
|
+
ensureDir(dest);
|
|
515
|
+
}
|
|
516
|
+
wipeDir(dest);
|
|
517
|
+
copyDir(src, dest, { useSymlinks });
|
|
518
|
+
console.log(` -> ${countFiles(src)} template file(s) copied to ${dest}`);
|
|
519
|
+
}
|
|
520
|
+
|
|
504
521
|
function installTree(name, pipelineSrc, dest, useSymlinks) {
|
|
505
522
|
const src = join(pipelineSrc, name);
|
|
506
523
|
if (!existsSync(src)) return;
|
package/install/copilot.mjs
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { existsSync, mkdirSync, readFileSync, readdirSync, rmSync } from "fs";
|
|
12
|
-
import { join } from "path";
|
|
12
|
+
import { dirname, join } from "path";
|
|
13
13
|
|
|
14
14
|
import {
|
|
15
15
|
copyDir,
|
|
@@ -61,6 +61,7 @@ export function installCopilot(ctx) {
|
|
|
61
61
|
const COPILOT_SCHEMAS = join(COPILOT_DIR, "schemas");
|
|
62
62
|
const COPILOT_LIB = join(COPILOT_DIR, "lib");
|
|
63
63
|
const COPILOT_RULES = join(COPILOT_DIR, "rules");
|
|
64
|
+
const COPILOT_TEMPLATES = join(COPILOT_DIR, "templates");
|
|
64
65
|
|
|
65
66
|
console.log(" [Copilot CLI] Installing pipeline instructions...");
|
|
66
67
|
ensureDir(COPILOT_DIR);
|
|
@@ -71,6 +72,7 @@ export function installCopilot(ctx) {
|
|
|
71
72
|
installSchemas(pipelineSrc, COPILOT_SCHEMAS, useSymlinks);
|
|
72
73
|
installLib(pipelineSrc, COPILOT_LIB, useSymlinks);
|
|
73
74
|
installRules(pipelineSrc, COPILOT_RULES, useSymlinks);
|
|
75
|
+
installTemplates(pipelineSrc, COPILOT_TEMPLATES, useSymlinks);
|
|
74
76
|
installSkills({ home, pipelineSrc, dest: COPILOT_SKILLS, indexOnly, useSymlinks, platformFlag });
|
|
75
77
|
|
|
76
78
|
// Copilot never registered the companion MCP server, while Codex did from the day its
|
|
@@ -258,6 +260,20 @@ function installSchemas(pipelineSrc, dest, useSymlinks) {
|
|
|
258
260
|
console.log(` -> ${countFiles(schemasSrc)} files copied to ${dest}`);
|
|
259
261
|
}
|
|
260
262
|
|
|
263
|
+
function installTemplates(pipelineSrc, dest, useSymlinks) {
|
|
264
|
+
// Only install/claude.mjs used to lay this tree down, so a Copilot-only or
|
|
265
|
+
// Codex-only machine had no ~/.claude/templates - and autopilot-on reads the
|
|
266
|
+
// launchd plist template out of it. The mode would have written a job for a
|
|
267
|
+
// file the host does not have.
|
|
268
|
+
console.log(" [Copilot CLI] Installing templates...");
|
|
269
|
+
const templatesSrc = join(dirname(pipelineSrc), "install", "templates");
|
|
270
|
+
if (!existsSync(templatesSrc)) return;
|
|
271
|
+
if (!useSymlinks) ensureRealDir(dest);
|
|
272
|
+
wipeDir(dest);
|
|
273
|
+
copyDir(templatesSrc, dest, { useSymlinks });
|
|
274
|
+
console.log(` -> ${countFiles(templatesSrc)} files copied to ${dest}`);
|
|
275
|
+
}
|
|
276
|
+
|
|
261
277
|
function installLib(pipelineSrc, dest, useSymlinks) {
|
|
262
278
|
console.log(" [Copilot CLI] Installing shell libraries...");
|
|
263
279
|
const libSrc = join(pipelineSrc, "lib");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mmerterden/multi-agent-pipeline",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.4.0",
|
|
4
4
|
"description": "8-phase AI development pipeline with full orchestration on Claude Code, Copilot CLI and Codex CLI. Analysis, planning, TDD, CLI-aware parallel review with consensus surfacing + Fable triage, default-FAIL evidence gates, secret + intent guards, per-phase cost ledger, persistent learnings memory, wiki generation, commit automation. Token-preserving uninstall.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -25,13 +25,15 @@ Return ONLY a JSON object:
|
|
|
25
25
|
{
|
|
26
26
|
"findings": [{"severity": "blocking|important|suggestion", "file": "...", "line": N, "issue": "...", "fix": "...", "ruleId": "SEC-01", "criteriaSource": "ios-coding-standard"}],
|
|
27
27
|
"conformance": [{"ruleId": "SEC-01", "verdict": "conformant|violated|not-applicable", "file": "Sources/X.swift", "line": 42, "reason": "..."}],
|
|
28
|
+
"fileCoverage": [{"path": "Sources/X.swift", "verdict": "reviewed|skipped", "reason": "..."}],
|
|
28
29
|
"approved": true|false
|
|
29
30
|
}
|
|
30
31
|
```
|
|
31
32
|
|
|
32
33
|
`ruleId` + `criteriaSource` are required on a finding that comes from a cited
|
|
33
34
|
rule and omitted otherwise. `conformance` is required whenever a `${CRITERIA}`
|
|
34
|
-
block was supplied -
|
|
35
|
+
block was supplied, and `fileCoverage` whenever a `${REVIEW_FILES}` block was -
|
|
36
|
+
see below.
|
|
35
37
|
|
|
36
38
|
## Severity Classification
|
|
37
39
|
|
|
@@ -90,6 +92,38 @@ obvious breach; `judgement` rules are yours, and each needs the measurement its
|
|
|
90
92
|
When no `${CRITERIA}` block is supplied, omit `conformance` entirely and review
|
|
91
93
|
on the focus areas above.
|
|
92
94
|
|
|
95
|
+
## Review file set (required when supplied)
|
|
96
|
+
|
|
97
|
+
The orchestrator may pass a `${REVIEW_FILES}` block: the changed files you are
|
|
98
|
+
accountable for, computed before you were dispatched. Generated output,
|
|
99
|
+
lockfiles, recorded snapshots, vendored source and binaries are already removed,
|
|
100
|
+
so what is left is human-authored code and the list is not negotiable.
|
|
101
|
+
|
|
102
|
+
```
|
|
103
|
+
${REVIEW_FILES}
|
|
104
|
+
reviewed:
|
|
105
|
+
<repo-relative path>
|
|
106
|
+
...
|
|
107
|
+
excluded (not yours, listed so you can see the decision):
|
|
108
|
+
<repo-relative path> - <reason>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Return one `fileCoverage` row **per path under `reviewed`**, and no rows for
|
|
112
|
+
paths outside it. Rules:
|
|
113
|
+
|
|
114
|
+
- `reviewed` means you read the file's diff in full. There is no `partial`: what
|
|
115
|
+
you read but did not understand belongs in a `findings` entry, not in a
|
|
116
|
+
hedged verdict.
|
|
117
|
+
- `skipped` requires a `reason` naming why you could not read it - the diff was
|
|
118
|
+
truncated, the content was unreadable. "Not relevant" is not a skip reason; a
|
|
119
|
+
file you read and found nothing in is `reviewed`.
|
|
120
|
+
- A path that is neither read nor explicitly skipped fails the stage, for the
|
|
121
|
+
same reason an unanswered rule ID does: a reviewer that opened one file of ten
|
|
122
|
+
and one that read all ten return identical empty `findings` arrays, and this
|
|
123
|
+
list is what tells them apart.
|
|
124
|
+
|
|
125
|
+
When no `${REVIEW_FILES}` block is supplied, omit `fileCoverage` entirely.
|
|
126
|
+
|
|
93
127
|
## Priority Files (advisory)
|
|
94
128
|
|
|
95
129
|
When the orchestrator passes a `${PRIORITY_FILES}` block, treat it as a heuristic
|
|
@@ -122,7 +122,9 @@ Render `templates/multi-agent-autopilot.plist.template` by substituting its five
|
|
|
122
122
|
placeholders, then show the resolved **path** and interval and `AskUserQuestion`:
|
|
123
123
|
|
|
124
124
|
```bash
|
|
125
|
-
|
|
125
|
+
. "$HOME/.claude/lib/autopilot-state.sh"
|
|
126
|
+
TPL=$(ma_ap_asset templates/multi-agent-autopilot.plist.template) || {
|
|
127
|
+
echo "BLOCKED: the plist template is not installed on this host - re-run the installer"; exit 1; }
|
|
126
128
|
DEST="$HOME/Library/LaunchAgents/com.multi-agent.autopilot.plist"
|
|
127
129
|
INTERVAL=$(bash "$HOME/.claude/scripts/autopilot-status.sh" --json | jq -r '.scanIntervalSeconds // 120')
|
|
128
130
|
sed -e "s|{{NODE}}|$(command -v node)|g" \
|
|
@@ -133,6 +135,12 @@ sed -e "s|{{NODE}}|$(command -v node)|g" \
|
|
|
133
135
|
"$TPL" > "$DEST"
|
|
134
136
|
```
|
|
135
137
|
|
|
138
|
+
`ma_ap_asset` rather than a literal `$HOME/.claude/templates/...`: only
|
|
139
|
+
`install/claude.mjs` used to lay that tree down, so on a Copilot-only or
|
|
140
|
+
Codex-only machine the mode would have written a launchd job from a template
|
|
141
|
+
the host does not have. The state root stays shared on purpose - two CLIs on one
|
|
142
|
+
machine must see one queue, not two.
|
|
143
|
+
|
|
136
144
|
`command -v node` rather than the bare word: launchd does not read a login
|
|
137
145
|
shell, so its `PATH` is the short one in the plist's own `EnvironmentVariables`,
|
|
138
146
|
and a Homebrew or nvm node that is not on that path would make every tick fail
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
# ma_ap_root # prints the dir, creating it 0700 only when asked
|
|
27
27
|
# ma_ap_is_on # exit 0 when configured, 1 otherwise. NO side effects
|
|
28
28
|
# ma_ap_write <file> <- # atomic write from stdin, 0600
|
|
29
|
+
# ma_ap_asset <rel> # resolve a script/lib/template across the 3 host roots
|
|
29
30
|
|
|
30
31
|
set -uo pipefail
|
|
31
32
|
|
|
@@ -33,6 +34,39 @@ MA_AP_ROOT="${MA_AUTOPILOT_ROOT:-$HOME/.claude/autopilot}"
|
|
|
33
34
|
|
|
34
35
|
ma_ap_root() { printf '%s\n' "$MA_AP_ROOT"; }
|
|
35
36
|
|
|
37
|
+
# Where the scripts, libs and templates this mode needs actually live.
|
|
38
|
+
#
|
|
39
|
+
# This file ships into whichever host tree installed it, and a Copilot-only or
|
|
40
|
+
# Codex-only machine has no ~/.claude/scripts, no ~/.claude/lib and - the one
|
|
41
|
+
# that bites hardest - no ~/.claude/templates, which only install/claude.mjs
|
|
42
|
+
# creates. phase-tracker.sh already carries this resolver and its comment names
|
|
43
|
+
# what happens without it: "a hard-coded path silently disabled every live ping
|
|
44
|
+
# on those hosts". Autopilot reproduced the class; this is the same answer.
|
|
45
|
+
#
|
|
46
|
+
# The STATE root above is deliberately NOT resolved this way. ~/.claude/autopilot/
|
|
47
|
+
# is shared across hosts on purpose, exactly like logs/, knowledge/ and
|
|
48
|
+
# multi-agent-preferences.json, because two CLIs on one machine must see ONE
|
|
49
|
+
# queue. Resolving it per host would hand a Copilot session a second, invisible
|
|
50
|
+
# queue and the same item would be taken twice.
|
|
51
|
+
MA_AP_HOST_ROOT="${MA_AP_HOST_ROOT:-$(cd "$(dirname "${BASH_SOURCE[0]}")/.." 2>/dev/null && pwd)}"
|
|
52
|
+
|
|
53
|
+
ma_ap_asset() { # $1 = path relative to a host root, e.g. scripts/autopilot-runner.mjs
|
|
54
|
+
local rel="$1" root
|
|
55
|
+
# The tree this file was sourced from wins: on a machine with all three
|
|
56
|
+
# installed, the caller's own tree is the one that is current.
|
|
57
|
+
if [ -n "$MA_AP_HOST_ROOT" ] && [ -e "$MA_AP_HOST_ROOT/$rel" ]; then
|
|
58
|
+
printf '%s\n' "$MA_AP_HOST_ROOT/$rel"
|
|
59
|
+
return 0
|
|
60
|
+
fi
|
|
61
|
+
for root in "$HOME/.claude" "$HOME/.copilot" "$HOME/.codex"; do
|
|
62
|
+
if [ -e "$root/$rel" ]; then
|
|
63
|
+
printf '%s\n' "$root/$rel"
|
|
64
|
+
return 0
|
|
65
|
+
fi
|
|
66
|
+
done
|
|
67
|
+
return 1
|
|
68
|
+
}
|
|
69
|
+
|
|
36
70
|
MA_AP_LABEL="${MA_AUTOPILOT_LABEL:-com.multi-agent.autopilot}"
|
|
37
71
|
MA_AP_PLIST="${MA_AUTOPILOT_PLIST:-$HOME/Library/LaunchAgents/$MA_AP_LABEL.plist}"
|
|
38
72
|
|
|
@@ -4,6 +4,16 @@ description: "Internal - dev context (extra repos) picker for multi-agent."
|
|
|
4
4
|
|
|
5
5
|
# _dev-context - Extra Dev Repo Selection
|
|
6
6
|
|
|
7
|
+
<!-- toc -->
|
|
8
|
+
- [Steps](#steps)
|
|
9
|
+
- [Web repos - `webRepos`](#web-repos---webrepos)
|
|
10
|
+
- [Pref override - `editableRelatedRepos`](#pref-override---editablerelatedrepos)
|
|
11
|
+
- [Output](#output)
|
|
12
|
+
- [Rule](#rule)
|
|
13
|
+
- [Autopilot Behavior](#autopilot-behavior)
|
|
14
|
+
- [Pipeline contract for read-only siblings](#pipeline-contract-for-read-only-siblings)
|
|
15
|
+
<!-- /toc -->
|
|
16
|
+
|
|
7
17
|
Selects extra repos the pipeline may touch beyond the primary repo(s) - typically submodules (e.g. SDKs vendored inside an app repo) or sibling libraries. Each candidate is enriched with a `canPush` flag so the picker can pre-select repos that the active account is allowed to edit, and surface read-only ones as advisory context the pipeline will not modify.
|
|
8
18
|
|
|
9
19
|
> **Language**: see `picker-contract.md` + `rules.md` Language Application matrix.
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
# Locked decisions (
|
|
1
|
+
# Locked decisions (37)
|
|
2
2
|
|
|
3
|
-
> The
|
|
3
|
+
> The 37 Locked decisions of the analysis flow. Loaded by `/multi-agent:analysis`, by `/multi-agent:analysis-resolve` (which inherits them) and by pipeline Phase 1 when it runs the analysis engine. Numbering is canonical: cite as `Locked <n> (<short label>)`.
|
|
4
4
|
|
|
5
5
|
### Index by category (v9.1.0+)
|
|
6
6
|
|
|
7
|
-
Browse-friendly grouping of the
|
|
7
|
+
Browse-friendly grouping of the 37 Locked decisions. Numbering stays canonical (matches the list below); the index is read-only navigation.
|
|
8
8
|
|
|
9
9
|
| Category | Decisions | Concern |
|
|
10
10
|
|---|---|---|
|
|
11
11
|
| **A. Governance** | 1, 5, 6, 7, 10, 26, 27, 32, 36 | Run-level process rules: one feature per run, default output, auto-commit ban, punctuation policy, output picker timing, Pass B preview, evidence digest cache, analysis profile, document reviewed before publish |
|
|
12
12
|
| **B. Citation and Evidence** | 3, 4, 8, 11, 24, 30, 34 | Every fact in the doc traces back to a source: citation discipline, forward-looking spec, standards binding, repo-evidence reuse-first, Pass B footnote mandatory, analysis self-contained (pipeline-wide), references built from the evidence record |
|
|
13
|
-
| **C. Output Format and Structure** | 2, 9, 13, 14, 16, 17, 20, 21, 25, 33, 35 | How the document is laid out: section omission rule, per-platform output split, Gherkin user stories, Goals + Non-Goals paired, Files-to-Add tag, API response variants exhaustive, localization mode (ownership-aware), References at the bottom, Lite mode, corporate backbone always renders, stack-optional render |
|
|
13
|
+
| **C. Output Format and Structure** | 2, 9, 13, 14, 16, 17, 20, 21, 25, 33, 35, 37 | How the document is laid out: section omission rule, per-platform output split, Gherkin user stories, Goals + Non-Goals paired, Files-to-Add tag, API response variants exhaustive, localization mode (ownership-aware), References at the bottom, Lite mode, corporate backbone always renders, stack-optional render, redesign records v1 before planning v2 |
|
|
14
14
|
| **D. Design Source and Pipeline Architecture** | 12, 22, 23 | Where design comes from and how the pipeline renders: Figma 3-tier access (BLOCKING), platform-agnostic template + Pass B render, convention extraction (Phase 1c) |
|
|
15
15
|
| **E. UI, Variant, and Test Coverage** | 15, 18, 19, 28, 29, 31 | UI artefact rules: SVG default for new assets, screenshots embedded, all Figma variants drilled, SwiftUI Preview block (iOS), variant usage explicit, business-rule to acceptance-criterion to test traceability |
|
|
16
16
|
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Redesign mode - the contract
|
|
2
2
|
|
|
3
|
+
<!-- toc -->
|
|
4
|
+
- [What the mode is for](#what-the-mode-is-for)
|
|
5
|
+
- [Why it is an option and not a mode](#why-it-is-an-option-and-not-a-mode)
|
|
6
|
+
- [The three artefacts](#the-three-artefacts)
|
|
7
|
+
- [The eight checks](#the-eight-checks)
|
|
8
|
+
- [The cache, and the silent failure to avoid](#the-cache-and-the-silent-failure-to-avoid)
|
|
9
|
+
<!-- /toc -->
|
|
10
|
+
|
|
3
11
|
Loaded only when `state.analysisSpec.options.redesign` is true, the same way
|
|
4
12
|
`analysis/review.md` is loaded only by a reviewer subagent. A run that is not a
|
|
5
13
|
redesign never pays for this file.
|
|
@@ -124,10 +124,11 @@ Result: `state.analysisSpec.outputs.requested[]`.
|
|
|
124
124
|
for f in /tmp/analysis-<feature-slug>-<ts>/*.md; do
|
|
125
125
|
node "$HOME/.claude/scripts/validate-analysis-doc.mjs" "$f" || GATE_FAILED=1
|
|
126
126
|
node "$HOME/.claude/scripts/build-references.mjs" <state.json> --check "$f" || GATE_FAILED=1
|
|
127
|
+
node "$HOME/.claude/scripts/verify-citations.mjs" "$f" --repo "$REPO_ROOT" || GATE_FAILED=1
|
|
127
128
|
done
|
|
128
129
|
```
|
|
129
130
|
|
|
130
|
-
`validate-analysis-doc.mjs` enforces the mechanically-checkable Locked decisions on the emitted markdown itself (front-matter completeness, never-omitted sections per Locked 2, humanizer punctuation per Locked 7, Full-mode business-rule traceability per Locked 31, and in the corporate profile the backbone presence and `EKLENECEK`-to-Section-20 pairing per Locked 33). `build-references.mjs --check` runs the References coverage gate (Locked 34): a source the run consumed but did not list, or a listed row with no evidence behind it, blocks dispatch. Any ERROR blocks dispatch: fix the draft and re-validate. Warnings are advisory (run with `--strict` to treat them as blocking). This turns the "fails the dispatch gate" prose into a real, model-independent check.
|
|
131
|
+
`validate-analysis-doc.mjs` enforces the mechanically-checkable Locked decisions on the emitted markdown itself (front-matter completeness, never-omitted sections per Locked 2, humanizer punctuation per Locked 7, Full-mode business-rule traceability per Locked 31, and in the corporate profile the backbone presence and `EKLENECEK`-to-Section-20 pairing per Locked 33). `build-references.mjs --check` runs the References coverage gate (Locked 34): a source the run consumed but did not list, or a listed row with no evidence behind it, blocks dispatch. `verify-citations.mjs` resolves each claimed `file:line` at HEAD with `git cat-file`, so `Foo.swift:9999` in a repo with no Foo.swift blocks dispatch (Locked 3, Locked 37). Any ERROR blocks dispatch: fix the draft and re-validate. Warnings are advisory (run with `--strict` to treat them as blocking). This turns the "fails the dispatch gate" prose into a real, model-independent check.
|
|
131
132
|
|
|
132
133
|
Iterate `state.analysisSpec.outputs.requested`. For each target:
|
|
133
134
|
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# Analysis document review (`/multi-agent:review-analysis`)
|
|
2
2
|
|
|
3
|
+
<!-- toc -->
|
|
4
|
+
- [Phase 0 - Resolve the document](#phase-0---resolve-the-document)
|
|
5
|
+
- [Phase 1 - Deterministic gates first](#phase-1---deterministic-gates-first)
|
|
6
|
+
- [Phase 1.5 - What did the run skip?](#phase-15---what-did-the-run-skip)
|
|
7
|
+
- [Phase 2 - Rubric](#phase-2---rubric)
|
|
8
|
+
- [Phase 3 - Triage and verdict](#phase-3---triage-and-verdict)
|
|
9
|
+
- [Phase 4 - Output](#phase-4---output)
|
|
10
|
+
<!-- /toc -->
|
|
11
|
+
|
|
3
12
|
> Reviews a written analysis the way `/multi-agent:review` reviews a diff. Loaded on demand. Read-only: no branch, no worktree, no commit, and the source document is never edited in place.
|
|
4
13
|
|
|
5
14
|
`/multi-agent:review` answers "is this code right". This answers "could an implementer build the thing from this document, and does the document keep the promises its own contract makes". The two are different questions with the same failure mode: a reviewer who has opinions instead of rules produces findings nobody can act on. So this flow cites `Locked <n>` the way a code review cites a rule ID.
|