v0.12.0 — durable-memory flush (write-at-realization)
Durable memory — golden rules, decisions, milestones — used to be harvested at session end, exactly when compaction and attention dilution have already distorted the details or displaced the intent. v0.12.0 moves the write to the turn the signal appears (rough stubs with pasted evidence are legitimate; polishing is idempotent, loss is not) and backs the contract with three warn-only sentinels at the danger moments: context filling, just-compacted, and stopping. A full-plan sandbox rehearsal before execution also surfaced two hook-robustness hazards, fixed here: unbounded stdin capture could hang hooks for callers that hold stdin open, and post-tool-use's TERM watchdog cost every consumer ~5s while never actually killing a runaway main.
Added
- Write-at-realization contract for durable memory:
capturing-golden-rulesnow mandates
capture in the turn the signal appears, with a legitimate rough-stub form (origin = pasted
evidence at hand; Check defaultsmanual review→ /gc's [MANUAL] tier); template note synced. hooks/post-tool-useCheck 1d — context-fill flush reminder: transcript-size threshold
(6 MiB const), warn-once per session via a.harness-anchor/flush-warned-<session_id>marker;
X-vs-Y blind spots documented in the check header.hooks/session-start— compact caution line: fired with stdinsource=="compact", the
banner warns that memory-from-recall is unreliable and points at on-disk evidence; stdin read
is-t 0-guarded (non-blocking), regular startups zero-increment.- Contract tests:
post-tool-use-flush-sentinel.sh,session-start-compact-caution.sh.
Changed
hooks/stop— the stale-progress nudge now also reminds to flush chat-only durable memory;
observation-point header documents the mtime-proxy blind spot (cannot see chat content).hooks/post-tool-use— stdin capture bounded (1sread -t; callers holding stdin open no
longer hang the hook) and watchdog hardened to the SIGKILL/stdio-detached idiom
(session-start's v0.10.0 lesson): the TERM version added ~5s wall to every
command-substitution consumer and could not actually kill a runaway main.- Same-turn flush cross-links:
self-correction-loop(capture hop after a recurrent fix),
context-budget-discipline(flush-before-compress ritual + rebuild-from-disk after
compaction),feature-state-keeper(mid-session milestoneprogress.mdprepends),
/session-endstep 7 reframed as the safety net rather than the capture moment.