feat(miner): expose governor decisions via a read-only, payload-redacted MCP tool - #5413
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. |
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-12 17:25:51 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
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.
|
Adds
gittensory_miner_get_governor_decisionsto the gittensory-miner MCP server (scaffold #5153) — remote/agent-facing, read-only visibility into the governor's allow/deny/throttle/kill-switch decisions, withpayload_jsonexcluded by construction.Resubmit of #5379 → #5411. #5379 closed on
codecov/patch(an unused standalone export I'd added for parity — removed; the tool uses the injected instance method, which the tests fully cover). #5411 then passed CI/coverage but closed on a transient overlap-blocker while another PR was concurrently touching the shared scaffold files; that PR has since cleared and the scaffold bin is free again.What this adds
readGovernorDecisions()(instance method) ingovernor-ledger.jswith an explicit named-column SELECT —id, ts, event_type, repo_full_name, action_class, decision, reason— neverSELECT *, sopayload_json(reputation / self-plagiarism / budget state that Persist governor cross-attempt state (rate-limit, budget, convergence, reputation, self-plagiarism) #5134 is expanding) is excluded by construction (requirement 2). The write path and existingreadGovernorEventsare untouched (requirement 5).repoFullNamefilter (the only native ledger filter — requirement 4) and a description documenting the exclusion (requirement 6).Validation (local)
tsc --noEmit: 0 errors.vitestacross the affected files: green — including the dedicated redaction test (requirement 3) that drives a real temp governor ledger seeded with areputation/self_plagiarism/budgetpayload and asserts the response is exactly the seven projected columns with none of those keys/values (fails if the SELECT ever widens).governor-ledger.jslines are uncovered (codecov reportedgovernor-ledger.jspatch<100.00%>on the prior submission).check-miner-package,docs:drift-check,git diff --check: clean. Rebased onto latest main; overlap-free at open time.Closes #5159