Skip to content

feat(tracking): lock-free append-only event journal (eliminate write-skipped under fan-out) - #91

Merged
fusengine merged 2 commits into
mainfrom
feat/track-journal
Jul 24, 2026
Merged

feat(tracking): lock-free append-only event journal (eliminate write-skipped under fan-out)#91
fusengine merged 2 commits into
mainfrom
feat/track-journal

Conversation

@fusengine

Copy link
Copy Markdown
Owner

Summary

  • Replace SessionTrack's read-modify-write with a lock-free append-only event journal, eliminating write-skipped outcomes under concurrent multi-agent fan-out.
  • Kill-switch FUSE_TRACK_JOURNAL=0 reverts to legacy behavior; FUSE_TRACK_COMPACT_BYTES tunes compaction; compaction rewrites state via atomic rename (never a torn write).
  • Guarantees G1-G4 (append never skipped, deterministic/idempotent replay, crash-safe compaction, byte-identical legacy fallback) — triple-audited (challenger CONFIRMED, independent factual verification GO, non-vacuity re-proven) and validated in real conditions (deployed dist, multi-agent fan-out, 0 write-skipped, 24/24 runs without loss, clean migration).
  • Version bump 0.1.81 -> 0.1.82 (PATCH — repo convention: 81 prior tags / 75 prior feat commits, all PATCH-only, no MINOR precedent).

Test plan

  • bunx tsc --noEmit clean
  • bun test: 898 pass / 1 skip / 0 fail
  • No bun:/Bun./from 'bun' runtime imports in touched src dirs
  • All new/modified files <= 100 lines
  • Validated in real deployed conditions (fan-out, 0 write-skipped, 24/24, migration)

Breaking changes

None — kill-switch FUSE_TRACK_JOURNAL=0 preserves legacy behavior exactly.

…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)
@fusengine
fusengine merged commit 7ae42c1 into main Jul 24, 2026
1 check passed
@fusengine
fusengine deleted the feat/track-journal branch July 24, 2026 09:58
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