Skip to content

feat(mcp): expose outcome calibration via gittensory_get_outcome_calibration - #1171

Closed
jason020818 wants to merge 1 commit into
JSONbored:mainfrom
jason020818:feat/mcp-outcome-calibration
Closed

feat(mcp): expose outcome calibration via gittensory_get_outcome_calibration#1171
jason020818 wants to merge 1 commit into
JSONbored:mainfrom
jason020818:feat/mcp-outcome-calibration

Conversation

@jason020818

Copy link
Copy Markdown
Contributor

Summary

  • Add gittensory_get_outcome_calibration MCP tool wrapping the existing outcome-calibration service
  • Optional windowDays filter; structured output schema + integration test coverage

Test plan

  • npx vitest run test/unit/mcp-output-schemas.test.ts test/unit/outcome-calibration.test.ts
  • MCP tools/list includes new tool

…bration

Wire the slop-band and recommendation outcome calibration service into MCP
so maintainers can inspect predictive accuracy without a separate HTTP call.
Includes structured output schema validation tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jason020818
jason020818 requested a review from JSONbored as a code owner June 24, 2026 05:09
@dosubot dosubot Bot added the size:M label Jun 24, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

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

@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.84%. Comparing base (f085f78) to head (0d0f26a).
⚠️ Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
src/mcp/server.ts 75.00% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1171      +/-   ##
==========================================
- Coverage   94.85%   94.84%   -0.02%     
==========================================
  Files         156      156              
  Lines       18909    18921      +12     
  Branches     6848     6851       +3     
==========================================
+ Hits        17937    17946       +9     
  Misses        387      387              
- Partials      585      588       +3     

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

@ghost

ghost commented Jun 24, 2026

Copy link
Copy Markdown

Caution

🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥

🛑 Gittensory review — closed

3 files · 2 AI reviewers · 1 blocker · readiness 93/100 · CI green · unknown

🛑 Closed — An AI reviewer flagged a likely blocking defect — Resolve the flagged defect and open a new pull request, or override if the reviewers are mistaken.

Review summary
The change adds a new MCP tool `gittensory_get_outcome_calibration` that wraps the outcome-calibration service, introduces input and output Zod schemas, registers the tool, and implements a private handler that fetches the calibration report and returns a summary. The implementation correctly validates repo access, forwards the optional windowDays filter, and formats the response. Unit and integration tests are added to verify schema compliance and tool registration.

Blockers

  • The codecov/patch check failed with 75.00% of diff hit (target 94.85%) — this will break the code coverage threshold.

Nits (5)

  • ownerRepoWindowShape repeats the owner/repo fields from ownerRepoShape; could be defined via .extend to avoid duplication (src/mcp/server.ts).
  • The ternary `input.windowDays !== undefined ? input.windowDays : undefined` is redundant; passing `input.windowDays` directly would be clearer (src/mcp/server.ts).
  • The maintainerMeasurementReportOutputSchema uses many `z.unknown()` fields; tightening types would improve validation robustness (src/mcp/server.ts).
  • The new method `getOutcomeCalibration` lacks a JSDoc comment describing its purpose and parameters (src/mcp/server.ts).
  • The tool description mentions "maintainer-authenticated" but the code only checks repo access; consider adding explicit maintainer auth checks if required.

Why this is blocked

  • An AI reviewer flagged a likely blocking defect — Resolve the flagged defect and open a new pull request, or override if the reviewers are mistaken.
Signal Result Evidence
Code review ❌ 1 blocker 2 reviewers, synthesized
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Review load ✅ 20/20 Readiness component derived from cached public PR metadata and labels; size label size:M.
Validation evidence ✅ 25/25 PR body includes validation/test evidence.
Open PR queue ✅ 10/10 0 open PR(s), 0 likely reviewable.
Contributor context ✅ Confirmed Gittensor contributor jaso0n0818; Gittensor profile; 1361 PR(s), 5 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
Nits — 1 non-blocking
  • No linked issue detected — If this PR is intended to solve an issue, link it explicitly in the PR body.
Review context
  • Author: jaso0n0818
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: Python, Rust, Shell, C++, Dart, Ruby, Scala, TypeScript
  • Official Gittensor activity: 1361 PR(s), 5 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Explain no-issue PR.
  • 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.
  • 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.

The change adds a new MCP tool `gittensory_get_outcome_calibration` that wraps the outcome-calibration service, introduces input and output Zod schemas, registers the tool, and implements a private handler that fetches the calibration report and returns a summary. The implementation correctly validates repo access, forwards the optional windowDays filter, and formats the response. Unit and integration tests are added to verify schema compliance and tool registration.

Blockers

  • The codecov/patch check failed with 75.00% of diff hit (target 94.85%) — this will break the code coverage threshold.

Nits (5)

  • ownerRepoWindowShape repeats the owner/repo fields from ownerRepoShape; could be defined via .extend to avoid duplication (src/mcp/server.ts).
  • The ternary `input.windowDays !== undefined ? input.windowDays : undefined` is redundant; passing `input.windowDays` directly would be clearer (src/mcp/server.ts).
  • The maintainerMeasurementReportOutputSchema uses many `z.unknown()` fields; tightening types would improve validation robustness (src/mcp/server.ts).
  • The new method `getOutcomeCalibration` lacks a JSDoc comment describing its purpose and parameters (src/mcp/server.ts).
  • The tool description mentions "maintainer-authenticated" but the code only checks repo access; consider adding explicit maintainer auth checks if required.

🟩 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

@ghost ghost added gittensory:reviewed gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. labels Jun 24, 2026

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

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

@ghost

ghost commented Jun 24, 2026

Copy link
Copy Markdown

Gittensory is closing this pull request on the maintainer's behalf (AI reviewers agree on a likely critical defect: src/mcp/server.ts: getOutcomeCalibration accesses `slop` properties without checking for undefined, which will throw a TypeError if the calibration report lacks a slop object.). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs are re-reviewed automatically, so an inaccurate close may be reopened, but that does not guarantee it can merge (e.g. if conflicts or failing CI remain).

@ghost

ghost commented Jun 24, 2026

Copy link
Copy Markdown

Gittensory is closing this pull request on the maintainer's behalf (An AI reviewer flagged a likely blocking defect). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs are re-reviewed automatically, so an inaccurate close may be reopened, but that does not guarantee it can merge (e.g. if conflicts or failing CI remain).

2 similar comments
@ghost

ghost commented Jun 24, 2026

Copy link
Copy Markdown

Gittensory is closing this pull request on the maintainer's behalf (An AI reviewer flagged a likely blocking defect). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs are re-reviewed automatically, so an inaccurate close may be reopened, but that does not guarantee it can merge (e.g. if conflicts or failing CI remain).

@ghost

ghost commented Jun 24, 2026

Copy link
Copy Markdown

Gittensory is closing this pull request on the maintainer's behalf (An AI reviewer flagged a likely blocking defect). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs are re-reviewed automatically, so an inaccurate close may be reopened, but that does not guarantee it can merge (e.g. if conflicts or failing CI remain).

@JSONbored JSONbored reopened this Jun 24, 2026
@JSONbored JSONbored closed this Jun 24, 2026
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 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants