feat(miner): expose per-repo run-state as a read-only MCP tool#5363
Conversation
Add gittensory_miner_get_run_state to the gittensory-miner MCP server (scaffold JSONbored#5153): pass repoFullName for one repo's state (idle/discovering/planning/preparing; null = none recorded yet) or omit it to list all repos, reading via run-state.js's existing getRunState/listRunStates. The read-only analog of ORB's gittensory_get_automation_state -- adds no state-set/mutation. Opens the store only when invoked and closes any it opened; the opener is injectable for tests. Closes JSONbored#5160
|
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 #5363 +/- ##
=======================================
Coverage 94.41% 94.41%
=======================================
Files 550 550
Lines 44143 44143
Branches 14632 14632
=======================================
Hits 41677 41677
Misses 1791 1791
Partials 675 675
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-12 15:08:19 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_run_stateto the gittensory-miner MCP server (scaffold #5153) — remote/agent-facing, read-only visibility into what an autonomously-running miner is currently doing on a given repo, without inspecting local state by hand.What this adds
packages/gittensory-miner/lib/run-state.js's existing accessors — no duplicated state logic:repoFullName→{ repoFullName, state }for that repo, wherestateisidle/discovering/planning/preparing, ornullwhen no state has been recorded yet (explicit, never throws — requirement 6);repoFullName→{ states: [...] }listing every repo (listRunStates).gittensory_get_automation_state(requirement 7).getRunState/listRunStates; adds nostate set/ mutation tool. The store opener is injectable (MinerMcpServerOptions.initRunStateStore) so tests need no on-disk state.Validation (local)
tsc --noEmit: 0 errors.viteston the three affected files (miner-mcp-scaffold,miner-package-skeleton,check-miner-package): 28/28 pass — new run-state cases cover single-repo known state, unknown/no-state-yet repo (null, no throw), list-all mode, and an invariant asserting the tool never triggers a state transition (onlygetRunStateis called; neversetRunState).node scripts/check-miner-package.mjs,docs:drift-check,git diff --check: all clean. Rebased onto latest main.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 #5160