flow-workflows 0.109.0 → 0.111.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/adapters/codex/CORE.md +59 -3
  2. package/adapters/codex/skills/flow-bug-investigate/SKILL.md +2 -1
  3. package/adapters/codex/skills/flow-bug-ship/SKILL.md +1 -1
  4. package/adapters/codex/skills/flow-doctor/SKILL.md +1 -0
  5. package/adapters/codex/skills/flow-feat-ship/SKILL.md +1 -1
  6. package/adapters/codex/skills/flow-work-README/SKILL.md +3 -0
  7. package/adapters/codex/skills/flow-work-abandon/SKILL.md +1 -1
  8. package/adapters/codex/skills/flow-work-clean/SKILL.md +1 -1
  9. package/adapters/gemini/CORE.md +59 -3
  10. package/adapters/gemini/commands/flow/bug/investigate.toml +2 -1
  11. package/adapters/gemini/commands/flow/bug/ship.toml +1 -1
  12. package/adapters/gemini/commands/flow/doctor.toml +1 -0
  13. package/adapters/gemini/commands/flow/feat/ship.toml +1 -1
  14. package/adapters/gemini/commands/flow/work/README.toml +3 -0
  15. package/adapters/gemini/commands/flow/work/abandon.toml +1 -1
  16. package/adapters/gemini/commands/flow/work/clean.toml +1 -1
  17. package/adapters/hermes/CORE.md +59 -3
  18. package/adapters/hermes/skills/flow-bug-investigate/SKILL.md +2 -1
  19. package/adapters/hermes/skills/flow-bug-ship/SKILL.md +1 -1
  20. package/adapters/hermes/skills/flow-doctor/SKILL.md +1 -0
  21. package/adapters/hermes/skills/flow-feat-ship/SKILL.md +1 -1
  22. package/adapters/hermes/skills/flow-work-README/SKILL.md +3 -0
  23. package/adapters/hermes/skills/flow-work-abandon/SKILL.md +1 -1
  24. package/adapters/hermes/skills/flow-work-clean/SKILL.md +1 -1
  25. package/adapters/opencode/CORE.md +59 -3
  26. package/adapters/opencode/commands/flow-bug-investigate.md +2 -1
  27. package/adapters/opencode/commands/flow-bug-ship.md +1 -1
  28. package/adapters/opencode/commands/flow-doctor.md +1 -0
  29. package/adapters/opencode/commands/flow-feat-ship.md +1 -1
  30. package/adapters/opencode/commands/flow-work-README.md +3 -0
  31. package/adapters/opencode/commands/flow-work-abandon.md +1 -1
  32. package/adapters/opencode/commands/flow-work-clean.md +1 -1
  33. package/bin/cli.mjs +155 -6
  34. package/package.json +1 -1
  35. package/plugins/flow/.claude-plugin/plugin.json +1 -1
  36. package/plugins/flow/CHANGELOG.md +39 -0
  37. package/plugins/flow/examples/FLOW.template.md +9 -0
@@ -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.111.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
@@ -117,7 +117,7 @@ a command relies on is simply absent in that session, and nothing else will repo
117
117
  prints that file with it — "`agents: opus` (`FLOW.claude.md`)", never the value alone. `doctor` reports it and later
118
118
  edits preserve it.
119
119
  - The sections in any of the files are tracker, git, autonomy, quality, agents, models, data,
120
- conventions, notes, knowledge, and observability. No layer found, or an effective empty key
120
+ conventions, notes, knowledge, observability, roadmap, and panel. No layer found, or an effective empty key
121
121
  → the default or auto-discovery each step names. Never stop because a file or key is empty.
122
122
  - **An empty key that is a real decision for this repo is offered where it first matters**, and
123
123
  nowhere else. Three steps, in order:
@@ -674,7 +674,9 @@ right now. **Any progress line you were about to type into the chat is a panel u
674
674
  available, this console is a pane of agent-terminal: publish the panel through them (§4.2) and
675
675
  **stop writing `.claude/work/<work>/panel.json`** — while a pane is claimed, its file is not read at
676
676
  all. When they are not there, write the file (§4.3). No work folder (lightweight
677
- `respond`/`green`) → nothing to publish, either way.
677
+ `respond`/`green`) → nothing to publish, either way. With `panel.artifact` set, each publication is
678
+ also mirrored to a claude.ai page that gathers every work of every repo (§4.6) — in addition to the
679
+ transport, never instead of it.
678
680
 
679
681
  **Look for them before you conclude they are missing**, once per session, in pre-flight. A harness
680
682
  namespaces an MCP server's tools, so what you are looking for is a tool whose name *ends* in
@@ -803,6 +805,60 @@ that reports no figure is recorded with `"source": "not reported"` rather than e
803
805
  phase with no entry measured nothing — **absence is not zero**. Every figure is the harness's own
804
806
  client-side estimate and can differ from a bill.
805
807
 
808
+ ### 4.6 The artifact mirror — one page for every work, opt-in
809
+
810
+ Someone running flow in several consoles, across several repos, has one panel per pane and no view
811
+ of them together. `panel.artifact` in the FLOW config — the URL of a claude.ai artifact published
812
+ from `examples/panel-artifact.html` — turns on a mirror: each work writes its own card to that
813
+ page's shared database, and the page shows every card, grouped by repo. Empty or absent → this
814
+ section does not exist: no artifact tool is loaded or called.
815
+
816
+ - **Only where the tool is.** The writes go through the tool whose name ends in `ArtifactData` —
817
+ interactive Claude Code, and possibly **deferred** (load it, as §4 says of the panel tools).
818
+ Absent → the mirror is off, in silence: no line, no error. A headless run (`claude -p`, an
819
+ `unattended` container) has no such tool, and other harnesses never read `FLOW.claude.md`, where
820
+ the key belongs.
821
+ - **When**: right after the transport publishes, at §4.4 (a) to (e) — a phase's own publications
822
+ (`ship` the moment an MR/PR URL exists, `plan`, `resume`, `watch`, `abandon`) are among them. At
823
+ (f), a plan step, only when the card's last write is 10 minutes old or more: every write is a
824
+ tool call, and outside auto mode a prompt, while a card left alone for 30 minutes reads as a dead
825
+ session on the page.
826
+ - **What**: what the terminal now shows, never a document rebuilt in your head. On the file
827
+ transport, the §4.1 document just written. Over the tools, what `panel_get` returns right after a
828
+ publication that applied — a refused patch changed nothing on screen and writes nothing here.
829
+ Then set, whichever transport:
830
+ - `updated_at` — the real clock (`date -Iseconds`); over the tools the app stamps arrival itself,
831
+ so the document carries none of its own.
832
+ - `attention` — as §4.2 defines it, on the file transport too: `wait` while a `Decision` is
833
+ parked on the user, `block` while stuck on somebody else, absent while simply working — and
834
+ `done` only once the work is over: `meta.json.phase` set to `done`, or `abandon` (whose terminal
835
+ panel clears `attention` and carries a `block` line; the card says `done`). An open MR/PR
836
+ waiting to merge is not over. The page reads the state from this field alone.
837
+ - `repo` (the repo id below), `work` (the work folder's name), `ticket`, `type`, `branch`, and
838
+ `harness` (`Claude Code`), from `meta.json` and git.
839
+ - **Where**: action `set` — the whole document, so a line dropped from the panel leaves the card —
840
+ `url` the key's value, collection `works`, doc id `<repo id>--<work folder>`. The repo id is the
841
+ path of `git remote get-url origin` — everything after the host, which ends at the first `/` after
842
+ `//` (`https://host/owner/repo.git`, `ssh://git@host:22/owner/repo.git`) or at the first `:`
843
+ (`git@host:owner/repo.git`) — with `.git` dropped and every `/` turned into `.`: `owner.repo`,
844
+ `group.subgroup.repo`. No remote → the main checkout's directory name (§0). Any character outside
845
+ `[A-Za-z0-9_.~:@+-]` becomes `-`.
846
+ - **Version**: a write to a card that exists needs `if_version`, the version the last write
847
+ returned. Keep it in the session — one writer per card, so it is right until the session loses
848
+ it. None held → one `get` first: the card exists → pin to its version; it does not → write
849
+ unpinned. A write refused for its version — stale, or missing on a card that exists — is not a
850
+ failure: one retry pinned to the version the refusal names, or to the one a single `get` returns.
851
+ Then remember what the write returned.
852
+ - **A card ends with its work folder.** Whatever moves a work folder to `_archive/` — `abandon`,
853
+ `clean`, the archive offer at `ship`'s Close — first deletes that work's card: action `delete`,
854
+ pinned to the version held, or to the one a single `get` returns; no card → nothing to do. The
855
+ mirror off or the key empty → nothing to do. A folder moved back out of `_archive/` gets its card
856
+ again at its next publication.
857
+ - **Failure never stops a phase.** A second version refusal → no more retries for that
858
+ publication. Any other failure — a wrong URL, auth, a permission prompt the user declined — turns
859
+ the mirror off for the rest of the session. Either way the next stop carries one line,
860
+ `artifact panel: <error>`, once.
861
+
806
862
  ## 5. Work summary — `00-summary.md`
807
863
 
808
864
  Each phase reads what the previous ones wrote. Reading every artifact whole on every phase is the
@@ -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).
@@ -213,5 +213,5 @@ posted as comments anchored on the changed lines of the MR/PR, confirmed in ever
213
213
  - **Conventions learned — `$flow-feat-ship` §6.4bis, in full and unchanged.** Read `meta.json.conventions_candidates[]` (flow-core §8); nothing pending → skip silently. Otherwise: drop what `FLOW.md` already says, then one batched `AskUserQuestion` (**Add to FLOW.md** / **Not a rule** / **Later**, or **Replace** when it contradicts a line that is there). Asked in every mode — it edits a file in the tree. A fix is where the corrections land hardest: *«never mock the repository in that layer»*, *«the regression test goes next to the unit test, not in the functional suite»* — said once inside `bug:fix`, and proposed again in the next incident unless they reach the file.
