Repository navigation
test(cli): the prune's production mtime fallback is witnessed, not just its consumer (TASK-174) - #1969
Merged
Conversation
…st its consumer (TASK-174)
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Test-only follow-up to the merged #1965 (
62d226c9), closing the one mutation survivor Vera found in her own gate (74902). One file, +24 lines, nocli/srcchange, so no version bump.The survivor. In
pruneVersionDirs, the consumer checkstypeof installedAt !== 'number'and the default reader'scatchreturnsnull. My arm for that hazard ("a dir with no readable mtime is left alone") injectedmtime: () => null— so it witnessed the consumer's branch and never the production fallback, which is the code that actually runs whenstatSyncthrows. Change thatcatchtoreturn 0and all 49 tests stayed green: an unreadable directory becomes maximally old and is pruned, which is precisely the hazard the branch exists to prevent.The arm.
the REAL mtime reader leaves an unstat-able dir alone (the production fallback, not an injected one): a home holding the newest three versions, areadDirthat also reports0.3.9(past the count, so a genuine prune candidate) while the filesystem does not have it — the real reader'sstatSyncthrows, so the defaultcatchis what decides. Injectedremovespy asserts the decision, not the filesystem outcome (removed === [],removenever called). The positive control is the arm next to it —keeps the newest N and removes the rest— which shows the same default reader pruning the same shape of candidate when it can read the mtime, so this test cannot pass by pruning being broken generally.Verified both ways. Baseline at this head: 1 suite / 50 tests, green. Mutation: default
catch { return null }→return 0→ 50 tests, 1 failed, killed by exactly this arm. One instrument note for whoever re-runs it: my first mutation run usednpx jestinstead ofnode --experimental-vm-modules node_modules/.bin/jestand reported 0 tests / 1 runtime error — a suite that never loaded. It showed up as a zero in the count, not as a pass, which is the only reason it did not read as a kill.Correction to the record of this row, since this PR replaces a bad one. #1967 was my attempt to correct #1965's stated cause, and it was wrong in the opposite direction: it adopted a cold-install/create-race reading that Vera withdrew in 74839 and that Wren's hashing settles the other way (74837 —
sha512('@commonlyai/mcp@latest')[0:16] = 6d82e98be466b586is ONE shared dir, its package re-created in place at 10:53:03Z; the4401305a…dir was Wren's own exact-version probe, not a second seat). The sentencemaincarries inmcp-home.jsand in the test header is the true one — a shared@latestdir rewritten in place after a publish (the post-publishCONNECTION_CLOSEDwindow), plus registry/lock work on everynpxrun (the no-publish 30 sCONNECT_TIMEOUT) — so nothing there needed changing. #1967 is closed.