feat(miner-plan): wire the feasibility gate into a new MCP tool + miner CLI command - #4432
Conversation
|
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 #4432 +/- ##
=======================================
Coverage 93.97% 93.97%
=======================================
Files 411 411
Lines 37202 37202
Branches 13587 13587
=======================================
Hits 34962 34962
Misses 1585 1585
Partials 655 655 🚀 New features to boost your workflow:
|
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review result - approve/merge recommendedReview updated: 2026-07-09 18:21:24 UTC
✅ Suggested Action - Approve/Merge
Review summary Nits — 5 non-blocking
Linked issue satisfactionAddressed Review context
Contributor next steps
Signal definitions
🟩 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.
|
bc41f68 to
f8aad56
Compare
Summary
buildFeasibilityVerdictcomposer (packages/gittensory-engine/src/feasibility.ts) into both halves the issue asks for: a new local MCP tool and a new miner CLI command. Neither half adds new business logic — both are thin parse/validate -> call the pure composer -> render wrappers, mirroring this repo's existing conventions exactly.packages/gittensory-mcp/bin/gittensory-mcp.js): registersgittensory_feasibility_gate, following the issue's own explicit reasoning for choosing this package oversrc/mcp/server.ts— it already depends on@jsonbored/gittensory-engineand already imports local helper modules in the same file, so no new cross-package dependency is introduced. Unlike every other tool in this file (all of which round-trip to the hosted API viaapiGet/apiPost), this is a genuinely local, synchronous, no-network computation — exactly what the composer's own header comment describes.packages/gittensory-miner/lib/feasibility-cli.js):gittensory-miner feasibility <claimStatus> <duplicateClusterRisk> <issueStatus> [--not-found] [--json], following the same parse -> execute -> render(json|table) -> exit-code convention asrunQueueCli/runClaimCli. Dispatched inbin/gittensory-miner.jsalongside the other purely-local commands (queue/claim/ledger/plan/governor), before the npm-registry update check starts, since it makes no network calls either.printHelpinlib/cli.jsdocuments the new command's usage line.Scope
type(scope): short summaryConventional Commit format.CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlint— not run; no workflow files touched.npm run typecheck(clean on this diff; the repo's one pre-existing failure — a missingaws4fetchtype declaration insrc/selfhost/s3-blob-store.ts— reproduces identically on a cleanmaincheckout and is unrelated).npm run test:coveragelocally —packages/gittensory-miner/**andpackages/gittensory-mcp/**are plain JS and are not in vitest's coverageincludeglobs (onlysrc/**andpackages/gittensory-engine/src/**are instrumented, pervitest.config.ts), so this diff carries nocodecov/patchobligation (buildFeasibilityVerdictitself is untouched, pre-existing, already-tested engine code). In lieu of the full unsharded run (this dev machine is shared with several other concurrent contributor sessions and a full run does not complete in reasonable time), I ran the two new suites —test/unit/miner-feasibility-cli.test.ts(14 tests: arg parsing/validation, all three verdict arms,--not-found, dependency injection, and real subprocess CLI-entrypoint calls through the compiled engine) andtest/unit/mcp-feasibility-gate.test.ts(6 tests: a realnode bin/gittensory-mcp.js --stdioprocess connected overStdioClientTransport, exercising tool listing, all three verdict arms, zod input validation, and a private-terminology leak check) — plus every directly-adjacent sibling suite (miner-cli,miner-discover-cli,mcp-cli-tools,mcp-cli-upstream-drift,mcp-cli-basics,mcp-output-schemas): 120/120 pass.npm run test:workers— not run; no Cloudflare Worker code touched.npm run build:mcp/npm run test:mcp-pack/ miner-pack equivalents — not run directly, butnpm --workspace @jsonbored/gittensory-mcp run build(node --checkon the touched bin file) andnpm --workspace @jsonbored/gittensory-engine run buildwere both run locally as part of getting the subprocess tests green, and both succeed.test:mcp-pack/test:miner-packthemselves currently fail on this Windows machine for an unrelated, pre-existing reason (spawnSync("npm", ...)requiresshell:trueon Windows; reproduces identically on a cleanmaincheckout).npm run ui:openapi:check/ui:lint/ui:typecheck/ui:build— not run; noapps/gittensory-uifiles touched. (npm run command-reference:checkwas checked too: it tracks an unrelated GitHub@gittensorymention-command catalog insrc/github/commands.ts, not this MCP/CLI tool system; confirmed a no-op for this diff.)npm audit --audit-level=moderate— not run; no dependency changes.--not-found, malformed-enum rejection (CLI arg validation + MCP zod schema validation), and a private-terminology leak check on the MCP response.If any required check was skipped, explain why:
src/, non-UI, non-workflow change, or blocked by pre-existing, reproducible-on-clean-mainWindows-local environment issues (npm pack'sspawnSyncWindows incompatibility) that do not reflect real CI behavior (GitHub Actions runs on Linux, and a dedicated CI step already builds@jsonbored/gittensory-enginebeforetest:coverageruns specifically so subprocess tests like these resolve the compiled package).Safety
mcp-output-schemas.test.ts's full tool-inventory and output-schema tests still pass unmodified).UI Evidence
Not applicable; this is a local CLI + MCP tool change.
Notes
apiGet/apiPostand never touches the network — its handler is a direct, synchronous call intobuildFeasibilityVerdict, the only tool inpackages/gittensory-mcp/bin/gittensory-mcp.jswith that property today.