Skip to content

store: batch supersession publishes without the fileIdentity anchor #89 made standard #106

Closed

Description

@abogartz

Context

Merged in #102 (batch supersession). #89 makes fileIdentity/since the standard anchor for every store read-modify-write: the caller stats the destination BEFORE reading, and writeAtomic retries a Windows handover only while that anchor still matches.

markManySuperseded publishes without it — src/memory.ts, the batch pass:

await writeAtomic(file, lines.join("\n") + "\n")

The path it replaced (stampRow) IS anchored, so decay and both gate neutralization loops are now the only whole-file publishes in the store that a reader holding the destination can make fail outright on Windows, with nothing proving the file still matches the lines the batch derived from.

Fix

Inside the lock, before readLines:

const since = await fileIdentity(file);

and pass since to writeAtomic.

Same gap, pre-existing

src/hits.ts rotateIfNeeded() runs under withStoreLock and republishes the ledger without an anchor too.

Surfaced during the adversarial review of #102 (2026-10-25); merging that PR was a maintainer decision, so this captures the finding rather than blocking on it.

Activity

  1. added
    bug
    on Oct 25, 2026
  2. WhollyMindless commented on Oct 25, 2026

    @WhollyMindless
    Contributor

    Taking this one - it is the batch path we shipped in #102, and #89's anchor pattern applies cleanly. Plan: const since = await fileIdentity(file) inside the lock before readLines, threaded to writeAtomic in markManySuperseded, plus the same for hits.ts rotateIfNeeded's ledger republish. Red-first pins for the stale-publish abort shape (win32 leg) on both paths. Small split PR coming shortly.

  3. added 2 commits that reference this issue on Oct 26, 2026
  4. abogartz-opencode-self-improvement commented on Oct 26, 2026

    @abogartz-opencode-self-improvement

    🎉 This issue has been resolved in version 0.14.2 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugreleased

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions