Skip to content

fix(mcp): include open issue counts in score breakdown - #971

Merged
JSONbored merged 4 commits into
mainfrom
codex/fix-mcp-score-breakdown-for-open-issue-counts
Jun 21, 2026
Merged

fix(mcp): include open issue counts in score breakdown#971
JSONbored merged 4 commits into
mainfrom
codex/fix-mcp-score-breakdown-for-open-issue-counts

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Motivation

  • The MCP explain/score-breakdown path was not passing trusted contributor open-issue counts into the scoring core, causing inconsistent breakdowns compared to the preview path and omitting the open-issue spam gate for affected contributors.

Description

  • Fetch listContributorIssues for input.contributorLogin in the MCP explainScoreBreakdown handler and compute the repo-specific openIssueCount via contributorOpenIssueCount before scoring. (modified src/mcp/server.ts)
  • Inject openIssueCount into the scoreInput passed to buildScorePreview so the scoring core receives the intended trusted open-issue value. (modified src/mcp/server.ts)
  • Add a regression test gittensory_explain_score_breakdown applies trusted open-issue counts that seeds contributor issues and asserts the open-issue gate appears in the tool output. (modified test/unit/mcp-output-schemas.test.ts)

Testing

  • Ran the focused MCP schema test with npx vitest run test/unit/mcp-output-schemas.test.ts -t "trusted open-issue", and the new test passed.
  • Ran type checking with npm run typecheck (tsc --noEmit), which completed successfully.
  • Verified the changed handlers produce the expected gateHighlights and that buildScorePreview now receives openIssueCount during the explain/score-breakdown flow.

Codex Task

@dosubot dosubot Bot added the size:XS label Jun 21, 2026
@ghost ghost added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jun 21, 2026
@ghost

ghost commented Jun 21, 2026

Copy link
Copy Markdown

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

🛠️ Maintainer review — Held for maintainer review

Reviewed 2 changed file(s) — two independent AI reviewers, synthesized. ✅ Safe to merge — both reviewers found no blocking issues.

ℹ️ Correct and green, but touches a sensitive area (src/mcp/server.ts) — held for your review.

Merge readiness: ✅ Mergeable · all CI checks green/neutral/skipped.

Summary

The change adds open issue count to the scoring breakdown by fetching contributor issues and integrating the count into the score input. Types compile (CI passed) and the new unit test validates the gate behavior. No security concerns are introduced, and the public/private sanitizer boundary remains intact. The modification is logically sound and does not break existing tests or functionality.

💡 Nits — non-blocking, optional

  • Ensure that the imported functions listContributorIssues and contributorOpenIssueCount are documented for future maintainers.
  • Add a brief comment near the new openIssueCount handling to explain its purpose and any performance considerations.
  • Consider adding a test case where the contributor has no open issues to verify that the code handles empty results gracefully.
  • Consider adding a comment explaining the purpose of the new openIssueCount variable in src/mcp/server.ts.
  • Ensure that the listContributorIssues function is well-documented and handles edge cases, such as contributors with no open issues.

@ghost ghost added the reviewbot-review label Jun 21, 2026
@ghost

ghost commented Jun 21, 2026

Copy link
Copy Markdown

Note

Gittensory Gate skipped

PR closed before full evaluation. No late first comment was created.

Signal Result Evidence Action
Gate result ⚠️ Skipped #971 is no longer open. No action.

💰 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.

@ghost ghost added the gittensory:reviewed label Jun 21, 2026
@codecov

codecov Bot commented Jun 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.61%. Comparing base (669cd03) to head (e9b917e).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #971   +/-   ##
=======================================
  Coverage   96.60%   96.61%           
=======================================
  Files         110      110           
  Lines       15073    15074    +1     
  Branches     5447     5447           
=======================================
+ Hits        14562    14564    +2     
+ Misses        107      106    -1     
  Partials      404      404           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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

@JSONbored JSONbored self-assigned this Jun 21, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

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

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Held for maintainer (guardrail_area) — correct + CI green

@JSONbored
JSONbored merged commit e93c893 into main Jun 21, 2026
19 checks passed
@JSONbored
JSONbored deleted the codex/fix-mcp-score-breakdown-for-open-issue-counts branch June 21, 2026 10:26
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