fix(install): capture installed_at at lockfile upsert (PR-D C2a, ADR-0008)#630
Merged
fix(install): capture installed_at at lockfile upsert (PR-D C2a, ADR-0008)#630
Conversation
…0008) `installed_at` was captured before `copy_tree_atomic`, leaving freshly installed files with mtimes potentially later than the recorded `installed_at`. ADR-0008 PR-D's `mtime > installed_at` dirty check (Invariant 2) would then false-positive on the install's own writes under any non-trivial copytree latency. Move the capture to the lockfile-upsert boundary (after copy completes) so `mtime <= installed_at` holds for fresh installs by construction. Add `test_installed_at_after_all_writes` to pin the invariant: install a multi-file skill, walk the dest tree, and assert parsed `installed_at` >= max(dest mtimes) within 1ms slack for fs precision. Standalone PR-B fixup that ships independently of C2's `mm context update` work; no user-visible behavior change today, but tightens the lockfile semantic so the upcoming dirty check is sound. Co-authored-by: Claude <[email protected]>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
mm context updatework.installed_atwas captured beforecopy_tree_atomic, leaving freshly installed files with mtimes potentially later than the recordedinstalled_at. ADR-0008 PR-D'smtime > installed_atdirty check (Invariant 2) would then false-positive on the install's own writes under any non-trivial copytree latency.mtime <= installed_atholds for fresh installs by construction.Why standalone
C2 (
mm context update+ dirty detection) consumes this invariant in itsis_asset_dirty()classifier. Splitting the fixup into its own PR keeps that change reviewable as a real PR-B bug fix, independent of C2's much larger surface (updateCLI,--allcross-project,.baksemantics).No user-visible behavior change today; the lockfile semantic is tightened so the upcoming dirty check is sound.
Test plan
test_installed_at_after_all_writes: install a multi-file skill (4 files across 3 subdirs), walk dest, assert parsedinstalled_at >= max(dest mtimes)within 1ms slack.packages/memtomem/tests/test_context_install.py).test_context_install_widening.py,test_lockfile.py.uv run pytest -m "not ollama"— 3476 passed, 46 deselected.ruff check+ruff format --check— green.Series
Part of ADR-0008 wiki layer:
mm context install+ lockfile + concurrencymm wiki {agent,command} overrideCLI mirrormm context update+ dirty detection🤖 Generated with Claude Code