feat(miner): expose governor decisions via a read-only, payload-redacted MCP tool - #5411
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✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5411 +/- ##
=======================================
Coverage 94.45% 94.45%
=======================================
Files 552 552
Lines 44310 44317 +7
Branches 14659 14659
=======================================
+ Hits 41851 41858 +7
Misses 1784 1784
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 - reject/close recommendedReview updated: 2026-07-12 17:11:26 UTC
🛑 Suggested Action - Reject/Close
Review summary Nits — 5 non-blocking
Why this is blocked
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 (Linked issue overlaps another open PR; duplicate of another open PR). 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 allow/deny/throttle/kill-switch decisions, with the sensitivepayload_jsoncolumn excluded by construction.Resubmit of #5379, which auto-closed on
codecov/patchonly (the gate passed with no blockers, readiness 100, and both AI reviewers approved the code + the redaction test). #4864 recently broughtpackages/gittensory-miner/lib/**/*.jsunder the 99% patch gate; the one uncovered line was an unused standalonereadGovernorDecisions()export I'd added for parity. Removed it — the bin tool uses the injected instance method, which the tests fully exercise. Verified: my diff lines carry no uncovered statements.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 (engine dist rebuilt).vitestacross the five affected files: 41/41 pass.reputation/self_plagiarism/budgetpayload and asserts the response is exactly the seven projected columns with none of those keys/values — it fails if the SELECT ever widens.governor-ledger.jslines (rowToDecision, the projection statements, the instance reader) are uncovered.check-miner-package,docs:drift-check,git diff --check: all clean. Rebased onto latest main; overlap-free.Closes #5159