pi-dev-flow 0.77.0 โ†’ 0.77.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,16 @@ Format: newest first. `Unreleased` collects what's merged but not yet tagged.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.77.2] - 2026-11-03
8
+
9
+ ### Changed
10
+ - In pi-web the flow list now lives in the footer itself: the `๐Ÿ’ฌ N flows open` (or bound `<glyph> <slug>`) footer is the clickable chip that expands to the per-flow list, instead of a separate `dev-flow` chip beside it. The panel lists only the flows other than the bound one (that one is the chip's label); alone, it reads `no other flows open`. With nothing open it reads `๐Ÿ’ฌ no flows` and has nothing to expand. The terminal footer is unchanged.
11
+
12
+ ## [0.77.1] - 2026-11-03
13
+
14
+ ### Changed
15
+ - The implement stage spells out when to hand a slice to a `flow_stage` worker and when to stay inline: delegate a slice that is in the plan, provable by `flow check`, needs no operator input and is big enough (โ‰ˆ4+ files or heavy reading) to crowd the driver's context; keep small fixes, mid-debug work, operator-judged work, exploration and final integration inline. Plus how to run workers (one slice at a time, read each diff, review before Verified?). Still advisory: no gate asks who wrote a commit.
16
+
7
17
  ## [0.77.0] - 2026-11-03
8
18
 
9
19
  **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.
@@ -17,7 +17,7 @@ While a feature is active, the extension intercepts every tool call:
17
17
  - **Shell calls can't hang forever**: pi kills a shell command only when the model passed a `timeout` โ€” it omits one in ~75% of calls, so a `gh` waiting on a prompt or a dead `curl` froze sessions for hours. In an initiated repo (`.dev-flow/project.md` exists) every shell call without one therefore gets the class default armed silently (30s quick inspection ยท 120s local git and unknown ยท 180s network ยท 300s containers/services ยท 900s builds/tests/installs ยท 1,200s watchers like `gh run watch`), and absurd explicit values clamp to 1,800s. A project that wants the timeout visible on every call line sets `bashTimeout = require` in `## global` โ€” then a call without one is refused, naming the value it would have armed (each refusal costs a turn, which is why it is no longer the default). Uninitiated folders hear nothing at all: without the playbook dev-flow enforces no rules.
18
18
  - **Compact-aware**: dev-flow paces compaction the way pi counts it: the self-compaction trigger uses the *effective* `reserveTokens` (settings and per-model overrides, not the built-in default) and is checked at every turn end, not only when a run settles. When pi force-compacts on its threshold anyway โ€” the chat-only states (open tier-2 dialog, plan discussion not yet in `plan/`) refuse to self-compact by design โ€” dev-flow takes the compaction over and redoes it with flow-aware summary instructions (overflow recovery keeps pi's compact-and-retry and is left alone). Auto-compaction turned off in settings is honored.
19
19
  - The active stage is injected into the model's context every turn; the bundled `dev-flow` skill is the agent's playbook, including the recommended sequences: pre-release โ€” review (`/flow-review`) โ†’ fixes โ†’ docs โ†’ changelog/version bump; release โ€” PR โ†’ merge โ†’ tag โ†’ `release-done`. The package also bundles the review skills themselves โ€” `/flow-review` (a change, read against its `plan/plan.md`), `/flow-audit` (the whole repo) and `/flow-simplify` (the operative cut: deletes dead and duplicated code, one verified commit at a time) โ€” and injects a built-in senior-discipline guidance at implement stage unless the playbook sets its own `prose.implement`.
20
- - **Status bar**: an initiated repo (`.dev-flow/project.md` exists) always carries the dev-flow footer; while the session **is bound** to a feature it shows `<stage glyph> <slug>` plus mode markers โ€” stages ๐Ÿ“ plan, ๐Ÿ”จ implement, ๐Ÿ” pre-release, ๐Ÿš€ release; markers โšก patch, ๐Ÿ“š docs, ๐ŸŽฑ yolo, `๐Ÿ’ฌ` while a checkpoint (Approve?/Verified?/Release?/Finish?) still waits on the operator's word โ€” the legend's "operator, your turn" glyph, the same one stage lines open with โ€” and `โš ๏ธ` while a check of the bound feature fails (emoji render in their own color, so the footer carries no theme coloring). An **unbound** session never sees a slug โ€” it shows `๐Ÿ’ฌ N flow(s) open` (unfinished-feature count only, no warning marker) or `๐Ÿ’ฌ no flows` when nothing is in flight: the pre-flow glyph, because an unbound session is parked on the operator by definition; a session binds only via `flow start`/`flow use`, never by opening. In **pi-web** the footer text is not clickable, so an initiated repo also carries a `dev-flow` widget there: a chip in the status shelf whose panel expands (click again to collapse) to one lean line per unfinished flow โ€” `โ†’` marks the session's bound flow, the stage word is spelled out, markers and `โš ๏ธ` follow the footer vocabulary โ€” and no chip appears while nothing is open. The TUI never shows it: a widget there is an always-present block, and in a terminal the footer stays the legend. The footer repaints at session start, at the start of every agent run (the earliest a late-attaching web client is listening) and after every gate; an uninitiated folder gets no footer at all. `flow status` is the spelled-out surface: `stage=implement`, the per-feature mode tags (`[ui]`, `[yolo]`, `[no-version]`), the `๐Ÿ’ฌ <word>` marker of a checkpoint the operator has not answered, and the `flow=<ver>` stamp of the build that started the feature.
20
+ - **Status bar**: an initiated repo (`.dev-flow/project.md` exists) always carries the dev-flow footer; while the session **is bound** to a feature it shows `<stage glyph> <slug>` plus mode markers โ€” stages ๐Ÿ“ plan, ๐Ÿ”จ implement, ๐Ÿ” pre-release, ๐Ÿš€ release; markers โšก patch, ๐Ÿ“š docs, ๐ŸŽฑ yolo, `๐Ÿ’ฌ` while a checkpoint (Approve?/Verified?/Release?/Finish?) still waits on the operator's word โ€” the legend's "operator, your turn" glyph, the same one stage lines open with โ€” and `โš ๏ธ` while a check of the bound feature fails (emoji render in their own color, so the footer carries no theme coloring). An **unbound** session never sees a slug โ€” it shows `๐Ÿ’ฌ N flow(s) open` (unfinished-feature count only, no warning marker) or `๐Ÿ’ฌ no flows` when nothing is in flight: the pre-flow glyph, because an unbound session is parked on the operator by definition; a session binds only via `flow start`/`flow use`, never by opening. In **pi-web** status text is not clickable, so there the footer is a widget chip instead: the chip reads exactly the footer text (`๐Ÿ’ฌ 2 flows open`, `๐Ÿ”จ my-feature โšก`) and expands (click again to collapse) to one lean line per *other* unfinished flow โ€” the bound flow is already the chip's label, so it is not repeated (alone in the repo, the panel says `no other flows open`); the stage word is spelled out, markers and `โš ๏ธ` follow the footer vocabulary; with nothing open (`๐Ÿ’ฌ no flows`) it is a plain chip with nothing to expand. The TUI never shows it: a widget there is an always-present block, and in a terminal the footer stays the legend. The footer repaints at session start, at the start of every agent run (the earliest a late-attaching web client is listening) and after every gate; an uninitiated folder gets no footer at all. `flow status` is the spelled-out surface: `stage=implement`, the per-feature mode tags (`[ui]`, `[yolo]`, `[no-version]`), the `๐Ÿ’ฌ <word>` marker of a checkpoint the operator has not answered, and the `flow=<ver>` stamp of the build that started the feature.
21
21
 
22
22
  ## Limitations (deliberate, v1)
23
23
 
@@ -2121,24 +2121,40 @@ function tail(out: string, n = 15): string {
2121
2121
 
2122
2122
  // ------------------------------------------------------------------ extension
2123
2123
 
2124
+ /** The pi-web chip's current key: the chip's label IS the widget key, so it changes with the footer text
2125
+ * and the previous one must be cleared on every repaint. */
2126
+ let webChipKey: string | undefined;
2127
+
2124
2128
  /** Compact footer: bound flow = stage glyph, slug, mode markers, โš ๏ธ on its failing checks; unbound = the
2125
2129
  * unfinished-flow count, or `๐Ÿ’ฌ no flows` โ€” an initiated repo always carries the footer. An uninitiated
2126
- * folder gets nothing: the status is cleared. In pi-web the footer text is not clickable, so the same
2127
- * snapshot also feeds a flow-list widget (a `dev-flow` chip whose panel lists every open flow, one lean
2128
- * line each). Pure read โ€” rendering never binds or claims anything. */
2130
+ * folder gets nothing: the status is cleared. In pi-web the footer text is not clickable, so there the
2131
+ * footer IS a widget: one chip labelled with the footer text whose panel lists every open flow, one lean
2132
+ * line each (no lines โ†’ a plain, non-expandable chip). Pure read โ€” rendering never binds or claims anything. */
2129
2133
  function refreshStatus(ctx: ExtensionContext, root: string): void {
2130
2134
  if (!ctx.hasUI) return;
2135
+ const web = ctx.mode !== "tui";
2136
+ const setChip = (key: string | undefined, lines?: string[]) => {
2137
+ if (webChipKey !== undefined && webChipKey !== key) ctx.ui.setWidget(webChipKey, undefined);
2138
+ webChipKey = key;
2139
+ if (key !== undefined) ctx.ui.setWidget(key, lines);
2140
+ };
2131
2141
  if (!initiated(root)) {
2132
2142
  ctx.ui.setStatus("dev-flow", undefined);
2133
- if (ctx.mode !== "tui") ctx.ui.setWidget("dev-flow", undefined);
2143
+ if (web) setChip(undefined);
2134
2144
  return;
2135
2145
  }
2136
2146
  const un = unfinishedStates(root);
2137
2147
  const bound = boundFeature(root, sessionKey(ctx));
2138
- ctx.ui.setStatus("dev-flow", statusFor(bound, un.length).text);
2148
+ const text = statusFor(bound, un.length).text;
2139
2149
  // TUI keeps the footer as its only surface: a lines-widget there is an always-present block above the
2140
- // editor (no click to collapse), which competes with "the footer is the legend". pi-web gets the chip.
2141
- if (ctx.mode !== "tui") ctx.ui.setWidget("dev-flow", un.length ? widgetLines(bound, un) : undefined);
2150
+ // editor (no click to collapse), which competes with "the footer is the legend". pi-web shows the footer
2151
+ // text once, as the chip itself โ€” a status line beside it would only repeat it.
2152
+ if (!web) {
2153
+ ctx.ui.setStatus("dev-flow", text);
2154
+ return;
2155
+ }
2156
+ ctx.ui.setStatus("dev-flow", undefined);
2157
+ setChip(text, widgetLines(bound, un));
2142
2158
  }
2143
2159
 
2144
2160
 
@@ -2269,7 +2285,7 @@ export default function devFlow(pi: ExtensionAPI) {
2269
2285
  name: "flow_stage",
2270
2286
  label: "Stage worker",
2271
2287
  description:
2272
- 'Optional: hand a slice of work to a fresh pi session so this conversation stays lean. op "implement" (stage implement) โ€” the worker edits and commits a slice on the feature branch; op "review" (implement or pre-release) โ€” a fresh read-only reviewer that returns findings and a PASS/FAIL verdict (advisory: no gate depends on it); op "reflect" (any stage, standard at finish) โ€” a fresh read-only reviewer of this session\'s transcript and every worker transcript that returns classified reflection findings (docs / code / plugin) with a fold-or-drop recommendation each, for the operator to decide. The plan path, branch, commits so far and the project checks are added to the brief automatically โ€” `note` is just the slice: what to do, operator answers and decisions the worker cannot see. The worker holds no flow tool; gates and checkpoints stay with you. Small work and small fixes are fine to do inline. In pi-web the worker appears in the session\'s Agents menu as a subagent (running while it works, then its final status); the opened transcript holds its report.',
2288
+ 'Optional: hand a slice of work to a fresh pi session so this conversation stays lean. op "implement" (stage implement) โ€” the worker edits and commits a slice on the feature branch; op "review" (implement or pre-release) โ€” a fresh read-only reviewer that returns findings and a PASS/FAIL verdict (advisory: no gate depends on it); op "reflect" (any stage, standard at finish) โ€” a fresh read-only reviewer of this session\'s transcript and every worker transcript that returns classified reflection findings (docs / code / plugin) with a fold-or-drop recommendation each, for the operator to decide. The plan path, branch, commits so far and the project checks are added to the brief automatically โ€” `note` is just the slice: what to do, operator answers and decisions the worker cannot see. The worker holds no flow tool; gates and checkpoints stay with you. Delegate an implement slice when it is in the plan, provable by flow check, needs no operator input mid-slice and is big enough (โ‰ˆ4+ files or heavy reading) to crowd this context; small work, small fixes, mid-debug work, operator-judged work and final integration stay inline (criteria: references/implement.md). In pi-web the worker appears in the session\'s Agents menu as a subagent (running while it works, then its final status); the opened transcript holds its report.',
2273
2289
  promptSnippet: 'flow_stage(op: "implement"|"review"|"reflect", note, label?) โ€” optional fresh-session worker for a big implement slice, an independent review, or the end-of-session reflection (finish); gates stay with you; in pi-web workers show up as subagents in the Agents menu',
2274
2290
  parameters: Type.Object({
2275
2291
  op: Type.String({ description: '"implement" (a worker edits + commits a slice), "review" (read-only reviewer, findings + verdict) or "reflect" (read-only reviewer of the session transcripts, reflection findings + fold/drop recommendations)' }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-dev-flow",
3
- "version": "0.77.0",
3
+ "version": "0.77.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": [
@@ -50,6 +50,45 @@ Big slices can go to a worker so this conversation stays lean; small work and
50
50
  small fixes are fine inline. **Delegation is a tool, not a rule** โ€” no gate
51
51
  asks who wrote a commit.
52
52
 
53
+ **The rule of thumb:** delegate a slice when it is in the plan, provable by
54
+ `flow check`, needs no operator input, and is large enough (โ‰ˆ4+ files or heavy
55
+ reading) that doing it here would crowd out the context you need for verify;
56
+ otherwise do it inline. The worker starts fresh and is briefed with the plan,
57
+ commits and checks, but it cannot see this chat, cannot ask the operator and
58
+ holds no gate.
59
+
60
+ Delegate when most of these hold:
61
+ - **Specifiable** โ€” the slice fits a short `note`; its decisions are in
62
+ `plan.md`, not only in chat (write them there first if they are not).
63
+ - **Mechanically done** โ€” `flow check` green plus an acceptance criterion you
64
+ can state proves it.
65
+ - **Broad** โ€” โ‰ˆ4+ files, a few hundred lines, or a lot of reading this session
66
+ will not need again (a mechanical sweep, a new module with its tests, a
67
+ migration).
68
+ - **Clean boundary** โ€” it does not overlap uncommitted work in progress.
69
+ - **Context pressure** โ€” this conversation is past ~40โ€“50% of its window;
70
+ delegating beats compacting away detail.
71
+ - **Hands-off** โ€” nothing mid-slice needs the operator.
72
+
73
+ Stay inline when any of these hold:
74
+ - **Small** โ€” one or two files, a review finding, a verify follow-up, an
75
+ operator tweak: the note would cost more than the change.
76
+ - **Context already loaded** โ€” mid-debug, you hold the failure; a handoff
77
+ throws that away.
78
+ - **Still being decided** โ€” the approach is still moving in chat.
79
+ - **Operator-judged** โ€” a UI pass, tier-2 items, anything that ends in a
80
+ question to the operator.
81
+ - **Integration** โ€” the final wiring and polish before Verified? is yours: you
82
+ own verify.
83
+ - **Exploratory** โ€” "find out why X": what you learn shapes the next step, and
84
+ a worker's summary is lossy.
85
+
86
+ Running it: one slice per worker, in sequence โ€” read each returned diff before
87
+ briefing the next. Slice along the plan's steps, never into half-working
88
+ commits. When workers wrote most of the code, run a `review` before Verified?.
89
+ A worker that fails or stalls โ†’ take the slice over inline rather than
90
+ resending the same note.
91
+
53
92
  - `flow_stage({ op: "implement", note, label })` โ€” a fresh pi session in the
54
93
  worktree, with read/bash/edit/write, edits and commits one slice. The tool
55
94
  adds the facts itself: the absolute plan path, the branch's commits, the
package/src/core.ts CHANGED
@@ -1441,15 +1441,18 @@ export function statusFor(bound: FlowState | null, openCount: number): { text: s
1441
1441
  return { text: `๐Ÿ’ฌ ${openCount} flow${openCount === 1 ? "" : "s"} open` };
1442
1442
  }
1443
1443
 
1444
- /** The pi-web widget panel's lines: one lean line per unfinished flow โ€” `โ†’` marks this session's bound
1445
- * flow, glyph + markers ride on statusCompact so the panel and the footer never drift in vocabulary โ€”
1446
- * plus the spelled-out stage word and the `โš ๏ธ` on failing checks the compact footer cannot show. The
1447
- * panel is the glance surface; `flow status` stays the detailed one. Empty in, empty out (the caller
1448
- * clears the widget โ€” no chip with nothing to expand). */
1444
+ /** The pi-web footer chip's panel lines: the chip's label already is this session's footer (the bound
1445
+ * flow, or the open count), so the panel lists only the OTHER unfinished flows, one lean line each โ€”
1446
+ * glyph + markers ride on statusCompact so panel and footer never drift in vocabulary โ€” plus the
1447
+ * spelled-out stage word and the `โš ๏ธ` on failing checks. A bound session alone in the repo gets one
1448
+ * "no other flows open" line (the chip still expands, never looks dead); unbound with nothing open
1449
+ * gets no lines (a plain `๐Ÿ’ฌ no flows` chip). `flow status` stays the detailed surface. */
1449
1450
  export function widgetLines(bound: FlowState | null, states: FlowState[]): string[] {
1450
- return states.map((st) => {
1451
+ const others = states.filter((st) => st.slug !== bound?.slug);
1452
+ if (bound && !others.length) return ["no other flows open"];
1453
+ return others.map((st) => {
1451
1454
  const { text, failed } = statusCompact(st);
1452
- return `${st.slug === bound?.slug ? "โ†’" : " "} ${text} ยท ${st.stage}${failed ? " โš ๏ธ" : ""}`;
1455
+ return `${text} ยท ${st.stage}${failed ? " โš ๏ธ" : ""}`;
1453
1456
  });
1454
1457
  }
1455
1458