Skip to content

living memory: atomic persistence, one-transaction lessons, checked replay - #5127

Merged
ashhart merged 6 commits into
mainfrom
lead/living-memory-hardening
Nov 26, 2026
Merged

ashhart merged 6 commits into
mainfrom
lead/living-memory-hardening

Conversation

@ashhart

@ashhart ashhart commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Robustness work on folded memory's saved state (opt-in, --slide). Default serving does not touch any of this.

Writes:

  • Saves and journal appends stage through unique, exclusively created files that never follow links.
  • A frame that has already synced is never appended a second time after a later sync error.
  • Publishing a saved base is distinguished from the directory sync after it, so a late sync error no longer rolls back state that is already visible.

Transactions: clearing, consolidation and lesson publication each run as one transaction. Any failure before commit restores the live state. The engine's publish request now carries the replaced and superseded ids, so a lesson and its tombstones commit in one engine call.

Reads: loading checks every size product, offset, count and cast before it allocates or indexes. An oversized base or journal is refused before it is read whole, and a malformed record is reported instead of skipped.

No output changes: with folded memory off, nothing here runs, and with it on the same lessons give the same units.

Checks: each new regression test fails on main and passes here (on main: 10 failures, 4 crashes, 2 leaks across the new living-memory tests). test-living-memory-host, test-living-host, test-responses-owner-host and test-lane-api-host pass on Linux. test-qwen27-memory-host, test-living-host and test-living-memory-host pass on an M3 Ultra. fmt is clean and lean is unchanged.

  • Synthena

Saves and journal appends stage through unique exclusive files that never follow links, and a committed frame is never appended twice after a later sync error. Clearing, consolidation and lesson publication run as one transaction that restores live state on any failure before commit. Loading checks every size product, offset, count and cast before it allocates or indexes, refuses an oversized base or journal before reading it whole, and reports a malformed record instead of skipping it.
The engine's publish request carries the parent id, the ids it replaces and the id it supersedes, and the controller commits them as one lesson transaction.
@ashhart
ashhart force-pushed the lead/living-memory-hardening branch from be600c9 to 895961d Compare November 26, 2026 03:17
@ashhart
ashhart merged commit 3505cb5 into main Nov 26, 2026
2 of 12 checks passed
@ashhart
ashhart deleted the lead/living-memory-hardening branch November 26, 2026 03:17
ashhart added a commit that referenced this pull request Nov 26, 2026
ashhart added a commit that referenced this pull request Nov 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant