pi-dev-flow 0.72.0 → 0.73.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.72.0",
3
+ "version": "0.73.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": [
@@ -13,7 +13,7 @@ description: >
13
13
  # dev-flow: the stage-by-stage playbook
14
14
 
15
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", "--ui"]`,
16
+ criteria hold. Drive it with args arrays — `["start", "dark-mode"]`,
17
17
  `["test"]`, `["status"]`.
18
18
 
19
19
  Ground rules:
@@ -43,16 +43,14 @@ Ground rules:
43
43
  - **yolo** at any checkpoint → run that gate `--yolo --confirmed`; every later
44
44
  checkpoint is pre-confirmed — run the remaining gates back to back without
45
45
  asking, honoring guidance attached to the word ("yolo, create a patch
46
- version release" → bump patch; "yolo, no tag" → `--no-version`). Checks and
46
+ version release" → bump patch; "yolo, no tag" → `--no-version`). Yolo never
47
+ skips a gate: merge/tag/publish follow `flow release`. Checks and
47
48
  guardrails stay fully enforced — a flow-guard `confirm` rule still asks the
48
49
  operator.
49
50
  - At Release?, choosing **no version/tag for this flow** →
50
51
  `flow release --no-version --confirmed` — the merge still owes a changelog
51
52
  entry under `Unreleased`, which the next versioned release folds under its
52
53
  version heading (default is versioned: bump + tag).
53
- - **Pre-plan before binding:** an unbound session writes **nothing** — bring
54
- findings, questions and a proposed direction + slug/mode, and **ask the
55
- operator to start** (protocol: `references/start.md`).
56
54
  - **One session = exactly one feature** (flow + branch + worktree); parallel
57
55
  sessions, one feature each, are the model. A session binds **explicitly and
58
56
  only**: `flow start <slug>` binds its own feature (main checkout must be on
@@ -69,9 +67,6 @@ Ground rules:
69
67
  `flow status` is your view. **project.md is the operator-owned playbook**:
70
68
  read freely, **never edit** — it changes through `flow init --write` on the
71
69
  operator's word (`flow doctor` reviews what it lacks).
72
- - **At implement the driver drives, a worker writes** — `flow verify` proves the branch's
73
- commits fall inside a `flow_stage` run window (`--docs`/`--patch` stay inline).
74
- - **Every bash/shell call states its own `timeout`** or the guard refuses it.
75
70
  - **A guard blocking you means you are skipping a stage or writing outside your
76
71
  feature** — run the gate instead of working around it. The guard reads
77
72
  **commands**: quoted text is an argument's prose (a PR body discussing a
@@ -91,7 +86,7 @@ session's stage injection names the file to read now, and this is the map.
91
86
 
92
87
  | Read | For |
93
88
  | --- | --- |
94
- | `references/start.md` | pre-plan (unbound: no writes, ask to start), `flow init` (no `.dev-flow/` yet), mode grants (`--patch`, `--docs`), playbook ownership |
89
+ | `references/start.md` | `flow init` (no `.dev-flow/` yet), mode grants (`--patch`, `--docs`), playbook ownership |
95
90
  | `references/plan.md` | plan stage — research, clarify, plan file, mockups, Approve? |
96
91
  | `references/implement.md` | implement stage — worktree, commits, checks, tier-2 list, Verified? |
97
92
  | `references/pre-release.md` | pre-release — `/flow-review`, docs, changelog + bump, Release? |
@@ -5,13 +5,9 @@
5
5
  ## Stage: finish
6
6
 
7
7
  **Reflect before you finish** — `flow finish` deletes `.dev-flow/<slug>/` and
8
- the session context goes with it. **Delegate the review**: `flow_stage { op:
9
- "reflect" }` (legal after `release-done`) hands the whole finished flow — this
10
- session's transcript plus every worker transcript, the plan, live status — to a
11
- fresh reviewer that returns `[playbook]`/`[plugin]`-tagged findings as an
12
- outside view. Park real issues with `flow reflect` (the bare `flow reflect`
13
- self-protocol under *Reflect* is the fallback only when delegation is
14
- impossible); then:
8
+ the session context goes with it. Run the end-of-session reflection (bare
9
+ `flow reflect` protocol under *Reflect*) now and park real issues with
10
+ `flow reflect`; then:
15
11
 
16
12
  - issues parked → ask **Fold? Fix? Drop?** and stop: fold = write the items
17
13
  into `.dev-flow/reflections.md` (your queue), fix = route them now via
@@ -9,36 +9,6 @@ or the injection line) — writes elsewhere are blocked; other sessions'
9
9
  worktrees are theirs (attribution guards judge every path by its owning
10
10
  feature).
11
11
 
12
- **Delegating the stage's work.** Implement **is delegated**: this session does not write the
13
- feature at all — run the work in a disposable worker session with `flow_stage`
14
- (`stage: "implement"`). That is enforced, not advised: the guard refuses a driver's own edit
15
- inside its worktree at implement, and `flow verify` refuses a branch whose commits fall outside a
16
- worker's run window (`.dev-flow/<slug>/stage-sessions/delegations.log` is the record it reads), so
17
- inline work is work that cannot be verified. `--docs` and `--patch` flows are exempt and stay
18
- inline — the operator granted those modes for exactly that. What stays the driver's own: the gates,
19
- the checkpoint, `flow check`, running the app. The
20
- worker gets a fresh context holding the plan, live git and `flow status
21
- --json` — it keeps nothing from this conversation, so put every operator
22
- answer, decision, warning and the exact next action into `note`, and a short
23
- `label` — a few words of purpose — so the picker reads `⏳ 🔨 #2 · wire ops` and,
24
- when it ends, `✓ 🔨 #2 · 3 commits · wire ops` (a verify: `✓ 🔍 #3 · PASS · <label>`)
25
- instead of a column of identical rows. The worker
26
- may edit and commit in the worktree but holds no flow tool: gates,
27
- checkpoints and the claim stay with you. When it returns, digest its stage
28
- report (done/files/notes/blockers — a handoff, never a verification), rerun
29
- `flow check` (its edits invalidated tier-1 records), and delegate the remaining
30
- loose ends too — a second `run` worker is how a tail gets finished, there is no inline allowance to fall back to. A missing report block or a crashed worker means the
31
- worktree is mid-stage: read the transcript path and (if it names one) the
32
- snapshot `.diff` the result gives. Every slice goes out, the small ones with the big ones. One worker per session at a
33
- time — but **sequential re-delegation is legal and often right**: a second
34
- worker whose `note` says what the first one proved is how a big stage is
35
- sliced. While one runs, the **tool card streams the worker's live output into
36
- your transcript** (current tool, last assistant line, ✓/✗ results, clock against budget,
37
- usage); the footer beats progress, the worker is visible as a
38
- named session in the picker, and `flow_stage { op: "status" }` answers “how’s it
39
- going?” without a model call on any host (the tail also mirrors to `stage-live.log`). Size `budgetMin` to the slice (default 45; verify/reflect default 30): at 75%
40
- the worker is steered to commit and report rather than cut off.
41
-
42
12
  1. Implement per the approved plan with project conventions and the **stage
43
13
  guidance injected at stage start** (tier-3 prose — your playbook's
44
14
  `prose.implement`, or dev-flow's built-in senior-discipline guidance when
@@ -57,16 +27,7 @@ the worker is steered to commit and report rather than cut off.
57
27
  the tier-2 confirmation — rerun before verify.
58
28
  4. UI flag set? An actual browser visual pass (screenshot or the project's
59
29
  automated pass) — not just a typecheck.
60
- 5. **The independent checker speaks before the operator does:** `flow_stage { op: "verify" }`
61
- runs a read-only reviewer (toolset read + bash, standing order *check, don't fix*) over the
62
- plan and the branch diff; it closes with a `VERIFY REPORT` verdict. Its **PASS is a
63
- precondition of `flow verify`** and belongs to the tree it read: any edit after it drops it like
64
- a tier-1 record, so the fix → a **fresh** verify worker; a verdict from an interrupted or
65
- tree-touching worker never stamps (a reviewer that edits voids its own report). **FAIL means:
66
- delegate the fix** — a fresh `flow_stage { stage: "implement" }` worker carries it out, because at
67
- implement the guard refuses your own edit tool in your own worktree; then rerun a fresh verify
68
- worker. The report is a handoff, the gate's own rerun is the proof.
69
- 6. Done means **running and healthy with pre-existing data**, not "compiles":
30
+ 5. Done means **running and healthy with pre-existing data**, not "compiles":
70
31
  `commands.seedData` (if set) puts real data in place, the app starts with
71
32
  the `run` command, and the health check passes — `flow check` covers it
72
33
  (seedData runs before health) and `flow verify` probes **the deployed app
@@ -80,9 +41,30 @@ the worker is steered to commit and report rather than cut off.
80
41
  answered (with no `dev` deploy configured, `flow verify` live-re-probes
81
42
  `health` itself and refuses while nothing is answering). Checkpoint report: stage line **🔨 implement ·
82
43
  `<slug>`** — commits `N ahead, M uncommitted` · tier-1 · tier-2 · deploy/
83
- health · `branch@sha`, then `Done:`/`Next steps:` per the Stage reports rule. Fixes = delegate,
84
- iterate and re-verify; that loop is free — but every fix re-owes the verify worker's PASS, and a
85
- fixer needs its own fresh worker: nothing at this stage comes off your own pen.
44
+ health · `branch@sha`, then `Done:`/`Next steps:` per the Stage reports rule. Fixes = iterate and re-verify; that loop is
45
+ free.
46
+
47
+ ### Optional: a fresh-session worker (`flow_stage`)
48
+
49
+ Big slices can go to a worker so this conversation stays lean; small work and
50
+ small fixes are fine inline. **Delegation is a tool, not a rule** — no gate
51
+ asks who wrote a commit.
52
+
53
+ - `flow_stage({ op: "implement", note, label })` — a fresh pi session in the
54
+ worktree, with read/bash/edit/write, edits and commits one slice. The tool
55
+ adds the facts itself: the absolute plan path, the branch's commits, the
56
+ uncommitted paths and the project checks. Your `note` is just the slice, plus
57
+ any operator answers the worker cannot see. A worker whose turn ends in prose
58
+ is nudged to continue, up to twice. On return the tool reruns `flow check` and
59
+ lists the new commits and anything uncommitted.
60
+ - `flow_stage({ op: "review", note })` — a fresh **read-only** reviewer (at
61
+ implement or pre-release): findings plus `verdict: PASS|FAIL`. It is advisory:
62
+ no stamp, no gate waits on it. On a non-trivial feature, run one before
63
+ Verified?. Fix what is real (inline is fine), and re-review only if the fix
64
+ was large.
65
+ - One worker at a time per session. The worker holds no flow tool, so gates
66
+ and checkpoints stay with you. Its transcript nests under this session in
67
+ pi's picker.
86
68
 
87
69
  `flow verify` re-runs build, runs the `dev` deploy when configured (the
88
70
  operator reviews the running app; the gate **prints what it ran** —
@@ -17,10 +17,6 @@
17
17
  name is itself the gate's proof: **plan.md** — a preliminary direction
18
18
  belongs *inside* plan.md (marked draft), never a separate
19
19
  `pre-plan`/`direction.md` file: the approve gate requires plan.md by name.
20
- The flow folder is the plan's permanent home — the worktree only exists
21
- after approval, while the plan must exist (and stay amendable during
22
- implement) from before it; that is why plan.md lives in
23
- `.dev-flow/<slug>/plan/`, not in the worktree.
24
20
  First check
25
21
  `git log origin/<default>..<default> --oneline`: local-only default-branch
26
22
  commits fall out of the worktree's base (push them or re-plan).
@@ -6,11 +6,6 @@
6
6
 
7
7
  Implemented, tested, running locally; prepare the release entirely in the
8
8
  worktree — main-repo git state stays off-limits until this gate hands over.
9
- Prep that is mostly review and judgment (the review itself, changelog wording,
10
- the version decision) stays in-session; `flow_stage` (`stage: "pre-release"`)
11
- can take heavy mechanical work on the same terms as the implement stage —
12
- operator words travel in `note`, gates and checkpoints stay with you, rerun
13
- `flow check` after the worker returns (see implement.md).
14
9
  **Versioning:** the `versioning.file` manifest is the single source of truth
15
10
  and tags are `versioning.pattern` rendered from it — one number everywhere. If
16
11
  `versioning.file` is unset, stop and clarify the scheme with the user; never
@@ -26,12 +26,7 @@ and stage context; the operator decides:
26
26
  count with this verb when the pile grows; offer the tidy to the operator then.
27
27
  - **Bare `flow reflect` is the end-of-session reflection** — it runs as part
28
28
  of every finish (before the slug folder is deleted — see Stage: finish) and
29
- whenever the operator asks. The default way to run that review at finish is
30
- delegated: `flow_stage { op: "reflect" }` (release stage, after
31
- `release-done`) gives the whole flow — driver transcript + every worker
32
- transcript + plan + status — to an independent session that returns tagged
33
- findings you put to the operator (Fold? Fix? Drop?); the self-protocol below
34
- is the fallback when delegation is impossible. It prints the
29
+ whenever the operator asks. It prints the
35
30
  protocol: review the full session log (messages, tool calls, results);
36
31
  re-check each open item against the current playbook and newer dev-flow
37
32
  versions (`npm view pi-dev-flow version` vs the running version, or
@@ -25,7 +25,9 @@ the worktree unless noted:
25
25
  (`git tag -a`) and push the ref explicitly (`git push origin v<ver>`) —
26
26
  never `--follow-tags` (it silently skips lightweight tags: they never reach
27
27
  the remote, CI never publishes). After the merge a tag points at what
28
- actually shipped. If CI publishes from the tag, set `release.artifact` in
28
+ actually shipped. If CI builds from the tag, set `release.preflight` (e.g.
29
+ `docker build .`) so `flow release` proves that build before the tag exists,
30
+ and `release.artifact` in
29
31
  the playbook — `release-done` then verifies the published artifact and
30
32
  refuses local-only tags outright. Unversioned flow (`--no-version` granted):
31
33
  no bump, no tag — publish the merge only (your entry rides under
@@ -2,18 +2,6 @@
2
2
  > [../SKILL.md](../SKILL.md); this file is the detail for one stage — read it
3
3
  > when the session reaches that stage.
4
4
 
5
- ## Before a flow exists (pre-plan)
6
-
7
- A feature request arriving in an **unbound** session gets analysis, not
8
- scaffolding — this is the only phase with **no writes at all** (guards refuse
9
- checkout writes unbound anyway): read the code the request touches (reads are
10
- always free), then bring back to chat: findings, the real unknowns, your
11
- **open questions** and a proposed **direction**, with a proposed slug and mode
12
- and its one-line why. **Ask the operator to start the flow** — only on their
13
- word do you `flow start <slug>` (they grant any `--patch`/`--docs` mode at the
14
- start gate). The direction lives in chat until the plan stage writes and owns
15
- `plan.md`.
16
-
17
5
  ## Start
18
6
 
19
7
  **No `.dev-flow/`?** `flow init` analyzes the repo and prints a **setup
@@ -37,7 +25,8 @@ with a delete offer — surface the dialog, never delete on your own.
37
25
  findings); `--force` re-detects from scratch, `--draft` prints without
38
26
  writing.
39
27
 
40
- `flow start <slug> [--ui]` — `--ui` whenever anything user-visible is touched;
28
+ `flow start <slug> [--ui --confirmed]` — `--ui` adds a rendered-mockup gate to plan, so it is
29
+ operator-granted like `--patch`/`--docs`: propose it when screens change, start with it only on their word;
41
30
  slug lowercase words-dashed; check `flow status` for an active feature first.
42
31
 
43
32
  `flow start` **preflights** before it creates anything: it warns when this session runs an older dev-flow