Skip to content

perf(brain): index preserved sync tail by record - #5520

Merged
atomantic merged 1 commit into
mainfrom
codex/brain-sync-log-tail-index
Aug 31, 2026
Merged

perf(brain): index preserved sync tail by record#5520
atomantic merged 1 commit into
mainfrom
codex/brain-sync-log-tail-index

Conversation

@atomantic

Copy link
Copy Markdown
Owner

Summary

  • build per-record buckets while partitioning the preserved sync-log tail
  • replace one full-tail scan per overlapping older record with a direct keyed lookup
  • cover mixed stale and superseding tail operations across multiple records

This is the non-blocking performance follow-up identified while reviewing #5462. It preserves the terminal LWW behavior merged there while making positive-floor compaction linear in the retained log size.

Verification

  • cd server && npm test -- services/brainSyncLog.test.js services/syncOrchestrator.test.js (74 tests passed)
  • git diff --check

CI may be skipped under the maintainer small-change exception: the production diff is a local data-structure substitution with direct regression coverage.

Avoid rescanning the full preserved tail for every older record during positive-floor compaction. Cover mixed stale and superseding tail entries across multiple records.
@atomantic
atomantic merged commit fe0e4d8 into main Aug 31, 2026
5 checks passed
@atomantic
atomantic deleted the codex/brain-sync-log-tail-index branch August 31, 2026 06:06
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