pi-dev-flow 0.76.0 → 0.77.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,29 @@ Format: newest first. `Unreleased` collects what's merged but not yet tagged.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.77.0] - 2026-11-03
8
+
9
+ **The finish reflection is done by a separate reviewer, and plugin feedback goes upstream.** The driving agent used to review its own session inline (biased, and blind to its workers' transcripts), wrote findings straight into the project's `reflections.md` — dev-flow complaints included — and reminded the operator about open reflections on every turn.
10
+
11
+ ### Added
12
+ - `flow_stage` op `reflect`: a fresh read-only pi session reviews the driver's transcript and every `flow_stage` worker transcript (found by their `parentSession` header), re-checks the open items, dedupes against them and the upstream issues, and returns numbered findings — each **docs** / **code** / **plugin** with a **fold** or **drop** recommendation. It runs in the main checkout at any stage; finish is its standard moment. A reported run is recorded on the flow, and a finish question without one says so (advisory, never a block).
13
+ - At finish the operator decides fold or drop per finding: fold docs → `## playbook` (docs flow), fold code → `## code` (patch flow), fold plugin → a GitHub issue on the dev-flow repo; drop records nothing.
14
+ - `flow reflect --code "<note>"` and a `## code` section for fixes that touch project code.
15
+ - Timed nudges: *fix the open reflections now?* fires when an item recurred this session, is ≥ 14 days old, ≥ 3 playbook items wait (one docs flow), or a code item waits between flows; *tidy* fires at ≥ 5 closed, closed ≥ open (≥ 3), or a closed item ≥ 30 days old.
16
+
17
+ ### Changed
18
+ - `flow reflect --plugin` never writes `reflections.md`: it prints the upstream recipe (search, then `gh issue create` with the `— reflection from` tail the fold matches). A plugin-shaped note without a flag does the same. In the dev-flow repo itself plugin is code and files under `## code`. `--both` is gone; `reflect move` takes `--playbook|--code`.
19
+ - Existing `## plugin` rows are kept verbatim, never added to, and flagged by `flow doctor` and `reflect list` to be filed upstream (or moved to `## code` in the dev-flow repo).
20
+ - Open-reflection reminders left the per-turn stage context of a feature in progress; they surface at the release stage, at finish, in an unbound session, and in `flow status` / `flow doctor`.
21
+
22
+ ## [0.76.1] - 2026-11-03
23
+
24
+ **pi-web workers read Running while they run.** Since 0.75.0 a `flow_stage` worker's Agents-menu row read *Interrupted* for its whole run, and its label repeated the slug.
25
+
26
+ ### Fixed
27
+ - While a `flow_stage` worker runs, its pi-web Agents row now reads running. pi-web shows a persisted `running` as interrupted unless it can confirm the run is alive in-process, so the worker now registers itself in pi-web's live run map for the run and leaves it only after its result entry is written. Plain pi is unchanged. Stop/steer from the Agents menu still answer "not running"; the driving session's Stop aborts the worker.
28
+ - Worker labels read `<glyph> <slug> <what>`: a `label` that repeats the slug is trimmed (`🔍 flow-list-widget · flow-list-widget review` → `🔍 flow-list-widget review`), and with no label the op names the run.
29
+
7
30
  ## [0.76.0] - 2026-11-03
8
31
 
9
32
  **The status bar now lists the flows.** In pi-web the footer was text — nothing to click, and no way to see what was in flight without asking the agent.
package/README.md CHANGED
@@ -146,12 +146,25 @@ claiming a gate result it never produced. → [Gate reference](docs/gates.md)
146
146
 
147
147
  When something costs the agent a step — a playbook command that stopped existing, a guard that
148
148
  refused the wrong thing, a gate that forced a detour, a rough edge in dev-flow itself — it does not
149
- just work around it. It parks a one-line note in `.dev-flow/reflections.md`, under **playbook**
150
- (something about your project) or **plugin** (something about dev-flow) — the agent says which with
151
- `flow reflect --playbook|--plugin "<note>"`, and a note queued without a flag lands on a keyword
152
- guess the printed line explains (`flow reflect list` numbers the queue, `flow reflect move <n>
153
- --plugin` re-files one). The open count surfaces in
154
- `flow status` and in the agent's stage context (`↻ 2 reflection(s) open`).
149
+ just work around it. It parks a one-line note in `.dev-flow/reflections.md` — your project's queue — under **playbook**
150
+ (the fix lives in `project.md`, a docs flow) or **code** (the fix touches your code, a patch flow):
151
+ `flow reflect --playbook|--code "<note>"`. Feedback about **dev-flow itself never lands in your
152
+ project**: `flow reflect --plugin "<note>"` prints the recipe for a GitHub issue on the dev-flow repo
153
+ (search first, then `gh issue create`), filed on your word. A note queued without a flag lands on a
154
+ keyword guess the printed line explains (`flow reflect list` numbers the queue, `flow reflect move
155
+ <n> --code` re-files one). The open count surfaces in `flow status` and `flow doctor`.
156
+
157
+ **At finish, a separate reviewer reflects on the session.** `flow_stage` op `reflect` starts a fresh
158
+ read-only pi session that reads the whole driving transcript *and every worker's*, re-checks the
159
+ open items, dedupes against them and the upstream issues, and returns a numbered list — each
160
+ finding classified docs / code / plugin with a **fold or drop** recommendation. You answer per item
161
+ (`fold 1,3 drop 2`): fold records a docs/code row or files the plugin issue, drop records nothing.
162
+
163
+ The nudges are timed, not constant. *Fix the open reflections now?* is suggested only when an item
164
+ recurred this session, has waited 14 days, three playbook items can share one docs flow, or a code
165
+ item waits while you are between flows — at finish, in an unbound session, in `flow doctor`, never
166
+ mid-feature. *Tidy* is suggested once the closed pile is real (5 closed, more closed than open, or a
167
+ month-old closed item).
155
168
 
156
169
  With a GitHub remote, `flow doctor` and `flow reflect list` also **fold in the open GitHub issues**
157
170
  — external submissions land on GitHub while the queue lives in `reflections.md`, so both surfaces
@@ -164,10 +177,8 @@ the file, never both. No GitHub remote shows nothing; missing or failing `gh` is
164
177
  They never gate anything, and the fix is never the agent's call alone. You ask it to go through them
165
178
  — usually with `flow doctor`, which reviews each open item and routes it: a playbook item becomes a
166
179
  small docs flow that edits `project.md` through the flow (so the change is committed and reviewed like
167
- any other), a dev-flow item goes upstream as an issue. At the end of a session the agent does the same
168
- review over the whole exchange before `Finish?`, so friction it noticed but never filed shows up too.
169
- Fold, fix or drop them — but leaving them is the one option that lets the same friction come back next
170
- feature.
180
+ any other), a code item a patch flow. Leaving them is the one option that lets the same friction come
181
+ back next feature — which is exactly what the *recurred* nudge catches.
171
182
 
