Skip to content

test(miner-governor): close codecov/patch gap on kill-switch's repoFullName fallback - #5047

Merged
JSONbored merged 1 commit into
mainfrom
fix-kill-switch-codecov-patch-gap
Jul 11, 2026
Merged

test(miner-governor): close codecov/patch gap on kill-switch's repoFullName fallback#5047
JSONbored merged 1 commit into
mainfrom
fix-kill-switch-codecov-patch-gap

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

Follow-up to #2341 (#5012, merged). That PR landed with codecov/patch actually failing at 92.30% -- I only discovered this by checking the raw PR checks after the fact, since my own verification during that PR relied on the engine package's separate node:test suite, which is invisible to Codecov. Only files with a corresponding packages/gittensory-miner/lib/ wrapper exercised by a root-level vitest test (via the vi.mock("@jsonbored/gittensory-engine", ...) source-redirect pattern) are actually measured by Codecov -- kill-switch.ts has exactly that (governor-kill-switch.js + test/unit/miner-governor-kill-switch.test.ts), so the gap was real and reachable, not a scope-exclusion artifact.

The one partial branch: buildMinerKillSwitchTransitionGovernorLedgerEvent's input.repoFullName ?? null (kill-switch.ts:69) never took its null-producing side -- the root test's only transition-recording assertions always supplied a repoFullName, and the one test that omitted it never reached that line (it was a same-scope no-op, returning null earlier). Added a genuine scope-changing transition with repoFullName omitted, asserting the ledger row lands with repoFullName: null.

Validation

npx vitest run test/unit/miner-governor-kill-switch.test.ts --coverage --coverage.include="packages/gittensory-engine/src/governor/kill-switch.ts"
  • 6/6 tests pass.
  • kill-switch.ts: 100.00% stmts / 100.00% branch / 100.00% funcs / 100.00% lines (was 92.85% branch / 92.30% Codecov patch).

Test-only change, no production code touched.

Test plan

  • All 6 tests in the affected file pass.
  • Measured branch coverage on the touched file is 100%, via the same vitest + source-redirect path Codecov itself reads.

…llName fallback

PR #5012 (#2341, merged) landed with codecov/patch failing at
92.30% -- one partial branch never exercised: the root vitest test
only ever supplied repoFullName on transitions, so
buildMinerKillSwitchTransitionGovernorLedgerEvent's
`input.repoFullName ?? null` fallback (kill-switch.ts:69) never took
its null-producing side. Add a real, non-no-op transition (a genuine
scope change) with repoFullName omitted, asserting the ledger row's
repoFullName lands as null rather than undefined or omitted.

kill-switch.ts now measures 100/100/100/100 via the same root vitest
+ vi.mock source-redirect path codecov actually reads (the engine
package's own separate node:test suite, which this session had been
using for local verification elsewhere, is invisible to codecov --
only files with a corresponding miner-lib wrapper exercised by a root
vitest test are.)
@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jul 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.16%. Comparing base (8f10e83) to head (9e34521).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5047   +/-   ##
=======================================
  Coverage   94.16%   94.16%           
=======================================
  Files         463      463           
  Lines       39429    39429           
  Branches    14384    14384           
=======================================
+ Hits        37128    37129    +1     
  Misses       1646     1646           
+ Partials      655      654    -1     
Flag Coverage Δ
shard-1 46.59% <ø> (-0.02%) ⬇️
shard-2 33.21% <ø> (-0.12%) ⬇️
shard-3 31.22% <ø> (-0.19%) ⬇️
shard-4 32.48% <ø> (-0.27%) ⬇️
shard-5 34.37% <ø> (+0.94%) ⬆️
shard-6 45.22% <ø> (+0.21%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@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 10:43:44 UTC

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

⏸️ Suggested Action - Manual Review

  • AI review could not be completed: The dual-model AI review did not return a usable verdict for this change.

Review summary
AI review could not be completed for this PR head. Gittensory is holding this PR for manual review instead of relying on deterministic signals alone.

Nits — 1 non-blocking
  • AI review could not be completed — The gate is held for a human reviewer rather than passed automatically; it re-evaluates on the next update.

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 No AI review summary
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).
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: Python, TypeScript, Ruby, Go, JavaScript, MDX, Shell, Solidity
  • 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 linked an issue Jul 11, 2026 that may be closed by this pull request
4 tasks
@JSONbored
JSONbored merged commit aa9b145 into main Jul 11, 2026
18 checks passed
@JSONbored
JSONbored deleted the fix-kill-switch-codecov-patch-gap branch July 11, 2026 10:47
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: global + per-repo kill-switch

1 participant