fix(signals): unify the test-evidence code-path predicate as isTestableCodePath - #9906
Conversation
|
Tip ✅ LoopOver review result - approve/merge recommendedReview updated: 2026-07-29 21:40:56 UTC
Review summary Nits — 3 non-blocking
Decision drivers
Context & advisory signals — never blocks the verdict
Linked issue satisfactionPartially addressed 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.
|
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
…leCodePath buildMissingTestEvidenceFinding exempts generated/vendored/minified output (source extensions, but nobody hand-writes tests for regenerated code) via !PADDING_CATEGORIES.has(classifyChangedFile(path)). Two consumers claimed to mirror it and used bare isCodeFile instead: - improvement.ts's hasCodeFileToEvaluate returned true for a codegen-only diff, so buildMissingTestEvidenceFinding's null (no testable code) was read as "test evidence present" and a zero-test PR of only api/service.pb.go scored added_test_evidence and banded `minor` instead of `insufficient-signal`. - contributor-open-pr-monitor.ts's missingTestsFromFiles flagged a vendored-only diff missing_tests, telling the contributor to test vendored code the gate-side exempts. Extract the rule once as isTestableCodePath(path) in the engine slop module, re-export it through the src shim, and adopt it in both consumers (removing the two hand-copied isCodeFile filters). No change to PADDING_CATEGORIES or any replacement/threshold. Closes JSONbored#9696
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #9906 +/- ##
==========================================
+ Coverage 91.76% 91.85% +0.09%
==========================================
Files 921 921
Lines 113198 113209 +11
Branches 27253 27284 +31
==========================================
+ Hits 103879 103991 +112
+ Misses 8034 7929 -105
- Partials 1285 1289 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Summary
The canonical "does this diff have code that needs tests" rule lives in
buildMissingTestEvidenceFinding(packages/loopover-engine/src/signals/slop.ts): it exemptsPADDING_CATEGORIES(generated/vendored/minified) because that output carries source-file extensions (e.g. protoc's.pb.gostubs) but nobody hand-writes tests for mechanically regenerated code. Two consumers claimed to mirror it and used bareisCodeFileinstead:improvement.ts'shasCodeFileToEvaluatereturnedtruefor a codegen-only diff (isCodeFile("api/service.pb.go")is true), sobuildMissingTestEvidenceFinding'snull(no testable code) was interpreted as "test evidence present". A zero-test PR of onlyapi/service.pb.goemittedadded_test_evidenceand bandedminorinstead ofinsufficient-signal.contributor-open-pr-monitor.ts'smissingTestsFromFilesflagged avendor/**/*.go-only diff asmissing_tests, telling the contributor to add tests for vendored code the gate-side deliberately exempts (its comment even claimed parity with slop.ts).Fix
Extract the rule once as
export function isTestableCodePath(path)inpackages/loopover-engine/src/signals/slop.ts(isCodeFile(path) && !PADDING_CATEGORIES.has(classifyChangedFile(path))), havebuildMissingTestEvidenceFindingcall it, re-export it through the engine index and thesrc/signals/slop.tsshim, and adopt it in both consumers — removing the two hand-copiedisCodeFilefilters. No change toPADDING_CATEGORIESmembership or any replacement/threshold. Thesrc/signals/slop.tsshim stays a pure re-export, soscripts/check-engine-parity.tsstill recognises it.Tests
node:test(packages/loopover-engine/test/slop.test.ts, new):isTestableCodePathis true for hand-authored source and false for generated/vendored/minified/non-code;buildMissingTestEvidenceFindingexempts a codegen-only diff and still fires on real uncovered code.improvement.test.ts: a codegen-only diff no longer emits a falseadded_test_evidence(bandinsufficient-signal).contributor-open-pr-monitor.test.ts:missingTestsFromFilesexempts a generated/vendored-only diff, still flags real uncovered code, and clears when a substantive test file is present.Both root regression tests fail against the current bare-
isCodeFilecode. Engine-flag coverage of the changed engine lines verified 100% (source-mapped lcov).Closes #9696