60 60 Never answer a Neovim documentation question from model memory in this codebase: `nvim_help` resolves against the running version's runtime path, including plugin docs.
61 61 Help is read-only by construction; keep mutating tools out of its allowlist.
63 -16. **Contract tests guard assumptions,** not features. They skip unless `pi` is on `PATH` and opt-in is set. When Pi changes behavior, they fail before users do.
63 +16. **Edits stay proportional.** Never rewrite a whole buffer for a local change: `edit.replace` rewrites only the spanned lines and `edit.set_content` diffs first.
64 + A whole-buffer replacement marks every line as agent work, destroys marks and folds, and makes the trail useless.
65 + Assert the trail covers only the changed lines.
67 +17. **The trail belongs to the agent until the user edits.** `activity.touch` records the agent-owned revision; a later foreign change clears the trail.
68 + Anything the agent's own operation triggers, including a write, must call `touch` again, or an unrelated plugin reacting to the write wipes the trail.
69 + A revision recorded before the operation finishes is not enough; re-record after the event loop settles.
71 +18. **Contract tests guard assumptions,** not features. They skip unless `pi` is on `PATH` and opt-in is set. When Pi changes behavior, they fail before users do.
84 92 Requests are synchronous, so scenarios need no sleeps.
85 93 Add scenarios to `tests/drive/run.lua`.
97 +pivi decorates only its own windows and publishes state for everyone else.
101 +| Transcript and prompt windows | window-local `winbar` carries the session name; the prompt also names its submit key |
102 +| Progress | `transcript.set_state` shows the running tool in pivi's own winbar |
103 +| Statusline | `lua/bugabinga/pivi_status.lua` is a consumer: it reads `vim.g.pivi` and never requires pivi, so it degrades when pivi is absent |
104 +| Headings | write `## pi` only when real text arrives, so a tool-only turn leaves no empty heading |
105 +| Leading blank lines | models open with them; strip them before the first visible character |
106 +| Rejections | name the command the user should type, not the internal state |
110 +- Resolve the Pi executable to a real path before spawning. On Windows the launcher is a `.CMD` shim, a bare `pi` reaches the spawner as `ENOENT`, and a Neovim started from a desktop launcher has a smaller `PATH` than a shell. A failed spawn must be reported, never raised as a traceback in the editor.
111 +- End a Pi child by closing its input and only killing it after a grace period. On Windows the launcher is a shim, so an immediate kill orphans the runtime behind it and those orphans keep later test runs from exiting. Contract tests share one child per command line and shut it down explicitly.
112 +- Plenary discovers spec files by spawning `pwsh` with a 5 second timeout. Under load that fails with `E5108` and no tests run at all. Run the file directly when that happens; an empty summary is a harness failure, not a pass.
89 113 - Never pipe a Plenary run into `tail`, `grep`, or `head`. Plenary spawns child Neovim processes that inherit stdout, so the pipe stays open and the shell appears to hang long after the tests finished. Redirect to a file and read the file.
90 114 - A `vim.wait` predicate that already holds when the wait begins asserts nothing. `run == 'idle'` is true before the first frame is ever dispatched; wait for an observed event instead, or use the fake's `flush` barrier.
91 115 - Real extension traffic dominates a recorded run: a recorded stream is mostly `setStatus` and `setWidget`, and the extensions clear their own entries on shutdown, so end-of-run status maps are empty by design.