@mmerterden/multi-agent-pipeline 23.6.0 → 23.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +6 -5
  3. package/README.tr.md +6 -5
  4. package/docs/architecture.md +7 -5
  5. package/docs/ecosystem.md +6 -6
  6. package/docs/engineering.md +1 -1
  7. package/docs/facts.json +4 -3
  8. package/package.json +1 -1
  9. package/pipeline/commands/multi-agent/SKILL.md +3 -2
  10. package/pipeline/commands/multi-agent/resume/SKILL.md +2 -0
  11. package/pipeline/commands/multi-agent/review-rounds/SKILL.md +94 -0
  12. package/pipeline/commands/multi-agent/sync/SKILL.md +3 -3
  13. package/pipeline/lib/usage-names.generated.mjs +3 -0
  14. package/pipeline/multi-agent-refs/_input-parser.md +1 -1
  15. package/pipeline/multi-agent-refs/component-dispatch.md +2 -2
  16. package/pipeline/multi-agent-refs/cross-cli-contract.md +3 -3
  17. package/pipeline/multi-agent-refs/features/autopilot-circuit-breaker.md +4 -4
  18. package/pipeline/multi-agent-refs/features/review-delta.md +1 -1
  19. package/pipeline/multi-agent-refs/features/review-rounds.md +40 -0
  20. package/pipeline/multi-agent-refs/features/rework-escalation.md +5 -4
  21. package/pipeline/multi-agent-refs/help/en.md +3 -1
  22. package/pipeline/multi-agent-refs/help/tr.md +3 -1
  23. package/pipeline/multi-agent-refs/orchestrator/copilot-pipeline.md +1 -1
  24. package/pipeline/multi-agent-refs/phases/operations.md +1 -1
  25. package/pipeline/multi-agent-refs/phases/phase-0-init.md +1 -1
  26. package/pipeline/multi-agent-refs/phases/phase-2-dev.md +4 -4
  27. package/pipeline/multi-agent-refs/phases/phase-3-review.md +7 -3
  28. package/pipeline/multi-agent-refs/resume/details.md +2 -0
  29. package/pipeline/office/index.html +2 -2
  30. package/pipeline/schemas/agent-state.schema.json +19 -1
  31. package/pipeline/schemas/phases.json +2 -2
  32. package/pipeline/schemas/prefs.schema.json +15 -3
  33. package/pipeline/schemas/token-budget.json +2 -2
  34. package/pipeline/scripts/gen-facts.mjs +9 -4
  35. package/pipeline/scripts/review-rounds.mjs +592 -0
  36. package/pipeline/scripts/rework-escalation.mjs +7 -3
  37. package/pipeline/scripts/validate-state.mjs +19 -11
  38. package/pipeline/skills/.skill-manifest.json +9 -5
  39. package/pipeline/skills/.skills-index.json +12 -1
  40. package/pipeline/skills/shared/README.md +4 -3
  41. package/pipeline/skills/shared/core/multi-agent/SKILL.md +3 -3
  42. package/pipeline/skills/shared/core/multi-agent-resume/SKILL.md +1 -1
  43. package/pipeline/skills/shared/core/multi-agent-review-rounds/SKILL.md +92 -0
  44. package/pipeline/skills/shared/core/multi-agent-sync/SKILL.md +3 -3
  45. package/pipeline/skills/skills-index.md +2 -1
package/CHANGELOG.md CHANGED
@@ -16,6 +16,24 @@ Internal file-layout changes that don't affect the slash-command surface are sti
16
16
 
17
17
  ## [Unreleased]
18
18
 
19
+ ## [23.7.0] - 2026-11-13
20
+
21
+ ### Added
22
+
23
+ - `/multi-agent:review-rounds`: how many times review may send work back to development before the run stops, 1 to 3. With no argument it shows the effective value and its source and asks with a picker (2 rounds recommended, 3 rounds, 1 round); `status` prints, `1`, `2` or `3` sets it globally, `--repo` scopes it to the current repository, `reset` removes the override. Unattended runs never open the picker. The office lists it as a terminal command until its settings window carries the switch.
24
+ - `/multi-agent "task" --review-rounds N`: the limit for one run, stored as `state.reviewRounds`.
25
+ - `scripts/review-rounds.mjs`: the one resolver every reader of the limit goes through (`get`, `set`, `reset`, `parse`, `record`). Precedence: run flag, `prefs.projects.<slug>.maxReworkCycles`, `prefs.global.review.maxReworkCycles`, default. A stored value outside 1 to 3 is ignored and reported.
26
+ - `docs/facts.json` carries `reworkDefault` beside `reworkCap`.
27
+
28
+ ### Changed
29
+
30
+ - The default review rework limit is 2, down from 3. A run that never set the preference now allows two rework rounds before the Phase 2 hard-kill ruling applies; `/multi-agent:review-rounds 3` or `/multi-agent "task" --review-rounds 3` restores three. The ceiling stays 3 (the Phase 2 `retryCount` cap). An explicit stored value is kept as it is; nothing is migrated.
31
+ - With limit N, review sends work back to development N times, every rework is reviewed again, and the run stops when a review still has accepted findings after N reworks (N reworks, at most N + 1 reviews). The decision moved to Phase 3 Step 4: `review-rounds.mjs next` answers `rework` (and records it) or `rule`, which runs `rework-rulings.mjs` on the current triage. Phase 2 re-entry no longer counts or compares anything.
32
+ - `review-rounds.mjs next` is idempotent per review iteration: it records `phases["2"].reworkForIteration` with the increment, answers `rework` again without counting twice, and resume re-enters a decided, unfinished rework instead of deciding again.
33
+ - Reworks are counted in `state.phases["2"].reworkCount` (integer 0 to 3, validated); `retryCount` counts build and component-dispatch retries only, with its own cap of 3.
34
+ - The rework-escalation script and the autopilot circuit-breaker read the same resolver. In an autopilot run `prefs.global.autopilotCircuitBreaker.maxReworkCycles`, when set and the breaker is enabled, lowers the limit (source `breaker`); it has no default and never raises it. The limit itself is `prefs.global.review.maxReworkCycles` (default 2).
35
+ - The per-repo key is the repository's folder name as is (no normalisation), the same value as `state.project`, on the command side and the run side. `--repo` outside a repository, or with a key it cannot resolve, or `--project` without `--repo`, exits 2 and writes nothing. A repeated `--review-rounds` flag is refused.
36
+
19
37
  ## [23.6.0] - 2026-11-13
20
38
 
21
39
  ### Added
package/README.md CHANGED
@@ -158,7 +158,7 @@ The discipline behind all of this - bounded loops, evidence gates, token-budgete
158
158
 
159
159
  ## Commands
160
160
 
161
- `/multi-agent` plus <!-- fact:commandCount -->80<!-- /fact --> sub-commands. `/multi-agent:help` renders the same catalog in your terminal, in your `outputLanguage`.
161
+ `/multi-agent` plus <!-- fact:commandCount -->81<!-- /fact --> sub-commands. `/multi-agent:help` renders the same catalog in your terminal, in your `outputLanguage`.
162
162
 
163
163
  ### Pipeline entries
164
164
 
@@ -267,6 +267,7 @@ The discipline behind all of this - bounded loops, evidence gates, token-budgete
267
267
  | `/multi-agent:stack [ids]` | Enable the marketplace plugin(s) for this repo. Multi-select |
