test(engine): make harness-submission-trigger coverage visible to Codecov#8454
Conversation
…ecov `packages/loopover-engine/src/miner/harness-submission-trigger.ts` (JSONbored#2337) is the final gate before a real call site may build an `open_pr` local-write spec from a passing `HandoffPacket`: `evaluateHarnessSubmissionTrigger` checks a session-level circuit breaker FIRST (N consecutive gate-blocks pauses the run, never un-tripped by a later candidate), then delegates to the separately-tested `shouldSubmit`. 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 `evaluateHarnessSubmissionTrigger` and `DEFAULT_MAX_CONSECUTIVE_GATE_BLOCKS` via the engine barrel and mirroring every scenario the package suite covers: the circuit-breaker boundary (below/at/above the ceiling, with the tripped path never consulting shouldSubmit), the `?? DEFAULT_MAX_CONSECUTIVE_GATE_BLOCKS` fallback (both arms), and the delegation outcomes (clean allow, kill-switch, predicted-gate failure, slop-over-threshold, observe mode). Fixtures built exactly as the package suite does; 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 extend the engine README's Codecov-mirror note — 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#8346
|
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 #8454 +/- ##
===========================================
+ Coverage 79.34% 92.47% +13.13%
===========================================
Files 791 791
Lines 79319 79320 +1
Branches 23952 23952
===========================================
+ Hits 62933 73350 +10417
+ Misses 13312 4839 -8473
+ Partials 3074 1131 -1943
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:27:19 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 #8346
Summary
packages/loopover-engine/src/miner/harness-submission-trigger.ts(maintainer: wire the submission-gate trigger into the harness driving loop #2337) is the final gate before a real call site may build anopen_prlocal-write spec from a passingHandoffPacket.evaluateHarnessSubmissionTriggerchecks a session-level circuit breaker FIRST (N consecutive gate-blocks pauses the run, never un-tripped by a later candidate), then delegates to the separately-testedshouldSubmit. It is fully exercised by the engine package's ownnode --testsuite (packages/loopover-engine/test/harness-submission-trigger.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/harness-submission-trigger.test.ts, importingevaluateHarnessSubmissionTriggerandDEFAULT_MAX_CONSECUTIVE_GATE_BLOCKSvia 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/**. Fixtures (HandoffPacket/MinerKillSwitchScope/verdict) are built exactly as the package suite does, so no real IO path is touched.Covered, per the issue's requirements: the circuit-breaker boundary (
consecutiveGateBlocksbelow the ceiling proceeds toshouldSubmit; at/above trips it withcircuitBreakerTripped: true,allow: false, without consultingshouldSubmit— boundary case exactlymaxConsecutiveGateBlocks), the?? DEFAULT_MAX_CONSECUTIVE_GATE_BLOCKSfallback (default applied when omitted, and an explicit override honored — both arms), and a non-tripped candidate threadingkillSwitchScope/verdict/slopThreshold/modeintoshouldSubmitand returning itsallow/reasonsverbatim (clean allow, kill-switch block, predicted-gate failure, slop-over-threshold, observe mode). 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 (extending the README's Codecov-mirror note) 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 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 #8346.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 (9 tests) and reports 100% line + branch coverage ofharness-submission-trigger.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
harness-submission-trigger.ts(orshouldSubmit) was changed, and the package's ownnode --testsuite was left untouched, as the issue requires.