feat(mcp): add gittensory_explain_gate_disposition tool (#2234) - #4220
Conversation
gittensory_predict_gate returns a pass/fail verdict; this adds a read-only companion
tool that surfaces the STRUCTURED per-rule dispositions behind it — which specific gate
rules block vs advise, and why — from the repo's PUBLIC .gittensory.yml only. No
merge/close decision.
- server.ts: extract computePredictedGateVerdict (shared by both tools, so they can't
diverge — no behavior change to predict_gate); pure buildGateDispositions(verdict)
maps blockers→block, warnings→advisory (blockers first); new
gittensory_explain_gate_disposition tool reusing predictGateShape + a zod
outputSchema for the itemized {rule, status, reason} list.
- Tests: pure buildGateDispositions (pass-all/one-blocker/multi-blocker), plus
tool-level blocking + passing cases via the predict-gate harness; asserts public-safe.
Verified: typecheck clean; full suite green (12149 passed, 0 failed).
|
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 #4220 +/- ##
=======================================
Coverage 93.75% 93.76%
=======================================
Files 389 389
Lines 36499 36511 +12
Branches 13376 13376
=======================================
+ Hits 34221 34233 +12
Misses 1621 1621
Partials 657 657
🚀 New features to boost your workflow:
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-08 19:01:01 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
Linked issue satisfactionAddressed 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.
|
…ass (#4537) reReviewStoredPullRequest / the direct pull_request webhook handler both thread ONE shared LiveGithubFacts object through readiness, maybePublishPrPublicSurface, and runAgentMaintenancePlanAndExecute -- but the latter two independently force-refetched the same PR's mergeable_state and CI aggregate live from GitHub, back to back, with no mutation between the two reads. Adds reuseOrRefreshLiveMergeState/reuseOrRefreshLiveCiAggregate, which reuse a value already populated by a FORCED write earlier in the same pass instead of re-fetching. Deliberately not the existing cachedLiveMergeState/ cachedLiveCiAggregate variants: those fall through to the durable cross-webhook cache on a request-local miss, which can replay an older webhook's snapshot -- exactly what the disposition input's #4220 invariant prohibits. Tracks which keys were populated by a forced (genuinely-live- this-pass) write via new forcedMergeStateKeys/forcedCiAggregateKeys sets on LiveGithubFacts, so a value written by the READINESS path's own cache-preferring reader is never mistaken for a fresh one. Closes #4498.
Closes #2234.
gittensory_predict_gatereturns a pass/fail verdict, but there's no tool for the structured per-rule reasons behind it. This adds a read-only companion —gittensory_explain_gate_disposition— that returns the itemized rule dispositions (which specific gate rules block vs advise, and why) from the repo's public.gittensory.ymlonly. No merge/close decision (that stays maintainer-only).What's here
server.tscomputePredictedGateVerdict— shared by both tools so they run the identical deterministic prediction and can't diverge (no behavior change topredict_gate).buildGateDispositions(verdict)— mapsblockers → block,warnings → advisory(blockers first); a read-only reshaping of what the predictor already computed, no new gate logic.gittensory_explain_gate_dispositiontool reusingpredictGateShape+ a zodoutputSchemafor the{rule, status, reason}list.buildGateDispositions(pass-all / one-blocker / multi-blocker), plus tool-level blocking and passing cases driven through the existing predict-gate harness; asserts the output stays public-safe.Validation
Typecheck clean. Full suite (
npm run test):Includes the existing
gittensory_predict_gatetest (confirms the shared-compute refactor is behavior-preserving).