Skip to content

test(calibration): make signal-tracking's real coverage visible to Codecov#8407

Closed
cleanjunc wants to merge 1 commit into
JSONbored:mainfrom
cleanjunc:feat/8343-signal-tracking-codecov-twin
Closed

test(calibration): make signal-tracking's real coverage visible to Codecov#8407
cleanjunc wants to merge 1 commit into
JSONbored:mainfrom
cleanjunc:feat/8343-signal-tracking-codecov-twin

Conversation

@cleanjunc

Copy link
Copy Markdown
Contributor

Summary

  • packages/loopover-engine/src/calibration/signal-tracking.ts (Extract a shared, deployment-agnostic calibration/signal-tracking module for ORB + AMS #7982) — computeRulePrecision, computeRuleRepeatCount, and evaluateRuleRepeatAlarm — is fully exercised by the engine package's own node --test suite (packages/loopover-engine/test/signal-tracking.test.ts), but that runner is not part of the root vitest run Codecov reads codecov/patch from, 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 (review-enrichment); packages/loopover-engine/src/** is already in vitest.config.ts's coverage.include, so the fix is per-file test coverage, not a wiring change.
  • Adds one root-level vitest twin, 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 existing sibling twins test/unit/calibration-dashboard.test.ts and test/unit/discovery-soft-claim.test.ts.
  • Test-only. No change to any file under packages/loopover-engine/src/** or packages/loopover-engine/test/** — the only new artifact is the one vitest file the issue calls for.

Covers both arms of every branch in the three functions: computeRulePrecision (fired-rule filter both arms, override rule match/no-match, reversed/confirmed verdicts, decided > 0 ? … : null both arms), computeRuleRepeatCount (both && operands' false arms via same-rule-different-target and same-target-different-rule, plus the empty-list case), and evaluateRuleRepeatAlarm (below/at threshold boundary, seen-dedup first-seen order, other-ruleId exclusion, empty list). Locally this brings the source module to 100% line + branch under vitest.

Closes #8343

Scope

  • The PR title follows type(scope): short summary Conventional Commit format.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes — it is a single new test file.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves — Closes #8343.

Validation

  • git diff --check — clean (no whitespace errors on the diff).
  • npm run actionlint — N/A: no GitHub Actions workflow or composite-action changes.
  • npm run typecheck — green (after npm run build --workspace @loopover/engine, as the root test:ci sequence does before typecheck).
  • npm run test:coverage locally — green; the new file passes (13 tests) and reports 100% line + branch coverage of signal-tracking.ts. codecov/patch note: this PR changes zero lines under src/** (it only adds a test/** file), so codecov/patch has no changed production lines to grade — the coverage this adds is what makes a future PR touching signal-tracking.ts gate correctly.
  • npm run test:workers — N/A: no worker code changed; this adds a root vitest unit test only.
  • 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 (the local sandbox's audit endpoint returns a lockfile 400); this PR makes no dependency changes (package.json / lockfiles untouched), so it cannot affect the audit result. CI runs it against a clean install.
  • New or changed behavior has unit tests — this PR is the added test coverage for existing, currently-Codecov-invisible behavior; no production behavior changed.

If any required check was skipped, explain why:

  • All skipped checks are N/A for a test-only PR that adds a single root-level vitest file with no production, UI, MCP, API, workflow, or dependency changes (explanations inline above).

Safety

  • No secrets, wallet details, hotkeys, coldkeys, PATs, private keys, trust scores, private rankings, or maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and implies no compensation or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests — N/A: none of these changed.
  • API/OpenAPI/MCP behavior is updated and tested where needed — N/A: none changed.
  • UI changes use live API data / real empty/error/loading states — N/A: no UI changes.
  • Public docs/changelogs are updated where needed; CHANGELOG.md not edited (not a release-prep PR).

Notes

  • The test imports the primitives from the engine barrel (../../packages/loopover-engine/src/index), not via a relative path into the source file, matching every existing sibling root-level engine test.
  • No behavior of signal-tracking.ts was changed, and its own node --test suite was left untouched, as the issue requires.

…decov

`packages/loopover-engine/src/calibration/signal-tracking.ts` (JSONbored#7982) 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
`computeRulePrecision` / `computeRuleRepeatCount` / `evaluateRuleRepeatAlarm`
report 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`.

Test-only: no change to any file under `packages/loopover-engine/src/**` or
`packages/loopover-engine/test/**`. Covers both arms of every branch in the three
functions (100% line + branch of the source module locally).

Closes JSONbored#8343
@cleanjunc
cleanjunc requested a review from JSONbored as a code owner July 24, 2026 11:44
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 24, 2026
@loopover-orb

loopover-orb Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Caution

🛑 LoopOver review result - fixes required

Review updated: 2026-07-24 12:02:52 UTC

1 file · 1 AI reviewer · no blockers · CI failing · blocked

🛑 Suggested Action - Fix Blockers

Review summary
This is a pure test-addition PR that mirrors an existing, passing node --test suite for signal-tracking.ts into a root-level vitest twin so Codecov's patch-coverage check (which only reads the root vitest run) can see coverage on computeRulePrecision, computeRuleRepeatCount, and evaluateRuleRepeatAlarm. The new tests import the real functions through the engine barrel (not a fabricated/mocked path) and the assertions match the values these functions actually produce given their documented branch logic (decided>0 ternary, both && operands in repeat-count, seen-dedup and threshold boundary in the alarm), so this is genuine coverage of the real path, not a fabricated test. It closes #8343, is scoped to a single new test file with no src changes, and follows the established sibling-twin pattern (calibration-dashboard.test.ts, discovery-soft-claim.test.ts).

Nits — 4 non-blocking
  • The file duplicates the entire package test suite almost verbatim rather than importing/reusing the existing test helpers or scenarios, which means the two suites will drift independently over time — consider whether a shared fixture module is worth it long-term.
  • validate and validate-tests-merge failed with no detail provided; worth confirming these aren't caused by the new import path (`../../packages/loopover-engine/src/index`) resolving differently under the root tsconfig/vitest config than the sibling twins do.
  • Consider factoring the `fired`/`override` helper functions into a shared test-utils module imported by both the package suite and this vitest twin to avoid the two suites silently diverging.
  • If `validate`/`validate-tests-merge` failures are unrelated to this diff (e.g., base-branch drift), note that in the PR so reviewers don't have to re-derive it.

CI checks failing

  • validate
  • validate-tests-merge

Decision drivers

  • ✅ Code review — No blockers (1 reviewer)
  • ✅ Gate result — Passing (No configured blocker found.)
Context & advisory signals — never blocks the verdict
Signal Result Evidence
Linked issue ✅ Linked #8343
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 53 registered-repo PR(s), 22 merged, 37 issue(s).
Contributor context ✅ Confirmed Gittensor contributor cleanjunc; Gittensor profile; 53 PR(s), 37 issue(s).
Improvement ℹ️ Insufficient signal risk: clean · value: insufficient-signal · LLM: minor
Linked issue satisfaction

Addressed
The PR adds exactly the requested root-level test/unit/signal-tracking.test.ts file importing the three primitives via the engine barrel, and covers all the specified scenarios (precision null/decided>0, cross-rule filtering, unmatched override, repeat-count double-match filtering, alarm threshold boundary, dedup order, cross-rule exclusion) without touching packages/loopover-engine/src or test di

Review context
  • Author: cleanjunc
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 53 PR(s), 37 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Start here: Triage stale or unlinked PRs.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
🧪 Chat with LoopOver

Ask 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.

  • @loopover ask <question> answers contribution-quality Q&A with source citations and freshness.
  • @loopover chat <question> answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @loopover mention with a real question is routed to the closest matching read-only command automatically — no exact syntax required.

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.

  • Re-run LoopOver review

@loopover-orb

loopover-orb Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

LoopOver is closing this pull request on the maintainer's behalf (CI is failing (validate, validate-tests-merge)). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

@loopover-orb loopover-orb Bot closed this Jul 24, 2026
loopover-orb Bot pushed a commit that referenced this pull request Jul 24, 2026
…decov (#8438)

`packages/loopover-engine/src/calibration/signal-tracking.ts` (#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
#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 (#8349) — the same doc touch the merged #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, #8407).

Closes #8343
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

calibration/signal-tracking.ts's real node:test coverage is invisible to Codecov

1 participant