pi-dev-flow 0.64.1 → 0.64.2

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,13 @@ Format: newest first. `Unreleased` collects what's merged but not yet tagged.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.64.2] - 2026-10-25
8
+
9
+ ### Changed
10
+
11
+ - **Structured stage reports — a tier-3 communication convention, documented and injected.** `docs/playbook.md` gains a "Structured stage reports" section: every stage report opens with one inline `◆ <stage> · <slug>` line (mode + grant mark, ui, then per-stage decision fields — plan status, commits/tier-1/deploy, the version decision with its pending/bump/no-version states, PR/tag/artifact proofs, finish cleanup state) and closes with exactly one plain-chat checkpoint rendered as three markdown bullets (context / options incl. yolo / recommend) plus the single verb. The shape is plain markdown, never fenced — fenced header blocks rendered as horizontal-scroll boxes in web UIs. This repo's `project.md` carries the matching per-stage prose so every session inherits the contract at stage start; gates and guardrails are untouched — the contract is advisory like all tier-3 prose.
12
+ - **Repo dogfood of `/flow-simplify`, shipped as a patch**: dropped the one dead import `tsc --noUnusedLocals` reports repo-wide (`unreleasedBody` in `test/core.test.ts`), and collapsed the thrice-duplicated yolo-word intake — the byte-identical `--yolo` acceptance block and its error string in the verify, release and finish gates — into one `takeYoloWord` helper, so the operator-word wording lives in one place. Also committed the `package-lock.json` version fields `npm install` rewrites in every worktree since the 0.64.1 bump left them unsynced.
13
+
7
14
  ## [0.64.1] - 2026-10-24
8
15
 
9
16
  ### Changed
package/docs/playbook.md CHANGED
@@ -173,3 +173,44 @@ shipped, dedupe new findings, put the fix decision to the operator) — and noth
173
173
  Future features have their own file: `.dev-flow/roadmap.md`, a gitignored backlog `flow roadmap`
174
174
  manages (add / pick → `flow start` / done / tidy) — a picked item is checked off by `finish` when
175
175
  its feature ships, and it never gates either.
176
+
177
+ ### Structured stage reports (a prose convention, not a gate)
178
+
179
+ The gates enforce *state*; how the agent *talks* about that state at each stage is a tier-3 convention —
180
+ type `prose.implement`-style guidance into the stage sections and every session inherits it. The contract
181
+ this repo runs on has two fixed shapes, both **plain markdown inline lines — never fenced** (a code block
182
+ renders monospace with a horizontal scrollbar in web UIs; fences stay for diffs and command output).
183
+
184
+ **The stage line.** Every stage report opens with one inline line: a `◆` marker, the stage and slug, then
185
+ the *decision record* as `·`-separated `key value` pairs with backticked values. The core — stage · slug ·
186
+ mode (+ grant mark: `✓` operator-granted, `?` proposed) · ui — repeats at every stage; stage-specific
187
+ fields append:
188
+
189
+ | Stage | Fields after the core | Example |
190
+ |---|---|---|
191
+ | pre-flow | mode proposal + why, detected knob defaults, merge-policy state | **◆ pre-flow · new work** — mode `normal` (proposed: touches behavior) · ui on · forge `github` ✓ · merge policy **missing** |
192
+ | plan | plan.md status, mockups `rendered/total`, open questions | **◆ plan · `dark-mode`** — `normal` ✓ · ui on · plan `created` · mockups `3/3` · open questions `0` |
193
+ | implement | commits `N ahead, M uncommitted`, tier-1, tier-2, deploy/health, branch@sha | **◆ implement · `dark-mode`** — `normal` ✓ · ui on · commits `2 ahead, 0 uncommitted` · tier-1 `5/5` · deploy `health PASS` · `feat/dark-mode@a1b2c3` |
194
+ | pre-release | **version decision** — `pending` / `bump <patch\|minor\|major> → vX.Y.Z (pending your word)` / `no-version [your word]` — tag, changelog, fold, review tally, merge style | **◆ pre-release · `dark-mode`** — `normal` ✓ · ui on · version **`bump minor → 0.56.0 (pending your word)`** · tag `v0.56.0` · changelog `ready` · review `0 must / 0 should` · merge `merge` |
195
+ | release | PR + state, merge style used, tag state, artifact proof, forge release state (one line per step — this stage has no checkpoint) | **◆ release · `dark-mode`** — PR `#131 merged` · merge `--merge (playbook)` · tag `v0.56.0 pushed` · artifact `npm view OK` · forge release `created` |
196
+ | finish | release recorded, main state, unmerged commits, reflections open, release-checklist open | **◆ finish · `dark-mode`** — release `recorded` · main `clean, pushed` · unmerged `0` · reflections `2 open` |
197
+
198
+ A decision that was *not* made is recorded as `pending` — never left unstated, never silently invented
199
+ (a version bump needs the operator's word; `no-version` too).
200
+
201
+ **The checkpoint.** Exactly one per stage, as a plain chat message (a structured-question tool is
202
+ not chat and never licenses `--confirmed`), three markdown bullets and the single verb, **yolo** named
203
+ as an available answer:
204
+
205
+ > **CHECKPOINT — Release?**
206
+ > - **context** — checks green; manifest ahead of last tag; `Unreleased` folded.
207
+ > - **options** — *release* → bump minor 0.56.0, tag `v0.56.0`, forge release · *no-version* → merge only, entry rides under `Unreleased` · *edit* — what to change · *yolo* → release with the parameters above, remaining gates run back to back
208
+ > - **recommend** — *release* — user-facing feature, minor per playbook semver
209
+ >
210
+ > Answer in chat: **Release?** (or yolo)
211
+
212
+ After each gate that advances a stage, one short echo line confirms the new state before new work
213
+ (`▶ stage: implement — 2 commits ahead, tier-1 5/5`). Mid-stage additions amend `plan.md` with an
214
+ `**Added mid-stage:**` line instead of opening a second checkpoint — the verb count stays one per
215
+ stage. The contract is advisory like all tier-3 prose: gates refuse what gates refuse regardless of
216
+ how neatly the report is formatted.
@@ -766,6 +766,13 @@ async function runFlow(args: string[], root: string, ui: Ui, sess: Session): Pro
766
766
  if (!initiated(root) && sub !== "init" && sub !== "version") return { text: "dev-flow is not initiated here — no .dev-flow/project.md — run flow init first", isError: true };
767
767
  const cfg = loadProject(dfDir(root)).cfg;
768
768
  const flag = (name: string) => rest.includes(`--${name}`);
769
+ // the yolo word at Verified?/Release?/Finish?: the operator said it in chat, then re-run with --confirmed; checks and guardrails stay enforced
770
+ const takeYoloWord = (state: FlowState): string | null => {
771
+ if (!flag("yolo")) return null;
772
+ if (!state.yolo && !flag("confirmed")) return "yolo is the operator's word — the operator must have said it in chat, then re-run with --yolo --confirmed";
773
+ state.yolo = true;
774
+ return null;
775
+ };
769
776
  const slugArg = rest.find((a) => !a.startsWith("--"));
770
777
 
771
778
  switch (sub) {
@@ -1225,11 +1232,9 @@ ${mdDigest(draftRefresh)}`))
1225
1232
  } else did.push("dev: none configured");
1226
1233
  }
1227
1234
  const ran = [branchLine, ...did].join("; ");
1228
- // yolo is the operator's word at Verified? — answers this question and pre-confirms the later ones; --confirmed anchors it, checks and guardrails stay
1229
- if (flag("yolo")) {
1230
- if (!state!.yolo && !flag("confirmed")) return { text: "yolo is the operator's word — the operator must have said it in chat, then re-run with --yolo --confirmed", isError: true };
1231
- state!.yolo = true;
1232
- }
1235
+ // yolo is the operator's word at Verified? — answers this question and pre-confirms the later ones
1236
+ const yoloWord = takeYoloWord(state!);
1237
+ if (yoloWord) return { text: yoloWord, isError: true };
1233
1238
  const audit = flag("confirmed") ? " (confirmed by operator instruction)" : state!.yolo ? " (yolo: pre-confirmed)" : "";
1234
1239
  if (!flag("confirmed") && !state!.yolo) {
1235
1240
  // these commands already ran — say so even on the way out
@@ -1279,11 +1284,9 @@ ${mdDigest(draftRefresh)}`))
1279
1284
  if (err) return err;
