flow-workflows 0.100.0 → 0.102.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/adapters/codex/CORE.md +25 -6
- package/adapters/codex/skills/flow-bug-review/SKILL.md +1 -0
- package/adapters/codex/skills/flow-bug-ship/SKILL.md +3 -3
- package/adapters/codex/skills/flow-feat-review/SKILL.md +4 -2
- package/adapters/codex/skills/flow-feat-ship/SKILL.md +18 -10
- package/adapters/gemini/CORE.md +25 -6
- package/adapters/gemini/commands/flow/bug/review.toml +1 -0
- package/adapters/gemini/commands/flow/bug/ship.toml +3 -3
- package/adapters/gemini/commands/flow/feat/review.toml +4 -2
- package/adapters/gemini/commands/flow/feat/ship.toml +18 -10
- package/adapters/hermes/CORE.md +25 -6
- package/adapters/hermes/skills/flow-bug-review/SKILL.md +1 -0
- package/adapters/hermes/skills/flow-bug-ship/SKILL.md +3 -3
- package/adapters/hermes/skills/flow-feat-review/SKILL.md +4 -2
- package/adapters/hermes/skills/flow-feat-ship/SKILL.md +18 -10
- package/adapters/opencode/CORE.md +25 -6
- package/adapters/opencode/commands/flow-bug-review.md +1 -0
- package/adapters/opencode/commands/flow-bug-ship.md +3 -3
- package/adapters/opencode/commands/flow-feat-review.md +4 -2
- package/adapters/opencode/commands/flow-feat-ship.md +18 -10
- package/package.json +1 -1
- package/plugins/flow/.claude-plugin/plugin.json +1 -1
- package/plugins/flow/CHANGELOG.md +38 -0
- package/plugins/flow/examples/FLOW.template.md +4 -2
package/adapters/codex/CORE.md
CHANGED
|
@@ -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.
|
|
20
|
+
**This file belongs to flow `0.102.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
|
|
@@ -530,7 +530,10 @@ only in `unattended` (empty or `ask` → every question stops as above). It appl
|
|
|
530
530
|
holds a study a person approved: `done-summary.md` in the work folder (a study run, approved with
|
|
531
531
|
`why = start`) or `meta.json.handoff` true (a study handed off from elsewhere). Then a question
|
|
532
532
|
stop in `build`, `fix`, `review`, `validate` or `ship` is not sent, and the run answers it with its
|
|
533
|
-
own recommended option, in the same turn
|
|
533
|
+
own recommended option, in the same turn. So is one in `design`, `plan` or `investigate` once the
|
|
534
|
+
work has crossed the door to code — `05-implementation.md` or `04-fix.md` exists, as when building
|
|
535
|
+
sent the work back to the study: `--study` sets `handoff` at start, before anyone approved anything,
|
|
536
|
+
so before that door the flag proves nothing.
|
|
534
537
|
|
|
535
538
|
1. Write the question and options files as the stop would, and compute its `id` the same way.
|
|
536
539
|
2. Append one entry to `auto-answers.md` in the work folder — whoever reads it later has not seen
|
|
@@ -544,12 +547,13 @@ own recommended option, in the same turn:
|
|
|
544
547
|
- [ ] <each other option, in its order>
|
|
545
548
|
```
|
|
546
549
|
|
|
547
|
-
`MR/PR <n>` is this MR/PR's `mrs[]` entry, left out for a work with no `mrs
|
|
550
|
+
`MR/PR <n>` is this MR/PR's `mrs[]` entry, left out for a work with no `mrs` — and for a study
|
|
551
|
+
phase run before `plan` wrote them, whose entries go to the first MR/PR the work publishes.
|
|
548
552
|
3. Apply that option as an orchestrator's answer is applied (above): written where the re-entry
|
|
549
553
|
table says, with every effect its row names — *Fix them* writes the plan steps and chains into
|
|
550
554
|
`build` / `fix` — and `{ "key": "unattended:answer:<gate>", "default": "<option>", "id": "<id>",
|
|
551
555
|
"phase": "<phase>", "head": "<head>", "mr": <n>, "source": "recommended" }` in
|
|
552
|
-
`meta.json.defaults_used[]
|
|
556
|
+
`meta.json.defaults_used[]` — `mr` left out when the heading names none — so "Which site takes it" reads it as it reads any answer.
|
|
553
557
|
4. `pending` stays `null`: no `ask`, no end of the run. The phase goes on from that site.
|
|
554
558
|
|
|
555
559
|
Still a question stop, as above:
|
|
@@ -559,8 +563,23 @@ Still a question stop, as above:
|
|
|
559
563
|
- **A third `high_findings` on the same MR/PR** — two `source: "recommended"` answers to that gate
|
|
560
564
|
with this `mr` already in `defaults_used[]`: two rounds of fixes that left high findings behind
|
|
561
565
|
are for a person to judge.
|
|
562
|
-
- **
|
|
563
|
-
|
|
566
|
+
- **An option that reaches another repository** — taken, it adds a `meta.json.related_repos`
|
|
567
|
+
entry, or changes a contract a sibling repo consumes (a `related_repos` consumer in
|
|
568
|
+
`03-design.md` "External contracts") or published (`01-context.md` "Contracts received"). The
|
|
569
|
+
orchestrator owns this checkout only; widening the work past it is a person's call.
|
|
570
|
+
- **An option that writes a schema object `approved-schema.md` does not list** — a table, column,
|
|
571
|
+
index, constraint or data copy, or any of them when the file does not exist. A `migration`
|
|
572
|
+
question in `build`, `fix` or `review` is this case by construction: one that writes only listed
|
|
573
|
+
objects is never asked (§2, a schema approved with the study), and hard gate 3 asks for whatever
|
|
574
|
+
lies beyond the list. Applying a migration (`validate`) and the pre-deploy SQL (`ship`) write no
|
|
575
|
+
new object, and are answered as before.
|
|
576
|
+
- **A bundled option** — *Apply the recommended response to each* of a `design_challenge` or an
|
|
577
|
+
`investigation_challenge` — is judged response by response: one that falls in either case above
|
|
578
|
+
stops the whole question.
|
|
579
|
+
- **The study phases before the door to code** — the first study run, a `--study` work still
|
|
580
|
+
being studied, a study a person's changes rewound — and **`respond`, `green` and `start`**, in
|
|
581
|
+
every case, ask or block as they always do: a review round answers a reviewer, and the ticket's
|
|
582
|
+
owner decides that one.
|
|
564
583
|
|
|
565
584
|
`ship` puts this MR/PR's entries in the body (its "In every mode" paragraph), so the person who
|
|
566
585
|
reads the draft sees each question, its options and the one taken, and asks for a change there.
|
|
@@ -141,6 +141,7 @@ Fix-specific:
|
|
|
141
141
|
- **Every modified query carries its base row** — the same query on `git merge-base HEAD <git.default_base>`, measured in the same sandbox with the same seed (`$flow-work-query` §4). This chain already demanded it for slowness bugs; it now applies to any query the fix changes, because a fix that quietly costs 40 ms is a regression whether or not the ticket mentioned speed.
|
|
142
142
|
- **Bug about slowness or timeouts → the duel is the fix's proof**: the base and after rows are the verdict, or the fix is unproven whatever the tests say.
|
|
143
143
|
- A **trick** added under pressure (a cast to align a collation, a hint, a hand-written column order) — checklist item 11 applies in full: it ships with a comment saying why it is there and what removes it, plus the ticket for the root cause, or it does not ship.
|
|
144
|
+
- **This round's own fixes are diff too** — `$flow-feat-review` §3.6, unchanged: a fix applied after the round that adds or modifies a query (a scope the user widened included) is dueled before §8, and "no queries touched" is written only when neither the candidate nor the fixes touched one.
|
|
144
145
|
- Verdicts map as findings: **change** blocks, **regressed** blocks unless `03-investigation.md` justifies the trade, **schema / follow-up** → proposed ticket **and a `followups[]` entry** (flow-core §7), **unresolved** recorded literally.
|
|
145
146
|
|
|
146
147
|
## 4. Over-engineering audit (fit + YAGNI)
|
|
@@ -48,7 +48,7 @@ Read `~/.claude/flow/CORE.codex.md` first (shared rules: `FLOW.md` step 0, model
|
|
|
48
48
|
- **The review has to be about the tree you are about to push — `$flow-feat-ship` §1, in full and unchanged**, including its four newer cases: `reviewed_sha` is the revision the reviewers *read* (`$flow-bug-review` §1.5 froze it), so `fixed_sha` set alongside an equal sha is a mismatch and not a match; a dirty tree at this end is named and asked about rather than passed over; and a `reviewed_sha` that no longer resolves is reported, then treated as absent. Compare `meta.json.reviewed_sha` and `validated_sha` against `git rev-parse HEAD`:
|
|
49
49
|
- **Equal** (and no `fixed_sha`, over a clean tree) → continue.
|
|
50
50
|
- **Absent** (a work from before the shas were recorded) → say so in one line, continue; absence is not a mismatch.
|
|
51
|
-
- **Different** → read the delta (`git log --oneline <sha>..HEAD`, `git diff --stat <sha>..HEAD`) and judge it by **what it touches**. Only test files (`tests/`, `test/`, `spec/`, `__tests__/`, `*_test.*`, `*Test.*`, `*.test.*`, `*.spec.*`) or this work's folder under `.claude/work/` → append both shas and the file list to `06-review.md`, continue without asking. **Anything else** → stop and ask in **every** `autonomy.mode`, no exceptions (`AskUserQuestion`): *re-review the delta* (`$flow-bug-review`, the recommended default — its §1.5 takes `reviewed_sha` as the base, so the delta is both what it reads and what sets its tier) · *ship as it stands*, recording in `06-review.md` the two shas and that the user accepted them unreviewed.
|
|
51
|
+
- **Different** → read the delta (`git log --oneline <sha>..HEAD`, `git diff --stat <sha>..HEAD`) and judge it by **what it touches**. Only test files (`tests/`, `test/`, `spec/`, `__tests__/`, `*_test.*`, `*Test.*`, `*.test.*`, `*.spec.*`) or this work's folder under `.claude/work/` → append both shas and the file list to `06-review.md`, continue without asking. **Anything else** → stop and ask in **every** `autonomy.mode`, no exceptions (`AskUserQuestion`): *re-review the delta* (`$flow-bug-review`, the recommended default — its §1.5 takes `reviewed_sha` as the base, so the delta is both what it reads and what sets its tier) · *ship as it stands*, recording in `06-review.md` the two shas and that the user accepted them unreviewed. Its own question, never a line of the §2 MR/PR preview; a delta that adds or modifies a query or a schema object names it in the question, as `$flow-feat-ship` §1 says.
|
|
52
52
|
|
|
53
53
|
## 1. Draft title and description (without sending anything yet)
|
|
54
54
|
|
|
@@ -185,8 +185,8 @@ With an "all threads resolved before merge" policy, the MR/PR cannot be merged o
|
|
|
185
185
|
|
|
186
186
|
### 3.3 Performance comment
|
|
187
187
|
|
|
188
|
-
`$flow-feat-ship` §4.3, unchanged: query rows from `06-review.md` —
|
|
189
|
-
measured included, as `not measured (<reason>)` — and benchmark rows from `05-validation.md`,
|
|
188
|
+
`$flow-feat-ship` §4.3, unchanged: query and schema rows from `06-review.md` — added and modified
|
|
189
|
+
queries alike, one that was not measured included, as `not measured (<reason>)` — and benchmark rows from `05-validation.md`,
|
|
190
190
|
posted as comments anchored on the changed lines of the MR/PR, confirmed in every mode. A slowness bug is the case where this comment *is* the proof the fix worked.
|
|
191
191
|
|
|
192
192
|
## 4. Close
|
|
@@ -212,7 +212,9 @@ Judging rules: **no number, no win** (unresolved is recorded unresolved, never s
|
|
|
212
212
|
|
|
213
213
|
**A modified query is judged against its own past, not only against its rivals.** For every query the diff *changes* (as opposed to adds), the duel carries the **base row** — the same query on `git merge-base HEAD <git.default_base>`, measured in the same sandbox with the same seed (`$flow-work-query` §4). Without it the table cannot say whether this diff made things better or worse, which is the one thing a reviewer wants from it.
|
|
214
214
|
|
|
215
|
-
**A
|
|
215
|
+
**A query with no plan behind its verdict — added or modified — is recorded `ok (plan not measured)` — and says what would measure it (`data.explain_cmd`, a data set) — never a bare `ok`.** Ship publishes that row on the MR/PR (`$flow-feat-ship` §4.3); a reviewer who finds a plain "ok" and no number has no way to know nobody looked.
|
|
216
|
+
|
|
217
|
+
**This round's own fixes are diff too.** A fix applied after the round — a blocker's, a suggestion's, or a scope the user widened when a finding asked — that adds or modifies a query or a schema object runs this section on it before §9, on the tree that holds the fix. "No queries touched" is written only when neither the candidate nor the fixes touched one; a query that entered with a fix and was judged by reading it ("indexed unique key, LIMIT 1") is `ok (plan not measured)`, never an `ok`, and ship publishes it as such.
|
|
216
218
|
|
|
217
219
|
Verdicts as findings: **change** = blocker, through §6; **regressed** = blocker unless `03-design.md` justifies the trade, in which case it is stated and published; **schema / follow-up** → proposed ticket in the output **and a `followups[]` entry** (flow-core §7); **unresolved** → recorded literally with the open question (as §3.5). A `change` verdict resting on a measured plan is already confirmed — no §6 skeptic.
|
|
218
220
|
|
|
@@ -336,7 +338,7 @@ Write `.claude/work/<TICKET>/06-review.md`. The `Cost:` line of `## Summary` is
|
|
|
336
338
|
<the phases §2.0b's give-up order dropped because the budget ran out, one line each with what was not looked at, or "none">
|
|
337
339
|
|
|
338
340
|
## Data-access duel
|
|
339
|
-
<one row per query added or modified by the diff, per §3.6; "no queries touched" if none, or "renames only" when the change did not alter filter/order/bound/joins/columns>
|
|
341
|
+
<one row per query added or modified by the diff or by this round's fixes, and per schema change, per §3.6; "no queries touched" if none, or "renames only" when the change did not alter filter/order/bound/joins/columns>
|
|
340
342
|
|
|
341
343
|
| Query (file:line) | New/mod | Bound | Index used / plan | Rows read → returned | vs base | Verdict | Evidence |
|
|
342
344
|
|---|---|---|---|---|---|---|---|
|
|
@@ -72,7 +72,8 @@ where it failed too — and the review findings an orchestrator's answer accepte
|
|
|
72
72
|
(`06-review.md` "Answered (unattended)"), one line each. The §3 preview shows that section like
|
|
73
73
|
any other, and the person reading it is the check the run could not do. Entries of
|
|
74
74
|
`auto-answers.md` for this MR/PR (`MR/PR <n>` in their heading, or all of them for a work with no
|
|
75
|
-
`mrs`)
|
|
75
|
+
`mrs`) — plus, while no `mrs[]` entry is `published` or `merged`, every entry whose heading names none: a study
|
|
76
|
+
phase answered it before `plan` wrote `mrs` — go into the body verbatim under `## Decided without asking` — each question, its options,
|
|
76
77
|
the one taken checked (flow-core §2.1, the recommended answer).
|
|
77
78
|
|
|
78
79
|
## 1. Pre-flight
|
|
@@ -87,7 +88,7 @@ the one taken checked (flow-core §2.1, the recommended answer).
|
|
|
87
88
|
- **Absent** (work started before the shas were recorded) → say so in one line and continue. Absence is not a mismatch.
|
|
88
89
|
- **Different** → read the delta (`git log --oneline <sha>..HEAD`, `git diff --stat <sha>..HEAD`) and judge it by **what it touches**, never by size. When `fixed_sha` is set, say in the same line that part of this delta is the review's own fixes: the user is judging what the reviewers never read, and where it came from is the first thing they need.
|
|
89
90
|
- Only test files (`tests/`, `test/`, `spec/`, `__tests__/`, `*_test.*`, `*Test.*`, `*.test.*`, `*.spec.*`) and this work's own folder under `.claude/work/` → append both shas and the file list to `06-review.md`, continue **without asking** (a test written by `validate` after the review is the normal order).
|
|
90
|
-
- **Anything else** → stop and ask, in **every** `autonomy.mode`, with a single `AskUserQuestion`: *re-review the delta* (`$flow-feat-review`, recommended default — §1.5 resolves `reviewed_sha` as its base, so it reads the delta and nothing else, and resolves the tier on the delta too) · *ship it as it stands*, which first appends to `06-review.md` the two shas, the files, and that the user accepted them unreviewed. Never resolve this one silently.
|
|
91
|
+
- **Anything else** → stop and ask, in **every** `autonomy.mode`, with a single `AskUserQuestion`: *re-review the delta* (`$flow-feat-review`, recommended default — §1.5 resolves `reviewed_sha` as its base, so it reads the delta and nothing else, and resolves the tier on the delta too) · *ship it as it stands*, which first appends to `06-review.md` the two shas, the files, and that the user accepted them unreviewed. Never resolve this one silently, and never fold it into the §3 description preview as a line to accept with the MR/PR: it is a question of its own, asked before §2 drafts anything. **A delta that adds or modifies a query or a schema object** says so in the question, by name: re-reviewing it is what puts it through the data-access duel (`$flow-feat-review` §3.6) and onto the performance comment (§4.3); shipping as it stands leaves that query out of both, and the appended line in `06-review.md` names it as unmeasured.
|
|
91
92
|
- Check for blocking TODO/FIXME added on this branch (`git diff --unified=0 <git.default_base>...HEAD | grep -E '^\+.*(TODO|FIXME)'`). If any, list them and ask whether to continue.
|
|
92
93
|
|
|
93
94
|
## 2. Draft title and description (without sending anything yet)
|
|
@@ -245,20 +246,26 @@ Thread body: the SQL block under "Pre-deploy: run this SQL on the server BEFORE
|
|
|
245
246
|
|
|
246
247
|
With the repo policy "all threads resolved before merge", the MR/PR cannot merge until the SQL is executed and the thread **resolved**. **One single thread even with multiple statements.** Tell the user it is left open on purpose.
|
|
247
248
|
|
|
248
|
-
### 4.3 Performance comment (every
|
|
249
|
+
### 4.3 Performance comment (every query or table the diff touches, measured or not)
|
|
249
250
|
|
|
250
|
-
Post one when `06-review.md` §"Data-access duel" has a row for a
|
|
251
|
-
|
|
252
|
-
|
|
251
|
+
Post one when `06-review.md` §"Data-access duel" has a row for a query the diff **adds or modifies**,
|
|
252
|
+
or for a **schema change** (a table created or altered, an index added or dropped) — **whatever its
|
|
253
|
+
verdict, measured or not** — or `07-validation.md` §3.7 has benchmark rows. Renames and reformats
|
|
254
|
+
only, and nothing benchmarked → post nothing.
|
|
253
255
|
|
|
254
|
-
**
|
|
256
|
+
**An added query has no past, not no plan.** Its comment carries the plan on the branch alone, the
|
|
257
|
+
`base` row reading `new`. A new table carries its DDL with the indexes it was created with, and the
|
|
258
|
+
plan of every query in the diff that reads it — a table nobody queries yet says so in one line. The
|
|
259
|
+
row is anchored to the migration's changed lines, the queries' rows to theirs.
|
|
260
|
+
|
|
261
|
+
**A query that was never measured is the case this comment exists for.** Silence reads as
|
|
255
262
|
"nothing to see"; a reviewer cannot tell a query that was measured and is fine from one that nobody
|
|
256
263
|
looked at. The row says `not measured (<reason>)` and what would settle it (`data.explain_cmd`, a
|
|
257
264
|
data set, the entry point to run), so the reviewer knows what was *not* checked.
|
|
258
265
|
|
|
259
266
|
**Where it goes: on the query, not under the title.** One **inline thread anchored to the changed
|
|
260
267
|
lines of that query in the MR/PR diff** (a resolvable GitLab discussion with a `position`; a GitHub
|
|
261
|
-
review comment on `path` + `line`), one per
|
|
268
|
+
review comment on `path` + `line`), one per query or schema change. The entry-point rows anchor to the entry
|
|
262
269
|
point's changed line the same way. Anchoring fails (the line is not in the diff, the forge refuses
|
|
263
270
|
the position) → a general MR/PR comment that names the file and line, and say so. A general comment
|
|
264
271
|
is the fallback, never the default: a number a reviewer meets on the line they are reading is read;
|
|
@@ -293,8 +300,9 @@ no measurable change, not a percentage.
|
|
|
293
300
|
plan command for it — `EXPLAIN`, never `EXPLAIN ANALYZE` on a write — in a code block, so the
|
|
294
301
|
author can run it on production or a replica and answer in the thread. This is a complement to the
|
|
295
302
|
sandbox measurement, never a substitute: the flow does not touch production.
|
|
296
|
-
- **Memory is the entry point's, not the query's.** A
|
|
297
|
-
that exercises it, through `quality.bench_cmd` on both sides
|
|
303
|
+
- **Memory is the entry point's, not the query's.** A query the diff adds or modifies also gets the
|
|
304
|
+
entry-point row that exercises it, through `quality.bench_cmd` on both sides — the branch alone
|
|
305
|
+
for an added one (`$flow-*-validate` §3.7). No
|
|
298
306
|
`bench_cmd` → the entry-point row says `not measured (no quality.bench_cmd)`; never an estimate.
|
|
299
307
|
- **Verdicts**: `improved` · `no measurable change` · `regressed` · `not measured (<reason>)`.
|
|
300
308
|
- **A `regressed` row is a review blocker** unless `03-design.md` justifies the trade — in which
|
package/adapters/gemini/CORE.md
CHANGED
|
@@ -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.
|
|
19
|
+
**This file belongs to flow `0.102.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
|
|
@@ -529,7 +529,10 @@ only in `unattended` (empty or `ask` → every question stops as above). It appl
|
|
|
529
529
|
holds a study a person approved: `done-summary.md` in the work folder (a study run, approved with
|
|
530
530
|
`why = start`) or `meta.json.handoff` true (a study handed off from elsewhere). Then a question
|
|
531
531
|
stop in `build`, `fix`, `review`, `validate` or `ship` is not sent, and the run answers it with its
|
|
532
|
-
own recommended option, in the same turn
|
|
532
|
+
own recommended option, in the same turn. So is one in `design`, `plan` or `investigate` once the
|
|
533
|
+
work has crossed the door to code — `05-implementation.md` or `04-fix.md` exists, as when building
|
|
534
|
+
sent the work back to the study: `--study` sets `handoff` at start, before anyone approved anything,
|
|
535
|
+
so before that door the flag proves nothing.
|
|
533
536
|
|
|
534
537
|
1. Write the question and options files as the stop would, and compute its `id` the same way.
|
|
535
538
|
2. Append one entry to `auto-answers.md` in the work folder — whoever reads it later has not seen
|
|
@@ -543,12 +546,13 @@ own recommended option, in the same turn:
|
|
|
543
546
|
- [ ] <each other option, in its order>
|
|
544
547
|
```
|
|
545
548
|
|
|
546
|
-
`MR/PR <n>` is this MR/PR's `mrs[]` entry, left out for a work with no `mrs
|
|
549
|
+
`MR/PR <n>` is this MR/PR's `mrs[]` entry, left out for a work with no `mrs` — and for a study
|
|
550
|
+
phase run before `plan` wrote them, whose entries go to the first MR/PR the work publishes.
|
|
547
551
|
3. Apply that option as an orchestrator's answer is applied (above): written where the re-entry
|
|
548
552
|
table says, with every effect its row names — *Fix them* writes the plan steps and chains into
|
|
549
553
|
`build` / `fix` — and `{ "key": "unattended:answer:<gate>", "default": "<option>", "id": "<id>",
|
|
550
554
|
"phase": "<phase>", "head": "<head>", "mr": <n>, "source": "recommended" }` in
|
|
551
|
-
`meta.json.defaults_used[]
|
|
555
|
+
`meta.json.defaults_used[]` — `mr` left out when the heading names none — so "Which site takes it" reads it as it reads any answer.
|
|
552
556
|
4. `pending` stays `null`: no `ask`, no end of the run. The phase goes on from that site.
|
|
553
557
|
|
|
554
558
|
Still a question stop, as above:
|
|
@@ -558,8 +562,23 @@ Still a question stop, as above:
|
|
|
558
562
|
- **A third `high_findings` on the same MR/PR** — two `source: "recommended"` answers to that gate
|
|
559
563
|
with this `mr` already in `defaults_used[]`: two rounds of fixes that left high findings behind
|
|
560
564
|
are for a person to judge.
|
|
561
|
-
- **
|
|
562
|
-
|
|
565
|
+
- **An option that reaches another repository** — taken, it adds a `meta.json.related_repos`
|
|
566
|
+
entry, or changes a contract a sibling repo consumes (a `related_repos` consumer in
|
|
567
|
+
`03-design.md` "External contracts") or published (`01-context.md` "Contracts received"). The
|
|
568
|
+
orchestrator owns this checkout only; widening the work past it is a person's call.
|
|
569
|
+
- **An option that writes a schema object `approved-schema.md` does not list** — a table, column,
|
|
570
|
+
index, constraint or data copy, or any of them when the file does not exist. A `migration`
|
|
571
|
+
question in `build`, `fix` or `review` is this case by construction: one that writes only listed
|
|
572
|
+
objects is never asked (§2, a schema approved with the study), and hard gate 3 asks for whatever
|
|
573
|
+
lies beyond the list. Applying a migration (`validate`) and the pre-deploy SQL (`ship`) write no
|
|
574
|
+
new object, and are answered as before.
|
|
575
|
+
- **A bundled option** — *Apply the recommended response to each* of a `design_challenge` or an
|
|
576
|
+
`investigation_challenge` — is judged response by response: one that falls in either case above
|
|
577
|
+
stops the whole question.
|
|
578
|
+
- **The study phases before the door to code** — the first study run, a `--study` work still
|
|
579
|
+
being studied, a study a person's changes rewound — and **`respond`, `green` and `start`**, in
|
|
580
|
+
every case, ask or block as they always do: a review round answers a reviewer, and the ticket's
|
|
581
|
+
owner decides that one.
|
|
563
582
|
|
|
564
583
|
`ship` puts this MR/PR's entries in the body (its "In every mode" paragraph), so the person who
|
|
565
584
|
reads the draft sees each question, its options and the one taken, and asks for a change there.
|
|
@@ -137,6 +137,7 @@ Fix-specific:
|
|
|
137
137
|
- **Every modified query carries its base row** — the same query on `git merge-base HEAD <git.default_base>`, measured in the same sandbox with the same seed (`/flow:work:query` §4). This chain already demanded it for slowness bugs; it now applies to any query the fix changes, because a fix that quietly costs 40 ms is a regression whether or not the ticket mentioned speed.
|
|
138
138
|
- **Bug about slowness or timeouts → the duel is the fix's proof**: the base and after rows are the verdict, or the fix is unproven whatever the tests say.
|
|
139
139
|
- A **trick** added under pressure (a cast to align a collation, a hint, a hand-written column order) — checklist item 11 applies in full: it ships with a comment saying why it is there and what removes it, plus the ticket for the root cause, or it does not ship.
|
|
140
|
+
- **This round's own fixes are diff too** — `/flow:feat:review` §3.6, unchanged: a fix applied after the round that adds or modifies a query (a scope the user widened included) is dueled before §8, and "no queries touched" is written only when neither the candidate nor the fixes touched one.
|
|
140
141
|
- Verdicts map as findings: **change** blocks, **regressed** blocks unless `03-investigation.md` justifies the trade, **schema / follow-up** → proposed ticket **and a `followups[]` entry** (flow-core §7), **unresolved** recorded literally.
|
|
141
142
|
|
|
142
143
|
## 4. Over-engineering audit (fit + YAGNI)
|
|
@@ -44,7 +44,7 @@ Read `~/.claude/flow/CORE.gemini.md` first (shared rules: `FLOW.md` step 0, mode
|
|
|
44
44
|
- **The review has to be about the tree you are about to push — `/flow:feat:ship` §1, in full and unchanged**, including its four newer cases: `reviewed_sha` is the revision the reviewers *read* (`/flow:bug:review` §1.5 froze it), so `fixed_sha` set alongside an equal sha is a mismatch and not a match; a dirty tree at this end is named and asked about rather than passed over; and a `reviewed_sha` that no longer resolves is reported, then treated as absent. Compare `meta.json.reviewed_sha` and `validated_sha` against `git rev-parse HEAD`:
|
|
45
45
|
- **Equal** (and no `fixed_sha`, over a clean tree) → continue.
|
|
46
46
|
- **Absent** (a work from before the shas were recorded) → say so in one line, continue; absence is not a mismatch.
|
|
47
|
-
- **Different** → read the delta (`git log --oneline <sha>..HEAD`, `git diff --stat <sha>..HEAD`) and judge it by **what it touches**. Only test files (`tests/`, `test/`, `spec/`, `__tests__/`, `*_test.*`, `*Test.*`, `*.test.*`, `*.spec.*`) or this work's folder under `.claude/work/` → append both shas and the file list to `06-review.md`, continue without asking. **Anything else** → stop and ask in **every** `autonomy.mode`, no exceptions (`AskUserQuestion`): *re-review the delta* (`/flow:bug:review`, the recommended default — its §1.5 takes `reviewed_sha` as the base, so the delta is both what it reads and what sets its tier) · *ship as it stands*, recording in `06-review.md` the two shas and that the user accepted them unreviewed.
|
|
47
|
+
- **Different** → read the delta (`git log --oneline <sha>..HEAD`, `git diff --stat <sha>..HEAD`) and judge it by **what it touches**. Only test files (`tests/`, `test/`, `spec/`, `__tests__/`, `*_test.*`, `*Test.*`, `*.test.*`, `*.spec.*`) or this work's folder under `.claude/work/` → append both shas and the file list to `06-review.md`, continue without asking. **Anything else** → stop and ask in **every** `autonomy.mode`, no exceptions (`AskUserQuestion`): *re-review the delta* (`/flow:bug:review`, the recommended default — its §1.5 takes `reviewed_sha` as the base, so the delta is both what it reads and what sets its tier) · *ship as it stands*, recording in `06-review.md` the two shas and that the user accepted them unreviewed. Its own question, never a line of the §2 MR/PR preview; a delta that adds or modifies a query or a schema object names it in the question, as `/flow:feat:ship` §1 says.
|
|
48
48
|
|
|
49
49
|
## 1. Draft title and description (without sending anything yet)
|
|
50
50
|
|
|
@@ -181,8 +181,8 @@ With an "all threads resolved before merge" policy, the MR/PR cannot be merged o
|
|
|
181
181
|
|
|
182
182
|
### 3.3 Performance comment
|
|
183
183
|
|
|
184
|
-
`/flow:feat:ship` §4.3, unchanged: query rows from `06-review.md` —
|
|
185
|
-
measured included, as `not measured (<reason>)` — and benchmark rows from `05-validation.md`,
|
|
184
|
+
`/flow:feat:ship` §4.3, unchanged: query and schema rows from `06-review.md` — added and modified
|
|
185
|
+
queries alike, one that was not measured included, as `not measured (<reason>)` — and benchmark rows from `05-validation.md`,
|
|
186
186
|
posted as comments anchored on the changed lines of the MR/PR, confirmed in every mode. A slowness bug is the case where this comment *is* the proof the fix worked.
|
|
187
187
|
|
|
188
188
|
## 4. Close
|
|
@@ -208,7 +208,9 @@ Judging rules: **no number, no win** (unresolved is recorded unresolved, never s
|
|
|
208
208
|
|
|
209
209
|
**A modified query is judged against its own past, not only against its rivals.** For every query the diff *changes* (as opposed to adds), the duel carries the **base row** — the same query on `git merge-base HEAD <git.default_base>`, measured in the same sandbox with the same seed (`/flow:work:query` §4). Without it the table cannot say whether this diff made things better or worse, which is the one thing a reviewer wants from it.
|
|
210
210
|
|
|
211
|
-
**A
|
|
211
|
+
**A query with no plan behind its verdict — added or modified — is recorded `ok (plan not measured)` — and says what would measure it (`data.explain_cmd`, a data set) — never a bare `ok`.** Ship publishes that row on the MR/PR (`/flow:feat:ship` §4.3); a reviewer who finds a plain "ok" and no number has no way to know nobody looked.
|
|
212
|
+
|
|
213
|
+
**This round's own fixes are diff too.** A fix applied after the round — a blocker's, a suggestion's, or a scope the user widened when a finding asked — that adds or modifies a query or a schema object runs this section on it before §9, on the tree that holds the fix. "No queries touched" is written only when neither the candidate nor the fixes touched one; a query that entered with a fix and was judged by reading it ("indexed unique key, LIMIT 1") is `ok (plan not measured)`, never an `ok`, and ship publishes it as such.
|
|
212
214
|
|
|
213
215
|
Verdicts as findings: **change** = blocker, through §6; **regressed** = blocker unless `03-design.md` justifies the trade, in which case it is stated and published; **schema / follow-up** → proposed ticket in the output **and a `followups[]` entry** (flow-core §7); **unresolved** → recorded literally with the open question (as §3.5). A `change` verdict resting on a measured plan is already confirmed — no §6 skeptic.
|
|
214
216
|
|
|
@@ -332,7 +334,7 @@ Write `.claude/work/<TICKET>/06-review.md`. The `Cost:` line of `## Summary` is
|
|
|
332
334
|
<the phases §2.0b's give-up order dropped because the budget ran out, one line each with what was not looked at, or "none">
|
|
333
335
|
|
|
334
336
|
## Data-access duel
|
|
335
|
-
<one row per query added or modified by the diff, per §3.6; "no queries touched" if none, or "renames only" when the change did not alter filter/order/bound/joins/columns>
|
|
337
|
+
<one row per query added or modified by the diff or by this round's fixes, and per schema change, per §3.6; "no queries touched" if none, or "renames only" when the change did not alter filter/order/bound/joins/columns>
|
|
336
338
|
|
|
337
339
|
| Query (file:line) | New/mod | Bound | Index used / plan | Rows read → returned | vs base | Verdict | Evidence |
|
|
338
340
|
|---|---|---|---|---|---|---|---|
|
|
@@ -68,7 +68,8 @@ where it failed too — and the review findings an orchestrator's answer accepte
|
|
|
68
68
|
(`06-review.md` "Answered (unattended)"), one line each. The §3 preview shows that section like
|
|
69
69
|
any other, and the person reading it is the check the run could not do. Entries of
|
|
70
70
|
`auto-answers.md` for this MR/PR (`MR/PR <n>` in their heading, or all of them for a work with no
|
|
71
|
-
`mrs`)
|
|
71
|
+
`mrs`) — plus, while no `mrs[]` entry is `published` or `merged`, every entry whose heading names none: a study
|
|
72
|
+
phase answered it before `plan` wrote `mrs` — go into the body verbatim under `## Decided without asking` — each question, its options,
|
|
72
73
|
the one taken checked (flow-core §2.1, the recommended answer).
|
|
73
74
|
|
|
74
75
|
## 1. Pre-flight
|
|
@@ -83,7 +84,7 @@ the one taken checked (flow-core §2.1, the recommended answer).
|
|
|
83
84
|
- **Absent** (work started before the shas were recorded) → say so in one line and continue. Absence is not a mismatch.
|
|
84
85
|
- **Different** → read the delta (`git log --oneline <sha>..HEAD`, `git diff --stat <sha>..HEAD`) and judge it by **what it touches**, never by size. When `fixed_sha` is set, say in the same line that part of this delta is the review's own fixes: the user is judging what the reviewers never read, and where it came from is the first thing they need.
|
|
85
86
|
- Only test files (`tests/`, `test/`, `spec/`, `__tests__/`, `*_test.*`, `*Test.*`, `*.test.*`, `*.spec.*`) and this work's own folder under `.claude/work/` → append both shas and the file list to `06-review.md`, continue **without asking** (a test written by `validate` after the review is the normal order).
|
|
86
|
-
- **Anything else** → stop and ask, in **every** `autonomy.mode`, with a single `AskUserQuestion`: *re-review the delta* (`/flow:feat:review`, recommended default — §1.5 resolves `reviewed_sha` as its base, so it reads the delta and nothing else, and resolves the tier on the delta too) · *ship it as it stands*, which first appends to `06-review.md` the two shas, the files, and that the user accepted them unreviewed. Never resolve this one silently.
|
|
87
|
+
- **Anything else** → stop and ask, in **every** `autonomy.mode`, with a single `AskUserQuestion`: *re-review the delta* (`/flow:feat:review`, recommended default — §1.5 resolves `reviewed_sha` as its base, so it reads the delta and nothing else, and resolves the tier on the delta too) · *ship it as it stands*, which first appends to `06-review.md` the two shas, the files, and that the user accepted them unreviewed. Never resolve this one silently, and never fold it into the §3 description preview as a line to accept with the MR/PR: it is a question of its own, asked before §2 drafts anything. **A delta that adds or modifies a query or a schema object** says so in the question, by name: re-reviewing it is what puts it through the data-access duel (`/flow:feat:review` §3.6) and onto the performance comment (§4.3); shipping as it stands leaves that query out of both, and the appended line in `06-review.md` names it as unmeasured.
|
|
87
88
|
- Check for blocking TODO/FIXME added on this branch (`git diff --unified=0 <git.default_base>...HEAD | grep -E '^\\+.*(TODO|FIXME)'`). If any, list them and ask whether to continue.
|
|
88
89
|
|
|
89
90
|
## 2. Draft title and description (without sending anything yet)
|
|
@@ -241,20 +242,26 @@ Thread body: the SQL block under "Pre-deploy: run this SQL on the server BEFORE
|
|
|
241
242
|
|
|
242
243
|
With the repo policy "all threads resolved before merge", the MR/PR cannot merge until the SQL is executed and the thread **resolved**. **One single thread even with multiple statements.** Tell the user it is left open on purpose.
|
|
243
244
|
|
|
244
|
-
### 4.3 Performance comment (every
|
|
245
|
+
### 4.3 Performance comment (every query or table the diff touches, measured or not)
|
|
245
246
|
|
|
246
|
-
Post one when `06-review.md` §"Data-access duel" has a row for a
|
|
247
|
-
|
|
248
|
-
|
|
247
|
+
Post one when `06-review.md` §"Data-access duel" has a row for a query the diff **adds or modifies**,
|
|
248
|
+
or for a **schema change** (a table created or altered, an index added or dropped) — **whatever its
|
|
249
|
+
verdict, measured or not** — or `07-validation.md` §3.7 has benchmark rows. Renames and reformats
|
|
250
|
+
only, and nothing benchmarked → post nothing.
|
|
249
251
|
|
|
250
|
-
**
|
|
252
|
+
**An added query has no past, not no plan.** Its comment carries the plan on the branch alone, the
|
|
253
|
+
`base` row reading `new`. A new table carries its DDL with the indexes it was created with, and the
|
|
254
|
+
plan of every query in the diff that reads it — a table nobody queries yet says so in one line. The
|
|
255
|
+
row is anchored to the migration's changed lines, the queries' rows to theirs.
|
|
256
|
+
|
|
257
|
+
**A query that was never measured is the case this comment exists for.** Silence reads as
|
|
251
258
|
"nothing to see"; a reviewer cannot tell a query that was measured and is fine from one that nobody
|
|
252
259
|
looked at. The row says `not measured (<reason>)` and what would settle it (`data.explain_cmd`, a
|
|
253
260
|
data set, the entry point to run), so the reviewer knows what was *not* checked.
|
|
254
261
|
|
|
255
262
|
**Where it goes: on the query, not under the title.** One **inline thread anchored to the changed
|
|
256
263
|
lines of that query in the MR/PR diff** (a resolvable GitLab discussion with a `position`; a GitHub
|
|
257
|
-
review comment on `path` + `line`), one per
|
|
264
|
+
review comment on `path` + `line`), one per query or schema change. The entry-point rows anchor to the entry
|
|
258
265
|
point's changed line the same way. Anchoring fails (the line is not in the diff, the forge refuses
|
|
259
266
|
the position) → a general MR/PR comment that names the file and line, and say so. A general comment
|
|
260
267
|
is the fallback, never the default: a number a reviewer meets on the line they are reading is read;
|
|
@@ -289,8 +296,9 @@ no measurable change, not a percentage.
|
|
|
289
296
|
plan command for it — `EXPLAIN`, never `EXPLAIN ANALYZE` on a write — in a code block, so the
|
|
290
297
|
author can run it on production or a replica and answer in the thread. This is a complement to the
|
|
291
298
|
sandbox measurement, never a substitute: the flow does not touch production.
|
|
292
|
-
- **Memory is the entry point's, not the query's.** A
|
|
293
|
-
that exercises it, through `quality.bench_cmd` on both sides
|
|
299
|
+
- **Memory is the entry point's, not the query's.** A query the diff adds or modifies also gets the
|
|
300
|
+
entry-point row that exercises it, through `quality.bench_cmd` on both sides — the branch alone
|
|
301
|
+
for an added one (`/flow:*:validate` §3.7). No
|
|
294
302
|
`bench_cmd` → the entry-point row says `not measured (no quality.bench_cmd)`; never an estimate.
|
|
295
303
|
- **Verdicts**: `improved` · `no measurable change` · `regressed` · `not measured (<reason>)`.
|
|
296
304
|
- **A `regressed` row is a review blocker** unless `03-design.md` justifies the trade — in which
|
package/adapters/hermes/CORE.md
CHANGED
|
@@ -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.
|
|
20
|
+
**This file belongs to flow `0.102.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
|
|
@@ -530,7 +530,10 @@ only in `unattended` (empty or `ask` → every question stops as above). It appl
|
|
|
530
530
|
holds a study a person approved: `done-summary.md` in the work folder (a study run, approved with
|
|
531
531
|
`why = start`) or `meta.json.handoff` true (a study handed off from elsewhere). Then a question
|
|
532
532
|
stop in `build`, `fix`, `review`, `validate` or `ship` is not sent, and the run answers it with its
|
|
533
|
-
own recommended option, in the same turn
|
|
533
|
+
own recommended option, in the same turn. So is one in `design`, `plan` or `investigate` once the
|
|
534
|
+
work has crossed the door to code — `05-implementation.md` or `04-fix.md` exists, as when building
|
|
535
|
+
sent the work back to the study: `--study` sets `handoff` at start, before anyone approved anything,
|
|
536
|
+
so before that door the flag proves nothing.
|
|
534
537
|
|
|
535
538
|
1. Write the question and options files as the stop would, and compute its `id` the same way.
|
|
536
539
|
2. Append one entry to `auto-answers.md` in the work folder — whoever reads it later has not seen
|
|
@@ -544,12 +547,13 @@ own recommended option, in the same turn:
|
|
|
544
547
|
- [ ] <each other option, in its order>
|
|
545
548
|
```
|
|
546
549
|
|
|
547
|
-
`MR/PR <n>` is this MR/PR's `mrs[]` entry, left out for a work with no `mrs
|
|
550
|
+
`MR/PR <n>` is this MR/PR's `mrs[]` entry, left out for a work with no `mrs` — and for a study
|
|
551
|
+
phase run before `plan` wrote them, whose entries go to the first MR/PR the work publishes.
|
|
548
552
|
3. Apply that option as an orchestrator's answer is applied (above): written where the re-entry
|
|
549
553
|
table says, with every effect its row names — *Fix them* writes the plan steps and chains into
|
|
550
554
|
`build` / `fix` — and `{ "key": "unattended:answer:<gate>", "default": "<option>", "id": "<id>",
|
|
551
555
|
"phase": "<phase>", "head": "<head>", "mr": <n>, "source": "recommended" }` in
|
|
552
|
-
`meta.json.defaults_used[]
|
|
556
|
+
`meta.json.defaults_used[]` — `mr` left out when the heading names none — so "Which site takes it" reads it as it reads any answer.
|
|
553
557
|
4. `pending` stays `null`: no `ask`, no end of the run. The phase goes on from that site.
|
|
554
558
|
|
|
555
559
|
Still a question stop, as above:
|
|
@@ -559,8 +563,23 @@ Still a question stop, as above:
|
|
|
559
563
|
- **A third `high_findings` on the same MR/PR** — two `source: "recommended"` answers to that gate
|
|
560
564
|
with this `mr` already in `defaults_used[]`: two rounds of fixes that left high findings behind
|
|
561
565
|
are for a person to judge.
|
|
562
|
-
- **
|
|
563
|
-
|
|
566
|
+
- **An option that reaches another repository** — taken, it adds a `meta.json.related_repos`
|
|
567
|
+
entry, or changes a contract a sibling repo consumes (a `related_repos` consumer in
|
|
568
|
+
`03-design.md` "External contracts") or published (`01-context.md` "Contracts received"). The
|
|
569
|
+
orchestrator owns this checkout only; widening the work past it is a person's call.
|
|
570
|
+
- **An option that writes a schema object `approved-schema.md` does not list** — a table, column,
|
|
571
|
+
index, constraint or data copy, or any of them when the file does not exist. A `migration`
|
|
572
|
+
question in `build`, `fix` or `review` is this case by construction: one that writes only listed
|
|
573
|
+
objects is never asked (§2, a schema approved with the study), and hard gate 3 asks for whatever
|
|
574
|
+
lies beyond the list. Applying a migration (`validate`) and the pre-deploy SQL (`ship`) write no
|
|
575
|
+
new object, and are answered as before.
|
|
576
|
+
- **A bundled option** — *Apply the recommended response to each* of a `design_challenge` or an
|
|
577
|
+
`investigation_challenge` — is judged response by response: one that falls in either case above
|
|
578
|
+
stops the whole question.
|
|
579
|
+
- **The study phases before the door to code** — the first study run, a `--study` work still
|
|
580
|
+
being studied, a study a person's changes rewound — and **`respond`, `green` and `start`**, in
|
|
581
|
+
every case, ask or block as they always do: a review round answers a reviewer, and the ticket's
|
|
582
|
+
owner decides that one.
|
|
564
583
|
|
|
565
584
|
`ship` puts this MR/PR's entries in the body (its "In every mode" paragraph), so the person who
|
|
566
585
|
reads the draft sees each question, its options and the one taken, and asks for a change there.
|
|
@@ -141,6 +141,7 @@ Fix-specific:
|
|
|
141
141
|
- **Every modified query carries its base row** — the same query on `git merge-base HEAD <git.default_base>`, measured in the same sandbox with the same seed (`/flow-work-query` §4). This chain already demanded it for slowness bugs; it now applies to any query the fix changes, because a fix that quietly costs 40 ms is a regression whether or not the ticket mentioned speed.
|
|
142
142
|
- **Bug about slowness or timeouts → the duel is the fix's proof**: the base and after rows are the verdict, or the fix is unproven whatever the tests say.
|
|
143
143
|
- A **trick** added under pressure (a cast to align a collation, a hint, a hand-written column order) — checklist item 11 applies in full: it ships with a comment saying why it is there and what removes it, plus the ticket for the root cause, or it does not ship.
|
|
144
|
+
- **This round's own fixes are diff too** — `/flow-feat-review` §3.6, unchanged: a fix applied after the round that adds or modifies a query (a scope the user widened included) is dueled before §8, and "no queries touched" is written only when neither the candidate nor the fixes touched one.
|
|
144
145
|
- Verdicts map as findings: **change** blocks, **regressed** blocks unless `03-investigation.md` justifies the trade, **schema / follow-up** → proposed ticket **and a `followups[]` entry** (flow-core §7), **unresolved** recorded literally.
|
|
145
146
|
|
|
146
147
|
## 4. Over-engineering audit (fit + YAGNI)
|
|
@@ -48,7 +48,7 @@ Read `~/.claude/flow/CORE.hermes.md` first (shared rules: `FLOW.md` step 0, mode
|
|
|
48
48
|
- **The review has to be about the tree you are about to push — `/flow-feat-ship` §1, in full and unchanged**, including its four newer cases: `reviewed_sha` is the revision the reviewers *read* (`/flow-bug-review` §1.5 froze it), so `fixed_sha` set alongside an equal sha is a mismatch and not a match; a dirty tree at this end is named and asked about rather than passed over; and a `reviewed_sha` that no longer resolves is reported, then treated as absent. Compare `meta.json.reviewed_sha` and `validated_sha` against `git rev-parse HEAD`:
|
|
49
49
|
- **Equal** (and no `fixed_sha`, over a clean tree) → continue.
|
|
50
50
|
- **Absent** (a work from before the shas were recorded) → say so in one line, continue; absence is not a mismatch.
|
|
51
|
-
- **Different** → read the delta (`git log --oneline <sha>..HEAD`, `git diff --stat <sha>..HEAD`) and judge it by **what it touches**. Only test files (`tests/`, `test/`, `spec/`, `__tests__/`, `*_test.*`, `*Test.*`, `*.test.*`, `*.spec.*`) or this work's folder under `.claude/work/` → append both shas and the file list to `06-review.md`, continue without asking. **Anything else** → stop and ask in **every** `autonomy.mode`, no exceptions (`AskUserQuestion`): *re-review the delta* (`/flow-bug-review`, the recommended default — its §1.5 takes `reviewed_sha` as the base, so the delta is both what it reads and what sets its tier) · *ship as it stands*, recording in `06-review.md` the two shas and that the user accepted them unreviewed.
|
|
51
|
+
- **Different** → read the delta (`git log --oneline <sha>..HEAD`, `git diff --stat <sha>..HEAD`) and judge it by **what it touches**. Only test files (`tests/`, `test/`, `spec/`, `__tests__/`, `*_test.*`, `*Test.*`, `*.test.*`, `*.spec.*`) or this work's folder under `.claude/work/` → append both shas and the file list to `06-review.md`, continue without asking. **Anything else** → stop and ask in **every** `autonomy.mode`, no exceptions (`AskUserQuestion`): *re-review the delta* (`/flow-bug-review`, the recommended default — its §1.5 takes `reviewed_sha` as the base, so the delta is both what it reads and what sets its tier) · *ship as it stands*, recording in `06-review.md` the two shas and that the user accepted them unreviewed. Its own question, never a line of the §2 MR/PR preview; a delta that adds or modifies a query or a schema object names it in the question, as `/flow-feat-ship` §1 says.
|
|
52
52
|
|
|
53
53
|
## 1. Draft title and description (without sending anything yet)
|
|
54
54
|
|
|
@@ -185,8 +185,8 @@ With an "all threads resolved before merge" policy, the MR/PR cannot be merged o
|
|
|
185
185
|
|
|
186
186
|
### 3.3 Performance comment
|
|
187
187
|
|
|
188
|
-
`/flow-feat-ship` §4.3, unchanged: query rows from `06-review.md` —
|
|
189
|
-
measured included, as `not measured (<reason>)` — and benchmark rows from `05-validation.md`,
|
|
188
|
+
`/flow-feat-ship` §4.3, unchanged: query and schema rows from `06-review.md` — added and modified
|
|
189
|
+
queries alike, one that was not measured included, as `not measured (<reason>)` — and benchmark rows from `05-validation.md`,
|
|
190
190
|
posted as comments anchored on the changed lines of the MR/PR, confirmed in every mode. A slowness bug is the case where this comment *is* the proof the fix worked.
|
|
191
191
|
|
|
192
192
|
## 4. Close
|
|
@@ -212,7 +212,9 @@ Judging rules: **no number, no win** (unresolved is recorded unresolved, never s
|
|
|
212
212
|
|
|
213
213
|
**A modified query is judged against its own past, not only against its rivals.** For every query the diff *changes* (as opposed to adds), the duel carries the **base row** — the same query on `git merge-base HEAD <git.default_base>`, measured in the same sandbox with the same seed (`/flow-work-query` §4). Without it the table cannot say whether this diff made things better or worse, which is the one thing a reviewer wants from it.
|
|
214
214
|
|
|
215
|
-
**A
|
|
215
|
+
**A query with no plan behind its verdict — added or modified — is recorded `ok (plan not measured)` — and says what would measure it (`data.explain_cmd`, a data set) — never a bare `ok`.** Ship publishes that row on the MR/PR (`/flow-feat-ship` §4.3); a reviewer who finds a plain "ok" and no number has no way to know nobody looked.
|
|
216
|
+
|
|
217
|
+
**This round's own fixes are diff too.** A fix applied after the round — a blocker's, a suggestion's, or a scope the user widened when a finding asked — that adds or modifies a query or a schema object runs this section on it before §9, on the tree that holds the fix. "No queries touched" is written only when neither the candidate nor the fixes touched one; a query that entered with a fix and was judged by reading it ("indexed unique key, LIMIT 1") is `ok (plan not measured)`, never an `ok`, and ship publishes it as such.
|
|
216
218
|
|
|
217
219
|
Verdicts as findings: **change** = blocker, through §6; **regressed** = blocker unless `03-design.md` justifies the trade, in which case it is stated and published; **schema / follow-up** → proposed ticket in the output **and a `followups[]` entry** (flow-core §7); **unresolved** → recorded literally with the open question (as §3.5). A `change` verdict resting on a measured plan is already confirmed — no §6 skeptic.
|
|
218
220
|
|
|
@@ -336,7 +338,7 @@ Write `.claude/work/<TICKET>/06-review.md`. The `Cost:` line of `## Summary` is
|
|
|
336
338
|
<the phases §2.0b's give-up order dropped because the budget ran out, one line each with what was not looked at, or "none">
|
|
337
339
|
|
|
338
340
|
## Data-access duel
|
|
339
|
-
<one row per query added or modified by the diff, per §3.6; "no queries touched" if none, or "renames only" when the change did not alter filter/order/bound/joins/columns>
|
|
341
|
+
<one row per query added or modified by the diff or by this round's fixes, and per schema change, per §3.6; "no queries touched" if none, or "renames only" when the change did not alter filter/order/bound/joins/columns>
|
|
340
342
|
|
|
341
343
|
| Query (file:line) | New/mod | Bound | Index used / plan | Rows read → returned | vs base | Verdict | Evidence |
|
|
342
344
|
|---|---|---|---|---|---|---|---|
|
|
@@ -72,7 +72,8 @@ where it failed too — and the review findings an orchestrator's answer accepte
|
|
|
72
72
|
(`06-review.md` "Answered (unattended)"), one line each. The §3 preview shows that section like
|
|
73
73
|
any other, and the person reading it is the check the run could not do. Entries of
|
|
74
74
|
`auto-answers.md` for this MR/PR (`MR/PR <n>` in their heading, or all of them for a work with no
|
|
75
|
-
`mrs`)
|
|
75
|
+
`mrs`) — plus, while no `mrs[]` entry is `published` or `merged`, every entry whose heading names none: a study
|
|
76
|
+
phase answered it before `plan` wrote `mrs` — go into the body verbatim under `## Decided without asking` — each question, its options,
|
|
76
77
|
the one taken checked (flow-core §2.1, the recommended answer).
|
|
77
78
|
|
|
78
79
|
## 1. Pre-flight
|
|
@@ -87,7 +88,7 @@ the one taken checked (flow-core §2.1, the recommended answer).
|
|
|
87
88
|
- **Absent** (work started before the shas were recorded) → say so in one line and continue. Absence is not a mismatch.
|
|
88
89
|
- **Different** → read the delta (`git log --oneline <sha>..HEAD`, `git diff --stat <sha>..HEAD`) and judge it by **what it touches**, never by size. When `fixed_sha` is set, say in the same line that part of this delta is the review's own fixes: the user is judging what the reviewers never read, and where it came from is the first thing they need.
|
|
89
90
|
- Only test files (`tests/`, `test/`, `spec/`, `__tests__/`, `*_test.*`, `*Test.*`, `*.test.*`, `*.spec.*`) and this work's own folder under `.claude/work/` → append both shas and the file list to `06-review.md`, continue **without asking** (a test written by `validate` after the review is the normal order).
|
|
90
|
-
- **Anything else** → stop and ask, in **every** `autonomy.mode`, with a single `AskUserQuestion`: *re-review the delta* (`/flow-feat-review`, recommended default — §1.5 resolves `reviewed_sha` as its base, so it reads the delta and nothing else, and resolves the tier on the delta too) · *ship it as it stands*, which first appends to `06-review.md` the two shas, the files, and that the user accepted them unreviewed. Never resolve this one silently.
|
|
91
|
+
- **Anything else** → stop and ask, in **every** `autonomy.mode`, with a single `AskUserQuestion`: *re-review the delta* (`/flow-feat-review`, recommended default — §1.5 resolves `reviewed_sha` as its base, so it reads the delta and nothing else, and resolves the tier on the delta too) · *ship it as it stands*, which first appends to `06-review.md` the two shas, the files, and that the user accepted them unreviewed. Never resolve this one silently, and never fold it into the §3 description preview as a line to accept with the MR/PR: it is a question of its own, asked before §2 drafts anything. **A delta that adds or modifies a query or a schema object** says so in the question, by name: re-reviewing it is what puts it through the data-access duel (`/flow-feat-review` §3.6) and onto the performance comment (§4.3); shipping as it stands leaves that query out of both, and the appended line in `06-review.md` names it as unmeasured.
|
|
91
92
|
- Check for blocking TODO/FIXME added on this branch (`git diff --unified=0 <git.default_base>...HEAD | grep -E '^\+.*(TODO|FIXME)'`). If any, list them and ask whether to continue.
|
|
92
93
|
|
|
93
94
|
## 2. Draft title and description (without sending anything yet)
|
|
@@ -245,20 +246,26 @@ Thread body: the SQL block under "Pre-deploy: run this SQL on the server BEFORE
|
|
|
245
246
|
|
|
246
247
|
With the repo policy "all threads resolved before merge", the MR/PR cannot merge until the SQL is executed and the thread **resolved**. **One single thread even with multiple statements.** Tell the user it is left open on purpose.
|
|
247
248
|
|
|
248
|
-
### 4.3 Performance comment (every
|
|
249
|
+
### 4.3 Performance comment (every query or table the diff touches, measured or not)
|
|
249
250
|
|
|
250
|
-
Post one when `06-review.md` §"Data-access duel" has a row for a
|
|
251
|
-
|
|
252
|
-
|
|
251
|
+
Post one when `06-review.md` §"Data-access duel" has a row for a query the diff **adds or modifies**,
|
|
252
|
+
or for a **schema change** (a table created or altered, an index added or dropped) — **whatever its
|
|
253
|
+
verdict, measured or not** — or `07-validation.md` §3.7 has benchmark rows. Renames and reformats
|
|
254
|
+
only, and nothing benchmarked → post nothing.
|
|
253
255
|
|
|
254
|
-
**
|
|
256
|
+
**An added query has no past, not no plan.** Its comment carries the plan on the branch alone, the
|
|
257
|
+
`base` row reading `new`. A new table carries its DDL with the indexes it was created with, and the
|
|
258
|
+
plan of every query in the diff that reads it — a table nobody queries yet says so in one line. The
|
|
259
|
+
row is anchored to the migration's changed lines, the queries' rows to theirs.
|
|
260
|
+
|
|
261
|
+
**A query that was never measured is the case this comment exists for.** Silence reads as
|
|
255
262
|
"nothing to see"; a reviewer cannot tell a query that was measured and is fine from one that nobody
|
|
256
263
|
looked at. The row says `not measured (<reason>)` and what would settle it (`data.explain_cmd`, a
|
|
257
264
|
data set, the entry point to run), so the reviewer knows what was *not* checked.
|
|
258
265
|
|
|
259
266
|
**Where it goes: on the query, not under the title.** One **inline thread anchored to the changed
|
|
260
267
|
lines of that query in the MR/PR diff** (a resolvable GitLab discussion with a `position`; a GitHub
|
|
261
|
-
review comment on `path` + `line`), one per
|
|
268
|
+
review comment on `path` + `line`), one per query or schema change. The entry-point rows anchor to the entry
|
|
262
269
|
point's changed line the same way. Anchoring fails (the line is not in the diff, the forge refuses
|
|
263
270
|
the position) → a general MR/PR comment that names the file and line, and say so. A general comment
|
|
264
271
|
is the fallback, never the default: a number a reviewer meets on the line they are reading is read;
|
|
@@ -293,8 +300,9 @@ no measurable change, not a percentage.
|
|
|
293
300
|
plan command for it — `EXPLAIN`, never `EXPLAIN ANALYZE` on a write — in a code block, so the
|
|
294
301
|
author can run it on production or a replica and answer in the thread. This is a complement to the
|
|
295
302
|
sandbox measurement, never a substitute: the flow does not touch production.
|
|
296
|
-
- **Memory is the entry point's, not the query's.** A
|
|
297
|
-
that exercises it, through `quality.bench_cmd` on both sides
|
|
303
|
+
- **Memory is the entry point's, not the query's.** A query the diff adds or modifies also gets the
|
|
304
|
+
entry-point row that exercises it, through `quality.bench_cmd` on both sides — the branch alone
|
|
305
|
+
for an added one (`/flow-*-validate` §3.7). No
|
|
298
306
|
`bench_cmd` → the entry-point row says `not measured (no quality.bench_cmd)`; never an estimate.
|
|
299
307
|
- **Verdicts**: `improved` · `no measurable change` · `regressed` · `not measured (<reason>)`.
|
|
300
308
|
- **A `regressed` row is a review blocker** unless `03-design.md` justifies the trade — in which
|
|
@@ -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.
|
|
19
|
+
**This file belongs to flow `0.102.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
|
|
@@ -529,7 +529,10 @@ only in `unattended` (empty or `ask` → every question stops as above). It appl
|
|
|
529
529
|
holds a study a person approved: `done-summary.md` in the work folder (a study run, approved with
|
|
530
530
|
`why = start`) or `meta.json.handoff` true (a study handed off from elsewhere). Then a question
|
|
531
531
|
stop in `build`, `fix`, `review`, `validate` or `ship` is not sent, and the run answers it with its
|
|
532
|
-
own recommended option, in the same turn
|
|
532
|
+
own recommended option, in the same turn. So is one in `design`, `plan` or `investigate` once the
|
|
533
|
+
work has crossed the door to code — `05-implementation.md` or `04-fix.md` exists, as when building
|
|
534
|
+
sent the work back to the study: `--study` sets `handoff` at start, before anyone approved anything,
|
|
535
|
+
so before that door the flag proves nothing.
|
|
533
536
|
|
|
534
537
|
1. Write the question and options files as the stop would, and compute its `id` the same way.
|
|
535
538
|
2. Append one entry to `auto-answers.md` in the work folder — whoever reads it later has not seen
|
|
@@ -543,12 +546,13 @@ own recommended option, in the same turn:
|
|
|
543
546
|
- [ ] <each other option, in its order>
|
|
544
547
|
```
|
|
545
548
|
|
|
546
|
-
`MR/PR <n>` is this MR/PR's `mrs[]` entry, left out for a work with no `mrs
|
|
549
|
+
`MR/PR <n>` is this MR/PR's `mrs[]` entry, left out for a work with no `mrs` — and for a study
|
|
550
|
+
phase run before `plan` wrote them, whose entries go to the first MR/PR the work publishes.
|
|
547
551
|
3. Apply that option as an orchestrator's answer is applied (above): written where the re-entry
|
|
548
552
|
table says, with every effect its row names — *Fix them* writes the plan steps and chains into
|
|
549
553
|
`build` / `fix` — and `{ "key": "unattended:answer:<gate>", "default": "<option>", "id": "<id>",
|
|
550
554
|
"phase": "<phase>", "head": "<head>", "mr": <n>, "source": "recommended" }` in
|
|
551
|
-
`meta.json.defaults_used[]
|
|
555
|
+
`meta.json.defaults_used[]` — `mr` left out when the heading names none — so "Which site takes it" reads it as it reads any answer.
|
|
552
556
|
4. `pending` stays `null`: no `ask`, no end of the run. The phase goes on from that site.
|
|
553
557
|
|
|
554
558
|
Still a question stop, as above:
|
|
@@ -558,8 +562,23 @@ Still a question stop, as above:
|
|
|
558
562
|
- **A third `high_findings` on the same MR/PR** — two `source: "recommended"` answers to that gate
|
|
559
563
|
with this `mr` already in `defaults_used[]`: two rounds of fixes that left high findings behind
|
|
560
564
|
are for a person to judge.
|
|
561
|
-
- **
|
|
562
|
-
|
|
565
|
+
- **An option that reaches another repository** — taken, it adds a `meta.json.related_repos`
|
|
566
|
+
entry, or changes a contract a sibling repo consumes (a `related_repos` consumer in
|
|
567
|
+
`03-design.md` "External contracts") or published (`01-context.md` "Contracts received"). The
|
|
568
|
+
orchestrator owns this checkout only; widening the work past it is a person's call.
|
|
569
|
+
- **An option that writes a schema object `approved-schema.md` does not list** — a table, column,
|
|
570
|
+
index, constraint or data copy, or any of them when the file does not exist. A `migration`
|
|
571
|
+
question in `build`, `fix` or `review` is this case by construction: one that writes only listed
|
|
572
|
+
objects is never asked (§2, a schema approved with the study), and hard gate 3 asks for whatever
|
|
573
|
+
lies beyond the list. Applying a migration (`validate`) and the pre-deploy SQL (`ship`) write no
|
|
574
|
+
new object, and are answered as before.
|
|
575
|
+
- **A bundled option** — *Apply the recommended response to each* of a `design_challenge` or an
|
|
576
|
+
`investigation_challenge` — is judged response by response: one that falls in either case above
|
|
577
|
+
stops the whole question.
|
|
578
|
+
- **The study phases before the door to code** — the first study run, a `--study` work still
|
|
579
|
+
being studied, a study a person's changes rewound — and **`respond`, `green` and `start`**, in
|
|
580
|
+
every case, ask or block as they always do: a review round answers a reviewer, and the ticket's
|
|
581
|
+
owner decides that one.
|
|
563
582
|
|
|
564
583
|
`ship` puts this MR/PR's entries in the body (its "In every mode" paragraph), so the person who
|
|
565
584
|
reads the draft sees each question, its options and the one taken, and asks for a change there.
|
|
@@ -139,6 +139,7 @@ Fix-specific:
|
|
|
139
139
|
- **Every modified query carries its base row** — the same query on `git merge-base HEAD <git.default_base>`, measured in the same sandbox with the same seed (`/flow-work-query` §4). This chain already demanded it for slowness bugs; it now applies to any query the fix changes, because a fix that quietly costs 40 ms is a regression whether or not the ticket mentioned speed.
|
|
140
140
|
- **Bug about slowness or timeouts → the duel is the fix's proof**: the base and after rows are the verdict, or the fix is unproven whatever the tests say.
|
|
141
141
|
- A **trick** added under pressure (a cast to align a collation, a hint, a hand-written column order) — checklist item 11 applies in full: it ships with a comment saying why it is there and what removes it, plus the ticket for the root cause, or it does not ship.
|
|
142
|
+
- **This round's own fixes are diff too** — `/flow-feat-review` §3.6, unchanged: a fix applied after the round that adds or modifies a query (a scope the user widened included) is dueled before §8, and "no queries touched" is written only when neither the candidate nor the fixes touched one.
|
|
142
143
|
- Verdicts map as findings: **change** blocks, **regressed** blocks unless `03-investigation.md` justifies the trade, **schema / follow-up** → proposed ticket **and a `followups[]` entry** (flow-core §7), **unresolved** recorded literally.
|
|
143
144
|
|
|
144
145
|
## 4. Over-engineering audit (fit + YAGNI)
|
|
@@ -46,7 +46,7 @@ Read `~/.claude/flow/CORE.opencode.md` first (shared rules: `FLOW.md` step 0, mo
|
|
|
46
46
|
- **The review has to be about the tree you are about to push — `/flow-feat-ship` §1, in full and unchanged**, including its four newer cases: `reviewed_sha` is the revision the reviewers *read* (`/flow-bug-review` §1.5 froze it), so `fixed_sha` set alongside an equal sha is a mismatch and not a match; a dirty tree at this end is named and asked about rather than passed over; and a `reviewed_sha` that no longer resolves is reported, then treated as absent. Compare `meta.json.reviewed_sha` and `validated_sha` against `git rev-parse HEAD`:
|
|
47
47
|
- **Equal** (and no `fixed_sha`, over a clean tree) → continue.
|
|
48
48
|
- **Absent** (a work from before the shas were recorded) → say so in one line, continue; absence is not a mismatch.
|
|
49
|
-
- **Different** → read the delta (`git log --oneline <sha>..HEAD`, `git diff --stat <sha>..HEAD`) and judge it by **what it touches**. Only test files (`tests/`, `test/`, `spec/`, `__tests__/`, `*_test.*`, `*Test.*`, `*.test.*`, `*.spec.*`) or this work's folder under `.claude/work/` → append both shas and the file list to `06-review.md`, continue without asking. **Anything else** → stop and ask in **every** `autonomy.mode`, no exceptions (`AskUserQuestion`): *re-review the delta* (`/flow-bug-review`, the recommended default — its §1.5 takes `reviewed_sha` as the base, so the delta is both what it reads and what sets its tier) · *ship as it stands*, recording in `06-review.md` the two shas and that the user accepted them unreviewed.
|
|
49
|
+
- **Different** → read the delta (`git log --oneline <sha>..HEAD`, `git diff --stat <sha>..HEAD`) and judge it by **what it touches**. Only test files (`tests/`, `test/`, `spec/`, `__tests__/`, `*_test.*`, `*Test.*`, `*.test.*`, `*.spec.*`) or this work's folder under `.claude/work/` → append both shas and the file list to `06-review.md`, continue without asking. **Anything else** → stop and ask in **every** `autonomy.mode`, no exceptions (`AskUserQuestion`): *re-review the delta* (`/flow-bug-review`, the recommended default — its §1.5 takes `reviewed_sha` as the base, so the delta is both what it reads and what sets its tier) · *ship as it stands*, recording in `06-review.md` the two shas and that the user accepted them unreviewed. Its own question, never a line of the §2 MR/PR preview; a delta that adds or modifies a query or a schema object names it in the question, as `/flow-feat-ship` §1 says.
|
|
50
50
|
|
|
51
51
|
## 1. Draft title and description (without sending anything yet)
|
|
52
52
|
|
|
@@ -183,8 +183,8 @@ With an "all threads resolved before merge" policy, the MR/PR cannot be merged o
|
|
|
183
183
|
|
|
184
184
|
### 3.3 Performance comment
|
|
185
185
|
|
|
186
|
-
`/flow-feat-ship` §4.3, unchanged: query rows from `06-review.md` —
|
|
187
|
-
measured included, as `not measured (<reason>)` — and benchmark rows from `05-validation.md`,
|
|
186
|
+
`/flow-feat-ship` §4.3, unchanged: query and schema rows from `06-review.md` — added and modified
|
|
187
|
+
queries alike, one that was not measured included, as `not measured (<reason>)` — and benchmark rows from `05-validation.md`,
|
|
188
188
|
posted as comments anchored on the changed lines of the MR/PR, confirmed in every mode. A slowness bug is the case where this comment *is* the proof the fix worked.
|
|
189
189
|
|
|
190
190
|
## 4. Close
|
|
@@ -210,7 +210,9 @@ Judging rules: **no number, no win** (unresolved is recorded unresolved, never s
|
|
|
210
210
|
|
|
211
211
|
**A modified query is judged against its own past, not only against its rivals.** For every query the diff *changes* (as opposed to adds), the duel carries the **base row** — the same query on `git merge-base HEAD <git.default_base>`, measured in the same sandbox with the same seed (`/flow-work-query` §4). Without it the table cannot say whether this diff made things better or worse, which is the one thing a reviewer wants from it.
|
|
212
212
|
|
|
213
|
-
**A
|
|
213
|
+
**A query with no plan behind its verdict — added or modified — is recorded `ok (plan not measured)` — and says what would measure it (`data.explain_cmd`, a data set) — never a bare `ok`.** Ship publishes that row on the MR/PR (`/flow-feat-ship` §4.3); a reviewer who finds a plain "ok" and no number has no way to know nobody looked.
|
|
214
|
+
|
|
215
|
+
**This round's own fixes are diff too.** A fix applied after the round — a blocker's, a suggestion's, or a scope the user widened when a finding asked — that adds or modifies a query or a schema object runs this section on it before §9, on the tree that holds the fix. "No queries touched" is written only when neither the candidate nor the fixes touched one; a query that entered with a fix and was judged by reading it ("indexed unique key, LIMIT 1") is `ok (plan not measured)`, never an `ok`, and ship publishes it as such.
|
|
214
216
|
|
|
215
217
|
Verdicts as findings: **change** = blocker, through §6; **regressed** = blocker unless `03-design.md` justifies the trade, in which case it is stated and published; **schema / follow-up** → proposed ticket in the output **and a `followups[]` entry** (flow-core §7); **unresolved** → recorded literally with the open question (as §3.5). A `change` verdict resting on a measured plan is already confirmed — no §6 skeptic.
|
|
216
218
|
|
|
@@ -334,7 +336,7 @@ Write `.claude/work/<TICKET>/06-review.md`. The `Cost:` line of `## Summary` is
|
|
|
334
336
|
<the phases §2.0b's give-up order dropped because the budget ran out, one line each with what was not looked at, or "none">
|
|
335
337
|
|
|
336
338
|
## Data-access duel
|
|
337
|
-
<one row per query added or modified by the diff, per §3.6; "no queries touched" if none, or "renames only" when the change did not alter filter/order/bound/joins/columns>
|
|
339
|
+
<one row per query added or modified by the diff or by this round's fixes, and per schema change, per §3.6; "no queries touched" if none, or "renames only" when the change did not alter filter/order/bound/joins/columns>
|
|
338
340
|
|
|
339
341
|
| Query (file:line) | New/mod | Bound | Index used / plan | Rows read → returned | vs base | Verdict | Evidence |
|
|
340
342
|
|---|---|---|---|---|---|---|---|
|
|
@@ -70,7 +70,8 @@ where it failed too — and the review findings an orchestrator's answer accepte
|
|
|
70
70
|
(`06-review.md` "Answered (unattended)"), one line each. The §3 preview shows that section like
|
|
71
71
|
any other, and the person reading it is the check the run could not do. Entries of
|
|
72
72
|
`auto-answers.md` for this MR/PR (`MR/PR <n>` in their heading, or all of them for a work with no
|
|
73
|
-
`mrs`)
|
|
73
|
+
`mrs`) — plus, while no `mrs[]` entry is `published` or `merged`, every entry whose heading names none: a study
|
|
74
|
+
phase answered it before `plan` wrote `mrs` — go into the body verbatim under `## Decided without asking` — each question, its options,
|
|
74
75
|
the one taken checked (flow-core §2.1, the recommended answer).
|
|
75
76
|
|
|
76
77
|
## 1. Pre-flight
|
|
@@ -85,7 +86,7 @@ the one taken checked (flow-core §2.1, the recommended answer).
|
|
|
85
86
|
- **Absent** (work started before the shas were recorded) → say so in one line and continue. Absence is not a mismatch.
|
|
86
87
|
- **Different** → read the delta (`git log --oneline <sha>..HEAD`, `git diff --stat <sha>..HEAD`) and judge it by **what it touches**, never by size. When `fixed_sha` is set, say in the same line that part of this delta is the review's own fixes: the user is judging what the reviewers never read, and where it came from is the first thing they need.
|
|
87
88
|
- Only test files (`tests/`, `test/`, `spec/`, `__tests__/`, `*_test.*`, `*Test.*`, `*.test.*`, `*.spec.*`) and this work's own folder under `.claude/work/` → append both shas and the file list to `06-review.md`, continue **without asking** (a test written by `validate` after the review is the normal order).
|
|
88
|
-
- **Anything else** → stop and ask, in **every** `autonomy.mode`, with a single `AskUserQuestion`: *re-review the delta* (`/flow-feat-review`, recommended default — §1.5 resolves `reviewed_sha` as its base, so it reads the delta and nothing else, and resolves the tier on the delta too) · *ship it as it stands*, which first appends to `06-review.md` the two shas, the files, and that the user accepted them unreviewed. Never resolve this one silently.
|
|
89
|
+
- **Anything else** → stop and ask, in **every** `autonomy.mode`, with a single `AskUserQuestion`: *re-review the delta* (`/flow-feat-review`, recommended default — §1.5 resolves `reviewed_sha` as its base, so it reads the delta and nothing else, and resolves the tier on the delta too) · *ship it as it stands*, which first appends to `06-review.md` the two shas, the files, and that the user accepted them unreviewed. Never resolve this one silently, and never fold it into the §3 description preview as a line to accept with the MR/PR: it is a question of its own, asked before §2 drafts anything. **A delta that adds or modifies a query or a schema object** says so in the question, by name: re-reviewing it is what puts it through the data-access duel (`/flow-feat-review` §3.6) and onto the performance comment (§4.3); shipping as it stands leaves that query out of both, and the appended line in `06-review.md` names it as unmeasured.
|
|
89
90
|
- Check for blocking TODO/FIXME added on this branch (`git diff --unified=0 <git.default_base>...HEAD | grep -E '^\+.*(TODO|FIXME)'`). If any, list them and ask whether to continue.
|
|
90
91
|
|
|
91
92
|
## 2. Draft title and description (without sending anything yet)
|
|
@@ -243,20 +244,26 @@ Thread body: the SQL block under "Pre-deploy: run this SQL on the server BEFORE
|
|
|
243
244
|
|
|
244
245
|
With the repo policy "all threads resolved before merge", the MR/PR cannot merge until the SQL is executed and the thread **resolved**. **One single thread even with multiple statements.** Tell the user it is left open on purpose.
|
|
245
246
|
|
|
246
|
-
### 4.3 Performance comment (every
|
|
247
|
+
### 4.3 Performance comment (every query or table the diff touches, measured or not)
|
|
247
248
|
|
|
248
|
-
Post one when `06-review.md` §"Data-access duel" has a row for a
|
|
249
|
-
|
|
250
|
-
|
|
249
|
+
Post one when `06-review.md` §"Data-access duel" has a row for a query the diff **adds or modifies**,
|
|
250
|
+
or for a **schema change** (a table created or altered, an index added or dropped) — **whatever its
|
|
251
|
+
verdict, measured or not** — or `07-validation.md` §3.7 has benchmark rows. Renames and reformats
|
|
252
|
+
only, and nothing benchmarked → post nothing.
|
|
251
253
|
|
|
252
|
-
**
|
|
254
|
+
**An added query has no past, not no plan.** Its comment carries the plan on the branch alone, the
|
|
255
|
+
`base` row reading `new`. A new table carries its DDL with the indexes it was created with, and the
|
|
256
|
+
plan of every query in the diff that reads it — a table nobody queries yet says so in one line. The
|
|
257
|
+
row is anchored to the migration's changed lines, the queries' rows to theirs.
|
|
258
|
+
|
|
259
|
+
**A query that was never measured is the case this comment exists for.** Silence reads as
|
|
253
260
|
"nothing to see"; a reviewer cannot tell a query that was measured and is fine from one that nobody
|
|
254
261
|
looked at. The row says `not measured (<reason>)` and what would settle it (`data.explain_cmd`, a
|
|
255
262
|
data set, the entry point to run), so the reviewer knows what was *not* checked.
|
|
256
263
|
|
|
257
264
|
**Where it goes: on the query, not under the title.** One **inline thread anchored to the changed
|
|
258
265
|
lines of that query in the MR/PR diff** (a resolvable GitLab discussion with a `position`; a GitHub
|
|
259
|
-
review comment on `path` + `line`), one per
|
|
266
|
+
review comment on `path` + `line`), one per query or schema change. The entry-point rows anchor to the entry
|
|
260
267
|
point's changed line the same way. Anchoring fails (the line is not in the diff, the forge refuses
|
|
261
268
|
the position) → a general MR/PR comment that names the file and line, and say so. A general comment
|
|
262
269
|
is the fallback, never the default: a number a reviewer meets on the line they are reading is read;
|
|
@@ -291,8 +298,9 @@ no measurable change, not a percentage.
|
|
|
291
298
|
plan command for it — `EXPLAIN`, never `EXPLAIN ANALYZE` on a write — in a code block, so the
|
|
292
299
|
author can run it on production or a replica and answer in the thread. This is a complement to the
|
|
293
300
|
sandbox measurement, never a substitute: the flow does not touch production.
|
|
294
|
-
- **Memory is the entry point's, not the query's.** A
|
|
295
|
-
that exercises it, through `quality.bench_cmd` on both sides
|
|
301
|
+
- **Memory is the entry point's, not the query's.** A query the diff adds or modifies also gets the
|
|
302
|
+
entry-point row that exercises it, through `quality.bench_cmd` on both sides — the branch alone
|
|
303
|
+
for an added one (`/flow-*-validate` §3.7). No
|
|
296
304
|
`bench_cmd` → the entry-point row says `not measured (no quality.bench_cmd)`; never an estimate.
|
|
297
305
|
- **Verdicts**: `improved` · `no measurable change` · `regressed` · `not measured (<reason>)`.
|
|
298
306
|
- **A `regressed` row is a review blocker** unless `03-design.md` justifies the trade — in which
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flow-workflows",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.102.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.
|
|
6
|
+
"version": "0.102.0",
|
|
7
7
|
"author": {
|
|
8
8
|
"name": "Alberto Vioque",
|
|
9
9
|
"email": "mashware@gmail.com"
|
|
@@ -5,6 +5,44 @@ 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.102.0 — A query that entered after the review still reaches the MR with its plan · 2026-10-28
|
|
9
|
+
|
|
10
|
+
**In short**
|
|
11
|
+
- **New queries and new tables get the performance comment too.** Before, only a *modified* query
|
|
12
|
+
did: a new query ships with its plan on the branch (base row `new`), a new table with its DDL,
|
|
13
|
+
its indexes and the plan of the queries that read it.
|
|
14
|
+
- **The review duels its own fixes.** A blocker fixed in the round, or a scope widened when a
|
|
15
|
+
finding asked, that adds a query is tried on its plan before the review closes. "No queries
|
|
16
|
+
touched" now means none in the candidate *and* none in the fixes.
|
|
17
|
+
- **Ship asks the re-review question on its own.** Code the reviewers never read is a separate
|
|
18
|
+
question, never a line inside the MR/PR preview, and when that code adds a query or a schema
|
|
19
|
+
object the question names it: shipping as it stands leaves it unmeasured, and says so.
|
|
20
|
+
|
|
21
|
+
A bug fix widened its scope after a review finding and added a query that checked who owned the
|
|
22
|
+
record. The review had already written "no queries touched", the query was judged by reading it,
|
|
23
|
+
and ship folded "these lines were only reviewed by me" into the MR preview — so no plan was ever
|
|
24
|
+
taken and no comment was posted.
|
|
25
|
+
|
|
26
|
+
## v0.101.0 — An approved study answers its own design questions too · 2026-10-25
|
|
27
|
+
|
|
28
|
+
**In short**
|
|
29
|
+
- **`after_study: recommended` now reaches `design`, `plan` and `investigate`** — once the work has
|
|
30
|
+
crossed the door to code (`05-implementation.md` or `04-fix.md` exists) and building sent it back
|
|
31
|
+
to the study. Before that door nothing changes: `--study` sets `handoff` at start, before anyone
|
|
32
|
+
approved anything.
|
|
33
|
+
- **Still a person's call, in every phase the rule covers:** a recommended option that adds
|
|
34
|
+
another repository or changes a sibling's contract, and one that writes a schema object
|
|
35
|
+
`approved-schema.md` does not list. A `migration` question in `build`, `fix` or `review` for an
|
|
36
|
+
unlisted object now stops — the recommended answer used to take it past hard gate 3.
|
|
37
|
+
- **A bundled challenge answer is judged response by response:** one that widens the work stops
|
|
38
|
+
the whole question.
|
|
39
|
+
- **Answers given before `plan` wrote `mrs`** go into the draft MR/PR under `## Decided without
|
|
40
|
+
asking` while no part is published yet.
|
|
41
|
+
|
|
42
|
+
A study approved with "take the recommended option" still stopped at every design question a gap
|
|
43
|
+
in the build sent it back to, and the answer — always the recommended one — came hours later on a
|
|
44
|
+
cold relaunch.
|
|
45
|
+
|
|
8
46
|
## v0.100.0 — An unattended split builds every part without waiting for merges · 2026-10-23
|
|
9
47
|
|
|
10
48
|
**In short**
|
|
@@ -129,10 +129,12 @@ How much the flow advances on its own vs. stopping to ask you.
|
|
|
129
129
|
# the run's one closing order (`ask`, `publish`, `blocked`, `done`). Read only
|
|
130
130
|
# in that mode. The orders: flow-core §2.1.
|
|
131
131
|
- `after_study:` # `ask` (default) | `recommended`. Read only in `unattended`, once the work holds an approved study.
|
|
132
|
-
# ask — a question in build/fix/review/validate/ship ends the run with `ask
|
|
132
|
+
# ask — a question in build/fix/review/validate/ship ends the run with `ask`,
|
|
133
|
+
# and so does one in design/plan/investigate once building began.
|
|
133
134
|
# recommended — the run takes the recommended option itself and goes on; the draft
|
|
134
135
|
# MR/PR lists each question with its options, the one taken checked.
|
|
135
|
-
# Questions with no recommended option,
|
|
136
|
+
# Questions with no recommended option, a third high-findings round, and an option
|
|
137
|
+
# that reaches another repo or a schema object the study did not list, still ask.
|
|
136
138
|
|
|
137
139
|
## quality
|
|
138
140
|
Repo commands for quality gates, whatever the stack — `make test`, `./gradlew test`, `dotnet test`,
|