Skip to content

feat(scoring): surface tied-leverage disclosure in score breakdown#2362

Merged
JSONbored merged 5 commits into
JSONbored:mainfrom
RenzoMXD:feat/scoring-issue-discovery-history-breakdown-v2
Jul 2, 2026
Merged

feat(scoring): surface tied-leverage disclosure in score breakdown#2362
JSONbored merged 5 commits into
JSONbored:mainfrom
RenzoMXD:feat/scoring-issue-discovery-history-breakdown-v2

Conversation

@RenzoMXD

@RenzoMXD RenzoMXD commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Replaces #1982 (cannot reopen after force-push per GitHub policy).

What changed:

  • ScoreBreakdownExplanation.highestLeverageLever gains a tiedLeverageComponents: string[] field
  • pickHighestLeverage surfaces all components sharing the top leverageScore
  • Tests cover no-tie (singleton) and blocked tie paths

Rationale: When two scoring levers tie for highest leverageScore, the breakdown silently showed only one. This disclosure lets contributors see all tied levers so they can prioritize which to fix first.

Files changed:

  • src/services/score-breakdown.ts — pickHighestLeverage collects ties; ScoreBreakdownExplanation.highestLeverageLever adds tiedLeverageComponents
  • test/unit/score-breakdown.test.ts — 2 new test cases (blocked tie scenario + no-tie scenario)

Validation:

  • npx vitest run test/unit/score-breakdown.test.ts — 24/24 pass
  • npm run typecheck clean
  • git diff --check clean

Linked issue: Closes #2142 (spawned from the tied-leverage gap identified in that issue).

@RenzoMXD RenzoMXD requested a review from JSONbored as a code owner July 1, 2026 12:15
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jul 1, 2026
@gittensory-orb

gittensory-orb Bot commented Jul 1, 2026

Copy link
Copy Markdown

Warning

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

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-02 04:19:47 UTC

2 files · 1 AI reviewer · no blockers · readiness 55/100 · CI green · clean

⏸️ Suggested Action - Manual Review

  • Touches a guarded path — held for manual review

Review summary
The change correctly extends the score breakdown response to disclose other components tied at the top leverage score, while preserving the existing deterministic top-component selection. The implementation sorts once, derives ties from the same ranked list, and returns an empty array for the normal no-tie path. The new tests cover the reachable blocked tie path and singleton top path, so the visible diff is safe enough to proceed.

Nits — 6 non-blocking
  • nit: src/services/score-breakdown.ts:21 adds a required public field, so confirm any external schema/OpenAPI or extension-facing contract docs are regenerated if this type is serialized outside TypeScript callers.
  • nit: src/services/score-breakdown.ts:371 uses exact numeric equality for leverage ties; that is fine for the current integer scores, but would become brittle if future components compute fractional leverage scores.
  • src/services/score-breakdown.ts:371 could make the current integer-score assumption explicit by either keeping leverageScore integer-only in the type contract or comparing through a small helper if fractional scores are expected later.
  • test/unit/score-breakdown.test.ts:677 should keep one assertion on the serialized output shape so this new public field stays present when highestLeverageLever is consumed as JSON.
  • Readiness score is below the configured threshold — Use the readiness panel as advisory maintainer context; the score does not block this PR.
  • Touches a guarded path — held for manual review — A maintainer must review and merge this change.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #2142
Related work ⚠️ 2 scoped overlaps Top overlaps are listed below; lower-confidence bulk is hidden.
Change scope ❌ 8/20 High review scope from cached public metadata (size label size:S; 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: 69 registered-repo PR(s), 32 merged, 7 issue(s).
Contributor context ✅ Confirmed Gittensor contributor RenzoMXD; Gittensor profile; 69 PR(s), 7 issue(s).
Gate result ⚠️ Not blocking Advisory; not blocking this PR.
Review context
Contributor next steps
  • Review top overlaps.
  • Add a concise scope and risk note.
  • Await review-lane availability.
  • Triage stale or unlinked PRs.
  • Refresh registry data or choose a registered active repo.
  • Check active issues and PRs before submitting.
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

@gittensory-orb gittensory-orb Bot added gittensor Gittensor contributor context gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 1.25x multiplier. labels Jul 1, 2026
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.83%. Comparing base (9e657e1) to head (b47be58).
⚠️ Report is 41 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2362   +/-   ##
=======================================
  Coverage   95.83%   95.83%           
=======================================
  Files         224      224           
  Lines       24996    24998    +2     
  Branches     9091     9092    +1     
=======================================
+ Hits        23954    23956    +2     
  Misses        428      428           
  Partials      614      614           
Files with missing lines Coverage Δ
src/services/score-breakdown.ts 99.19% <100.00%> (+0.01%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

RenzoMXD and others added 2 commits July 1, 2026 10:42
ScoreBreakdownLever gains an optional tiedLeverageComponents field;
pickHighestLeverage now collects every component that ties for the
top leverageScore instead of silently returning only one.

Covers three paths: no tie (singleton result), blocked tie (multiple
blocked levers at same score), and reduced tie (multiple reduced levers
at same score).
- Creates scenario where openPrMultiplier and openIssueMultiplier both block at leverageScore 100
- Asserts alphabetical winner (openIssueMultiplier) and tied component (openPrMultiplier)
- Asserts reason includes tie disclosure
- Adds no-tie test asserting empty array and no tie clause in reason
@RenzoMXD RenzoMXD force-pushed the feat/scoring-issue-discovery-history-breakdown-v2 branch from c392c16 to 4d9b9d2 Compare July 1, 2026 20:44
@dosubot dosubot Bot added the lgtm Approved by a maintainer. label Jul 2, 2026
@JSONbored JSONbored merged commit f9662a7 into JSONbored:main Jul 2, 2026
9 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jul 2, 2026
@RenzoMXD RenzoMXD deleted the feat/scoring-issue-discovery-history-breakdown-v2 branch July 2, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 1.25x multiplier. gittensor Gittensor contributor context lgtm Approved by a maintainer. size:S This PR changes 10-29 lines, ignoring generated files.

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

feat(review): review.suggestions config toggle (default off) gating suggested-change blocks

3 participants