268
268
  | `/multi-agent:scaffold <stack> <name>` | New project skeleton from the toolkit's scaffold skill, green before its first commit |
269
269
  | `/multi-agent:language [en\|tr]` | Show or set `outputLanguage`; `promptLanguage` stays English |
270
+ | `/multi-agent:review-rounds [1\|2\|3\|status\|reset] [--repo]` | How many times review may send work back to development: <!-- fact:reworkDefault -->2<!-- /fact --> rounds by default, adjustable from 1 to <!-- fact:reworkCap -->3<!-- /fact -->. No argument opens a picker; `/multi-agent "task" --review-rounds N` sets it for one run |
270
271
  | `/multi-agent:sync` | One-shot sync: Claude Code, Copilot CLI, pipeline repo, website, toolkit MCP |
271
272
  | `/multi-agent:update` | Update to the latest published npm release and run migrations |
272
273
  | `/multi-agent:doctor` | Health check of the install: layout, preferences, credentials, hooks, host capabilities; the exit code is the verdict |
@@ -500,17 +501,17 @@ This enables the matching plugin (+ the shared `ai-common` plugin) in the repo's
500
501
 
501
502
  ## Tool support
502
503
 
503
- The pipeline runs natively on **Claude Code**, **Copilot CLI** and **Codex CLI** - all three install from the same `pipeline/` source and get the same <!-- fact:commandCount -->80<!-- /fact --> commands.
504
+ The pipeline runs natively on **Claude Code**, **Copilot CLI** and **Codex CLI** - all three install from the same `pipeline/` source and get the same <!-- fact:commandCount -->81<!-- /fact --> commands.
504
505
 
505
506
  | Tool | Flag | What it installs |
506
507
  | ----------- | -------------------- | ------------------------------------------------------------------------------------------------------ |
507
508
  | Claude Code | `--claude` (default) | slash commands + skills + agents + the enforcement hooks (secret scan, agent-guard, read-size gate, run-scope guard, run-stop guard) |
508
- | Copilot CLI | `--copilot` | instructions + <!-- fact:commandCount -->80<!-- /fact --> sub-command skills + scripts |
509
- | Codex CLI | `--codex` | one router skill + <!-- fact:commandCount -->80<!-- /fact --> specs as refs + a `/multi-agent-<name>` prompt per user-only command + <!-- fact:agentCount -->11<!-- /fact --> agent TOML + `AGENTS.md` block + `codex mcp add` |
509
+ | Copilot CLI | `--copilot` | instructions + <!-- fact:commandCount -->81<!-- /fact --> sub-command skills + scripts |
510
+ | Codex CLI | `--codex` | one router skill + <!-- fact:commandCount -->81<!-- /fact --> specs as refs + a `/multi-agent-<name>` prompt per user-only command + <!-- fact:agentCount -->11<!-- /fact --> agent TOML + `AGENTS.md` block + `codex mcp add` |
510
511
 
511
512
  Filter skills by stack with `--platform=ios\|android\|all`.
512
513
 
513
- **Why Codex gets one skill and not <!-- fact:commandCount -->80<!-- /fact -->.** Codex assembles every discovered skill's name
514
+ **Why Codex gets one skill and not <!-- fact:commandCount -->81<!-- /fact -->.** Codex assembles every discovered skill's name
514
515
  and description into a single prompt block and drops entries when it overflows, with no
515
516
  error. Measured on 0.145: installing one plugin that declares 142 skills surfaced only
516
517
  75 of them and evicted an unrelated user skill. So on Codex the pipeline ships a single
package/README.tr.md CHANGED
@@ -157,7 +157,7 @@ Koşunun kendisinde ayarlanabilen tek şey autopilot; geri kalan her şey kendi
157
157
 
158
158
  ## Komutlar
159
159
 
160
- `/multi-agent` ve <!-- fact:commandCount -->80<!-- /fact --> alt komut. `/multi-agent:help` aynı katalogu terminalde, `outputLanguage` ayarına göre gösterir.
160
+ `/multi-agent` ve <!-- fact:commandCount -->81<!-- /fact --> alt komut. `/multi-agent:help` aynı katalogu terminalde, `outputLanguage` ayarına göre gösterir.
161
161
 
162
162
  ### Pipeline girişleri
163
163
 
@@ -266,6 +266,7 @@ Koşunun kendisinde ayarlanabilen tek şey autopilot; geri kalan her şey kendi
266
266
  | `/multi-agent:stack [id]` | Bu repo için marketplace plugin'lerini etkinleştirir. Çoklu seçim |
267
267
  | `/multi-agent:scaffold <stack> <ad>` | Toolkit'in scaffold skill'i ile yeni proje iskeleti; ilk commit'ten önce yeşil |
268
268
  | `/multi-agent:language [en\|tr]` | `outputLanguage`'i gösterir veya değiştirir; `promptLanguage` İngilizce kalır |
269
+ | `/multi-agent:review-rounds [1\|2\|3\|status\|reset] [--repo]` | Review işi geliştirmeye kaç kez geri gönderebilir: varsayılan <!-- fact:reworkDefault -->2<!-- /fact --> tur, 1 ile <!-- fact:reworkCap -->3<!-- /fact --> arasında ayarlanır. Argümansız çalışınca seçici açılır; `/multi-agent "görev" --review-rounds N` tek koşu için ayarlar |
269
270
  | `/multi-agent:sync` | Tek atımlık senkron: Claude Code, Copilot CLI, pipeline repo, website, toolkit MCP |
270
271
  | `/multi-agent:update` | npm'deki son yayına günceller ve migration'ları koşar |
271
272
  | `/multi-agent:doctor` | Kurulumun sağlık kontrolü: yerleşim, tercihler, kimlik bilgileri, hook'lar, host yetenekleri; çıkış kodu verdiktin kendisi |
@@ -498,17 +499,17 @@ Bu, ilgili plugin'i (+ ortak `ai-common` plugin'ini) repo'nun `.claude/settings.
498
499
 
499
500
  ## Araç desteği
500
501
 
501
- Pipeline **Claude Code**, **Copilot CLI** ve **Codex CLI** üzerinde native çalışır - üçü de aynı `pipeline/` kaynağından kurulur ve aynı <!-- fact:commandCount -->80<!-- /fact --> komutu alır.
502
+ Pipeline **Claude Code**, **Copilot CLI** ve **Codex CLI** üzerinde native çalışır - üçü de aynı `pipeline/` kaynağından kurulur ve aynı <!-- fact:commandCount -->81<!-- /fact --> komutu alır.
502
503
 
503
504
  | Araç | Bayrak | Ne kurar |
504
505
  | ----------- | ----------------------- | ---------------------------------------------------------------------------------------------------------------- |
505
506
  | Claude Code | `--claude` (varsayılan) | slash komutları + skill'ler + agent'lar + üç `PreToolUse` hook'u (secret scan, agent-guard, okuma-boyutu geçidi) |
506
- | Copilot CLI | `--copilot` | talimatlar + <!-- fact:commandCount -->80<!-- /fact --> alt-komut skill'i + script'ler |
507
- | Codex CLI | `--codex` | bir router skill + ref olarak <!-- fact:commandCount -->80<!-- /fact --> spec + yalnızca kullanıcının yazdığı her komut için bir `/multi-agent-<ad>` prompt'u + <!-- fact:agentCount -->11<!-- /fact --> agent TOML + `AGENTS.md` bloğu + `codex mcp add` |
507
+ | Copilot CLI | `--copilot` | talimatlar + <!-- fact:commandCount -->81<!-- /fact --> alt-komut skill'i + script'ler |
508
+ | Codex CLI | `--codex` | bir router skill + ref olarak <!-- fact:commandCount -->81<!-- /fact --> spec + yalnızca kullanıcının yazdığı her komut için bir `/multi-agent-<ad>` prompt'u + <!-- fact:agentCount -->11<!-- /fact --> agent TOML + `AGENTS.md` bloğu + `codex mcp add` |
508
509
 
