pi-dev-flow 0.68.1 → 0.70.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/CHANGELOG.md CHANGED
@@ -4,6 +4,17 @@ Format: newest first. `Unreleased` collects what's merged but not yet tagged.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.70.0] - 2026-10-31
8
+
9
+ - **A flow's workers are one family in the picker.** Every `flow_stage` worker is now stamped as a child of the session that delegated it: its header carries `parentSession` → the driver's session file, and its transcript lands in the driver's own session bucket. `pi --resume` therefore nests the whole family under the driver in its default **Current Folder** scope, Threaded sort, with no scope switch — and because the worker's name carries its outcome (`✓ 🔍 · PASS · stamp attack`, `✗ 🔨 #3 · hard-cut`), the tree reads without opening a single row. One layout boundary: with a configured session directory that is not the checkout's default, the folder scope filters by each session's own cwd, so workers — whose cwd is the worktree — sit one Tab away under **All**, still threaded.
10
+ - **The family has a text view for hosts without a tree.** The settled card and `flow_stage { op: "status" }` list every worker this session spawned: picker name, message count, last-write time (local wall-clock), transcript path, newest first, older ones folded behind one counted line. The run the card or status is reporting on is left out — it is the section above it — and the section appears only inside a flow. A host with no file-backed session gets the flow's own `transcripts.log` instead, labelled as the coarser source it is. Reading a bucket costs ~15 ms per MB of its history, so a polled live view re-reads at most once per two seconds while the settled card and an idle status always read fresh.
11
+
12
+ ## [0.69.0] - 2026-10-30
13
+
14
+ - **Workers, so the conversation that talks to you stays lean.** `flow_stage` now delegates to disposable worker sessions with a fresh context, and the skill makes delegation the default for non-trivial implement work: the driver keeps the claim, the gates and the checkpoints, and receives one bounded stage report. A **verify worker** (`op: "verify"`) is an independent, check-only checker of the implement work — and its PASS is now a hard precondition of `flow verify`: the stamp belongs to the exact tree it read (worktree *and* the plan dir it judged against), so any edit anywhere — including a mid-stage plan amendment — drops it like a tier-1 record; a fresh FAIL deletes a contradicted PASS; a reviewer that moves the tree through bash anyway (file, HEAD, branch pointer or plan) voids its own verdict and gets snapshotted. A **reflect worker** (`op: "reflect"`) reviews the finished flow — driver transcript plus every worker transcript, durably indexed in `stage-sessions/transcripts.log` — returning tagged findings to route through Fold?/Fix?/Drop?.
15
+ - **Workers are visible while they work.** The tool card streams the live tail (current tool, last assistant line, ✓/✗ results, elapsed against budget, usage); the picker shows a live session named by role, ordinal and purpose — `⏳ 🔍 · stamp attack`, `⏳ 🔨 #2 · wire ops` — renamed at the end with its outcome: `✓ 🔍 · PASS · stamp attack`, `✓ 🔨 #2 · 3 commits · wire ops`, `✗ 🔨 #3 · hard-cut`. A footer beat ticks while a worker runs, `stage-live.log` is tail-able, `flow_stage { op: "status" }` prints the same on any host, and `dev-flow:worker-*` events put every run on the bus for other extensions.
16
+ - **Pre-plan discipline:** an unbound session may plan freely but writes nothing — `plan.md` belongs to the flow folder and is only written after `flow start` binds the slug, so discussing an idea can never leave edits behind.
17
+
7
18
  ## [0.68.1] - 2026-10-28
8
19
 
