chore(extension): remove dead matchPullRequestTarget; pin extension endpoints to the API contract - #8053
Conversation
…SONbored#8023) matchPullRequestTarget duplicated matchGitHubPageTarget minus the kind field. JSONbored#7487 removed issue-page matching and simplified the target guard but left this wrapper stranded: no production call site remains -- it was only re-exported through the __loopoverContentInternals test hook. Unlike the issue's "zero test files" note, the ROOT test suite does consume that hook: test/unit/extension-content.test.ts asserted on internals.matchPullRequestTarget in four places (the miss that got the previous attempt at this issue closed). Those assertions are removed with the symbol; the one case unique to them -- a JSONbored/pull/146/files sub-path still matching -- is ported to matchGitHubPageTarget, where the behavior actually lives, so no behavioral coverage is lost.
…ontract (JSONbored#8023) Each of the three extension suites gains a drift guard pinning the endpoints / message types its subject consumes to the backend contract (buildOpenApiSpec): auth.js's fetched paths, background.js's routed message types, and content.js's overlay request chain. A backend route rename now surfaces in the suite that owns the affected extension file instead of silently breaking installed extensions. This also satisfies scoped CI's per-shard non-empty-lcov verification: an extension-only diff previously selected a single test file that executed no instrumented source, so every validate-tests shard failed "Verify coverage report exists" even with all tests green (the failure that closed the prior attempt). Three selected suites, one per shard, each executing src/openapi/spec.ts, produce a real lcov in every shard.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Caution 🛑 LoopOver review result - fixes requiredReview updated: 2026-07-22 16:18:26 UTC
Review summary Nits — 4 non-blocking
CI checks failing
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. Visual preview
Click any thumbnail to open the full-size screenshot. Before = production · After = this PR's preview deploy. Scroll preview
A short scroll-through clip (desktop) — click either thumbnail to open the full animation. Evidence for scroll-linked behavior a single screenshot can't show. 🟩 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.
|
|
LoopOver is closing this pull request on the maintainer's behalf (CI is failing (validate, validate-tests (3), validate-tests (2), validate-tests (1))). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed. |

Summary
matchPullRequestTarget(apps/loopover-extension/content.js) duplicatedmatchGitHubPageTargetminus thekindfield. fix(extension): drop dead issue-page content-script match #7487 removed issue-page matching and simplified the target guard, leaving this wrapper stranded — no production call site remains; it was only re-exported through the__loopoverContentInternalstest hook. Removed, along with its hook entry; repo-wide grep confirms zero remaining references.test/unit/extension-content.test.tsasserted oninternals.matchPullRequestTargetin four places — the miss that closed fix(extension): remove dead matchPullRequestTarget from content.js #8037). Those assertions are removed with the symbol; the one case unique to them (a/pull/146/filessub-path still matching) is ported ontomatchGitHubPageTarget, where the behavior actually lives.buildOpenApiSpec):auth.js's fetched paths (/v1/extension/pull-context,/v1/auth/logout),background.js's routed message types, andcontent.js's overlay request chain. A backend route rename now surfaces in the suite that owns the affected extension file instead of silently breaking installed extensions. These also give every scoped-CI shard real instrumented-source coverage — see Notes.Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #123) — a linked open issue is required for every contributor PR.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally;codecov/patchrequires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
vitest runover all three extension suites (19 tests green),npm run extension:lint+npm run extension:typecheck(the extension checks CI gatesvalidate-codeon, whichtest:ciitself does not run), and the full rootnpm run typecheck. Source diff is deletion-only (content.js−7 lines); all additions aretest/**(Codecov-ignored), so there is no new patch-coverage surface. Additionally simulated the scoped-CI shard condition locally: each suite run alone under--coverage.all=falsenow emits a ~2 MBlcov.infowith 708 instrumented files (previously 0 bytes — the exactVerify coverage report existsfailure that sank the last attempt).actionlint/workers/mcp/ui checks are untouched surfaces; CI runs them all.Safety
UI Evidencesection below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.UI Evidence
Not applicable — dead-code removal with no behavior or visual change (the overlay mounts through
matchGitHubPageTarget, which is untouched).Notes
test/unit/extension-content.test.tsasserting on it (TypeError). chore(extension): remove dead matchPullRequestTarget from content.js #8050 fixed that but selected only one test file under scoped CI, which executed no instrumented source — everyvalidate-testsshard failedVerify coverage report existson an emptylcov.infoeven with all tests green. This PR touches all three extension suites (one per shard) and each executessrc/openapi/spec.tsthrough its parity guard, so every shard produces a real coverage report. Verified locally per-suite before opening.