feat(tracking): lock-free append-only event journal (eliminate write-skipped under fan-out) - #91
Merged
Merged
Conversation
…skipped under fan-out) SessionTrack writes now go through an append-only event journal instead of read-modify-write on the shared state file, removing the write-skipped outcome entirely under concurrent multi-agent fan-out. - Kill-switch: FUSE_TRACK_JOURNAL=0 reverts to legacy read-modify-write. - Tunable: FUSE_TRACK_COMPACT_BYTES controls when journal compaction fires. - Compaction rewrites the journal into a fresh state file via atomic rename (write-temp + rename), never a partial/torn write. - Guarantees: G1 append is lock-free and never skipped under fan-out, G2 replay is deterministic and idempotent, G3 compaction is crash-safe (atomic rename, no torn state), G4 legacy behavior is preserved byte-for- byte when the kill-switch is off. - Validated in real conditions: deployed dist, multi-agent fan-out, 0 write-skipped, 24/24 runs without loss, migration from legacy state verified clean. version: 0.1.81 -> 0.1.82 (PATCH — repo convention: 81 prior tags, 75 prior feat commits, all PATCH-only; no MINOR precedent, so MINOR default overridden)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SessionTrack's read-modify-write with a lock-free append-only event journal, eliminating write-skipped outcomes under concurrent multi-agent fan-out.FUSE_TRACK_JOURNAL=0reverts to legacy behavior;FUSE_TRACK_COMPACT_BYTEStunes compaction; compaction rewrites state via atomic rename (never a torn write).Test plan
bunx tsc --noEmitcleanbun test: 898 pass / 1 skip / 0 failbun:/Bun./from 'bun'runtime imports in touched src dirsBreaking changes
None — kill-switch
FUSE_TRACK_JOURNAL=0preserves legacy behavior exactly.