509
510
  Skill'leri stack'e göre filtrele: `--platform=ios\|android\|all`.
510
511
 
511
- **Codex neden <!-- fact:commandCount -->80<!-- /fact --> değil de tek bir skill alıyor.** Codex, keşfettiği her skill'in adını
512
+ **Codex neden <!-- fact:commandCount -->81<!-- /fact --> değil de tek bir skill alıyor.** Codex, keşfettiği her skill'in adını
512
513
  ve açıklamasını tek bir prompt bloğuna toplar ve blok taştığında girdileri hatasızca
513
514
  düşürür. 0.145 üzerinde ölçüldü: 142 skill deklare eden bir plugin kurulduğunda sadece
514
515
  75'i yüzeye çıktı ve alakasız bir kullanıcı skill'i tahliye edildi. Bu yüzden Codex'te
@@ -46,6 +46,7 @@ graph LR
46
46
 
47
47
  ## Review Architecture (Phase 3)
48
48
 
49
+ <!-- facts: reworkDefault="rounds by" -->
49
50
  ```mermaid
50
51
  graph TD
51
52
  DIFF["Code Diff"]
@@ -59,7 +60,7 @@ graph TD
59
60
  SON --> TRIAGE
60
61
 
61
62
  TRIAGE -->|PASS| P4["Phase 4: Commit"]
62
- TRIAGE -->|FIX_REQUIRED| P2["Phase 2: Dev (retry ≤3x)"]
63
+ TRIAGE -->|FIX_REQUIRED| P2["Phase 2: Dev (rework, 2 rounds by default)"]
63
64
 
64
65
  style TRIAGE fill:#ffd,stroke:#333
65
66
  style P3 fill:#fdd,stroke:#333
@@ -115,7 +116,7 @@ graph TB
115
116
  end
116
117
 
117
118
  subgraph "Pipeline Specs"
118
- CMD[commands/<br/>80 command files]
119
+ CMD[commands/<br/>81 command files]
119
120
  AGT[agents/<br/>11 agent personas]
120
121
  RUL[rules/<br/>domain rules]
121
122
  PHS[multi-agent-refs/phases/<br/>phase specs + contracts]
@@ -140,6 +141,7 @@ graph TB
140
141
 
141
142
  ## Data Flow
142
143
 
144
+ <!-- facts: reworkDefault="rounds" reworkCap="max" -->
143
145
  ```
144
146
  User Input → Phase 0 (Init)
145
147
  ↓
@@ -147,7 +149,7 @@ User Input → Phase 0 (Init)
147
149
  ↓
148
150
  Phase 1 (Plan: analysis + breakdown + approval gate)
149
151
  ↓
150
- Phase 2 (Dev) ←──────── retry loop (max 3x)
152
+ Phase 2 (Dev) ←──────── retry loop (default 2 rounds, 3 max, adjustable)
151
153
  ↓ ↑
152
154
  Verify exit gate │
153
155
  build · lint · tests · secrets
