⚠️ Definition of Done: this issue must be completed in full, in a single PR. Do not split this
work across multiple PRs, and do not defer any Deliverable below to a follow-up issue. A PR that
satisfies only some of the Deliverables, stubs a required test, or leaves a checkbox
partially-done does NOT resolve this issue and will be closed.
Context
packages/loopover-miner/lib/self-review-context.ts's applyLiveGateThresholdsToManifest
overlays a live-probed ORB confidence floor onto a statically-reconstructed FocusManifest, per its
own doc comment: "confidence_floor → raise-only readinessMinScore (mirrors
applySelfTuneOverrideToSettings)":
if (typeof fields.confidence_floor === "number") {
const floorScore = Math.max(0, Math.min(100, Math.round(fields.confidence_floor * 100)));
if (typeof gate.readinessMinScore === "number" && floorScore > gate.readinessMinScore) {
gate.readinessMinScore = floorScore;
}
}
packages/loopover-engine/src/focus-manifest.ts defaults readinessMinScore to null (not a
number) whenever a repo's manifest doesn't configure a custom readiness threshold — the common case
for any repo without a custom .loopover.yml readiness block. typeof null === "object", so the
typeof gate.readinessMinScore === "number" guard evaluates false for exactly this default case.
The result: a successfully-fetched live confidence_floor is silently discarded and never applied
whenever there's no pre-existing static value to compare it against — the "raise-only" overlay
never RAISES anything in the most common baseline configuration, because there's nothing for it to
compare against and raise.
Every existing test for this function in test/unit/miner-self-review-context.test.ts (around
lines 717-746 and 843-857) constructs its baseline manifest from YAML that explicitly sets
gate.readiness.minScore to a real number (70, 10, or a deliberately-invalid "x" string for the
type-guard case) — none constructs a manifest with no readiness block at all (the real
readinessMinScore: null default) and then applies a live confidence_floor, so the no-op path is
currently untested.
Requirements
- Change
applyLiveGateThresholdsToManifest's confidence_floor branch so that when
gate.readinessMinScore is null (or otherwise not a number), the live floorScore is ADOPTED
as the initial value, not discarded. The "raise-only" semantics must still hold when a real
existing number IS present — do not regress the existing raise-only comparison for that case.
- Do not change behavior for the case where
fields.confidence_floor itself is not a number — that
branch is untouched (existing outer if (typeof fields.confidence_floor === "number") guard
stays).
Deliverables
All deliverables are required in this one PR.
Test Coverage Requirements
This repo's Codecov patch gate is 99%+ (branch-counted) on packages/loopover-miner/lib/**. Add
the new regression test to test/unit/miner-self-review-context.test.ts (this package's tests
live in the shared root test/ directory, not packages/loopover-miner/test/**). The new branch
handling readinessMinScore === null must be exercised, and the pre-existing branches (both the
raise case and the no-raise-because-lower case) must remain covered by the existing tests.
Expected Outcome
A repo whose .loopover.yml has no custom readiness threshold still gets the live ORB-probed
confidence floor applied when one is available, matching the "raise-only" overlay's own stated
intent instead of silently no-op'ing for the most common baseline configuration.
Links & Resources
packages/loopover-miner/lib/self-review-context.ts — applyLiveGateThresholdsToManifest
(~lines 167-186).
packages/loopover-engine/src/focus-manifest.ts — readinessMinScore's default of null
(~line 1386).
test/unit/miner-self-review-context.test.ts — existing tests around lines 717-746, 843-857 to
extend/mirror.
Context
packages/loopover-miner/lib/self-review-context.ts'sapplyLiveGateThresholdsToManifestoverlays a live-probed ORB confidence floor onto a statically-reconstructed
FocusManifest, per itsown doc comment: "confidence_floor → raise-only readinessMinScore (mirrors
applySelfTuneOverrideToSettings)":
packages/loopover-engine/src/focus-manifest.tsdefaultsreadinessMinScoretonull(not anumber) whenever a repo's manifest doesn't configure a custom readiness threshold — the common case
for any repo without a custom
.loopover.ymlreadiness block.typeof null === "object", so thetypeof gate.readinessMinScore === "number"guard evaluatesfalsefor exactly this default case.The result: a successfully-fetched live
confidence_flooris silently discarded and never appliedwhenever there's no pre-existing static value to compare it against — the "raise-only" overlay
never RAISES anything in the most common baseline configuration, because there's nothing for it to
compare against and raise.
Every existing test for this function in
test/unit/miner-self-review-context.test.ts(aroundlines 717-746 and 843-857) constructs its baseline manifest from YAML that explicitly sets
gate.readiness.minScoreto a real number (70, 10, or a deliberately-invalid"x"string for thetype-guard case) — none constructs a manifest with no
readinessblock at all (the realreadinessMinScore: nulldefault) and then applies a liveconfidence_floor, so the no-op path iscurrently untested.
Requirements
applyLiveGateThresholdsToManifest'sconfidence_floorbranch so that whengate.readinessMinScoreisnull(or otherwise not a number), the livefloorScoreis ADOPTEDas the initial value, not discarded. The "raise-only" semantics must still hold when a real
existing number IS present — do not regress the existing raise-only comparison for that case.
fields.confidence_flooritself is not a number — thatbranch is untouched (existing outer
if (typeof fields.confidence_floor === "number")guardstays).
Deliverables
applyLiveGateThresholdsToManifestadopts a liveconfidence_flooras the initialreadinessMinScorewhen the static baseline has no existing numeric value (nullorotherwise not a number).
overwrite it; a live floor higher than an existing static number DOES overwrite it) is
unchanged and still passes its existing tests.
readinessblock (i.e. thereal default
readinessMinScore: null), applying a liveconfidence_floor, and assertingthe resulting
gate.readinessMinScoreequals the live-derivedfloorScore— the exact paththat currently silently no-ops.
All deliverables are required in this one PR.
Test Coverage Requirements
This repo's Codecov patch gate is 99%+ (branch-counted) on
packages/loopover-miner/lib/**. Addthe new regression test to
test/unit/miner-self-review-context.test.ts(this package's testslive in the shared root
test/directory, notpackages/loopover-miner/test/**). The new branchhandling
readinessMinScore === nullmust be exercised, and the pre-existing branches (both theraise case and the no-raise-because-lower case) must remain covered by the existing tests.
Expected Outcome
A repo whose
.loopover.ymlhas no custom readiness threshold still gets the live ORB-probedconfidence floor applied when one is available, matching the "raise-only" overlay's own stated
intent instead of silently no-op'ing for the most common baseline configuration.
Links & Resources
packages/loopover-miner/lib/self-review-context.ts—applyLiveGateThresholdsToManifest(~lines 167-186).
packages/loopover-engine/src/focus-manifest.ts—readinessMinScore's default ofnull(~line 1386).
test/unit/miner-self-review-context.test.ts— existing tests around lines 717-746, 843-857 toextend/mirror.