Skip to content

fix(engine): diffFilePriority's vendored-directory pattern misses vendored/third_party/third-party/bower_components/jspm_packages - #7540

Merged
loopover-orb[bot] merged 2 commits into
JSONbored:mainfrom
claytonlin1110:fix/diff-file-priority-vendored-dirs-7526
Jul 20, 2026
Merged

fix(engine): diffFilePriority's vendored-directory pattern misses vendored/third_party/third-party/bower_components/jspm_packages#7540
loopover-orb[bot] merged 2 commits into
JSONbored:mainfrom
claytonlin1110:fix/diff-file-priority-vendored-dirs-7526

Conversation

@claytonlin1110

Copy link
Copy Markdown
Contributor

Summary

  • diffFilePriority's priority-4 ("least-useful-to-review, never real collision evidence") directory alternation only matched vendor (singular), while the sibling isVendoredFileFrom matcher in packages/loopover-engine/src/signals/path-matchers.ts already recognizes vendor, vendored, third_party, third-party, bower_components, and jspm_packages.
  • path-matchers.ts had this full set from its original creation (feat(signals): add slop path matchers and non-substantive-padding signal (#561) #752/feat(signals): classify build and CI configuration files in path-matchers (#561) #1045) and later additions (fix(signals): classify bower_components and jspm_packages as vendored #2777 added bower_components/jspm_packages) with no corresponding update to diff-file-priority.ts — the two matchers silently drifted apart.
  • Practical effect: a file shared between two unrelated PRs under e.g. third_party/foo.js, vendored/bar.js, or bower_components/baz.js was ranked priority 0 ("ordinary source") instead of 4, so sharesMeaningfulFile (both call sites: packages/loopover-engine/src/signals/engine.ts and packages/loopover-engine/src/signals/predicted-gate-engine.ts) treated it as real collision evidence — inflating the collision/duplicate-cluster signal on exactly the kind of vendored-artifact path both call sites' own doc comments say should be excluded.
  • Extended diffFilePriority's directory alternation to the full isVendoredFileFrom set, with a code comment cross-referencing path-matchers.ts as the source of truth to keep in sync. No other branches of diffFilePriority (lockfile/doc/test) were touched, per the issue's stated scope.
  • Scope note: src/review/review-diff.ts and src/review/review-grounding.ts carry their own host-side copies of diffFilePriority with the identical gap, but are out of scope for this issue (not referenced in its Requirements/Links) and scripts/check-engine-parity.ts's twin-pair drift check only verifies marker presence (not byte-identical bodies) for this pair, so this scoped fix doesn't trip it.

Tests

  • packages/loopover-engine/test/diff-file-priority.test.ts: added a case asserting priority 4 for a path under each newly-added directory name (vendored/x.js, third_party/x.js, third-party/x.js, bower_components/x.js, jspm_packages/x.js), plus a sharesMeaningfulFile regression test confirming a file shared only under third_party//bower_components/ no longer counts as meaningful collision evidence.

Validation

  • npm run test --workspace @loopover/engine — 594/594 passing
  • npm run build --workspace @loopover/engine && npm run typecheck — clean
  • npm run engine-parity:drift-check — ok, 5 hand-duplicated file pairs agree
  • npm run test:engine-parity && npm run test:live-gate-parity && npm run test:driver-parity — all passing
  • npm run db:migrations:check && npm run db:schema-drift:check && npm run selfhost:env-reference:check && npm run miner:env-reference:check && npm run selfhost:validate-observability && npm run command-reference:check && npm run docs:drift-check && npm run manifest:drift-check — all clean
  • npm run cf-typegen:check — no drift
  • npm run actionlint — clean
  • git diff --check — clean
  • No UI-visible change, so no screenshots.

Closes #7526

…dored/third_party/third-party/bower_components/jspm_packages

diffFilePriority's priority-4 ("least-useful-to-review, never real collision
evidence") directory alternation only matched vendor (singular), while the
sibling isVendoredFileFrom matcher in path-matchers.ts already recognized
vendored, third_party, third-party, bower_components, and jspm_packages too.
A file shared between two unrelated PRs under one of those paths was ranked
priority 0 (ordinary source) instead of 4, inflating sharesMeaningfulFile's
collision/duplicate-cluster signal on exactly the kind of vendored-artifact
path both call sites' own doc comments say should be excluded.

Closes JSONbored#7526
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@claytonlin1110
claytonlin1110 marked this pull request as draft July 20, 2026 21:22
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 20, 2026
@loopover-orb

loopover-orb Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-20 21:37:51 UTC

2 files · 1 AI reviewer · no blockers · readiness 98/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This is a narrow, well-targeted regex fix aligning diffFilePriority's vendored-directory alternation with path-matchers.ts's isVendoredFileFrom set (adding vendored, third_party, third-party, bower_components, jspm_packages). The fix is correct and minimal — only the vendored-directory branch is touched, other branches untouched per stated scope. Tests directly exercise the new regex alternatives and the sharesMeaningfulFile downstream effect, which is the real collision-detection consequence described in the PR.

Nits — 4 non-blocking
  • The PR's own scope note admits src/review/review-diff.ts and src/review/review-grounding.ts carry identical copies of diffFilePriority with the same gap but are left unfixed — worth confirming a follow-up issue exists rather than letting the drift persist silently.
  • validate, validate-tests (4), and validate-tests (2) are listed as FAILED in CI STATUS; worth checking whether these are pre-existing/unrelated failures or caused by this change.
  • Consider filing or linking a follow-up issue to update the two host-side copies (review-diff.ts, review-grounding.ts) so the three-way drift doesn't recur.
  • Since scripts/check-engine-parity.ts only checks marker presence and not byte-identical bodies for this pair, consider strengthening that check to catch future silent drift like this one.

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #7526
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 376 registered-repo PR(s), 247 merged, 85 issue(s).
Contributor context ✅ Confirmed Gittensor contributor claytonlin1110; Gittensor profile; 376 PR(s), 85 issue(s).
Improvement ✅ Minor risk: clean · value: minor
Review context
  • Author: claytonlin1110
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 376 PR(s), 85 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask 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.

  • @loopover ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

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.

  • Re-run LoopOver review

…lure)

The previous CI run's Codecov upload step failed on both shards with
"gpg: no valid OpenPGP data found" / "Can't check signature: No public
key" -- a transient Codecov CLI key-server issue during a narrow ~10s
window, unrelated to this PR's code (a separate PR's run minutes earlier
uploaded successfully with the identical action). Empty commit to force
a fresh CI run since re-running the existing workflow run requires admin
rights on JSONbored/loopover this account doesn't have.
@claytonlin1110
claytonlin1110 marked this pull request as ready for review July 20, 2026 21:28

@loopover-orb loopover-orb Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LoopOver approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit 1a019ab into JSONbored:main Jul 20, 2026
19 checks passed
@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.47%. Comparing base (37e7f86) to head (83e0c91).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7540      +/-   ##
==========================================
- Coverage   88.47%   88.47%   -0.01%     
==========================================
  Files         720      720              
  Lines       75733    75733              
  Branches    22547    22548       +1     
==========================================
- Hits        67008    67004       -4     
  Misses       7679     7679              
- Partials     1046     1050       +4     
Flag Coverage Δ
shard-1 32.99% <0.00%> (-0.05%) ⬇️
shard-2 36.85% <0.00%> (ø)
shard-3 25.66% <0.00%> (ø)
shard-4 38.88% <0.00%> (ø)
shard-5 34.21% <100.00%> (ø)
shard-6 36.22% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...s/loopover-engine/src/review/diff-file-priority.ts 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(engine): diffFilePriority's vendored-directory pattern misses vendored/third_party/third-party/bower_components/jspm_packages

1 participant