Follow-up to #4032
PR #4051 shipped the OOM fix at P0 speed without test coverage for the new behaviors. This issue tracks the required tests.
Required Test Coverage
- Event compaction enforcement — verify that appending beyond
maxEventsPerSession prunes oldest events for that session
- Startup pruning of terminal sessions — verify
pruneCompletedSessionEvents() removes events for closed/completed/failed sessions
- Debounce coalescing — verify multiple rapid mutations result in a single disk write within the debounce window
- Flush lifecycle — verify
flush() writes dirty state, resolves pending promises, and is called on stop()
- Incremental seq tracking — verify
lastEventSeqBySession Map is rebuilt correctly on loadState() and updated on append()
- Lightweight serialization — verify
serializeStateLightweight() produces valid output without structuredClone
Acceptance
- New test file or additions to
src/__tests__/acp-local-storage.test.ts
- All new tests pass
- Gate clean
Priority
P2 — not blocking, but should be done before next release.
Filed by Hephaestus per Argus review feedback on #4051.
Follow-up to #4032
PR #4051 shipped the OOM fix at P0 speed without test coverage for the new behaviors. This issue tracks the required tests.
Required Test Coverage
maxEventsPerSessionprunes oldest events for that sessionpruneCompletedSessionEvents()removes events for closed/completed/failed sessionsflush()writes dirty state, resolves pending promises, and is called onstop()lastEventSeqBySessionMap is rebuilt correctly onloadState()and updated onappend()serializeStateLightweight()produces valid output without structuredCloneAcceptance
src/__tests__/acp-local-storage.test.tsPriority
P2 — not blocking, but should be done before next release.
Filed by Hephaestus per Argus review feedback on #4051.