@@ -207,8 +209,8 @@ repo and the website, plus the two independently shipped repos
207
209
  ```mermaid
208
210
  graph TD
209
211
  CC["Claude Code<br/>(source of truth)"]
210
- COP["Copilot CLI<br/>(instructions + 80 sub-command skills)"]
211
- COD["Codex CLI<br/>(1 router skill + 80 refs)"]
212
+ COP["Copilot CLI<br/>(instructions + 81 sub-command skills)"]
213
+ COD["Codex CLI<br/>(1 router skill + 81 refs)"]
212
214
  REPO["Pipeline Repo<br/>(npm package)"]
213
215
  WEB["Website"]
214
216
  PLUGREPO["multi-agent-plugins<br/>(6 plugins, own repo)"]
package/docs/ecosystem.md CHANGED
@@ -5,7 +5,7 @@ separately, wired together at install time and at run time:
5
5
 
6
6
  | Repo | What it owns | Ships as |
7
7
  |---|---|---|
8
- | **`multi-agent-pipeline`** (this repo) | Orchestration: the <!-- fact:phaseCount -->6<!-- /fact -->-phase flow, the <!-- fact:commandCount -->80<!-- /fact --> slash commands, quality gates, review/triage, cross-CLI parity | npm package (`@mmerterden/multi-agent-pipeline`), installs itself onto Claude Code / Copilot CLI / Codex CLI |
8
+ | **`multi-agent-pipeline`** (this repo) | Orchestration: the <!-- fact:phaseCount -->6<!-- /fact -->-phase flow, the <!-- fact:commandCount -->81<!-- /fact --> slash commands, quality gates, review/triage, cross-CLI parity | npm package (`@mmerterden/multi-agent-pipeline`), installs itself onto Claude Code / Copilot CLI / Codex CLI |
9
9
  | **`multi-agent-plugins`** | Stack knowledge: per-platform component/lifecycle skills (iOS, Android, Frontend, Backend) + shared knowledge | Claude Code marketplace, 6 independently-versioned plugins |
10
10
  | **`multi-agent-mcp`** | The pipeline's hands on devices and browsers: <!-- fact:toolCount -->267<!-- /fact --> MCP tools across <!-- fact:toolFamilyCount -->25<!-- /fact --> families (simulator/emulator control, end-to-end locators and assertions, memory, crash diagnostics, accessibility audit, store compliance and listing lint, web automation and scraping, Figma-vs-mock design audit with contrast checks, code intelligence, a code graph, a learnings ledger, wallet passes, an agent-DSL batch runner, a full-text context index with text-to-image rendering, provider-backed and community research, opt-in social reading, verified hand-off of simple text tasks to free models, video key frames and transcripts, offline security scoring with evidence checks, SARIF export and MCP config launch-selector audits, read-only access to related repositories at their latest branch, travel document fixtures, a voice channel, App Store Connect and Play Console APIs, virtual iPhones, offline facts about builds you own) | npm package, registered as a standard stdio MCP server on every host |
11
11
 
@@ -19,7 +19,7 @@ Either can be swapped or removed without touching the other two's source.
19
19
  graph LR
20
20
  subgraph PIPE ["multi-agent-pipeline (orchestrator)"]
21
21
  direction TB
22
- PHASES["6 phases · 80 commands"]
22
+ PHASES["6 phases · 81 commands"]
23
23
  GATES["deterministic gates + review triage"]
24
24
  end
25
25
 
@@ -70,8 +70,8 @@ only those:
70
70
  graph TD
71
71
  CC["Claude Code<br/>~/.claude/commands/multi-agent/<br/>(source of truth)"]
72
72
 
73
- CC -->|"Step 2: copy + reformat<br/>80 sub-command skills"| COP["Copilot CLI<br/>~/.copilot/skills/"]
74
- CC -->|"Step 2b: transform<br/>(install.js --codex)"| COD["Codex CLI<br/>1 router skill + 80 refs<br/>+ 11 agent TOML"]
73
+ CC -->|"Step 2: copy + reformat<br/>81 sub-command skills"| COP["Copilot CLI<br/>~/.copilot/skills/"]
74
+ CC -->|"Step 2b: transform<br/>(install.js --codex)"| COD["Codex CLI<br/>1 router skill + 81 refs<br/>+ 11 agent TOML"]
75
75
  CC -->|"Step 3: genericize<br/>(strip personal data)"| REPO["multi-agent-pipeline repo<br/>pipeline/"]
76
76
  CC -->|"Step 4: version + feature sync"| WEB["Website<br/>projects.ts / i18n.tsx"]
77
77
 
@@ -162,7 +162,7 @@ measurements behind this table):
162
162
 
163
163
  | | Claude Code | Copilot CLI | Codex CLI |
164
164
  |---|---|---|---|
165
- | **Pipeline commands** | <!-- fact:commandCount -->80<!-- /fact --> slash-command skills, native | <!-- fact:commandCount -->80<!-- /fact --> sub-command skills, `multi-agent-{cmd}` naming, copied in | 1 router skill (`multi-agent`) + <!-- fact:commandCount -->80<!-- /fact --> command specs as reference files - Codex silently truncates its skills block past a few dozen entries, so sub-commands are not peer skills here |
165
+ | **Pipeline commands** | <!-- fact:commandCount -->81<!-- /fact --> slash-command skills, native | <!-- fact:commandCount -->81<!-- /fact --> sub-command skills, `multi-agent-{cmd}` naming, copied in | 1 router skill (`multi-agent`) + <!-- fact:commandCount -->81<!-- /fact --> command specs as reference files - Codex silently truncates its skills block past a few dozen entries, so sub-commands are not peer skills here |
166
166
  | **Stack plugins** | Marketplace plugin, loaded natively, resolved by `.claude/settings.json` enabled-list | Enabled plugin's authored skills copied flat into `~/.copilot/skills/`; `knowledge/` **not** re-copied (already delivered via `shared/external`) | Copied as reference files under `~/.codex/multi-agent-refs/skills/`, plugin-prefixed on name clash (e.g. `architecture` → `ai-ios-toolkit-architecture`) |
167
167
  | **Component dispatch (Phase 3)** | Marketplace plugin's `create-component`/`create-screen` skill via the Skill tool | No plugin loader - the enabled stack plugin's authored skills (incl. `create-component`) are copied flat into `~/.copilot/skills/` at install time (the old frozen `figma-*` copies are pruned, they were never a fallback) | Not part of the enforced parity axis; classification + state-shape must match, skill *inventory* does not |
168
168
  | **multi-agent-mcp** | `claude mcp add multi-agent -- npx -y @mmerterden/multi-agent-mcp` | `copilot mcp add multi-agent -- npx -y @mmerterden/multi-agent-mcp` | `codex mcp add multi-agent -- npx -y @mmerterden/multi-agent-mcp` (skipped with a warning if `codex` isn't on `PATH`) |
@@ -201,7 +201,7 @@ graph TD
201
201
  **Phase 2 → plugin** is a one-shot delegation: the plugin skill does its own
202
202
  lifecycle (test → code → build → wiki) and reports back a coarse
203
203
  `component-build` result; the pipeline does not re-implement any of that logic, and
204
- a plugin failure counts against the pipeline's own retry cap (`retryCount === 3` →
204
+ a plugin failure counts against the pipeline's own retry cap (the build-retry cap of 3, `retryCount` →
205
205
  hard stop, per `component-dispatch.md`).
206
206
 
207
207
  **`/multi-agent:scaffold` → plugin** uses the same seam for a new project: the
@@ -8,7 +8,7 @@ Every loop in the pipeline has a deterministic exit condition and a hard iterati
8
8
 
9
9
  - **TDD micro-loop** (Phase 2): red -> green -> refactor per task; build-fix retries capped at 3 attempts.
10
10
  - **Dev-critic loop** (Phase 2.5, opt-in): generator vs critic on deterministic criteria; max 2 iterations, round 3 escalates to the user.
11
- - **Review-fix macro-loop** (Phase 2 <-> 3): only triage-accepted blocking findings re-enter development; max 3 iterations, then hard-kill and escalate.
11
+ - **Review-fix macro-loop** (Phase 2 <-> 3): only triage-accepted blocking findings re-enter development; <!-- fact:reworkDefault -->2<!-- /fact --> rework rounds by default, adjustable from 1 to <!-- fact:reworkCap -->3<!-- /fact --> (`/multi-agent:review-rounds`), then hard-kill and escalate.
12
12
  - **Disagreement round** (Phase 3, opt-in): when reviewers split, exactly one rebuttal round - never more.
13
13
  - **Global rule**: any retry loop stops after 3 attempts and asks the user. No exceptions, no infinite loops.
14
14
 
package/docs/facts.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$comment": "Generated by pipeline/scripts/gen-facts.mjs. Do not hand-edit: the site reads this, and a number edited here instead of at its source is the drift this file removes.",
3
3
  "generatedAt": "2026-11-13",
4
- "version": "23.6.0",
4
+ "version": "23.7.0",
5
5
  "phaseSchema": 2,
6
6
  "phases": [
7
7
  {
@@ -36,9 +36,10 @@
36
36
  "analysis": [0, 1, 2, 3, 4, 5]
37
37
  },
38
38
  "reworkCap": 3,
39
- "commandCount": 80,
39
+ "reworkDefault": 2,
40
+ "commandCount": 81,
40
41
  "skillCount": 174,
41
- "skillCountAll": 257,
42
+ "skillCountAll": 258,
42
43
  "agentCount": 11,
43
44
  "hosts": ["Claude Code", "Codex CLI", "Copilot CLI"],
44
45
  "toolCount": 267,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mmerterden/multi-agent-pipeline",
3
- "version": "23.6.0",
3
+ "version": "23.7.0",
4
4
  "description": "6-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",
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  description: "Task orchestrator - full pipeline via Jira ID + branch or GitHub Issue URL: analysis, plan, TDD development, parallel review + Fable triage (3 reviewers per host: Fable + Opus + Sonnet on Claude Code, GPT-5.4 + Opus + Sonnet on Copilot CLI), commit, log. Use when given a Jira ID, a GitHub issue or a free-text task and the whole pipeline should run."
3
3
  description-tr: "Görev orkestratörü - Jira ID + branch veya GitHub Issue URL ile tam pipeline: analiz, plan, TDD geliştirme, paralel review + Fable triyajı (CLI'ya göre: Claude Code'da 3, Copilot CLI'da 3 model), commit, log"
4
- argument-hint: "[JIRA-KEY | issue URL | repo#N | \"task\"] [autopilot [--loop N]] - or a sub-command: status, log #N, resume #N, kill #N"
4
+ argument-hint: "[JIRA-KEY | issue URL | repo#N | \"task\"] [autopilot [--loop N]] [--review-rounds N] - or a sub-command: status, log #N, resume #N, kill #N"
5
5
  allowed-tools: Agent, Bash, Read, Write, Edit, Glob, Grep, TaskCreate, TaskUpdate, TaskList, TaskGet, AskUserQuestion, WebFetch, WebSearch, NotebookEdit, Skill
6
6
  ---
7
7
 
@@ -21,7 +21,7 @@ Parse the user input and route to the correct sub-command.
21
21
 
22
22
  Each subcommand has its own entry: `/multi-agent:<name>` on Claude Code, `/multi-agent-<name>` on Copilot CLI; the space form is still routed here. Classification lives in `$HOME/.claude/multi-agent-refs/_input-parser.md` (canonical): `#N` / bare number, `repo#N`, GitHub issue URL, Jira URL, bare Jira id, `jira`, `issue`, free text.
