pi-dev-flow 0.55.0 → 0.56.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 +11 -0
- package/README.md +3 -1
- package/docs/gates.md +3 -3
- package/docs/playbook.md +2 -1
- package/extensions/dev-flow.ts +94 -7
- package/package.json +1 -1
- package/skills/dev-flow/SKILL.md +4 -0
- package/src/core.ts +48 -4
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.56.0] - 2026-10-22
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- **`flow reflect tidy` drops the closed reflections.** Checking items off was the end of their story — the `- [x]` lines just piled up in `reflections.md` while every surface counts only open ones, so the checked-off history was invisible weight the agent kept walking past. Now the verb mirrors `roadmap tidy`: it deletes every `- [x]` item (the `— fixed:` note has already recorded the outcome), leaves the preamble and the open lines verbatim, and drops a `## playbook`/`## plugin` heading left empty. And the pile no longer waits to be noticed: queueing a note, the bare `reflect` protocol and `flow doctor` all print `↻ N closed reflection(s) — flow reflect tidy drops them` while any closed items exist — exactly the surfaces where items get checked off, quiet once the file is clean.
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- **The guard no longer mistakes an unattributed command for a stage violation.** pi can register dev-flow twice in one process (the documented two-sources hazard — a project pointer beside the installed package), and *every* copy evaluates every guard hook: the copy that never served the flow call judges with an empty in-memory binding, and whenever a second unfinished feature exists — which kills the single-feature auto-bind that used to mask it — `git merge`/`push` to the default branch was refused with *'requires stage release'* while the bound feature sat at release the whole time (it blocked the v0.55.0 release's own chore git, live). The on-disk claim is now a binding: an unfinished feature whose `claim.json` carries this session's key attributes the call regardless of how many features are unfinished, so a second copy judges from disk instead of guessing. When attribution truly fails, the refusal says so — *not attributed to a bound feature (session key, which dev-flow, what to do)* — instead of lying about the stage. `flow version`, `status` and `start` also name every dev-flow copy registered in the process, and the README's two-sources warning says which copy to remove.
|
|
16
|
+
- **`flow finish` fast-forwards a main checkout that trails origin.** Close-out used to probe only `origin/<default>` (tag there, HEAD an ancestor), so a local main left behind by the release — exactly what a guard misattribution produces — passed silently and rotted. Now, once the checkout is clean and proven pushed, `finish` fast-forwards local `<default>` to `origin/<default>` with its own git (never a merge: a diverged or not-checked-out main prints the operator's exact `git pull --ff-only` command instead of touching it).
|
|
17
|
+
|
|
7
18
|
## [0.55.0] - 2026-10-22
|
|
8
19
|
|
|
9
20
|
### Changed
|
package/README.md
CHANGED
|
@@ -52,7 +52,9 @@ pi install ./pi-dev-flow # or a local checkout
|
|
|
52
52
|
Later releases arrive with `pi update --extensions` (an npm install reconciles to the newest version);
|
|
53
53
|
then `/reload` — a running session keeps the code it loaded at startup. Two sources at once (a project
|
|
54
54
|
`git:` pin beside the global `npm:` package) load two copies — pi dedupes extensions by path, not by
|
|
55
|
-
package — so keep the one you actually update from
|
|
55
|
+
package — so keep the one you actually update from: `flow version` lists every dev-flow copy
|
|
56
|
+
registered in the process, and the on-disk session claim keeps the guard of a copy that never served
|
|
57
|
+
a flow call attributing your commands correctly.
|
|
56
58
|
|
|
57
59
|
Then, once per project repo, `/flow init`. It reads the repo (default branch and forge from git,
|
|
58
60
|
package manager, test/build/run conventions, version manifest) and writes **`.dev-flow/project.md`
|
package/docs/gates.md
CHANGED
|
@@ -10,7 +10,7 @@ so it needs no `--confirmed`.
|
|
|
10
10
|
| Gate | Advances | Refuses unless |
|
|
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
|
-
| `use <slug>` | — (binds this session to a feature) | slug unfinished |
|
|
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
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)` |
|
|
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) |
|
|
@@ -18,8 +18,8 @@ so it needs no `--confirmed`.
|
|
|
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 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 |
|
|
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 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 |
|
|
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; **one question** (Finish? — mentions unmerged-looking commits with the playbook's `merge` policy in mind, and warns when the forge release create failed at `release-done` and no retry succeeded) — or `--confirmed`; under `merge = merge`, commits that never reached the default branch are a **policy violation**: `yolo` does not answer it, only your explicit answer does; to abandon an unreleased feature use `abort` |
|
|
22
|
-
| `reflect ["<note>"]` | — | `reflect "<note>"` queues a suggestion in `reflections.md` (never gates; gate flags such as `--confirmed` are ignored, they never become part of the note). Bare `reflect` prints the full **session-reflection protocol** for the agent (from the `/flow reflect` bar it additionally wakes the model, so the protocol executes immediately): review the whole session log, re-check every open item against the current playbook and **newer dev-flow versions** (`npm view pi-dev-flow version` vs the running version — dev-flow ships from npm; recommend `pi install npm:pi-dev-flow` + `/reload`, the operator performs updates), dedupe new findings against the open ones, then report playbook vs plugin items to the operator and ask whether to fix now — plugin items: search upstream issues first (`gh issue list --repo <upstream> --state all --search …`; an author-addressed match is reported back, no match → `gh issue create` with a detailed description and a suggested fix), playbook items: `flow doctor` routes each to the docs flow that implements it |
|
|
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` |
|
|
22
|
+
| `reflect ["<note>"|tidy]` | — | `reflect "<note>"` queues a suggestion in `reflections.md` (never gates; gate flags such as `--confirmed` are ignored, they never become part of the note). `reflect tidy` drops the closed (`- [x]`) items — the preamble and open items stay verbatim and a `## section` heading left empty goes with its items; every surface that queues or reviews reflections (`reflect "<note>"`, bare `reflect`, `doctor`) nudges with the closed count when the checked-off pile grows. Bare `reflect` prints the full **session-reflection protocol** for the agent (from the `/flow reflect` bar it additionally wakes the model, so the protocol executes immediately): review the whole session log, re-check every open item against the current playbook and **newer dev-flow versions** (`npm view pi-dev-flow version` vs the running version — dev-flow ships from npm; recommend `pi install npm:pi-dev-flow` + `/reload`, the operator performs updates), dedupe new findings against the open ones, then report playbook vs plugin items to the operator and ask whether to fix now — plugin items: search upstream issues first (`gh issue list --repo <upstream> --state all --search …`; an author-addressed match is reported back, no match → `gh issue create` with a detailed description and a suggested fix), playbook items: `flow doctor` routes each to the docs flow that implements it |
|
|
23
23
|
| `roadmap [add "<feature>" \| pick <n> <slug> \| done <n> \| tidy]` | — | manages `.dev-flow/roadmap.md`, the gitignored backlog of future features (`- [ ]` checklist): bare prints the numbered open items, `add` appends one, `pick <n> <slug>` stamps open item n with `(slug)` so `flow start <slug>` can take it — **`finish` checks the stamped item off when that feature ships**; `done <n>` checks off by hand (items shipped outside a flow), `tidy` drops the checked lines. Never gates; the open count is surfaced in `status` and session context |
|
|
24
24
|
| `doctor ["<issue note>"]` | — | read-only findings: playbook drift, dead commands/scripts, untracked playbook, ghost feature dirs, orphan worktrees/branches — **plus a review of every open reflection, each routed to the flow that should fix it** (playbook item → docs flow; plugin item → upstream issue, or a patch/normal flow inside the dev-flow repo). It writes nothing and asks nothing, safe for agents and CI at any stage; the agent investigates, you confirm, the routed flow implements. `doctor "<note>"` prints an investigation brief and a fix route for a fresh observation |
|
|
25
25
|
| `status [slug]` / `abort [slug]` | — | — |
|
package/docs/playbook.md
CHANGED
|
@@ -162,7 +162,8 @@ anything (findings are also printed whenever `flow init` runs without a UI, e.g.
|
|
|
162
162
|
rewrites from fresh detection. Improvement
|
|
163
163
|
ideas the agent notices along the way queue up in `.dev-flow/reflections.md` under `## playbook`
|
|
164
164
|
(what to change in *your* playbook) and `## plugin` (what to change in dev-flow itself) —
|
|
165
|
-
`flow reflect "<note>"` appends them,
|
|
165
|
+
`flow reflect "<note>"` appends them, `flow reflect tidy` drops the closed (`- [x]`) ones,
|
|
166
|
+
plain `flow doctor` reviews the open ones and routes
|
|
166
167
|
each fix to the flow that implements it (docs flow for playbook items — those edits only pass a
|
|
167
168
|
docs/patch flow's worktree), bare `flow reflect` hands the agent the full end-of-session
|
|
168
169
|
reflection protocol (review the session log, re-check open items against fixes that already
|
package/extensions/dev-flow.ts
CHANGED
|
@@ -43,6 +43,7 @@ import {
|
|
|
43
43
|
classifyMergeHistory,
|
|
44
44
|
cmpVersions,
|
|
45
45
|
cleanupAssess,
|
|
46
|
+
closedReflectionCount,
|
|
46
47
|
compactionReflectionLine,
|
|
47
48
|
detectForge,
|
|
48
49
|
featureBranchPrefix,
|
|
@@ -70,6 +71,8 @@ import {
|
|
|
70
71
|
reflectSections,
|
|
71
72
|
reflectionLine,
|
|
72
73
|
reflectionRoutes,
|
|
74
|
+
reflectionsTidy,
|
|
75
|
+
reflectionsTidyHint,
|
|
73
76
|
sessionRunsOlderBuild,
|
|
74
77
|
|
|
75
78
|
listFiles,
|
|
@@ -122,6 +125,40 @@ function loadedVersion(): string | null {
|
|
|
122
125
|
return process.env.DEV_FLOW_LOADED_VERSION?.trim() || pluginVersion(import.meta.dirname).version;
|
|
123
126
|
}
|
|
124
127
|
|
|
128
|
+
/** This build's own identity, read once (the guard hot path must not re-walk the fs per call). */
|
|
129
|
+
const SELF_BUILD = pluginVersion(import.meta.dirname);
|
|
130
|
+
|
|
131
|
+
/** Cross-copy registry: one process can register dev-flow more than once (the documented
|
|
132
|
+
* two-sources-at-once hazard: a project dogfood pointer plus an installed copy), and EVERY copy
|
|
133
|
+
* evaluates every guard hook. The flow-tool binding belongs to whichever copy served the call,
|
|
134
|
+
* so the other copy judges from a missing binding — claims on disk (see boundFeature) keep its
|
|
135
|
+
* verdict honest, and these entries let `flow version`, `status` and `start` name the duplicate
|
|
136
|
+
* instead of leaving a misattribution a mystery. Same-process only: it is a globalThis list. */
|
|
137
|
+
interface CopyEntry {
|
|
138
|
+
dir: string;
|
|
139
|
+
version: string | null;
|
|
140
|
+
pid: number;
|
|
141
|
+
at: string;
|
|
142
|
+
}
|
|
143
|
+
const COPIES: CopyEntry[] = ((globalThis as { __piDevFlowCopies?: CopyEntry[] }).__piDevFlowCopies ??= []);
|
|
144
|
+
function registerCopy(): void {
|
|
145
|
+
const mine = COPIES.find((r) => r.dir === SELF_BUILD.dir && r.pid === process.pid);
|
|
146
|
+
if (mine) Object.assign(mine, { version: loadedVersion(), at: new Date().toISOString() });
|
|
147
|
+
else COPIES.push({ dir: SELF_BUILD.dir, version: loadedVersion(), pid: process.pid, at: new Date().toISOString() });
|
|
148
|
+
}
|
|
149
|
+
function otherCopies(): CopyEntry[] {
|
|
150
|
+
return COPIES.filter((r) => r.pid === process.pid && r.dir !== SELF_BUILD.dir);
|
|
151
|
+
}
|
|
152
|
+
function copyWarning(): string | null {
|
|
153
|
+
const dup = otherCopies();
|
|
154
|
+
return dup.length
|
|
155
|
+
? `warning: ${dup.length} other dev-flow cop${dup.length === 1 ? "y" : "ies"} registered in this process: ${dup.map((d) => `${d.dir} (${d.version ?? "?"})`).join(", ")} — every copy evaluates the guard hooks, so keep only one source you intend (README: two sources at once)`
|
|
156
|
+
: null;
|
|
157
|
+
}
|
|
158
|
+
/** Test seam: the smoke suite cannot load a second copy of this module, so it plants registry
|
|
159
|
+
* entries and asserts the warnings the real duplicate would print. */
|
|
160
|
+
export const testSeams = { copies: COPIES };
|
|
161
|
+
|
|
125
162
|
interface Ui {
|
|
126
163
|
hasUI: boolean;
|
|
127
164
|
confirm: (title: string, message: string) => Promise<boolean>;
|
|
@@ -247,7 +284,7 @@ async function releaseTags(root: string): Promise<string[] | null> {
|
|
|
247
284
|
}
|
|
248
285
|
|
|
249
286
|
const GATE_HELP =
|
|
250
|
-
"help [--json] | init [--force|--draft|--write <text>] | reflect [<note
|
|
287
|
+
"help [--json] | init [--force|--draft|--write <text>] | reflect [<note>|tidy] | roadmap [add <text>|pick <n> <slug>|done <n>|tidy] | doctor [<issue note>] | status [slug] [--json] | start <slug> [--ui] [--force] [--patch|--docs --confirmed] [--merge=squash|merge|rebase|any] [--check-upstream] | use <slug> | test | check | health | approve [--yolo] | verify [--yolo] | release [--yolo|--no-version|--no-fold-check] | release-done [--no-artifact-check|--no-release-create] | finish [--yolo] [slug] | abort [slug] | version [--check-upstream] — start preflights the playbook before creating anything: it prints playbook gaps and warns when the session runs an older dev-flow build, and it refuses until a merge policy is set (ask the operator squash / merge / rebase / any in chat, then re-run with --merge=<style> --confirmed — the answer is written into project.md and enforced from then on: gh/glab merges that contradict it are blocked, and release-done proves what actually landed); version prints the loaded build and names any other dev-flow copies registered in the same process (--check-upstream also asks the registry for the published one) — reflect <note> queues a suggestion in reflections.md (gate flags like --confirmed are ignored there); reflect tidy drops the closed (`- [x]`) items from reflections.md — every surface that queues or reviews reflections nudges when the checked-off pile grows; bare reflect prints the full session-reflection protocol (review the session log, re-check open items against shipped fixes and newer dev-flow versions, dedupe and report new findings, put the fix decision to the operator); roadmap manages .dev-flow/roadmap.md, the gitignored backlog of future features (bare lists open items; add appends one; pick <n> <slug> stamps open item <n> with the slug a later flow start uses — flow finish checks it off when that feature ships; done <n> checks off by hand; tidy drops done items); bare doctor reviews structure, git consistency and open reflections (routes each fix to a flow; it never writes); doctor <note> prints an investigation brief for a fresh observation; state gates take [slug] and --confirmed (the operator already answered in chat); --patch/--docs likewise need --confirmed (the operator granted the mode); --yolo on any state gate (approve/verify/release/finish) = the operator said \"yolo\" at that checkpoint: it answers that question and pre-confirms every later one (needs --confirmed; checks and guardrails stay); release --no-fold-check = operator-granted escape from the changelog fold proofs (the entries pending before the release are not line-checked; the entry heading and the 'this branch touched the changelog' proofs stay); release --no-version = this flow ships merge + changelog only — no bump, tag or forge release; the entry rides under Unreleased until the next versioned release folds it (default: versioned); when the session runs an older dev-flow build than the checkout, release names both builds, lists what the running code can no longer prove, and asks the operator update (/reload) or proceed with the old release — an operator decision recorded in state and repeated by release-done, never a block";
|
|
251
288
|
const featDir = (root: string, slug: string) => path.join(dfDir(root), slug);
|
|
252
289
|
const stateFile = (root: string, slug: string) => path.join(featDir(root, slug), "state.json");
|
|
253
290
|
const claimFile = (root: string, slug: string) => path.join(featDir(root, slug), "claim.json");
|
|
@@ -307,6 +344,12 @@ const readReflections = (root: string): string[] => {
|
|
|
307
344
|
return existsSync(f) ? openReflections(readFileSync(f, "utf8")) : [];
|
|
308
345
|
};
|
|
309
346
|
|
|
347
|
+
/** Raw reflections.md content — the closed-item count needs the checked lines the open-only reader drops. */
|
|
348
|
+
const readReflectionsText = (root: string): string => {
|
|
349
|
+
const f = path.join(dfDir(root), "reflections.md");
|
|
350
|
+
return existsSync(f) ? readFileSync(f, "utf8") : "";
|
|
351
|
+
};
|
|
352
|
+
|
|
310
353
|
const roadmapFile = (root: string) => path.join(dfDir(root), "roadmap.md");
|
|
311
354
|
const readRoadmap = (root: string): string => {
|
|
312
355
|
const f = roadmapFile(root);
|
|
@@ -321,6 +364,12 @@ function boundFeature(root: string, key: string): FlowState | null {
|
|
|
321
364
|
if (s && s.stage !== "done") return s;
|
|
322
365
|
}
|
|
323
366
|
const un = unfinishedStates(root);
|
|
367
|
+
// the claim is the persisted binding: bind() already stamps the session key into claim.json, so
|
|
368
|
+
// trust the disk after the in-memory map — a second registered dev-flow copy (both copies
|
|
369
|
+
// evaluate the guard hooks) or a re-instantiated module then attributes the session's own
|
|
370
|
+
// feature from disk instead of misjudging with stage null
|
|
371
|
+
const mine = un.find((s) => readClaim(root, s.slug)?.key === key);
|
|
372
|
+
if (mine) return mine;
|
|
324
373
|
if (un.length !== 1) return null;
|
|
325
374
|
const claim = readClaim(root, un[0].slug);
|
|
326
375
|
// shortcut: liveness is pid-only — pid reuse can read "live" and force an explicit flow use; friction only, never a wrong commit.
|
|
@@ -560,7 +609,21 @@ function reflectNote(root: string, sess: Session, note: string[]): RunResult {
|
|
|
560
609
|
const next = appendReflection(text, sections, line);
|
|
561
610
|
if (next === text) return { text: `already reflected (duplicate): ${line}` };
|
|
562
611
|
writeFileSync(file, next);
|
|
563
|
-
|
|
612
|
+
// queueing is exactly when the operator hears about the checked-off pile — nudge instead of letting it grow
|
|
613
|
+
const closed = closedReflectionCount(next);
|
|
614
|
+
return { text: `reflected (${sections.join(" + ")}): ${line}` + (closed ? `\n${reflectionsTidyHint(closed)}` : "") };
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
/** `flow reflect tidy` — drop the closed (`- [x]`) items; the `— fixed:` note already recorded the outcome. */
|
|
618
|
+
function reflectTidy(root: string): RunResult {
|
|
619
|
+
const file = path.join(dfDir(root), "reflections.md");
|
|
620
|
+
if (!existsSync(file)) return { text: "reflections: nothing to tidy (no queue yet)" };
|
|
621
|
+
const text = readFileSync(file, "utf8");
|
|
622
|
+
const closed = closedReflectionCount(text);
|
|
623
|
+
const open = openReflections(text).length;
|
|
624
|
+
if (!closed) return { text: `reflections: nothing to tidy (${open} open, 0 closed)` };
|
|
625
|
+
writeFileSync(file, reflectionsTidy(text));
|
|
626
|
+
return { text: `reflections: dropped ${closed} closed item(s) — ${open} open` };
|
|
564
627
|
}
|
|
565
628
|
|
|
566
629
|
/** Single runner for both the /flow command and the flow tool. */
|
|
@@ -723,6 +786,8 @@ ${mdDigest(draftRefresh)}`))
|
|
|
723
786
|
const self = pluginVersion(import.meta.dirname);
|
|
724
787
|
const behind = sessionRunsOlderBuild(loadedVersion(), self.version);
|
|
725
788
|
if (behind) notes.push(`warning: this session runs dev-flow ${behind}, the checkout has ${self.version} — /reload before trusting what a gate prints`);
|
|
789
|
+
const dupStart = copyWarning();
|
|
790
|
+
if (dupStart) notes.push(dupStart);
|
|
726
791
|
if (flag("check-upstream")) {
|
|
727
792
|
const pub = await sh("npm view pi-dev-flow version", root);
|
|
728
793
|
const newest = pub.ok ? pub.out.trim().split("\n").pop() : "";
|
|
@@ -771,7 +836,7 @@ ${mdDigest(draftRefresh)}`))
|
|
|
771
836
|
const { md } = loadProject(df);
|
|
772
837
|
// cheap fs probes only (no git subprocesses) — status is a glance, `flow doctor` is the full list
|
|
773
838
|
const findings = md ? doctorFindings(root, cfg, md) : [];
|
|
774
|
-
const warn = findings.length ? [`⚠ doctor: ${findings.length} finding(s) — run flow doctor`] : [];
|
|
839
|
+
const warn = [...(findings.length ? [`⚠ doctor: ${findings.length} finding(s) — run flow doctor`] : []), ...(copyWarning() ? [copyWarning()!] : [])];
|
|
775
840
|
// the backlog nudge belongs to the no-features answer too — that is when a pick is most useful
|
|
776
841
|
const rmap = roadmapOpenCount(readRoadmap(root));
|
|
777
842
|
const rmapLine = rmap ? [`◇ ${rmap} roadmap item(s) open — flow roadmap`] : [];
|
|
@@ -806,11 +871,13 @@ ${mdDigest(draftRefresh)}`))
|
|
|
806
871
|
// gate flags belong to the state verbs — pasted into the note they read as part of the operator's
|
|
807
872
|
// own sentence in reflections.md (#43)
|
|
808
873
|
const words = rest.filter((a) => !a.startsWith("--"));
|
|
874
|
+
// the single word `tidy` is a verb (roadmap-style); a note merely starting with it stays a note
|
|
875
|
+
if (words.length === 1 && words[0] === "tidy") return reflectTidy(root);
|
|
809
876
|
if (words.length) return reflectNote(root, sess, words);
|
|
810
877
|
// upstream for the update probe: the manifest's repository field; the dev-flow checkout itself falls back to its origin
|
|
811
878
|
const self = pluginVersion(import.meta.dirname);
|
|
812
879
|
const upstream = self.repo || (isSelfRepo(root) ? githubSlug((await sh("git remote get-url origin", root)).out) : "");
|
|
813
|
-
return { text: reflectProtocol(readReflections(root), isSelfRepo(root), { version: self.version, upstream }).join("\n") };
|
|
880
|
+
return { text: reflectProtocol(readReflections(root), isSelfRepo(root), { version: self.version, upstream, closed: closedReflectionCount(readReflectionsText(root)) }).join("\n") };
|
|
814
881
|
}
|
|
815
882
|
|
|
816
883
|
case "roadmap": {
|
|
@@ -867,6 +934,8 @@ ${mdDigest(draftRefresh)}`))
|
|
|
867
934
|
findings.push(`reflection review — ${refl.length} open item(s); doctor never implements: investigate each, present the fix, the operator confirms, then the routed flow implements it:`);
|
|
868
935
|
for (const r of reflectionRoutes(refl, isSelfRepo(root))) findings.push(` [${r.sections.join("+")}] ${r.text}\n → ${r.route}`);
|
|
869
936
|
}
|
|
937
|
+
const closedRefl = closedReflectionCount(readReflectionsText(root));
|
|
938
|
+
if (closedRefl) findings.push(reflectionsTidyHint(closedRefl));
|
|
870
939
|
if (!rest.length) return { text: findings.length ? `doctor: ${findings.length} finding(s)\n${findings.map((f) => ` ${f}`).join("\n")}` : "doctor: no findings — playbook, flow state and git layout are consistent" };
|
|
871
940
|
// flow doctor <note>: a fresh observation gets an investigation brief and a fix route
|
|
872
941
|
return { text: investigationBrief(rest.filter((a) => !a.startsWith("--")).join(" "), isSelfRepo(root)).join("\n") };
|
|
@@ -877,13 +946,14 @@ ${mdDigest(draftRefresh)}`))
|
|
|
877
946
|
const self = pluginVersion(import.meta.dirname);
|
|
878
947
|
const behind = sessionRunsOlderBuild(loadedVersion(), self.version);
|
|
879
948
|
const head = self.version ? `dev-flow ${self.version} (pi-dev-flow at ${self.dir})` : `dev-flow version unknown — no pi-dev-flow package.json above ${self.dir}`;
|
|
949
|
+
const dupNote = copyWarning();
|
|
880
950
|
// --check-upstream is the one that asks the registry; plain flow version stays offline and instant
|
|
881
951
|
if (flag("check-upstream")) {
|
|
882
952
|
const pub = await sh("npm view pi-dev-flow version", root);
|
|
883
953
|
const newest = pub.ok ? pub.out.trim().split("\n").pop() : "";
|
|
884
954
|
return { text: newest ? `${head} — published: ${newest}${self.version && newest !== self.version ? " (update available)" : ""}` : `${head} — could not read the published version (offline?)` };
|
|
885
955
|
}
|
|
886
|
-
return { text: behind ? `${head} — but this session runs ${behind}; /reload to run ${self.version}` : head };
|
|
956
|
+
return { text: `${behind ? `${head} — but this session runs ${behind}; /reload to run ${self.version}` : head}${dupNote ? `\n${dupNote}` : ""}` };
|
|
887
957
|
}
|
|
888
958
|
|
|
889
959
|
case "approve": {
|
|
@@ -1324,6 +1394,22 @@ ${mdDigest(draftRefresh)}`))
|
|
|
1324
1394
|
const pushed = await sh(`git merge-base --is-ancestor HEAD ${sq(`origin/${cfg.defaultBranch}`)}`, root);
|
|
1325
1395
|
if (!pushed.ok) return { text: `HEAD is not on origin/${cfg.defaultBranch} — push the release (git push origin ${cfg.defaultBranch}) before finish`, isError: true };
|
|
1326
1396
|
}
|
|
1397
|
+
// close-out also syncs the main checkout: a released flow must never leave local
|
|
1398
|
+
// <default> trailing origin — the push check above proved nothing local-only remains, so a
|
|
1399
|
+
// differing sha means local trails and the fast-forward is safe. never a merge: a diverged
|
|
1400
|
+
// or not-checked-out main prints the operator's exact command instead of touching anything
|
|
1401
|
+
let syncNote = "";
|
|
1402
|
+
if (hasOriginF) {
|
|
1403
|
+
const headSha = await sh("git rev-parse HEAD", root);
|
|
1404
|
+
const originSha = await sh(`git rev-parse ${sq(`origin/${cfg.defaultBranch}`)}`, root);
|
|
1405
|
+
if (headSha.ok && originSha.ok && headSha.out.trim() !== originSha.out.trim()) {
|
|
1406
|
+
const onDefault = (await currentBranch(root)) === cfg.defaultBranch;
|
|
1407
|
+
const ff = onDefault ? await sh(`git merge --ff-only ${sq(`origin/${cfg.defaultBranch}`)}`, root) : { ok: false, out: "" };
|
|
1408
|
+
syncNote = ff.ok
|
|
1409
|
+
? ` local ${cfg.defaultBranch} fast-forwarded to origin/${cfg.defaultBranch}.`
|
|
1410
|
+
: ` local ${cfg.defaultBranch} trails origin/${cfg.defaultBranch} and did not fast-forward cleanly — sync by hand: git -C ${sq(root)} pull --ff-only`;
|
|
1411
|
+
}
|
|
1412
|
+
}
|
|
1327
1413
|
// the cleanup part of closing out: drop the worktree and branch the release consumed
|
|
1328
1414
|
const wt = worktreeAbs(root, state!);
|
|
1329
1415
|
let closeNote: string;
|
|
@@ -1413,7 +1499,7 @@ ${mdDigest(draftRefresh)}`))
|
|
|
1413
1499
|
roadmapNote = ` roadmap: ${r.count} item(s) marked done.`;
|
|
1414
1500
|
}
|
|
1415
1501
|
}
|
|
1416
|
-
return { text: `feature ${state!.slug} done — ${closeNote}${remoteNote}; .dev-flow/${state!.slug}/ removed.${roadmapNote}${forgeSkipNote}` };
|
|
1502
|
+
return { text: `feature ${state!.slug} done — ${closeNote}${remoteNote}; .dev-flow/${state!.slug}/ removed.${roadmapNote}${forgeSkipNote}${syncNote}` };
|
|
1417
1503
|
}
|
|
1418
1504
|
|
|
1419
1505
|
case "use": {
|
|
@@ -1502,6 +1588,7 @@ async function askOperator(ctx: ExtensionContext, what: string, why: string): Pr
|
|
|
1502
1588
|
}
|
|
1503
1589
|
|
|
1504
1590
|
export default function devFlow(pi: ExtensionAPI) {
|
|
1591
|
+
registerCopy(); // which copy of dev-flow this is — see COPIES
|
|
1505
1592
|
/** Parse "flow <sub> [slug] [--flags]" args shared by command and tool. */
|
|
1506
1593
|
const parse = (input: unknown): string[] => {
|
|
1507
1594
|
if (Array.isArray(input)) return input.map(String);
|
|
@@ -1751,7 +1838,7 @@ export default function devFlow(pi: ExtensionAPI) {
|
|
|
1751
1838
|
const dirty = await sh(`git -C ${sq(gitDir)} status --porcelain`, ctx.cwd);
|
|
1752
1839
|
playbookChore = dirty.ok && playbookOnlyChange(dirty.out);
|
|
1753
1840
|
}
|
|
1754
|
-
const reason = bashFlowGuard({ command: g.seg, branch, stage: bound?.stage ?? null, defaultBranch: cfg.defaultBranch, pushRefs, playbookChore, dir: gitDir });
|
|
1841
|
+
const reason = bashFlowGuard({ command: g.seg, branch, stage: bound?.stage ?? null, defaultBranch: cfg.defaultBranch, pushRefs, playbookChore, dir: gitDir, attribution: bound ? undefined : `not attributed to a bound feature (session ${key}; dev-flow ${loadedVersion() ?? "?"} at ${SELF_BUILD.dir}) — run flow use <slug> here if a binding is missing` });
|
|
1755
1842
|
if (reason) return { block: true, reason };
|
|
1756
1843
|
// Branch discipline: feature branches live in their worktree — never checked out or created (-b) in the main checkout
|
|
1757
1844
|
const target = checkoutTarget(g.seg);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-dev-flow",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.56.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": [
|
package/skills/dev-flow/SKILL.md
CHANGED
|
@@ -361,6 +361,10 @@ a note about both goes to both. The open count shows in status and stage
|
|
|
361
361
|
context; the operator decides:
|
|
362
362
|
|
|
363
363
|
- Reflect real friction only, one line each, never the same issue twice.
|
|
364
|
+
- **`flow reflect tidy` drops the closed (`- [x]`) items** — the `— fixed:` note has
|
|
365
|
+
already recorded the outcome, so the check-off is history and the file stays
|
|
366
|
+
scannable. Queueing a note, bare `reflect` and `doctor` all print the closed
|
|
367
|
+
count with this verb when the pile grows; offer the tidy to the operator then.
|
|
364
368
|
- **Bare `flow reflect` is the end-of-session reflection** — it runs as part
|
|
365
369
|
of every finish (before the slug folder is deleted — see Stage: finish) and
|
|
366
370
|
whenever the operator asks. It prints the
|
package/src/core.ts
CHANGED
|
@@ -691,6 +691,7 @@ export interface GuardCtx {
|
|
|
691
691
|
pushRefs?: PushRef[]; // caller-resolved push targets (bare names disambiguated tag vs branch); omit = guard parses raw command
|
|
692
692
|
playbookChore?: boolean; // the only change in this checkout is the playbook — tracking it is setup, not feature work (#53)
|
|
693
693
|
dir?: string; // absolute directory this segment runs in; named in the refusal so a wrong verdict is diagnosable
|
|
694
|
+
attribution?: string; // why the call could not be attributed to a bound feature; appended to the stage refusals when stage is null, so a misattribution names itself instead of lying about the stage
|
|
694
695
|
}
|
|
695
696
|
|
|
696
697
|
const unquote = (s: string): string => s.replace(/^(['"])(.*)\1$/, "$2");
|
|
@@ -929,15 +930,19 @@ export function bashFlowGuard(o: GuardCtx): string | null {
|
|
|
929
930
|
// a cd earlier in the command picks the directory this verdict is about — name it, or a misjudged segment
|
|
930
931
|
// reads as "the rule is broken" instead of "the guard looked in the wrong place".
|
|
931
932
|
const judgedIn = o.dir ? ` — judged in ${o.dir}; a cd or git -C earlier in the command picks the directory` : "";
|
|
932
|
-
|
|
933
|
+
// an unattributed refusal must admit it is guessing: "requires stage release" reads as a verdict on
|
|
934
|
+
// the feature when the real finding is "I never found your feature" (a second registered dev-flow
|
|
935
|
+
// copy judging with no bindings of its own — see boundFeature's claim path)
|
|
936
|
+
const attr = o.stage === null && o.attribution ? ` — ${o.attribution}` : "";
|
|
937
|
+
if (git("commit") && onMain && o.stage !== "release" && !playbookCommit) return `direct commits to ${o.defaultBranch} are forbidden — work in the feature worktree (tracking the playbook is legal: git add -f .dev-flow/project.md && DEV_FLOW_ALLOW_MAIN=1 git commit)${judgedIn}${attr}`;
|
|
933
938
|
if (git("push")) {
|
|
934
939
|
// ref-aware: only pushes that WRITE the default branch need stage release — tags and other branches pass.
|
|
935
940
|
// unresolved bare names arrive pre-resolved by the caller (tag vs branch); no parse info → conservative onMain.
|
|
936
941
|
const refs = o.pushRefs ?? parsePushRefs(gitInvocation(c).pushes);
|
|
937
942
|
const writesDefault = refs.some((r) => (r.kind === "branch" && (r.name === o.defaultBranch || r.name === "*")) || (r.kind === "current" && onMain));
|
|
938
|
-
if (writesDefault && o.stage !== "release") return `pushing to ${o.defaultBranch} requires stage "release" (verified feature)`;
|
|
943
|
+
if (writesDefault && o.stage !== "release") return `pushing to ${o.defaultBranch} requires stage "release" (verified feature)${attr}`;
|
|
939
944
|
}
|
|
940
|
-
if (git("merge") && onMain && o.stage !== "release") return `merging into ${o.defaultBranch} requires stage "release"`;
|
|
945
|
+
if (git("merge") && onMain && o.stage !== "release") return `merging into ${o.defaultBranch} requires stage "release"${attr}`;
|
|
941
946
|
return null;
|
|
942
947
|
}
|
|
943
948
|
|
|
@@ -1207,6 +1212,44 @@ export function openReflections(text: string): string[] {
|
|
|
1207
1212
|
return openChecklistItems(text);
|
|
1208
1213
|
}
|
|
1209
1214
|
|
|
1215
|
+
/** Closed (checked-off) reflection items — what `flow reflect tidy` drops (roadmap shares the checkbox test). */
|
|
1216
|
+
export const closedReflectionCount = (text: string) => text.split("\n").filter(isDoneItem).length;
|
|
1217
|
+
|
|
1218
|
+
/** Drop the closed (`- [x]`) reflection items: the preamble and the open lines stay verbatim
|
|
1219
|
+
* (a line filter — no re-bucketing like appendReflection's rewrite), and a `## section` heading
|
|
1220
|
+
* left with no open items under it goes with its items. */
|
|
1221
|
+
export function reflectionsTidy(text: string): string {
|
|
1222
|
+
const headerRe = new RegExp(`^## (${REFLECT_SECTIONS.join("|")})\\s*$`, "i");
|
|
1223
|
+
const lines = text.split("\n");
|
|
1224
|
+
// pass 1: open items per heading decides which sections survive; items above every heading are legacy flat lines with no heading to drop
|
|
1225
|
+
let section: string | null = null;
|
|
1226
|
+
const openUnder = new Map<string, number>();
|
|
1227
|
+
for (const raw of lines) {
|
|
1228
|
+
const l = raw.trim();
|
|
1229
|
+
const h = headerRe.exec(l);
|
|
1230
|
+
if (h) section = h[1].toLowerCase();
|
|
1231
|
+
else if (section && isOpenItem(l)) openUnder.set(section, (openUnder.get(section) ?? 0) + 1);
|
|
1232
|
+
}
|
|
1233
|
+
// pass 2: closed items never survive; an emptied heading never survives
|
|
1234
|
+
const out: string[] = [];
|
|
1235
|
+
section = null;
|
|
1236
|
+
for (const raw of lines) {
|
|
1237
|
+
const l = raw.trim();
|
|
1238
|
+
const h = headerRe.exec(l);
|
|
1239
|
+
if (h) {
|
|
1240
|
+
section = h[1].toLowerCase();
|
|
1241
|
+
if ((openUnder.get(section) ?? 0) > 0) out.push(raw);
|
|
1242
|
+
continue;
|
|
1243
|
+
}
|
|
1244
|
+
if (isDoneItem(raw)) continue;
|
|
1245
|
+
out.push(raw);
|
|
1246
|
+
}
|
|
1247
|
+
return out.join("\n").replace(/\n{3,}/g, "\n\n");
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
/** Shared wording for every surface that notices closed items piling up, so all hints read alike. */
|
|
1251
|
+
export const reflectionsTidyHint = (closed: number) => `↻ ${closed} closed reflection(s) — flow reflect tidy drops them`;
|
|
1252
|
+
|
|
1210
1253
|
/** The note text of an item, without the checkbox and without the trailing ` — <attribution>`: what
|
|
1211
1254
|
* two reflects are compared on, so the same note at another date is still the same note.
|
|
1212
1255
|
* shortcut: split on the last em dash — matches what the tool writes; a hand-written item ending in
|
|
@@ -1273,7 +1316,7 @@ export function investigationBrief(note: string, selfRepo: boolean): string[] {
|
|
|
1273
1316
|
/** Bare `flow reflect`: the full session-reflection protocol for the agent (the plugin has no LLM —
|
|
1274
1317
|
* the agent reviews the session log, re-checks open items against shipped fixes, dedupes new
|
|
1275
1318
|
* findings and puts the fix decision to the operator). Writes nothing, runs no network calls. */
|
|
1276
|
-
export function reflectProtocol(items: string[], selfRepo: boolean, facts: { version: string | null; upstream: string }): string[] {
|
|
1319
|
+
export function reflectProtocol(items: string[], selfRepo: boolean, facts: { version: string | null; upstream: string; closed?: number }): string[] {
|
|
1277
1320
|
const ver = facts.version ? `dev-flow ${facts.version}` : "dev-flow version unknown";
|
|
1278
1321
|
const up = facts.upstream || "<upstream — ask the operator for the dev-flow repo>";
|
|
1279
1322
|
const url = facts.upstream ? `https://github.com/${facts.upstream}` : "<upstream-url>";
|
|
@@ -1288,6 +1331,7 @@ export function reflectProtocol(items: string[], selfRepo: boolean, facts: { ver
|
|
|
1288
1331
|
` a. plugin items: search upstream first — gh issue list --repo ${up} --state all --search "<keywords>" — an author-addressed match → report the verdict back to the operator (fixed in v… / closed won't-fix + reason), do not re-file; no match → gh issue create --repo ${up} with a detailed description, session evidence and a suggested fix.`,
|
|
1289
1332
|
" b. playbook items: run flow doctor — it reviews each open item and routes it to the docs flow that implements the fix.",
|
|
1290
1333
|
];
|
|
1334
|
+
if (facts.closed) lines.push(`${reflectionsTidyHint(facts.closed)} — check an item off only when it is handled; tidy once the checked-off pile grows.`);
|
|
1291
1335
|
if (!items.length) lines.push("open items: none — steps 1 and 3 still apply.");
|
|
1292
1336
|
else {
|
|
1293
1337
|
lines.push(`open items (${items.length}):`);
|