pi-dev-flow 0.65.1 → 0.66.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,7 +4,12 @@ Format: newest first. `Unreleased` collects what's merged but not yet tagged.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
- ## [0.65.1] - 2026-10-27
7
+ ## [0.66.0] - 2026-10-27
8
+
9
+ ### Changed
10
+
11
+ - **The approve gate now proves what the plan prose always demanded.** A regular feature needs `plan/plan.md` **by name** — a preliminary direction belongs inside plan.md (marked draft); a separate `pre-plan`/`direction.md` file no longer opens the gate (the old check accepted any `*.md`, which let a direction draft stand in for the plan). For `--ui` features the gate opens plan.md itself and refuses every render file under `plan/` that is not embedded with `![...](…)` and every `mockups/<screen>.html` that carries no embedded `<screen>-<width>.` shot — an unrendered or unembedded screenshot is one the operator never saw. Glob matching (incl. `mockupGlobs`) is case-insensitive, so `Screenshot.PNG` can no longer slip the `*.png` proof.
12
+ - **`flow verify` proves a live app before asking Verified?.** With a `health` command configured and no `dev` deploy, verify now re-probes the app itself (`health: live re-probe PASS`) instead of trusting the `flow check` record — a green record survives a killed server (process death dirties no worktree fingerprint), so a dead app now refuses with `live probe FAILED … start it and rerun` rather than letting the operator be asked to review nothing. With `dev` configured the existing post-deploy probe still proves liveness. The implement nextHint and stage reference state the rule the gates now enforce: keep the app running until the checkpoint is answered.
8
13
 
9
14
  ### Changed
10
15
 
package/docs/gates.md CHANGED
@@ -11,11 +11,11 @@ so it needs no `--confirmed`.
11
11
  |---|---|---|
12
12
  | `start <slug> [--ui] [--patch|--docs --confirmed] [--merge=squash\|merge\|rebase\|any] [--check-upstream]` | → plan | slug is new (binds the session); relaxed modes are operator-granted in chat, anchored by `--confirmed`: `--patch` = chore release, no plan document, every gate unchanged; `--docs` = docs-only, no plan document and no tier-1 checks (worktree and release intact). Start prints the dev-flow build and stamps it into the feature state (`flow status` shows `flow=<ver>`), warns when **this session runs an older build than the checkout** (`--check-upstream` also asks npm for the published one), prints the playbook gaps `flow doctor` would report — and **refuses while the playbook has no `merge` policy**: it names the question (squash / merge / rebase / any), the style its own history suggests, and the re-run `--merge=<style> --confirmed`, which writes the answer into `## release` (single-line insert, validated, `.bak` kept, committed as a playbook chore only when the playbook is the only dirty path) and never asks again |
13
13
  | `use <slug>` | — (binds this session to a feature) | slug unfinished — the binding is persisted to disk as a claim (`flow version` lists every dev-flow copy registered in the process, and a copy whose in-memory bindings never saw the bind attributes commands from the claim, so a two-sources setup does not misjudge your git) |
14
- | `approve [--yolo]` | plan → implement (creates worktree + branch) | `plan/*.md` exists; if `--ui`, rendered mockup screenshots (per `mockupGlobs`, default `*.png`) exist under `plan/` — headless chromium renders embedded in plan.md; **one question** — or `--confirmed` after you answered in chat; **yolo** (your chat answer at **any** checkpoint question) → run that gate with `--yolo --confirmed` (`approve`/`verify`/`release`/`finish`): that question is answered and every later one (Verified?/Release?/Finish?) is pre-confirmed — the agent then runs the remaining gates back to back, honoring guidance attached to the yolo word (e.g. "yolo, create a patch version release") — checks and guardrails stay fully enforced. `commands.setup` runs in the worktree and is retried until it succeeds once (a worktree left behind by a failed setup is set up on the next `approve`, never silently reused); a `--docs` feature runs no project command at all and says `setup skipped (docs mode)` |
14
+ | `approve [--yolo]` | plan → implement (creates worktree + branch) | `plan/plan.md` exists **by name** (a separate pre-plan/direction file does not open the gate — a preliminary direction belongs inside plan.md); if `--ui`, rendered mockup screenshots (per `mockupGlobs`, default `*.png`) exist under `plan/` — headless chromium renders embedded in plan.md, and the gate opens plan.md to prove it: every image file under `plan/` must appear in an embed (`![...](…)`, case-insensitive) and every `mockups/<screen>.html` must carry an embedded `<screen>-<width>.` shot; **one question** — or `--confirmed` after you answered in chat; **yolo** (your chat answer at **any** checkpoint question) → run that gate with `--yolo --confirmed` (`approve`/`verify`/`release`/`finish`): that question is answered and every later one (Verified?/Release?/Finish?) is pre-confirmed — the agent then runs the remaining gates back to back, honoring guidance attached to the yolo word (e.g. "yolo, create a patch version release") — checks and guardrails stay fully enforced. `commands.setup` runs in the worktree and is retried until it succeeds once (a worktree left behind by a failed setup is set up on the next `approve`, never silently reused); a `--docs` feature runs no project command at all and says `setup skipped (docs mode)` |
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`), 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 | 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; 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; 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` |
@@ -938,6 +938,7 @@ async function gateVerify(o: GateCtx): Promise<RunResult> {
938
938
  did.push(`build ran (${cfg.commands.build})`);
939
939
  }