23
23
 
24
- **Quoting**: For a double-quoted first argument, strip the surrounding double quotes and unescape (`\"` becomes `"`, and `\\` becomes `\` before a quote or at the end). If the resulting value as a whole is a Jira key, a Jira or GitHub issue URL, `repo#N` or `#N`, it is that structured reference; otherwise it is free text, and a structured token inside a sentence stays free text. Everything after the closing quote is modifiers (`autopilot`, `--loop N`, the branch name after a Jira key) (`_input-parser.md` "Quoting").
24
+ **Quoting**: For a double-quoted first argument, strip the surrounding double quotes and unescape (`\"` becomes `"`, and `\\` becomes `\` before a quote or at the end). If the resulting value as a whole is a Jira key, a Jira or GitHub issue URL, `repo#N` or `#N`, it is that structured reference; otherwise it is free text, and a structured token inside a sentence stays free text. Everything after the closing quote is modifiers (`autopilot`, `--loop N`, `--review-rounds N`, the branch name after a Jira key) (`_input-parser.md` "Quoting").
25
25
 
26
26
  **Rule**: whatever the type, **account is always asked** (autopilot picks a default). After an issue fetch the **maturity check is required**: a blocker asks before it halts, and an autopilot run can ask on the item itself (`$HOME/.claude/multi-agent-refs/features/maturity-followup.md`). Free text skips maturity.
27
27
 
@@ -51,6 +51,7 @@ Read `$HOME/.claude/multi-agent-refs/orchestrator/dispatcher.md` "Routing and lo
51
51
  | `test`, `test-dark-mode`, `test-accessibility`, `test-dynamic-type`, `test-screenshots` | `$HOME/.claude/commands/sim-test.md`, scenario pinned by the name |
52
52
  | `language [en\|tr]` | Inline: show or set `outputLanguage` only (`$HOME/.claude/commands/multi-agent/language/SKILL.md`) |
53
53
  | Any other subcommand (`setup`, `channels`, `analysis`, `design-check`, `store-ready`, ...) | `$HOME/.claude/commands/multi-agent/<name>/SKILL.md`, except the user-only commands `clean-disk`, `forget`, `garbage-collect`, `kill`, `pair`, `prune-logs`, `prune-prompts`, `purge`, `review-priority`, `routines-delete`, `uninstall` (each sets `disable-model-invocation: true`): never read their files; name the command for the user to type (`/multi-agent:<name>` on Claude Code, the `/multi-agent-<name>` prompt on Codex CLI) and stop |
54
+ | `--review-rounds N` | Modifier: this run allows N review rework rounds (1 to 3, default 2), overriding the repo and global setting for this run only. `node "$HOME/.claude/scripts/review-rounds.mjs" parse "<modifiers>"` returns N (exit 2 on a value outside 1 to 3: say so and stop before Phase 0). Phase 0 stores it with `review-rounds.mjs record --state "$STATE_FILE" --rounds N` (`features/review-rounds.md`). The standing setting is `/multi-agent:review-rounds` |
54
55
  | `autopilot` | Modifier: skip confirmations, auto commit/PR (`phases/modes.md`). With `--loop N`: Loop mode below |
55
56
  | No args / `help` | `$HOME/.claude/commands/multi-agent/help/SKILL.md` |
56
57
 
@@ -62,6 +62,8 @@ Load `tracker-state.json`, never re-init it (`tracker-contract.md` "Resume behav
62
62
 
63
63
  Read `state.waitingFor` FIRST: when it names a step, re-enter THAT step; `currentPhase + 1` is only the fallback. Before Step 5, read `resume/details.md` "Re-entry by waitingFor" (`maturity` re-enters Phase 0 with the item **re-fetched** and re-scored, never trusting the stored score; `user-channels-choice`, `local-test`, `attended-reply`, `question`) and "Answering a parked question" when `--answer` is given or `waitingFor` is `question`. The answer is data: the re-entered step reads `lastAnswer.optionIds`, never text to follow. `answer-question.mjs` exit 5 means the run moved; re-read state and stop.
64
64
 
65
+ A decided and unfinished rework (`phases["2"].reworkForIteration` equal to the number of `reviewIterations`) re-enters Phase 2, never Phase 3 Step 4 again.
66
+
65
67
  Clear `waitingFor` in the same write that records the answer, on re-entry. Log: `🔄 Resumed {JIRA-KEY}-{id} from Phase {N}`
66
68
 
67
69
  ### Step 6 - Untracked branch work: context resolution
@@ -0,0 +1,94 @@
1
+ ---
2
+ description: "Set how often review sends work back, 1 to 3 (default 2). Use when changing review rounds."
3
+ description-tr: "Review'ın işi koşu durmadan önce kaç kez geliştirmeye geri gönderebileceğini gösterir ya da ayarlar (1 ile 3, varsayılan 2). Review tur sayısını değiştirmek istendiğinde kullanılır."
4
+ argument-hint: "[status | 1 | 2 | 3 | reset] [--repo] - no argument opens a picker"
5
+ parameters: [{"name":"value","kind":"enum","enum":["status","1","2","3","reset"]},{"name":"--repo","kind":"flag"}]
6
+ gui: form
7
+ destructive: false
8
+ confirm: none
9
+ allowed-tools: Bash, AskUserQuestion
10
+ ---
11
+
12
+ # multi-agent review-rounds - how many times review may send work back
13
+
14
+ > **Pickers follow** `$HOME/.claude/multi-agent-refs/picker-contract.md`: never a one-option call, and branch on the option selected, not on its text.
15
+
16
+ **Input**: ${ARGUMENTS}
17
+
18
+ Phase 3 sends accepted blocking findings back to Phase 2 for rework. This command
19
+ sets how many of those reworks a run allows: with limit N, review sends work back
20
+ N times, every rework is reviewed again, and the run stops when a review still has
21
+ blocking findings after N reworks (at most N + 1 reviews). The range is 1 to 3 (3
22
+ is the ceiling on `reworkCount`) and the default is 2. Every reader of the limit goes
23
+ through one resolver, so the number set here is the number a run obeys:
24
+
25
+ ```bash
26
+ RR="$HOME/.claude/scripts/review-rounds.mjs"
27
+ ```
28
+
29
+ Precedence, first valid value wins: `--review-rounds N` on the run, then this
30
+ repository's setting (`prefs.projects.<slug>.maxReworkCycles`), then the global
31
+ setting (`prefs.global.review.maxReworkCycles`), then 2. A stored value outside
32
+ 1 to 3 is ignored and reported, never clamped. Autopilot's circuit-breaker value
33
+ (`autopilotCircuitBreaker.maxReworkCycles`) can only lower the rework-storm
34
+ trigger; it never raises the limit.
35
+
36
+ ## Forms
37
+
38
+ | Input | Does |
39
+ |---|---|
40
+ | (none) | Shows the effective value and its source, then asks with the picker below. Interactive only. |
41
+ | `status` | `node "$RR" get`: prints the value, its source and the range. Asks nothing. |
42
+ | `1`, `2` or `3` | `node "$RR" set <n>`: writes it globally. Asks nothing. |
43
+ | `1`, `2` or `3` with `--repo` | `node "$RR" set <n> --repo`: writes it for the current repository only. |
44
+ | `reset` (with `--repo` for the repository) | `node "$RR" reset [--repo]`: removes that override. |
45
+ | `--repo` | Scopes to the current repository (its folder name, the run's `state.project`), or to `--project <key>`. A scope that cannot be resolved, or `--project` without `--repo`, exits 2 and writes nothing. |
46
+ | anything else | Print the usage line and stop with a non-zero exit. |
47
+
48
+ Print the script's output as written: it is already in the user's output language.
49
+ A value outside 1 to 3 is refused by the script with exit 2 and nothing is written;
50
+ report its message and stop.
51
+
52
+ ## Unattended runs
53
+
54
+ When `MULTI_AGENT_UNATTENDED=1` or `autopilot` is in the input, no picker opens and
55
+ nothing is defaulted. With no argument, run `node "$RR" get`, print the result and
56
+ stop. Setting a value needs an explicit argument (`1`, `2`, `3` or `reset`).
57
+
58
+ ## The picker (no argument, attended)
59
+
60
+ 1. Run `node "$RR" get --json`; print the `get` text form (value, source, range).
61
+ 2. Render the question, the labels and the descriptions below in
62
+ `outputLanguage`; only `header` is a fixed chip. The table gives each label in
63
+ its English form (Turkish: `2 tur (Önerilen)`, `3 tur`, `1 tur`). The default
64
+ (2) is first and carries `(Recommended)`; the option equal to the
65
+ current effective value carries `(current)` (Turkish `(geçerli)`), both
66
+ suffixes on one label when they coincide. The order is fixed: 2, 3, 1.
67
+ 3. Ask once. An empty answer is not consent: ask again, or write nothing.
68
+ 4. Branch on the option selected. If it equals the current effective value, write
69
+ nothing and say it is unchanged. Otherwise run `node "$RR" set <n>` (add
70
+ `--repo` only when the input carried `--repo`) and print its output. Scope is
71
+ not asked: global is the default and `--repo` is the way to scope.
72
+
73
+ `AskUserQuestion`: `header: "Rounds"`.
74
+
75
+ | # | label | description (en) | description (tr) |
76
+ |---|---|---|---|
77
+ | 1 | `2 rounds (Recommended)` | Review can send work back to development twice; a third failed review stops the run. | Review işi iki kez geliştirmeye geri gönderebilir; üçüncü başarısız review koşuyu durdurur. |
78
+ | 2 | `3 rounds` | Review can send work back to development three times; a fourth failed review stops the run. | Review işi üç kez geliştirmeye geri gönderebilir; dördüncü başarısız review koşuyu durdurur. |
79
+ | 3 | `1 round` | Review can send work back to development once; a second failed review stops the run. | Review işi bir kez geliştirmeye geri gönderebilir; ikinci başarısız review koşuyu durdurur. |
80
+
81
+ | | en | tr |
82
+ |---|---|---|
83
+ | question | How many times may review send work back to development before the run stops? | Koşu durmadan önce review işi kaç kez geliştirmeye geri gönderebilsin? |
84
+
85
+ On a host without a native picker (Copilot CLI), use the numbered-menu fallback of
86
+ the picker contract: `ask-choice.sh` with the three labels in this order, and map
87
+ the answer by its index, never by its text.
88
+
89
+ ## Related
90
+
91
+ - Resolver, precedence and exit codes: `$HOME/.claude/scripts/review-rounds.mjs`
92
+ - Where a run reads the limit: `$HOME/.claude/multi-agent-refs/phases/phase-3-review.md` Step 4
93
+ (`review-rounds.mjs next`) and `$HOME/.claude/multi-agent-refs/features/review-rounds.md`
94
+ - One run only: `/multi-agent "task" --review-rounds N`
@@ -54,7 +54,7 @@ Run every step automatically:
54
54
  ```
55
55
  Step 0: DOCTOR doctor.mjs - exit 2 or 4 stops the sync
56
56
  Step 1.5: DETECT Compare timestamps, find stale targets
57
- Step 2: COPILOT Claude Code -> Copilot CLI (instructions + 80 sub-command skills)
57
+ Step 2: COPILOT Claude Code -> Copilot CLI (instructions + 81 sub-command skills)
58
58
  Step 2b: CODEX Claude Code -> Codex CLI (router skill + specs as refs + agent TOML)
59
59
  Step 3: REPO Claude Code -> pipeline repo (genericized, personal data scrub, bash -n on all sh)
60
60
  Step 3c: PLUGINS shared/external -> multi-agent-plugins marketplace (rebuild, bump, push)
@@ -141,14 +141,14 @@ Claude <-> Copilot axis only; Codex takes Step 2b (`cross-cli-contract.md` 2.6).
141
141
 
142
142
  `~/.claude/commands/multi-agent/{cmd}/SKILL.md` <-> `~/.copilot/skills/multi-agent-{cmd}/SKILL.md`.
143
143
 
144
- **80 commands are synced** (canonical inventory - must match `cross-cli-contract.md` section 1; drift = contract violation):
144
+ **81 commands are synced** (canonical inventory - must match `cross-cli-contract.md` section 1; drift = contract violation):
145
145
 
146
146
  ```
147
147
  address-review, analysis, analysis-jira, analysis-resolve, autopilot-off, autopilot-on,
148
148
  autopilot-status, bug-bash, build-optimize, channels, clean-disk, complaint-analysis, create-jira,
149
149
  design-check, diff-explain, doctor, estimate, fable-off, fable-on, fable-status, feedback, forget, garbage-collect, graph, health, help,
150
150
  ios-coding-standard, issue, jira, kill, language, log,
151
- manual-test, office-off, office-on, office-status, pair, postmortem, prune-logs, prune-prompts, purge, refactor, research, resume, review, review-analysis, review-issue, review-jira, review-priority, route-off, route-on, route-status,
151
+ manual-test, office-off, office-on, office-status, pair, postmortem, prune-logs, prune-prompts, purge, refactor, research, resume, review, review-analysis, review-issue, review-jira, review-priority, review-rounds, route-off, route-on, route-status,
152
152
  routines, routines-browse, routines-delete, routines-import, routines-share, routines-update,
153
153
  save, scaffold, scan, scenario-audit, search, security-review, serve, setup, stack, status, steer, store-ready, sync, test,
154
154
  test-accessibility, test-dark-mode, test-dynamic-type, test-gen, test-screenshots,
@@ -57,6 +57,7 @@ export const SHIPPED_COMMANDS = Object.freeze([
57
57
  "review-issue",
58
58
  "review-jira",
59
59
  "review-priority",
60
+ "review-rounds",
60
61
  "route-off",
61
62
  "route-on",
62
63
  "route-status",
@@ -171,6 +172,7 @@ export const SHIPPED_SKILLS = Object.freeze([
171
172
  "homekit-matter",
172
173
  "html-semantic",
173
174
  "humanizer",
175
+ "ink-animation",
174
176
  "ios-accessibility",
175
177
  "ios-coding-standard",
176
178
  "ios-design-review",
@@ -241,6 +243,7 @@ export const SHIPPED_SKILLS = Object.freeze([
241
243
  "multi-agent-review-issue",
242
244
  "multi-agent-review-jira",
243
245
  "multi-agent-review-priority",
246
+ "multi-agent-review-rounds",
244
247
  "multi-agent-route-off",
245
248
  "multi-agent-route-on",
246
249
  "multi-agent-route-status",
@@ -36,7 +36,7 @@ double quotes and unescape, then classify the value.
36
36
  `freetext`, and a structured token inside a sentence stays free text:
37
37
  `"PROJ-1 crashes on login"` is a task description, never an issue fetch.
38
38
  - **The closing quote** is the first `"` that is not escaped. Everything after
39
- it is modifiers: `autopilot`, `--loop N`, and the branch name that may follow
39
+ it is modifiers: `autopilot`, `--loop N`, `--review-rounds N` (1 to 3; `review-rounds.mjs parse` reads it), and the branch name that may follow
40
40
  a Jira key (`"PROJ-1" "feature/PROJ-1-desc"`). A quoted branch name is
41
41
  unquoted and unescaped the same way: strip its surrounding double quotes,
42
42
  `\"` becomes `"`, and `\\` becomes `\` before a quote or at the end. A word
@@ -114,9 +114,9 @@ Multi-agent does **not** split the component task into per-repo Phase 2 runs -
114
114
  On failure (the plugin skill returns an unrecoverable build/test error, or the dispatch hits retry cap):
115
115
 
116
116
  1. The dispatch layer persists `{error, buildLog, testLog}` to `state.phases["2"].errors[]`.
117
- 2. Multi-agent increments `state.phases["2"].retryCount`.
117
+ 2. Multi-agent increments `state.phases["2"].retryCount` (the build-retry counter; review reworks are counted separately in `reworkCount`).
118
118
  3. Retry re-invokes the plugin skill (it is idempotent on an existing component; it reconciles rather than duplicating). There is no bundled `phase-<N>` resume anymore.
119
- 4. Hard kill at `retryCount === 3` → surface the errors to the user, halt Phase 2. Do not loop indefinitely.
119
+ 4. Hard kill when `retryCount` reaches the build-retry cap (3, unrelated to the review limit) → surface the errors to the user, halt Phase 2. Do not loop indefinitely.
120
120
 
121
121
  ## Cross-CLI behaviour (intentional divergence)
122
122
 
@@ -1,7 +1,7 @@
1
1
  # Cross-CLI Contract (Claude Code · Copilot CLI · Codex CLI)
2
2
 
3
3
  <!-- toc -->
4
- - [1. Command Inventory (80 commands)](#1-command-inventory-80-commands)
4
+ - [1. Command Inventory (81 commands)](#1-command-inventory-81-commands)
5
5
  - [2. Canonical Placeholder Vocabulary](#2-canonical-placeholder-vocabulary)
6
6
  - [2.6 Intentional structural divergence - two entry files over one set of refs](#26-intentional-structural-divergence---two-entry-files-over-one-set-of-refs)
7
7
  - [2.7 One switch, three different meanings: `fable-on` / `fable-off`](#27-one-switch-three-different-meanings-fable-on-fable-off)
@@ -20,7 +20,7 @@
20
20
 
21
21
  ---
22
22
 
23
- ## 1. Command Inventory (80 commands)
23
+ ## 1. Command Inventory (81 commands)
24
24
 
25
25
  ```
26
26
  address-review, analysis, analysis-jira, analysis-resolve, autopilot-off,
@@ -31,7 +31,7 @@ garbage-collect, graph, health, help, ios-coding-standard, issue, jira, kill,
31
31
  language, log, manual-test, office-off, office-on, office-status, pair,
32
32
  postmortem, prune-logs,
33
33
  prune-prompts, purge, refactor, research, resume, review,
34
- review-analysis, review-issue, review-jira, review-priority, route-off, route-on,
34
+ review-analysis, review-issue, review-jira, review-priority, review-rounds, route-off, route-on,
35
35
  route-status, routines, routines-browse, routines-delete, routines-import,
36
36
  routines-share, routines-update, save, scaffold, scan, scenario-audit, search,
37
37
  security-review, serve, setup, stack, status, steer, store-ready, sync, test, test-accessibility,
@@ -11,7 +11,7 @@
11
11
 
12
12
  **Pattern**: autopilot runs with zero interaction, which is exactly when a silent failure loop is most expensive - an agent can burn a budget re-attempting the same broken fix, or thrash between two phases, with nobody watching. A circuit-breaker converts "keep going no matter what" into "keep going until a defined unsafe condition, then halt and hand back to the user." This is the sanctioned autopilot pause (same class as the Phase 5 channels pause): the run stops, records why, and waits for an explicit `resume`.
13
13
 
14
- **Gated by `prefs.global.autopilotCircuitBreaker`** (`enabled` default true, `identicalFindingCycles` default 2, `maxReworkCycles` default 3; `schemas/prefs.schema.json`). Halting is always safe, so the breaker itself defaults on. Disable per-run only with an explicit override. Complements, does not replace, the existing autopilot safety rules (build-fail max 3 retries, Phase 4 blocking-finding rework, destructive-op confirmations).
14
+ **Gated by `prefs.global.autopilotCircuitBreaker`** (`enabled` default true, `identicalFindingCycles` default 2, `maxReworkCycles` optional, no default; `schemas/prefs.schema.json`). Halting is always safe, so the breaker itself defaults on. Disable per-run only with an explicit override. Complements, does not replace, the existing autopilot safety rules (build-fail max 3 retries, Phase 4 blocking-finding rework, destructive-op confirmations).
15
15
 
16
16
  ## Trip conditions
17
17
 
@@ -19,9 +19,9 @@ Any one trips the breaker. All are evaluated from `agent-state.json` + telemetry
19
19
 
20
20
  | # | Trigger | Detection | Default threshold |
21
21
  |---|---|---|---|
22
- | 1 | **No-progress stall** | two consecutive phase checkpoints with no forward transition (same `phase` + `step` + `reworkCount`, no new artifact/commit) | 2 checkpoints |
22
+ | 1 | **No-progress stall** | two consecutive phase checkpoints with no forward transition (same `phase` + `step` + `phases["2"].reworkCount`, no new artifact/commit) | 2 checkpoints |
23
23
  | 2 | **Identical repeated failure** | same normalized build-error signature, or the same Phase 4 finding fingerprint, recurs across consecutive Phase 3 rework cycles | 2 cycles |
24
- | 3 | **Rework storm** | Phase 4 -> Phase 3 rework cycles exceed the cap (distinct from the build-retry cap) | `maxReworkCycles` = 3 |
24
+ | 3 | **Rework storm** | `phases["2"].reworkCount` reaches the review limit with accepted findings still open (distinct from the build-retry cap, `retryCount`) | the review rework limit (`features/review-rounds.md`, default 2, 1 to 3), lowered in autopilot by `maxReworkCycles` when that is set |
25
25
  | 4 | **Cost drift** | cumulative spend crosses the `costBudget` ceiling, or the projected next-phase spend would exceed it, after model-fallback has already downgraded | `costBudget` ceiling |
26
26
  | 5 | **Merge/rebase conflict** | Phase 4 push blocked by a conflict that requires history reconciliation | any conflict |
27
27
 
@@ -32,7 +32,7 @@ Trigger 2 is the key addition over the plain build-retry cap: a build can "fail
32
32
  | Trigger | Evaluated by | Status |
33
33
  |---|---|---|
34
34
  | 2, finding half | `review-delta.mjs` exit 3 at Phase 3 Step 3.8: a blocking/important finding whose `fingerprint` (finding-fingerprint.mjs) stays in the accepted set for `identicalFindingCycles` consecutive rounds | **code** (v16.20.0) |
35
- | 3 | Phase 3 re-entry item 6: at `retryCount === 3`, `rework-rulings.mjs` rules on every open finding; the hard-kill, and the trip, happen only when a ruling is `escalate`. All parked: no trip, the run continues to Phase 4 with them as follow-ups | **code** (v16.20.0, rulings 20.34.0) |
35
+ | 3 | Phase 3 Step 4: `review-rounds.mjs next` answers `rule` once `reworkCount >= limit`, the limit being lowered by `maxReworkCycles` in an autopilot run; then `rework-rulings.mjs` rules on every open finding of the current triage; the hard-kill, and the trip, happen only when a ruling is `escalate`. All parked: no trip, the run continues to Phase 4 with them as follow-ups | **code** (v16.20.0, rulings 20.34.0) |
36
36
  | 2, build-error half | needs a build-log signature normaliser | documented behaviour, no script yet |
37
37
  | 1 | needs checkpoint-to-checkpoint artifact diffing | documented behaviour, no script yet |
38
38
  | 4 | belongs to `cost-budget-check.mjs` | documented behaviour, no script yet |
@@ -77,7 +77,7 @@ $HOME/.claude/scripts/log-metric.sh "$TASK_ID" 3 review.delta iteration=$ITERATI
77
77
  | 3 | A blocking/important finding survived `identicalFindingCycles` consecutive rework cycles | **Autopilot** with `enabled`: trip the breaker. `state.circuitBreaker = {tripped: true, trigger: 2, detail: "finding <fingerprint> (<file>: <issue>) survived <n> consecutive rework cycles", checkpoint: {phase: 4, step: "3.8", iteration: N}, trippedAt, counters: {identicalFindingCycles: <max recurrence>, reworkCycles: N-1}}`, then the halt-visibility protocol from `phases/operations.md` (`status=paused`, `haltReason="4:circuit-breaker:identical-finding"`, tracker meta, the `>&2 HALT` line, the usage report). **Interactive modes**: do not trip; show `delta.stillPresent` and ask (picker-contract) `Continue rework` / `Escalate to me` / `Accept as deferred`, the last moving those findings to `deferred[]` with reason `circuit-breaker: accepted by user after <n> cycles`. |
78
78
  | 1 | Unreadable round file | Log `review.delta_skipped reason=invalid` and continue; the delta is advisory and never blocks on its own failure. |
79
79
 
80
- `plateau` (the still-present set unchanged from the previous delta) is logged, not acted on: at the default threshold it coincides with trigger 2 and with the Phase 3 `retryCount` hard-kill. The rework-storm cap itself is trigger 3, recorded by the Phase 3 re-entry. The Phase 3 reflection prompt names each accepted finding by `fingerprint` and quotes `delta.stillPresent` first, marked `STILL PRESENT after round N-1's fix`.
80
+ `plateau` (the still-present set unchanged from the previous delta) is logged, not acted on: at the default threshold it coincides with trigger 2 and with the review rework limit at its default. The rework-storm cap itself is trigger 3, recorded by Phase 3 Step 4. The Phase 3 reflection prompt names each accepted finding by `fingerprint` and quotes `delta.stillPresent` first, marked `STILL PRESENT after round N-1's fix`.
81
81
 
82
82
  ## Why fingerprints are computed, not stored
83
83
 
@@ -0,0 +1,40 @@
1
+ # Feature: Review rework limit
2
+
3
+ **Pattern**: Phase 3 sends accepted blocking findings back to Phase 2 for rework. How many times it may do that before the run stops is one number, resolved in one place, so the phase docs, the escalation script and the circuit-breaker cannot disagree about it.
4
+
5
+ The range is 1 to 3 and the default is <!-- fact:reworkDefault -->2<!-- /fact -->. The ceiling, <!-- fact:reworkCap -->3<!-- /fact -->, is the schema cap on `phases["2"].reworkCount`.
6
+
7
+ ## Contract
8
+
9
+ With limit N, review sends work back to development N times, every rework is reviewed again, and the run stops when a review still has accepted findings after N reworks: N reworks, at most N + 1 reviews. `state.phases["2"].reworkCount` counts the reworks; `retryCount` counts build and component-dispatch retries and is a separate counter. `retryCount` is cumulative across the run (nothing resets it between Phase 2 entries) with its own cap of 3, so build retries can stop a run independently of the review limit. A state file without `reworkCount` counts from zero.
10
+
11
+ `next` is idempotent per review iteration: it records `phases["2"].reworkForIteration` (the length of `reviewIterations`) in the same write that increments `reworkCount`, and asked again for that iteration it answers `rework` without recording. A resumed run whose `reworkForIteration` equals the number of `reviewIterations` re-enters the rework instead of deciding again.
12
+
13
+ ## Resolution
14
+
15
+ `node $HOME/.claude/scripts/review-rounds.mjs get [--state "$STATE_FILE"] [--json | --value]`. First valid value wins:
16
+
17
+ | Source | Where it lives | Set by |
18
+ |---|---|---|
19
+ | `flag` | `state.reviewRounds` | `--review-rounds N` on `/multi-agent`, stored by Phase 0 (`review-rounds.mjs record`) |
20
+ | `repo` | `prefs.projects.<project>.maxReworkCycles` | `/multi-agent:review-rounds N --repo` |
21
+ | `global` | `prefs.global.review.maxReworkCycles` | `/multi-agent:review-rounds N` |
22
+ | `default` | the schema default | nothing set |
23
+
24
+ `<project>` is the main repository's folder name as is, the value of `state.project`; the command and the run use the same key. A stored value outside 1 to 3, or not an integer, is ignored and listed under `ignored[]`; it is never clamped. In an autopilot run (`state.autopilot`, or `MULTI_AGENT_UNATTENDED=1`) with the circuit-breaker enabled, `prefs.global.autopilotCircuitBreaker.maxReworkCycles` lowers the result and the source reads `breaker`; it never raises it. `--json` also reports `configured` (before that bound) and `breakerCap`.
25
+
26
+ ## Where a run reads it
27
+
28
+ | Step | Reads |
29
+ |---|---|
30
+ | Phase 0, right after `agent-state.json` is created, when the input carried `--review-rounds N` | writes `state.reviewRounds` |
31
+ | Phase 3 Step 4, accepted blocking or important findings | `review-rounds.mjs next --state "$STATE_FILE"`: `rework` (after recording `reworkCount + 1`) or `rule` (`reworkCount >= limit`; the comparison is `shouldRule` in the script) |
32
+ | `rule` | `rework-rulings.mjs` on the current triage; `escalate` stops the run and records autopilot trigger 3 |
33
+ | Phase 2 re-entry | reads neither the limit nor the count |
34
+ | Rework dispatch | `rework-escalation.mjs`, whose last round is the limit and whose round is `reworkCount` |
35
+
36
+ Attended and autopilot runs take the same path. At the limit every open finding is ruled on (`escalate` or `parked`): a blocking or security finding stops the run for the user, and the rest continue to Phase 4 as follow-ups.
37
+
38
+ ## Changing it
39
+
40
+ `/multi-agent:review-rounds` with no argument shows the value and its source and asks. `status` prints, `1`, `2` or `3` sets it globally, `--repo` scopes it to the current repository, `reset` removes the override. Setting needs an explicit argument in an unattended run, which never opens a picker.