Skip to content

feat(miner): expose the claim ledger as a read-only MCP tool#5326

Merged
gittensory-orb[bot] merged 1 commit into
JSONbored:mainfrom
jaytbarimbao-collab:feat-miner-mcp-list-claims
Jul 12, 2026
Merged

feat(miner): expose the claim ledger as a read-only MCP tool#5326
gittensory-orb[bot] merged 1 commit into
JSONbored:mainfrom
jaytbarimbao-collab:feat-miner-mcp-list-claims

Conversation

@jaytbarimbao-collab

Copy link
Copy Markdown
Contributor

Adds gittensory_miner_list_claims to the gittensory-miner MCP server (scaffold #5153, extended by #5155 in #5298) — remote/agent-facing, read-only visibility into which issues this miner currently holds, without shelling into the machine.

What this adds

  • A new tool that reads the local claim ledger via the existing listClaims() query (packages/gittensory-miner/lib/claim-ledger.js) — no new query/filter logic added to claim-ledger.js. Returns each entry verbatim: repo, issue number, status, claimed-at, note.
  • Optional filters repoFullName / status pass straight through to listClaims; omitted → the full unfiltered list.
  • Strictly read-only: the tool reaches only listClaims; no claim/release/expire mutation and no conflict-resolution logic (that stays Wire claim-conflict resolution end-to-end #4848's maintainer-only domain). Opens the ledger only when invoked and closes any store it opened; the opener is injectable (MinerMcpServerOptions.openClaimLedger) so tests need no on-disk state.
  • zod (matching the mcp package) is added for the optional-filter input schema.

Validation (local)

  • tsc --noEmit: 0 errors.
  • vitest on the three affected files (miner-mcp-scaffold, miner-package-skeleton, check-miner-package): 24/24 pass — new claim cases cover the full list, filter-by-repo, filter-by-status, the empty ledger, and an invariant asserting the tool never reaches a mutating ledger method (recordClaim/claimIssue/releaseClaim/expireClaim).
  • node scripts/check-miner-package.mjs, docs:drift-check, git diff --check: all clean.

Note: packages/gittensory-miner/** sits outside vitest's coverage.include, so codecov/patch cannot measure it yet (closed separately by #4864/#4865); the tests above enforce full behavioral coverage regardless.

Closes #5156

Add gittensory_miner_list_claims to the gittensory-miner MCP server (scaffold JSONbored#5153): a
read-only listing of the local claim ledger (repo, issue number, status, claimed-at, note)
via the existing listClaims query, with optional repoFullName/status filters passed through.
Exposes no claim/release mutation and no conflict-resolution logic. Opens the ledger only when
invoked and closes any it opened; the opener is injectable for tests.

Adds zod (matching the mcp package) for the tool's optional-filter input schema.

Closes JSONbored#5156
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.40%. Comparing base (62d7f22) to head (52be295).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5326   +/-   ##
=======================================
  Coverage   94.40%   94.40%           
=======================================
  Files         550      550           
  Lines       44106    44116   +10     
  Branches    14631    14631           
=======================================
+ Hits        41639    41649   +10     
  Misses       1792     1792           
  Partials      675      675           
Flag Coverage Δ
shard-1 44.01% <ø> (-0.01%) ⬇️
shard-2 34.64% <ø> (-0.01%) ⬇️
shard-3 31.54% <ø> (-0.01%) ⬇️
shard-4 31.42% <ø> (-0.01%) ⬇️
shard-5 33.15% <ø> (+0.01%) ⬆️
shard-6 43.35% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gittensory-orb gittensory-orb Bot added the gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. label Jul 12, 2026
@gittensory-orb

gittensory-orb Bot commented Jul 12, 2026

Copy link
Copy Markdown

Tip

🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩

✅ Gittensory review result - approve/merge recommended

Review updated: 2026-07-12 14:14:20 UTC

6 files · 2 AI reviewers · no blockers · readiness 100/100 · CI green · clean

✅ Suggested Action - Approve/Merge

  • safe to merge

Review summary
Adds a straightforward, read-only gittensory_miner_list_claims MCP tool that wraps the existing listClaims() query with optional repoFullName/status filters, mirroring the pattern already established by the ping and portfolio-dashboard tools. The store-open/close injection seam and the invariant test asserting no mutating ledger method is ever reached are solid, and the tool correctly builds a sparse filter object so undefined args pass through as omitted rather than null. This closes #5156 and is well-scoped to the linked issue with no unrelated changes bundled in.

Nits — 5 non-blocking
  • packages/gittensory-miner/bin/gittensory-miner-mcp.js:88 — zod is a fairly heavy dependency (281 KB / 62 KB gzip) for validating two optional string-like fields; worth confirming it matches the mcp package's existing convention (per the PR description it does) rather than hand-rolling validation.
  • test/unit/miner-mcp-scaffold.test.ts — CLAIM_ROWS/fakeLedger don't cover a combined repoFullName+status filter (only each filter individually), though the underlying filter-building logic is trivial enough that this is low risk.
  • Consider a small integration test against the real openClaimLedger/listClaims (even with a temp on-disk DB) to catch schema drift between claim-ledger.js's actual filter shape and the fake used in tests, since the fake reimplements the filter logic rather than exercising the real query.
  • nit: `packages/gittensory-miner/bin/gittensory-miner-mcp.d.ts` still documents `createMinerMcpServer()` as registering only ping and portfolio-dashboard, so the declaration comment is stale after adding `gittensory_miner_list_claims`.
  • nit: `test/unit/miner-mcp-scaffold.test.ts` asserts the injected ledger is not closed, but there is no companion assertion around the real-owner close behavior for the new tool; this mirrors the existing dashboard seam, but the new store-backed path would benefit from explicit close coverage.
Signal Result Evidence
Code review ✅ No blockers 2 reviewers, synthesized
Linked issue ✅ Linked #5156
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 20 registered-repo PR(s), 9 merged, 1 issue(s).
Contributor context ✅ Confirmed Gittensor contributor jaytbarimbao-collab; Gittensor profile; 20 PR(s), 1 issue(s).
Gate result ✅ Passing No configured blocker found.
Improvement ✅ Minor risk: clean · value: minor — Code changes are accompanied by test evidence. LLM value judgment: moderate — The PR adds a small, well-tested, correctly-scoped read-only capability that closes a specifically linked issue and follows the exact pattern of prior tools in the same server, meaningfully extending remote/agent visibility without adding mutation risk.
Linked issue satisfaction

Addressed
The PR adds a read-only gittensory_miner_list_claims MCP tool that reads via listClaims() with optional repoFullName/status pass-through filters, adds no new filtering logic to claim-ledger.js, and never reaches claim/release/expire mutation methods, matching all stated requirements. It also ships unit tests for full/filtered/empty cases plus an explicit invariant test proving no mutator is called

Review context
  • Author: jaytbarimbao-collab
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 20 PR(s), 1 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.
[BETA] Chat with Gittensory

Ask 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.

  • @gittensory ask &lt;question&gt; answers contribution-quality Q&A with source citations and freshness.
  • @gittensory chat &lt;question&gt; answers in natural prose from cached decision-pack facts via local inference (maintainer/collaborator; read-only).
  • A plain-language @gittensory mention with a real question is routed to the closest matching read-only command automatically -- no exact syntax required.

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.

  • Re-run Gittensory review

@gittensory-orb gittensory-orb Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gittensory approves — the gate is satisfied and CI is green.

@gittensory-orb gittensory-orb Bot merged commit 97707b8 into JSONbored:main Jul 12, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose AMS claim-ledger listing as a read-only MCP tool (gittensory_miner_list_claims)

1 participant