pi-dev-flow 0.83.1 → 0.84.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.84.0] - 2026-11-05
8
+
9
+ **A yolo given early no longer ships commits nobody saw, and per-machine ignored files are writable without a flow.**
10
+
11
+ ### Fixed
12
+ - **A yolo given early no longer ships commits nobody saw** (fixes #176). In this case a yolo at plan pre-answered Release?, and a fix that landed after Verified? shipped with only an after-the-fact warning. Now a standing yolo does not answer Release? while non-prep commits sit after Verified?: the gate asks Release? and names those commits. `--confirmed` (the operator's own answer, including a yolo said at Release?) still passes.
13
+ - **An unbound session can write a path git ignores** (fixes #175). This covers a per-machine file such as a local secrets note listed in `.git/info/exclude`. Before this, the guard refused it, so agents wrote it from bash instead. Tracked and untracked-unignored paths are still refused, and the refusal now names the `.git/info/exclude` route.
14
+
15
+ ### Added
16
+ - **`yolo = until-release`** in a playbook's `## release` block. In that project a yolo given at an earlier checkpoint never answers Release?, for repos whose rules want the release word given after the commits exist. A junk value warns and keeps the default, `all`.
17
+
7
18
  ## [0.83.1] - 2026-11-05
8
19
 
9
20
  **A worker whose model is down is reported as down, not nudged as a stall.**
package/README.md CHANGED
@@ -129,7 +129,8 @@ Your answers at a checkpoint:
129
129
  - **yes** — or **no**, with the reason. The agent fixes it and asks again; that loop is free.
130
130
  - **yolo** — answers this checkpoint *and* pre-confirms the rest, so the remaining gates run back to
131
131
  back with every check still enforced. Attach your wishes to the word: *"yolo, patch bump"*,
132
- *"yolo, no tag"*.
132
+ *"yolo, no tag"*. Release? is asked anyway when commits landed after Verified?, or always when
133
+ the playbook sets `yolo = until-release` under `## release`.
133
134
  - **no version this time** (at Release?) — merge and changelog land, no bump or tag; the next
134
135
  versioned release folds your `Unreleased` entry under its heading.
135
136
 
@@ -230,7 +231,8 @@ While a feature is active, every tool call passes a guard:
230
231
  - no commit, merge or push to the default branch outside the release stage (plus a git hook for work outside Pi);
231
232
  - at plan stage the agent can only write inside its own feature folder;
232
233
  - at implement/pre-release it can only write inside its own worktree;
233
- - with a `.dev-flow/` present, an unbound session cannot edit source at all — everything goes through the flow;
234
+ - with a `.dev-flow/` present, an unbound session cannot edit source at all — everything goes through the flow
235
+ (a path git ignores, such as a per-machine secrets file, stays writable: it can never reach a commit);
234
236
  - `.dev-flow/*/state.json` is unwritable by the agent, so gates cannot be skipped or forged;
235
237
  - `project.md` is yours: the agent cannot write it (except inside a docs/patch flow), and every
236
238
  sanctioned overwrite keeps a `.bak`;
package/docs/gates.md CHANGED
@@ -16,7 +16,7 @@ so it needs no `--confirmed`.
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
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 — except a **release-only flow** (#161): on a versioned project an empty branch over unreleased commits on the default branch (since the newest local version tag, or all of them before the first release) passes, the line says `release-only flow: N unreleased commit(s)`, and the version bump is the pre-release commit; with nothing unreleased the refusal says there is nothing to release; 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
- | `release [--yolo|--no-version|--no-fold-check|--no-marker-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 branch adds no merge-conflict marker lines** vs its merge base (#164: a hand-resolved merge that kept a `<<<<<<<`/`>>>>>>>` line is refused with `file:line`; `--no-marker-check` on the operator's word when the lines are meant); **commits after Verified?** are named in the Release? question and the approved line (#162: the operator's word covers the HEAD verify stamped — a warning, never a refusal); **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`** (a `--docs` flow is exempt — #163: a playbook/docs change owes no user-facing entry; one it writes is welcome, not proven) (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) |
19
+ | `release [--yolo|--no-version|--no-fold-check|--no-marker-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 branch adds no merge-conflict marker lines** vs its merge base (#164: a hand-resolved merge that kept a `<<<<<<<`/`>>>>>>>` line is refused with `file:line`; `--no-marker-check` on the operator's word when the lines are meant); **commits after Verified?** are named in the Release? question and the approved line (#162: the operator's word covers the HEAD verify stamped — a warning, never a refusal); a **standing yolo** (given at an earlier checkpoint) does not answer Release? when such commits exist, nor ever under `yolo = until-release` in `## release` — the gate returns NEEDS-OPERATOR Release? (gh#176), while `--confirmed` (the operator's answer, a yolo said at Release? included) still passes; **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`** (a `--docs` flow is exempt — #163: a playbook/docs change owes no user-facing entry; one it writes is welcome, not proven) (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] [--no-reflect] [--note=<text>] [slug]` | release → done — **first run the closing reflection**: while no reflection is recorded for the flow, finish starts the reflect worker before it touches anything and stops for the operator's fold/drop (or Finish? when nothing was found); the re-run with `--confirmed` does the cleanup. `--no-reflect --confirmed` skips it on the operator's explicit word (yolo never does); `--note=` hands the worker the operator's friction notes. Cleanup (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
22
  | `reflect ["<note>"|list|tidy|move <n> --playbook|--code|done <n> ["<what>"]]` | — | `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; `reflect done <n> ["<what>"]` checks a fixed one off (`— fixed: <date> <slug> — <what>`) so doctor stops re-reporting it; 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 |
@@ -9,7 +9,7 @@ While a feature is active, the extension intercepts every tool call:
9
9
  - **Work stays in the worktree**: at stages `implement` and `pre-release`, edits are confined to that feature's worktree — judged per-path by the owning feature, so one session can never write into another session's worktree or into the main checkout. A throwaway **outside** the checkout is not feature work and stays free at every stage (the OS temp dir, e.g. a one-off rewrite script): both sides are realpath'd, so a symlink out of the temp dir is still judged as the repo path it writes, and a repository that merely lives under the temp dir (a test repo) keeps the stage rules. For a bound feature that scratch lives in the feature itself: every bash call the guards let through, and every project command a gate runs (test, checks, build, dev, seed, health), gets `TMPDIR=.dev-flow/<slug>/tmp/`, so `mktemp`, `os.tmpdir()` and test-suite fixtures land there and `flow finish` (or `flow abort`) removes them. Unbound sessions keep the OS temp dir.
10
10
  - **Shipping waits for `flow release`**: while a bound feature is at `plan`, `implement` or `pre-release`, cutting or pushing a tag (`git tag <name>`, `git push --tags`, `refs/tags/…`), merging its PR (`gh pr merge`, `glab mr merge`) and creating a forge release (`gh|glab release create`) are refused with "run flow release first". Shipping by hand first left `flow release` unable to record the release ("already tagged") and the flow unable to close. Reads (`git tag -l`, `gh pr view`) and opening the PR at pre-release are unaffected.
11
11
  - **A feature worktree keeps its branch**: creating a branch inside a feature worktree (`git checkout -b`, `git switch -c`) is refused. An unrelated fix is its own flow (`flow start <slug> --patch --confirmed`), not a side branch in someone's worktree. A session whose cwd is a feature worktree is judged by the **main checkout's** `.dev-flow/` state, which is where the features live.
12
- - **Flow by default**: in a repo with `.dev-flow/`, an unbound session cannot touch source files at all — every request goes through `flow start`/`flow use`; there is no bypass. `flow start` refuses when the main checkout isn't on the default branch, worktrees are always created from the default branch, and the agent cannot check feature branches out in the main checkout.
12
+ - **Flow by default**: in a repo with `.dev-flow/`, an unbound session cannot touch source files at all — every request goes through `flow start`/`flow use`; there is no bypass. A path git ignores (`git check-ignore`, e.g. a per-machine secrets file listed in `.git/info/exclude`) is not source and stays writable unbound. Tracked and untracked-unignored paths are refused, and the refusal names that route (gh#175). `flow start` refuses when the main checkout isn't on the default branch, worktrees are always created from the default branch, and the agent cannot check feature branches out in the main checkout.
13
13
  - **Gates can't be skipped**: flow state is untouchable by the agent (edit tool and bash) — writing `state.json` or `claim.json`, moving either away, or deleting a feature directory or the whole `.dev-flow/` folder all block, at a relative **or an absolute** path (an absolute path names the same folder); the `project.md` playbook is operator-owned — the main-checkout copy is blocked for the agent outright, and only a **docs or patch flow's** worktree copy may be edited (normal features route playbook changes to their own flow); every sanctioned playbook overwrite keeps the previous file as `project.md.bak`; every recorded check carries a fingerprint of the worktree it ran against (paths, uncommitted diff, HEAD) — an edit-tool change clears the records at once, and any other write (`sed -i`, a formatter, codegen through bash) is caught at the gate itself, which reruns what went stale and says so; edit/write paths are judged by realpath, so a symlink out of the worktree cannot launder a confined write.
14
14
  - **Your project's own rules**: every `deny`/`confirm`/`protect`/`forbid` rule from the `flow-guard` block in project.md `## global` runs on every bash command and every edit/write path — in every stage and binding, ahead of dev-flow's own verdicts. A block always carries the reason you wrote.
15
15
  - **The rules reach the agent, they are not left in a file it may never read**: pi advertises a skill and loads it only if the model chooses to, so the ground rules of the dev-flow skill are injected into every session once (and again after a compaction that summarized them away), and each stage's turn names the one playbook file that stage needs. The guards enforce the same discipline either way — this is what makes the agent follow it without being stuck.
package/docs/playbook.md CHANGED
@@ -150,7 +150,9 @@ build" means stays the project's own assertion: the probe runs with the worktree
150
150
  wait for readiness and compare the served build stamp with `git rev-parse HEAD`. No probe → the
151
151
  gate prints `health: none configured` and `flow doctor` flags the combination. The pre-release and release stages take
152
152
  `versionFile`/`versionTag` (defaults `v{version}`; accepted under either section) and
153
- `merge = squash | merge | rebase | any` — how a merged PR lands on the default branch (see below). `## global` also takes
153
+ `merge = squash | merge | rebase | any` — how a merged PR lands on the default branch (see below) — and
154
+ `yolo = all | until-release`: with `until-release` a yolo given at an earlier checkpoint never answers Release?
155
+ (for repos whose rules want the release word given after the commits exist; default `all`). `## global` also takes
154
156
  `forge = github | gitlab | self` — the release machinery's target; when unset it is detected from the
155
157
  `origin` URL at the moment of use (GitHub gets `gh`, GitLab gets `glab`, self-hosted stays forge-neutral:
156
158
  no automatic release creation, merge proof by ancestry only), and `release.releases = false` skips
@@ -1297,14 +1297,24 @@ async function gateRelease(o: GateCtx): Promise<RunResult> {
1297
1297
  if (commits.length && !prepOnly)
1298
1298
  postVerify = `${commits.length} commit(s) landed after the operator's Verified? (given over ${state!.verifiedHead.slice(0, 7)}): ${commits.slice(0, 6).join(" | ")}${commits.length > 6 ? ` …(${commits.length - 6} more)` : ""} — the verify verdict does not cover them: if behaviour changed, have the operator check the current build before Release?, and either way say in the PR body which commit the verdict was given over`;
1299
1299
  }
1300
+ // a standing yolo (given at an earlier checkpoint) stops short of Release? when the playbook says so, or
1301
+ // when commits landed after Verified? — the word was given before those commits existed (gh#176).
1302
+ // --confirmed is the operator's own answer at this checkpoint, yolo-at-Release? included: it always stands.
1303
+ const yoloHeld = !state!.yolo || flag("confirmed")
1304
+ ? ""
1305
+ : cfg.release.yolo === "until-release"
1306
+ ? "the playbook sets yolo = until-release: a yolo given earlier never answers Release? — ask it"
1307
+ : postVerify
1308
+ ? "a yolo given earlier does not cover commits that landed after Verified? — ask Release? with them named"
1309
+ : "";
1300
1310
  const audit = flag("confirmed") ? " (confirmed by operator instruction)" : state!.yolo ? " (yolo: pre-confirmed)" : "";
1301
- const askPending = !flag("confirmed") && !state!.yolo;
1311
+ const askPending = !flag("confirmed") && (!state!.yolo || !!yoloHeld);
1302
1312
  if (askPending) {
1303
1313
  markPendingAsk(root, state!, "Release?");
1304
1314
  if (!ui.hasUI) {
1305
- return { text: needsOperator(`release confirmation needs the operator: confirm interactively, or re-run with --confirmed once the operator answered 'Release?' in chat${stale ? ` — the operator must also answer the stale-build question: ${staleAsk}` : ""}${postVerify ? ` — tell them: ${postVerify}` : ""}`, "Release?"), isError: true };
1315
+ return { text: needsOperator(`release confirmation needs the operator${yoloHeld ? ` (${yoloHeld})` : ""}: confirm interactively, or re-run with --confirmed once the operator answered 'Release?' in chat${stale ? ` — the operator must also answer the stale-build question: ${staleAsk}` : ""}${postVerify ? ` — tell them: ${postVerify}` : ""}`, "Release?"), isError: true };
1306
1316
  }
1307
- const ok = await ui.confirm("Enter release", `Release ${state!.slug}${manifestVer ? ` v${manifestVer}` : ""}${noVersion ? " (unversioned — merge + changelog entry only: no bump, no tag for this flow)" : ""}? Publishing starts: PR, merge${noVersion ? "" : ", tag"} — release-done afterwards needs no further answer.${staleAsk ? `\n\n${staleAsk}` : ""}${postVerify ? `\n\n${postVerify}` : ""}`);
1317
+ const ok = await ui.confirm("Enter release", `Release ${state!.slug}${manifestVer ? ` v${manifestVer}` : ""}${noVersion ? " (unversioned — merge + changelog entry only: no bump, no tag for this flow)" : ""}? Publishing starts: PR, merge${noVersion ? "" : ", tag"} — release-done afterwards needs no further answer.${staleAsk ? `\n\n${staleAsk}` : ""}${postVerify ? `\n\n${postVerify}` : ""}${yoloHeld ? `\n\n(${yoloHeld})` : ""}`);
1308
1318
  if (!ok) {
1309
1319
  delete state!.pendingAsk;
1310
1320
  writeState(root, state!);
@@ -2984,7 +2994,9 @@ export default function devFlow(pi: ExtensionAPI) {
2984
2994
  const why = await askOperator(ctx, `Editing ${path.relative(ctx.cwd, abs) || abs}`, pv.confirm);
2985
2995
  if (why) return { block: true, reason: why };
2986
2996
  }
2987
- const reason = writeGuard({ abs, dfDir: dfDir(guardRoot), features: feats, boundSlug: bound?.slug ?? null, repoRoot: ctx.cwd });
2997
+ // only an unbound session's main-checkout write ever reads it — ask git just then (gh#175)
2998
+ const ignored = !bound && (await sh(`git check-ignore -q -- ${sq(abs)}`, guardRoot)).ok; // outside the repo: git exits 128, not ignored
2999
+ const reason = writeGuard({ abs, dfDir: dfDir(guardRoot), features: feats, boundSlug: bound?.slug ?? null, repoRoot: ctx.cwd, ignored });
2988
3000
  // a stale green is caught where it matters: verify and release fingerprint the worktree (freshenChecks)
2989
3001
  return reason ? { block: true, reason } : undefined;
2990
3002
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-dev-flow",
3
- "version": "0.83.1",
3
+ "version": "0.84.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": [
@@ -43,7 +43,8 @@ Ground rules:
43
43
  - **yolo** at any checkpoint → run that gate `--yolo --confirmed`; every later
44
44
  checkpoint is pre-confirmed — run the remaining gates back to back without
45
45
  asking, honoring guidance attached to the word ("yolo, create a patch
46
- version release" → bump patch; "yolo, no tag" → `--no-version`). Yolo never
46
+ version release" → bump patch; "yolo, no tag" → `--no-version`); a
47
+ NEEDS-OPERATOR is still asked. Yolo never
47
48
  skips a gate: merge/tag/publish follow `flow release`. Checks and
48
49
  guardrails stay fully enforced — a flow-guard `confirm` rule still asks the
49
50
  operator.
@@ -37,7 +37,11 @@ invent one mid-release. Sequence:
37
37
  4. `flow check` — the prep edits made the implement checks stale; the release
38
38
  gate demands them green again.
39
39
  5. State what the PR will contain, present version and changelog entry,
40
- **stop** — **Release?** → `flow release --confirmed`. Checkpoint report:
40
+ **stop** — **Release?** → `flow release --confirmed`. Under a standing
41
+ yolo you run `flow release` without asking. If it returns **NEEDS-OPERATOR
42
+ Release?**, ask anyway: either commits landed after Verified? (the yolo
43
+ predates them, and the gate names them), or the playbook sets
44
+ `yolo = until-release`. Checkpoint report:
41
45
  stage line **🔍 pre-release · `<slug>`** — version decision (`pending` /
42
46
  `bump <level> → vX.Y.Z ~` / `no-version ✓`) · tag · changelog · fold ·
43
47
  review tally · merge style, then `Done:`/`Next steps:` per the Stage
package/src/core.ts CHANGED
@@ -106,7 +106,7 @@ export interface Config {
106
106
  versioning: Versioning;
107
107
  /** Seconds the post-deploy health probe may keep retrying before the gate gives up (0 = single shot). */
108
108
  healthWait: number;
109
- release: { review: string; changelog?: string; releases?: boolean; artifact?: string; preflight?: string; merge?: MergeStyle | "any" };
109
+ release: { review: string; changelog?: string; releases?: boolean; artifact?: string; preflight?: string; merge?: MergeStyle | "any"; /** `until-release`: a standing yolo never answers Release? (gh#176) */ yolo?: "all" | "until-release" };
110
110
  mainHook: boolean; // flow init installs a pre-commit hook blocking main commits
111
111
  /** `inject` (default): the class default timeout is armed silently on every shell call.
112
112
  * `require`: a shell call without its own visible timeout is refused (costs a turn per miss). */
@@ -1438,7 +1438,7 @@ export function inScratchDir(abs: string, repoRoot?: string | null): boolean {
1438
1438
  * touch the checkout at all — a bound feature is the only way in.
1439
1439
  * Returns a reason or null (allowed).
1440
1440
  */
1441
- export function writeGuard(o: { abs: string; dfDir: string; features: FeatureRef[]; boundSlug: string | null; repoRoot?: string | null }): string | null {
1441
+ export function writeGuard(o: { abs: string; dfDir: string; features: FeatureRef[]; boundSlug: string | null; repoRoot?: string | null; ignored?: boolean }): string | null {
1442
1442
  // Judge where the bytes land, not where the path pretends: a symlink inside the worktree pointing
1443
1443
  // out of it is the same write as the target path (realAbs walks the deepest existing ancestor, so
1444
1444
  // a brand-new file under a real directory resolves right, and a never-existing one is stable).
@@ -1486,8 +1486,13 @@ export function writeGuard(o: { abs: string; dfDir: string; features: FeatureRef
1486
1486
  return `bound feature ${o.boundSlug} is at ${bound.state.stage} — edit its worktree (${bound.state.worktree}), not the main checkout; a throwaway script goes in $TMPDIR (.dev-flow/${o.boundSlug}/tmp/, removed at finish)`;
1487
1487
  return null; // release: release chores may touch the main checkout
1488
1488
  }
1489
- if (!o.features.length) return "no active flow — every request goes through flow: flow start <slug> for new work, flow use <slug> for an unfinished feature";
1490
- return `unfinished features: ${o.features.map((f) => f.state.slug).join(", ")} — bind this session with flow use <slug> (or pass an explicit slug to gates)`;
1489
+ // a path git ignores can never reach a commit nor dirty the checkout finish proves clean: a per-machine
1490
+ // file (local secrets, editor state) is not source, and refusing it only sent agents around the guard
1491
+ // through bash (gh#175). The caller asks git; tracked and untracked-unignored paths stay refused.
1492
+ if (o.ignored) return null;
1493
+ const ignoreHint = " — a per-machine file that must never be committed: add its path to .git/info/exclude first (a git-ignored path is writable without a flow)";
1494
+ if (!o.features.length) return `no active flow — every request goes through flow: flow start <slug> for new work, flow use <slug> for an unfinished feature${ignoreHint}`;
1495
+ return `unfinished features: ${o.features.map((f) => f.state.slug).join(", ")} — bind this session with flow use <slug> (or pass an explicit slug to gates)${ignoreHint}`;
1491
1496
  }
1492
1497
 
1493
1498
  /** Prefix feature branches match: branchPattern up to `{slug}` — used to keep feature branches out of the main checkout. */
package/src/projectmd.ts CHANGED
@@ -56,6 +56,7 @@ const KEYMAP: Record<string, Record<string, string>> = {
56
56
  artifact: "release.artifact",
57
57
  preflight: "release.preflight", // run in the worktree at flow release, before anything ships (e.g. docker build .)
58
58
  merge: "release.merge", // how a merged branch lands: squash | merge | rebase | any
59
+ yolo: "release.yolo", // how far a standing yolo reaches: all (default) | until-release (gh#176)
59
60
  },
60
61
  };
61
62
  // pre-release owns release preparation; the release keys are accepted under both sections so
@@ -161,6 +162,11 @@ export function parseProjectMd(text: string): ParsedMd {
161
162
  p.warn.push(`${where}: merge = "${m[2]}" — expected squash, merge, rebase or any — ignored`);
162
163
  return;
163
164
  }
165
+ // a typo must not quietly widen what a yolo answers
166
+ if (mapped === "release.yolo" && !/^(all|until-release)$/.test(m[2].trim())) {
167
+ p.warn.push(`${where}: yolo = "${m[2]}" — expected all or until-release, keeping all`);
168
+ return;
169
+ }
164
170
  p.flow[stage as MdStage][mapped] = m[2];
165
171
  }
166
172
  }
@@ -330,7 +336,7 @@ const ANSWER_STAGE: Record<string, MdStage> = {
330
336
  defaultBranch: "global", forge: "global", worktreeDir: "global", branchPattern: "global", mainHook: "global", mockupGlobs: "global", bashTimeout: "global",
331
337
  setup: "implement", test: "implement", build: "implement", run: "implement", seedData: "implement", health: "implement", dev: "implement", healthWait: "implement",
332
338
  versionFile: "pre-release", versionTag: "pre-release", changelog: "pre-release", review: "pre-release",
333
- releases: "release", artifact: "release", preflight: "release", merge: "release",
339
+ releases: "release", artifact: "release", preflight: "release", merge: "release", yolo: "release",
334
340
  };
335
341
  /** The draft's placeholder comment per key (buildDraft) — stale once the key has an answer. */
336
342
  const DRAFT_HINTS: Record<string, RegExp> = { versionFile: /<!-- versionFile = /, merge: /<!-- merge = /, changelog: /<!-- no changelog found/ };
@@ -484,7 +490,7 @@ export function doctorFindings(root: string, cfg: Config, md: ParsedMd | null):
484
490
  /** Compact per-stage digest of project.md content for dialog display (raw md walls are unreadable). */
485
491
  const DIGEST_STAGES: Record<string, string> = { global: "General", plan: "Planning", implement: "Implement", "pre-release": "Pre-release", release: "Release" };
486
492
  const DIGEST_CMDS: Record<string, string> = { setup: "setup", test: "test", build: "build", run: "run app", seedData: "seed data", dev: "dev deploy" };
487
- const DIGEST_WORDS: Record<string, string> = { defaultBranch: "default branch", branchPattern: "branch pattern", worktreeDir: "worktree dir", mainHook: "main-branch hook", mockupGlobs: "mockup files", forge: "forge", bashTimeout: "shell-call timeout mode", merge: "merge policy" };
493
+ const DIGEST_WORDS: Record<string, string> = { defaultBranch: "default branch", branchPattern: "branch pattern", worktreeDir: "worktree dir", mainHook: "main-branch hook", mockupGlobs: "mockup files", forge: "forge", bashTimeout: "shell-call timeout mode", merge: "merge policy", yolo: "yolo reach" };
488
494
 
489
495
  /** Human summary of a playbook for the init confirm: one line per stage, real values and full item/guidance text, nothing truncated. */
490
496
  export function mdDigest(text: string): string {