flow-workflows 0.103.0 → 0.104.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,7 +17,7 @@ Every `$flow-*` command assumes these rules. They are stated once, here, so a co
17
17
  carries what is specific to its phase. Read this once per session; a command that says "load
18
18
  `flow-core`" means this file.
19
19
 
20
- **This file belongs to flow `0.103.0`.** Compare it once, at the start of the session, against
20
+ **This file belongs to flow `0.104.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
@@ -426,7 +426,7 @@ person asking for changes, a ticket that already has code — is `$flow-work-run
426
426
  | Writing a DB schema change, index or migration — in any phase, a review's own fixes included — or applying one (`validate`) | question `migration`, before the first line of it is written or run — except in `respond` and `green`, where it is blocked: a schema change agreed after the MR/PR exists goes back through `build`. Writing one whose every object `approved-schema.md` lists is not asked (§2, a schema approved with the study) |
427
427
  | `review` with blockers or high-severity findings | question `high_findings` |
428
428
  | `validate` with a criterion `unproven` | blocked — the phase does not advance and does not chain |
429
- | `validate` with a red suite | **One exception, and it is measured, never judged**: every failing test also fails, under the same name, on the base (`git merge-base HEAD <git.default_base>`, run in a detached worktree), none of them lives in a file this diff touches, and none is the test that proves an acceptance criterion. **The base runs the way HEAD went red**: the same command (the whole suite when the whole suite went red, never the failing file alone), and a test that is red in the whole suite but green on its own is load- or order-dependent, so one run on each side proves nothing — run the whole suite three times on HEAD and three on the base, and write each side's red count and that test's duration in every run. Red on the base as often as on HEAD → the exception holds. Green on the base and red on HEAD, even once in three → this diff made it, whatever a single base run said; its repair step says so, with both sides' counts and how much slower the failing runs were, and the fix is what this diff adds under concurrency (a lock, a pool, a timer, a background loop), never a longer timeout or a retry → record `{"key":"unattended:validate-red-base","default":"<n> red on HEAD and on base <short sha>: <test names>","phase":"validate"}` and advance; `ship` lists those tests under "Not verified — needs a human". Short of that, **repair rounds while they make progress, at most three per MR/PR**: each round is a heading under this MR/PR's plan (`05-implementation.md` / `04-fix.md`), `### Red suite at validate (unattended), round <k>: <n> red`. No such heading yet, or the last one's `<n>` above the count red now and `<k>` below 3 → write the next heading with one unticked step per failing test (its name and the first line of its failure), each ending *fix the code, or update an assertion whose expected value this MR/PR's design or fix changed — never delete, skip or loosen a test*; record `{"key":"unattended:validate-red-loop","default":"round <k>, <n> red: <test names>","phase":"validate"}`, leave `phase = build` (`fix`) and chain into `$flow-feat-build` (`$flow-bug-fix`) — whose steps then run through the phases that follow it as always, review and validate included. A review of that round treats a test the round deleted, skipped or loosened as a blocker. A round that did not lower the count, or a third round still red → blocked, naming the tests still red and the count each round left |
429
+ | `validate` with a red suite | **One exception, and it is measured, never judged**: every failing test also fails, under the same name, on the base (`git merge-base HEAD <git.default_base>`, run in a detached worktree), none of them lives in a file this diff touches, and none is the test that proves an acceptance criterion. **The base runs the way HEAD went red**: the same command (the whole suite when the whole suite went red, never the failing file alone), and a test that is red in the whole suite but green on its own is load- or order-dependent, so one run on each side proves nothing — run the whole suite three times on HEAD and three on the base, and write each side's red count and that test's duration in every run. Red on the base as often as on HEAD → the exception holds: record `{"key":"unattended:validate-red-base","default":"<n> red on HEAD and on base <short sha>: <test names>","phase":"validate"}` and advance; `ship` lists those tests under "Not verified — needs a human". Green on the base and red on HEAD, even once in three → this diff made it, whatever a single base run said (a suspect flake, below, gets five more runs first); its repair step says so, with both sides' counts and how much slower the failing runs were, and the fix is what this diff adds under concurrency (a lock, a pool, a timer, a background loop), never a longer timeout or a retry. **A suspect flake is measured again before it is blamed**: a test red in exactly one of HEAD's three runs (the run that first went red is not one of them), in none of the base's, in a file this diff does not touch, green when run on its own, and not the test that proves an acceptance criterion. When at least one test is red in HEAD's three runs and every such test is one, run the whole suite five more times on HEAD — not on the base, whose three runs already said 0 — and write each run's red tests and the suspects' durations. Nothing red in any of the five → record `{"key":"unattended:validate-flaky","default":"<test name>: red 1/3 then 0/5 on HEAD, 0/3 on base <short sha>","phase":"validate"}` per test and advance; `ship` lists them under "Not verified — needs a human". Anything red in the five, or a red test that is not a suspect → this diff made it, and the repair rounds below follow: every red test, suspects included, goes to the repair rounds and counts in their `<n>`. The five runs are only ever more runs: a test is never rerun alone in their place, retried, skipped or loosened. Short of the exception and of a flake that held, **repair rounds while they make progress, at most three per MR/PR**: each round is a heading under this MR/PR's plan (`05-implementation.md` / `04-fix.md`), `### Red suite at validate (unattended), round <k>: <n> red`. No such heading yet, or the last one's `<n>` above the count red now and `<k>` below 3 → write the next heading with one unticked step per failing test (its name and the first line of its failure), each ending *fix the code, or update an assertion whose expected value this MR/PR's design or fix changed — never delete, skip or loosen a test*; record `{"key":"unattended:validate-red-loop","default":"round <k>, <n> red: <test names>","phase":"validate"}`, leave `phase = build` (`fix`) and chain into `$flow-feat-build` (`$flow-bug-fix`) — whose steps then run through the phases that follow it as always, review and validate included. A review of that round treats a test the round deleted, skipped or loosened as a blocker. A round that did not lower the count, or a third round still red → blocked, naming the tests still red and the count each round left |
430
430
  | A product decision (§7 `decision`) | question `decision` |