1280
1285
  const items = applicableItems(cfg, state!, "pre-release");
1281
1286
  if (flag("no-version")) state!.noVersion = true; // operator's word at Release?: this flow ships without a version bump or tag
1282
- // yolo is the operator's word at Release? — answers this question and pre-confirms Finish?; publishing guardrails stay enforced
1283
- if (flag("yolo")) {
1284
- if (!state!.yolo && !flag("confirmed")) return { text: "yolo is the operator's word — the operator must have said it in chat, then re-run with --yolo --confirmed", isError: true };
1285
- state!.yolo = true;
1286
- }
1287
+ // yolo is the operator's word at Release? — pre-confirms Finish?; publishing guardrails stay enforced
1288
+ const yoloWord = takeYoloWord(state!);
1289
+ if (yoloWord) return { text: yoloWord, isError: true };
1287
1290
  // prep evidence is read from the worktree: the bump and changelog entry exist on the branch before the PR merges
1288
1291
  const wtCwd = gateCwd(root, state!);
1289
1292
  const manifestVer = cfg.versioning.file && existsSync(path.join(wtCwd, cfg.versioning.file))
@@ -1597,10 +1600,8 @@ ${mdDigest(draftRefresh)}`))
1597
1600
  const forgeSkipNote = state!.forgeReleaseSkipped ? ` WARNING: the forge release was not created (${state!.forgeReleaseSkipped}) — recreate it manually or re-run release-done before finishing.` : "";
1598
1601
  // the one finish question — asked after the safety checks so it can never be a wasted question
1599
1602
  // yolo works uniformly at every gate: at Finish? nothing later remains to pre-confirm, the flag just answers this one
1600
- if (flag("yolo")) {
1601
- if (!state!.yolo && !flag("confirmed")) return { text: "yolo is the operator's word — the operator must have said it in chat, then re-run with --yolo --confirmed", isError: true };
1602
- state!.yolo = true;
1603
- }
1603
+ const yoloWord = takeYoloWord(state!);
1604
+ if (yoloWord) return { text: yoloWord, isError: true };
1604
1605
  if (!flag("confirmed") && !state!.yolo) {
1605
1606
  if (!ui.hasUI) return { text: needsOperator(`finish needs the operator: ask them Finish? in chat, then re-run with --confirmed (or run /flow finish interactively)${forgeSkipNote}`, "Finish?"), isError: true };
1606
1607
  const ok = await ui.confirm("Finish feature", `Finish ${state!.slug}?${unmergedNote}${forgeSkipNote} Removes worktree, branch ${state!.branch || "-"} and .dev-flow/${state!.slug}/.`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-dev-flow",
3
- "version": "0.64.1",
3
+ "version": "0.64.2",
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": [