# Plans and trails This file says where plans and decision logs live and what their rows and proofs must show. The pstack block in `AGENTS.md` points here. Edit its shared source in `udecode/ustack`. - **Plans and trails.** Keep a dated plan (`docs/plans/-.md`) and decision log (`docs/plans/-.decisions.tsv`) in the repository when work spans sessions, goes into a PR, accepts a narrower proof, has a suggested task waiting on it, or a project playbook requires one. Other runs keep their log in the run directory (`docs/plans/artifacts//`, git-ignored) and hand back in the reply. Store all durable run artifacts (pre-edit copies, seat answers, proof logs, worker rosters) in the run directory; never commit screenshots or run artifacts, and never rely on temporary scratch that restarts can wipe. - **Decision-log rows.** Append rows in batches with `node .agents/pstack/decisions-check.mjs append --from ` (5 tab-separated cells: `phase`, `decision`, `why`, `evidence`, `result`; the helper stamps UTC timestamps and records `lead` boundary rows automatically). Every result starts with a valid status word (`fixed`, `verified`, `proven`, `partial`, `open`, `decided`, `applied`, `dismissed`, `deferred`, `recorded`, `superseded`, `reverted`, `blocked`, `gap`, `inconclusive`, `accepted`, etc.). A `fixed`, `verified`, or `proven` row must include `scope:` in its evidence naming what the proof covered. Log cheaper stand-ins as `partial` with the gap stated. Use stage phases (`architect`, `panel`, `build`, `writing`, `verify`, `delivery`, `reflect`) so `plan-page.mjs --rail` tracks them; reserve `review*` for hand-off reviewers. - **Closing plans (`plan-open.mjs`).** Mark a plan Done only after `node .agents/pstack/plan-open.mjs ` passes: no unchecked boxes, TODO/TBD/FIXME, or blank gate cells; every newly closed box cites its artifact or `skip: `; every newly added deferred or `## Open work` item names a real `owner:` (person or scheduled run, never a skill) and observable `stop:`. Set `PSTACK_BASE` to the intake commit if the owner commits mid-run. - **Proof hygiene (`proof.mjs`).** Run command proofs via `node .agents/pstack/proof.mjs --dir --name -- `, which records the command, output, and `exit=` to an immutable `-a.log`. Pair proofs with a control or must-fail case so a no-op launch cannot pass, and assert expected failure text on non-zero exits. Under `pipefail`, write bounded output to a file before piping to early-exiting consumers (`head`, `grep -m`). - **Honest claims.** Every count, absence, impossibility, or external capability claim names the check that could falsify it (or says it is inferred); verify runtime claims by running the real path, not only reading types or docs. When a claim narrows or a proof is superseded, log a `superseded` row and update every plan step, Close, subject file, commit body, and PR text that cites it. An approved plan change gets a deviation row, keeps the approved wording visible, and opens `## Close` as a reversal. Save background subagent reports to the run directory when they arrive so compaction cannot lose them.