431
431
  | Clarifying questions on the ticket (`start`) | question `clarify` — after the branch and the work folder exist, with the questions also written to `01-context.md` |
432
432
  | An unanswered high-severity challenge (`design`, `investigate`) | question `design_challenge` / `investigation_challenge` |
@@ -97,7 +97,7 @@ this is the same gate as a red test.
97
97
 
98
98
  ## 5. Close
99
99
 
100
- - Red test, regressions, **or the original symptom still reproducible in §2.5** → `phase` stays at `fix`; the user iterates. A red gate stops in every mode except `unattended`, where flow-core §2.1 decides: every failing test also red on the base → its exception advances (the reproduction test lives in a file this diff touches, so it never qualifies); otherwise a repair round of that row — the failing tests become unticked steps of `04-fix.md`'s plan, `phase = fix`, chain into `$flow-bug-fix`, which chains back here; rounds go on while each lowers the red count, three at most, and one that does not, or a third still red → `blocked`, naming the tests still red. The original symptom still reproducible in §2.5 is not a failing test: `blocked`, naming it.
100
+ - Red test, regressions, **or the original symptom still reproducible in §2.5** → `phase` stays at `fix`; the user iterates. A red gate stops in every mode except `unattended`, where flow-core §2.1 decides: every failing test also red on the base → its exception advances (the reproduction test lives in a file this diff touches, so it never qualifies); when every test red in HEAD's three runs is a suspect flake — red once in HEAD's three runs, never on the base, outside the files this diff touches, green on their own — those tests get that row's five more HEAD runs, their counts written in `05-validation.md`, and nothing red in them advances with `unattended:validate-flaky` (the reproduction test never qualifies here either); otherwise a repair round of that row — the failing tests become unticked steps of `04-fix.md`'s plan, `phase = fix`, chain into `$flow-bug-fix`, which chains back here; rounds go on while each lowers the red count, three at most, and one that does not, or a third still red → `blocked`, naming the tests still red. The original symptom still reproducible in §2.5 is not a failing test: `blocked`, naming it.
101
101
  - Green → `phase = "validate"`, add to `phases_done`; in the same write record `validated_sha` = `git rev-parse HEAD` — the tree the regression test passed on, which `$flow-bug-ship §0` reads. Suggest `$flow-bug-review`.
102
102
  - **Other bugs detected become `followups[]` entries** (flow-core §7) when they clear its bar — a reproducible symptom with someone who suffers it, not «this looks fragile» — per the output template.
103
103
  - **Stage what the validation taught** (`knowledge.stage` set; silence by default): a mutation that stayed green, a disguise the scenario wore, a fixture that could not produce the case — findings about how this codebase is tested, not about this diff. Same rule and evidence line as the review's Close.
@@ -68,7 +68,8 @@ place it would ask:
68
68
  **In every mode**, criteria `07-validation.md` marks `not-verified-unattended` go into the body under
69
69
  `## Not verified — needs a human`, with what to do for each — and so do the tests the suite left red
70
70
  because they also fail on the base (`unattended:validate-red-base`): each name, and the base sha
71
- where it failed too — and the review findings an orchestrator's answer accepted unfixed
71
+ where it failed too — and the suspect flakes the run advanced past (`unattended:validate-flaky`), one line each:
72
+ `` `<test>` — intermittent: red 1/3 then 0/5 on HEAD, 0/3 on base `<sha>`; not in a file this change touches `` — and the review findings an orchestrator's answer accepted unfixed
72
73
  (`06-review.md` "Answered (unattended)"), one line each. The §3 preview shows that section like
73
74
  any other, and the person reading it is the check the run could not do. Entries of