172
183
  ### Reviews and senior discipline, built in
173
184
 
@@ -184,8 +195,8 @@ speculative layers — removed in a risk-ascending order, one verified commit pe
184
195
  tests as contract, and a structural-vs-cheap self-audit so the diff shrank because the system
185
196
  got smaller, not because comments got deleted. For a big implement slice the session can hand
186
197
  the work to **`flow_stage`**: a fresh pi session in the worktree that edits, commits and reports,
187
- or a fresh read-only reviewer (`op: "review"`) whose PASS/FAIL is advice, not a gate. Both are
188
- optional, and the plan path, commits and checks are briefed automatically. In pi-web a worker also
198
+ or a fresh read-only reviewer (`op: "review"`) whose PASS/FAIL is advice, not a gate, or the
199
+ end-of-session reflection (`op: "reflect"`, see Reflections). All are optional, and the plan path, commits and checks are briefed automatically. In pi-web a worker also
189
200
  shows up in the session's Agents menu as a subagent, its final status on the row and its report in
190
201
  the opened transcript. And while a flow writes code, the
191
202
  implement stage injects a compact senior-discipline guidance — smallest complete change, no
@@ -229,7 +240,7 @@ While a feature is active, every tool call passes a guard:
229
240
  ```
230
241
  .dev-flow/
231
242
  project.md your playbook — the only committed file here
232
- reflections.md the agent's suggestion queue for you (advisory)
243
+ reflections.md this project's suggestion queue for you (advisory; plugin feedback goes upstream)
233
244
  roadmap.md your backlog of future features (advisory)
234
245
  <slug>/
235
246
  plan/plan.md the spec you approve (embeds the mockup renders)
package/docs/gates.md CHANGED
@@ -19,7 +19,7 @@ so it needs no `--confirmed`.
19
19
  | `release [--yolo|--no-version|--no-fold-check]` | pre-release → release | checks re-greened after the prep edits; `release.preflight` (when set) passes in the worktree — the build the tag will trigger, proven before anything ships; **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` |
