Skip to content

fix(logger): persist only durable count during seed - #901

Merged
antropos17 merged 2 commits into
masterfrom
codex/logger-durable-count-20261011
Oct 11, 2026
Merged

antropos17 merged 2 commits into
masterfrom
codex/logger-durable-count-20261011

Conversation

@antropos17

Copy link
Copy Markdown
Owner

Problem and behavior

During legacy log-count seeding, a newly buffered startup entry could be included in the persisted .count index before it reached disk. If the process died before flush, the next process could accept a phantom count because the index bytes still matched the durable log. The seed now writes only the streamed disk count, while the public live stats continue to include buffered entries. A flush during an in-flight scan invalidates the seed-index write.

Verification

  • A fresh-process crash regression reproduced a restored count of 11 for 10 durable lines before the fix. It restores 10 after the fix; a normal flush yields 11.
  • Early-flush and existing logger/log-file focused checks: 46 passed. Scoped formatting and diff checks pass; ESLint has zero errors and nine existing console warnings.
  • Independent GPT-6.1 Sol review of unchanged two-file hashes: GO. Local Vitest 4.1.11 is provisional; hosted CI with declared dependencies is authoritative.

Existing concurrent multi-file scan/rotation behavior and cumulative retention-count semantics remain outside this patch. This is a log-index durability correction, not full crash-reboot enforcement acceptance.

@antropos17
antropos17 merged commit b972493 into master Oct 11, 2026
5 checks passed
@antropos17
antropos17 deleted the codex/logger-durable-count-20261011 branch October 11, 2026 13:07
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