74
75
  `auto-answers.md` for this MR/PR (`MR/PR <n>` in their heading, or all of them for a work with no
@@ -233,7 +233,10 @@ Write `.claude/work/<TICKET>/07-validation.md`:
233
233
  failing tests on the base the way they went red on HEAD — the whole suite, three runs on each side
234
234
  for a test that is red in the suite and green on its own — and write each name, its result there,
235
235
  the run counts and the base sha under "Suite results" in `07-validation.md`. Calling a failure "pre-existing" without that run is not the
236
- exception — it is a red suite. Short of it, the red suite gets a repair round (the same row):
236
+ exception — it is a red suite. Tests red once in HEAD's three runs, never on the base, outside the
237
+ files this diff touches, green on their own and proving no criterion are suspect flakes: when every test red in HEAD's three runs is one,
238
+ five more whole-suite runs on HEAD decide — nothing red in them → `unattended:validate-flaky`, the
239
+ counts under "Suite results", and the phase advances. Short of it, the red suite gets a repair round (the same row):
237
240
  the failing tests become unticked steps of this MR/PR's plan, `phase = build`, and the run
238
241
  chains into `$flow-feat-build`, then review and this phase again. Rounds go on while each lowers
239
242
  the red count, three at most; one that does not, or a third still red → `blocked`, naming the
@@ -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.103.0`.** Compare it once, at the start of the session, against
19
+ **This file belongs to flow `0.104.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
@@ -425,7 +425,7 @@ person asking for changes, a ticket that already has code — is `/flow:work:run
425
425
  | Writing a DB schema change, index or migration — in any phase, a review's own fixes included — or applying one (`validate`) | question `migration`, before the first line of it is written or run — except in `respond` and `green`, where it is blocked: a schema change agreed after the MR/PR exists goes back through `build`. Writing one whose every object `approved-schema.md` lists is not asked (§2, a schema approved with the study) |
426
426
  | `review` with blockers or high-severity findings | question `high_findings` |
427
427
  | `validate` with a criterion `unproven` | blocked — the phase does not advance and does not chain |
428
- | `validate` with a red suite | **One exception, and it is measured, never judged**: every failing test also fails, under the same name, on the base (`git merge-base HEAD <git.default_base>`, run in a detached worktree), none of them lives in a file this diff touches, and none is the test that proves an acceptance criterion. **The base runs the way HEAD went red**: the same command (the whole suite when the whole suite went red, never the failing file alone), and a test that is red in the whole suite but green on its own is load- or order-dependent, so one run on each side proves nothing — run the whole suite three times on HEAD and three on the base, and write each side's red count and that test's duration in every run. Red on the base as often as on HEAD → the exception holds. Green on the base and red on HEAD, even once in three → this diff made it, whatever a single base run said; its repair step says so, with both sides' counts and how much slower the failing runs were, and the fix is what this diff adds under concurrency (a lock, a pool, a timer, a background loop), never a longer timeout or a retry → record `{"key":"unattended:validate-red-base","default":"<n> red on HEAD and on base <short sha>: <test names>","phase":"validate"}` and advance; `ship` lists those tests under "Not verified — needs a human". Short of that, **repair rounds while they make progress, at most three per MR/PR**: each round is a heading under this MR/PR's plan (`05-implementation.md` / `04-fix.md`), `### Red suite at validate (unattended), round <k>: <n> red`. No such heading yet, or the last one's `<n>` above the count red now and `<k>` below 3 → write the next heading with one unticked step per failing test (its name and the first line of its failure), each ending *fix the code, or update an assertion whose expected value this MR/PR's design or fix changed — never delete, skip or loosen a test*; record `{"key":"unattended:validate-red-loop","default":"round <k>, <n> red: <test names>","phase":"validate"}`, leave `phase = build` (`fix`) and chain into `/flow:feat:build` (`/flow:bug:fix`) — whose steps then run through the phases that follow it as always, review and validate included. A review of that round treats a test the round deleted, skipped or loosened as a blocker. A round that did not lower the count, or a third round still red → blocked, naming the tests still red and the count each round left |
428
+ | `validate` with a red suite | **One exception, and it is measured, never judged**: every failing test also fails, under the same name, on the base (`git merge-base HEAD <git.default_base>`, run in a detached worktree), none of them lives in a file this diff touches, and none is the test that proves an acceptance criterion. **The base runs the way HEAD went red**: the same command (the whole suite when the whole suite went red, never the failing file alone), and a test that is red in the whole suite but green on its own is load- or order-dependent, so one run on each side proves nothing — run the whole suite three times on HEAD and three on the base, and write each side's red count and that test's duration in every run. Red on the base as often as on HEAD → the exception holds: record `{"key":"unattended:validate-red-base","default":"<n> red on HEAD and on base <short sha>: <test names>","phase":"validate"}` and advance; `ship` lists those tests under "Not verified — needs a human". Green on the base and red on HEAD, even once in three → this diff made it, whatever a single base run said (a suspect flake, below, gets five more runs first); its repair step says so, with both sides' counts and how much slower the failing runs were, and the fix is what this diff adds under concurrency (a lock, a pool, a timer, a background loop), never a longer timeout or a retry. **A suspect flake is measured again before it is blamed**: a test red in exactly one of HEAD's three runs (the run that first went red is not one of them), in none of the base's, in a file this diff does not touch, green when run on its own, and not the test that proves an acceptance criterion. When at least one test is red in HEAD's three runs and every such test is one, run the whole suite five more times on HEAD — not on the base, whose three runs already said 0 — and write each run's red tests and the suspects' durations. Nothing red in any of the five → record `{"key":"unattended:validate-flaky","default":"<test name>: red 1/3 then 0/5 on HEAD, 0/3 on base <short sha>","phase":"validate"}` per test and advance; `ship` lists them under "Not verified — needs a human". Anything red in the five, or a red test that is not a suspect → this diff made it, and the repair rounds below follow: every red test, suspects included, goes to the repair rounds and counts in their `<n>`. The five runs are only ever more runs: a test is never rerun alone in their place, retried, skipped or loosened. Short of the exception and of a flake that held, **repair rounds while they make progress, at most three per MR/PR**: each round is a heading under this MR/PR's plan (`05-implementation.md` / `04-fix.md`), `### Red suite at validate (unattended), round <k>: <n> red`. No such heading yet, or the last one's `<n>` above the count red now and `<k>` below 3 → write the next heading with one unticked step per failing test (its name and the first line of its failure), each ending *fix the code, or update an assertion whose expected value this MR/PR's design or fix changed — never delete, skip or loosen a test*; record `{"key":"unattended:validate-red-loop","default":"round <k>, <n> red: <test names>","phase":"validate"}`, leave `phase = build` (`fix`) and chain into `/flow:feat:build` (`/flow:bug:fix`) — whose steps then run through the phases that follow it as always, review and validate included. A review of that round treats a test the round deleted, skipped or loosened as a blocker. A round that did not lower the count, or a third round still red → blocked, naming the tests still red and the count each round left |
429
429
  | A product decision (§7 `decision`) | question `decision` |
430
430
  | Clarifying questions on the ticket (`start`) | question `clarify` — after the branch and the work folder exist, with the questions also written to `01-context.md` |
431
431
  | An unanswered high-severity challenge (`design`, `investigate`) | question `design_challenge` / `investigation_challenge` |
@@ -93,7 +93,7 @@ this is the same gate as a red test.
93
93
 
94
94
  ## 5. Close
95
95
 
96
- - Red test, regressions, **or the original symptom still reproducible in §2.5** → `phase` stays at `fix`; the user iterates. A red gate stops in every mode except `unattended`, where flow-core §2.1 decides: every failing test also red on the base → its exception advances (the reproduction test lives in a file this diff touches, so it never qualifies); otherwise a repair round of that row — the failing tests become unticked steps of `04-fix.md`'s plan, `phase = fix`, chain into `/flow:bug:fix`, which chains back here; rounds go on while each lowers the red count, three at most, and one that does not, or a third still red → `blocked`, naming the tests still red. The original symptom still reproducible in §2.5 is not a failing test: `blocked`, naming it.
96
+ - Red test, regressions, **or the original symptom still reproducible in §2.5** → `phase` stays at `fix`; the user iterates. A red gate stops in every mode except `unattended`, where flow-core §2.1 decides: every failing test also red on the base → its exception advances (the reproduction test lives in a file this diff touches, so it never qualifies); when every test red in HEAD's three runs is a suspect flake — red once in HEAD's three runs, never on the base, outside the files this diff touches, green on their own — those tests get that row's five more HEAD runs, their counts written in `05-validation.md`, and nothing red in them advances with `unattended:validate-flaky` (the reproduction test never qualifies here either); otherwise a repair round of that row — the failing tests become unticked steps of `04-fix.md`'s plan, `phase = fix`, chain into `/flow:bug:fix`, which chains back here; rounds go on while each lowers the red count, three at most, and one that does not, or a third still red → `blocked`, naming the tests still red. The original symptom still reproducible in §2.5 is not a failing test: `blocked`, naming it.
97
97
  - Green → `phase = "validate"`, add to `phases_done`; in the same write record `validated_sha` = `git rev-parse HEAD` — the tree the regression test passed on, which `/flow:bug:ship §0` reads. Suggest `/flow:bug:review`.
98
98
  - **Other bugs detected become `followups[]` entries** (flow-core §7) when they clear its bar — a reproducible symptom with someone who suffers it, not «this looks fragile» — per the output template.
99
99
  - **Stage what the validation taught** (`knowledge.stage` set; silence by default): a mutation that stayed green, a disguise the scenario wore, a fixture that could not produce the case — findings about how this codebase is tested, not about this diff. Same rule and evidence line as the review's Close.
@@ -64,7 +64,8 @@ place it would ask:
64
64
  **In every mode**, criteria `07-validation.md` marks `not-verified-unattended` go into the body under
65
65
  `## Not verified — needs a human`, with what to do for each — and so do the tests the suite left red
66
66
  because they also fail on the base (`unattended:validate-red-base`): each name, and the base sha
67
- where it failed too — and the review findings an orchestrator's answer accepted unfixed
67
+ where it failed too — and the suspect flakes the run advanced past (`unattended:validate-flaky`), one line each:
68
+ `` `<test>` — intermittent: red 1/3 then 0/5 on HEAD, 0/3 on base `<sha>`; not in a file this change touches `` — and the review findings an orchestrator's answer accepted unfixed
68
69
  (`06-review.md` "Answered (unattended)"), one line each. The §3 preview shows that section like
69
70
  any other, and the person reading it is the check the run could not do. Entries of
70
71
  `auto-answers.md` for this MR/PR (`MR/PR <n>` in their heading, or all of them for a work with no
@@ -229,7 +229,10 @@ Write `.claude/work/<TICKET>/07-validation.md`:
229
229
  failing tests on the base the way they went red on HEAD — the whole suite, three runs on each side
230
230
  for a test that is red in the suite and green on its own — and write each name, its result there,
231
231
  the run counts and the base sha under "Suite results" in `07-validation.md`. Calling a failure "pre-existing" without that run is not the
232
- exception — it is a red suite. Short of it, the red suite gets a repair round (the same row):
232
+ exception — it is a red suite. Tests red once in HEAD's three runs, never on the base, outside the
233
+ files this diff touches, green on their own and proving no criterion are suspect flakes: when every test red in HEAD's three runs is one,
234
+ five more whole-suite runs on HEAD decide — nothing red in them → `unattended:validate-flaky`, the
235
+ counts under "Suite results", and the phase advances. Short of it, the red suite gets a repair round (the same row):
233
236
  the failing tests become unticked steps of this MR/PR's plan, `phase = build`, and the run
234
237
  chains into `/flow:feat:build`, then review and this phase again. Rounds go on while each lowers
235
238
  the red count, three at most; one that does not, or a third still red → `blocked`, naming the
@@ -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.103.0`.** Compare it once, at the start of the session, against
20
+ **This file belongs to flow `0.104.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
@@ -426,7 +426,7 @@ person asking for changes, a ticket that already has code — is `/flow-work-run
426
426
  | Writing a DB schema change, index or migration — in any phase, a review's own fixes included — or applying one (`validate`) | question `migration`, before the first line of it is written or run — except in `respond` and `green`, where it is blocked: a schema change agreed after the MR/PR exists goes back through `build`. Writing one whose every object `approved-schema.md` lists is not asked (§2, a schema approved with the study) |
427
427
  | `review` with blockers or high-severity findings | question `high_findings` |
428
428
  | `validate` with a criterion `unproven` | blocked — the phase does not advance and does not chain |
429
- | `validate` with a red suite | **One exception, and it is measured, never judged**: every failing test also fails, under the same name, on the base (`git merge-base HEAD <git.default_base>`, run in a detached worktree), none of them lives in a file this diff touches, and none is the test that proves an acceptance criterion. **The base runs the way HEAD went red**: the same command (the whole suite when the whole suite went red, never the failing file alone), and a test that is red in the whole suite but green on its own is load- or order-dependent, so one run on each side proves nothing — run the whole suite three times on HEAD and three on the base, and write each side's red count and that test's duration in every run. Red on the base as often as on HEAD → the exception holds. Green on the base and red on HEAD, even once in three → this diff made it, whatever a single base run said; its repair step says so, with both sides' counts and how much slower the failing runs were, and the fix is what this diff adds under concurrency (a lock, a pool, a timer, a background loop), never a longer timeout or a retry → record `{"key":"unattended:validate-red-base","default":"<n> red on HEAD and on base <short sha>: <test names>","phase":"validate"}` and advance; `ship` lists those tests under "Not verified — needs a human". Short of that, **repair rounds while they make progress, at most three per MR/PR**: each round is a heading under this MR/PR's plan (`05-implementation.md` / `04-fix.md`), `### Red suite at validate (unattended), round <k>: <n> red`. No such heading yet, or the last one's `<n>` above the count red now and `<k>` below 3 → write the next heading with one unticked step per failing test (its name and the first line of its failure), each ending *fix the code, or update an assertion whose expected value this MR/PR's design or fix changed — never delete, skip or loosen a test*; record `{"key":"unattended:validate-red-loop","default":"round <k>, <n> red: <test names>","phase":"validate"}`, leave `phase = build` (`fix`) and chain into `/flow-feat-build` (`/flow-bug-fix`) — whose steps then run through the phases that follow it as always, review and validate included. A review of that round treats a test the round deleted, skipped or loosened as a blocker. A round that did not lower the count, or a third round still red → blocked, naming the tests still red and the count each round left |
429
+ | `validate` with a red suite | **One exception, and it is measured, never judged**: every failing test also fails, under the same name, on the base (`git merge-base HEAD <git.default_base>`, run in a detached worktree), none of them lives in a file this diff touches, and none is the test that proves an acceptance criterion. **The base runs the way HEAD went red**: the same command (the whole suite when the whole suite went red, never the failing file alone), and a test that is red in the whole suite but green on its own is load- or order-dependent, so one run on each side proves nothing — run the whole suite three times on HEAD and three on the base, and write each side's red count and that test's duration in every run. Red on the base as often as on HEAD → the exception holds: record `{"key":"unattended:validate-red-base","default":"<n> red on HEAD and on base <short sha>: <test names>","phase":"validate"}` and advance; `ship` lists those tests under "Not verified — needs a human". Green on the base and red on HEAD, even once in three → this diff made it, whatever a single base run said (a suspect flake, below, gets five more runs first); its repair step says so, with both sides' counts and how much slower the failing runs were, and the fix is what this diff adds under concurrency (a lock, a pool, a timer, a background loop), never a longer timeout or a retry. **A suspect flake is measured again before it is blamed**: a test red in exactly one of HEAD's three runs (the run that first went red is not one of them), in none of the base's, in a file this diff does not touch, green when run on its own, and not the test that proves an acceptance criterion. When at least one test is red in HEAD's three runs and every such test is one, run the whole suite five more times on HEAD — not on the base, whose three runs already said 0 — and write each run's red tests and the suspects' durations. Nothing red in any of the five → record `{"key":"unattended:validate-flaky","default":"<test name>: red 1/3 then 0/5 on HEAD, 0/3 on base <short sha>","phase":"validate"}` per test and advance; `ship` lists them under "Not verified — needs a human". Anything red in the five, or a red test that is not a suspect → this diff made it, and the repair rounds below follow: every red test, suspects included, goes to the repair rounds and counts in their `<n>`. The five runs are only ever more runs: a test is never rerun alone in their place, retried, skipped or loosened. Short of the exception and of a flake that held, **repair rounds while they make progress, at most three per MR/PR**: each round is a heading under this MR/PR's plan (`05-implementation.md` / `04-fix.md`), `### Red suite at validate (unattended), round <k>: <n> red`. No such heading yet, or the last one's `<n>` above the count red now and `<k>` below 3 → write the next heading with one unticked step per failing test (its name and the first line of its failure), each ending *fix the code, or update an assertion whose expected value this MR/PR's design or fix changed — never delete, skip or loosen a test*; record `{"key":"unattended:validate-red-loop","default":"round <k>, <n> red: <test names>","phase":"validate"}`, leave `phase = build` (`fix`) and chain into `/flow-feat-build` (`/flow-bug-fix`) — whose steps then run through the phases that follow it as always, review and validate included. A review of that round treats a test the round deleted, skipped or loosened as a blocker. A round that did not lower the count, or a third round still red → blocked, naming the tests still red and the count each round left |
430
430
  | A product decision (§7 `decision`) | question `decision` |
431
431
  | Clarifying questions on the ticket (`start`) | question `clarify` — after the branch and the work folder exist, with the questions also written to `01-context.md` |
432
432
  | An unanswered high-severity challenge (`design`, `investigate`) | question `design_challenge` / `investigation_challenge` |
@@ -97,7 +97,7 @@ this is the same gate as a red test.
97
97
 
98
98
  ## 5. Close
99
99
 
100
- - Red test, regressions, **or the original symptom still reproducible in §2.5** → `phase` stays at `fix`; the user iterates. A red gate stops in every mode except `unattended`, where flow-core §2.1 decides: every failing test also red on the base → its exception advances (the reproduction test lives in a file this diff touches, so it never qualifies); otherwise a repair round of that row — the failing tests become unticked steps of `04-fix.md`'s plan, `phase = fix`, chain into `/flow-bug-fix`, which chains back here; rounds go on while each lowers the red count, three at most, and one that does not, or a third still red → `blocked`, naming the tests still red. The original symptom still reproducible in §2.5 is not a failing test: `blocked`, naming it.
100
+ - Red test, regressions, **or the original symptom still reproducible in §2.5** → `phase` stays at `fix`; the user iterates. A red gate stops in every mode except `unattended`, where flow-core §2.1 decides: every failing test also red on the base → its exception advances (the reproduction test lives in a file this diff touches, so it never qualifies); when every test red in HEAD's three runs is a suspect flake — red once in HEAD's three runs, never on the base, outside the files this diff touches, green on their own — those tests get that row's five more HEAD runs, their counts written in `05-validation.md`, and nothing red in them advances with `unattended:validate-flaky` (the reproduction test never qualifies here either); otherwise a repair round of that row — the failing tests become unticked steps of `04-fix.md`'s plan, `phase = fix`, chain into `/flow-bug-fix`, which chains back here; rounds go on while each lowers the red count, three at most, and one that does not, or a third still red → `blocked`, naming the tests still red. The original symptom still reproducible in §2.5 is not a failing test: `blocked`, naming it.
101
101
  - Green → `phase = "validate"`, add to `phases_done`; in the same write record `validated_sha` = `git rev-parse HEAD` — the tree the regression test passed on, which `/flow-bug-ship §0` reads. Suggest `/flow-bug-review`.
102
102
  - **Other bugs detected become `followups[]` entries** (flow-core §7) when they clear its bar — a reproducible symptom with someone who suffers it, not «this looks fragile» — per the output template.
103
103
  - **Stage what the validation taught** (`knowledge.stage` set; silence by default): a mutation that stayed green, a disguise the scenario wore, a fixture that could not produce the case — findings about how this codebase is tested, not about this diff. Same rule and evidence line as the review's Close.
@@ -68,7 +68,8 @@ place it would ask:
68
68
  **In every mode**, criteria `07-validation.md` marks `not-verified-unattended` go into the body under
69
69
  `## Not verified — needs a human`, with what to do for each — and so do the tests the suite left red
70
70
  because they also fail on the base (`unattended:validate-red-base`): each name, and the base sha
71
- where it failed too — and the review findings an orchestrator's answer accepted unfixed
71
+ where it failed too — and the suspect flakes the run advanced past (`unattended:validate-flaky`), one line each:
72
+ `` `<test>` — intermittent: red 1/3 then 0/5 on HEAD, 0/3 on base `<sha>`; not in a file this change touches `` — and the review findings an orchestrator's answer accepted unfixed
72
73
  (`06-review.md` "Answered (unattended)"), one line each. The §3 preview shows that section like
73
74
  any other, and the person reading it is the check the run could not do. Entries of
74
75
  `auto-answers.md` for this MR/PR (`MR/PR <n>` in their heading, or all of them for a work with no
@@ -233,7 +233,10 @@ Write `.claude/work/<TICKET>/07-validation.md`:
233
233
  failing tests on the base the way they went red on HEAD — the whole suite, three runs on each side
234
234
  for a test that is red in the suite and green on its own — and write each name, its result there,
235
235
  the run counts and the base sha under "Suite results" in `07-validation.md`. Calling a failure "pre-existing" without that run is not the
236
- exception — it is a red suite. Short of it, the red suite gets a repair round (the same row):
236
+ exception — it is a red suite. Tests red once in HEAD's three runs, never on the base, outside the
237
+ files this diff touches, green on their own and proving no criterion are suspect flakes: when every test red in HEAD's three runs is one,
238
+ five more whole-suite runs on HEAD decide — nothing red in them → `unattended:validate-flaky`, the
239
+ counts under "Suite results", and the phase advances. Short of it, the red suite gets a repair round (the same row):
237
240
  the failing tests become unticked steps of this MR/PR's plan, `phase = build`, and the run
238
241
  chains into `/flow-feat-build`, then review and this phase again. Rounds go on while each lowers
239
242
  the red count, three at most; one that does not, or a third still red → `blocked`, naming the
@@ -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.103.0`.** Compare it once, at the start of the session, against
19
+ **This file belongs to flow `0.104.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
@@ -425,7 +425,7 @@ person asking for changes, a ticket that already has code — is `/flow-work-run
425
425
  | Writing a DB schema change, index or migration — in any phase, a review's own fixes included — or applying one (`validate`) | question `migration`, before the first line of it is written or run — except in `respond` and `green`, where it is blocked: a schema change agreed after the MR/PR exists goes back through `build`. Writing one whose every object `approved-schema.md` lists is not asked (§2, a schema approved with the study) |
426
426
  | `review` with blockers or high-severity findings | question `high_findings` |
427
427
  | `validate` with a criterion `unproven` | blocked — the phase does not advance and does not chain |
428
- | `validate` with a red suite | **One exception, and it is measured, never judged**: every failing test also fails, under the same name, on the base (`git merge-base HEAD <git.default_base>`, run in a detached worktree), none of them lives in a file this diff touches, and none is the test that proves an acceptance criterion. **The base runs the way HEAD went red**: the same command (the whole suite when the whole suite went red, never the failing file alone), and a test that is red in the whole suite but green on its own is load- or order-dependent, so one run on each side proves nothing — run the whole suite three times on HEAD and three on the base, and write each side's red count and that test's duration in every run. Red on the base as often as on HEAD → the exception holds. Green on the base and red on HEAD, even once in three → this diff made it, whatever a single base run said; its repair step says so, with both sides' counts and how much slower the failing runs were, and the fix is what this diff adds under concurrency (a lock, a pool, a timer, a background loop), never a longer timeout or a retry → record `{"key":"unattended:validate-red-base","default":"<n> red on HEAD and on base <short sha>: <test names>","phase":"validate"}` and advance; `ship` lists those tests under "Not verified — needs a human". Short of that, **repair rounds while they make progress, at most three per MR/PR**: each round is a heading under this MR/PR's plan (`05-implementation.md` / `04-fix.md`), `### Red suite at validate (unattended), round <k>: <n> red`. No such heading yet, or the last one's `<n>` above the count red now and `<k>` below 3 → write the next heading with one unticked step per failing test (its name and the first line of its failure), each ending *fix the code, or update an assertion whose expected value this MR/PR's design or fix changed — never delete, skip or loosen a test*; record `{"key":"unattended:validate-red-loop","default":"round <k>, <n> red: <test names>","phase":"validate"}`, leave `phase = build` (`fix`) and chain into `/flow-feat-build` (`/flow-bug-fix`) — whose steps then run through the phases that follow it as always, review and validate included. A review of that round treats a test the round deleted, skipped or loosened as a blocker. A round that did not lower the count, or a third round still red → blocked, naming the tests still red and the count each round left |
428
+ | `validate` with a red suite | **One exception, and it is measured, never judged**: every failing test also fails, under the same name, on the base (`git merge-base HEAD <git.default_base>`, run in a detached worktree), none of them lives in a file this diff touches, and none is the test that proves an acceptance criterion. **The base runs the way HEAD went red**: the same command (the whole suite when the whole suite went red, never the failing file alone), and a test that is red in the whole suite but green on its own is load- or order-dependent, so one run on each side proves nothing — run the whole suite three times on HEAD and three on the base, and write each side's red count and that test's duration in every run. Red on the base as often as on HEAD → the exception holds: record `{"key":"unattended:validate-red-base","default":"<n> red on HEAD and on base <short sha>: <test names>","phase":"validate"}` and advance; `ship` lists those tests under "Not verified — needs a human". Green on the base and red on HEAD, even once in three → this diff made it, whatever a single base run said (a suspect flake, below, gets five more runs first); its repair step says so, with both sides' counts and how much slower the failing runs were, and the fix is what this diff adds under concurrency (a lock, a pool, a timer, a background loop), never a longer timeout or a retry. **A suspect flake is measured again before it is blamed**: a test red in exactly one of HEAD's three runs (the run that first went red is not one of them), in none of the base's, in a file this diff does not touch, green when run on its own, and not the test that proves an acceptance criterion. When at least one test is red in HEAD's three runs and every such test is one, run the whole suite five more times on HEAD — not on the base, whose three runs already said 0 — and write each run's red tests and the suspects' durations. Nothing red in any of the five → record `{"key":"unattended:validate-flaky","default":"<test name>: red 1/3 then 0/5 on HEAD, 0/3 on base <short sha>","phase":"validate"}` per test and advance; `ship` lists them under "Not verified — needs a human". Anything red in the five, or a red test that is not a suspect → this diff made it, and the repair rounds below follow: every red test, suspects included, goes to the repair rounds and counts in their `<n>`. The five runs are only ever more runs: a test is never rerun alone in their place, retried, skipped or loosened. Short of the exception and of a flake that held, **repair rounds while they make progress, at most three per MR/PR**: each round is a heading under this MR/PR's plan (`05-implementation.md` / `04-fix.md`), `### Red suite at validate (unattended), round <k>: <n> red`. No such heading yet, or the last one's `<n>` above the count red now and `<k>` below 3 → write the next heading with one unticked step per failing test (its name and the first line of its failure), each ending *fix the code, or update an assertion whose expected value this MR/PR's design or fix changed — never delete, skip or loosen a test*; record `{"key":"unattended:validate-red-loop","default":"round <k>, <n> red: <test names>","phase":"validate"}`, leave `phase = build` (`fix`) and chain into `/flow-feat-build` (`/flow-bug-fix`) — whose steps then run through the phases that follow it as always, review and validate included. A review of that round treats a test the round deleted, skipped or loosened as a blocker. A round that did not lower the count, or a third round still red → blocked, naming the tests still red and the count each round left |
429
429
  | A product decision (§7 `decision`) | question `decision` |
430
430
  | Clarifying questions on the ticket (`start`) | question `clarify` — after the branch and the work folder exist, with the questions also written to `01-context.md` |
431
431
  | An unanswered high-severity challenge (`design`, `investigate`) | question `design_challenge` / `investigation_challenge` |
@@ -95,7 +95,7 @@ this is the same gate as a red test.
95
95
 
96
96
  ## 5. Close
97
97
 
98
- - Red test, regressions, **or the original symptom still reproducible in §2.5** → `phase` stays at `fix`; the user iterates. A red gate stops in every mode except `unattended`, where flow-core §2.1 decides: every failing test also red on the base → its exception advances (the reproduction test lives in a file this diff touches, so it never qualifies); otherwise a repair round of that row — the failing tests become unticked steps of `04-fix.md`'s plan, `phase = fix`, chain into `/flow-bug-fix`, which chains back here; rounds go on while each lowers the red count, three at most, and one that does not, or a third still red → `blocked`, naming the tests still red. The original symptom still reproducible in §2.5 is not a failing test: `blocked`, naming it.
98
+ - Red test, regressions, **or the original symptom still reproducible in §2.5** → `phase` stays at `fix`; the user iterates. A red gate stops in every mode except `unattended`, where flow-core §2.1 decides: every failing test also red on the base → its exception advances (the reproduction test lives in a file this diff touches, so it never qualifies); when every test red in HEAD's three runs is a suspect flake — red once in HEAD's three runs, never on the base, outside the files this diff touches, green on their own — those tests get that row's five more HEAD runs, their counts written in `05-validation.md`, and nothing red in them advances with `unattended:validate-flaky` (the reproduction test never qualifies here either); otherwise a repair round of that row — the failing tests become unticked steps of `04-fix.md`'s plan, `phase = fix`, chain into `/flow-bug-fix`, which chains back here; rounds go on while each lowers the red count, three at most, and one that does not, or a third still red → `blocked`, naming the tests still red. The original symptom still reproducible in §2.5 is not a failing test: `blocked`, naming it.
99
99
  - Green → `phase = "validate"`, add to `phases_done`; in the same write record `validated_sha` = `git rev-parse HEAD` — the tree the regression test passed on, which `/flow-bug-ship §0` reads. Suggest `/flow-bug-review`.
100
100
  - **Other bugs detected become `followups[]` entries** (flow-core §7) when they clear its bar — a reproducible symptom with someone who suffers it, not «this looks fragile» — per the output template.
101
101
  - **Stage what the validation taught** (`knowledge.stage` set; silence by default): a mutation that stayed green, a disguise the scenario wore, a fixture that could not produce the case — findings about how this codebase is tested, not about this diff. Same rule and evidence line as the review's Close.
@@ -66,7 +66,8 @@ place it would ask:
66
66
  **In every mode**, criteria `07-validation.md` marks `not-verified-unattended` go into the body under
67
67
  `## Not verified — needs a human`, with what to do for each — and so do the tests the suite left red
68
68
  because they also fail on the base (`unattended:validate-red-base`): each name, and the base sha
69
- where it failed too — and the review findings an orchestrator's answer accepted unfixed
69
+ where it failed too — and the suspect flakes the run advanced past (`unattended:validate-flaky`), one line each:
70
+ `` `<test>` — intermittent: red 1/3 then 0/5 on HEAD, 0/3 on base `<sha>`; not in a file this change touches `` — and the review findings an orchestrator's answer accepted unfixed
70
71
  (`06-review.md` "Answered (unattended)"), one line each. The §3 preview shows that section like
71
72
  any other, and the person reading it is the check the run could not do. Entries of
72
73
  `auto-answers.md` for this MR/PR (`MR/PR <n>` in their heading, or all of them for a work with no
@@ -231,7 +231,10 @@ Write `.claude/work/<TICKET>/07-validation.md`:
231
231
  failing tests on the base the way they went red on HEAD — the whole suite, three runs on each side
232
232
  for a test that is red in the suite and green on its own — and write each name, its result there,
233
233
  the run counts and the base sha under "Suite results" in `07-validation.md`. Calling a failure "pre-existing" without that run is not the
234
- exception — it is a red suite. Short of it, the red suite gets a repair round (the same row):
234
+ exception — it is a red suite. Tests red once in HEAD's three runs, never on the base, outside the
235
+ files this diff touches, green on their own and proving no criterion are suspect flakes: when every test red in HEAD's three runs is one,
236
+ five more whole-suite runs on HEAD decide — nothing red in them → `unattended:validate-flaky`, the
237
+ counts under "Suite results", and the phase advances. Short of it, the red suite gets a repair round (the same row):
235
238
  the failing tests become unticked steps of this MR/PR's plan, `phase = build`, and the run
236
239
  chains into `/flow-feat-build`, then review and this phase again. Rounds go on while each lowers
237
240
  the red count, three at most; one that does not, or a third still red → `blocked`, naming the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flow-workflows",
3
- "version": "0.103.0",
3
+ "version": "0.104.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.103.0",
6
+ "version": "0.104.0",
7
7
  "author": {
8
8
  "name": "Alberto Vioque",
9
9
  "email": "mashware@gmail.com"
@@ -5,6 +5,21 @@ 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.104.0 — A flaky test outside your change no longer blocks an unattended run · 2026-10-31
9
+
10
+ **In short**
11
+ - **A once-in-three red is measured again before it is blamed.** In `unattended`, a test that went red in one of
12
+ HEAD's three suite runs and none of the base's, in a file the change does not touch and proving no acceptance
13
+ criterion, is a suspect flake. When every red test is one, the whole suite runs five more times on HEAD.
14
+ - **Five clean runs → the run advances**, records `unattended:validate-flaky`, and the draft MR/PR lists each test
15
+ under "Not verified — needs a human" with both sides' counts.
16
+ - **Anything red in those five, or any other red test → the repair rounds, as before.** Tests are never rerun alone,
17
+ retried, skipped or loosened. Bug runs follow the same rule; no other mode changes.
18
+
19
+ Until now one red in three on HEAD against none on the base meant "this change made it". A test failing one time in
20
+ ten lands there about a quarter of the time, so runs spent their repair rounds on code that was not broken and then
21
+ blocked. With the five extra runs, that same test blocks about one run in ten.
22
+
8
23
  ## v0.103.0 — The project's roadmap: flow reads where you are and ticks off what ships · 2026-10-29
9
24
 
10
25
  **In short**