fix(review): skip lockfiles in RAG via the canonical isLockfile set - #8678
Conversation
…not a hand-rolled list rag.ts's SKIP_FILE_RE hand-listed 8 lockfile names plus a generic `.lock` suffix, which structurally can't catch lockfile names that don't end in .lock -- npm-shrinkwrap.json and packages.lock.json (.NET NuGet) both have a .json extension matched by CODE_EXT_RE, so classifyRepoFile returned "code" and chunked those large machine-generated files into the RAG index, burning embedding budget. Delegate the lockfile check to the canonical isLockfile()/LOCKFILE_NAMES set (path-matchers.ts), mirroring how DOC_EXT_RE already delegates to the canonical DOCS set, so future canonical additions propagate automatically. The 8 already-skipped names still skip (no regression).
|
🚨 Contributor flagged. Click here for more info: Superagent Dashboard |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8678 +/- ##
==========================================
- Coverage 93.77% 90.66% -3.11%
==========================================
Files 798 97 -701
Lines 79475 22747 -56728
Branches 24082 3956 -20126
==========================================
- Hits 74525 20623 -53902
+ Misses 3565 1945 -1620
+ Partials 1385 179 -1206
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Warning ⏸️ LoopOver review result - manual review recommendedReview updated: 2026-07-25 23:37:00 UTC
Review summary Nits — 3 non-blocking
Flagged checks (non-blocking)
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🧪 Chat with LoopOverAsk LoopOver a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://loopover.ai/docs/loopover-commands 🧪 Experimental — new and may change. 🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by LoopOver, a quiet PR intelligence layer for OSS maintainers.
|
What & why
Closes #8649.
src/review/rag.ts'sSKIP_FILE_REhand-listed 8 lockfile names plus a generic\.lock$suffix pattern instead of delegating to the canonicalLOCKFILE_NAMES/isLockfileset (packages/loopover-engine/src/signals/path-matchers.ts). The generic suffix coincidentally catches most of the canonical set, but structurally cannot catch lockfile names that don't end in.lock:npm-shrinkwrap.json(a valid npm lockfile format) andpackages.lock.json(.NET NuGet) both failSKIP_FILE_REand have a.jsonextension matched byCODE_EXT_RE, soclassifyRepoFilereturned"code"— chunking those large machine-generated files into the RAG index, burning embedding budget and polluting retrieval.The adjacent
DOC_EXT_REin the same file already received the equivalent drift fix ("mirror the canonical DOCS set"); the lockfile list never got the same treatment.The fix
Delegate the lockfile-name check to the canonical
isLockfile()inclassifyRepoFile, and reduceSKIP_FILE_REto only the suffix-shaped skips (minified bundles, sourcemaps, the generic.locksuffix, snapshots). Future additions to the canonicalLOCKFILE_NAMESset now propagate automatically.Tests
npm-shrinkwrap.jsonandpackages.lock.json(incl. a nested path) now classify"skip"(were"code").package-lock.json,pnpm-lock.yaml,go.sum,yarn.lock,bun.lockb,cargo.lock,poetry.lock,composer.lock) still skip.isLockfilecheck fails thenpm-shrinkwrap.jsonassertion.Validation
test/unit/rag.test.ts: 111 tests pass; typecheck clean;engine-parity:drift-checkOK (this only consumes the engine'sisLockfile, changes no twin); 100% of changed lines/branches covered.main, mergeable-clean.