940
940
  // deploy to dev before asking — the operator reviews the running dev app, not a promise
941
+ const probe = healthProbe(cfg);
941
942
  if (cfg.commands.dev) {
942
943
  const res = await sh(cfg.commands.dev, gateCwd(root, state!));
943
944
  state!.checks.dev = { ok: res.ok, at: now() };
@@ -948,7 +949,6 @@ async function gateVerify(o: GateCtx): Promise<RunResult> {
948
949
  // still serves the previous build, must not pass on a health PASS recorded before it was
949
950
  // recreated. What "the expected version" means is the project's business — the probe runs in
950
951
  // the worktree cwd, so it can compare the served build stamp with `git rev-parse HEAD`.
951
- const probe = healthProbe(cfg);
952
952
  if (!probe) did.push("health: none configured");
953
953
  else {
954
954
  const seedFail = await seedStep(root, state!, cfg);
@@ -962,7 +962,22 @@ async function gateVerify(o: GateCtx): Promise<RunResult> {
962
962
  if (!probed.ok) return { text: `post-deploy probe FAILED (${probe}) — the deploy is not healthy / not serving this build (gave up after ${probed.attempts} attempt(s), healthWait ${cfg.healthWait}s):\n${tail(probed.out)}`, isError: true };
963
963
  did.push(`health: PASS (${probe}${tried})`);
964
964
  }
965
- } else did.push("dev: none configured");
965
+ } else if (!probe) did.push("dev: none configured");
966
+ else {
967
+ // no deploy to prove, but the operator still reviews a live app — and a green health record
968
+ // survives a killed server (process death dirties no worktree fingerprint), so the record
969
+ // cannot stand for liveness: re-probe, before anyone is asked.
970
+ const seedFail = await seedStep(root, state!, cfg);
971
+ if (seedFail) return seedFail;
972
+ const probed = await runHealthProbe(probe, gateCwd(root, state!), cfg.healthWait);
973
+ state!.checks.health = { ok: probed.ok, at: now() };
974
+ await stampChecks(root, state!, ["health"]);
975
+ writeState(root, state!);
976
+ const tried = probed.attempts > 1 ? `, ${probed.attempts} attempts` : "";
977
+ if (!probed.ok)
978
+ return { text: `live probe FAILED (${probe}) — nothing is answering and no dev deploy is configured: the app the operator must review has to be running before verify — start it and rerun (gave up after ${probed.attempts} attempt(s), healthWait ${cfg.healthWait}s):\n${tail(probed.out)}`, isError: true };
979
+ did.push(`health: live re-probe PASS (${probe}${tried})`);
980
+ }
966
981
  }
967
982
  const ran = [branchLine, ...did].join("; ");
968
983
  // yolo is the operator's word at Verified? — answers this question and pre-confirms the later ones