214
214
  - **Close the follow-up that started this work.** `meta.json.origin` set and this ship moved `phase` to `done` → open the originating work's `meta.json` (live folder or `_archive/`) and set that `followups[]` entry to `status: "done"`. Best-effort: the originating folder is gone or unreadable → warn in one line and continue, never block. Without this the entry stays `in_progress` forever and `status`/`daily` keep reporting work that is finished.
215
215
  - **Only once `phase` is `done`**: delete the candidate anchor `$flow-bug-review §1.5` left behind — `git update-ref -d refs/flow/candidate/<TICKET>`. No question: local, never pushed, and the gate that needed it has run. And clear the branch's staging as `$flow-feat-ship` §6.5 says (`consolidated`/`declined` only).
216
- - Ask whether to archive `.claude/work/<TICKET>/` to `.claude/work/_archive/`.
216
+ - Ask whether to archive `.claude/work/<TICKET>/` to `.claude/work/_archive/`. Archiving deletes the work's card from the artifact control room first, when `panel.artifact` is set (flow-core §4.6).
217
217
  - If `meta.json.worktree` is not null, offer `git worktree remove <worktree>` once the MR/PR is merged (`--force` only if the user confirms discarding remaining changes). Not before merge, not without confirmation.
@@ -226,6 +226,7 @@ refuse) · **degraded** (it runs, quietly worse than the config promises), plus
226
226
  that fits, else `general-purpose` (a skill: skipped) — a panel missing agents reviews less and still reports a clean pass.
227
227
  - Harness cannot set a model per subagent → note that every `models.*` value degrades to inheritance.
228
228
  - **Where the live panel will go this session** (flow-core §4): a tool whose name ends in `panel_set` / `panel_patch` — namespaced by the harness (`mcp__panel__panel_set` on Claude Code) and possibly **deferred**, which reads as absent until the list of deferred tools is checked → the terminal draws the panel and no `panel.json` is written; genuinely absent → the panel is that file, as before. Neither is a fault — one line naming the tools as they are actually called here, or saying the file is the transport.
229
+ - **The artifact mirror** (flow-core §4.6) — only when `panel.artifact` is set: one line with its value and the file it came from; whether a tool whose name ends in `ArtifactData` is here (deferred counts); and, when it is, whether a `list` of collection `works` (limit 1) on that URL answers — a read, never a write. Tool present → also name the rule that keeps every card update from asking — `ArtifactData` (as the harness calls it) under `permissions.allow` — and its cost in the same line: it lets any session write to the data of any of your artifacts without asking, not only this page's; without it, each card update is approved by hand. The value coming from any file but `FLOW.claude.md` → a fault: the URL is one person's page, and a committed `FLOW.md` hands it to every teammate, whose writes it refuses. Key set and no tool → *off in this harness*, not a fault. The read failing → the error, as a fault.
229
230
 
230
231
  ### 2.3 Knowledge sources
231
232
 
@@ -595,7 +595,7 @@ paste. Never a list here, and never a question: in `guided`/`auto` not asking is
595
595
  Only if `phase = "done"`:
596
596
  - Delete the candidate anchor `$flow-feat-review §1.5` left behind: `git update-ref -d refs/flow/candidate/<TICKET>`. It existed to stop the object being collected while the gate still needed it; the gate has run. No question — it is local, it was never pushed, and nothing reads it after this. Absent already → nothing to do.
597
597
  - Clear this branch's staging (flow-core §0 step 7) when `meta.json.knowledge.status` is `consolidated` or `declined` and the store has that notion. No question: what it held is saved, or was refused. `later`/`failed` → leave it; §5 still owes it.
598
- - Ask whether to keep `.claude/work/<TICKET>/` or archive it (move to `.claude/work/_archive/`).
598
+ - Ask whether to keep `.claude/work/<TICKET>/` or archive it (move to `.claude/work/_archive/`). Archiving deletes the work's card from the artifact control room first, when `panel.artifact` is set (flow-core §4.6).
599
599
  - If `meta.json.worktree` is not null, offer to remove the worktree (from the main checkout) with `git worktree remove <worktree>` (`--force` only if it still has changes the user confirms discarding). Never without confirmation, never if the MR/PR is not yet merged.
600
600
 
601
601
  On a **train MR/PR** neither offer fires (`phase` is not `done`; the branch is the base of the next one). When shipping an intermediate MR/PR whose predecessor has since merged, say so in one line and point at `$flow-work-clean`, which sweeps the whole backlog at once. Mention it once per work, not per MR/PR.
@@ -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.
@@ -219,6 +220,8 @@ This system **orchestrates** the project's existing sub-agents and skills (it do
219
220
 
220
221
  **No headings over the train.** A shipped MR/PR is *open, waiting to merge*; `mark` says it per entry — `wait` shipped, `current` being worked, `done` only merged.
221
222
 
223
+ **The artifact mirror** (opt-in, flow-core §4.6). With `panel.artifact` set — in `FLOW.claude.md`, Claude Code only — each publication is also written (a per-step patch only when the card is 10 minutes old), whole, as one card of a claude.ai page that gathers every work of every repo: doc `<owner.repo>--<work folder>` in collection `works`, the document above plus `updated_at`, `attention` (on either transport) and `repo`, `work`, `ticket`, `type`, `branch`, `harness`. The page is `examples/panel-artifact.html`, published once by hand. The transport above is unchanged.
224
+
222
225
  **Who publishes it.** The 18 phase commands (flow-core §4); `$flow-feat-ship` and `$flow-bug-ship` the instant an MR/PR URL exists; `$flow-feat-plan` when the train is populated — a new train is a new shape, so a full republish; `$flow-work-resume` (§5), after reading what is on screen; `$flow-work-watch` every cycle; `$flow-work-abandon` with a terminal state. Read-only `status`, `daily`, `config`, `doctor`, `news` never publish; `$flow-work-clean` archives the folder with any panel file inside.
223
226
 
224
227
  ## Shortcuts by size
@@ -94,7 +94,7 @@ Ask the user what to do with the branch — do not decide alone:
94
94
  - Overwrite `00-summary.md` whole (≤15 lines, flow-core §5).
95
95
  - **Tracker: move to won't-do** (never "done" — this work did not ship). Only if `tracker.tool` is not `none`/empty, `tracker.abandon_cmd` is set, and `meta.json.ticket` is a **real tracker id** (skip for local-only slugs). Run `tracker.abandon_cmd` substituting `{TICKET}` = `meta.json.ticket`. Same contract as `$flow-feat-start §6.5`: **best-effort, idempotent, gated** (ask once in `autonomy.mode: manual`; automatic in `guided`/`auto`); failure or already-in-state ticket → warn and continue, never block. `tracker.abandon_cmd` empty → do nothing (the user closes the ticket by hand if they want).
96
96
  - Panel published for this work (flow-core §4) → publish a terminal state before archiving: the title, one `block` line saying the work was abandoned and why, no `Decision` line, and `attention` cleared where the panel tools carry it — nothing is waiting on anyone any more.
97
- - Move the folder to `.claude/work/_archive/` **keeping its directory name** (`_archive/<work-dir>/`, the folder located in §1 — e.g. `<TICKET>-<slug>`) so `$flow-work-daily` no longer lists it.
97
+ - Delete the work's card from the artifact control room when `panel.artifact` is set (flow-core §4.6, *a card ends with its work folder*), then move the folder to `.claude/work/_archive/` **keeping its directory name** (`_archive/<work-dir>/`, the folder located in §1 — e.g. `<TICKET>-<slug>`) so `$flow-work-daily` no longer lists it.
98
98
  - Report to the user: ticket abandoned, reason, what was done with the branch.
99
99
 
100
100
  ## Recovery
@@ -189,7 +189,7 @@ Execute in this order (a branch cannot be deleted while a worktree holds it):
189
189
 
