flow-workflows 0.108.0 → 0.110.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.
@@ -17,7 +17,7 @@ Every `$flow-*` command assumes these rules. They are stated once, here, so a co
17
17
  carries what is specific to its phase. Read this once per session; a command that says "load
18
18
  `flow-core`" means this file.
19
19
 
20
- **This file belongs to flow `0.108.0`.** Compare it once, at the start of the session, against
20
+ **This file belongs to flow `0.110.0`.** Compare it once, at the start of the session, against
21
21
  `version` in `~/.claude/flow/.claude-plugin/plugin.json`. The two differing means the session
22
22
  is running a **mixture** — the commands from one copy of the plugin, these shared rules from another
23
23
  — which is exactly what happens when a branch or a release candidate is loaded over an installed
@@ -796,8 +796,9 @@ of the MR/PR: a list that jumps from nothing to finished told the user nothing w
796
796
  ### 4.5 `meta.json.cost[]` — what a phase measured, when it could
797
797
 
798
798
  A phase that can measure what it spent appends one entry: `{ "phase": "review", "at": "<ISO>",
799
- "reviewers": 8, "usd": 0.0124, "source": "harness" }`. `flow review --record` writes it; `flow cost`
800
- reads it back per phase. Two rules, and they are the reason the block is worth having: a harness
799
+ "reviewers": 8, "usd": 0.0124, "source": "harness" }` — a review's entry also carries `round`, `tier`,
800
+ `effective_size` and `agents`. `flow record-review` writes it at the review's Close (`flow review --record`
801
+ outside one); `flow cost` reads it back per phase. Two rules, and they are the reason the block is worth having: a harness
801
802
  that reports no figure is recorded with `"source": "not reported"` rather than estimated, and a
802
803
  phase with no entry measured nothing — **absence is not zero**. Every figure is the harness's own
803
804
  client-side estimate and can differ from a bill.
@@ -165,7 +165,7 @@ If `agents.fanout_tool` is set in `FLOW.md`, run the sweep through that tool; br
165
165
  - Logs / traces that confirm it:
166
166
 
167
167
  ## Why tests/CI did not catch it
168
- <2-3 lines>
168
+ <2-3 lines. Then one line with what `escape` (§8) answered about the suspected commit: the work whose review read it, or that no single reviewed work holds it.>
169
169
 
170
170
  ## Areas with similar risk (same pattern)
171
171
  - explain
@@ -231,6 +231,7 @@ If `knowledge.stage` is set and the root cause reveals a **non-obvious "why"** a
231
231
  ## 8. Close
232
232
 
233
233
  - Update `meta.json`: `phase = "investigate"`, add to `phases_done`.
234
+ - **Did a flow review let it through?** With a suspected commit named under "Evidence", run `npx flow-workflows@<version> escape <commit> --file <the file the root cause is in>` from the work's checkout (`<version>` = this plugin's own, from `~/.claude/flow/.claude-plugin/plugin.json`). It records `meta.json.escape` only when the commit sits inside exactly one work's reviewed range, or carries the number of exactly one reviewed MR/PR; anything less it says and records nowhere. Copy its line under "Why tests/CI did not catch it". No suspected commit, or the CLI unavailable → say so there in one line; never write `escape` by hand. Asks nothing: it is a reading, and `flow yield` is what counts it.
234
235
  - Overwrite `00-summary.md` whole (≤15 lines, flow-core §5).
235
236
  - Suggest `$flow-bug-fix` — `meta.json.handoff` set and not `unattended` → `$flow-work-handoff` in its place, **Hand off the study** recommended and **Build here** second where it asks (flow-core §2, a study made for handoff).
236
237
  - **Autonomy handoff** (`autonomy.mode`, flow-core §2): `manual` → propose `$flow-bug-fix` with a single `AskUserQuestion`, invoke it only on confirmation; `guided`/`auto` → chain into it in this same turn. Either way: `meta.json.handoff` set and not `unattended` → `$flow-work-handoff` in its place, **Hand off the study** recommended and **Build here** second where it asks (flow-core §2, a study made for handoff).
@@ -182,7 +182,7 @@ Cost line: count every subagent this command launched — reviewers = §2.1 buil
182
182
  - Review tier: <light | full | proportional — which reviewers ran, at what built-in effort (medium/high/xhigh/max), and why, per §2.0>
183
183
  - Agents launched: <ran vs defined — `N/M` of the `review_skill`/`reviewers` roster, naming any that did not run (with the reason) and any substitution; "built-in only" if §2.0 selected no panel>
184
184
  - Cost: <n>/<budget_max> subagents launched (<k> reviewers · <m> reinforcements · <s> skeptics), tier <light|proportional|full>
185
- - Measured cost: <what the harness reported for this round, when it reported anything — `flow review --record` writes it to `meta.json.cost[]` and `$flow-work-daily` and `flow cost` read it back. A harness that reports no figure is recorded as "not reported": the subagent count above is a headcount, not a cost, and a guess is worse than a gap.>
185
+ - Measured cost: <what the harness reported for this round, when it reported anything — recorded as the round's `usd` in `meta.json.cost[]` (`$flow-feat-review §9`), and `$flow-work-daily` and `flow cost` read it back. A harness that reports no figure is recorded as "not reported": the subagent count above is a headcount, not a cost, and a guess is worse than a gap.>
186
186
  - Effective size: <diff size (N changed lines) vs `meta.json.size`, which the tier used, and — when the diff landed within 10% under a tier threshold — that fact (§2.0)>
187
187
  - Review path: <the two paths this round actually took: `flow bundle` or git for the material, `flow review` or the agentic panel for the reviewers — each with the reason when it was the fallback (no CLI, non-zero exit, `agents.exec_cmd` empty, every role empty). Without this line a round that skipped the CLI reads exactly like one that used it. When the pack ran, quote its `Config read:` line verbatim: it is the only place that says whether the overlay reached the material, and “no `--harness` was given” there means every key set only in the overlay was missing from this round.>
188
188
  - Agent models: <the value of `models.workers`/`models.agents` **with the file each came from** (flow-core §0) when set; otherwise "inherited from this thread", naming the config files you listed; agents named in `agents.<role>` keep their own definition's model>
@@ -225,10 +225,10 @@ Cost line: count every subagent this command launched — reviewers = §2.1 buil
225
225
  <only if §5 was run; refuted findings with their reason, or "not applicable">
226
226
 
227
227
  ## Blockers
228
- 1. [file:line] · <origin> · …
228
+ 1. [file:line] · <origin(s), from `$flow-feat-review §2.1`'s list> · …
229
229
 
230
230
  ## Suggestions
231
- 1. [file:line] · <origin> · …
231
+ 1. [file:line] · <origin(s), from `$flow-feat-review §2.1`'s list> · …
232
232
  ```
233
233
 
234
234
  ## 8. Close
@@ -236,7 +236,7 @@ Cost line: count every subagent this command launched — reviewers = §2.1 buil
236
236
  - With blockers: `phase` stays where it was (`validate` for size ≥ S, `fix` on XS, where validate never ran). Iterate.
237
237
  - Without blockers: `phase = "review"`, add to `phases_done`. Suggest `$flow-bug-postmortem` (M/L) or `$flow-bug-ship` (XS/S).