@@ -1598,7 +1613,11 @@ async function gateApprove(o: GateCtx): Promise<RunResult> {
1598
1613
  const { root, ui, sess, cfg, flag, slugArg } = o;
1599
1614
  const { state, err } = needState(root, sess, slugArg);
1600
1615
  if (err) return err;
1601
- const errs = approveGate(state!, cfg, listFiles(path.join(featDir(root, state!.slug), "plan")));
1616
+ const planDir = path.join(featDir(root, state!.slug), "plan");
1617
+ // the embed proofs read the plan document itself: a render that exists on disk but is not
1618
+ // embedded in plan.md is one the operator would never be shown
1619
+ const planMd = path.join(planDir, "plan.md");
1620
+ const errs = approveGate(state!, cfg, listFiles(planDir), existsSync(planMd) ? readFileSync(planMd, "utf8") : undefined);
1602
1621
  if (errs.length) return { text: `plan gate FAILED:\n- ${errs.join("\n- ")}`, isError: true };
1603
1622
  const planItems = applicableItems(cfg, state!, "plan");
1604
1623
  if (flag("yolo")) state!.yolo = true; // operator's word at Approve? — every later gate question is pre-confirmed; checks and guardrails stay
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-dev-flow",
3
- "version": "0.65.1",
3
+ "version": "0.66.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": [
@@ -35,8 +35,11 @@ feature).
35
35
  up to `healthWait` (default 30s) — a service needing a moment after its
36
36
  container starts is not a failed deploy; say so rather than declaring a
37
37
  healthy deploy broken. Walk the **tier-2 checklist** (`- [ ]`) with the
38
- operator honestly — it cannot be scripted. Then ask **Verified?** →
39
- `flow verify --confirmed`. Checkpoint report: stage line **🔨 implement ·
38
+ operator honestly — it cannot be scripted. Keep the app **running** when
39
+ you ask **Verified?** → `flow verify --confirmed` — the operator reviews
40
+ the live app, so never tear the test server down before the checkpoint is
41
+ answered (with no `dev` deploy configured, `flow verify` live-re-probes
42
+ `health` itself and refuses while nothing is answering). Checkpoint report: stage line **🔨 implement ·
40
43
  `<slug>`** — commits `N ahead, M uncommitted` · tier-1 · tier-2 · deploy/
41
44
  health · `branch@sha`, then `Done:`/`Next steps:` per the Stage reports rule. Fixes = iterate and re-verify; that loop is
42
45
  free.
@@ -13,7 +13,11 @@
13
13
  keep it current**: create the file the moment the direction is confirmed —
14
14
  don't wait for the finished plan — and amend it in the file as the discussion
15
15
  continues. Plan talk held only in the conversation is gone when pi
16
- auto-compacts mid-stage; the gate reviews the file, not the memory. First check
16
+ auto-compacts mid-stage; the gate reviews the file, not the memory. The file
17
+ name is itself the gate's proof: **plan.md** — a preliminary direction
18
+ belongs *inside* plan.md (marked draft), never a separate
19
+ `pre-plan`/`direction.md` file: the approve gate requires plan.md by name.
20
+ First check
17
21
  `git log origin/<default>..<default> --oneline`: local-only default-branch
18
22
  commits fall out of the worktree's base (push them or re-plan).
19
23
  4. **UI flag set?** Mockups live in `plan/mockups/`, one HTML per screen/state
@@ -29,7 +33,9 @@
29
33
  - Embed every render in plan.md under its section —
30
34
  `![<screen> — phone](mockups/<screen>-390.png)`. Image syntax only (a
31
35
  filename in prose is a broken link); before Approve? re-check that every
32
- tag points at an existing file.
36
+ tag points at an existing file. The approve gate proves this: it opens
37
+ plan.md and refuses every render file that is not embedded, and every
38
+ `mockups/<screen>.html` with no embedded `<screen>-<width>.` shot.
33
39
  - No chromium anywhere → tell the operator and ask; `*.html`-only plans
34
40
  only with their OK (knob: `mockupGlobs`); never fake or skip silently.
35
41
  - Gotchas: for a component question prefer a **static strip** — standalone
package/src/core.ts CHANGED
@@ -227,16 +227,43 @@ export function listFiles(dir: string): string[] {
227
227
  }
228
228
 
229
229
  function matchesGlob(file: string, globs: string[]): boolean {
230
- return globs.some((g) => (g.startsWith("*.") ? file.endsWith(g.slice(1)) : file.includes(g)));
230
+ const f = file.toLowerCase();
231
+ return globs.some((g) => {
232
+ const glob = g.toLowerCase();
233
+ return glob.startsWith("*.") ? f.endsWith(glob.slice(1)) : f.includes(glob);
234
+ });
231
235
  }
232
236
 
233
- /** Gate: plan → implement. Returns reasons it cannot advance (empty = pass). */
234
- export function approveGate(state: FlowState, cfg: Config, planFiles: string[]): string[] {
237
+ /** Image extensions the embed proof keys on — independent of mockupGlobs: whatever the operator
238
+ * configured as the render proof, a render nobody embedded is one the operator never saw. */
239
+ const IMG_EXT = /\.(?:png|jpe?g|webp|gif)$/i;
240
+
241
+ /** Gate: plan → implement. Returns reasons it cannot advance (empty = pass).
242
+ * planDoc is the text of plan/plan.md (undefined = absent) — the embed proofs read the plan
243
+ * document itself. Before it, the gate checked only that *a* *.md and *a* *.png existed, which
244
+ * let a pre-plan/direction file with unembedded screenshots walk through Approve. */
245
+ export function approveGate(state: FlowState, cfg: Config, planFiles: string[], planDoc?: string): string[] {
235
246
  const errs: string[] = [];
236
247
  if (state.stage !== "plan") errs.push(`stage is "${state.stage}", approval only applies to "plan"`);
237
- if (!state.patch && !state.docs && !planFiles.some((f) => f.endsWith(".md"))) errs.push("plan/ must contain the written plan (*.md)");
248
+ if (!state.patch && !state.docs && !planFiles.includes("plan.md"))
249
+ errs.push("plan/plan.md is missing — the plan IS plan.md (a preliminary direction belongs inside it, marked draft; a separate pre-plan/direction file does not open the gate)");
238
250
  if (state.ui && !planFiles.some((f) => matchesGlob(f, cfg.mockupGlobs)))
239
251
  errs.push(`UI feature: plan/mockups/ must contain rendered screenshots matching ${cfg.mockupGlobs.join(", ")} (headless chromium, embedded in plan.md)`);
252
+ if (state.ui && planDoc !== undefined) {
253
+ // ![alt](mockups/screen-390.png) with an optional "title" tolerated; matching is case-insensitive
254
+ const embeds = [...planDoc.matchAll(/!\[[^\]]*\]\(\s*<?([^)\s>]+)>?(?:\s+"[^"]*")?\s*\)/g)].map((m) => m[1].toLowerCase());
255
+ const unembedded = planFiles.filter((f) => IMG_EXT.test(f) && !embeds.some((e) => e === f.toLowerCase() || e.endsWith("/" + f.toLowerCase())));
256
+ if (unembedded.length) errs.push(`plan.md must embed every render — missing embed: ${unembedded.join(", ")} (write ![<screen> — width](mockups/<file>) under the screen's section)`);
257
+ // the naming plan.md prescribes (screen.html → screen-<width>.png): a mockups/*.html with no
258
+ // embedded shot of its own was never rendered
259
+ const unrendered = planFiles
260
+ .filter((f) => /^mockups\/[^/]+\.html$/i.test(f))
261
+ .filter((f) => {
262
+ const stem = f.toLowerCase().replace(/\.html$/, "").split("/").pop()!;
263
+ return !embeds.some((e) => (e.split("/").pop() ?? "").startsWith(stem) && IMG_EXT.test(e));
264
+ });
265
+ if (unrendered.length) errs.push(`mockups without an embedded render — ${unrendered.join(", ")} (render each screen and name the shot after it: <screen>-<width>.png)`);
266
+ }
240
267
  return errs;
241
268
  }
242
269
 
@@ -1776,7 +1803,7 @@ export function nextHint(state: FlowState, cfg: Config): string {
1776
1803
  return `investigate, present your direction and proposed mode to the operator and clarify in chat, then write the plan into .dev-flow/${state.slug}/plan/plan.md${state.ui ? ` and render mockups to plan/mockups/ (${cfg.mockupGlobs.join(", ")}) with headless chromium, embedded in plan.md` : ""}, then ask the operator Approve? in chat and run flow approve --confirmed when they answer`;
1777
1804
  case "implement":
1778
1805
  if (state.docs) return `implement in the worktree ${state.worktree} — docs mode runs no project command (no build, no dev deploy, no health probe); tick the tier-2 checklist with the operator, then ask them Verified? in chat and run flow verify --confirmed when they answer`;
1779
- return `implement in the worktree ${state.worktree}, add tests, run flow check (tier-1 checks, incl. health with seeded data); tick the tier-2 checklist with the operator, then ask them Verified? in chat and run flow verify --confirmed when they answer`;
1806
+ return `implement in the worktree ${state.worktree}, add tests, run flow check (tier-1 checks, incl. health with seeded data); tick the tier-2 checklist with the operator, then ask them Verified? in chat and run flow verify --confirmed when they answer — keep the app running when you ask Verified?: the operator reviews the live app; never clean up the test server before the checkpoint is answered (with no dev deploy configured, verify live-re-probes health itself and refuses while nothing is answering)`;
1780
1807
  case "pre-release":
1781
1808
  return `${cfg.release.review} → fix must-have/should-have → update docs${cfg.release.changelog ? ` → prepare ${cfg.release.changelog} (a heading for the new version, carrying every pending Unreleased line over as it stands)` : ""}${cfg.versioning.file ? ` → bump version in ${cfg.versioning.file}` : ""}, re-run flow check, then show the operator the PR summary, version and changelog, ask Release? and run flow release`;
1782
1809
  case "release":