190
190
  1. **Worktrees** — `git worktree remove <path>`. No `--force`, ever: §5 excluded the dirty ones, so a failure means something changed since the inventory. Stop that row, report it, continue.
191
191
  2. **Branches** — `git branch -d <branch>` first. Git refuses on a squash merge; only then `git branch -D`, and only for rows whose verdict came from **the forge** (§4a) — never a locally inferred one. Name it in the report: `-D (squash-merged, MR #401)`.
192
- 3. **Work folders** — `mv .claude/work/<dir> .claude/work/_archive/<dir>`, keeping the name, as `$flow-work-abandon` §6 does. Never `rm`.
192
+ 3. **Work folders** — `mv .claude/work/<dir> .claude/work/_archive/<dir>`, keeping the name, as `$flow-work-abandon` §6 does. Never `rm`. Before each move, delete that work's card from the artifact control room when `panel.artifact` is set (flow-core §4.6, *a card ends with its work folder*).
193
193
  4. **Prune** — `git worktree prune`.
194
194
 
195
195
  Never touch the remote (no `git push --delete`; deleting merged remote branches is the forge's job).
@@ -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.111.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
@@ -116,7 +116,7 @@ a command relies on is simply absent in that session, and nothing else will repo
116
116
  prints that file with it — "`agents: opus` (`FLOW.claude.md`)", never the value alone. `doctor` reports it and later
117
117
  edits preserve it.
118
118
  - The sections in any of the files are tracker, git, autonomy, quality, agents, models, data,
119
- conventions, notes, knowledge, and observability. No layer found, or an effective empty key
119
+ conventions, notes, knowledge, observability, roadmap, and panel. No layer found, or an effective empty key
120
120
  → the default or auto-discovery each step names. Never stop because a file or key is empty.
121
121
  - **An empty key that is a real decision for this repo is offered where it first matters**, and
122
122
  nowhere else. Three steps, in order:
@@ -673,7 +673,9 @@ right now. **Any progress line you were about to type into the chat is a panel u
673
673
  available, this console is a pane of agent-terminal: publish the panel through them (§4.2) and
674
674
  **stop writing `.claude/work/<work>/panel.json`** — while a pane is claimed, its file is not read at
675
675
  all. When they are not there, write the file (§4.3). No work folder (lightweight
676
- `respond`/`green`) → nothing to publish, either way.
676
+ `respond`/`green`) → nothing to publish, either way. With `panel.artifact` set, each publication is
677
+ also mirrored to a claude.ai page that gathers every work of every repo (§4.6) — in addition to the
678
+ transport, never instead of it.
677
679
 
678
680
  **Look for them before you conclude they are missing**, once per session, in pre-flight. A harness
679
681
  namespaces an MCP server's tools, so what you are looking for is a tool whose name *ends* in
@@ -802,6 +804,60 @@ that reports no figure is recorded with `"source": "not reported"` rather than e
802
804
  phase with no entry measured nothing — **absence is not zero**. Every figure is the harness's own
803
805
  client-side estimate and can differ from a bill.
804
806
 
807
+ ### 4.6 The artifact mirror — one page for every work, opt-in
808
+
809
+ Someone running flow in several consoles, across several repos, has one panel per pane and no view
810
+ of them together. `panel.artifact` in the FLOW config — the URL of a claude.ai artifact published
811
+ from `examples/panel-artifact.html` — turns on a mirror: each work writes its own card to that
812
+ page's shared database, and the page shows every card, grouped by repo. Empty or absent → this
813
+ section does not exist: no artifact tool is loaded or called.
814
+
815
+ - **Only where the tool is.** The writes go through the tool whose name ends in `ArtifactData` —
816
+ interactive Claude Code, and possibly **deferred** (load it, as §4 says of the panel tools).
817
+ Absent → the mirror is off, in silence: no line, no error. A headless run (`claude -p`, an
818
+ `unattended` container) has no such tool, and other harnesses never read `FLOW.claude.md`, where
819
+ the key belongs.
820
+ - **When**: right after the transport publishes, at §4.4 (a) to (e) — a phase's own publications
821
+ (`ship` the moment an MR/PR URL exists, `plan`, `resume`, `watch`, `abandon`) are among them. At
822
+ (f), a plan step, only when the card's last write is 10 minutes old or more: every write is a
823
+ tool call, and outside auto mode a prompt, while a card left alone for 30 minutes reads as a dead
824
+ session on the page.
825
+ - **What**: what the terminal now shows, never a document rebuilt in your head. On the file
826
+ transport, the §4.1 document just written. Over the tools, what `panel_get` returns right after a
827
+ publication that applied — a refused patch changed nothing on screen and writes nothing here.
828
+ Then set, whichever transport:
829
+ - `updated_at` — the real clock (`date -Iseconds`); over the tools the app stamps arrival itself,
830
+ so the document carries none of its own.
831
+ - `attention` — as §4.2 defines it, on the file transport too: `wait` while a `Decision` is
832
+ parked on the user, `block` while stuck on somebody else, absent while simply working — and
833
+ `done` only once the work is over: `meta.json.phase` set to `done`, or `abandon` (whose terminal
834
+ panel clears `attention` and carries a `block` line; the card says `done`). An open MR/PR
835
+ waiting to merge is not over. The page reads the state from this field alone.
836
+ - `repo` (the repo id below), `work` (the work folder's name), `ticket`, `type`, `branch`, and
837
+ `harness` (`Claude Code`), from `meta.json` and git.
838
+ - **Where**: action `set` — the whole document, so a line dropped from the panel leaves the card —
839
+ `url` the key's value, collection `works`, doc id `<repo id>--<work folder>`. The repo id is the
840
+ path of `git remote get-url origin` — everything after the host, which ends at the first `/` after
841
+ `//` (`https://host/owner/repo.git`, `ssh://git@host:22/owner/repo.git`) or at the first `:`
842
+ (`git@host:owner/repo.git`) — with `.git` dropped and every `/` turned into `.`: `owner.repo`,
843
+ `group.subgroup.repo`. No remote → the main checkout's directory name (§0). Any character outside
844
+ `[A-Za-z0-9_.~:@+-]` becomes `-`.
845
+ - **Version**: a write to a card that exists needs `if_version`, the version the last write
846
+ returned. Keep it in the session — one writer per card, so it is right until the session loses
847
+ it. None held → one `get` first: the card exists → pin to its version; it does not → write
848
+ unpinned. A write refused for its version — stale, or missing on a card that exists — is not a
849
+ failure: one retry pinned to the version the refusal names, or to the one a single `get` returns.
850
+ Then remember what the write returned.
851
+ - **A card ends with its work folder.** Whatever moves a work folder to `_archive/` — `abandon`,
852
+ `clean`, the archive offer at `ship`'s Close — first deletes that work's card: action `delete`,
853
+ pinned to the version held, or to the one a single `get` returns; no card → nothing to do. The
854
+ mirror off or the key empty → nothing to do. A folder moved back out of `_archive/` gets its card
855
+ again at its next publication.
856
+ - **Failure never stops a phase.** A second version refusal → no more retries for that
857
+ publication. Any other failure — a wrong URL, auth, a permission prompt the user declined — turns
858
+ the mirror off for the rest of the session. Either way the next stop carries one line,
859
+ `artifact panel: <error>`, once.
860
+
805
861
  ## 5. Work summary — `00-summary.md`
806
862
 
807
863
  Each phase reads what the previous ones wrote. Reading every artifact whole on every phase is the
@@ -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).
@@ -209,6 +209,6 @@ posted as comments anchored on the changed lines of the MR/PR, confirmed in ever
209
209
  - **Conventions learned — `/flow:feat:ship` §6.4bis, in full and unchanged.** Read `meta.json.conventions_candidates[]` (flow-core §8); nothing pending → skip silently. Otherwise: drop what `FLOW.md` already says, then one batched `AskUserQuestion` (**Add to FLOW.md** / **Not a rule** / **Later**, or **Replace** when it contradicts a line that is there). Asked in every mode — it edits a file in the tree. A fix is where the corrections land hardest: *«never mock the repository in that layer»*, *«the regression test goes next to the unit test, not in the functional suite»* — said once inside `bug:fix`, and proposed again in the next incident unless they reach the file.
210
210
  - **Close the follow-up that started this work.** `meta.json.origin` set and this ship moved `phase` to `done` → open the originating work's `meta.json` (live folder or `_archive/`) and set that `followups[]` entry to `status: "done"`. Best-effort: the originating folder is gone or unreadable → warn in one line and continue, never block. Without this the entry stays `in_progress` forever and `status`/`daily` keep reporting work that is finished.
211
211
  - **Only once `phase` is `done`**: delete the candidate anchor `/flow:bug:review §1.5` left behind — `git update-ref -d refs/flow/candidate/<TICKET>`. No question: local, never pushed, and the gate that needed it has run. And clear the branch's staging as `/flow:feat:ship` §6.5 says (`consolidated`/`declined` only).
