Skip to content

agent: pin the memory lock's old-binary interop and the legacy file's held mark - #160

Merged
jaredLunde merged 1 commit into
mainfrom
jared/memory-lock-pins
Oct 7, 2026
Merged

jaredLunde merged 1 commit into
mainfrom
jared/memory-lock-pins

Conversation

@jaredLunde

Copy link
Copy Markdown
Contributor

This adds tests for two gaps the #158 audit found. It changes no behaviour.

Each test fails with the mutant that previously survived:

Test What it pins Mutant it kills (checked)
memory::file::tests::the_store_lock_and_an_old_binarys_flock_exclude_each_other A python stand-in for an older binary takes a non-blocking flock on .memory.lock. While it holds the lock, our StoreLock times out. While we hold StoreLock, its flock is refused. Once we release, its flock succeeds. N4: Target::File changed to Target::Itself in StoreLock::acquire, so no legacy flock is taken. Fails with "the old binary's flock holds the store".
file_lock::tests::a_hard_link_to_a_held_legacy_lock_file_is_not_replaced While a lock is held, write_atomic refuses a hard link to the legacy lock under a name that doesn't look like a lock (notes.txt). After release, the link is written. N3: the legacy file's marks.mark(&file) removed from take_legacy_flock.

Local checks:

  • lib units plus all mcp_*, serve_* and run_* suites: 2404 passed.
  • clippy --workspace --all-targets -D warnings and cargo fmt --check are clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JimHGjsfk2Ktm5GxyZJKKk

… held mark

Two test gaps from #158's audit, each failing with its mutant:
- the_store_lock_and_an_old_binarys_flock_exclude_each_other: an old-binary
  stand-in's flock on .memory.lock makes StoreLock time out, and while we hold
  it their non-blocking flock is refused (kills Target::File -> Itself).
- a_hard_link_to_a_held_legacy_lock_file_is_not_replaced: a hard link to the
  held legacy `lock` under a non-lock name is refused by write_atomic while
  held, written once released (kills dropping the legacy file's mark).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JimHGjsfk2Ktm5GxyZJKKk
@jaredLunde
jaredLunde merged commit ea9559c into main Oct 7, 2026
21 checks passed
@jaredLunde
jaredLunde deleted the jared/memory-lock-pins branch October 7, 2026 13: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