Skip to content

test(signals): full-branch coverage for duplicate-winner isDuplicateClusterWinnerByClaim - #3311

Merged
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
jony376:test/duplicate-winner-claim-branches-2113
Jul 5, 2026
Merged

test(signals): full-branch coverage for duplicate-winner isDuplicateClusterWinnerByClaim#3311
loopover-orb[bot] merged 1 commit into
JSONbored:mainfrom
jony376:test/duplicate-winner-claim-branches-2113

Conversation

@jony376

@jony376 jony376 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Extends test/unit/duplicate-winner.test.ts with focused cases for the remaining isDuplicateClusterWinnerByClaim branches: empty sibling list, missing self claim timestamps, later sibling claims, and equal-claim tie breaks by PR number.

Closes #2113.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked an issue, or this is small enough that the summary explains why an issue is not needed.

Validation

  • git diff --check
  • npm run typecheck
  • npx vitest run test/unit/duplicate-winner.test.ts (25/25 passed)
  • npm run test:coverage locally; codecov/patch requires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests.
  • API/OpenAPI/MCP behavior is updated and tested where needed.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks.
  • Visible UI changes include a UI Evidence section below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

UI Evidence

Not applicable — test-only change.

Notes

  • Covers empty siblings, undefined self claim, later sibling claims, equal-claim wins/losses by PR number, and complements existing null/unparseable sibling claim cases.

Made with Cursor

@jony376
jony376 requested a review from JSONbored as a code owner July 5, 2026 01:36
@superagent-security superagent-security Bot added the contributor:flagged Contributor flagged for review by trust analysis. label Jul 5, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

🚨 Contributor flagged. Click here for more info: Superagent Dashboard

@superagent-security

Copy link
Copy Markdown
Contributor

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

1 similar comment
@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 01:41:23 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 exercises the remaining reachable branches in `isDuplicateClusterWinnerByClaim`: empty sibling clusters, missing self timestamps, later siblings, and equal timestamp tie-breaks. The added cases match the current implementation in `src/signals/duplicate-winner.ts` and do not introduce production behavior or wiring changes. CI and patch coverage are already green, and I do not see a correctness blocker in the visible diff.

Nits — 2 non-blocking
  • nit: `test/unit/duplicate-winner.test.ts:71` uses a hand-written object with `linkedIssueClaimedAt: undefined` while the local `claim` helper only accepts `string | null`; consider widening the helper to `string | null | undefined` so the shape stays consistent across these branch tests.
  • `test/unit/duplicate-winner.test.ts:42` could change `const claim = (number: number, linkedIssueClaimedAt: string | null)` to accept `undefined` as well, then use `claim(12, undefined)` at line 71 for the missing timestamp case.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #2113
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 ❌ 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: 1006 registered-repo PR(s), 705 merged, 41 issue(s).
Contributor context ✅ Confirmed Gittensor contributor jony376; Gittensor profile; 1006 PR(s), 41 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: jony376
  • 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: 1006 PR(s), 41 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Await review-lane availability.
  • Refresh registry data or choose a registered active repo.
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

@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.73%. Comparing base (55dff40) to head (b5fd8a6).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3311   +/-   ##
=======================================
  Coverage   93.73%   93.73%           
=======================================
  Files         276      276           
  Lines       30381    30381           
  Branches    11073    11073           
=======================================
  Hits        28479    28479           
  Misses       1257     1257           
  Partials      645      645           
🚀 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 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 83918ac into JSONbored:main Jul 5, 2026
8 checks passed
JSONbored pushed a commit that referenced this pull request Jul 5, 2026
…on (#3311)

Closes #2113.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor:flagged Contributor flagged for review by trust analysis. gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(signals): full-branch coverage for duplicate-winner isDuplicateClusterWinnerByClaim

1 participant