212
- - Ask whether to archive `.claude/work/<TICKET>/` to `.claude/work/_archive/`.
212
+ - Ask whether to archive `.claude/work/<TICKET>/` to `.claude/work/_archive/`. Archiving deletes the work's card from the artifact control room first, when `panel.artifact` is set (flow-core §4.6).
213
213
  - If `meta.json.worktree` is not null, offer `git worktree remove <worktree>` once the MR/PR is merged (`--force` only if the user confirms discarding remaining changes). Not before merge, not without confirmation.
214
214
  """
@@ -222,6 +222,7 @@ refuse) · **degraded** (it runs, quietly worse than the config promises), plus
222
222
  that fits, else `general-purpose` (a skill: skipped) — a panel missing agents reviews less and still reports a clean pass.
223
223
  - Harness cannot set a model per subagent → note that every `models.*` value degrades to inheritance.
224
224
  - **Where the live panel will go this session** (flow-core §4): a tool whose name ends in `panel_set` / `panel_patch` — namespaced by the harness (`mcp__panel__panel_set` on Claude Code) and possibly **deferred**, which reads as absent until the list of deferred tools is checked → the terminal draws the panel and no `panel.json` is written; genuinely absent → the panel is that file, as before. Neither is a fault — one line naming the tools as they are actually called here, or saying the file is the transport.
225
+ - **The artifact mirror** (flow-core §4.6) — only when `panel.artifact` is set: one line with its value and the file it came from; whether a tool whose name ends in `ArtifactData` is here (deferred counts); and, when it is, whether a `list` of collection `works` (limit 1) on that URL answers — a read, never a write. Tool present → also name the rule that keeps every card update from asking — `ArtifactData` (as the harness calls it) under `permissions.allow` — and its cost in the same line: it lets any session write to the data of any of your artifacts without asking, not only this page's; without it, each card update is approved by hand. The value coming from any file but `FLOW.claude.md` → a fault: the URL is one person's page, and a committed `FLOW.md` hands it to every teammate, whose writes it refuses. Key set and no tool → *off in this harness*, not a fault. The read failing → the error, as a fault.
225
226
 
226
227
  ### 2.3 Knowledge sources
227
228
 
@@ -591,7 +591,7 @@ paste. Never a list here, and never a question: in `guided`/`auto` not asking is
591
591
  Only if `phase = "done"`:
592
592
  - Delete the candidate anchor `/flow:feat:review §1.5` left behind: `git update-ref -d refs/flow/candidate/<TICKET>`. It existed to stop the object being collected while the gate still needed it; the gate has run. No question — it is local, it was never pushed, and nothing reads it after this. Absent already → nothing to do.
593
593
  - Clear this branch's staging (flow-core §0 step 7) when `meta.json.knowledge.status` is `consolidated` or `declined` and the store has that notion. No question: what it held is saved, or was refused. `later`/`failed` → leave it; §5 still owes it.
594
- - Ask whether to keep `.claude/work/<TICKET>/` or archive it (move to `.claude/work/_archive/`).
594
+ - Ask whether to keep `.claude/work/<TICKET>/` or archive it (move to `.claude/work/_archive/`). Archiving deletes the work's card from the artifact control room first, when `panel.artifact` is set (flow-core §4.6).
595
595
  - If `meta.json.worktree` is not null, offer to remove the worktree (from the main checkout) with `git worktree remove <worktree>` (`--force` only if it still has changes the user confirms discarding). Never without confirmation, never if the MR/PR is not yet merged.
596
596
 
597
597
  On a **train MR/PR** neither offer fires (`phase` is not `done`; the branch is the base of the next one). When shipping an intermediate MR/PR whose predecessor has since merged, say so in one line and point at `/flow:work:clean`, which sweeps the whole backlog at once. Mention it once per work, not per MR/PR.
@@ -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.
@@ -215,6 +216,8 @@ This system **orchestrates** the project's existing sub-agents and skills (it do
215
216
 
216
217
  **No headings over the train.** A shipped MR/PR is *open, waiting to merge*; `mark` says it per entry — `wait` shipped, `current` being worked, `done` only merged.
217
218
 
219
+ **The artifact mirror** (opt-in, flow-core §4.6). With `panel.artifact` set — in `FLOW.claude.md`, Claude Code only — each publication is also written (a per-step patch only when the card is 10 minutes old), whole, as one card of a claude.ai page that gathers every work of every repo: doc `<owner.repo>--<work folder>` in collection `works`, the document above plus `updated_at`, `attention` (on either transport) and `repo`, `work`, `ticket`, `type`, `branch`, `harness`. The page is `examples/panel-artifact.html`, published once by hand. The transport above is unchanged.
220
+
218
221
  **Who publishes it.** The 18 phase commands (flow-core §4); `/flow:feat:ship` and `/flow:bug:ship` the instant an MR/PR URL exists; `/flow:feat:plan` when the train is populated — a new train is a new shape, so a full republish; `/flow:work:resume` (§5), after reading what is on screen; `/flow:work:watch` every cycle; `/flow:work:abandon` with a terminal state. Read-only `status`, `daily`, `config`, `doctor`, `news` never publish; `/flow:work:clean` archives the folder with any panel file inside.
219
222
 
220
223
  ## Shortcuts by size
@@ -90,7 +90,7 @@ Ask the user what to do with the branch — do not decide alone:
90
90
  - Overwrite `00-summary.md` whole (≤15 lines, flow-core §5).
91
91
  - **Tracker: move to won't-do** (never "done" — this work did not ship). Only if `tracker.tool` is not `none`/empty, `tracker.abandon_cmd` is set, and `meta.json.ticket` is a **real tracker id** (skip for local-only slugs). Run `tracker.abandon_cmd` substituting `{TICKET}` = `meta.json.ticket`. Same contract as `/flow:feat:start §6.5`: **best-effort, idempotent, gated** (ask once in `autonomy.mode: manual`; automatic in `guided`/`auto`); failure or already-in-state ticket → warn and continue, never block. `tracker.abandon_cmd` empty → do nothing (the user closes the ticket by hand if they want).
92
92
  - Panel published for this work (flow-core §4) → publish a terminal state before archiving: the title, one `block` line saying the work was abandoned and why, no `Decision` line, and `attention` cleared where the panel tools carry it — nothing is waiting on anyone any more.
93
- - Move the folder to `.claude/work/_archive/` **keeping its directory name** (`_archive/<work-dir>/`, the folder located in §1 — e.g. `<TICKET>-<slug>`) so `/flow:work:daily` no longer lists it.
93
+ - Delete the work's card from the artifact control room when `panel.artifact` is set (flow-core §4.6, *a card ends with its work folder*), then move the folder to `.claude/work/_archive/` **keeping its directory name** (`_archive/<work-dir>/`, the folder located in §1 — e.g. `<TICKET>-<slug>`) so `/flow:work:daily` no longer lists it.
94
94
  - Report to the user: ticket abandoned, reason, what was done with the branch.
95
95
 
96
96
  ## Recovery
@@ -185,7 +185,7 @@ Execute in this order (a branch cannot be deleted while a worktree holds it):
185
185
 
186
186
  1. **Worktrees** — `git worktree remove <path>`. No `--force`, ever: §5 excluded the dirty ones, so a failure means something changed since the inventory. Stop that row, report it, continue.
187
187
  2. **Branches** — `git branch -d <branch>` first. Git refuses on a squash merge; only then `git branch -D`, and only for rows whose verdict came from **the forge** (§4a) — never a locally inferred one. Name it in the report: `-D (squash-merged, MR #401)`.
188
- 3. **Work folders** — `mv .claude/work/<dir> .claude/work/_archive/<dir>`, keeping the name, as `/flow:work:abandon` §6 does. Never `rm`.
188
+ 3. **Work folders** — `mv .claude/work/<dir> .claude/work/_archive/<dir>`, keeping the name, as `/flow:work:abandon` §6 does. Never `rm`. Before each move, delete that work's card from the artifact control room when `panel.artifact` is set (flow-core §4.6, *a card ends with its work folder*).
189
189
  4. **Prune** — `git worktree prune`.
190
190
 
191
191
  Never touch the remote (no `git push --delete`; deleting merged remote branches is the forge's job).
@@ -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.111.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
@@ -117,7 +117,7 @@ a command relies on is simply absent in that session, and nothing else will repo
117
117
  prints that file with it — "`agents: opus` (`FLOW.claude.md`)", never the value alone. `doctor` reports it and later
118
118
  edits preserve it.
119
119
  - The sections in any of the files are tracker, git, autonomy, quality, agents, models, data,
120
- conventions, notes, knowledge, and observability. No layer found, or an effective empty key
120
+ conventions, notes, knowledge, observability, roadmap, and panel. No layer found, or an effective empty key
121
121
  → the default or auto-discovery each step names. Never stop because a file or key is empty.
122
122
  - **An empty key that is a real decision for this repo is offered where it first matters**, and
123
123
  nowhere else. Three steps, in order:
@@ -674,7 +674,9 @@ right now. **Any progress line you were about to type into the chat is a panel u
674
674
  available, this console is a pane of agent-terminal: publish the panel through them (§4.2) and
675
675
  **stop writing `.claude/work/<work>/panel.json`** — while a pane is claimed, its file is not read at
676
676
  all. When they are not there, write the file (§4.3). No work folder (lightweight
677
- `respond`/`green`) → nothing to publish, either way.
677
+ `respond`/`green`) → nothing to publish, either way. With `panel.artifact` set, each publication is
678
+ also mirrored to a claude.ai page that gathers every work of every repo (§4.6) — in addition to the
679
+ transport, never instead of it.
678
680
 
679
681
  **Look for them before you conclude they are missing**, once per session, in pre-flight. A harness
680
682
  namespaces an MCP server's tools, so what you are looking for is a tool whose name *ends* in
@@ -803,6 +805,60 @@ that reports no figure is recorded with `"source": "not reported"` rather than e
803
805
  phase with no entry measured nothing — **absence is not zero**. Every figure is the harness's own
804
806
  client-side estimate and can differ from a bill.
805
807
 
808
+ ### 4.6 The artifact mirror — one page for every work, opt-in
809
+
810
+ Someone running flow in several consoles, across several repos, has one panel per pane and no view
811
+ of them together. `panel.artifact` in the FLOW config — the URL of a claude.ai artifact published
812
+ from `examples/panel-artifact.html` — turns on a mirror: each work writes its own card to that
813
+ page's shared database, and the page shows every card, grouped by repo. Empty or absent → this
814
+ section does not exist: no artifact tool is loaded or called.
815
+
816
+ - **Only where the tool is.** The writes go through the tool whose name ends in `ArtifactData` —
817
+ interactive Claude Code, and possibly **deferred** (load it, as §4 says of the panel tools).
818
+ Absent → the mirror is off, in silence: no line, no error. A headless run (`claude -p`, an
819
+ `unattended` container) has no such tool, and other harnesses never read `FLOW.claude.md`, where
820
+ the key belongs.
821
+ - **When**: right after the transport publishes, at §4.4 (a) to (e) — a phase's own publications
822
+ (`ship` the moment an MR/PR URL exists, `plan`, `resume`, `watch`, `abandon`) are among them. At
823
+ (f), a plan step, only when the card's last write is 10 minutes old or more: every write is a
824
+ tool call, and outside auto mode a prompt, while a card left alone for 30 minutes reads as a dead
825
+ session on the page.
826
+ - **What**: what the terminal now shows, never a document rebuilt in your head. On the file
827
+ transport, the §4.1 document just written. Over the tools, what `panel_get` returns right after a
828
+ publication that applied — a refused patch changed nothing on screen and writes nothing here.
829
+ Then set, whichever transport:
830
+ - `updated_at` — the real clock (`date -Iseconds`); over the tools the app stamps arrival itself,
831
+ so the document carries none of its own.
832
+ - `attention` — as §4.2 defines it, on the file transport too: `wait` while a `Decision` is
833
+ parked on the user, `block` while stuck on somebody else, absent while simply working — and
834
+ `done` only once the work is over: `meta.json.phase` set to `done`, or `abandon` (whose terminal
835
+ panel clears `attention` and carries a `block` line; the card says `done`). An open MR/PR
836
+ waiting to merge is not over. The page reads the state from this field alone.
837
+ - `repo` (the repo id below), `work` (the work folder's name), `ticket`, `type`, `branch`, and
838
+ `harness` (`Claude Code`), from `meta.json` and git.
839
+ - **Where**: action `set` — the whole document, so a line dropped from the panel leaves the card —
840
+ `url` the key's value, collection `works`, doc id `<repo id>--<work folder>`. The repo id is the
841
+ path of `git remote get-url origin` — everything after the host, which ends at the first `/` after
842
+ `//` (`https://host/owner/repo.git`, `ssh://git@host:22/owner/repo.git`) or at the first `:`
843
+ (`git@host:owner/repo.git`) — with `.git` dropped and every `/` turned into `.`: `owner.repo`,
844
+ `group.subgroup.repo`. No remote → the main checkout's directory name (§0). Any character outside
845
+ `[A-Za-z0-9_.~:@+-]` becomes `-`.
846
+ - **Version**: a write to a card that exists needs `if_version`, the version the last write
847
+ returned. Keep it in the session — one writer per card, so it is right until the session loses
848
+ it. None held → one `get` first: the card exists → pin to its version; it does not → write
849
+ unpinned. A write refused for its version — stale, or missing on a card that exists — is not a
850
+ failure: one retry pinned to the version the refusal names, or to the one a single `get` returns.
851
+ Then remember what the write returned.
852
+ - **A card ends with its work folder.** Whatever moves a work folder to `_archive/` — `abandon`,
853
+ `clean`, the archive offer at `ship`'s Close — first deletes that work's card: action `delete`,
854
+ pinned to the version held, or to the one a single `get` returns; no card → nothing to do. The
855
+ mirror off or the key empty → nothing to do. A folder moved back out of `_archive/` gets its card
856
+ again at its next publication.
857
+ - **Failure never stops a phase.** A second version refusal → no more retries for that
858
+ publication. Any other failure — a wrong URL, auth, a permission prompt the user declined — turns
859
+ the mirror off for the rest of the session. Either way the next stop carries one line,
860
+ `artifact panel: <error>`, once.
861
+
806
862
  ## 5. Work summary — `00-summary.md`
807
863
 
808
864
  Each phase reads what the previous ones wrote. Reading every artifact whole on every phase is the
@@ -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).
@@ -213,5 +213,5 @@ posted as comments anchored on the changed lines of the MR/PR, confirmed in ever
213
213
  - **Conventions learned — `/flow-feat-ship` §6.4bis, in full and unchanged.** Read `meta.json.conventions_candidates[]` (flow-core §8); nothing pending → skip silently. Otherwise: drop what `FLOW.md` already says, then one batched `AskUserQuestion` (**Add to FLOW.md** / **Not a rule** / **Later**, or **Replace** when it contradicts a line that is there). Asked in every mode — it edits a file in the tree. A fix is where the corrections land hardest: *«never mock the repository in that layer»*, *«the regression test goes next to the unit test, not in the functional suite»* — said once inside `bug:fix`, and proposed again in the next incident unless they reach the file.
214
214
  - **Close the follow-up that started this work.** `meta.json.origin` set and this ship moved `phase` to `done` → open the originating work's `meta.json` (live folder or `_archive/`) and set that `followups[]` entry to `status: "done"`. Best-effort: the originating folder is gone or unreadable → warn in one line and continue, never block. Without this the entry stays `in_progress` forever and `status`/`daily` keep reporting work that is finished.
215
215
  - **Only once `phase` is `done`**: delete the candidate anchor `/flow-bug-review §1.5` left behind — `git update-ref -d refs/flow/candidate/<TICKET>`. No question: local, never pushed, and the gate that needed it has run. And clear the branch's staging as `/flow-feat-ship` §6.5 says (`consolidated`/`declined` only).
216
- - Ask whether to archive `.claude/work/<TICKET>/` to `.claude/work/_archive/`.
216
+ - Ask whether to archive `.claude/work/<TICKET>/` to `.claude/work/_archive/`. Archiving deletes the work's card from the artifact control room first, when `panel.artifact` is set (flow-core §4.6).
217
217
  - If `meta.json.worktree` is not null, offer `git worktree remove <worktree>` once the MR/PR is merged (`--force` only if the user confirms discarding remaining changes). Not before merge, not without confirmation.
@@ -226,6 +226,7 @@ refuse) · **degraded** (it runs, quietly worse than the config promises), plus
226
226
  that fits, else `general-purpose` (a skill: skipped) — a panel missing agents reviews less and still reports a clean pass.
227
227
  - Harness cannot set a model per subagent → note that every `models.*` value degrades to inheritance.
228
228
  - **Where the live panel will go this session** (flow-core §4): a tool whose name ends in `panel_set` / `panel_patch` — namespaced by the harness (`mcp__panel__panel_set` on Claude Code) and possibly **deferred**, which reads as absent until the list of deferred tools is checked → the terminal draws the panel and no `panel.json` is written; genuinely absent → the panel is that file, as before. Neither is a fault — one line naming the tools as they are actually called here, or saying the file is the transport.
229
+ - **The artifact mirror** (flow-core §4.6) — only when `panel.artifact` is set: one line with its value and the file it came from; whether a tool whose name ends in `ArtifactData` is here (deferred counts); and, when it is, whether a `list` of collection `works` (limit 1) on that URL answers — a read, never a write. Tool present → also name the rule that keeps every card update from asking — `ArtifactData` (as the harness calls it) under `permissions.allow` — and its cost in the same line: it lets any session write to the data of any of your artifacts without asking, not only this page's; without it, each card update is approved by hand. The value coming from any file but `FLOW.claude.md` → a fault: the URL is one person's page, and a committed `FLOW.md` hands it to every teammate, whose writes it refuses. Key set and no tool → *off in this harness*, not a fault. The read failing → the error, as a fault.
229
230
 
230
231
  ### 2.3 Knowledge sources
231
232
 
@@ -595,7 +595,7 @@ paste. Never a list here, and never a question: in `guided`/`auto` not asking is
595
595
  Only if `phase = "done"`:
596
596
  - Delete the candidate anchor `/flow-feat-review §1.5` left behind: `git update-ref -d refs/flow/candidate/<TICKET>`. It existed to stop the object being collected while the gate still needed it; the gate has run. No question — it is local, it was never pushed, and nothing reads it after this. Absent already → nothing to do.
597
597
  - Clear this branch's staging (flow-core §0 step 7) when `meta.json.knowledge.status` is `consolidated` or `declined` and the store has that notion. No question: what it held is saved, or was refused. `later`/`failed` → leave it; §5 still owes it.
598
- - Ask whether to keep `.claude/work/<TICKET>/` or archive it (move to `.claude/work/_archive/`).
598
+ - Ask whether to keep `.claude/work/<TICKET>/` or archive it (move to `.claude/work/_archive/`). Archiving deletes the work's card from the artifact control room first, when `panel.artifact` is set (flow-core §4.6).
599
599
  - If `meta.json.worktree` is not null, offer to remove the worktree (from the main checkout) with `git worktree remove <worktree>` (`--force` only if it still has changes the user confirms discarding). Never without confirmation, never if the MR/PR is not yet merged.
600
600
 
601
601
  On a **train MR/PR** neither offer fires (`phase` is not `done`; the branch is the base of the next one). When shipping an intermediate MR/PR whose predecessor has since merged, say so in one line and point at `/flow-work-clean`, which sweeps the whole backlog at once. Mention it once per work, not per MR/PR.
@@ -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.
@@ -219,6 +220,8 @@ This system **orchestrates** the project's existing sub-agents and skills (it do
219
220
 
220
221
  **No headings over the train.** A shipped MR/PR is *open, waiting to merge*; `mark` says it per entry — `wait` shipped, `current` being worked, `done` only merged.
221
222
 
223
+ **The artifact mirror** (opt-in, flow-core §4.6). With `panel.artifact` set — in `FLOW.claude.md`, Claude Code only — each publication is also written (a per-step patch only when the card is 10 minutes old), whole, as one card of a claude.ai page that gathers every work of every repo: doc `<owner.repo>--<work folder>` in collection `works`, the document above plus `updated_at`, `attention` (on either transport) and `repo`, `work`, `ticket`, `type`, `branch`, `harness`. The page is `examples/panel-artifact.html`, published once by hand. The transport above is unchanged.
224
+
222
225
  **Who publishes it.** The 18 phase commands (flow-core §4); `/flow-feat-ship` and `/flow-bug-ship` the instant an MR/PR URL exists; `/flow-feat-plan` when the train is populated — a new train is a new shape, so a full republish; `/flow-work-resume` (§5), after reading what is on screen; `/flow-work-watch` every cycle; `/flow-work-abandon` with a terminal state. Read-only `status`, `daily`, `config`, `doctor`, `news` never publish; `/flow-work-clean` archives the folder with any panel file inside.
223
226
 
224
227
  ## Shortcuts by size
@@ -94,7 +94,7 @@ Ask the user what to do with the branch — do not decide alone:
94
94
  - Overwrite `00-summary.md` whole (≤15 lines, flow-core §5).
95
95
  - **Tracker: move to won't-do** (never "done" — this work did not ship). Only if `tracker.tool` is not `none`/empty, `tracker.abandon_cmd` is set, and `meta.json.ticket` is a **real tracker id** (skip for local-only slugs). Run `tracker.abandon_cmd` substituting `{TICKET}` = `meta.json.ticket`. Same contract as `/flow-feat-start §6.5`: **best-effort, idempotent, gated** (ask once in `autonomy.mode: manual`; automatic in `guided`/`auto`); failure or already-in-state ticket → warn and continue, never block. `tracker.abandon_cmd` empty → do nothing (the user closes the ticket by hand if they want).
96
96
  - Panel published for this work (flow-core §4) → publish a terminal state before archiving: the title, one `block` line saying the work was abandoned and why, no `Decision` line, and `attention` cleared where the panel tools carry it — nothing is waiting on anyone any more.
97
- - Move the folder to `.claude/work/_archive/` **keeping its directory name** (`_archive/<work-dir>/`, the folder located in §1 — e.g. `<TICKET>-<slug>`) so `/flow-work-daily` no longer lists it.
97
+ - Delete the work's card from the artifact control room when `panel.artifact` is set (flow-core §4.6, *a card ends with its work folder*), then move the folder to `.claude/work/_archive/` **keeping its directory name** (`_archive/<work-dir>/`, the folder located in §1 — e.g. `<TICKET>-<slug>`) so `/flow-work-daily` no longer lists it.
98
98
  - Report to the user: ticket abandoned, reason, what was done with the branch.
99
99
 
100
100
  ## Recovery
@@ -189,7 +189,7 @@ Execute in this order (a branch cannot be deleted while a worktree holds it):
189
189
 
190
190
  1. **Worktrees** — `git worktree remove <path>`. No `--force`, ever: §5 excluded the dirty ones, so a failure means something changed since the inventory. Stop that row, report it, continue.
191
191
  2. **Branches** — `git branch -d <branch>` first. Git refuses on a squash merge; only then `git branch -D`, and only for rows whose verdict came from **the forge** (§4a) — never a locally inferred one. Name it in the report: `-D (squash-merged, MR #401)`.
192
- 3. **Work folders** — `mv .claude/work/<dir> .claude/work/_archive/<dir>`, keeping the name, as `/flow-work-abandon` §6 does. Never `rm`.
192
+ 3. **Work folders** — `mv .claude/work/<dir> .claude/work/_archive/<dir>`, keeping the name, as `/flow-work-abandon` §6 does. Never `rm`. Before each move, delete that work's card from the artifact control room when `panel.artifact` is set (flow-core §4.6, *a card ends with its work folder*).
193
193
  4. **Prune** — `git worktree prune`.
194
194
 
195
195
  Never touch the remote (no `git push --delete`; deleting merged remote branches is the forge's job).
@@ -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.111.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
@@ -116,7 +116,7 @@ a command relies on is simply absent in that session, and nothing else will repo
116
116
  prints that file with it — "`agents: opus` (`FLOW.claude.md`)", never the value alone. `doctor` reports it and later
117
117
  edits preserve it.
118
118
  - The sections in any of the files are tracker, git, autonomy, quality, agents, models, data,
119
- conventions, notes, knowledge, and observability. No layer found, or an effective empty key
119
+ conventions, notes, knowledge, observability, roadmap, and panel. No layer found, or an effective empty key
120
120
  → the default or auto-discovery each step names. Never stop because a file or key is empty.
121
121
  - **An empty key that is a real decision for this repo is offered where it first matters**, and
122
122
  nowhere else. Three steps, in order:
@@ -673,7 +673,9 @@ right now. **Any progress line you were about to type into the chat is a panel u
673
673
  available, this console is a pane of agent-terminal: publish the panel through them (§4.2) and
674
674
  **stop writing `.claude/work/<work>/panel.json`** — while a pane is claimed, its file is not read at
675
675
  all. When they are not there, write the file (§4.3). No work folder (lightweight
676
- `respond`/`green`) → nothing to publish, either way.
676
+ `respond`/`green`) → nothing to publish, either way. With `panel.artifact` set, each publication is
677
+ also mirrored to a claude.ai page that gathers every work of every repo (§4.6) — in addition to the
678
+ transport, never instead of it.
677
679
 
678
680
  **Look for them before you conclude they are missing**, once per session, in pre-flight. A harness
679
681
  namespaces an MCP server's tools, so what you are looking for is a tool whose name *ends* in
@@ -802,6 +804,60 @@ that reports no figure is recorded with `"source": "not reported"` rather than e
802
804
  phase with no entry measured nothing — **absence is not zero**. Every figure is the harness's own
803
805
  client-side estimate and can differ from a bill.
804
806
 
807
+ ### 4.6 The artifact mirror — one page for every work, opt-in
808
+
809
+ Someone running flow in several consoles, across several repos, has one panel per pane and no view
810
+ of them together. `panel.artifact` in the FLOW config — the URL of a claude.ai artifact published
811
+ from `examples/panel-artifact.html` — turns on a mirror: each work writes its own card to that
812
+ page's shared database, and the page shows every card, grouped by repo. Empty or absent → this
813
+ section does not exist: no artifact tool is loaded or called.
814
+
815
+ - **Only where the tool is.** The writes go through the tool whose name ends in `ArtifactData` —
816
+ interactive Claude Code, and possibly **deferred** (load it, as §4 says of the panel tools).
817
+ Absent → the mirror is off, in silence: no line, no error. A headless run (`claude -p`, an
818
+ `unattended` container) has no such tool, and other harnesses never read `FLOW.claude.md`, where
819
+ the key belongs.
820
+ - **When**: right after the transport publishes, at §4.4 (a) to (e) — a phase's own publications
821
+ (`ship` the moment an MR/PR URL exists, `plan`, `resume`, `watch`, `abandon`) are among them. At
822
+ (f), a plan step, only when the card's last write is 10 minutes old or more: every write is a
823
+ tool call, and outside auto mode a prompt, while a card left alone for 30 minutes reads as a dead
824
+ session on the page.
825
+ - **What**: what the terminal now shows, never a document rebuilt in your head. On the file
826
+ transport, the §4.1 document just written. Over the tools, what `panel_get` returns right after a
827
+ publication that applied — a refused patch changed nothing on screen and writes nothing here.
828
+ Then set, whichever transport:
829
+ - `updated_at` — the real clock (`date -Iseconds`); over the tools the app stamps arrival itself,
830
+ so the document carries none of its own.
831
+ - `attention` — as §4.2 defines it, on the file transport too: `wait` while a `Decision` is
832
+ parked on the user, `block` while stuck on somebody else, absent while simply working — and
833
+ `done` only once the work is over: `meta.json.phase` set to `done`, or `abandon` (whose terminal
834
+ panel clears `attention` and carries a `block` line; the card says `done`). An open MR/PR
835
+ waiting to merge is not over. The page reads the state from this field alone.
836
+ - `repo` (the repo id below), `work` (the work folder's name), `ticket`, `type`, `branch`, and
837
+ `harness` (`Claude Code`), from `meta.json` and git.
838
+ - **Where**: action `set` — the whole document, so a line dropped from the panel leaves the card —
839
+ `url` the key's value, collection `works`, doc id `<repo id>--<work folder>`. The repo id is the
840
+ path of `git remote get-url origin` — everything after the host, which ends at the first `/` after
841
+ `//` (`https://host/owner/repo.git`, `ssh://git@host:22/owner/repo.git`) or at the first `:`
842
+ (`git@host:owner/repo.git`) — with `.git` dropped and every `/` turned into `.`: `owner.repo`,
843
+ `group.subgroup.repo`. No remote → the main checkout's directory name (§0). Any character outside
844
+ `[A-Za-z0-9_.~:@+-]` becomes `-`.
845
+ - **Version**: a write to a card that exists needs `if_version`, the version the last write
846
+ returned. Keep it in the session — one writer per card, so it is right until the session loses
847
+ it. None held → one `get` first: the card exists → pin to its version; it does not → write
848
+ unpinned. A write refused for its version — stale, or missing on a card that exists — is not a
849
+ failure: one retry pinned to the version the refusal names, or to the one a single `get` returns.
850
+ Then remember what the write returned.
851
+ - **A card ends with its work folder.** Whatever moves a work folder to `_archive/` — `abandon`,
852
+ `clean`, the archive offer at `ship`'s Close — first deletes that work's card: action `delete`,
853
+ pinned to the version held, or to the one a single `get` returns; no card → nothing to do. The
854
+ mirror off or the key empty → nothing to do. A folder moved back out of `_archive/` gets its card
855
+ again at its next publication.
856
+ - **Failure never stops a phase.** A second version refusal → no more retries for that
857
+ publication. Any other failure — a wrong URL, auth, a permission prompt the user declined — turns
858
+ the mirror off for the rest of the session. Either way the next stop carries one line,
859
+ `artifact panel: <error>`, once.
860
+
805
861
  ## 5. Work summary — `00-summary.md`
806
862
 
807
863
  Each phase reads what the previous ones wrote. Reading every artifact whole on every phase is the
@@ -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).
@@ -211,5 +211,5 @@ posted as comments anchored on the changed lines of the MR/PR, confirmed in ever
211
211
  - **Conventions learned — `/flow-feat-ship` §6.4bis, in full and unchanged.** Read `meta.json.conventions_candidates[]` (flow-core §8); nothing pending → skip silently. Otherwise: drop what `FLOW.md` already says, then one batched `AskUserQuestion` (**Add to FLOW.md** / **Not a rule** / **Later**, or **Replace** when it contradicts a line that is there). Asked in every mode — it edits a file in the tree. A fix is where the corrections land hardest: *«never mock the repository in that layer»*, *«the regression test goes next to the unit test, not in the functional suite»* — said once inside `bug:fix`, and proposed again in the next incident unless they reach the file.
212
212
  - **Close the follow-up that started this work.** `meta.json.origin` set and this ship moved `phase` to `done` → open the originating work's `meta.json` (live folder or `_archive/`) and set that `followups[]` entry to `status: "done"`. Best-effort: the originating folder is gone or unreadable → warn in one line and continue, never block. Without this the entry stays `in_progress` forever and `status`/`daily` keep reporting work that is finished.
213
213
  - **Only once `phase` is `done`**: delete the candidate anchor `/flow-bug-review §1.5` left behind — `git update-ref -d refs/flow/candidate/<TICKET>`. No question: local, never pushed, and the gate that needed it has run. And clear the branch's staging as `/flow-feat-ship` §6.5 says (`consolidated`/`declined` only).
214
- - Ask whether to archive `.claude/work/<TICKET>/` to `.claude/work/_archive/`.
214
+ - Ask whether to archive `.claude/work/<TICKET>/` to `.claude/work/_archive/`. Archiving deletes the work's card from the artifact control room first, when `panel.artifact` is set (flow-core §4.6).
215
215
  - If `meta.json.worktree` is not null, offer `git worktree remove <worktree>` once the MR/PR is merged (`--force` only if the user confirms discarding remaining changes). Not before merge, not without confirmation.
@@ -224,6 +224,7 @@ refuse) · **degraded** (it runs, quietly worse than the config promises), plus
224
224
  that fits, else `general-purpose` (a skill: skipped) — a panel missing agents reviews less and still reports a clean pass.
225
225
  - Harness cannot set a model per subagent → note that every `models.*` value degrades to inheritance.
226
226
  - **Where the live panel will go this session** (flow-core §4): a tool whose name ends in `panel_set` / `panel_patch` — namespaced by the harness (`mcp__panel__panel_set` on Claude Code) and possibly **deferred**, which reads as absent until the list of deferred tools is checked → the terminal draws the panel and no `panel.json` is written; genuinely absent → the panel is that file, as before. Neither is a fault — one line naming the tools as they are actually called here, or saying the file is the transport.
227
+ - **The artifact mirror** (flow-core §4.6) — only when `panel.artifact` is set: one line with its value and the file it came from; whether a tool whose name ends in `ArtifactData` is here (deferred counts); and, when it is, whether a `list` of collection `works` (limit 1) on that URL answers — a read, never a write. Tool present → also name the rule that keeps every card update from asking — `ArtifactData` (as the harness calls it) under `permissions.allow` — and its cost in the same line: it lets any session write to the data of any of your artifacts without asking, not only this page's; without it, each card update is approved by hand. The value coming from any file but `FLOW.claude.md` → a fault: the URL is one person's page, and a committed `FLOW.md` hands it to every teammate, whose writes it refuses. Key set and no tool → *off in this harness*, not a fault. The read failing → the error, as a fault.
227
228
 
228
229
  ### 2.3 Knowledge sources
229
230
 
@@ -593,7 +593,7 @@ paste. Never a list here, and never a question: in `guided`/`auto` not asking is
593
593
  Only if `phase = "done"`:
594
594
  - Delete the candidate anchor `/flow-feat-review §1.5` left behind: `git update-ref -d refs/flow/candidate/<TICKET>`. It existed to stop the object being collected while the gate still needed it; the gate has run. No question — it is local, it was never pushed, and nothing reads it after this. Absent already → nothing to do.
595
595
  - Clear this branch's staging (flow-core §0 step 7) when `meta.json.knowledge.status` is `consolidated` or `declined` and the store has that notion. No question: what it held is saved, or was refused. `later`/`failed` → leave it; §5 still owes it.
596
- - Ask whether to keep `.claude/work/<TICKET>/` or archive it (move to `.claude/work/_archive/`).
596
+ - Ask whether to keep `.claude/work/<TICKET>/` or archive it (move to `.claude/work/_archive/`). Archiving deletes the work's card from the artifact control room first, when `panel.artifact` is set (flow-core §4.6).
597
597
  - If `meta.json.worktree` is not null, offer to remove the worktree (from the main checkout) with `git worktree remove <worktree>` (`--force` only if it still has changes the user confirms discarding). Never without confirmation, never if the MR/PR is not yet merged.
598
598
 
599
599
  On a **train MR/PR** neither offer fires (`phase` is not `done`; the branch is the base of the next one). When shipping an intermediate MR/PR whose predecessor has since merged, say so in one line and point at `/flow-work-clean`, which sweeps the whole backlog at once. Mention it once per work, not per MR/PR.
@@ -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.
@@ -217,6 +218,8 @@ This system **orchestrates** the project's existing sub-agents and skills (it do
217
218
 
218
219
  **No headings over the train.** A shipped MR/PR is *open, waiting to merge*; `mark` says it per entry — `wait` shipped, `current` being worked, `done` only merged.
219
220
 
221
+ **The artifact mirror** (opt-in, flow-core §4.6). With `panel.artifact` set — in `FLOW.claude.md`, Claude Code only — each publication is also written (a per-step patch only when the card is 10 minutes old), whole, as one card of a claude.ai page that gathers every work of every repo: doc `<owner.repo>--<work folder>` in collection `works`, the document above plus `updated_at`, `attention` (on either transport) and `repo`, `work`, `ticket`, `type`, `branch`, `harness`. The page is `examples/panel-artifact.html`, published once by hand. The transport above is unchanged.
222
+
220
223
  **Who publishes it.** The 18 phase commands (flow-core §4); `/flow-feat-ship` and `/flow-bug-ship` the instant an MR/PR URL exists; `/flow-feat-plan` when the train is populated — a new train is a new shape, so a full republish; `/flow-work-resume` (§5), after reading what is on screen; `/flow-work-watch` every cycle; `/flow-work-abandon` with a terminal state. Read-only `status`, `daily`, `config`, `doctor`, `news` never publish; `/flow-work-clean` archives the folder with any panel file inside.
221
224
 
222
225
  ## Shortcuts by size
@@ -92,7 +92,7 @@ Ask the user what to do with the branch — do not decide alone:
92
92
  - Overwrite `00-summary.md` whole (≤15 lines, flow-core §5).
93
93
  - **Tracker: move to won't-do** (never "done" — this work did not ship). Only if `tracker.tool` is not `none`/empty, `tracker.abandon_cmd` is set, and `meta.json.ticket` is a **real tracker id** (skip for local-only slugs). Run `tracker.abandon_cmd` substituting `{TICKET}` = `meta.json.ticket`. Same contract as `/flow-feat-start §6.5`: **best-effort, idempotent, gated** (ask once in `autonomy.mode: manual`; automatic in `guided`/`auto`); failure or already-in-state ticket → warn and continue, never block. `tracker.abandon_cmd` empty → do nothing (the user closes the ticket by hand if they want).
94
94
  - Panel published for this work (flow-core §4) → publish a terminal state before archiving: the title, one `block` line saying the work was abandoned and why, no `Decision` line, and `attention` cleared where the panel tools carry it — nothing is waiting on anyone any more.
95
- - Move the folder to `.claude/work/_archive/` **keeping its directory name** (`_archive/<work-dir>/`, the folder located in §1 — e.g. `<TICKET>-<slug>`) so `/flow-work-daily` no longer lists it.
95
+ - Delete the work's card from the artifact control room when `panel.artifact` is set (flow-core §4.6, *a card ends with its work folder*), then move the folder to `.claude/work/_archive/` **keeping its directory name** (`_archive/<work-dir>/`, the folder located in §1 — e.g. `<TICKET>-<slug>`) so `/flow-work-daily` no longer lists it.
96
96
  - Report to the user: ticket abandoned, reason, what was done with the branch.
97
97
 
98
98
  ## Recovery
@@ -187,7 +187,7 @@ Execute in this order (a branch cannot be deleted while a worktree holds it):
187
187
 
188
188
  1. **Worktrees** — `git worktree remove <path>`. No `--force`, ever: §5 excluded the dirty ones, so a failure means something changed since the inventory. Stop that row, report it, continue.
189
189
  2. **Branches** — `git branch -d <branch>` first. Git refuses on a squash merge; only then `git branch -D`, and only for rows whose verdict came from **the forge** (§4a) — never a locally inferred one. Name it in the report: `-D (squash-merged, MR #401)`.
190
- 3. **Work folders** — `mv .claude/work/<dir> .claude/work/_archive/<dir>`, keeping the name, as `/flow-work-abandon` §6 does. Never `rm`.
190
+ 3. **Work folders** — `mv .claude/work/<dir> .claude/work/_archive/<dir>`, keeping the name, as `/flow-work-abandon` §6 does. Never `rm`. Before each move, delete that work's card from the artifact control room when `panel.artifact` is set (flow-core §4.6, *a card ends with its work folder*).
191
191
  4. **Prune** — `git worktree prune`.
192
192
 
193
193
  Never touch the remote (no `git push --delete`; deleting merged remote branches is the forge's job).
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.111.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.111.0",
7
7
  "author": {
8
8
  "name": "Alberto Vioque",
9
9
  "email": "mashware@gmail.com"
@@ -5,6 +5,45 @@ 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.111.0 — Every work of every repo on one page · 2026-11-04
9
+
10
+ **In short**
11
+ - **One page for all your consoles.** With `panel.artifact` set, each work also writes its live panel to its own
12
+ card on a claude.ai artifact. The page shows every work of every repo, grouped by repo, and you can open it from
13
+ any device.
14
+ - **Each card shows what the terminal shows**: the MR/PR train, what runs now, what comes next, and whether the
15
+ work waits on you. It is a copy of what is on screen, never a version rebuilt from memory.
16
+ - **Off unless you turn it on.** The key belongs in `FLOW.claude.md`, because only an interactive Claude Code
17
+ session has the artifact tools. Left empty, flow calls no artifact tool and nothing changes. Headless runs and
18
+ other harnesses keep the terminal panel only.
19
+ - **It never stops a phase.** A card whose version moved on gets one retry. Any other failure (a wrong URL, a
20
+ declined permission) turns the mirror off for the rest of the session, with one line at the next stop.
21
+ - **`doctor` checks it**: where the key came from, whether the tool is there, whether the page answers, and the
22
+ permission rule that keeps every card update from asking.
23
+ - **Finished work leaves the page.** Archiving a work (`abandon`, `clean`, `ship`'s archive offer) deletes its
24
+ card, and done cards older than a day fold into one line per repo.
25
+ - **The page ships with the plugin** as `examples/panel-artifact.html`. You publish it once and paste its URL into
26
+ each repo.
27
+
28
+ Until now each panel lived in its own pane. Someone with several consoles across several repos had no single place
29
+ to see which work was running and which one was waiting on them (#237).
30
+
31
+ ## v0.110.0 — A bug that a flow review read is counted against that review · 2026-11-04
32
+
33
+ **In short**
34
+ - **`bug:investigate` now asks whether a flow review read the commit it blames.**
35
+ `npx flow-workflows escape <commit>` looks for the one reviewed work the commit belongs to and records it in the
36
+ bug's work.
37
+ - **Only on evidence.** On a repo that merges, the commit must sit between where the reviewed branch left its base
38
+ and what was reviewed. On a repo that squashes, its subject must carry the number of the reviewed MR/PR. Older
39
+ history, or a commit two works could claim, is said and recorded nowhere.
40
+ - **`flow yield` prints `escapes: <n>` under each size**, with the works they came from. This shows what reviews at
41
+ that size have already let through, next to what each pass found there.
42
+ - **The escape is counted per size, not per pass**, because every pass missed it.
43
+
44
+ The retirement rule weighed what a pass found against what it cost. It could not say what trimming the review would
45
+ let through. This is that count, and it closes #234.
46
+
8
47
  ## v0.109.0 — A review round records each finding once, and refuses names it does not know · 2026-11-04
9
48
 
10
49
  **In short**
@@ -357,6 +357,15 @@ already delivered but the file does not say; `feat:start` links a work to one of
357
357
  - `mark:` # `ship` (default) = mark in progress on the work's first MR/PR, done on its last | `never` = read-only, flow only reads it.
358
358
  - `columns:` # only when a table's header is ambiguous: `state=<header>, ticket=<header>, depends=<header>`. Empty = read off the header.
359
359
 
360
+ ## panel
361
+ One page for every work you have running, across repos and consoles (flow-core §4.6): each work
362
+ mirrors its live panel to its own card on a claude.ai artifact, grouped by repo. Claude Code only —
363
+ put the key in `FLOW.claude.md`, which is personal and read by no other harness. Publish
364
+ `examples/panel-artifact.html` once (ask Claude Code to publish it as an artifact with the
365
+ capabilities its header names), then paste the same URL into each repo you want on the page.
366
+
367
+ - `artifact:` # the artifact's URL, `https://claude.ai/artifact/<id>`. Empty = no mirror, no artifact tool called. Each card update is a tool call that asks permission unless `ArtifactData` is allowed — `doctor` prints the rule.
368
+
360
369
  ## notes
361
370
  Per-command extra guidance. When a command runs, it MUST follow the entry matching its command
362
371
  plus the `all` entry, as **mandatory additional instructions for that step**, on top of the