From c38e602fcdd97d99a8f5ccae615b4c1652be20ef Mon Sep 17 00:00:00 2001 From: bchanot Date: Thu, 5 Nov 2026 15:26:42 +0100 Subject: [PATCH] docs(plan): phase 4c plan r3 (confirmation pass) --- .../superpowers/plans/2026-11-04-memory-recall.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/superpowers/plans/2026-11-04-memory-recall.md b/docs/superpowers/plans/2026-11-04-memory-recall.md index 641e99b..cba54ba 100644 --- a/docs/superpowers/plans/2026-11-04-memory-recall.md +++ b/docs/superpowers/plans/2026-11-04-memory-recall.md @@ -256,3 +256,18 @@ Task 8 — harness (corr 5, 12, 15; rob 4; simp 5): Task 9 — docs: also the plugin.json `description` and the register.ts header comment (no version bump) (simp 6, corr 14). Task 10 — headless recipe copies LRN-260 (`GITFLOW_NO_PUSH=1`, `--allowedTools` naming the one probe command) (rob 12); a memory fixture body is written with Write + `--body-file`, never a heredoc quoting an extraction command (extract-guard, LRN-262). + +## R3 CHANGES (confirmation pass: correctness CONCERNS(4), no BLOCKER; these override R2 and the task text) + +- **Split order (conf 1).** 4a keeps only what it can show at its own commit: the switch-key logging (corr 6 test) and log retention (a `log` seeded in the store, then a failure capture and a sweep: the log survives). IR6, IR9, IR11, the spent-reset test and the log-after-injection test move to 4b; the two-concurrent-failures test moves to Task 5. Task 5 depends on 4a and 4b. +- **Real-registry parity (conf 2).** The `entriesOf` IDs == `parseIndex` IDs check runs in a shell suite (a new case in `lib/tests/memory.test.sh`, bun one-liner importing the two functions, EVAL rows filtered), and FAILS when the registries are absent; it is not a kit test. +- **Status unavailable (conf 3).** `buildIndex(entries, undefined)` indexes ALL entries (advisory); SR3-SR5 oracles: the SR2 failure reads `known BLK-001` and the `index:` line ends `status reader unavailable`; recall and the error channel inject nothing. A spec-amendment step (end of Task 9) rewrites spec Units 1, 2 and 5 for the four R2 deviations (status unavailable labels, `classic.SessionStart` as the context-start site, titles from memory.sh, digest from `memory.sh index blocker`). +- **Entry assembly (conf 4).** Export a pure `assembleEntries(texts: string[], index: Map): Entry[]` that joins kind, the memory.sh title cut at 100 with `…`, `lessonOf`, and the body; `loadRegistries` and the harness both use it; the harness imports also `recallLine`. +- **Digest tests (conf 5, 6, 7, 8).** SD9 = a copy of the script beside a fake `lib/memory.sh` that exits 2, then one that prints malformed rows, and a `blockers.md` that is a directory: exit 0, banner intact, no digest. The block cap drops whole lines from the end until ≤ 800 chars (never a mid-line cut); SD7 uses long TODO items and a long journal line. Cuts use bash `${v:0:159}…` under the inherited locale, with an SD6 line containing `—` checked to stay valid UTF-8 (`iconv -f UTF-8 -t UTF-8` succeeds); no `cut -c`. Without `timeout` or `jq`: the digest prints only when stdin is a terminal (`[ -t 0 ]`, a manual run), never from a hook; SD10 runs with a PATH lacking jq and a piped `{"source":"resume"}` → no digest. +- **Kill switch wording (conf 9).** Task 0 tells the user: before 4a lands, `{"enabled": false}` is the kill switch; from 4a on, `{"enabled": true, "recall": false}` cuts injections only. +- **Test world (conf 10).** Tests drive the `process.run` World field, never add a second bottom; the test at register.test.ts ~885 (expects `known LRN-002` after editing the file to open) sets its own stdout with LRN-002 open. +- **Errno phrase (conf 11).** `deErrno` runs on the lowercased line BEFORE `normalize`'s PATH step for `input/output error` only (a dedicated literal replacement), the other phrases after normalize as planned; ER case. +- **Log size (conf 12).** The log lives in its own store key `l:` (≤ 200 records, ≤ 64 KiB, oldest dropped), outside the session sweep; `loadProject`/`saveProject` untouched. +- **/clear event (conf 13).** Task 10's interactive check includes a `/clear` then an ordinary prompt: the transcript shows one `memory recall:` on it; the context-start key uses the event's `session_id` when present, else `$.session.id()`. If `clear` never fires, it is reported as a residual at the merge gate. +- **Discriminating fixtures (conf 14).** The spent-reset test uses a 3-entry recall of ~1 150 chars and a known line of ~400 chars (old code: dropped; new: injected); TE7 reaches its spent level through crafted injections, the lengths stated in the test. +- **API and references (conf 15).** `$.model.complete` gets `{model, prompt, maxTokens, effort}` only if the d.ts does not type `timeoutMs` (check the d.ts; the own 3 s race stays either way); the TODO `shortcut:` tick is in Task 9; `isTrigger`, `IDLE_MS`, `DESIGN_RULE`, `ANALYSIS_RULE` are produced by 4b.