pi-dev-flow 0.85.1 → 0.86.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-dev-flow",
3
- "version": "0.85.1",
3
+ "version": "0.86.0",
4
4
  "description": "Enforced feature workflow for Pi: plan → implement → pre-release → release, gated checkpoints, self-improvement reflections, one git worktree per feature, changelog + publish as part of the release",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -10,88 +10,65 @@ description: >
10
10
 
11
11
  <!-- dev-flow:core:start -->
12
12
 
13
- # dev-flow: the stage-by-stage playbook
13
+ # dev-flow: ground rules
14
14
 
15
- Only the **flow tool** advances stages, and each gate refuses until its exit
16
- criteria hold. Drive it with args arrays — `["start", "dark-mode"]`,
17
- `["test"]`, `["status"]`.
15
+ Only the **flow tool** advances stages; each gate refuses until its exit
16
+ criteria hold. Call it with an args array — `["start", "dark-mode"]`,
17
+ `["check"]`, `["status"]`.
18
18
 
19
- Ground rules:
20
-
21
- - **The flow tool is the only invocation.** `flow` is **not a shell command**: a
22
- bash call named `flow` has no binary behind it (the guard refuses it and names
23
- the tool call) — never reach for bash, `npx`, or a path to run a gate.
24
- - **You run the gates; the operator says words.** Ask the checkpoint word in
25
- chat, then run the gate yourself. **Checkpoints are one verb: Approve? /
26
- Verified? / Release? / Finish?** — ask exactly that word as a **plain chat
27
- message**, mention that **yolo** is an available answer, and stop. The same
28
- verb (or an explicit equivalent) in chat is the answer; then run that gate
29
- with `--confirmed` — zero dialogs, **exactly one checkpoint per stage**. A
30
- structured question tool is not chat and never
31
- licenses `--confirmed`; never infer the answer. Never ask the operator to type
32
- a `/flow ...` command: `/flow` is their **manual override** — surface it only
33
- when the session is demonstrably wrong, stuck, or claiming a gate result it
34
- never ran (and `/reload` when `flow version` says this session runs an older
35
- build).
36
- - **Stage reports** — a gate message = a **stage line** (statusbar glyph 💬 pre-flow / 📝 / 🔨 / 🔍 / 🚀 / 🏁
37
- + slug + `·`-separated decision fields, provenance-marked `✓` operator · `✓playbook`/`✓detected` rule
38
- · `~` agent-assumed · `?` pending; never fenced; undecided reads `pending`, never invented) + event
39
- title + **`Done:`**/**`Next steps:`** on own lines: verbs italic (***bold italic*** = recommended),
40
- no gate commands; recommended first, *yolo* last, plain closing line
41
- "or say what to do differently". Long form: docs/playbook.md;
42
- per-stage fields: the stage reference file.
43
- - **yolo** at any checkpoint → run that gate `--yolo --confirmed`; every later
44
- checkpoint is pre-confirmed — run the remaining gates back to back without
45
- asking, honoring guidance attached to the word ("yolo, create a patch
46
- version release" → bump patch; "yolo, no tag" → `--no-version`); a
47
- NEEDS-OPERATOR is still asked. Yolo never
48
- skips a gate: merge/tag/publish follow `flow release`. Checks and
49
- guardrails stay fully enforced — a flow-guard `confirm` rule still asks the
50
- operator.
51
- - At Release?, choosing **no version/tag for this flow** →
52
- `flow release --no-version --confirmed` — the merge still owes a changelog
53
- entry under `Unreleased`, which the next versioned release folds under its
54
- version heading (default is versioned: bump + tag).
55
- - **One session = exactly one feature** (flow + branch + worktree); parallel
56
- sessions, one feature each, are the model. A session binds **explicitly and
57
- only**: `flow start <slug>` binds its own feature; `flow use <slug>` takes
58
- one over. Nothing auto-binds. Unbound: gates demand an explicit slug and main-checkout writes stay
59
- blocked — there is no bypass, an unbound session cannot edit source.
60
- - **Project `flow-guard` rules** (`deny`/`confirm`/`protect`/`forbid` in
61
- project.md `## global`) apply at **every** stage and are judged ahead of
62
- dev-flow's verdicts — operator safety rules, not flow discipline. When one
63
- fires, its reason is the answer: stop, show it, let the operator decide;
64
- never route around it.
65
- - **`.dev-flow/<slug>/state.json` is flow-owned** — never read or write it;
66
- `flow status` is your view. **project.md is the operator-owned playbook**:
67
- read freely, **never edit** — it changes through `flow init --write` on the
68
- operator's word.
69
- - **A guard blocking you means you are skipping a stage or writing outside your
70
- feature** — run the gate instead of working around it. The guard reads
71
- **commands**: quoted text is an argument's prose (a PR body discussing a
72
- commit is not a commit), and a wrapper that execs its argument
73
- (`sh -c "git push origin main"`) is judged on its payload.
74
- - **Every bash call has a timeout**: none stated → dev-flow arms its class
75
- default (quick 30s … build 900s, a `timeout N` wrapper → N+15s). Pass
76
- `timeout` (seconds) when a run needs longer.
77
- - Abandon a feature with `flow abort <slug>` — never unbind by hand. A gate
78
- refusal lists exactly what is missing: fix that, rerun the gate.
79
- - Also obey the repo's own AGENTS.md and project skills: dev-flow sequences
80
- stages, the project defines its conventions.
19
+ - **The flow tool is the only invocation.** There is no `flow` shell command —
20
+ never bash, `npx` or a path.
21
+ - **You run the gates; the operator says words.** Never ask the operator to
22
+ type a `flow` or `/flow` command. A checkpoint is one word asked in plain
23
+ chat — **Approve? / Verified? / Release? / Finish?** — mentioning that
24
+ *yolo* is an answer, then stop. Their word (or a clear equivalent) in chat →
25
+ run that gate with `--confirmed`. A structured question tool is not chat;
26
+ never infer the answer. A gate returning `NEEDS-OPERATOR <Question?>` means:
27
+ ask exactly that, in chat. `/flow` is the operator's own override; mention it
28
+ only when the session is demonstrably stuck or wrong (and `/reload` when
29
+ `flow version` says this session runs an older build).
30
+ - **Stage reports** — open every report with the **stage line the gate
31
+ returned** (`stage line for your report`), pasted as is — the gate builds it
32
+ from state. A checkpoint message then has an event title and, on their own
33
+ lines, **`Done:`** (paths, SHAs, counts) and **`Next steps:`** — the
34
+ operator's options as italic verbs, the recommended one ***bold italic***
35
+ first, *yolo* last with what it pre-confirms, then the line
36
+ "or say what to do differently". Plain markdown, never fenced, never a gate
37
+ command.
38
+ - **yolo** at a checkpoint → that gate with `--yolo --confirmed`; run the
39
+ remaining gates back to back without asking, honoring guidance attached to
40
+ the word ("yolo, patch bump", "yolo, no tag" → `--no-version`). Checks,
41
+ guard rules and any `NEEDS-OPERATOR` still apply.
42
+ - **One session = one feature** (flow + branch + worktree). `flow start <slug>`
43
+ binds a new one, `flow use <slug>` takes one over; nothing auto-binds, and an
44
+ unbound session cannot edit source.
45
+ - **Project `flow-guard` rules** apply at every stage, ahead of dev-flow's own.
46
+ When one fires, show its reason and let the operator decide.
47
+ - **Hands off**: never read or write `.dev-flow/<slug>/state.json` (`flow
48
+ status` is your view); never edit `project.md` (it changes through `flow
49
+ init` on the operator's word, or inside a docs/patch flow).
50
+ - **A guard blocking you means you skipped a stage or wrote outside your
51
+ feature** — run the gate instead of working around it. A refusal lists what
52
+ is missing: fix that, rerun.
53
+ - **Every bash call has a timeout** (class default when unstated); pass
54
+ `timeout` (seconds) for longer runs.
55
+ - Abandon a feature with `flow abort <slug>`. The repo's own AGENTS.md and
56
+ project skills still apply.
81
57
 
82
58
  <!-- dev-flow:core:end -->
83
59
 
84
60
  ## Which stage you are in
85
61
 
86
- Everything the stage demands lives beside this file, one file per stage: the
87
- session's stage injection names the file to read now, and this is the map.
62
+ The stage injection names the file to read now; this is the map.
88
63
 
89
64
  | Read | For |
90
65
  | --- | --- |
91
- | `references/start.md` | `flow init` (no `.dev-flow/` yet), mode grants (`--patch`, `--docs`), playbook ownership |
92
- | `references/plan.md` | plan stage — research, clarify, plan file, mockups, Approve? |
93
- | `references/implement.md` | implement stage — worktree, commits, checks, tier-2 list, Verified? |
94
- | `references/pre-release.md` | pre-release — `/flow-review`, docs, changelog + bump, Release? |
95
- | `references/release.md` | release — PR and merge style, tag, forge release, release-done; hands over to finish |
96
- | `references/finish.md` | the close-out after `release-done` — `flow finish` runs the reflect worker first, fold/drop (= Finish?), then the re-run cleans up |
97
- | `references/reflect.md` | reflections (this project's queue; plugin feedback → upstream issues), when to fix or tidy, and the roadmap backlog |
66
+ | `references/start.md` | `flow init`, starting a feature, modes (`--patch`, `--docs`, `--ui`), merge policy |
67
+ | `references/plan.md` | plan — research, clarify, plan file, mockups, Approve? |
68
+ | `references/implement.md` | implement — worktree, commits, checks, workers, Verified? |
69
+ | `references/pre-release.md` | pre-release — review, docs, changelog + bump, Release? |
70
+ | `references/release.md` | release — PR, CI, merge, tag; hands over to finish |
71
+ | `references/finish.md` | finish — closing reflection, fold/drop, cleanup |
72
+ | `references/reflect.md` | reflections and the roadmap backlog |
73
+
74
+ Why each gate checks what it checks: [docs/gates.md](../../docs/gates.md).
@@ -1,67 +1,50 @@
1
- > Part of the **dev-flow** playbook. The always-on ground rules live in
2
- > [../SKILL.md](../SKILL.md); this file is the detail for one stage — read it
3
- > when the session reaches that stage.
1
+ > Part of the **dev-flow** playbook. Ground rules: [../SKILL.md](../SKILL.md).
4
2
 
5
3
  ## Stage: finish
6
4
 
7
- **`flow finish` reflects before it removes anything** — it deletes
8
- `.dev-flow/<slug>/` and unbinds the session, and a reflection asked for after
9
- that has nothing to run against. So the first `flow finish` (with or without
10
- `--confirmed`) runs the end-of-session reflection itself and stops; cleanup
11
- happens on the re-run:
12
-
13
- 1. `flow finish [--note="<friction the operator mentioned>"]` — while no
14
- reflection is recorded for the flow, it starts the reflect worker (the same
15
- one `flow_stage({ op: "reflect", note })` runs — call that earlier if you
16
- want, and finish skips straight to cleanup). A fresh **read-only** reviewer reads
17
- this session's transcript **and every `flow_stage` worker transcript**,
18
- re-checks the open items in `.dev-flow/reflections.md`, dedupes against them
19
- and the upstream issues, and returns numbered findings, each classified
20
- **docs** (fix only in `project.md` → docs flow), **code** (fix in this
21
- project's code, maybe the playbook too → patch flow) or **plugin** (dev-flow
22
- itself → GitHub issue upstream), with a **fold** or **drop** recommendation.
23
- `note` = anything the operator said about friction this session. The tool
24
- prebuilds a line-tagged digest of every transcript and prefetches the
25
- upstream issues, so the worker reads instead of dumping and searching. If the
26
- worker fails, finish removes nothing: re-run it, or review inline (bare `flow
27
- reflect` prints the protocol). Only the operator's explicit word skips the
28
- reflection — `flow finish --no-reflect --confirmed`; **yolo never does**.
29
- 2. Show the operator the list with your recommendation per item and ask
30
- **fold or drop** for each (`fold 1,3 drop 2` is a fine answer) — then stop.
31
- 3. Apply the answer: fold docs → `flow reflect --playbook "<note>"`; fold code →
32
- `flow reflect --code "<note>"`; fold plugin → `flow reflect --plugin "<note>"`
33
- prints the upstream recipe — search first, then `gh issue create` (the fold
34
- answer is the confirmation; report the URL). **Plugin findings never become
35
- rows in the project's `reflections.md`.** Drop → nothing is recorded. Open
5
+ `flow finish` removes the worktree, branch and `.dev-flow/<slug>/` and
6
+ unbinds the session — so anything that needs them runs first.
7
+
8
+ 1. **`flow finish [--note="<friction the operator mentioned>"]`**
9
+ - Release published but not recorded → it runs the release record first
10
+ (no question).
11
+ - **Closing reflection** — while none is recorded, a read-only worker
12
+ reviews this session's transcript and every worker transcript, dedupes
13
+ against `.dev-flow/reflections.md` and upstream issues, and returns
14
+ numbered findings, each **docs** / **code** / **plugin** with a **fold**
15
+ or **drop** recommendation. Finish then stops.
16
+ - A flow with **no friction** (no refusal, no guard block, no `--note`)
17
+ skips the worker, unless the playbook says `reflect = always`.
18
+ - Worker failed → nothing is removed: re-run, or review inline (bare `flow
19
+ reflect` prints the protocol). Only the operator's explicit word skips
20
+ it: `flow finish --no-reflect --confirmed` — yolo never does.
21
+ 2. **Findings → ask fold or drop** per item, with your recommendation (`fold
22
+ 1,3 drop 2` is a fine answer), and stop. That answer **is** Finish?.
23
+ 3. **Apply it**: fold docs → `flow reflect --playbook "<note>"`; fold code →
24
+ `flow reflect --code "<note>"`; fold plugin → `flow reflect --plugin
25
+ "<note>"` prints the upstream recipe — search first, then `gh issue create`
26
+ and report the URL. Plugin findings never go into `reflections.md`. Open
36
27
  items the reviewer found fixed → propose checking them off.
37
- 4. Offer the fix / tidy suggestions the tool printed (`⚑ fix the open
38
- reflections now?`, `↻ N closed reflection(s)`) — one line each, only when
39
- printed; never start a fix flow without the operator's word.
28
+ 4. **`flow finish --confirmed`** without asking again. Nothing found → ask
29
+ **Finish?** first.
30
+ 5. Offer the printed suggestions (`⚑ fix the open reflections now?`, `↻ N
31
+ closed reflection(s)`) in one line each; never start a fix flow without
32
+ the operator's word.
40
33
 
41
- The fold/drop answer replaces **Finish?** — act on it, then run
42
- `flow finish --confirmed` without asking again. Nothing found → ask the
43
- operator **Finish?** → `flow finish --confirmed`. Never tell the operator the
44
- open items were "classified" or "reviewed" unless the worker's list is what
45
- you are showing.
46
- Checkpoint report: stage line **🏁 finish · `<slug>`** — release recorded ·
47
- main state · unmerged count · reflections open · release-checklist open,
48
- then `Done:`/`Next steps:` per the Stage reports rule.
34
+ Report opening: **🏁 finish · `<slug>`** — release recorded · main state ·
35
+ unmerged count · reflections open · release-checklist open, then `Done:` /
36
+ `Next steps:`. Never say findings were "reviewed" unless you are showing the
37
+ worker's list.
49
38
 
50
- The question covers the whole cleanup and mentions any commits that look
51
- unmerged. `flow finish [slug]`:
39
+ Finish refuses until:
52
40
 
53
- - refuses until `release-done` recorded the release — abandoned features go
54
- through `flow abort` instead;
55
- - requires the main checkout **clean and pushed** — an uncommitted changelog or
56
- a local-only release commit is exactly what it protects against;
57
- - removes the worktree and branch, then deletes `.dev-flow/<slug>/` (its
58
- `tmp/` scratch dir included) and unbinds the session. A feature branch still on `origin` is deleted **only on
59
- proof it was merged** — ancestor of `origin/<default>`, or a merged PR via gh
60
- or glab (what a squash leaves behind); otherwise kept with a note. Uncommitted worktree edits block
61
- finish; commits that never reached the default branch are read against the playbook's `merge` policy —
62
- expected under `squash`/`rebase`, a **violation** under `merge` (which `yolo` cannot answer for), and
63
- called out at Finish? without an operator answer → stop and show them.
41
+ - the release is recorded (abandoned features use `flow abort`);
42
+ - the main checkout is **clean and pushed**;
43
+ - the worktree has no uncommitted edits.
64
44
 
65
- Production deployment stays manual and out of scope: never ask the operator
66
- whether a prod deploy happened.
45
+ Commits not on the default branch are expected under `squash`/`rebase`, a
46
+ **violation** under `merge` (yolo cannot answer it — ask). A remote feature
47
+ branch is deleted only on proof it merged.
67
48
 
49
+ Production deployment is out of scope: never ask whether a prod deploy
50
+ happened.
@@ -1,165 +1,75 @@
1
- > Part of the **dev-flow** playbook. The always-on ground rules live in
2
- > [../SKILL.md](../SKILL.md); this file is the detail for one stage — read it
3
- > when the session reaches that stage.
1
+ > Part of the **dev-flow** playbook. Ground rules: [../SKILL.md](../SKILL.md).
4
2
 
5
3
  ## Stage: implement
6
4
 
7
- Work happens **only in the worktree** the gate created (path in `flow status`
8
- or the injection line) — writes elsewhere are blocked; other sessions'
9
- worktrees are theirs (attribution guards judge every path by its owning
10
- feature).
5
+ Work only in the feature's worktree (path in `flow status` and the stage
6
+ note). Other sessions' worktrees are theirs.
11
7
 
12
- 1. Implement per the approved plan with project conventions and the **stage
13
- guidance injected at stage start** (tier-3 prose — your playbook's
14
- `prose.implement`, or dev-flow's built-in senior-discipline guidance when
15
- the playbook sets none). Commit in the worktree
16
- **as you go** — small reviewable commits; a twelve-file monolith saved for
17
- the end faces review blind and is not crash-safe. The gate enforces the
18
- habit: `flow verify` refuses while the branch holds **no commit** (checks
19
- describe the working tree, so nothing committed means nothing reviewed was
20
- ever recorded; a **release-only flow** — a versioned project whose code is
21
- already on main, unreleased since the last tag — passes with an empty branch,
22
- and its bump is the pre-release commit) and every verify line reports
23
- `commits: N ahead of <default>, M uncommitted path(s)` — uncommitted paths
24
- never block verify, they are what the operator sees they are approving.
25
- 2. Write tests as you go (project framework: the `test` key / `flow-check`
26
- blocks).
27
- Throwaway scripts and scratch output go in `$TMPDIR` (or `mktemp`), not a
28
- hard-coded `/tmp/...`: in a bound session, and in every command a gate runs,
29
- it is `.dev-flow/<slug>/tmp/`, and finish removes it with the feature. The
30
- same commands get that dir as `GIT_CEILING_DIRECTORIES`, so a test fixture
31
- made under it is not inside the checkout (git does not climb out of it).
32
- 3. `flow check` runs every tier-1 check (test, health, named `flow-check`
33
- blocks) and records each against a fingerprint of the worktree; any later
34
- worktree change makes them stale — verify reruns stale checks itself.
35
- 4. UI flag set? An actual browser visual pass (screenshot or the project's
36
- automated pass) — not just a typecheck.
37
- 5. Done means **running and healthy with pre-existing data**, not "compiles":
38
- `commands.seedData` (if set) puts real data in place, the app starts with
39
- the `run` command, and the health check passes — `flow check` covers it
40
- (seedData runs before health) and `flow verify` probes **the deployed app
41
- again**, because the deploy is what has to be proven. Probes retry every 2s
42
- up to `healthWait` (default 30s) — a service needing a moment after its
43
- container starts is not a failed deploy; say so rather than declaring a
44
- healthy deploy broken. Walk the **tier-2 checklist** (`- [ ]`) with the
45
- operator honestly — it cannot be scripted. **Verify is two steps.**
46
- `flow verify` prepares the review: it rebases onto the default branch when
47
- the branch is behind (a conflict aborts and hands it to you), deploys, and
48
- returns `deployed for review` — it never opens a dialog. If another flow
49
- holds the dev port it returns `NEEDS-OPERATOR Dev port?` with the free RAM
50
- and disk instead of deploying: put the options to the operator and re-run
51
- with their answer (`--port=<n>` alongside, or `--replace`). Then look at the
52
- change yourself, keep the app **running** while you ask **Verified?**, and
53
- record the answer with `flow verify --confirmed` — the operator reviews
54
- the live app, so never tear the test server down before the checkpoint is
55
- answered (with no `dev` deploy configured, `flow verify` live-re-probes
56
- `health` itself and refuses while nothing is answering). Checkpoint report: stage line **🔨 implement ·
57
- `<slug>`** — commits `N ahead, M uncommitted` · tier-1 · tier-2 · deploy/
58
- health · `branch@sha`, then `Done:`/`Next steps:` per the Stage reports rule. Fixes = iterate and re-verify; that loop is
59
- free.
8
+ ### Building it
60
9
 
61
- ### Optional: a fresh-session worker (`flow_stage`)
62
-
63
- Big slices can go to a worker so this conversation stays lean; small work and
64
- small fixes are fine inline. **Delegation is a tool, not a rule** — no gate
65
- asks who wrote a commit.
10
+ 1. Follow the approved plan, the project's conventions and the stage guidance
11
+ injected at stage start.
12
+ 2. **Commit as you go** — small reviewable commits. `flow verify` refuses a
13
+ branch with no commit (except a release-only flow: a versioned project
14
+ whose code is already on main, unreleased since the last tag).
15
+ 3. **Write tests as you go.** Scratch files go in `$TMPDIR` / `mktemp` (it is
16
+ `.dev-flow/<slug>/tmp/`, removed at finish) — never a hard-coded `/tmp/...`.
17
+ 4. `flow check` runs every tier-1 check (test, health with seeded data, named
18
+ `flow-check` blocks) and records them against the worktree; any later edit
19
+ makes them stale, and verify reruns stale ones itself.
20
+ 5. UI feature → a real browser visual pass, not just a typecheck.
21
+ 6. Walk the **tier-2 checklist** (`- [ ]` items) with the operator honestly —
22
+ it cannot be scripted.
66
23
 
67
- **The rule of thumb:** delegate a slice when it is in the plan, provable by
68
- `flow check`, needs no operator input, and is large enough (≈4+ files or heavy
69
- reading) that doing it here would crowd out the context you need for verify;
70
- otherwise do it inline. The worker starts fresh and is briefed with the plan,
71
- commits and checks, but it cannot see this chat, cannot ask the operator and
72
- holds no gate.
24
+ ### Verified? — two calls
73
25
 
74
- Delegate when most of these hold:
75
- - **Specifiable** — the slice fits a short `note`; its decisions are in
76
- `plan.md`, not only in chat (write them there first if they are not).
77
- - **Mechanically done** — `flow check` green plus an acceptance criterion you
78
- can state proves it.
79
- - **Broad** — ≈4+ files, a few hundred lines, or a lot of reading this session
80
- will not need again (a mechanical sweep, a new module with its tests, a
81
- migration).
82
- - **Clean boundary** — it does not overlap uncommitted work in progress.
83
- - **Context pressure** — this conversation is past ~40–50% of its window;
84
- delegating beats compacting away detail.
85
- - **Hands-off** — nothing mid-slice needs the operator.
26
+ 1. `flow verify` prepares the review: rebases onto the default branch when
27
+ behind (a conflict aborts and hands it to you), runs build, the `dev`
28
+ deploy and the health probe against what it deployed, and returns
29
+ `NEEDS-OPERATOR Verified?`. It never opens a dialog.
30
+ - Another flow holds the dev port → `NEEDS-OPERATOR Dev port?` with free
31
+ RAM/disk: ask, then re-run with `--port=<n>` or `--replace`.
32
+ - The health probe retries every 2s up to `healthWait` (default 30s); a
33
+ service that needs a moment is not a broken deploy.
34
+ 2. Look at the change yourself, **keep the app running**, ask **Verified?**.
35
+ Report opening: **🔨 implement · `<slug>`** (the gate's stage line).
36
+ 3. Answer → `flow verify --confirmed` (yolo → `--yolo --confirmed`). If the
37
+ default branch moved since the review deploy it refuses: run `flow verify`
38
+ again first. Fixes → iterate and re-verify; that loop is free.
86
39
 
87
- Stay inline when any of these hold:
88
- - **Small** — one or two files, a review finding, a verify follow-up, an
89
- operator tweak: the note would cost more than the change.
90
- - **Context already loaded** — mid-debug, you hold the failure; a handoff
91
- throws that away.
92
- - **Still being decided** — the approach is still moving in chat.
93
- - **Operator-judged** — a UI pass, tier-2 items, anything that ends in a
94
- question to the operator.
95
- - **Integration** — the final wiring and polish before Verified? is yours: you
96
- own verify.
97
- - **Exploratory** — "find out why X": what you learn shapes the next step, and
98
- a worker's summary is lossy.
40
+ Verify lands the feature in **pre-release**. A `--docs` feature runs no
41
+ project command and asks only the question.
99
42
 
100
- Running it: one slice per worker, in sequence — read each returned diff before
101
- briefing the next. Slice along the plan's steps, never into half-working
102
- commits. When workers wrote most of the code, run a `review` before Verified?.
103
- A worker that fails or stalls → take the slice over inline rather than
104
- resending the same note.
43
+ ### The feature grew, or a new problem appeared
105
44
 
106
- - `flow_stage({ op: "implement", note, label })` — a fresh pi session in the
107
- worktree, with read/bash/edit/write, edits and commits one slice. The tool
108
- adds the facts itself: the absolute plan path, the branch's commits, the
109
- uncommitted paths and the project checks. Your `note` is just the slice, plus
110
- any operator answers the worker cannot see. A worker whose turn ends in prose
111
- is nudged to continue, up to twice. A turn that ended in a **model error**
112
- (`model failed: stopReason=error …`) is not nudged: pi already retried it, so
113
- the model is down, not slow. Take the slice or review inline, or retry the
114
- delegation once the provider answers again. On return the tool reruns `flow check` and
115
- lists the new commits and anything uncommitted.
116
- - `flow_stage({ op: "review", note })` — a fresh **read-only** reviewer (at
117
- implement or pre-release): findings plus `verdict: PASS|FAIL`. It is advisory:
118
- no stamp, no gate waits on it. On a non-trivial feature, run one before
119
- Verified?. Fix what is real (inline is fine), and re-review only if the fix
120
- was large.
121
- - `flow_stage({ op: "reflect", note })` — a fresh **read-only** reviewer of this
122
- session's transcripts (driver + every worker), at any stage; its standard
123
- moment is finish (see Stage: finish). It returns classified reflection
124
- findings with fold/drop recommendations and writes nothing.
125
- - One worker at a time per session. The worker holds no flow tool, so gates
126
- and checkpoints stay with you. Its transcript nests under this session in
127
- pi's picker.
128
- - Budget (`budgetMin`; default 60 implement, 30 review, 20 reflect): at 75% the
129
- worker is steered to wrap up and report. A worker cut at the budget is asked
130
- once, with no tools, for its REPORT, so what it found comes back marked
131
- partial instead of being lost.
45
+ - **Same feature, more scope** → stay here, append an `**Added mid-stage:**`
46
+ line to `plan.md`, implement, `flow check` again.
47
+ - **Different problem** → once the operator agrees to split it, park it:
48
+ `flow roadmap add "<title>" --slug=<new-slug> --brief=<notes>`; finish this
49
+ feature, then `flow start <new-slug>` seeds its plan from the brief. Never
50
+ create `.dev-flow/<new-slug>/` by hand.
51
+ - **Plan heavily amended** → show it and get Approve? again in chat; verify
52
+ stays the checkpoint.
132
53
 
133
- `flow verify` re-runs build, runs the `dev` deploy when configured (the
134
- operator reviews the running app; the gate **prints what it ran** —
135
- `build ran (…)` / `dev ran (…)` / `dev: none configured`; the command must
136
- **background and exit**, e.g. `docker compose up -d .` — verify waits and kills
137
- runs past 15 min), re-runs the health probe **against what it just deployed**
138
- (`seedData` first when configured; a failing probe retries every 2s up to
139
- `healthWait`, then refuses the gate reporting its attempts — a pre-deploy PASS
140
- describes a container that no longer exists; no probe prints
141
- `health: none configured` and the doctor flags it), and demands all tier-1
142
- checks green before the single question. With `servedBuild` set it also proves
143
- the app serves the worktree's HEAD, not just that something answers. A
144
- `--confirmed` run refuses when the default branch moved since the review
145
- deploy: run `flow verify` again so the answer covers the tree that ships. The operator's confirm covers the
146
- tier-2 list as a set (hashed; edits reset it). A `--docs` feature prints
147
- `docs mode: project commands skipped` and asks only the verify question.
148
- Verify lands the feature in **pre-release**.
54
+ ### Optional: a fresh-session worker (`flow_stage`)
149
55
 
150
- Mid-stage additions — do not bounce the flow, do not grow it silently:
151
- **this feature grew** → stay at implement, append a `**Added mid-stage:**` line
152
- to `plan.md` (what was asked and how), implement, `flow check` again — edits
153
- make the checks stale, so verify re-covers the addition. **Different problem** →
154
- a spin-off: once the operator agrees to split it, park it in the roadmap with
155
- what you worked out — `flow roadmap add "<title>" --slug=<new-slug>
156
- --brief=<notes>` (or `--brief-file=<path>`; the item records it was split from
157
- this feature) — then finish this feature, and `flow start <new-slug>` (any
158
- session, fresh is fine) seeds the new `plan/plan.md` from the brief. **Never
159
- create `.dev-flow/<new-slug>/` by hand**: a plan dir with no `state.json` is a
160
- ghost no gate picks up (the guard refuses it; `flow start <slug> --confirmed`
161
- adopts one that already exists). Never fold two features into one plan, PR and
162
- verify — the audit trail is the point. **Heavily amended plan** → show it and have the
163
- operator re-approve in chat; verify remains the checkpoint — no reopen command
164
- exists by design.
56
+ Delegate a slice when it is in the plan, provable by `flow check`, needs no
57
+ operator input, and is big (≈4+ files or heavy reading) — especially past
58
+ ~40–50% of this session's context. Stay inline for small fixes, mid-debug
59
+ work, undecided approaches, anything the operator judges, and the final
60
+ wiring before Verified?.
165
61
 
62
+ - `flow_stage({ op: "implement", note, label })` — a fresh pi session in the
63
+ worktree edits and commits one slice. It gets the plan, commits and checks
64
+ itself; your `note` is the slice plus any operator answers. On return it
65
+ reruns `flow check` and lists new commits.
66
+ - `flow_stage({ op: "review", note })` — a read-only reviewer: findings plus
67
+ `verdict: PASS|FAIL`. Advisory. Run one before Verified? on a non-trivial
68
+ feature, and always when workers wrote most of the code.
69
+ - `flow_stage({ op: "reflect", note })` — a read-only review of this session's
70
+ transcripts; finish runs it for you.
71
+ - One worker at a time; read each diff before briefing the next; slice along
72
+ plan steps. A worker that fails or stalls → take the slice inline. A
73
+ `model failed: stopReason=error` means the provider is down, not slow.
74
+ - Budget (`budgetMin`; default 60 implement, 30 review, 20 reflect): steered
75
+ to wrap up at 75%, asked once for its report when cut.