238
238
  - **Record *what* you reviewed, and separately what you changed after reading it** — `$flow-feat-review` §9, unchanged: `reviewed_sha` = the **candidate** of §1.5 (the revision the reviewers read, never `git rev-parse HEAD`, which by now holds this round's own fixes), and `fixed_sha` = `git rev-parse HEAD` after those fixes, empty when the round applied none. `phases_done` says a review happened; these two say on which tree and what moved afterwards, and `$flow-bug-ship §0` reads both against what is being pushed. Only when the phase advances: a review that ended in blockers reviewed nothing that stands.
239
- - **Record which pass found what** — `$flow-feat-review §9`, unchanged: one `meta.json.review_findings[]` entry per finding **per source** (`{ round, origin, severity, file, discarded_by_skeptic }`, no finding text), written by `flow review --record` when the CLI ran the panel and by this Close when the agentic panel did. `flow yield` reads them back across works and repos, and the retirement rule is the same: a pass with no unique accepted finding across twenty rounds at a size comes out of the command at that size.
239
+ - **Record which pass found what** — `$flow-feat-review §9`, unchanged: one `meta.json.review_findings[]` row per finding with every origin that raised it and its outcome, plus what the round launched, written once per round through `npx flow-workflows@<version> record-review --file`, the CLI panel's roles included as sources — never by hand, and never also by `flow review --record`. `flow yield` reads them back across works and repos, and the retirement rule is the same: a pass with no unique accepted finding across twenty rounds at a size comes out of the command at that size.
240
240
  - **Record what the agents missed** — `$flow-feat-review §9`, unchanged: surviving findings in a category a panel member or named `agents.<role>` owns and did not report → `meta.json.agent_lessons[]` rows (flow-core §6.7), asking nothing. A fix is where this pays most: the defect already reached production once, and the reviewer that owns its category let it.
241
241
  - **Stage what the review taught** (`knowledge.stage` set; silence by default). Review is where a project teaches the most, and this is the only moment its findings are in context. Candidates are findings about the **domain or the codebase's real behaviour**, not about this diff: a library that does other than its name says, a test disguise that kept the suite green over a live defect, a module rule the reviewers had to cite from its own prose, a measurement. A blocker fixed here is not knowledge; *why it was written wrong* may be. Same evidence rule as `$flow-feat-design` §8 — one line of evidence per finding or it is not staged. One call per finding, one line to the user («Staged N finding(s) for `postmortem`/`ship`»). Never `knowledge.save` here.
242
242
  - Overwrite `00-summary.md` whole (≤15 lines, flow-core §5).
@@ -158,7 +158,7 @@ Launch the reviewers selected in §2.0 and **consolidate their findings into a s
158
158
 
159
159
  When both run, deduplicate overlapping correctness/simplification findings (count each once). The `review_skill` specialists (offensive/defensive security, silent failures, architecture) are not repeated in later phases.
160
160
 
161
- **Dedup keeps every source, not the first one.** A finding carries its **origin** from here to §8 — `built-in`, a panel role, or the pass that raised it (`§3.5`, `§3.6`, `§5`, `§5.5`) — and a finding more than one source raised lists all of them. Counted once, credited to each: a finding only one pass saw and a finding three sources raised say opposite things about that pass, and §9 records the difference.
161
+ **Dedup keeps every source, not the first one.** A finding carries its **origin** from here to §8, spelled from a closed list — `built-in` · `panel:<role>` (`<role>` = the part of a `quality.reviewers` entry before its `:`, or the `review_skill` agent's name — lower-case, every run of other characters turned into `-`) · `reinforcement:<area>` (§3) · `sweep` (§3.5) · `query-duel` (§3.6) · `yagni` (§4) · `contract` (§5) · `idiom` (§5.5) — and a finding more than one source raised lists all of them. §9 records them through a command that refuses any other spelling. Counted once, credited to each: a finding only one pass saw and a finding three sources raised say opposite things about that pass, and §9 records the difference.
162
162
 
163
163
  ### 2.2 Design truth vs design rationale (do not inherit rationalizations)
164
164
  `03-design.md` goes to reviewers as context, with unequal authority:
@@ -325,7 +325,7 @@ Write `.claude/work/<TICKET>/06-review.md`. The `Cost:` line of `## Summary` is
325
325
  - Review path: <the two paths this round actually took: `flow bundle` or git for the material, `flow review` or the agentic panel for the reviewers — each with the reason when it was the fallback (no CLI, non-zero exit, `agents.exec_cmd` empty, every role empty). Without this line a round that skipped the CLI reads exactly like one that used it. When the pack ran, quote its `Config read:` line verbatim: it is the only place that says whether the overlay reached the material, and “no `--harness` was given” there means every key set only in the overlay was missing from this round.>
326
326
  - Agent models: <the value of `models.workers`/`models.agents` **with the file each came from** (flow-core §0) when set; otherwise "inherited from this thread", naming the config files you listed — "unset" without them reads the same whether the overlay was empty or never opened — plus, when the panel ran, that agents named in `agents.<role>` kept the model their own definition sets. The values as they are, no judgement on them>
327
327
  - Cost: <n>/<budget_max> subagents launched (<k> reviewers · <m> reinforcements · <s> skeptics), tier <light|proportional|full>, effort <medium|high|xhigh|max>
328
- - Measured cost: <what the harness reported for this round, when it reported anything — `flow review --record` writes it to `meta.json.cost[]` and `$flow-work-daily` and `flow cost` read it back. A harness that reports no figure is recorded as "not reported": the subagent count above is a headcount, not a cost, and a guess is worse than a gap.>
328
+ - Measured cost: <what the harness reported for this round, when it reported anything — §9 records it as the round's `usd` in `meta.json.cost[]`, and `$flow-work-daily` and `flow cost` read it back. A harness that reports no figure is recorded as "not reported": the subagent count above is a headcount, not a cost, and a guess is worse than a gap.>
329
329
  - Agents launched: <ran vs defined — `N/M` of the `review_skill`/`reviewers` roster, naming any that did not run (with the reason) and any substitution; "built-in only" if §2.0 selected no panel>
330
330
  - Completeness rounds (M/L): N
331
331
  - Critical findings (block ship): N
@@ -365,10 +365,10 @@ Write `.claude/work/<TICKET>/06-review.md`. The `Cost:` line of `## Summary` is
365
365
  <if §6 did not run, one line saying which condition did not hold — size, diff size, count, or budget>
366
366
 
367
367
  ## Blockers (must-fix)
368
- 1. [file:line] · <origin> · description + concrete proposal
368
+ 1. [file:line] · <origin(s), from §2.1's list> · description + concrete proposal
369
369
 
370
370
  ## Suggestions (nice-to-have)
371
- 1. [file:line] · <origin> · description
371
+ 1. [file:line] · <origin(s), from §2.1's list> · description
372
372
 
373
373
  ## Quality gates
374
374
  - style_fix: ✅ / ❌
@@ -388,7 +388,7 @@ Write `.claude/work/<TICKET>/06-review.md`. The `Cost:` line of `## Summary` is
388
388
  - `reviewed_sha` = **the candidate of §1.5**, the revision the reviewers actually read. Not `git rev-parse HEAD`, which by then holds this round's own fixes — code no reviewer saw, recorded as reviewed, and `ship` finding it equal to `HEAD` every time.
389
389
  - `fixed_sha` = `git rev-parse HEAD` after this round's fixes, or **empty** when the round applied none. Two fields because they are two facts.
390
390
  - `phases_done` says a review *happened*; these say which tree, and `$flow-feat-ship §1` reads both before pushing. Written whenever the phase advances, never when it does not: a review that ended in blockers reviewed nothing that stands.
391
- - **Record which pass found what**, in the same write: `meta.json.review_findings[]`, one entry per finding **per source** — `{ round, origin, severity, file, discarded_by_skeptic }`, and no finding text, which stays in the artifact. `flow review --record` writes these itself when the CLI ran the panel; when the agentic panel ran, write them here from the origins §2.1 carried. `flow yield` reads them back across every work and repo, per origin and per size: rounds run, findings, how many only that pass raised, how many of those were acted on, and the agents it took (where the round recorded them). That unique-accepted number is the only evidence a pass is still earning its words, and `yield` marks a pass that ran twenty rounds at a size without one.
391
+ - **Record which pass found what**, in the same write, through the CLI — never by editing `meta.json`: write the round to `.claude/work/<TICKET>/review/round-<k>.json` and run `npx flow-workflows@<version> record-review --file <that path>` from the work's checkout. The file is `{ "round": { "mr": <n, in a multi-MR/PR work>, "tier": "light|proportional|full", "effective_size": "XS|S|M|L", "agents": { "<origin>": <agents it launched> }, "usd": <what the harness reported, when it did> }, "findings": [ { "sources": ["<origin>", …], "severity": "blocker|major|minor|nit|unrated", "file": "<path>", "outcome": "<outcome>" } ] }` — one entry per finding after §2.1's dedup, every origin that raised it in `sources`, no finding text (it stays in the artifact). `round` and its `agents` are required: every pass that ran this round, findings or not — a pass that ran and found nothing is the case the count exists for — and every source of a finding must be one of them. **Outcome**, as the round ends: `fixed` (applied in this round) · `open` (a blocker left to the user) · `rejected` (judged wrong — the reason is in this artifact) · `discarded` (refuted by §6) · `deferred` (became a `followups[]` entry). Exit 1 names each value outside the lists with the valid ones and writes nothing: correct them and run it once more. The CLI unavailable (the fallback rule of §1) → say so in `06-review.md` and leave the rows unrecorded rather than hand-written — a round with no rows is visible as such, a misspelt one is counted wrong. **One round, one record**: when the CLI ran the panel (§1), it ran without `--record`, and its roles go into this same file as `panel:<role>` sources with their real outcomes — recording both would split one review into two rounds and count every finding as unique to its half. `flow review --record` is for running the panel outside a review phase. `flow yield` reads them back across every work and repo, per origin and per size: rounds run, findings, how many only that pass raised, how many of those were acted on (`fixed` · `open` · `deferred`), and the agents it took. That unique-accepted number is the only evidence a pass is still earning its words, and `yield` marks a pass that ran twenty rounds at a size without one.
392
392
  - **Stage what the review taught** (`knowledge.stage` set; silence by default). Review is where a project teaches the most, and this is the only moment its findings are in context. Candidates are findings about the **domain or the codebase's real behaviour**, not about this diff: a library that does other than its name says, a test disguise that kept the suite green over a live defect, a module rule the reviewers had to cite from its own prose, a measurement. A blocker fixed here is not knowledge; *why it was written wrong* may be. Same evidence rule as `$flow-feat-design` §8 — one line of evidence per finding or it is not staged. One call per finding, one line to the user («Staged N finding(s) for `ship`»). Never `knowledge.save` here.
393
393
  - Overwrite `00-summary.md` whole (≤15 lines, flow-core §5).
394
394
  - **Record what the agents missed** (flow-core §6.7, `agents.learn` not `off`; asking nothing): for each finding that survived, the panel member or named `agents.<role>` whose category it falls in and who did not report it, and the delegated `build` agent whose code it sits in → one `meta.json.agent_lessons[]` row each, only when the lesson passes the §6.7 test. The origins §2.1 carried are what make this possible — a finding with no origin teaches nobody.
@@ -94,7 +94,7 @@ This system **orchestrates** the project's existing sub-agents and skills (it do
94
94
  "fixed_sha": "40-char sha after that review's own fixes, or '' when it applied none",
95
95
  "validated_sha": "40-char sha the suite last went green on, or ''",
96
96
  "respond_rounds": 0,
97
- "review_findings": [{"round": 1, "origin": "security", "severity": "blocker", "file": "src/X.php", "discarded_by_skeptic": false}],
97
+ "review_findings": [{"round": 1, "sources": ["built-in", "panel:security"], "severity": "blocker", "file": "src/X.php", "outcome": "fixed"}],
98
98
  "mrs": [
99
99
  {
100
100
  "n": 1,
@@ -163,7 +163,8 @@ This system **orchestrates** the project's existing sub-agents and skills (it do
163
163
  ```
164
164
 
165
165
  - **`candidate_sha` / `reviewed_sha` / `fixed_sha` / `validated_sha`**: which code each verdict is about. `candidate_sha` is written by `review` in its **pre-flight** (§1.5) — the revision it froze before reading anything, `git rev-parse HEAD` over a clean tree and `git stash create` over a dirty one, anchored at `refs/flow/candidate/<TICKET>` so nothing collects it. The other three are written at `## Close`, **only when the phase actually advances**, work-level and in the current `mrs[]` entry: `reviewed_sha` is the candidate that was actually read, `fixed_sha` is `HEAD` after that round's own fixes (empty when it applied none), `validated_sha` is where the suite went green.
166
- - **`review_findings[]`**: one entry per finding **per source** — `{ round, origin, severity, file, discarded_by_skeptic }`, no finding text (that stays in `06-review.md`). Written at `review`'s Close, and by `flow review --record` when the CLI ran the panel. `origin` is `built-in`, a panel role, or the pass that raised it. It exists so a pass can be retired on evidence: `flow yield [<repo-path>…]` reads every work those repos hold — live and `_archive/`, here and in the main checkout — and reports per origin and per size how many rounds each ran, how many findings it contributed, how many **only** it raised, and how many of those were acted on (for rows written before findings carried an outcome: not refuted by a skeptic) — and a finding three sources raised says nothing about any of them, which is why dedup keeps every source rather than the first. Old spellings of an origin (`builtin`, `cli:tests`, `§5.5`) are mapped on read and listed. The rule was written down before the data arrived: no unique accepted finding across twenty rounds at a size (XS and S pooled) and the pass comes out of the command at that size.
166
+ - **`review_findings[]`**: one row per finding, after the review's dedup — `{ round, mr?, sources, severity, file, outcome }`, no finding text (that stays in `06-review.md`). `sources` lists every origin that raised it, from a closed list (`built-in` · `panel:<role>` · `reinforcement:<area>` · `sweep` · `query-duel` · `yagni` · `contract` · `idiom`); `outcome` is `fixed` · `open` · `rejected` · `discarded` · `deferred`. The same round writes one `cost[]` entry with `round`, `tier`, `effective_size` and `agents` — every pass it launched, findings or not. Only `flow record-review --file` writes them — once per round, the CLI panel's roles included — and it refuses any value outside those lists, or a source that is not among the round's `agents`: six weeks of hand-written origins had produced ~65 spellings. Rows from before that, `{ round, origin, severity, file, discarded_by_skeptic }` one per source, stay as they are. It exists so a pass can be retired on evidence: `flow yield [<repo-path>…]` reads every work those repos hold — live and `_archive/`, here and in the main checkout — and reports per origin and per size how many rounds each ran, how many findings it contributed, how many **only** it raised, and how many of those were acted on (for the older rows: not refuted by a skeptic) — and a finding three sources raised says nothing about any of them, which is why dedup keeps every source rather than the first. The rule was written down before the data arrived: no unique accepted finding across twenty rounds at a size (XS and S pooled) and the pass comes out of the command at that size.
167
+ - **`escape`** (bug works only): `{ work, ticket, commit, file, size }` — the reviewed work the root-cause commit belongs to, written by `flow escape` at `bug:investigate`'s Close, and only when the commit sits inside exactly one work's reviewed range (merge history) or carries the number of exactly one reviewed MR/PR (squash). `flow yield` prints `escapes: <n>` under the table of that work's size: what a lighter review at that size has already let through.
167
168
  Two fields for the review because they are two facts. `reviewed_sha` used to be `git rev-parse HEAD` at the end of the phase, which by then held the round's own fixes — so `ship` compared a sha against itself and reported a match over code no reviewer had read. Read by `ship` at pre-flight against `HEAD`: a delta of test files and this work's own folder passes with a note in `06-review.md`; anything else stops and asks in every autonomy mode. Empty is not a mismatch; `fixed_sha` set with `reviewed_sha == HEAD` is one. `review` also reads `reviewed_sha` back as **its own base** on a re-review, so the second round reads the delta instead of the whole branch.
168
169
  - **`respond_rounds`**: rounds of `$flow-work-respond` on an MR/PR. `$flow-work-respond §1` reads it against `quality.respond_max_rounds` (empty = 3) and refuses the round that would exceed it, handing the open threads back to the user.
169
170
  - **`roadmap`**: the roadmap item this work delivers (flow-core §10). Linked at `$flow-feat-start §3.7`, marked in progress / done by `$flow-feat-ship` inside the MR/PR, shown by `next`/`daily`/`resume` — which also flag an item the code delivered but the file still does not mark. `null` with no roadmap, no link, or a bug.
@@ -16,7 +16,7 @@ Every `/flow:*` command assumes these rules. They are stated once, here, so a co
16
16
  carries what is specific to its phase. Read this once per session; a command that says "load
17
17
  `flow-core`" means this file.
18
18
 
19
- **This file belongs to flow `0.108.0`.** Compare it once, at the start of the session, against
19
+ **This file belongs to flow `0.110.0`.** Compare it once, at the start of the session, against
20
20
  `version` in `~/.claude/flow/.claude-plugin/plugin.json`. The two differing means the session
21
21
  is running a **mixture** — the commands from one copy of the plugin, these shared rules from another
22
22
  — which is exactly what happens when a branch or a release candidate is loaded over an installed
@@ -795,8 +795,9 @@ of the MR/PR: a list that jumps from nothing to finished told the user nothing w
795
795
  ### 4.5 `meta.json.cost[]` — what a phase measured, when it could
796
796
 
797
797
  A phase that can measure what it spent appends one entry: `{ "phase": "review", "at": "<ISO>",
798
- "reviewers": 8, "usd": 0.0124, "source": "harness" }`. `flow review --record` writes it; `flow cost`
799
- reads it back per phase. Two rules, and they are the reason the block is worth having: a harness
798
+ "reviewers": 8, "usd": 0.0124, "source": "harness" }` — a review's entry also carries `round`, `tier`,
799
+ `effective_size` and `agents`. `flow record-review` writes it at the review's Close (`flow review --record`
800
+ outside one); `flow cost` reads it back per phase. Two rules, and they are the reason the block is worth having: a harness
800
801
  that reports no figure is recorded with `"source": "not reported"` rather than estimated, and a
801
802
  phase with no entry measured nothing — **absence is not zero**. Every figure is the harness's own
802
803
  client-side estimate and can differ from a bill.
@@ -161,7 +161,7 @@ If `agents.fanout_tool` is set in `FLOW.md`, run the sweep through that tool; br
161
161
  - Logs / traces that confirm it:
162
162
 
163
163
  ## Why tests/CI did not catch it
164
- <2-3 lines>
164
+ <2-3 lines. Then one line with what `escape` (§8) answered about the suspected commit: the work whose review read it, or that no single reviewed work holds it.>
165
165
 
166
166
  ## Areas with similar risk (same pattern)
167
167
  - explain
@@ -227,6 +227,7 @@ If `knowledge.stage` is set and the root cause reveals a **non-obvious "why"** a
227
227
  ## 8. Close
228
228
 
229
229
  - Update `meta.json`: `phase = "investigate"`, add to `phases_done`.
230
+ - **Did a flow review let it through?** With a suspected commit named under "Evidence", run `npx flow-workflows@<version> escape <commit> --file <the file the root cause is in>` from the work's checkout (`<version>` = this plugin's own, from `~/.claude/flow/.claude-plugin/plugin.json`). It records `meta.json.escape` only when the commit sits inside exactly one work's reviewed range, or carries the number of exactly one reviewed MR/PR; anything less it says and records nowhere. Copy its line under "Why tests/CI did not catch it". No suspected commit, or the CLI unavailable → say so there in one line; never write `escape` by hand. Asks nothing: it is a reading, and `flow yield` is what counts it.
230
231
  - Overwrite `00-summary.md` whole (≤15 lines, flow-core §5).
231
232
  - Suggest `/flow:bug:fix` — `meta.json.handoff` set and not `unattended` → `/flow:work:handoff` in its place, **Hand off the study** recommended and **Build here** second where it asks (flow-core §2, a study made for handoff).
232
233
  - **Autonomy handoff** (`autonomy.mode`, flow-core §2): `manual` → propose `/flow:bug:fix` with a single `AskUserQuestion`, invoke it only on confirmation; `guided`/`auto` → chain into it in this same turn. Either way: `meta.json.handoff` set and not `unattended` → `/flow:work:handoff` in its place, **Hand off the study** recommended and **Build here** second where it asks (flow-core §2, a study made for handoff).
@@ -178,7 +178,7 @@ Cost line: count every subagent this command launched — reviewers = §2.1 buil
178
178
  - Review tier: <light | full | proportional — which reviewers ran, at what built-in effort (medium/high/xhigh/max), and why, per §2.0>
179
179
  - Agents launched: <ran vs defined — `N/M` of the `review_skill`/`reviewers` roster, naming any that did not run (with the reason) and any substitution; "built-in only" if §2.0 selected no panel>
180
180
  - Cost: <n>/<budget_max> subagents launched (<k> reviewers · <m> reinforcements · <s> skeptics), tier <light|proportional|full>
181
- - Measured cost: <what the harness reported for this round, when it reported anything — `flow review --record` writes it to `meta.json.cost[]` and `/flow:work:daily` and `flow cost` read it back. A harness that reports no figure is recorded as "not reported": the subagent count above is a headcount, not a cost, and a guess is worse than a gap.>
181
+ - Measured cost: <what the harness reported for this round, when it reported anything — recorded as the round's `usd` in `meta.json.cost[]` (`/flow:feat:review §9`), and `/flow:work:daily` and `flow cost` read it back. A harness that reports no figure is recorded as "not reported": the subagent count above is a headcount, not a cost, and a guess is worse than a gap.>
182
182
  - Effective size: <diff size (N changed lines) vs `meta.json.size`, which the tier used, and — when the diff landed within 10% under a tier threshold — that fact (§2.0)>
183
183
  - Review path: <the two paths this round actually took: `flow bundle` or git for the material, `flow review` or the agentic panel for the reviewers — each with the reason when it was the fallback (no CLI, non-zero exit, `agents.exec_cmd` empty, every role empty). Without this line a round that skipped the CLI reads exactly like one that used it. When the pack ran, quote its `Config read:` line verbatim: it is the only place that says whether the overlay reached the material, and “no `--harness` was given” there means every key set only in the overlay was missing from this round.>
184
184
  - Agent models: <the value of `models.workers`/`models.agents` **with the file each came from** (flow-core §0) when set; otherwise "inherited from this thread", naming the config files you listed; agents named in `agents.<role>` keep their own definition's model>
@@ -221,10 +221,10 @@ Cost line: count every subagent this command launched — reviewers = §2.1 buil
221
221
  <only if §5 was run; refuted findings with their reason, or "not applicable">
222
222
 
223
223
  ## Blockers
224
- 1. [file:line] · <origin> · …
224
+ 1. [file:line] · <origin(s), from `/flow:feat:review §2.1`'s list> · …
225
225
 
226
226
  ## Suggestions
227
- 1. [file:line] · <origin> · …
227
+ 1. [file:line] · <origin(s), from `/flow:feat:review §2.1`'s list> · …
228
228
  ```
229
229
 
230
230
  ## 8. Close
@@ -232,7 +232,7 @@ Cost line: count every subagent this command launched — reviewers = §2.1 buil
232
232
  - With blockers: `phase` stays where it was (`validate` for size ≥ S, `fix` on XS, where validate never ran). Iterate.
233
233
  - Without blockers: `phase = "review"`, add to `phases_done`. Suggest `/flow:bug:postmortem` (M/L) or `/flow:bug:ship` (XS/S).
234
234
  - **Record *what* you reviewed, and separately what you changed after reading it** — `/flow:feat:review` §9, unchanged: `reviewed_sha` = the **candidate** of §1.5 (the revision the reviewers read, never `git rev-parse HEAD`, which by now holds this round's own fixes), and `fixed_sha` = `git rev-parse HEAD` after those fixes, empty when the round applied none. `phases_done` says a review happened; these two say on which tree and what moved afterwards, and `/flow:bug:ship §0` reads both against what is being pushed. Only when the phase advances: a review that ended in blockers reviewed nothing that stands.
235
- - **Record which pass found what** — `/flow:feat:review §9`, unchanged: one `meta.json.review_findings[]` entry per finding **per source** (`{ round, origin, severity, file, discarded_by_skeptic }`, no finding text), written by `flow review --record` when the CLI ran the panel and by this Close when the agentic panel did. `flow yield` reads them back across works and repos, and the retirement rule is the same: a pass with no unique accepted finding across twenty rounds at a size comes out of the command at that size.
235
+ - **Record which pass found what** — `/flow:feat:review §9`, unchanged: one `meta.json.review_findings[]` row per finding with every origin that raised it and its outcome, plus what the round launched, written once per round through `npx flow-workflows@<version> record-review --file`, the CLI panel's roles included as sources — never by hand, and never also by `flow review --record`. `flow yield` reads them back across works and repos, and the retirement rule is the same: a pass with no unique accepted finding across twenty rounds at a size comes out of the command at that size.
236
236
  - **Record what the agents missed** — `/flow:feat:review §9`, unchanged: surviving findings in a category a panel member or named `agents.<role>` owns and did not report → `meta.json.agent_lessons[]` rows (flow-core §6.7), asking nothing. A fix is where this pays most: the defect already reached production once, and the reviewer that owns its category let it.
237
237
  - **Stage what the review taught** (`knowledge.stage` set; silence by default). Review is where a project teaches the most, and this is the only moment its findings are in context. Candidates are findings about the **domain or the codebase's real behaviour**, not about this diff: a library that does other than its name says, a test disguise that kept the suite green over a live defect, a module rule the reviewers had to cite from its own prose, a measurement. A blocker fixed here is not knowledge; *why it was written wrong* may be. Same evidence rule as `/flow:feat:design` §8 — one line of evidence per finding or it is not staged. One call per finding, one line to the user («Staged N finding(s) for `postmortem`/`ship`»). Never `knowledge.save` here.
238
238
  - Overwrite `00-summary.md` whole (≤15 lines, flow-core §5).
@@ -154,7 +154,7 @@ Launch the reviewers selected in §2.0 and **consolidate their findings into a s
154
154
 
155
155
  When both run, deduplicate overlapping correctness/simplification findings (count each once). The `review_skill` specialists (offensive/defensive security, silent failures, architecture) are not repeated in later phases.
156
156
 
157
- **Dedup keeps every source, not the first one.** A finding carries its **origin** from here to §8 — `built-in`, a panel role, or the pass that raised it (`§3.5`, `§3.6`, `§5`, `§5.5`) — and a finding more than one source raised lists all of them. Counted once, credited to each: a finding only one pass saw and a finding three sources raised say opposite things about that pass, and §9 records the difference.
157
+ **Dedup keeps every source, not the first one.** A finding carries its **origin** from here to §8, spelled from a closed list — `built-in` · `panel:<role>` (`<role>` = the part of a `quality.reviewers` entry before its `:`, or the `review_skill` agent's name — lower-case, every run of other characters turned into `-`) · `reinforcement:<area>` (§3) · `sweep` (§3.5) · `query-duel` (§3.6) · `yagni` (§4) · `contract` (§5) · `idiom` (§5.5) — and a finding more than one source raised lists all of them. §9 records them through a command that refuses any other spelling. Counted once, credited to each: a finding only one pass saw and a finding three sources raised say opposite things about that pass, and §9 records the difference.
158
158
 
159
159
  ### 2.2 Design truth vs design rationale (do not inherit rationalizations)
160
160
  `03-design.md` goes to reviewers as context, with unequal authority:
@@ -321,7 +321,7 @@ Write `.claude/work/<TICKET>/06-review.md`. The `Cost:` line of `## Summary` is
321
321
  - Review path: <the two paths this round actually took: `flow bundle` or git for the material, `flow review` or the agentic panel for the reviewers — each with the reason when it was the fallback (no CLI, non-zero exit, `agents.exec_cmd` empty, every role empty). Without this line a round that skipped the CLI reads exactly like one that used it. When the pack ran, quote its `Config read:` line verbatim: it is the only place that says whether the overlay reached the material, and “no `--harness` was given” there means every key set only in the overlay was missing from this round.>
322
322
  - Agent models: <the value of `models.workers`/`models.agents` **with the file each came from** (flow-core §0) when set; otherwise "inherited from this thread", naming the config files you listed — "unset" without them reads the same whether the overlay was empty or never opened — plus, when the panel ran, that agents named in `agents.<role>` kept the model their own definition sets. The values as they are, no judgement on them>
323
323
  - Cost: <n>/<budget_max> subagents launched (<k> reviewers · <m> reinforcements · <s> skeptics), tier <light|proportional|full>, effort <medium|high|xhigh|max>
324
- - Measured cost: <what the harness reported for this round, when it reported anything — `flow review --record` writes it to `meta.json.cost[]` and `/flow:work:daily` and `flow cost` read it back. A harness that reports no figure is recorded as "not reported": the subagent count above is a headcount, not a cost, and a guess is worse than a gap.>
324
+ - Measured cost: <what the harness reported for this round, when it reported anything — §9 records it as the round's `usd` in `meta.json.cost[]`, and `/flow:work:daily` and `flow cost` read it back. A harness that reports no figure is recorded as "not reported": the subagent count above is a headcount, not a cost, and a guess is worse than a gap.>
325
325
  - Agents launched: <ran vs defined — `N/M` of the `review_skill`/`reviewers` roster, naming any that did not run (with the reason) and any substitution; "built-in only" if §2.0 selected no panel>
326
326
  - Completeness rounds (M/L): N
327
327
  - Critical findings (block ship): N
@@ -361,10 +361,10 @@ Write `.claude/work/<TICKET>/06-review.md`. The `Cost:` line of `## Summary` is
361
361
  <if §6 did not run, one line saying which condition did not hold — size, diff size, count, or budget>
362
362
 
363
363
  ## Blockers (must-fix)
364
- 1. [file:line] · <origin> · description + concrete proposal
364
+ 1. [file:line] · <origin(s), from §2.1's list> · description + concrete proposal
365
365
 
366
366
  ## Suggestions (nice-to-have)
367
- 1. [file:line] · <origin> · description
367
+ 1. [file:line] · <origin(s), from §2.1's list> · description
368
368
 
369
369
  ## Quality gates
370
370
  - style_fix: ✅ / ❌
@@ -384,7 +384,7 @@ Write `.claude/work/<TICKET>/06-review.md`. The `Cost:` line of `## Summary` is
384
384
  - `reviewed_sha` = **the candidate of §1.5**, the revision the reviewers actually read. Not `git rev-parse HEAD`, which by then holds this round's own fixes — code no reviewer saw, recorded as reviewed, and `ship` finding it equal to `HEAD` every time.
385
385
  - `fixed_sha` = `git rev-parse HEAD` after this round's fixes, or **empty** when the round applied none. Two fields because they are two facts.
386
386
  - `phases_done` says a review *happened*; these say which tree, and `/flow:feat:ship §1` reads both before pushing. Written whenever the phase advances, never when it does not: a review that ended in blockers reviewed nothing that stands.
387
- - **Record which pass found what**, in the same write: `meta.json.review_findings[]`, one entry per finding **per source** — `{ round, origin, severity, file, discarded_by_skeptic }`, and no finding text, which stays in the artifact. `flow review --record` writes these itself when the CLI ran the panel; when the agentic panel ran, write them here from the origins §2.1 carried. `flow yield` reads them back across every work and repo, per origin and per size: rounds run, findings, how many only that pass raised, how many of those were acted on, and the agents it took (where the round recorded them). That unique-accepted number is the only evidence a pass is still earning its words, and `yield` marks a pass that ran twenty rounds at a size without one.
387
+ - **Record which pass found what**, in the same write, through the CLI — never by editing `meta.json`: write the round to `.claude/work/<TICKET>/review/round-<k>.json` and run `npx flow-workflows@<version> record-review --file <that path>` from the work's checkout. The file is `{ "round": { "mr": <n, in a multi-MR/PR work>, "tier": "light|proportional|full", "effective_size": "XS|S|M|L", "agents": { "<origin>": <agents it launched> }, "usd": <what the harness reported, when it did> }, "findings": [ { "sources": ["<origin>", …], "severity": "blocker|major|minor|nit|unrated", "file": "<path>", "outcome": "<outcome>" } ] }` — one entry per finding after §2.1's dedup, every origin that raised it in `sources`, no finding text (it stays in the artifact). `round` and its `agents` are required: every pass that ran this round, findings or not — a pass that ran and found nothing is the case the count exists for — and every source of a finding must be one of them. **Outcome**, as the round ends: `fixed` (applied in this round) · `open` (a blocker left to the user) · `rejected` (judged wrong — the reason is in this artifact) · `discarded` (refuted by §6) · `deferred` (became a `followups[]` entry). Exit 1 names each value outside the lists with the valid ones and writes nothing: correct them and run it once more. The CLI unavailable (the fallback rule of §1) → say so in `06-review.md` and leave the rows unrecorded rather than hand-written — a round with no rows is visible as such, a misspelt one is counted wrong. **One round, one record**: when the CLI ran the panel (§1), it ran without `--record`, and its roles go into this same file as `panel:<role>` sources with their real outcomes — recording both would split one review into two rounds and count every finding as unique to its half. `flow review --record` is for running the panel outside a review phase. `flow yield` reads them back across every work and repo, per origin and per size: rounds run, findings, how many only that pass raised, how many of those were acted on (`fixed` · `open` · `deferred`), and the agents it took. That unique-accepted number is the only evidence a pass is still earning its words, and `yield` marks a pass that ran twenty rounds at a size without one.
388
388
  - **Stage what the review taught** (`knowledge.stage` set; silence by default). Review is where a project teaches the most, and this is the only moment its findings are in context. Candidates are findings about the **domain or the codebase's real behaviour**, not about this diff: a library that does other than its name says, a test disguise that kept the suite green over a live defect, a module rule the reviewers had to cite from its own prose, a measurement. A blocker fixed here is not knowledge; *why it was written wrong* may be. Same evidence rule as `/flow:feat:design` §8 — one line of evidence per finding or it is not staged. One call per finding, one line to the user («Staged N finding(s) for `ship`»). Never `knowledge.save` here.
389
389
  - Overwrite `00-summary.md` whole (≤15 lines, flow-core §5).
390
390
  - **Record what the agents missed** (flow-core §6.7, `agents.learn` not `off`; asking nothing): for each finding that survived, the panel member or named `agents.<role>` whose category it falls in and who did not report it, and the delegated `build` agent whose code it sits in → one `meta.json.agent_lessons[]` row each, only when the lesson passes the §6.7 test. The origins §2.1 carried are what make this possible — a finding with no origin teaches nobody.
@@ -90,7 +90,7 @@ This system **orchestrates** the project's existing sub-agents and skills (it do
90
90
  "fixed_sha": "40-char sha after that review's own fixes, or '' when it applied none",
91
91
  "validated_sha": "40-char sha the suite last went green on, or ''",
92
92
  "respond_rounds": 0,
93
- "review_findings": [{"round": 1, "origin": "security", "severity": "blocker", "file": "src/X.php", "discarded_by_skeptic": false}],
93
+ "review_findings": [{"round": 1, "sources": ["built-in", "panel:security"], "severity": "blocker", "file": "src/X.php", "outcome": "fixed"}],
94
94
  "mrs": [
95
95
  {
96
96
  "n": 1,
@@ -159,7 +159,8 @@ This system **orchestrates** the project's existing sub-agents and skills (it do
159
159
  ```
160
160
 
161
161
  - **`candidate_sha` / `reviewed_sha` / `fixed_sha` / `validated_sha`**: which code each verdict is about. `candidate_sha` is written by `review` in its **pre-flight** (§1.5) — the revision it froze before reading anything, `git rev-parse HEAD` over a clean tree and `git stash create` over a dirty one, anchored at `refs/flow/candidate/<TICKET>` so nothing collects it. The other three are written at `## Close`, **only when the phase actually advances**, work-level and in the current `mrs[]` entry: `reviewed_sha` is the candidate that was actually read, `fixed_sha` is `HEAD` after that round's own fixes (empty when it applied none), `validated_sha` is where the suite went green.
162
- - **`review_findings[]`**: one entry per finding **per source** — `{ round, origin, severity, file, discarded_by_skeptic }`, no finding text (that stays in `06-review.md`). Written at `review`'s Close, and by `flow review --record` when the CLI ran the panel. `origin` is `built-in`, a panel role, or the pass that raised it. It exists so a pass can be retired on evidence: `flow yield [<repo-path>…]` reads every work those repos hold — live and `_archive/`, here and in the main checkout — and reports per origin and per size how many rounds each ran, how many findings it contributed, how many **only** it raised, and how many of those were acted on (for rows written before findings carried an outcome: not refuted by a skeptic) — and a finding three sources raised says nothing about any of them, which is why dedup keeps every source rather than the first. Old spellings of an origin (`builtin`, `cli:tests`, `§5.5`) are mapped on read and listed. The rule was written down before the data arrived: no unique accepted finding across twenty rounds at a size (XS and S pooled) and the pass comes out of the command at that size.
162
+ - **`review_findings[]`**: one row per finding, after the review's dedup — `{ round, mr?, sources, severity, file, outcome }`, no finding text (that stays in `06-review.md`). `sources` lists every origin that raised it, from a closed list (`built-in` · `panel:<role>` · `reinforcement:<area>` · `sweep` · `query-duel` · `yagni` · `contract` · `idiom`); `outcome` is `fixed` · `open` · `rejected` · `discarded` · `deferred`. The same round writes one `cost[]` entry with `round`, `tier`, `effective_size` and `agents` — every pass it launched, findings or not. Only `flow record-review --file` writes them — once per round, the CLI panel's roles included — and it refuses any value outside those lists, or a source that is not among the round's `agents`: six weeks of hand-written origins had produced ~65 spellings. Rows from before that, `{ round, origin, severity, file, discarded_by_skeptic }` one per source, stay as they are. It exists so a pass can be retired on evidence: `flow yield [<repo-path>…]` reads every work those repos hold — live and `_archive/`, here and in the main checkout — and reports per origin and per size how many rounds each ran, how many findings it contributed, how many **only** it raised, and how many of those were acted on (for the older rows: not refuted by a skeptic) — and a finding three sources raised says nothing about any of them, which is why dedup keeps every source rather than the first. The rule was written down before the data arrived: no unique accepted finding across twenty rounds at a size (XS and S pooled) and the pass comes out of the command at that size.
163
+ - **`escape`** (bug works only): `{ work, ticket, commit, file, size }` — the reviewed work the root-cause commit belongs to, written by `flow escape` at `bug:investigate`'s Close, and only when the commit sits inside exactly one work's reviewed range (merge history) or carries the number of exactly one reviewed MR/PR (squash). `flow yield` prints `escapes: <n>` under the table of that work's size: what a lighter review at that size has already let through.
163
164
  Two fields for the review because they are two facts. `reviewed_sha` used to be `git rev-parse HEAD` at the end of the phase, which by then held the round's own fixes — so `ship` compared a sha against itself and reported a match over code no reviewer had read. Read by `ship` at pre-flight against `HEAD`: a delta of test files and this work's own folder passes with a note in `06-review.md`; anything else stops and asks in every autonomy mode. Empty is not a mismatch; `fixed_sha` set with `reviewed_sha == HEAD` is one. `review` also reads `reviewed_sha` back as **its own base** on a re-review, so the second round reads the delta instead of the whole branch.
164
165
  - **`respond_rounds`**: rounds of `/flow:work:respond` on an MR/PR. `/flow:work:respond §1` reads it against `quality.respond_max_rounds` (empty = 3) and refuses the round that would exceed it, handing the open threads back to the user.
165
166
  - **`roadmap`**: the roadmap item this work delivers (flow-core §10). Linked at `/flow:feat:start §3.7`, marked in progress / done by `/flow:feat:ship` inside the MR/PR, shown by `next`/`daily`/`resume` — which also flag an item the code delivered but the file still does not mark. `null` with no roadmap, no link, or a bug.
@@ -17,7 +17,7 @@ Every `/flow-*` command assumes these rules. They are stated once, here, so a co
17
17
  carries what is specific to its phase. Read this once per session; a command that says "load
18
18
  `flow-core`" means this file.
19
19
 
20
- **This file belongs to flow `0.108.0`.** Compare it once, at the start of the session, against
20
+ **This file belongs to flow `0.110.0`.** Compare it once, at the start of the session, against
21
21
  `version` in `~/.claude/flow/.claude-plugin/plugin.json`. The two differing means the session
22
22
  is running a **mixture** — the commands from one copy of the plugin, these shared rules from another
23
23
  — which is exactly what happens when a branch or a release candidate is loaded over an installed
@@ -796,8 +796,9 @@ of the MR/PR: a list that jumps from nothing to finished told the user nothing w
796
796
  ### 4.5 `meta.json.cost[]` — what a phase measured, when it could
797
797
 
798
798
  A phase that can measure what it spent appends one entry: `{ "phase": "review", "at": "<ISO>",
799
- "reviewers": 8, "usd": 0.0124, "source": "harness" }`. `flow review --record` writes it; `flow cost`
800
- reads it back per phase. Two rules, and they are the reason the block is worth having: a harness
799
+ "reviewers": 8, "usd": 0.0124, "source": "harness" }` — a review's entry also carries `round`, `tier`,
800
+ `effective_size` and `agents`. `flow record-review` writes it at the review's Close (`flow review --record`
801
+ outside one); `flow cost` reads it back per phase. Two rules, and they are the reason the block is worth having: a harness
801
802
  that reports no figure is recorded with `"source": "not reported"` rather than estimated, and a
802
803
  phase with no entry measured nothing — **absence is not zero**. Every figure is the harness's own
803
804
  client-side estimate and can differ from a bill.
@@ -165,7 +165,7 @@ If `agents.fanout_tool` is set in `FLOW.md`, run the sweep through that tool; br
165
165
  - Logs / traces that confirm it:
166
166
 
167
167
  ## Why tests/CI did not catch it
168
- <2-3 lines>
168
+ <2-3 lines. Then one line with what `escape` (§8) answered about the suspected commit: the work whose review read it, or that no single reviewed work holds it.>
169
169
 
170
170
  ## Areas with similar risk (same pattern)
171
171
  - explain
@@ -231,6 +231,7 @@ If `knowledge.stage` is set and the root cause reveals a **non-obvious "why"** a
231
231
  ## 8. Close
232
232
 
233
233
  - Update `meta.json`: `phase = "investigate"`, add to `phases_done`.
234
+ - **Did a flow review let it through?** With a suspected commit named under "Evidence", run `npx flow-workflows@<version> escape <commit> --file <the file the root cause is in>` from the work's checkout (`<version>` = this plugin's own, from `~/.claude/flow/.claude-plugin/plugin.json`). It records `meta.json.escape` only when the commit sits inside exactly one work's reviewed range, or carries the number of exactly one reviewed MR/PR; anything less it says and records nowhere. Copy its line under "Why tests/CI did not catch it". No suspected commit, or the CLI unavailable → say so there in one line; never write `escape` by hand. Asks nothing: it is a reading, and `flow yield` is what counts it.
234
235
  - Overwrite `00-summary.md` whole (≤15 lines, flow-core §5).
235
236
  - Suggest `/flow-bug-fix` — `meta.json.handoff` set and not `unattended` → `/flow-work-handoff` in its place, **Hand off the study** recommended and **Build here** second where it asks (flow-core §2, a study made for handoff).
236
237
  - **Autonomy handoff** (`autonomy.mode`, flow-core §2): `manual` → propose `/flow-bug-fix` with a single `AskUserQuestion`, invoke it only on confirmation; `guided`/`auto` → chain into it in this same turn. Either way: `meta.json.handoff` set and not `unattended` → `/flow-work-handoff` in its place, **Hand off the study** recommended and **Build here** second where it asks (flow-core §2, a study made for handoff).
@@ -182,7 +182,7 @@ Cost line: count every subagent this command launched — reviewers = §2.1 buil
182
182
  - Review tier: <light | full | proportional — which reviewers ran, at what built-in effort (medium/high/xhigh/max), and why, per §2.0>
183
183
  - Agents launched: <ran vs defined — `N/M` of the `review_skill`/`reviewers` roster, naming any that did not run (with the reason) and any substitution; "built-in only" if §2.0 selected no panel>
184
184
  - Cost: <n>/<budget_max> subagents launched (<k> reviewers · <m> reinforcements · <s> skeptics), tier <light|proportional|full>
185
- - Measured cost: <what the harness reported for this round, when it reported anything — `flow review --record` writes it to `meta.json.cost[]` and `/flow-work-daily` and `flow cost` read it back. A harness that reports no figure is recorded as "not reported": the subagent count above is a headcount, not a cost, and a guess is worse than a gap.>
185
+ - Measured cost: <what the harness reported for this round, when it reported anything — recorded as the round's `usd` in `meta.json.cost[]` (`/flow-feat-review §9`), and `/flow-work-daily` and `flow cost` read it back. A harness that reports no figure is recorded as "not reported": the subagent count above is a headcount, not a cost, and a guess is worse than a gap.>
186
186
  - Effective size: <diff size (N changed lines) vs `meta.json.size`, which the tier used, and — when the diff landed within 10% under a tier threshold — that fact (§2.0)>
187
187
  - Review path: <the two paths this round actually took: `flow bundle` or git for the material, `flow review` or the agentic panel for the reviewers — each with the reason when it was the fallback (no CLI, non-zero exit, `agents.exec_cmd` empty, every role empty). Without this line a round that skipped the CLI reads exactly like one that used it. When the pack ran, quote its `Config read:` line verbatim: it is the only place that says whether the overlay reached the material, and “no `--harness` was given” there means every key set only in the overlay was missing from this round.>
188
188
  - Agent models: <the value of `models.workers`/`models.agents` **with the file each came from** (flow-core §0) when set; otherwise "inherited from this thread", naming the config files you listed; agents named in `agents.<role>` keep their own definition's model>
@@ -225,10 +225,10 @@ Cost line: count every subagent this command launched — reviewers = §2.1 buil
225
225
  <only if §5 was run; refuted findings with their reason, or "not applicable">
226
226
 
227
227
  ## Blockers
228
- 1. [file:line] · <origin> · …
228
+ 1. [file:line] · <origin(s), from `/flow-feat-review §2.1`'s list> · …
229
229
 
230
230
  ## Suggestions
231
- 1. [file:line] · <origin> · …
231
+ 1. [file:line] · <origin(s), from `/flow-feat-review §2.1`'s list> · …
232
232
  ```
233
233
 
234
234
  ## 8. Close
@@ -236,7 +236,7 @@ Cost line: count every subagent this command launched — reviewers = §2.1 buil
236
236
  - With blockers: `phase` stays where it was (`validate` for size ≥ S, `fix` on XS, where validate never ran). Iterate.
237
237
  - Without blockers: `phase = "review"`, add to `phases_done`. Suggest `/flow-bug-postmortem` (M/L) or `/flow-bug-ship` (XS/S).
238
238
  - **Record *what* you reviewed, and separately what you changed after reading it** — `/flow-feat-review` §9, unchanged: `reviewed_sha` = the **candidate** of §1.5 (the revision the reviewers read, never `git rev-parse HEAD`, which by now holds this round's own fixes), and `fixed_sha` = `git rev-parse HEAD` after those fixes, empty when the round applied none. `phases_done` says a review happened; these two say on which tree and what moved afterwards, and `/flow-bug-ship §0` reads both against what is being pushed. Only when the phase advances: a review that ended in blockers reviewed nothing that stands.
239
- - **Record which pass found what** — `/flow-feat-review §9`, unchanged: one `meta.json.review_findings[]` entry per finding **per source** (`{ round, origin, severity, file, discarded_by_skeptic }`, no finding text), written by `flow review --record` when the CLI ran the panel and by this Close when the agentic panel did. `flow yield` reads them back across works and repos, and the retirement rule is the same: a pass with no unique accepted finding across twenty rounds at a size comes out of the command at that size.
239
+ - **Record which pass found what** — `/flow-feat-review §9`, unchanged: one `meta.json.review_findings[]` row per finding with every origin that raised it and its outcome, plus what the round launched, written once per round through `npx flow-workflows@<version> record-review --file`, the CLI panel's roles included as sources — never by hand, and never also by `flow review --record`. `flow yield` reads them back across works and repos, and the retirement rule is the same: a pass with no unique accepted finding across twenty rounds at a size comes out of the command at that size.
240
240
  - **Record what the agents missed** — `/flow-feat-review §9`, unchanged: surviving findings in a category a panel member or named `agents.<role>` owns and did not report → `meta.json.agent_lessons[]` rows (flow-core §6.7), asking nothing. A fix is where this pays most: the defect already reached production once, and the reviewer that owns its category let it.
241
241
  - **Stage what the review taught** (`knowledge.stage` set; silence by default). Review is where a project teaches the most, and this is the only moment its findings are in context. Candidates are findings about the **domain or the codebase's real behaviour**, not about this diff: a library that does other than its name says, a test disguise that kept the suite green over a live defect, a module rule the reviewers had to cite from its own prose, a measurement. A blocker fixed here is not knowledge; *why it was written wrong* may be. Same evidence rule as `/flow-feat-design` §8 — one line of evidence per finding or it is not staged. One call per finding, one line to the user («Staged N finding(s) for `postmortem`/`ship`»). Never `knowledge.save` here.
242
242
  - Overwrite `00-summary.md` whole (≤15 lines, flow-core §5).
@@ -158,7 +158,7 @@ Launch the reviewers selected in §2.0 and **consolidate their findings into a s
158
158
 
159
159
  When both run, deduplicate overlapping correctness/simplification findings (count each once). The `review_skill` specialists (offensive/defensive security, silent failures, architecture) are not repeated in later phases.
160
160
 
161
- **Dedup keeps every source, not the first one.** A finding carries its **origin** from here to §8 — `built-in`, a panel role, or the pass that raised it (`§3.5`, `§3.6`, `§5`, `§5.5`) — and a finding more than one source raised lists all of them. Counted once, credited to each: a finding only one pass saw and a finding three sources raised say opposite things about that pass, and §9 records the difference.
161
+ **Dedup keeps every source, not the first one.** A finding carries its **origin** from here to §8, spelled from a closed list — `built-in` · `panel:<role>` (`<role>` = the part of a `quality.reviewers` entry before its `:`, or the `review_skill` agent's name — lower-case, every run of other characters turned into `-`) · `reinforcement:<area>` (§3) · `sweep` (§3.5) · `query-duel` (§3.6) · `yagni` (§4) · `contract` (§5) · `idiom` (§5.5) — and a finding more than one source raised lists all of them. §9 records them through a command that refuses any other spelling. Counted once, credited to each: a finding only one pass saw and a finding three sources raised say opposite things about that pass, and §9 records the difference.
162
162
 
163
163
  ### 2.2 Design truth vs design rationale (do not inherit rationalizations)
164
164
  `03-design.md` goes to reviewers as context, with unequal authority:
@@ -325,7 +325,7 @@ Write `.claude/work/<TICKET>/06-review.md`. The `Cost:` line of `## Summary` is
325
325
  - Review path: <the two paths this round actually took: `flow bundle` or git for the material, `flow review` or the agentic panel for the reviewers — each with the reason when it was the fallback (no CLI, non-zero exit, `agents.exec_cmd` empty, every role empty). Without this line a round that skipped the CLI reads exactly like one that used it. When the pack ran, quote its `Config read:` line verbatim: it is the only place that says whether the overlay reached the material, and “no `--harness` was given” there means every key set only in the overlay was missing from this round.>
326
326
  - Agent models: <the value of `models.workers`/`models.agents` **with the file each came from** (flow-core §0) when set; otherwise "inherited from this thread", naming the config files you listed — "unset" without them reads the same whether the overlay was empty or never opened — plus, when the panel ran, that agents named in `agents.<role>` kept the model their own definition sets. The values as they are, no judgement on them>
327
327
  - Cost: <n>/<budget_max> subagents launched (<k> reviewers · <m> reinforcements · <s> skeptics), tier <light|proportional|full>, effort <medium|high|xhigh|max>
328
- - Measured cost: <what the harness reported for this round, when it reported anything — `flow review --record` writes it to `meta.json.cost[]` and `/flow-work-daily` and `flow cost` read it back. A harness that reports no figure is recorded as "not reported": the subagent count above is a headcount, not a cost, and a guess is worse than a gap.>
328
+ - Measured cost: <what the harness reported for this round, when it reported anything — §9 records it as the round's `usd` in `meta.json.cost[]`, and `/flow-work-daily` and `flow cost` read it back. A harness that reports no figure is recorded as "not reported": the subagent count above is a headcount, not a cost, and a guess is worse than a gap.>
329
329
  - Agents launched: <ran vs defined — `N/M` of the `review_skill`/`reviewers` roster, naming any that did not run (with the reason) and any substitution; "built-in only" if §2.0 selected no panel>
330
330
  - Completeness rounds (M/L): N
331
331
  - Critical findings (block ship): N
@@ -365,10 +365,10 @@ Write `.claude/work/<TICKET>/06-review.md`. The `Cost:` line of `## Summary` is
365
365
  <if §6 did not run, one line saying which condition did not hold — size, diff size, count, or budget>
366
366
 
367
367
  ## Blockers (must-fix)
368
- 1. [file:line] · <origin> · description + concrete proposal
368
+ 1. [file:line] · <origin(s), from §2.1's list> · description + concrete proposal
369
369
 
370
370
  ## Suggestions (nice-to-have)
371
- 1. [file:line] · <origin> · description
371
+ 1. [file:line] · <origin(s), from §2.1's list> · description
372
372
 
373
373
  ## Quality gates
374
374
  - style_fix: ✅ / ❌
@@ -388,7 +388,7 @@ Write `.claude/work/<TICKET>/06-review.md`. The `Cost:` line of `## Summary` is
388
388
  - `reviewed_sha` = **the candidate of §1.5**, the revision the reviewers actually read. Not `git rev-parse HEAD`, which by then holds this round's own fixes — code no reviewer saw, recorded as reviewed, and `ship` finding it equal to `HEAD` every time.
389
389
  - `fixed_sha` = `git rev-parse HEAD` after this round's fixes, or **empty** when the round applied none. Two fields because they are two facts.
390
390
  - `phases_done` says a review *happened*; these say which tree, and `/flow-feat-ship §1` reads both before pushing. Written whenever the phase advances, never when it does not: a review that ended in blockers reviewed nothing that stands.
391
- - **Record which pass found what**, in the same write: `meta.json.review_findings[]`, one entry per finding **per source** — `{ round, origin, severity, file, discarded_by_skeptic }`, and no finding text, which stays in the artifact. `flow review --record` writes these itself when the CLI ran the panel; when the agentic panel ran, write them here from the origins §2.1 carried. `flow yield` reads them back across every work and repo, per origin and per size: rounds run, findings, how many only that pass raised, how many of those were acted on, and the agents it took (where the round recorded them). That unique-accepted number is the only evidence a pass is still earning its words, and `yield` marks a pass that ran twenty rounds at a size without one.
391
+ - **Record which pass found what**, in the same write, through the CLI — never by editing `meta.json`: write the round to `.claude/work/<TICKET>/review/round-<k>.json` and run `npx flow-workflows@<version> record-review --file <that path>` from the work's checkout. The file is `{ "round": { "mr": <n, in a multi-MR/PR work>, "tier": "light|proportional|full", "effective_size": "XS|S|M|L", "agents": { "<origin>": <agents it launched> }, "usd": <what the harness reported, when it did> }, "findings": [ { "sources": ["<origin>", …], "severity": "blocker|major|minor|nit|unrated", "file": "<path>", "outcome": "<outcome>" } ] }` — one entry per finding after §2.1's dedup, every origin that raised it in `sources`, no finding text (it stays in the artifact). `round` and its `agents` are required: every pass that ran this round, findings or not — a pass that ran and found nothing is the case the count exists for — and every source of a finding must be one of them. **Outcome**, as the round ends: `fixed` (applied in this round) · `open` (a blocker left to the user) · `rejected` (judged wrong — the reason is in this artifact) · `discarded` (refuted by §6) · `deferred` (became a `followups[]` entry). Exit 1 names each value outside the lists with the valid ones and writes nothing: correct them and run it once more. The CLI unavailable (the fallback rule of §1) → say so in `06-review.md` and leave the rows unrecorded rather than hand-written — a round with no rows is visible as such, a misspelt one is counted wrong. **One round, one record**: when the CLI ran the panel (§1), it ran without `--record`, and its roles go into this same file as `panel:<role>` sources with their real outcomes — recording both would split one review into two rounds and count every finding as unique to its half. `flow review --record` is for running the panel outside a review phase. `flow yield` reads them back across every work and repo, per origin and per size: rounds run, findings, how many only that pass raised, how many of those were acted on (`fixed` · `open` · `deferred`), and the agents it took. That unique-accepted number is the only evidence a pass is still earning its words, and `yield` marks a pass that ran twenty rounds at a size without one.
392
392
  - **Stage what the review taught** (`knowledge.stage` set; silence by default). Review is where a project teaches the most, and this is the only moment its findings are in context. Candidates are findings about the **domain or the codebase's real behaviour**, not about this diff: a library that does other than its name says, a test disguise that kept the suite green over a live defect, a module rule the reviewers had to cite from its own prose, a measurement. A blocker fixed here is not knowledge; *why it was written wrong* may be. Same evidence rule as `/flow-feat-design` §8 — one line of evidence per finding or it is not staged. One call per finding, one line to the user («Staged N finding(s) for `ship`»). Never `knowledge.save` here.
393
393
  - Overwrite `00-summary.md` whole (≤15 lines, flow-core §5).
394
394
  - **Record what the agents missed** (flow-core §6.7, `agents.learn` not `off`; asking nothing): for each finding that survived, the panel member or named `agents.<role>` whose category it falls in and who did not report it, and the delegated `build` agent whose code it sits in → one `meta.json.agent_lessons[]` row each, only when the lesson passes the §6.7 test. The origins §2.1 carried are what make this possible — a finding with no origin teaches nobody.
@@ -94,7 +94,7 @@ This system **orchestrates** the project's existing sub-agents and skills (it do
94
94
  "fixed_sha": "40-char sha after that review's own fixes, or '' when it applied none",
95
95
  "validated_sha": "40-char sha the suite last went green on, or ''",
96
96
  "respond_rounds": 0,
97
- "review_findings": [{"round": 1, "origin": "security", "severity": "blocker", "file": "src/X.php", "discarded_by_skeptic": false}],
97
+ "review_findings": [{"round": 1, "sources": ["built-in", "panel:security"], "severity": "blocker", "file": "src/X.php", "outcome": "fixed"}],
98
98
  "mrs": [
99
99
  {
100
100
  "n": 1,
@@ -163,7 +163,8 @@ This system **orchestrates** the project's existing sub-agents and skills (it do
163
163
  ```
164
164
 
165
165
  - **`candidate_sha` / `reviewed_sha` / `fixed_sha` / `validated_sha`**: which code each verdict is about. `candidate_sha` is written by `review` in its **pre-flight** (§1.5) — the revision it froze before reading anything, `git rev-parse HEAD` over a clean tree and `git stash create` over a dirty one, anchored at `refs/flow/candidate/<TICKET>` so nothing collects it. The other three are written at `## Close`, **only when the phase actually advances**, work-level and in the current `mrs[]` entry: `reviewed_sha` is the candidate that was actually read, `fixed_sha` is `HEAD` after that round's own fixes (empty when it applied none), `validated_sha` is where the suite went green.
166
- - **`review_findings[]`**: one entry per finding **per source** — `{ round, origin, severity, file, discarded_by_skeptic }`, no finding text (that stays in `06-review.md`). Written at `review`'s Close, and by `flow review --record` when the CLI ran the panel. `origin` is `built-in`, a panel role, or the pass that raised it. It exists so a pass can be retired on evidence: `flow yield [<repo-path>…]` reads every work those repos hold — live and `_archive/`, here and in the main checkout — and reports per origin and per size how many rounds each ran, how many findings it contributed, how many **only** it raised, and how many of those were acted on (for rows written before findings carried an outcome: not refuted by a skeptic) — and a finding three sources raised says nothing about any of them, which is why dedup keeps every source rather than the first. Old spellings of an origin (`builtin`, `cli:tests`, `§5.5`) are mapped on read and listed. The rule was written down before the data arrived: no unique accepted finding across twenty rounds at a size (XS and S pooled) and the pass comes out of the command at that size.
166
+ - **`review_findings[]`**: one row per finding, after the review's dedup — `{ round, mr?, sources, severity, file, outcome }`, no finding text (that stays in `06-review.md`). `sources` lists every origin that raised it, from a closed list (`built-in` · `panel:<role>` · `reinforcement:<area>` · `sweep` · `query-duel` · `yagni` · `contract` · `idiom`); `outcome` is `fixed` · `open` · `rejected` · `discarded` · `deferred`. The same round writes one `cost[]` entry with `round`, `tier`, `effective_size` and `agents` — every pass it launched, findings or not. Only `flow record-review --file` writes them — once per round, the CLI panel's roles included — and it refuses any value outside those lists, or a source that is not among the round's `agents`: six weeks of hand-written origins had produced ~65 spellings. Rows from before that, `{ round, origin, severity, file, discarded_by_skeptic }` one per source, stay as they are. It exists so a pass can be retired on evidence: `flow yield [<repo-path>…]` reads every work those repos hold — live and `_archive/`, here and in the main checkout — and reports per origin and per size how many rounds each ran, how many findings it contributed, how many **only** it raised, and how many of those were acted on (for the older rows: not refuted by a skeptic) — and a finding three sources raised says nothing about any of them, which is why dedup keeps every source rather than the first. The rule was written down before the data arrived: no unique accepted finding across twenty rounds at a size (XS and S pooled) and the pass comes out of the command at that size.
167
+ - **`escape`** (bug works only): `{ work, ticket, commit, file, size }` — the reviewed work the root-cause commit belongs to, written by `flow escape` at `bug:investigate`'s Close, and only when the commit sits inside exactly one work's reviewed range (merge history) or carries the number of exactly one reviewed MR/PR (squash). `flow yield` prints `escapes: <n>` under the table of that work's size: what a lighter review at that size has already let through.
167
168
  Two fields for the review because they are two facts. `reviewed_sha` used to be `git rev-parse HEAD` at the end of the phase, which by then held the round's own fixes — so `ship` compared a sha against itself and reported a match over code no reviewer had read. Read by `ship` at pre-flight against `HEAD`: a delta of test files and this work's own folder passes with a note in `06-review.md`; anything else stops and asks in every autonomy mode. Empty is not a mismatch; `fixed_sha` set with `reviewed_sha == HEAD` is one. `review` also reads `reviewed_sha` back as **its own base** on a re-review, so the second round reads the delta instead of the whole branch.
168
169
  - **`respond_rounds`**: rounds of `/flow-work-respond` on an MR/PR. `/flow-work-respond §1` reads it against `quality.respond_max_rounds` (empty = 3) and refuses the round that would exceed it, handing the open threads back to the user.
169
170
  - **`roadmap`**: the roadmap item this work delivers (flow-core §10). Linked at `/flow-feat-start §3.7`, marked in progress / done by `/flow-feat-ship` inside the MR/PR, shown by `next`/`daily`/`resume` — which also flag an item the code delivered but the file still does not mark. `null` with no roadmap, no link, or a bug.
@@ -16,7 +16,7 @@ Every `/flow-*` command assumes these rules. They are stated once, here, so a co
16
16
  carries what is specific to its phase. Read this once per session; a command that says "load
17
17
  `flow-core`" means this file.
18
18
 
19
- **This file belongs to flow `0.108.0`.** Compare it once, at the start of the session, against
19
+ **This file belongs to flow `0.110.0`.** Compare it once, at the start of the session, against
20
20
  `version` in `~/.claude/flow/.claude-plugin/plugin.json`. The two differing means the session
21
21
  is running a **mixture** — the commands from one copy of the plugin, these shared rules from another
22
22
  — which is exactly what happens when a branch or a release candidate is loaded over an installed
@@ -795,8 +795,9 @@ of the MR/PR: a list that jumps from nothing to finished told the user nothing w
795
795
  ### 4.5 `meta.json.cost[]` — what a phase measured, when it could
796
796
 
797
797
  A phase that can measure what it spent appends one entry: `{ "phase": "review", "at": "<ISO>",
798
- "reviewers": 8, "usd": 0.0124, "source": "harness" }`. `flow review --record` writes it; `flow cost`
799
- reads it back per phase. Two rules, and they are the reason the block is worth having: a harness
798
+ "reviewers": 8, "usd": 0.0124, "source": "harness" }` — a review's entry also carries `round`, `tier`,
799
+ `effective_size` and `agents`. `flow record-review` writes it at the review's Close (`flow review --record`
800
+ outside one); `flow cost` reads it back per phase. Two rules, and they are the reason the block is worth having: a harness
800
801
  that reports no figure is recorded with `"source": "not reported"` rather than estimated, and a
801
802
  phase with no entry measured nothing — **absence is not zero**. Every figure is the harness's own
802
803
  client-side estimate and can differ from a bill.
@@ -163,7 +163,7 @@ If `agents.fanout_tool` is set in `FLOW.md`, run the sweep through that tool; br
163
163
  - Logs / traces that confirm it:
164
164
 
165
165
  ## Why tests/CI did not catch it
166
- <2-3 lines>
166
+ <2-3 lines. Then one line with what `escape` (§8) answered about the suspected commit: the work whose review read it, or that no single reviewed work holds it.>
167
167
 
168
168
  ## Areas with similar risk (same pattern)
169
169
  - explain
@@ -229,6 +229,7 @@ If `knowledge.stage` is set and the root cause reveals a **non-obvious "why"** a
229
229
  ## 8. Close
230
230
 
231
231
  - Update `meta.json`: `phase = "investigate"`, add to `phases_done`.
232
+ - **Did a flow review let it through?** With a suspected commit named under "Evidence", run `npx flow-workflows@<version> escape <commit> --file <the file the root cause is in>` from the work's checkout (`<version>` = this plugin's own, from `~/.claude/flow/.claude-plugin/plugin.json`). It records `meta.json.escape` only when the commit sits inside exactly one work's reviewed range, or carries the number of exactly one reviewed MR/PR; anything less it says and records nowhere. Copy its line under "Why tests/CI did not catch it". No suspected commit, or the CLI unavailable → say so there in one line; never write `escape` by hand. Asks nothing: it is a reading, and `flow yield` is what counts it.
232
233
  - Overwrite `00-summary.md` whole (≤15 lines, flow-core §5).
233
234
  - Suggest `/flow-bug-fix` — `meta.json.handoff` set and not `unattended` → `/flow-work-handoff` in its place, **Hand off the study** recommended and **Build here** second where it asks (flow-core §2, a study made for handoff).
234
235
  - **Autonomy handoff** (`autonomy.mode`, flow-core §2): `manual` → propose `/flow-bug-fix` with a single `AskUserQuestion`, invoke it only on confirmation; `guided`/`auto` → chain into it in this same turn. Either way: `meta.json.handoff` set and not `unattended` → `/flow-work-handoff` in its place, **Hand off the study** recommended and **Build here** second where it asks (flow-core §2, a study made for handoff).