flow-workflows 0.109.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.109.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
@@ -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).
@@ -164,6 +164,7 @@ This system **orchestrates** the project's existing sub-agents and skills (it do
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
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.109.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
@@ -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).
@@ -160,6 +160,7 @@ This system **orchestrates** the project's existing sub-agents and skills (it do
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
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.109.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
@@ -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).
@@ -164,6 +164,7 @@ This system **orchestrates** the project's existing sub-agents and skills (it do
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
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.109.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
@@ -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).
@@ -162,6 +162,7 @@ This system **orchestrates** the project's existing sub-agents and skills (it do
162
162
 
163
163
  - **`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.
164
164
  - **`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.
165
+ - **`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.
165
166
  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.
166
167
  - **`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.
167
168
  - **`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.
package/bin/cli.mjs CHANGED
@@ -1094,6 +1094,137 @@ async function review(argv) {
1094
1094
  }
1095
1095
  }
1096
1096
 
1097
+ // --- escape ----------------------------------------------------------------------------
1098
+ // A bug whose cause is a commit a flow review read is the one number that says what trimming
1099
+ // the review would cost. It is charged only on evidence: the commit inside exactly one
1100
+ // reviewed range, or carrying the number of exactly one reviewed MR/PR. "An ancestor of what
1101
+ // was reviewed" is not evidence — the whole history of the base is an ancestor of every
1102
+ // reviewed sha — and a ticket number is not either, since one ticket spans several MRs/PRs.
1103
+
1104
+ function escapeOf(argv) {
1105
+ let file = null
1106
+ const rest = []
1107
+ for (let i = 0; i < argv.length; i++) {
1108
+ if (argv[i] === '--file') file = argv[++i] ?? null
1109
+ else if (argv[i].startsWith('--file=')) file = argv[i].slice('--file='.length)
1110
+ else if (argv[i].startsWith('--')) { console.error(`flow escape: unknown option \`${argv[i]}\``); process.exit(1) }
1111
+ else rest.push(argv[i])
1112
+ }
1113
+ const commitArg = rest[0]
1114
+ if (!commitArg) { console.error('flow escape: <commit> is required'); process.exit(1) }
1115
+ const repo = git(['rev-parse', '--show-toplevel']).trim()
1116
+ if (!repo) { console.error('flow escape: not a git checkout'); process.exit(1) }
1117
+ const commit = git(['rev-parse', '--verify', '--quiet', `${commitArg}^{commit}`], repo).trim()
1118
+ if (!commit) { console.error(`flow escape: \`${commitArg}\` is not a commit in this checkout`); process.exit(1) }
1119
+ const branch = git(['rev-parse', '--abbrev-ref', 'HEAD'], repo).trim()
1120
+ const here = workFolder(repo, branch)
1121
+ if (!here) { console.error(`flow escape: no work on \`${branch}\` to record the escape in`); process.exit(1) }
1122
+
1123
+ const cfg = flowConfig(repo, null, null)
1124
+ // The MR/PR a squash commit came from, and nothing else: GitHub appends `(#N)` to the end of
1125
+ // the subject, GitLab writes `See merge request <path>!N` in the body. A `(#7)` quoted
1126
+ // mid-subject — a revert, a cherry-pick — names another MR/PR and charges nobody.
1127
+ const subject = git(['log', '-1', '--format=%s', commit], repo).trim()
1128
+ const body = git(['log', '-1', '--format=%b', commit], repo)
1129
+ // A GitLab reference carries its project path, and an MR of another project with the same
1130
+ // number is not this one: the unit's url has to name that path too.
1131
+ const refs = [
1132
+ ...(subject.match(/\(#(\d+)\)\s*$/) ? [{ n: subject.match(/\(#(\d+)\)\s*$/)[1], path: null }] : []),
1133
+ ...[...body.matchAll(/See merge request (\S*)!(\d+)/g)].map((m) => ({ n: m[2], path: m[1] || null })),
1134
+ ]
1135
+ // `(#N)` is a GitHub pull request; on GitLab `#N` is an issue, and only `!N` is an MR.
1136
+ const namedBy = (url) => {
1137
+ const u = String(url ?? '')
1138
+ const pull = u.match(/\/pull\/(\d+)/)?.[1]
1139
+ const mr = u.match(/\/merge_requests\/(\d+)/)?.[1]
1140
+ return refs.some((r) => (r.path === null && r.n === pull)
1141
+ || (r.path !== null && r.n === mr && u.includes(`/${r.path}/-/merge_requests/${mr}`)))
1142
+ }
1143
+ const isAncestor = (a, b) => {
1144
+ try { execFileSync('git', ['merge-base', '--is-ancestor', a, b], { cwd: repo, stdio: 'ignore' }); return true } catch { return false }
1145
+ }
1146
+ const resolves = (ref) => Boolean(ref) && Boolean(git(['rev-parse', '--verify', '--quiet', `${ref}^{commit}`], repo).trim())
1147
+
1148
+ // Where the reviewed branch left the base. Once merged, the base contains the reviewed sha
1149
+ // and their merge-base is that sha itself, so the fork is read off the merge that brought it
1150
+ // in: the side it was merged into, at that point. A fast-forward leaves no merge to read,
1151
+ // and then there is no range — the MR/PR number is the only evidence left.
1152
+ // The reviewed branch's own commits: what `reviewed` reaches and the far side of every merge
1153
+ // that carried it across does not — the base's tip when it is not merged yet, otherwise the
1154
+ // first parent of each merge whose second side holds it (into the base, or into another
1155
+ // branch on the way). A commit the base already had, brought in by a back-merge, sits behind
1156
+ // one of those first parents and is never the branch's; a branch cut from another branch
1157
+ // owns only its own commits. A fast-forward leaves no merge, and then there is no range.
1158
+ // Two `rev-list` calls per unit, the rest in process: an archive of hundreds of works must
1159
+ // not cost a process per merge per work.
1160
+ const ranges = new Map()
1161
+ const rangeOf = (base, reviewed) => {
1162
+ const key = `${base} ${reviewed}`
1163
+ if (ranges.has(key)) return ranges.get(key)
1164
+ let set = null
1165
+ if (resolves(base)) {
1166
+ let stops = []
1167
+ if (!isAncestor(reviewed, base)) stops = [base]
1168
+ else {
1169
+ const lines = git(['rev-list', '--ancestry-path', '--parents', `${reviewed}..${base}`], repo).trim().split('\n').filter(Boolean)
1170
+ const after = new Set(lines.map((l) => l.split(' ')[0]))
1171
+ const holds = (c) => c === reviewed || after.has(c)
1172
+ stops = lines.map((l) => l.split(' ')).filter((p) => p.length > 2 && !holds(p[1]) && p.slice(2).some(holds)).map((p) => p[1])
1173
+ }
1174
+ if (stops.length) set = new Set(git(['rev-list', reviewed, ...stops.map((x) => `^${x}`)], repo).trim().split('\n').filter(Boolean))
1175
+ }
1176
+ ranges.set(key, set)
1177
+ return set
1178
+ }
1179
+
1180
+ const matches = []
1181
+ const hereReal = realpathSync(here)
1182
+ for (const { path, meta } of worksOf(repo, new Set())) {
1183
+ if (realpathSync(path) === hereReal) continue
1184
+ const units = Array.isArray(meta.mrs) && meta.mrs.length ? meta.mrs : [meta]
1185
+ for (const u of units) {
1186
+ const reviewed = u?.reviewed_sha
1187
+ let how = null
1188
+ if (resolves(reviewed) && isAncestor(commit, reviewed)) {
1189
+ const own = rangeOf(meta.base || cfg.git?.default_base || 'origin/main', git(['rev-parse', reviewed], repo).trim())
1190
+ if (own?.has(commit)) how = `one of the ${own.size} commit(s) its review read, up to ${reviewed.slice(0, 7)}`
1191
+ }
1192
+ if (!how && reviewed && namedBy(u?.url)) how = `the commit names its MR/PR, ${String(u.url).split('/').pop()}`
1193
+ if (how) matches.push({ path, meta, unit: u, how })
1194
+ }
1195
+ }
1196
+
1197
+ const works = [...new Set(matches.map((m) => m.path))]
1198
+ if (works.length !== 1) {
1199
+ // A blame that changed takes the old escape with it: counted, it would charge a review for
1200
+ // a commit the investigation no longer names.
1201
+ // Kept only for the same commit matching nothing at all: its evidence did not resolve this
1202
+ // time (a ref not fetched, a branch gone). Another commit, or now two candidate works, and
1203
+ // the old blame no longer stands.
1204
+ let dropped = false, kept = false
1205
+ editMeta(here, (meta) => {
1206
+ if (!meta.escape) return
1207
+ if (meta.escape.commit === commit && !works.length) kept = true
1208
+ else { dropped = true; delete meta.escape }
1209
+ })
1210
+ if (dropped) console.log('The escape recorded earlier for this bug was removed: the evidence below no longer names one review.')
1211
+ if (kept) console.log('The escape recorded earlier for this same commit is kept: its evidence did not resolve this time.')
1212
+ console.log(works.length
1213
+ ? `No escape recorded: ${commit.slice(0, 7)} matches ${works.length} reviewed works (${works.map((w) => w.split('/').pop()).join(', ')}), and a guess is not evidence.`
1214
+ : `No escape recorded: ${commit.slice(0, 7)} is not inside any reviewed range or reviewed MR/PR of this repo's works.`)
1215
+ return
1216
+ }
1217
+ const m = matches[0]
1218
+ const escape = {
1219
+ work: m.path.split('/').pop(), ticket: m.meta.ticket ?? null, commit,
1220
+ file: file ?? null, size: m.unit.size ?? m.meta.size ?? null,
1221
+ }
1222
+ if (!editMeta(here, (meta) => { meta.escape = escape })) {
1223
+ console.error(`flow escape: \`${join(here, 'meta.json')}\` is missing or not JSON — nothing recorded`); process.exit(1)
1224
+ }
1225
+ console.log(`Escape recorded: ${commit.slice(0, 7)} went through the review of ${escape.work} (${m.how}).`)
1226
+ }
1227
+
1097
1228
  // --- cost ------------------------------------------------------------------------------
1098
1229
  // `review` reports `<n>/<budget_max> subagents launched`, which is a headcount: two runs
1099
1230
  // with the same count differ by an order of magnitude depending on the turns each agent
@@ -1350,6 +1481,7 @@ function yieldOf(argv) {
1350
1481
  const spellings = new Map()
1351
1482
  let rounds = 0, rows = 0, works = 0
1352
1483
  const seen = new Set()
1484
+ const escapes = new Map()
1353
1485
  const cell = (bucket, origin) => {
1354
1486
  if (!table.has(bucket)) table.set(bucket, new Map())
1355
1487
  const t = table.get(bucket)
@@ -1367,6 +1499,11 @@ function yieldOf(argv) {
1367
1499
 
1368
1500
  for (const repo of repos) {
1369
1501
  for (const { path, meta } of worksOf(repo, seen)) {
1502
+ if (meta.escape?.work) {
1503
+ const b = sizeBucket(meta.escape.size)
1504
+ if (!escapes.has(b)) escapes.set(b, [])
1505
+ escapes.get(b).push(meta.escape.work)
1506
+ }
1370
1507
  const found = Array.isArray(meta.review_findings) ? meta.review_findings : []
1371
1508
  const costs = (Array.isArray(meta.cost) ? meta.cost : []).filter((e) => e?.phase === 'review' && e.round != null)
1372
1509
  if (!found.length && !costs.length) continue
@@ -1441,20 +1578,23 @@ function yieldOf(argv) {
1441
1578
 
1442
1579
  console.log(`# Review yield — ${repos.join(' · ')}`)
1443
1580
  console.log()
1444
- if (!table.size) {
1581
+ if (!table.size && !escapes.size) {
1445
1582
  console.log('No review rounds recorded in the works these checkouts hold')
1446
1583
  console.log(`(${repos.map((r) => join(r, '.claude', 'work')).join(', ')}, archive included).`)
1447
1584
  return
1448
1585
  }
1449
1586
  console.log(`${works} work(s), ${rounds} review round(s), ${rows} finding row(s).`)
1450
1587
  for (const bucket of ['XS+S', 'M', 'L', 'unknown size']) {
1451
- const t = table.get(bucket)
1452
- if (!t) continue
1588
+ const t = table.get(bucket) ?? new Map()
1589
+ const esc = escapes.get(bucket) ?? []
1590
+ if (!t.size && !esc.length) continue
1453
1591
  console.log()
1454
1592
  console.log(`## ${bucket}`)
1455
- console.log()
1456
- console.log('| origin | rounds | findings | unique | unique accepted | agents | verdict |')
1457
- console.log('|---|---|---|---|---|---|---|')
1593
+ if (t.size) {
1594
+ console.log()
1595
+ console.log('| origin | rounds | findings | unique | unique accepted | agents | verdict |')
1596
+ console.log('|---|---|---|---|---|---|---|')
1597
+ }
1458
1598
  const sorted = [...t.entries()].sort((a, b) => b[1].accepted - a[1].accepted || b[1].findings - a[1].findings)
1459
1599
  for (const [origin, c] of sorted) {
1460
1600
  const n = c.rounds.size
@@ -1462,6 +1602,8 @@ function yieldOf(argv) {
1462
1602
  : c.accepted === 0 ? `retire at ${bucket}` : 'keep'
1463
1603
  console.log(`| ${origin} | ${n} | ${c.findings} | ${c.unique} | ${c.accepted} | ${c.agents ?? '—'} | ${verdict} |`)
1464
1604
  }
1605
+ console.log()
1606
+ console.log(`escapes: ${esc.length}${esc.length ? ` (${[...new Set(esc)].sort().join(', ')})` : ''}`)
1465
1607
  }
1466
1608
  console.log()
1467
1609
  console.log('"unique accepted" decides: a finding only this origin raised and that was acted on.')
@@ -1491,6 +1633,7 @@ function usage() {
1491
1633
  npx flow-workflows cost
1492
1634
  npx flow-workflows record-review --file <rows.json>
1493
1635
  npx flow-workflows yield [<repo-path>…]
1636
+ npx flow-workflows escape <commit> [--file <path>]
1494
1637
 
1495
1638
  Harnesses: ${Object.keys(HARNESSES).join(' · ')}
1496
1639
  "project" installs into the current repo instead of your user folder.
@@ -1546,6 +1689,11 @@ Claude Code, Codex CLI and zcode have their own marketplaces:
1546
1689
  severities and outcomes come from closed lists; one value outside them and nothing is
1547
1690
  written, and the error names the values that are valid.
1548
1691
 
1692
+ "escape" tells whether the commit a bug investigation blamed went through a flow review:
1693
+ it must sit inside exactly one work's reviewed range (merge history), or carry the number
1694
+ of exactly one reviewed MR/PR in its subject (squash). Then it is recorded in this branch's
1695
+ work and "yield" counts it; anything less is said and recorded nowhere.
1696
+
1549
1697
  "yield" reads every work of the repos named (default: this one) — live and archived,
1550
1698
  here and in the main checkout — and prints, per reviewer or pass and per size, the
1551
1699
  rounds it ran, the findings it raised, how many only it raised, how many of those were
@@ -1564,6 +1712,7 @@ else if (cmd === 'tier') tier(process.argv.slice(3))
1564
1712
  else if (cmd === 'cost') cost(process.argv.slice(3))
1565
1713
  else if (cmd === 'yield') yieldOf(process.argv.slice(3))
1566
1714
  else if (cmd === 'record-review') recordReview(process.argv.slice(3))
1715
+ else if (cmd === 'escape') escapeOf(process.argv.slice(3))
1567
1716
  else if (cmd === 'review') review(process.argv.slice(3)).catch((e) => { console.error(`flow review: ${e.message}`); process.exit(1) })
1568
1717
  else if (cmd === 'check') check()
1569
1718
  else if (cmd === 'install' && tool === 'claude') claude()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flow-workflows",
3
- "version": "0.109.0",
3
+ "version": "0.110.0",
4
4
  "description": "Guided feat/bug workflows (start→ship), post-deploy monitoring and multi-agent code review, stack-agnostic. Each repo uses a shared FLOW.md plus optional harness overlay.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -3,7 +3,7 @@
3
3
  "name": "flow",
4
4
  "displayName": "Flow — guided dev workflows",
5
5
  "description": "Guided feat/bug workflows (start→ship), post-deploy monitoring and multi-agent code review, stack-agnostic. Each repo uses a shared FLOW.md plus optional harness overlay.",
6
- "version": "0.109.0",
6
+ "version": "0.110.0",
7
7
  "author": {
8
8
  "name": "Alberto Vioque",
9
9
  "email": "mashware@gmail.com"
@@ -5,6 +5,22 @@ plugin and is what `/flow:news` reads to show you what changed since your previo
5
5
 
6
6
  The canonical, richest notes live in the [GitHub Releases](https://github.com/mashware/flow-workflows/releases).
7
7
 
8
+ ## v0.110.0 — A bug that a flow review read is counted against that review · 2026-11-04
9
+
10
+ **In short**
11
+ - **`bug:investigate` now asks whether a flow review read the commit it blames.**
12
+ `npx flow-workflows escape <commit>` looks for the one reviewed work the commit belongs to and records it in the
13
+ bug's work.
14
+ - **Only on evidence.** On a repo that merges, the commit must sit between where the reviewed branch left its base
15
+ and what was reviewed. On a repo that squashes, its subject must carry the number of the reviewed MR/PR. Older
16
+ history, or a commit two works could claim, is said and recorded nowhere.
17
+ - **`flow yield` prints `escapes: <n>` under each size**, with the works they came from. This shows what reviews at
18
+ that size have already let through, next to what each pass found there.
19
+ - **The escape is counted per size, not per pass**, because every pass missed it.
20
+
21
+ The retirement rule weighed what a pass found against what it cost. It could not say what trimming the review would
22
+ let through. This is that count, and it closes #234.
23
+
8
24
  ## v0.109.0 — A review round records each finding once, and refuses names it does not know · 2026-11-04
9
25
 
10
26
  **In short**