22
- | `reflect ["<note>"|list|tidy|move <n> --plugin|--playbook]` | — | `reflect "<note>"` queues a suggestion in `reflections.md` (never gates; gate flags such as `--confirmed` are ignored, they never become part of the note). `--playbook` / `--plugin` files it in that section — the agent knows what its own note is about, so the wording guess is the fallback, and the echoed line prints the reason it landed where it did (`"gate" names dev-flow itself`, `playbook or project wording`, `nothing plugin-shaped in the note …`); a note is filed under **one** section, never both. `reflect list` numbers the open items with their section; `reflect move <n> --plugin|--playbook` re-files one of them. `reflect tidy` drops the closed (`- [x]`) items — the preamble and open items stay verbatim and a `## section` heading left empty goes with its items; every surface that queues or reviews reflections (`reflect "<note>"`, bare `reflect`, `doctor`) nudges with the closed count when the checked-off pile grows. Bare `reflect` prints the full **session-reflection protocol** for the agent (from the `/flow reflect` bar it additionally wakes the model, so the protocol executes immediately): review the whole session log, re-check every open item against the current playbook and **newer dev-flow versions** (`npm view pi-dev-flow version` vs the running version — dev-flow ships from npm; recommend `pi install npm:pi-dev-flow` + `/reload`, the operator performs updates), dedupe new findings against the open ones, then report playbook vs plugin items to the operator and ask whether to fix now — plugin items: search upstream issues first (`gh issue list --repo <upstream> --state all --search …`; an author-addressed match is reported back, no match → `gh issue create` with a detailed description and a suggested fix), playbook items: `flow doctor` routes each to the docs flow that implements it |
22
+ | `reflect ["<note>"|list|tidy|move <n> --playbook|--code]` | — | `reflect "<note>"` queues a suggestion in **this project's** `reflections.md` (never gates; gate flags such as `--confirmed` are ignored, they never become part of the note). `--playbook` (alias `--docs`) files it under `## playbook` — the fix lives only in `project.md`, a docs flow implements it; `--code` files it under `## code` — the fix touches project code, a patch flow implements it. `--plugin` **never writes**: dev-flow feedback is filed upstream, so it prints the recipe — `gh issue list --repo <dev-flow repo> --state all --search …` first, then `gh issue create` with a body ending `— reflection from <slug> <date>` (in the dev-flow repo itself plugin is code → `## code`). With no flag the wording guesses (plugin-shaped → the recipe; otherwise `## playbook`) and the echo prints why. `reflect list` numbers the open items with their section; `reflect move <n> --playbook|--code` re-files one; a legacy `## plugin` row is flagged by list and doctor (file it upstream, check it off `— filed: gh#NNN`). `reflect tidy` drops the closed (`- [x]`) items — the preamble and open items stay verbatim and a `## section` heading left empty goes with its items. **Nudges are timed, not constant**: `⚑ fix the open reflections now?` prints when an item recurred this session, is ≥ 14 days old, ≥ 3 playbook items wait, or a code item waits while between flows — at finish, in an unbound session and in doctor, never mid-feature; `↻ N closed reflection(s)` prints at ≥ 5 closed, closed ≥ open (≥ 3), or a closed item ≥ 30 days old. Bare `reflect` prints the **session-reflection protocol** (from the `/flow reflect` bar it additionally wakes the model): bound to a flow, delegate the review to `flow_stage` op `reflect`; unbound, review inline; re-check every open item against the playbook and **newer dev-flow versions** (`npm view pi-dev-flow version`; the operator performs updates); show the operator a numbered list with a fold/drop recommendation per finding and stop; fold docs/code → `reflect --playbook|--code`, fold plugin → the upstream issue, drop → nothing recorded |
23
23
  | `roadmap [add "<feature>" \| pick <n> <slug> \| done <n> \| tidy]` | — | manages `.dev-flow/roadmap.md`, the gitignored backlog of future features (`- [ ]` checklist): bare prints the numbered open items, `add` appends one, `pick <n> <slug>` stamps open item n with `(slug)` so `flow start <slug>` can take it — **`finish` checks the stamped item off when that feature ships**; `done <n>` checks off by hand (items shipped outside a flow), `tidy` drops the checked lines. Never gates; the open count is surfaced in `status` and session context |
