Repository navigation
feat: remove hard-link sampling of dependency trees of unknown size - #6688
Merged
Merged
Conversation
A tree of unknown size now follows its step's rule: the dormant step takes a linked worktree's tree after the measured ones, and the 7-day source rule keeps a source checkout's tree. Removes link-sample.ts, its two sidecar records and the tests that only protected it, and replaces LLP 0001 "A tree of hard links stays". Refs #6685
janicduplessis
marked this pull request as ready for review
November 29, 2026 15:34
janicduplessis
enabled auto-merge (squash)
November 29, 2026 15:34
Collaborator
Author
|
Review of head 7453b68, by a fresh reviewer subagent that did not implement the change, and by the Codex adversarial gate on the same head. Fresh reviewer: clear, no findings. It checked:
Dismissed: dropping the kept-reason rows for store-linked trees is approved by "Yes do all 4" (#6685). The old sidecar files are left for the status cache sweep rather than removed by Codex adversarial review: approve, no material findings. It found no regression against main: source trees of unknown size stay protected, deletion rechecks are intact, and legacy sample records are still sweepable. |
This was referenced Nov 29, 2026
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.
Description
Before the dormant dependency step and the 7-day source rule decided on a
node_modulesor Pods tree whose private size is unknown, gc sampled link counts in it and kept it when most files were hard links into a pnpm store outside the tree. The rule protected no user data, only a low-yield delete of a regenerable tree, and costlink-sample.ts(457 lines), a.modules.yamlparser, a native build output check with documented misses, and two locked sidecar records per tree. #6025 had already removed it from the pressure path.Maintainer decision: "Like if wr detect it is links", 2026-11-18, quoted in #5942. It added the sample (#5946).
Maintainer decision: "Yes do all 4", 2026-11-29, quoted in #6685, answering the cleanup-rules audit whose first candidate drops the sample. It replaces the 2026-11-18 decision.
Solution
A tree of unknown size now follows the rule its step already had for any tree of unknown size, with no exception for hard links:
selectDependencies(ranked, 'take'));'keep'), as it did for every unknown tree except a sampled one.Worst case: a linked worktree's pnpm
node_modulesis deleted afteridle.dormantDays, and pnpm relinks it from the store on the next install.The
<hash>.links.jsonand<hash>.native.jsonrecords an earlier Stim wrote stay recognized by the status cache listing, so the existing gc sweep still deletes them once their checkout is gone; nothing new writes them.forgetStatusMeasuresno longer names them.LLP 0001 "A tree of hard links stays" becomes "No step samples a tree for hard links" with both quotes. A separate commit fixes stale LLP text: the hand-edit check on dependency trees and the "install-edit" protection that #6639 removed, and "#6093 pending" in LLP 0001 and 0004 (closed by #6109 and #6115, which added the saved sentinel proof for scan-only marks).
Tests: the sampling tests in
gc-dependencies.test.tsare deleted. One test now asserts that the dormant step takes a store-linked tree of unknown size; it fails onmain, where the sample keeps it. The prune test for the leftover records seeds them by file name.Test plan
gc-dependencies.test.ts: the new test fails against the olddependencies.ts/link-sample.tsand passes here.maintenance-prune.test.ts: leftover.links.json/.native.jsonrecords of a gone checkout are deleted.ref-check), typecheck, build and knip pass locally.Fixes #6685