test(calibration): make signal-tracking's real coverage visible to Codecov#8438
Conversation
…decov `packages/loopover-engine/src/calibration/signal-tracking.ts` (JSONbored#7982) — `computeRulePrecision`, `computeRuleRepeatCount`, `evaluateRuleRepeatAlarm` — 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 the module reports as ~0% covered despite being genuinely tested (same blind spot as JSONbored#6250). Add a root-level vitest twin that imports the three primitives via the engine barrel and re-exercises every scenario the package suite covers, so vitest — and therefore Codecov — sees the module too. Mirrors the existing sibling twins `test/unit/calibration-dashboard.test.ts` and `test/unit/discovery-soft-claim.test.ts`. Covers both arms of every branch in the three functions (100% line + branch of the source module locally). No change to any file under `packages/loopover-engine/src/**` or `packages/loopover-engine/test/**`. Also document the root mirror in the engine package README, next to the existing Codecov-mirror note (JSONbored#8349) — the same doc touch the merged JSONbored#8349 twin used, which keeps this a full-coverage CI run: a root-`test/**`-only diff is otherwise treated as a scoped, coverage-artifact-free run whose shard blobs never reach the merge step (that is what auto-closed the first attempt, JSONbored#8407). Closes JSONbored#8343
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
1 similar comment
|
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 #8438 +/- ##
===========================================
+ Coverage 79.34% 92.44% +13.09%
===========================================
Files 791 791
Lines 79289 79294 +5
Branches 23950 23952 +2
===========================================
+ Hits 62915 73306 +10391
+ Misses 13302 4847 -8455
+ Partials 3072 1141 -1931
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 13:40:40 UTC
Review summary Nits — 4 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 #8343
Summary
packages/loopover-engine/src/calibration/signal-tracking.ts(Extract a shared, deployment-agnostic calibration/signal-tracking module for ORB + AMS #7982) —computeRulePrecision,computeRuleRepeatCount, andevaluateRuleRepeatAlarm— is fully exercised by the engine package's ownnode --testsuite (packages/loopover-engine/test/signal-tracking.test.ts), but that runner is not part of the rootvitestrun Codecov readscodecov/patchfrom, so the module reports as ~0% covered in Codecov's eyes 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/signal-tracking.test.ts, importing the three primitives via the engine barrel (../../packages/loopover-engine/src/index) and re-exercising every scenario the package suite covers — mirroring the sibling twinstest/unit/calibration-dashboard.test.tsandtest/unit/discovery-soft-claim.test.ts.packages/loopover-engine/src/**orpackages/loopover-engine/test/**.Covers both arms of every branch in the three functions:
computeRulePrecision(fired-rule filter, override rule match/no-match,reversed/confirmedverdicts,decided > 0 ? … : nullboth arms),computeRuleRepeatCount(both&&operands' false arms via same-rule-different-target and same-target-different-rule, plus the empty-list case), andevaluateRuleRepeatAlarm(below/at-threshold boundary,seen-dedup first-seen order, other-ruleIdexclusion, empty list). Locally this brings the source module 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 test shard runsvitest --changed=origin/main --coverage.all=false, produces an emptycoverage/lcov.info(no changedsrc/**), and therefore skips uploading its coverage blob ("scoped run passed but exercised no src/** files -- skipping coverage artifacts for this shard"). With zerocoverage-blob-shard-*artifacts,validate-tests-mergethen fails withENOENT … all-blob-reports, which failsvalidateand auto-closes the PR — which is exactly what happened to my first attempt (#8407).The merged twin PR for #8349 avoided this by also adding a note to
packages/loopover-engine/README.md. Touching an engine-package path flips CI onto the full-coverage run, whose shards upload real blobs sovalidate-tests-mergepasses. This PR follows that established, merged precedent: the README note is genuinely useful (it documents why the root mirror exists) and keeps CI on the full-coverage path. It adds zerosrc/**production lines, socodecov/patchstill has nothing on this diff to grade — the coverage this adds is what makes a future PR touchingsignal-tracking.tsgate correctly.Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.md; does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #8343.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 (13 tests) and reports 100% line + branch coverage ofsignal-tracking.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
signal-tracking.tswas changed, and its ownnode --testsuite was left untouched, as the issue requires.