Context
packages/loopover-engine/src/miner/harness-submission-trigger.ts (#2337) exports
evaluateHarnessSubmissionTrigger: the pure decision function that gates a real open_pr local-write from a
passing HandoffPacket. It checks a session-level circuit breaker FIRST (N consecutive allow: false
decisions pauses the whole session, never un-tripped by a later candidate on its own), then delegates to the
existing, separately-tested shouldSubmit (submission-gate.ts) for the per-candidate predicted-gate/slop
checks. It is live and consumed via the engine barrel, and it already has a full, passing test suite at
packages/loopover-engine/test/harness-submission-trigger.test.ts (9 scenarios, node --test).
Same failure mode as #6250 (review-enrichment's node:test suite being invisible to Codecov): that engine
package suite doesn't run under root vitest, which is what Codecov's codecov/patch gate reads.
packages/loopover-engine/src/**/*.ts is already listed in vitest.config.ts's coverage.include, so this
is a per-file gap — nothing under root test/** currently exercises evaluateHarnessSubmissionTrigger
directly, so it reports as ~0% covered in Codecov despite real, passing tests existing one directory over.
⚠️ Read this before starting. This issue is test-coverage-only. Do NOT modify
packages/loopover-engine/src/miner/harness-submission-trigger.ts,
packages/loopover-engine/src/miner/submission-gate.ts, or
packages/loopover-engine/test/harness-submission-trigger.test.ts. The only new artifact this issue calls
for is one new root-level vitest file that exercises the EXISTING, unchanged decision function. A PR that
changes this file's logic, or shouldSubmit's, does not satisfy this issue and is out of scope for it —
this is the live actuation trigger surface for an autonomous write and any behavior change here needs a
maintainer-reviewed design, not a routine contributor PR.
Requirements
- Create
test/unit/harness-submission-trigger.test.ts using describe/it/expect from vitest,
importing evaluateHarnessSubmissionTrigger and DEFAULT_MAX_CONSECUTIVE_GATE_BLOCKS from
"../../packages/loopover-engine/src/index" — the barrel — matching the existing sibling pattern in
test/unit/calibration-dashboard.test.ts. Build fake HandoffPacket/MinerKillSwitchScope fixtures the
same way packages/loopover-engine/test/harness-submission-trigger.test.ts already does.
- Cover, at minimum, every scenario already exercised in
packages/loopover-engine/test/harness-submission-trigger.test.ts (read it for the exact fixtures/assertions
to mirror), including:
- The session-level circuit breaker:
consecutiveGateBlocks below maxConsecutiveGateBlocks does not
trip it (falls through to shouldSubmit); at or above the threshold trips it (circuitBreakerTripped: true,
allow: false) WITHOUT calling shouldSubmit at all (verify via a passing handoff packet that would
otherwise allow) — boundary case: exactly maxConsecutiveGateBlocks.
- The
?? default for maxConsecutiveGateBlocks falling back to DEFAULT_MAX_CONSECUTIVE_GATE_BLOCKS when
omitted, and an explicit override being honored when provided.
- A non-tripped candidate correctly threading
killSwitchScope, the handoff packet's own
predictedGateVerdict/slopAssessment, slopThreshold, and mode into shouldSubmit, and returning its
allow/reasons verbatim with circuitBreakerTripped: false.
Deliverables
Test Coverage Requirements
packages/loopover-engine/src/miner/harness-submission-trigger.ts is inside coverage.include in
vitest.config.ts and therefore IS subject to the 99% Codecov codecov/patch branch-counted gate — today it
reports ~0% because nothing under root test/** exercises it directly. After this PR, npm run test:coverage
(run unsharded locally) should show this file at or near 100% line/branch coverage, including both arms of
the circuit-breaker boundary and the ?? default.
Expected Outcome
harness-submission-trigger.ts's already-real, already-tested circuit-breaker and gate-delegation logic
becomes visible to Codecov, so a future PR that changes this file is actually gated on real coverage instead
of a blind spot — closing a gap in the module this repo's own comments describe as "the trigger surface the
safety-tier system reserves for maintainer review."
Links & Resources
Context
packages/loopover-engine/src/miner/harness-submission-trigger.ts(#2337) exportsevaluateHarnessSubmissionTrigger: the pure decision function that gates a realopen_prlocal-write from apassing
HandoffPacket. It checks a session-level circuit breaker FIRST (N consecutiveallow: falsedecisions pauses the whole session, never un-tripped by a later candidate on its own), then delegates to the
existing, separately-tested
shouldSubmit(submission-gate.ts) for the per-candidate predicted-gate/slopchecks. It is live and consumed via the engine barrel, and it already has a full, passing test suite at
packages/loopover-engine/test/harness-submission-trigger.test.ts(9 scenarios,node --test).Same failure mode as #6250 (
review-enrichment's node:test suite being invisible to Codecov): that enginepackage suite doesn't run under root
vitest, which is what Codecov'scodecov/patchgate reads.packages/loopover-engine/src/**/*.tsis already listed invitest.config.ts'scoverage.include, so thisis a per-file gap — nothing under root
test/**currently exercisesevaluateHarnessSubmissionTriggerdirectly, so it reports as ~0% covered in Codecov despite real, passing tests existing one directory over.
Requirements
test/unit/harness-submission-trigger.test.tsusingdescribe/it/expectfromvitest,importing
evaluateHarnessSubmissionTriggerandDEFAULT_MAX_CONSECUTIVE_GATE_BLOCKSfrom"../../packages/loopover-engine/src/index"— the barrel — matching the existing sibling pattern intest/unit/calibration-dashboard.test.ts. Build fakeHandoffPacket/MinerKillSwitchScopefixtures thesame way
packages/loopover-engine/test/harness-submission-trigger.test.tsalready does.packages/loopover-engine/test/harness-submission-trigger.test.ts(read it for the exact fixtures/assertionsto mirror), including:
consecutiveGateBlocksbelowmaxConsecutiveGateBlocksdoes nottrip it (falls through to
shouldSubmit); at or above the threshold trips it (circuitBreakerTripped: true,allow: false) WITHOUT callingshouldSubmitat all (verify via a passing handoff packet that wouldotherwise allow) — boundary case: exactly
maxConsecutiveGateBlocks.??default formaxConsecutiveGateBlocksfalling back toDEFAULT_MAX_CONSECUTIVE_GATE_BLOCKSwhenomitted, and an explicit override being honored when provided.
killSwitchScope, the handoff packet's ownpredictedGateVerdict/slopAssessment,slopThreshold, andmodeintoshouldSubmit, and returning itsallow/reasonsverbatim withcircuitBreakerTripped: false.Deliverables
test/unit/harness-submission-trigger.test.ts(vitest, imports via the engine barrel).packages/loopover-engine/src/**orpackages/loopover-engine/test/**.Test Coverage Requirements
packages/loopover-engine/src/miner/harness-submission-trigger.tsis insidecoverage.includeinvitest.config.tsand therefore IS subject to the 99% Codecovcodecov/patchbranch-counted gate — today itreports ~0% because nothing under root
test/**exercises it directly. After this PR,npm run test:coverage(run unsharded locally) should show this file at or near 100% line/branch coverage, including both arms of
the circuit-breaker boundary and the
??default.Expected Outcome
harness-submission-trigger.ts's already-real, already-tested circuit-breaker and gate-delegation logicbecomes visible to Codecov, so a future PR that changes this file is actually gated on real coverage instead
of a blind spot — closing a gap in the module this repo's own comments describe as "the trigger surface the
safety-tier system reserves for maintainer review."
Links & Resources
packages/loopover-engine/src/miner/harness-submission-trigger.ts(module under test — do not modify)packages/loopover-engine/test/harness-submission-trigger.test.ts(the existing node:test suite to mirrorscenarios from)
test/unit/calibration-dashboard.test.ts(existing root-level vitest test following the exact pattern thisissue asks for)
vitest.config.ts(coverage.include, confirmspackages/loopover-engine/src/**/*.tsis already tracked)review-enrichment)