feat(miner): expose governor decisions via a read-only, payload-redacted MCP tool - #5379
Conversation
…ted MCP tool Add gittensory_miner_get_governor_decisions to the gittensory-miner MCP server (scaffold JSONbored#5153): a read-only projection of the governor decision log (id, ts, eventType, repoFullName, actionClass, decision, reason), optionally filtered by repoFullName. Excludes the sensitive payload_json column (reputation/self-plagiarism/budget state that JSONbored#5134 is expanding) BY CONSTRUCTION: a new readGovernorDecisions() reader in governor-ledger.js uses an explicit named-column SELECT, never SELECT *. The write path and existing readGovernorEvents are untouched. A dedicated test drives a real temp ledger seeded with a payload and asserts the projection never leaks payload/reputation/self_plagiarism/budget -- so it fails if a future edit widens the SELECT. Closes JSONbored#5159
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5379 +/- ##
==========================================
- Coverage 94.41% 94.41% -0.01%
==========================================
Files 551 551
Lines 44170 44178 +8
Branches 14633 14633
==========================================
+ Hits 41704 41711 +7
- Misses 1791 1792 +1
Partials 675 675
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
Caution 🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥 🛑 Gittensory review result - fixes requiredReview updated: 2026-07-12 15:44:07 UTC
🛑 Suggested Action - Fix Blockers Review summary Nits — 5 non-blocking
CI checks failing
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
[BETA] Chat with GittensoryAsk Gittensory a question about this PR directly in a comment — grounded only in the same cached, public-safe facts shown above, never a new claim.
Full command reference: https://gittensory.aethereal.dev/docs/gittensory-commands 🟩 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.
|
|
Gittensory is closing this pull request on the maintainer's behalf (CI is failing (codecov/patch)). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed. |
Adds
gittensory_miner_get_governor_decisionsto the gittensory-miner MCP server (scaffold #5153) — remote/agent-facing, read-only visibility into the governor's recent allow/deny/throttle/kill-switch decisions and reasons, with no risk of the sensitivepayload_jsoncolumn leaking.What this adds
readGovernorDecisions()ingovernor-ledger.jsthat selects an explicit named column list —id, ts, event_type, repo_full_name, action_class, decision, reason— and neverSELECT *, sopayload_json(which Persist governor cross-attempt state (rate-limit, budget, convergence, reputation, self-plagiarism) #5134 is expanding with reputation / self-plagiarism / budget state) is excluded by construction, not filtered after the fact (requirement 2). The write path and the existingreadGovernorEventsare untouched (requirement 5).repoFullNamefilter — the only filter the ledger supports natively (requirement 4) — and a description that documents the exclusion explicitly (requirement 6).Validation (local)
tsc --noEmit: 0 errors.viteston the five affected files (miner-mcp-scaffold, the newminer-mcp-governor-decisions, the existingminer-governor-ledger-cli,miner-package-skeleton,check-miner-package): 41/41 pass.reputation/self_plagiarism/budget, then asserts the tool's response is exactly the seven projected columns and contains none of those keys/values — so it fails if a future edit widens the SELECT.check-miner-package,docs:drift-check,git diff --check: all clean. Rebased onto latest main; overlap-free.Note:
packages/gittensory-miner/**sits outside vitest'scoverage.include, socodecov/patchcannot measure it yet (closed separately by #4864/#4865); the tests above enforce full behavioral coverage regardless.Closes #5159