fix(review): remove structurally-unreachable branch in classifyChangedFile (#8353)#8412
Conversation
…dFile (JSONbored#8353) isTestFile already delegates to isTestPath internally, so the `|| isTestPath(path)` disjunct on the "test" classification line can never independently change the result -- one branch combination was permanently uncoverable under the 99% branch-counted Codecov gate. Drops the redundant check and its now-unused import; the documented five-way precedence and all existing test cases are unchanged.
|
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 #8412 +/- ##
==========================================
- Coverage 92.42% 89.58% -2.85%
==========================================
Files 791 98 -693
Lines 79294 22711 -56583
Branches 23950 3876 -20074
==========================================
- Hits 73291 20346 -52945
+ Misses 4866 2187 -2679
+ Partials 1137 178 -959
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-24 13:37:17 UTC
Review summary Nits — 6 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.
|
Summary
classifyChangedFile's "test" check wasisTestFile(path) || isTestPath(path), butisTestFile(re-exported viasrc/signals/local-branch.tsfrompackages/loopover-engine/src/signals/path-matchers.ts) is itself defined asreturn isTestPath(file)— the sameisTestPathimported here fromsrc/signals/test-evidence.ts. The two operands are always equal, so the||'s right-hand side can never independently flip the result: one truth-table combination of this line is structurally unreachable by any input.isTestPath(path)disjunct (keepingisTestFile(path)) and its now-unused import. No behavior change: the documented five-way precedence (generated > test > docs > config > source) and every existing "test" classification case are unchanged.Closes #8353
Scope
type(scope): short summaryConventional Commit format, for examplefix(api): restore profile access checks.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.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:
src/review/changed-files-classify.ts(pure logic, no UI/MCP/workers/OpenAPI surface). Confirmed vianpx vitest run test/unit/changed-files-classify.test.ts— all 7 existing tests pass unmodified, with 100% line and 100% branch coverage on the changed file (verified directly againstcoverage/lcov.info: 5/5 lines, 12/12 branches onsrc/review/changed-files-classify.ts), which is the change's entire test-relevant surface.npm run typecheckpasses clean, confirming the now-unused import was fully removed with no dangling reference. The UI/MCP/workers checks are unaffected by a change confined to this one backend-only file.Safety
UI Evidencesection below with JPG/JPEG or PNG screenshots. (N/A — no visible UI changes.)Notes