Skip to content

test(signals): cover buildReviewRiskExplanation's 5-way branch logic (#9287) - #9338

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
nghetien:fix/issue-9287-a1-signals-add-direct-unit
Jul 27, 2026
Merged

test(signals): cover buildReviewRiskExplanation's 5-way branch logic (#9287)#9338
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
nghetien:fix/issue-9287-a1-signals-add-direct-unit

Conversation

@nghetien

Copy link
Copy Markdown
Contributor

Summary

  • buildReviewRiskExplanation (src/signals/review-risk.ts) previously only had REST/MCP parity coverage — no test asserted what each of its five recommendation branches actually resolves to.
  • Adds test/unit/review-risk.test.ts with one direct unit test per branch (likely_duplicate, maintainer_lane, needs_author, review, watch), each using minimal fixture inputs to deterministically trigger that branch, and asserting both recommendation and summary.
  • Mirrors the structure of test/unit/contributor-readiness-band.test.ts per the issue's guidance. No implementation changes — coverage-only.

Closes #9287

Scope

  • Single area: test coverage only (test/unit/)
  • No changes to src/signals/review-risk.ts or any other implementation file
  • No changes to site/, CNAME, VitePress, or GitHub Pages

Validation

  • npx vitest run test/unit/review-risk.test.ts — 5/5 passing
  • npx turbo run build --filter=@loopover/engine — green
  • npx turbo run build --filter=@loopover/mcp — green
  • npx turbo run build:tsc build:verify --filter=@loopover/miner — green
  • Full unsharded npm run test:ci — not completed locally before submission (interrupted by session timeout); test file only exercises existing exported functions/types with no src changes, so risk is low

Safety

  • No secrets, tokens, wallets, hotkeys, trust scores, or reward values in code or text
  • No auth/CORS surface touched (pure function test only)
  • No public/private boundary surface touched

Notes

This is a coverage-only PR requested by #9287; the function under test is unchanged.

…SONbored#9287)

Existing coverage only checked REST/MCP parity for the shared review-risk
builder, never asserting what each of the five recommendation branches
(likely_duplicate, maintainer_lane, needs_author, review, watch) actually
resolves to. Add direct unit tests with minimal fixtures for each branch.
@nghetien
nghetien requested a review from JSONbored as a code owner July 27, 2026 13:21
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 27, 2026
@loopover-orb

loopover-orb Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Tip

✅ LoopOver review result - approve/merge recommended

Review updated: 2026-07-27 13:31:16 UTC

1 file · 1 AI reviewer · no blockers · readiness 95/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
This is a pure test-addition PR adding five direct unit tests for buildReviewRiskExplanation's recommendation branches (likely_duplicate, maintainer_lane, needs_author, review, watch), closing #9287 as stated. No implementation files are touched, the fixtures are minimal and each test asserts both recommendation and summary output, and all CI checks passed on this commit. The PR correctly links to and closes its authorizing issue and stays narrowly scoped to test/unit/.

Nits — 5 non-blocking
  • The full unsharded test:ci run wasn't completed locally per the PR checklist, though this is low-risk for a test-only addition and CI passed regardless.
  • test/unit/review-risk.test.ts duplicates the repo/issue/pr fixture builder functions already present in test/contract/predicted-gate-engine-collision-parity.test.ts — consider extracting a shared test-fixtures helper to avoid drift between the two.
  • The inline comment referencing signals: add direct unit-test coverage for buildReviewRiskExplanation's 5-way branch logic #9287 at the top of the describe block duplicates context already in the PR description; fine to keep but not load-bearing.
  • Consider factoring the repo()/issue()/pr() fixture builders into a shared test helper module since they're now duplicated verbatim across at least two test files.
  • If buildReviewRiskExplanation has additional edge cases (e.g., multiple simultaneous high-risk conditions), a follow-up issue could track further branch/priority-ordering coverage.

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 #9287
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: 10 registered-repo PR(s), 4 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor nghetien; Gittensor profile; 10 PR(s), 0 issue(s).
Improvement ℹ️ Insufficient signal risk: clean · value: insufficient-signal · LLM: minor
Linked issue satisfaction

Addressed
The PR adds test/unit/review-risk.test.ts which imports buildReviewRiskExplanation directly, constructs minimal fixture inputs (mirroring the contributor-readiness-band precedent), and includes one test per each of the 5 recommendation branches with assertions on both recommendation and summary, without modifying the implementation file.

Review context
  • Author: nghetien
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Dart, JavaScript, Python, CSS, C#, C++, TypeScript
  • Official Gittensor activity: 10 PR(s), 0 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 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LoopOver approves — the gate is satisfied and CI is green.

@loopover-orb
loopover-orb Bot merged commit aad3f93 into JSONbored:main Jul 27, 2026
6 checks passed
@nghetien
nghetien deleted the fix/issue-9287-a1-signals-add-direct-unit branch July 28, 2026 13:48
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.

signals: add direct unit-test coverage for buildReviewRiskExplanation's 5-way branch logic

1 participant