9
20
  - **`flow abort` leaves no ghost (gh#138).** Aborting a feature whose worktree exists now stamps `aborted` on the kept state, and the doctor's git-consistency sweep skips stamped states — doing the cleanup the abort echo prints (`git worktree remove`, `git branch -D`) no longer becomes a `has no worktree` finding that every later `flow doctor` repeats.
package/README.md CHANGED
@@ -244,6 +244,6 @@ shipped feature checks off the item it was picked from.
244
244
  | [docs/gates.md](docs/gates.md) | every gate and flag, what makes each refuse |
245
245
  | [docs/guardrails.md](docs/guardrails.md) | everything enforced, and the deliberate limits |
246
246
  | [docs/concurrency.md](docs/concurrency.md) | several agents, one repo: bindings, claims, attribution |
247
- | [docs/stage-agent.md](docs/stage-agent.md) | `flow_stage`: run a heavy stage in a disposable worker session |
247
+ | [docs/stage-agent.md](docs/stage-agent.md) | `flow_stage`: run a heavy stage in a disposable worker session — nested under the driver in pi's picker |
248
248
  | [docs/headless.md](docs/headless.md) | driving a session from a bot/UI/queue: `NEEDS-OPERATOR`, `--json` surfaces |
249
249
  | [docs/development.md](docs/development.md) | hacking on dev-flow itself: tests, self-hosting, `/reload` |
package/docs/gates.md CHANGED
@@ -15,7 +15,7 @@ so it needs no `--confirmed`.
15
15
  | `test` | records a check | — (runs the `test` command/check, records pass/fail) |
16
16
  | `check` | records all tier-1 checks | — (runs every `flow-check`/test/health from project.md `## implement`); a `--docs` feature runs none of them and says `docs mode: project commands skipped` — a docs flow builds nothing, so a fresh checkout must not read as a failed deploy (#96) |
17
17
  | `health` | records a check | — (runs `seedData` + the health command, retrying up to `healthWait` seconds; app must be up locally with real data) |
18
- | `verify [--yolo]` | implement → pre-release | all tier-1 checks green — a check with no passing record is **run by the gate itself** (`checks ran at the gate (test)`) rather than refused and pointed at `flow check`, since entering the stage or editing the worktree is what cleared it — and so is a record whose worktree fingerprint differs from the tree now (`stale record(s) rerun after a worktree change: …`): a change made through bash fires no edit-tool hook, the fingerprint is what notices the tree moved — and a failure there prints the run output, **the feature branch holds at least one commit** (verify refuses a branch with nothing committed — the checks describe the working tree, so an uncommitted state has never been recorded — and prints `commits: N ahead of <default>, M uncommitted path(s)` with what it ran; uncommitted paths are reported, never gated), build (if configured) green, `dev` deploy (if configured) runs first so you can review the running app **and the health probe (if configured) re-runs against what it just deployed, retrying every 2s up to `healthWait` seconds** (a failing probe refuses the gate and reports how many attempts it took: the `flow check` PASS predates the deploy, and a service that needs seconds after its container starts is not a broken deploy; with no probe the output says `health: none configured`); with **no `dev` command but a `health` probe configured the gate live-re-probes the app before asking** (`health: live re-probe PASS` — a killed server refuses with `live probe FAILED`, because process death dirties no worktree fingerprint and a green record alone cannot prove liveness: start the app and rerun), tier-2 checklist (ui-only items excluded for non-UI features) confirmed as a set; a `--docs` feature runs none of it (`docs mode: project commands skipped`) and only asks you; **one question** — or `--confirmed`; `--yolo --confirmed` = you answered 'yolo' at Verified? — answers it and pre-confirms the rest |
18
+ | `verify [--yolo]` | implement → pre-release | a **verify-worker PASS over the current tree** first (`flow_stage { op: "verify" }`; the stamp belongs to the tree it read — any edit drops it like a tier-1 record and a fresh worker is owed; a docs flow is exempt), then all tier-1 checks green — a check with no passing record is **run by the gate itself** (`checks ran at the gate (test)`) rather than refused and pointed at `flow check`, since entering the stage or editing the worktree is what cleared it — and so is a record whose worktree fingerprint differs from the tree now (`stale record(s) rerun after a worktree change: …`): a change made through bash fires no edit-tool hook, the fingerprint is what notices the tree moved — and a failure there prints the run output, **the feature branch holds at least one commit** (verify refuses a branch with nothing committed — the checks describe the working tree, so an uncommitted state has never been recorded — and prints `commits: N ahead of <default>, M uncommitted path(s)` with what it ran; uncommitted paths are reported, never gated), build (if configured) green, `dev` deploy (if configured) runs first so you can review the running app **and the health probe (if configured) re-runs against what it just deployed, retrying every 2s up to `healthWait` seconds** (a failing probe refuses the gate and reports how many attempts it took: the `flow check` PASS predates the deploy, and a service that needs seconds after its container starts is not a broken deploy; with no probe the output says `health: none configured`); with **no `dev` command but a `health` probe configured the gate live-re-probes the app before asking** (`health: live re-probe PASS` — a killed server refuses with `live probe FAILED`, because process death dirties no worktree fingerprint and a green record alone cannot prove liveness: start the app and rerun), tier-2 checklist (ui-only items excluded for non-UI features) confirmed as a set; a `--docs` feature runs none of it (`docs mode: project commands skipped`) and only asks you; **one question** — or `--confirmed`; `--yolo --confirmed` = you answered 'yolo' at Verified? — answers it and pre-confirms the rest |
19
19
  | `release [--yolo|--no-version|--no-fold-check]` | pre-release → release | checks re-greened after the prep edits; **the worktree holds no uncommitted paths** (gh#131: a merge ships the branch, not the working tree — an uncommitted fix at this gate is a fix that never ships; the refusal lists the paths, and the approved line prints `commits: N ahead of <default>, M uncommitted path(s)` like verify's); with `versioning.file`: the manifest version parses and is **not tagged yet** (the bump must be ahead of the last release); with `release.changelog` the gate **proves the entry mechanically** (#97): a **heading names the version** (prose that mentions it, or a `1.2.0-beta` section when releasing `1.2.0`, is not an entry), **this branch touched the file** (an inherited changelog is not release prep), **every entry that was pending before the release survives inside the new section** — compared on normalized lines, so re-indenting a fold is free while rewording or deleting one is refused by naming the line — and **nothing is left under `Unreleased`**. The proofs guard the **baseline's** pending lines — they do not freeze the wording of the entry this flow writes, so a branch that landed as several iteration commits is free to state its result as one entry (see the changelog-writer rule in the pre-release reference). The pending baseline is the newest tag's changelog (what actually shipped), else the branch's merge base; when neither resolves, the two git-dependent proofs are skipped **with a printed advisory** rather than refusing a legal release for a topology reason, and the content proofs (the heading, its body) always run; tier-2 `## pre-release` checklist confirmed; the manifest version it validates is **stamped as the release's version of record** (`release-done` publishes that, whatever the checkouts say later); **one question** (Release?) — or `--confirmed`; `--no-version` (your call at Release?) ships this flow as **merge + changelog** — the bump/tag requirements and the tag checks at `release-done` are skipped for it, but the branch must still add its **own line under `Unreleased`** (editing an older section releases nothing) and it rides there until the next versioned release folds it (default: versioned); `--no-fold-check` is the operator-granted escape from the line-level fold proofs — one flow, stamped in the gate output, the heading and touched proofs stay; **stale session build** (loaded build behind the checkout): the gate prints both builds, lists what shipped between them (those proofs will not run this release) and folds *update (/reload, then re-run) or proceed with the old release?* into the Release? question — the operator's word, recorded in the release output, **never a block**: publishing under an older gate is a legitimate choice (hotfix, offline reload) |
20
20
  | `release-done` | records the release (the stage stays `release`) | **no question — the Release? answer covered the publication**; verify approval; the version published is the one `release` **stamped** from the manifest it validated (a main checkout still behind cannot republish the previous version), and it must not be older than the newest matching tag **on origin** (tag lists come from `git ls-remote`, so an unfetched clone does not decide what exists; when an origin exists but cannot be asked (offline, no ssh agent) **both release gates refuse** rather than answering with local tags); with `versioning.file`: that tag exists, is reachable from the default branch **and is on origin** (a local-only tag is not a release); with `release.artifact`: the published-artifact check runs (`{version}`/`{tag}` placeholders — the line it prints names the version it verified; skip once with `--no-artifact-check`, operator-instructed only) · creates the forge release from the tag, its body **the `release.changelog` entry for that version** — the changelog is the source of truth, and the tag's annotation stands in only when the changelog has no entry for the version, else nothing (and it says why — a body that is really a shell error is dropped, never shipped) — `gh` for GitHub, `glab` for GitLab) and then **proves the release exists**: it asks the forge (`gh release view <tag>` / `glab release view <tag>`) and refuses when nothing is there, because #51, #60 and #63 were three ways of ending `release recorded as complete` with nothing published — and when the changelog was the body it **reads the stored body back** and refuses a mismatch, so the release page and the changelog cannot drift (#97; normalized before comparing, skipped with a printed note on another forge). Skipping is deliberate and loud — `--no-release-create`, `release.releases = false` or `forge = self` each print that no forge release was created, and the view check is skipped for them; **with a `merge` policy** it also proves the merge that shipped matches it — branch ancestry plus what the forge says (`gh pr view` / `glab api`), so a squash under `merge = merge` (or a merge commit under `merge = squash`) refuses the release record, while a shape it cannot see prints an advisory instead (#97's split: an invisible topology never blocks a legal release); when the release went out on a stale build the operator acknowledged at the release gate, it prints that acknowledgement in place of the after-the-fact version-skew warning, and that warning prints the session vs disk version pair plus the duplicate-copy note when a second copy is registered (#117) |
21
21
  | `finish [--yolo] [slug]` | release → done (removes worktree + branch, deletes `.dev-flow/<slug>/`, and deletes `origin/<branch>` **only** when its merged state is verified — ancestor of the default branch or a merged PR/MR via `gh`/`glab`; unverifiable branches stay with a note) | a release is recorded (`release-done` ran), the main checkout is clean **and** pushed to `origin/<default>`, and the worktree has no uncommitted changes (the refusal lists the paths, not just the count — gh#131); when the clean checkout trails `origin/<default>` the gate **fast-forwards local main** as it closes out (never a merge — anything that cannot fast-forward prints the operator's exact `git pull --ff-only` command); **one question** (Finish? — mentions unmerged-looking commits with the playbook's `merge` policy in mind, and warns when the forge release create failed at `release-done` and no retry succeeded) — or `--confirmed`; under `merge = merge`, commits that never reached the default branch are a **policy violation**: `yolo` does not answer it, only your explicit answer does; to abandon an unreleased feature use `abort` |
package/docs/playbook.md CHANGED
@@ -9,6 +9,11 @@ in a repo that ignores the folder is a deliberate one-off:
9
9
  env prefix is for dev-flow's `pre-commit` hook, which allows a main commit whose only change is the
10
10
  playbook.
11
11
 
12
+ Inside, each `.dev-flow/<slug>/` folder holds one feature's whole world — its state, its `plan/`,
13
+ its worktree. The plan lives in the *folder*, not the worktree, on purpose: a plan must exist (and
14
+ stay amendable through implement) before the worktree exists at all — the worktree is created only
15
+ when `approve` runs.
16
+
12
17
  It is **committed to git**; you edit it (the agent is blocked from writing the main-checkout copy
13
18
  and may edit it only inside a docs/patch flow's worktree, or apply it through `flow init --write`
14
19
  on your word, which validates). Content is organized per stage
@@ -1,57 +1,86 @@
1
- # Stage worker: one stage's work in a disposable sub-session
1
+ # Stage worker: a stage's work or an independent review in a disposable sub-session
2
2
 
3
3
  A big `implement` costs more context than the rest of the flow will ever need:
4
4
  the driving session carries those hundred tool calls into every later gate and
5
5
  checkpoint. `flow_stage` runs that work in a fresh, disposable session
6
6
  instead, and hands back one bounded report. The conversation that talks to you
7
- stays lean.
7
+ stays lean — which is why non-trivial implement work is **delegated by default**,
8
+ not inlined (see `references/implement.md`). Three ops share one mechanism: `run` (a stage's work), `verify` (an
9
+ independent, check-only reviewer of the implement work) and `reflect` (an
10
+ independent review of the whole finished flow at release). Only the brief, the
11
+ toolset, the budget default and the closing contract differ — the safety story
12
+ is identical, and a second mechanism would drift.
8
13
 
9
14
  ## What delegates, what does not
10
15
 
11
16
  `flow_stage(stage: "implement" | "pre-release", note)` runs the **work** of
12
- the stage you are in. Everything else stays with the driving session:
17
+ the stage you are in; `flow_stage(op: "verify")` (legal only while the flow is
18
+ at implement) and `flow_stage(op: "reflect")` (at release, after
19
+ `release-done`) run the two independent reviews. Everything else stays with
20
+ the driving session:
13
21
 
14
22
  - **every gate and every checkpoint** — the worker holds no flow tool; Approve?/
15
23
  Verified?/Release?/Finish? are still your chat, answered by you, run by the
16
24
  bound session;
17
25
  - **the claim** — the driving session binds the feature and keeps the live
18
26
  claim the whole time; nothing is taken over;
19
- - **verification** — the worker's stage report is a handoff, never a check:
20
- after a worker run the driving session reruns `flow check` (the worker's
21
- edits invalidated the tier-1 records like any other edit) and still faces
22
- the normal `verify` gate.
27
+ - **verification** — no worker's report is a check: after a `run` the driving
28
+ session reruns `flow check` (the worker's edits invalidated the tier-1
29
+ records like any other edit) and still faces the normal `verify` gate. The
30
+ **verify worker is a checker, not the gate**: its `VERIFY REPORT` PASS stamps
31
+ the current tree and `flow verify` refuses without that stamp, but the gate
32
+ re-runs everything itself and the operator's **Verified?** stays the
33
+ checkpoint. Any tree edit after the PASS drops the stamp like a tier-1
34
+ record — every fix cycle owes a fresh verify worker.
23
35
 
24
36
  `plan` is the operator dialogue and `release`/`finish` carry the checkpoint
25
37
  words — both stay in-session by design. One worker per session at a time
26
38
  (`flow_stage { op: "status" }` reads the live one); sequential re-delegation is
27
- legal and often right. `flow verify` cannot be delegated.
39
+ legal and often right.
28
40
 
29
41
  ## Why an unbound worker is safe here
30
42
 
31
43
  The guards already judge a second session by attribution, so a helper needs no
32
44
  binding of its own:
33
45
 
34
- - worktree writes are judged by the **owning feature's stage** — the worker may
35
- edit and commit on the feature branch exactly while the flow allows it, and
36
- nothing else;
46
+ - worktree writes are judged by the **owning feature's stage** — a `run` worker
47
+ may edit and commit on the feature branch exactly while the flow allows it,
48
+ and nothing else; `verify` and `reflect` workers hold no edit/write tool at
49
+ all, and a check-only worker that moves the tree through `bash` anyway
50
+ **voids its own verdict**: the tool diffs `git status`, `git rev-parse HEAD`,
51
+ the branch pointer and a hash of the feature's plan dir before and after
52
+ (each leg alone has a clean-tree bypass; the proof sees the tracked tree —
53
+ the same documented shortcut as every other fingerprint here), a moved tree
54
+ is snapshotted and the stamp never lands —
55
+ and the PASS itself is stamped against a worktree+plan fingerprint, so even a
56
+ later edit to the plan it was written against demotes it;
37
57
  - default-branch discipline (no commit/merge/push on main) is enforced on every
38
58
  session's git calls alike;
39
- - `.dev-flow/state.json` and `claim.json` stay flow-owned — a worker cannot
40
- forge a stage or a claim, and it runs no gates because its toolset holds
41
- coding tools only.
59
+ - `.dev-flow/state.json` and `claim.json` stay flow-owned — the guard denies
60
+ workers the edit/write tools for them and `stateTamper` refuses the direct
61
+ bash shapes, and the worker runs no gates because its toolset holds coding
62
+ tools only. Honest scope, same line guardrails.md draws: these are strong
63
+ guardrails for what an agent types, **not a sandbox** — a determined wrapper
64
+ reaching around them is a hardening decision, not a control this feature
65
+ claims.
42
66
 
43
67
  ## The handoff
44
68
 
45
- The worker receives a brief assembled by the tool: the stage's playbook
46
- reference, `flow status --json`, live `git status` in the worktree, the plan
47
- file, and the driving session's `note`. The note is the only channel for
48
- conversation-only context — operator answers not yet recorded by a gate,
49
- decisions, warnings, the exact next action. Everything else the worker re-reads
50
- from disk.
51
-
52
- It closes with a `STAGE REPORT` block — `done` / `files` / `notes` /
53
- `blockers` — and the parent digests exactly that (bounded). A worker that skips
54
- the block is surfaced loudly (`reportMissing`), never silently trusted.
69
+ The worker receives a brief assembled by the tool. A `run` worker gets the
70
+ stage's playbook reference, `flow status --json`, live `git status` in the
71
+ worktree, the plan file, and the driving session's `note`. A `verify` worker
72
+ gets the plan, the branch diff, the tier-1 commands and the standing order
73
+ **check, don't fix**. A `reflect` worker gets the driver's own session file,
74
+ every worker transcript listed in the flow's `transcripts.log`, the plan and
75
+ live status. The note is the only channel for conversation-only context —
76
+ operator answers not yet recorded by a gate, decisions, warnings, the exact
77
+ next action. Everything else the worker re-reads from disk.
78
+
79
+ Each op closes with its bounded contract: `run` a `STAGE REPORT` (`done` /
80
+ `files` / `notes` / `blockers`), `verify` a `VERIFY REPORT` (`verdict:
81
+ pass|fail` / `findings` / `evidence`), `reflect` `[playbook]`/`[plugin]`-tagged
82
+ finding lines — and the parent digests exactly that. A worker that skips its
83
+ block is surfaced loudly (`reportMissing`), never silently trusted.
55
84
 
56
85
  The brief also carries a standing order: **commit each completed unit of work
57
86
  as you go** (one module, one file-group). If a run is ever cut, that costs one
@@ -59,29 +88,81 @@ unit — never a worktree.
59
88
 
60
89
  ## You can watch it work
61
90
 
62
- A worker is a real pi session in pi's standard session directory, named
63
- `⏳ stage worker · <stage> · <slug>` while it runs and `✓`/`✗ …` when it ends:
64
- it shows up in the pi-web sidebar and the `/resume` picker with the transcript
65
- rendering live as turns land (the ⏳ means live — resuming it forks it;
66
- browsing is safe). `pi export <file>` turns any finished transcript into
91
+ The **tool card is the guaranteed surface**: every worker line (current tool +
92
+ args, last assistant line, ✓/✗ tool results, clock against budget, usage)
93
+ travels as the tool's own streamed update, so the live tail rides inside the
94
+ driver's transcript wherever the host renders streamed tool updates (the TUI
95
+ does; expansion adds the fuller stream, the report and the transcript path).
96
+ Around it, three mirrors:
97
+
98
+ - a worker is a real pi session, **stamped as this session's child**: its header
99
+ carries `parentSession` → the driver's session file, and its transcript lands in
100
+ the driver's own session bucket — so `pi --resume` nests it under the driver in
101
+ its default **Current Folder** scope, in the Threaded sort, with no scope switch
102
+ (pi #1108 built that link for exactly this: extensions may stamp it on sessions
103
+ they create on a user's behalf). One layout exception: if you point pi at a
104
+ configured session directory (settings `sessionDir`, or `--session-dir`) that is
105
+ not the default for the folder you started it in, that scope filters by each
106
+ session's own cwd and a worker's cwd is its worktree — the family is still
107
+ threaded, one Tab away under **All**, and dev-flow's text view below lists it in
108
+ either layout. On a host with no file-backed session the stamp
109
+ is skipped and the worker keeps pi's default location, unlinked. Named by role
110
+ glyph, ordinal and purpose — `⏳ 🔨 #2 · wire ops` while it runs, renamed
111
+ at the end with its outcome: `✓ 🔨 #2 · 3 commits · wire ops`, a verify `✓ 🔍 ·
112
+ PASS · stamp attack`, a cut-off worker `✗ 🔨 #3 · hard-cut`; the verdict never
113
+ depends on opening the row (a `label` on the call supplies the purpose; with
114
+ none, a `run` is still separated by its ordinal). It appears in the `/resume`
115
+ picker, and its
116
+ transcript grows live on disk, readable at any moment — whether a viewer
117
+ tails a session still running is the viewer's choice, the card above is what
118
+ the flow promises. Every finished worker appends its transcript path to
119
+ `.dev-flow/<slug>/stage-sessions/transcripts.log` — the durable index the
120
+ reflect worker reads;
121
+ - the driving session's **footer** beats `⏳ 🔨 implement · <label> · <slug>
122
+ mm:ss · <tool>` while a worker runs (cleared when it ends);
123
+ - every line appends to `.dev-flow/<slug>/stage-live.log` — tail-able, and
124
+ `flow_stage { op: "status" }` prints the same tail plus elapsed time, budget,
125
+ the worktree state and recent commits, on any host, no model call.
126
+
127
+ ### The family, on a host with no tree
128
+
129
+ The parent link makes pi's own picker the lineage view. Where a host has no tree
130
+ (or you want the answer in text), the settled card and
131
+ `flow_stage { op: "status" }` list the family instead: one line per worker this
132
+ session spawned — its picker name (so the outcome is right there), message count,
133
+ last-write time, transcript path, newest first, older ones folded behind one
134
+ counted line. The worker the card or status is reporting on is left out — it is the
135
+ section above it — and the section appears only inside a flow, because an unbound
136
+ session has never spawned one:
137
+
138
+ ```
139
+ workers this session spawned:
140
+ ✓ 🔍 · PASS · stamp attack · 7 msgs · 2026-10-30 12:04 · ~/.pi/agent/sessions/…/w2.jsonl
141
+ ✗ 🔨 #1 · hard-cut · 31 msgs · 2026-10-30 11:02 · ~/.pi/agent/sessions/…/w1.jsonl
142
+ ```
143
+
144
+ It is read back from pi's session listing, not from a dev-flow index, so renames,
145
+ deletions and workers an earlier session already delegated all read correctly for
146
+ free. A host that gives dev-flow no session file to be a parent of falls back to
147
+ the lines the flow's own `transcripts.log` already holds — coarser (no message
148
+ count, no rename), still the same answer. Reading a bucket costs about 15 ms per
149
+ MB of its history, so the polled live view re-reads at most once every two seconds
150
+ while the settled card and an idle status always read fresh.
151
+
152
+ Lifecycle is also on the bus: `dev-flow:worker-started` / `-completed` /
153
+ `-failed` events (slug, op, elapsed, usage) let other extensions react without
154
+ touching dev-flow. `pi export <file>` turns any finished transcript into
67
155
  readable HTML; the tool result names the file and the export command.
68
156
 
69
- For hosts with no live partial rendering there are two more surfaces:
70
-
71
- - the driving session's **footer** beats `⏳ stage worker mm:ss · <tool> · <slug>`
72
- while a worker runs (cleared when it ends);
73
- - every tool call appends a line to `.dev-flow/<slug>/stage-live.log` —
74
- tail-able, and `flow_stage { op: "status" }` prints its last lines plus elapsed
75
- time, budget, the worktree state and recent commits, on any host, no model call.
76
-
77
157
  ## The budget, and the soft landing
78
158
 
79
- One run gets `budgetMin` minutes (default 45, clamped 5–120). At 75% of the
80
- budget the worker is not killed — it is **steered**: “stop starting new units,
81
- finish the edit you are in, commit everything done, close with the STAGE
82
- REPORT”. A worker that obeys lands its work and reports honestly (the result
83
- says so). The hard cut at the full budget is the backstop for a worker that
84
- ignores the steer or wedges; a hard-cut run is marked mid-stage and is an error.
159
+ One run gets `budgetMin` minutes (default 45 for `run`, 30 for `verify` and
160
+ `reflect`, clamped 5–120). At 75% of the budget the worker is not killed — it
161
+ is **steered**: “stop starting new units, finish the edit you are in, commit
162
+ everything done, close with the report”. A worker that obeys lands its work and
163
+ reports honestly (the result says so). The hard cut at the full budget is the
164
+ backstop for a worker that ignores the steer or wedges; a hard-cut run is
165
+ marked mid-stage and is an error.
85
166
 
86
167
  Either way, **a dirty worktree is never handed back**: the tool snapshots it
87
168
  (tracked *and* untracked) with a throwaway index — no WIP commit on the branch,
@@ -90,12 +171,20 @@ file to read before deciding what to keep.
90
171
 
91
172
  ## Transcripts
92
173
 
93
- Session JSONL lives where pi keeps sessions (standard dir, discoverable by the
94
- picker and `pi export`); snapshots live under `.dev-flow/<slug>/stage-sessions/`
95
- (gitignored, like all flow-owned state).
174
+ Session JSONL lives in the **driver's own session bucket** (the directory pi already
175
+ uses for this session), which is what lets pi's picker show a flow's workers as one
176
+ nested family; `pi export` and the picker find them there. Two consequences worth
177
+ knowing: a worker's header `cwd` is still the worktree, so after `flow finish`
178
+ removes that worktree the row points at a directory that is gone (browsing and
179
+ `pi export` still work — resuming it would not); and the bucket is shared with the
180
+ driver's own history, so worker transcripts are only ever deleted by path, never
181
+ by clearing a folder. Snapshots and the `transcripts.log` index live under
182
+ `.dev-flow/<slug>/stage-sessions/` (gitignored, like all flow-owned state).
96
183
 
97
- ## Deliberate limits (v1)
184
+ ## Deliberate limits (v2)
98
185
 
99
186
  Same model for worker and driver (a per-stage model/tool policy is a playbook
100
- conversation for later); no delegating of verify's fix loop; the worker cannot
101
- ask you anything — if it needed to, the note was too thin.
187
+ conversation for later); no delegating verify's fix loop — the checker is
188
+ fresh each cycle, the fixing stays the driver's call (inline or via a fresh
189
+ `run` worker); the worker cannot ask you anything — if it needed to, the note
190
+ was too thin.