Skip to content

test(miner-governor): close branch-coverage gaps in self-review adapter tests - #5039

Merged
JSONbored merged 1 commit into
mainfrom
feat/miner-self-review-adapter-2334-coverage-fixup
Jul 11, 2026
Merged

test(miner-governor): close branch-coverage gaps in self-review adapter tests#5039
JSONbored merged 1 commit into
mainfrom
feat/miner-self-review-adapter-2334-coverage-fixup

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

Follow-up to #2334 (#5034, merged). Real coverage measurement via node --experimental-test-coverage (not just visual test-suite review) found self-review-adapter.js at only 50% branch coverage despite the existing suite looking thorough on read-through:

  • buildSelfReviewPredictedGateInput's four optional-field conditional spreads (body, labels, linkedIssues, authorAssociation) each only had one side of their ternary exercised (the tests always used a diff state that set some fields and omitted others, but never varied it across both directions for the same field).
  • buildSelfReviewSlopInput's (diffState.linkedIssues?.length ?? 0) > 0 fallback chain was only exercised with linkedIssues: [], never with linkedIssues: undefined -- a distinct branch.
  • runSelfReview's three optional context-field spreads (bounties, issueQuality, confirmedContributor) were never exercised with those fields actually set.

Adds four targeted tests closing all 8 zero-hit branches identified via LCOV BRDA analysis. No production code changes -- test-only.

Validation

  • npm run build && npx tsc -p tsconfig.test.json && node --experimental-test-coverage --test "dist-test/**/*.test.js" -- 400/400 tests pass.
  • self-review-adapter.js coverage: 100.00% lines / 100.00% branch / 100.00% funcs (was 50% branch before this PR).

Test plan

  • All engine node:test tests pass (400/400).
  • Measured branch coverage on the touched file is 100%.

…er tests

Measured coverage (node --experimental-test-coverage) showed
self-review-adapter.js at only 50% branch coverage despite the existing
suite looking thorough -- four optional-field ternary spreads and one
?.length ?? 0 fallback each had only one side exercised. Add targeted
tests for the untaken branches; file now measures 100/100/100
(lines/branch/funcs).
@superagent-security

Copy link
Copy Markdown
Contributor

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

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
gittensory-ui abaf95f Commit Preview URL

Branch Preview URL
Jul 11 2026, 09:51 AM

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

loopover-orb Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-11 09:53:52 UTC

1 file · 1 AI reviewer · 1 blocker · readiness 100/100 · CI green · unstable

⏸️ Suggested Action - Manual Review

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.

Review summary
This is a test-only PR that closes 8 previously zero-hit branches in self-review-adapter.js's test suite (optional-field ternaries in buildSelfReviewPredictedGateInput, the linkedIssues `?.length ?? 0` fallback in buildSelfReviewSlopInput, and optional context-field forwarding in runSelfReview). Each new test exercises a genuinely distinct, real branch — e.g. `linkedIssues: undefined` vs `linkedIssues: []` are different inputs to the same nullish-fallback expression, and the labels/authorAssociation test exercises the 'field present' side of conditional spreads that prior tests only exercised from the 'absent' side. No production code changes, and the new assertions cross-check against direct `buildPredictedGateVerdict` calls the same way the existing suite already does, so this follows established convention rather than inventing a new pattern.

Nits — 4 non-blocking

Concerns raised — review before merging

  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
Signal Result Evidence
Code review ❌ 1 blocker 1 reviewer
Linked issue ✅ No-issue rationale PR body explains why no issue is linked.
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 (no linked issue context).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 47 registered-repo PR(s), 39 merged, 428 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 47 PR(s), 428 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
Improvement ⚠️ ℹ️ Insufficient signal risk: clean · value: insufficient-signal — Nothing measurable for the structural-improvement analyzers on this PR (e.g. no code files changed). LLM value judgment: moderate — It closes 8 real, previously-unhit branches in a hot-path self-review adapter with tests that exercise genuinely distinct inputs rather than fabricating unreachable states, meaningfully raising confidence in a file central to gate-prediction correctness.
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 47 PR(s), 428 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
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.

🟩 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 Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@loopover-orb loopover-orb Bot added the manual-review Gittensor contributor context label Jul 11, 2026
@JSONbored
JSONbored merged commit 6b52b20 into main Jul 11, 2026
13 checks passed
@JSONbored
JSONbored deleted the feat/miner-self-review-adapter-2334-coverage-fixup branch July 11, 2026 10:03
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. manual-review Gittensor contributor context

Projects

None yet

Development

Successfully merging this pull request may close these issues.

maintainer: self-review adapter wiring iterate-loop diffs through predicted-gate + slop scoring

1 participant