Skip to content

test(enrichment): cover churn-hotspot empty-list and threshold boundaries - #3385

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
dhgoal:test/churn-hotspot-coverage
Jul 5, 2026
Merged

test(enrichment): cover churn-hotspot empty-list and threshold boundaries#3385
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
dhgoal:test/churn-hotspot-coverage

Conversation

@dhgoal

@dhgoal dhgoal commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Hardens unit coverage for the churn-hotspot analyzer's pure helpers with two edge cases the existing threshold test doesn't exercise:

  • summarizeChurn([]) — an empty commit list must be zero churn (fixFraction: 0), exercising the commitCount ? fixCount / commitCount : 0 divide-by-zero guard's else branch (the existing test only feeds 10 commits).
  • isHotspot at the exact >= thresholds{commitCount: 8, fixFraction: 0.3} is inclusive (a hotspot), while one step below either floor (7 commits, or 0.29 fix-fraction) is not. The existing test only checks values well above/below, not the boundary.

Test-only, against the compiled dist/, in the analyzer's own test file. No source or shared-registry change; the pure helpers are already imported by this file, so no new import surface.

No linked issue — straightforward boundary/edge coverage hardening of pure functions; changes no runtime behavior.

Scope

  • Conventional Commit; focused; touches only review-enrichment/test/churn-hotspot.test.ts. No site//CNAME/**/lovable/**; no CHANGELOG.md.

Validation

  • npm --prefix review-enrichment test966 pass / 0 fail (build + sourcemap validate + metadata --check + node tests; exactly CI).
  • git diff --check clean.

Safety

  • Test-only, no runtime change. No secrets/wallets/hotkeys/trust/reward terms.

…ries

Adds edge cases the existing threshold test omits: summarizeChurn on an empty
commit list (the divide-by-zero guard's else branch → fixFraction 0), and
isHotspot at the exact inclusive `>=` thresholds (commits 8, fixFraction 0.3)
plus one step below each. Test-only.
@dhgoal
dhgoal requested a review from JSONbored as a code owner July 5, 2026 05:52
@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 5, 2026
@loopover-orb

loopover-orb Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Warning

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

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-05 05:54:24 UTC

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

⏸️ Suggested Action - Manual Review

Review summary
This is a focused test-only change that adds real coverage for the empty-list churn summary path and the exact inclusive hotspot thresholds. The new assertions exercise the pure helpers already imported by this test file, and the cases line up with the described `commitCount ? ... : 0` guard and `>=` behavior. I do not see a reachable correctness issue in the diff.

Nits — 2 non-blocking
  • nit: review-enrichment/test/churn-hotspot.test.ts:39 and review-enrichment/test/churn-hotspot.test.ts:44 duplicate implementation details in comments, so they will become stale if the helper thresholds or guard expression are refactored without changing behavior.
  • review-enrichment/test/churn-hotspot.test.ts:44: Keep the boundary test, but consider making the test body the source of truth and trimming the comment to avoid restating the exact operators already enforced by the assertions.
Signal Result Evidence
Code review ✅ No blockers 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 ❌ 5/25 Preflight is holding this PR: the review lane is unavailable, so it is not ready for automated review.
Contributor workload ✅ 10/10 Author activity: 69 registered-repo PR(s), 42 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor dhgoal; Gittensor profile; 69 PR(s), 0 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: dhgoal
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: not available
  • Official Gittensor activity: 69 PR(s), 0 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Await review-lane availability.
  • Refresh registry data or choose a registered active repo.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
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 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.

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

@loopover-orb
loopover-orb Bot merged commit 1fe11b1 into JSONbored:main Jul 5, 2026
6 checks passed
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.

1 participant