feat(mcp): add gittensory_check_improvement_potential pre-submit tool - #4963
Conversation
Adds a supply-side pre-submit MCP tool that mirrors gittensory_check_slop_risk but for the positive improvement axis: it calls buildStructuralImprovementAssessment (src/signals/improvement.ts, already shipped) directly from the MCP layer rather than re-deriving the scoring math, following the same metadata-only, no-source-upload contract as its sibling. complexityDeltas/duplicationDeltas are optional already-derived structured deltas the calling agent supplies; the tool never reads file content or diffs itself, and degrades cleanly to insufficient-signal when every input is omitted. Unlike checkSlopRisk, the raw score is not blunted here: improvementScore carries no gate/blocker power, so there is nothing to protect from reverse-engineering, and the whole point of the signal is to let a contributor see how close a planned change is to the next band. The LLM-tier judgment (ModelReview.valueAssessment) is intentionally out of scope for this tool -- it depends on a live AI-review call against an already-opened PR, which does not exist at pre-submit time. Also updates reference.md section 5's tool list (new entry plus a stale doc fix: the existing check_slop_risk entry still described a raw slopRisk field the handler stopped returning under the #mcp-slop-blunt change). Part of #4737.
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4963 +/- ##
=======================================
Coverage 94.26% 94.26%
=======================================
Files 447 447
Lines 38884 38891 +7
Branches 14167 14167
=======================================
+ Hits 36653 36660 +7
Misses 1574 1574
Partials 657 657
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-11 04:16:13 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 6 non-blocking
Review context
Contributor next steps
Signal definitions
🟩 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.
|
Summary
gittensory_check_improvement_potential, mirroring the existinggittensory_check_slop_risktool but for the positive structural-improvement axis (sub-issue I ofepic Epic: PR improvement signal — quality-delta scoring as the positive-axis counterpart to slop-risk #4737). It calls
buildStructuralImprovementAssessment(src/signals/improvement.ts, alreadyshipped by Aggregate deterministic structural-improvement sub-score #4742/feat(signals): add deterministic structural-improvement assessment #4822) directly from the MCP layer — no re-derived copy of the scoring math.
checkSlopRiskShape:changedFiles/tests/testFilesare reused verbatim, plus optionalpatchCoverageDeltaPercent,complexityDeltas(mirrors
ComplexityDeltaLike), andduplicationDeltas(mirrorsDuplicationDeltaLike) — allalready-derived structured deltas the calling agent supplies from its own local working tree. The
tool never reads file content or diffs itself.
improvementScore+band(insufficient-signal/none/minor/moderate/significant) +findings. UnlikecheckSlopRisk(which blunts/omits its raw score to prevent reverse-engineering a gate evasion),the raw
improvementScoreis returned here —improvementScorecarries no gate/blocker power(advisory-only per
improvement.ts's own header comment), so there is nothing to protect, and thewhole point of a supply-side value signal is to let a contributor see how close a planned change is
to the next band.
checkSlopRisk: this is a pure function over caller-supplied structureddata with no owner/repo/login to scope. Documented inline in the code comment above the new shape.
.claude/skills/contributing-to-gittensory/reference.md§5's numbered tool list: new entryplaced immediately after
check_slop_risk(its closest sibling), items renumbered. Also fixes astale doc line found while editing this exact list: the existing
check_slop_riskentry stilldescribed a
slopRisk 0-100return value that the handler stopped returning under the#mcp-slop-bluntchange — corrected to match the real, current output shape.Explicit non-goal: the LLM-tier judgment (
ModelReview.valueAssessment, #4743) is intentionallynot attempted in this PR. It's designed to piggyback on the live AI-review call against an
already-opened PR, which does not exist at pre-submit time — see
improvement.ts's own headercomment and the parent issue's "technical wrinkle" section. Scoping this tool to the deterministic
tier only is a deliberate choice, not an oversight.
Closes #4746
Scope
type(scope): short summaryConventional Commit format.changes (3 files: the MCP server, its reference doc, and one new test file).
CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Closes #4746).Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally — 703 test files / 13925 tests passed (2 skipped), 100% ofevery line and branch added in this diff (verified directly against
coverage/lcov.info'sDA/BRDArecords for the new shape/registration/handler line ranges — zero 0-hit entries).npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderate— 0 vulnerabilitiescomplexityDeltas/duplicationDeltas-omitted degraded path (
insufficient-signal), achangedFiles-only path (
minor), a combined-structural-signals path (significant), and apatch-coverage + duplication combination (
moderate) — plus an explicit assertion thatimprovementScoreis present (documenting the deliberate divergence fromcheckSlopRisk'sblunted output).
npm run test:cirun completed end-to-end (all ~40 chained steps, ending inui:build)with no failures anywhere.
If any required check was skipped, explain why:
npm run test:cirun's embeddedtest:coveragestep showed atransient anomaly (702 test files instead of the expected 703, missing exactly this PR's new test
file, with no error/crash logged and the file untouched on disk). Two independent standalone
npm run test:coveragere-runs (before and after rebasing onto latestmain) both cleanly showed703/705 files passing, including the new file at 100% line/branch coverage. Flagging this
transparently in case it recurs in CI; I could not identify a root cause tied to this PR's code
(which has no forking/pooling/environment interaction — it's a schema declaration, a tool
registration, and a straight-line handler with zero branches of its own).
Safety
private rankings, or private maintainer evidence are exposed (new tests assert the JSON output
never matches a forbidden-terms pattern; all MCP tool output already passes through the shared
redactSensitiveForMcpredaction intoolResult).optimization tactics.
N/A, no auth/session changes in this PR.
UI Evidencesection — N/A, no UI/frontend surface touched bythis PR (backend MCP tool + a reference doc's text list).
reference.md§5);CHANGELOG.mdintentionally not touched.Notes
apps/**filestouched).
src/mcp/server.ts'sgittensory_check_slop_riskregistration/handler as the exacttemplate per the parent issue's guidance, including its comment style, rate-limiting call
(
enforceToolRateLimit), andtoolResultwrapping.