test(engine): make self-review-adapter coverage visible to Codecov#8466
Conversation
`packages/loopover-engine/src/miner/self-review-adapter.ts` (JSONbored#2334) turns an attempt's live worktree diff into the same inputs `buildPredictedGateVerdict` and an injected slop-assessment function expect, so the miner's self-review pass is byte-identical in shape to the live maintainer gate. It exports `buildSelfReviewPredictedGateInput`, `buildSelfReviewChangedPaths`, `buildSelfReviewSlopInput`, `runSelfReview`, and `SELF_REVIEW_PASSING_CONCLUSION`. It is fully exercised by the engine package's own `node --test` suite, but that runner is not part of the root vitest run Codecov reads `codecov/patch` from, so it reports as ~0% covered despite being genuinely tested (same blind spot as JSONbored#6250). Add a root-level vitest twin importing the adapter functions via the engine barrel and mirroring every scenario the package suite covers: each optional identity field present/omitted (both arms of every conditional spread), the `?? null` description fallback and `?.length ?? 0 > 0` hasLinkedIssue derivation across undefined/empty/non-empty linkedIssues, changedPaths always threaded through, the optional context fields (bounties/issueQuality/confirmedContributor) forwarded, the injected runSlopAssessment called with the built input and its result passed through verbatim, and passesPredictedGate true only for a `"success"` conclusion. Uses `buildPredictedGateVerdict` + `parseFocusManifest` and an INJECTED slop fake exactly as the package suite does; the real `src/signals/slop.ts` is never imported. 100% line + branch of the source locally. Test-only: no change to any file under `packages/loopover-engine/src/**` or `packages/loopover-engine/test/**`. Also document the root mirror in the engine README — the doc touch keeps this a full-coverage CI run so the sharded coverage blobs reach the merge step (a root-`test/**`-only diff is otherwise treated as a scoped, artifact-free run). Closes JSONbored#8348
|
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 #8466 +/- ##
===========================================
+ Coverage 80.86% 92.50% +11.64%
===========================================
Files 791 791
Lines 79320 79333 +13
Branches 23954 23961 +7
===========================================
+ Hits 64142 73389 +9247
+ Misses 12156 4807 -7349
+ Partials 3022 1137 -1885
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 14:59:33 UTC
Review summary Nits — 3 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.
|
Closes #8348
Summary
packages/loopover-engine/src/miner/self-review-adapter.ts(maintainer: self-review adapter wiring iterate-loop diffs through predicted-gate + slop scoring #2334) turns an attempt's live worktree diff into the same inputsbuildPredictedGateVerdictand an injected slop-assessment function expect, so the miner's self-review pass is byte-identical in shape to the live maintainer gate. It exportsbuildSelfReviewPredictedGateInput,buildSelfReviewChangedPaths,buildSelfReviewSlopInput,runSelfReview, andSELF_REVIEW_PASSING_CONCLUSION. It is fully exercised by the engine package's ownnode --testsuite (packages/loopover-engine/test/self-review-adapter.test.ts), but that runner is not part of the rootvitestrun Codecov readscodecov/patchfrom, so it reports as ~0% covered despite being genuinely tested. Same blind spot as fix(ci): review-enrichment's real node:test coverage is invisible to Codecov (83 of 83 files effectively unmeasured) #6250.test/unit/self-review-adapter.test.ts, importing the adapter functions via the engine barrel (../../packages/loopover-engine/src/index) and mirroring every scenario the package suite covers — following the sibling pattern intest/unit/calibration-dashboard.test.ts.packages/loopover-engine/src/**orpackages/loopover-engine/test/**. It usesbuildPredictedGateVerdict+parseFocusManifestand an injectedrunSlopAssessmentfake exactly as the package suite does — the realsrc/signals/slop.tsis never imported.Covered, per the issue's requirements:
buildSelfReviewPredictedGateInput(each ofbody/labels/linkedIssues/authorAssociationpresent and omitted — both arms of every conditional spread),buildSelfReviewChangedPaths(path mapping in order + the empty-array case),buildSelfReviewSlopInput(the?? nulldescription fallback for present-body vs undefined→null, andhasLinkedIssuefrom?.length ?? 0 > 0across undefined / empty / non-emptylinkedIssues), andrunSelfReview(changedPathsalways threaded through; each optionalSelfReviewContextfield present and omitted; the injectedrunSlopAssessmentcalled with the built input and its result returned verbatim;passesPredictedGatetrue only for a"success"conclusion and false for a real blocked verdict). Locally this brings the source to 100% line + branch under vitest.Why the README change (please read before grading scope)
A pure
test/**-only diff that touches nopackages/loopover-engine/**path is classified by CI as a scoped, coverage-artifact-free run: each shard runsvitest --changed=origin/main --coverage.all=false, produces an emptycoverage/lcov.info(no changedsrc/**), and skips uploading its coverage blob. With zero blobs,validate-tests-mergethen fails withENOENT … all-blob-reports, failingvalidate. Touching an engine-package path (documenting the mirror in the README) flips CI onto the full-coverage run, whose shards upload real blobs so the merge job passes — the same doc touch the merged twins for #8349/#8344/#8343/#8345 used. It adds zerosrc/**production lines, socodecov/patchstill has nothing on this diff to grade.Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.md; does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #8348.Validation
git diff --check— clean.npm run actionlint— N/A: no workflow / composite-action changes.npm run typecheck— green (after building@loopover/engine, as the roottest:cisequence does before typecheck).npm run test:coveragelocally — the new file passes (15 tests) and reports 100% line + branch coverage ofself-review-adapter.ts.npm run test:workers— N/A: no worker code changed.npm run build:mcp/npm run test:mcp-pack— N/A: no MCP changes.npm run ui:openapi:check/npm run ui:lint/npm run ui:typecheck/npm run ui:build— N/A: no UI, API, or OpenAPI surface changed.npm audit --audit-level=moderate— not run locally (sandbox audit endpoint returns a lockfile 400); no dependency changes, so it cannot affect the audit. CI runs it against a clean install.If any required check was skipped, explain why:
Safety
CHANGELOG.mdnot edited (not a release-prep PR).Notes
self-review-adapter.tswas changed, and the package's ownnode --testsuite was left untouched, as the issue requires.