Task — engineering-spec@1
"MMR sync for memory-append — doctor stays READY after gated flips"
doneTASK-IMP-141
TASK-IMP-141: MMR sync for memory-append
Problem
Every gated HITL flip (reviewing→ready_to_test, testing→done) appends a status_overridden row via tools/install/docs-tools/memory-append.mjs. That tool advanced the binlog + HEAD but did not update audit/mmr/peaks.bin. Doctor ledger-mmr-cross-check then went RED, and with CUO-302's doctor gate fail-closed, run-gates.sh failed until a human rebuilt peaks from the binlog (batch-8b/8c ship notes).
Fix
After every successful append, rebuild audit/mmr/peaks.bin from every on-disk payload using the same peak-stack algorithm as modules/memory/cyberos/core/mmr.py (Node stdlib only — docs-tools convention). Catch-up heals a previously stale peaks file.
Acceptance
bash tools/install/tests/test_memory_append.shincludest05_mmr_peaks_stay_in_syncand passes.- After N appends, peaks
leaf_countequals HEAD. - A deliberately stale peaks.bin is healed by the next append.
- CHANGELOG Unreleased notes the fix.