Skip to content

test(engine): cover reviewer-consensus-calibration under root vitest - #8374

Closed
claytonlin1110 wants to merge 1 commit into
JSONbored:mainfrom
claytonlin1110:feat/reviewer-consensus-calibration-vitest-8349
Closed

test(engine): cover reviewer-consensus-calibration under root vitest#8374
claytonlin1110 wants to merge 1 commit into
JSONbored:mainfrom
claytonlin1110:feat/reviewer-consensus-calibration-vitest-8349

Conversation

@claytonlin1110

Copy link
Copy Markdown
Contributor

What

packages/loopover-engine/src/reviewer-consensus-calibration.ts (658 lines, ~128 branches) already had a full, passing node:test suite one directory over — but Codecov's codecov/patch gate only reads root vitest coverage, so the package's largest branch surface reported ~0% despite real tests. Same blind-spot class as #6250.

Changes

  • Added test/unit/reviewer-consensus-calibration.test.ts (vitest), importing the four public APIs from the engine barrel — matching the test/unit/calibration-dashboard.test.ts pattern.
  • Mirrored every scenario from packages/loopover-engine/test/reviewer-consensus-calibration.test.ts, plus remaining branch edges (normalizeOptionalWeight non-number/non-string, vote/dimension aliases, sanitize malformed rows, empty-dimensions render path, etc.) so the module hits 100% statements/branches/functions/lines under npm run test:coverage.
  • No changes under packages/loopover-engine/src/** or packages/loopover-engine/test/**.

Closes

Closes #8349

Verification

  • npx vitest run test/unit/reviewer-consensus-calibration.test.ts — 23 passed
  • npx vitest run --coverage --pool=forks test/unit/reviewer-consensus-calibration.test.ts --coverage.include=packages/loopover-engine/src/reviewer-consensus-calibration.ts100% stmts/branches/funcs/lines

…SONbored#8349)

The engine package already had a full node:test suite for this module, but
Codecov's codecov/patch gate only reads root vitest coverage — so the
package's largest branch surface (~128 branches) reported ~0% despite real
tests one directory over. Mirror every existing scenario (plus remaining
branch edges) into test/unit/ so the file reaches 100% line/branch coverage
under npm run test:coverage. No source changes.
@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 11:08:00 UTC

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

🛑 Suggested Action - Fix Blockers

Review summary
This is a pure test-only addition mirroring an existing node:test suite for reviewer-consensus-calibration.ts into vitest, closing the Codecov visibility gap described in #8349 (same pattern as #6250 per the description). The tests are thorough, cover public API behavior plus branch-edge cases (vote/dimension aliases, sanitize paths, markdown escaping), and assert concrete expected values rather than just truthy checks, which is a good sign they exercise real behavior rather than fabricated scenarios. No src/ or existing test changes are included, so risk is minimal.

Nits — 4 non-blocking
  • test/unit/reviewer-consensus-calibration.test.ts: the file is quite large (740 lines) for a single test file — consider whether splitting by describe block (config/ingest/compute/render) would improve maintainability, though this is a style preference not a defect.
  • The 'validate' and 'validate-tests-merge' CI checks failed with no detail provided; given the branch is 1 commit behind default, this is likely caused by upstream changes rather than this diff, but worth confirming after a rebase.
  • Consider a comment or assertion noting the source-of-truth suite path more prominently at the top of describe blocks (already partially done) so future maintainers know to keep both suites in sync if the engine's node:test suite changes.
  • If CI failures persist after rebasing onto the current default branch, investigate further since they are currently unverifiable from this diff alone.

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 #8349
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: 394 registered-repo PR(s), 251 merged, 92 issue(s).
Contributor context ✅ Confirmed Gittensor contributor claytonlin1110; Gittensor profile; 394 PR(s), 92 issue(s).
Improvement ℹ️ Insufficient signal risk: clean · value: insufficient-signal · LLM: moderate
Linked issue satisfaction

Addressed
The PR adds test/unit/reviewer-consensus-calibration.test.ts using vitest describe/it/expect, importing the four required functions from the engine barrel, and mirrors (plus extends) the scenarios from the sibling node:test suite including config resolution edge cases, ingestion rejection reasons, composite scoring weight fallback (including the all-zero-weights objective-only fallback per #6170),

Review context
  • Author: claytonlin1110
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, JavaScript, TypeScript, Rust
  • Official Gittensor activity: 394 PR(s), 92 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.

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.

reviewer-consensus-calibration.ts (658 lines) is the package's largest branch surface invisible to Codecov

1 participant