Repository navigation
perf(tooling): skip unused historical blobs in line-cap checks - #173340
Merged
Merged
Conversation
Measure current sources before reading inherited allowances. Under-cap changes no longer trigger per-blob partial-clone fetches or rename detection. Preserve over-cap, staged, and rename-aware enforcement.
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
steipete
marked this pull request as ready for review
October 15, 2026 17:36
Contributor
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 16, 2026
…law#173340) Measure current sources before reading inherited allowances. Under-cap changes no longer trigger per-blob partial-clone fetches or rename detection. Preserve over-cap, staged, and rename-aware enforcement.
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.
What Problem This Solves
The line-cap ratchet reads every changed file's historical source before discovering that most files already satisfy their cap. In a partial clone,
git cat-file --batchstill fetches absent blobs one at a time, creating one pack per unnecessary historical read.User Impact
Checks for under-cap changes avoid historical blob downloads and their pack/index files. Existing caps, inherited allowances, staged changes, exclusions, and rename handling stay intact. No clone migration or runtime configuration change.
Why This Change Was Made
Measure current sources first. Only over-cap files need historical allowances; defer rename detection until those allowances are needed and load only their base sources. Initial changed-path enumeration uses
--no-renamesand still includes renamed destinations as additions.Production delta: 10 additions / 11 deletions (net -1 line), excluding tests and docs. This deletes unnecessary reads rather than adding a cache or prefetch layer.
Evidence
Synthetic Linux benchmark of the actual script, isolated sandbox, Git 2.53, 30 changed source files in a
blob:noneclone, each reduced from 900 to 100 lines under a 700-line cap. Three fresh clones per version; file-protocol origin, no simulated network latency:Both versions returned the same successful result. That is 3.56x faster and about 2 MiB lower median peak RSS in this fixture. Expected pack creation from this eliminated under-cap baseline-read path is zero; total repository packs/day cannot be projected without invocation counts. Ordinary explicit fetches, over-cap historical reads, and arbitrary agent shell commands remain separate producers. When any file remains over-cap, existing repository-wide rename detection may still hydrate other blobs. This is not a claim that all observed pack growth came from the ratchet.
The investigation also reproduced
git diff --checkcreating 40 packs for 20 changed files andcat-file --batchcreating 20, versus zero for metadata-onlydiff --name-only --no-renames. Those are separate Git behaviors, not changed here.pnpm test test/scripts/check-line-cap-ratchet.test.ts --maxWorkers=1: 6/6 passed, 10.22 s test time, 12.56 s runner wall time. Existing coverage exercises growth, shrinking debt, renames, staged/untracked sources, exclusions, and syntax errors.git diff --checkpassed.