24
24
  | `doctor ["<issue note>"]` | — | read-only findings: playbook drift, dead commands/scripts, untracked playbook, ghost feature dirs, orphan worktrees/branches — the state of an **aborted** feature is never a finding (its worktree cleanup is by design — gh#138) — **plus a review of every open reflection, each routed to the flow that should fix it** (playbook item → docs flow; plugin item → upstream issue, or a patch/normal flow inside the dev-flow repo) — every item is labelled from the `## section` it is filed under (the file is the record, so the table cannot disagree with it) and items sitting outside both sections are named rather than silently bucketed. It writes nothing and asks nothing, safe for agents and CI at any stage; the agent investigates, you confirm, the routed flow implements. `doctor "<note>"` prints an investigation brief and a fix route for a fresh observation, including the section it would be filed under and why |
25
25
  | `status [slug]` / `abort [slug]` | — | — |
package/docs/playbook.md CHANGED
@@ -168,16 +168,19 @@ you can just edit `.dev-flow/project.md` yourself — the next `flow init` (doct
168
168
  flags problems, and `flow doctor` runs the same probes on demand without offering to change
169
169
  anything (findings are also printed whenever `flow init` runs without a UI, e.g. in CI). `--force`
170
170
  rewrites from fresh detection. Improvement
171
- ideas the agent notices along the way queue up in `.dev-flow/reflections.md` under `## playbook`
172
- (what to change in *your* playbook) and `## plugin` (what to change in dev-flow itself) —
173
- `flow reflect "<note>"` appends them (`--playbook` / `--plugin` says which section, no flag guesses
174
- from the wording and prints why), `flow reflect list` numbers the open ones, `flow reflect move <n>
175
- --plugin|--playbook` re-files one, `flow reflect tidy` drops the closed (`- [x]`) ones,
176
- plain `flow doctor` reviews the open ones and routes
177
- each fix to the flow that implements it (docs flow for playbook items — those edits only pass a
178
- docs/patch flow's worktree), bare `flow reflect` hands the agent the full end-of-session
179
- reflection protocol (review the session log, re-check open items against fixes that already
180
- shipped, dedupe new findings, put the fix decision to the operator) — and nothing there ever gates.
171
+ ideas the agent notices along the way queue up in `.dev-flow/reflections.md` — *this project's*
172
+ queue only: `## playbook` (the fix lives in your playbook → docs flow) and `## code` (the fix
173
+ touches your code → patch flow). Feedback about dev-flow itself never lands there: it becomes a
174
+ GitHub issue on the dev-flow repo. `flow reflect --playbook|--code "<note>"` appends a note,
175
+ `flow reflect --plugin "<note>"` prints the upstream issue recipe instead (no flag guesses from the
176
+ wording and prints why), `flow reflect list` numbers the open ones, `flow reflect move <n>
177
+ --playbook|--code` re-files one, `flow reflect tidy` drops the closed (`- [x]`) ones, plain
178
+ `flow doctor` reviews the open ones and routes each fix to the flow that implements it. At finish
179
+ a fresh read-only **reflect worker** (`flow_stage` op `reflect`) reviews the whole session — the
180
+ driver's and every worker's transcript — and returns classified findings with a fold/drop
181
+ recommendation each; the operator decides per item (fold = a queue row or an upstream issue, drop
182
+ = nothing recorded). Suggestions to fix open items or tidy closed ones are timed (finish, between
183
+ flows, doctor — never mid-feature) — and nothing there ever gates.
181
184
  Future features have their own file: `.dev-flow/roadmap.md`, a gitignored backlog `flow roadmap`
182
185
  manages (add / pick → `flow start` / done / tidy) — a picked item is checked off by `finish` when
183
186
  its feature ships, and it never gates either.