Skip to content

feat(scoring): explain the open-issue spam gate in the score breakdown#1453

Open
jaso0n0818 wants to merge 1 commit into
JSONbored:mainfrom
jaso0n0818:feat/slot2-1782465597
Open

feat(scoring): explain the open-issue spam gate in the score breakdown#1453
jaso0n0818 wants to merge 1 commit into
JSONbored:mainfrom
jaso0n0818:feat/slot2-1782465597

Conversation

@jaso0n0818

Copy link
Copy Markdown
Contributor

What

explainScoreBreakdown produces an improvement lever for every score multiplier — density, contribution bonus, label, issue, credibility, review penalty, open-PR — except the open-issue spam gate (#808). That gate is the issue-discovery-lane sibling of the open-PR gate (which already has openPrBreakdown), so the breakdown is asymmetric: a miner whose score is zeroed by too many concurrent open issues gets no row explaining why or how to recover.

How

Adds openIssueBreakdown, a direct mirror of openPrBreakdown. It reads values the preview already computesscoreEstimate.openIssueMultiplier and the gates.openIssueCount/openIssueThreshold fields — and emits a full/blocked band with a concrete lever (close or resolve excess open issues). No new inputs, no score-math change, no schema change: purely an explanation for a dimension that already exists in the preview.

Tests / coverage

  • Within-allowance path asserts a full band (existing fixture, no open issues).
  • New over-threshold case (50 open issues) asserts a blocked band, the 'exceeds the current allowance' summary, and the close/resolve lever.
  • Full branch coverage on every added line; output stays public-safe (sanitized, no forbidden terms). OpenAPI unchanged.

@jaso0n0818 jaso0n0818 requested a review from JSONbored as a code owner June 26, 2026 10:02
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jun 26, 2026
@superagent-security

Copy link
Copy Markdown

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

@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.45%. Comparing base (2446a04) to head (5aeaf93).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1453   +/-   ##
=======================================
  Coverage   95.45%   95.45%           
=======================================
  Files         202      202           
  Lines       21766    21773    +7     
  Branches     7864     7867    +3     
=======================================
+ Hits        20776    20783    +7     
  Misses        414      414           
  Partials      576      576           
Files with missing lines Coverage Δ
src/services/score-breakdown.ts 98.70% <100.00%> (+0.12%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored JSONbored added the gittensor:bug Gittensor-scored bug fix - worth 0.5x multiplier. label Jun 26, 2026
@gittensory-orb

gittensory-orb Bot commented Jun 27, 2026

Copy link
Copy Markdown

Warning

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

⏸️ Gittensory review — held for maintainer review

2 files · 1 AI reviewers · no blockers · readiness 48/100 · CI green · clean

⏸️ Held for maintainer review — Touches a guarded path — held for manual review

Review summary
Adds `openIssueBreakdown` as a direct structural mirror of `openPrBreakdown`, filling the only missing slot in `explainScoreBreakdown`'s multiplier coverage. The implementation is correct: it reads the already-computed `openIssueMultiplier`, `openIssueCount`, and `openIssueThreshold` from the preview, delegates to the shared `bandForMultiplier`, and emits a properly shaped `ScoreMultiplierBreakdown`. Two test paths cover the new branch (within-allowance → `full`, over-threshold → `blocked`), the FORBIDDEN regex guard is applied, and the component is correctly appended to the pipeline before `sanitizePublicComment` runs.

Signal Result Evidence
Code review ✅ No blockers 1 reviewers, synthesized
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
Related work ⚠️ 3 scoped overlaps Top overlaps are listed below; lower-confidence bulk is hidden.
Review load ❌ 8/20 Readiness component derived from cached public PR metadata and labels; size label size:S.
Validation evidence ❌ 5/25 Cached preflight status is hold.
Open PR queue ❌ 3/10 26 open PR(s), 9 likely reviewable, 17 unlinked.
Contributor context ✅ Confirmed Gittensor contributor jaso0n0818; Gittensor profile; 1363 PR(s), 7 issue(s).
Gate result ⚠️ Not blocking Advisory; not blocking this PR.
Nits — 6 non-blocking
  • The multi-line block comment above `openIssueBreakdown` (`src/services/score-breakdown.ts`) is inconsistent with every other private breakdown function in the file — all of which have no comment at all; reduce to a single-line or remove.
  • The `summary`/`lever` branches use a binary `openIssueMultiplier >= 1` test, so any multiplier strictly between 0 and 1 emits "exceeds the current allowance… blocks scoring" while `band` would be `"reduced"` — a subtle text/band mismatch that already exists in `openPrBreakdown`; worth a brief code comment confirming the gate is always 0-or-≥1 so the binary split is exhaustive.
  • The `highestLeverageLever.lever` regex in the first existing test (`/merge|close|credibility|open PR|linked issue|density|review/i`) does not include an open-issue term; the within-allowance lever ("Keep concurrent open issues…") would not match if it ever became the top-ranked lever — low risk given `leverageScore: 5`, but the pattern is now the odd one out.
  • Remove or collapse the multi-line comment on `openIssueBreakdown` to a single line (e.g., `// Sibling of openPrBreakdown — explains the open-issue spam gate (feat(scoring): model (or explicitly scope out) the issue-discovery / issue-spam dimension #808).`) to match the style of all other breakdown helpers in the file.
  • Add a short inline comment next to the `openIssueMultiplier >= 1` branches noting that the gate is binary (0 or ≥1), so a `"reduced"` band never occurs here — this prevents a future reader from introducing a three-way branch unnecessarily, and documents why the existing pattern in `openPrBreakdown` is safe to mirror.
  • Touches a guarded path — held for manual review — A maintainer must review and merge this change.
Review context
Contributor next steps
  • Explain no-issue PR.
  • Review top overlaps.
  • Add scope summary.
  • Fix blocker.
  • Expect slower review.
  • Refresh registry data or choose a registered active repo.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
  • Check active issues and PRs before submitting.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Review load = cached public PR metadata such as size labels, changed paths, and preflight status.
  • Open PR queue = repo-wide review pressure; it is not a PR quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
Review details

Generated from public PR metadata and the diff. Advisory only; deterministic signals remain authoritative.

Adds `openIssueBreakdown` as a direct structural mirror of `openPrBreakdown`, filling the only missing slot in `explainScoreBreakdown`'s multiplier coverage. The implementation is correct: it reads the already-computed `openIssueMultiplier`, `openIssueCount`, and `openIssueThreshold` from the preview, delegates to the shared `bandForMultiplier`, and emits a properly shaped `ScoreMultiplierBreakdown`. Two test paths cover the new branch (within-allowance → `full`, over-threshold → `blocked`), the FORBIDDEN regex guard is applied, and the component is correctly appended to the pipeline before `sanitizePublicComment` runs.

Nits (5)

  • The multi-line block comment above `openIssueBreakdown` (`src/services/score-breakdown.ts`) is inconsistent with every other private breakdown function in the file — all of which have no comment at all; reduce to a single-line or remove.
  • The `summary`/`lever` branches use a binary `openIssueMultiplier >= 1` test, so any multiplier strictly between 0 and 1 emits "exceeds the current allowance… blocks scoring" while `band` would be `"reduced"` — a subtle text/band mismatch that already exists in `openPrBreakdown`; worth a brief code comment confirming the gate is always 0-or-≥1 so the binary split is exhaustive.
  • The `highestLeverageLever.lever` regex in the first existing test (`/merge|close|credibility|open PR|linked issue|density|review/i`) does not include an open-issue term; the within-allowance lever ("Keep concurrent open issues…") would not match if it ever became the top-ranked lever — low risk given `leverageScore: 5`, but the pattern is now the odd one out.
  • Remove or collapse the multi-line comment on `openIssueBreakdown` to a single line (e.g., `// Sibling of openPrBreakdown — explains the open-issue spam gate (feat(scoring): model (or explicitly scope out) the issue-discovery / issue-spam dimension #808).`) to match the style of all other breakdown helpers in the file.
  • Add a short inline comment next to the `openIssueMultiplier >= 1` branches noting that the gate is binary (0 or ≥1), so a `"reduced"` band never occurs here — this prevents a future reader from introducing a three-way branch unnecessarily, and documents why the existing pattern in `openPrBreakdown` is safe to mirror.

🟩 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 - worth 1.25x multiplier. and removed gittensor:bug Gittensor-scored bug fix - worth 0.5x multiplier. labels Jun 27, 2026
`explainScoreBreakdown` surfaces a lever for every score multiplier except the
open-issue spam gate (JSONbored#808) — the issue-discovery sibling of the open-PR gate,
which already has `openPrBreakdown`. A miner in the issue-discovery lane whose
score is zeroed by too many concurrent open issues gets no breakdown row
explaining why, or how to recover.

Add `openIssueBreakdown`, mirroring `openPrBreakdown`: it reads the existing
`openIssueMultiplier` and the `openIssueCount`/`openIssueThreshold` gate fields
already on the preview, and emits a full/blocked band with a concrete lever
(close or resolve excess open issues). No new inputs or score math — purely an
explanation for a dimension the preview already computes.
@jaso0n0818 jaso0n0818 force-pushed the feat/slot2-1782465597 branch from 62732c5 to 5aeaf93 Compare June 27, 2026 02:37
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 - worth 1.25x multiplier. gittensor Gittensor contributor context size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants