You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The feasibility-gate composer itself is done: buildFeasibilityVerdict (packages/gittensory-engine/src/feasibility.ts:50) is a pure, fully-implemented go/raise/avoid verdict over claim status, duplicate-cluster risk, and issue quality/lifecycle status, exported from the package's public entrypoint (packages/gittensory-engine/src/index.ts:219-228). Nothing calls it yet — this issue is only the wiring around it.
Confirmed by grep: there is no feasibility MCP tool registration anywhere in src/mcp/server.ts or packages/gittensory-mcp/bin/gittensory-mcp.js (no server.registerTool("gittensory_..._feasibility_..."), nor an equivalent tool-name/shape declaration, in either file).
There are two plausible homes for the MCP tool, with a real trade-off between them:
packages/gittensory-mcp/bin/gittensory-mcp.js (the local stdio MCP wrapper, @jsonbored/gittensory-mcp) already depends on @jsonbored/gittensory-engine (>=0.1.0 <1.0.0, packages/gittensory-mcp/package.json:41) and already imports subpaths from it elsewhere in the same package (packages/gittensory-mcp/lib/local-branch.js:5), even though bin/gittensory-mcp.js itself doesn't import the engine yet. Its closest sibling tools are gittensory_validate_linked_issue (packages/gittensory-mcp/bin/gittensory-mcp.js:385-397) and gittensory_check_before_start (same file, lines 399-415) — feasibility.ts's own header comment says the composer "composes the same go/raise/avoid decision as the pre-start check's core recommendation logic." But those two sibling tools both proxy to the hosted API (apiPost against /v1/repos/{owner}/{repo}/check-before-start, etc.) — a feasibility tool would be meaningfully different in shape: a pure, synchronous, LOCAL computation with no API round-trip, which is exactly what feasibility.ts's header means by "without pulling in repo records or GitHub caches."
src/mcp/server.ts is the hosted, in-process MCP server (70+ server.registerTool(...) calls, e.g. gittensory_get_contributor_profile at lines 1304-1305) where tools call internal functions directly with no round-trip. But the root package.json does not depend on @jsonbored/gittensory-engine at all today (confirmed — no such entry) — wiring the tool here means adding that cross-package dependency first, a bigger-footprint change than extending a package that already declares it.
Given the composer's explicit local/pure design and that packages/gittensory-mcp already declares the dependency, that package is the more natural fit — but this issue should make the call explicitly (and document it in the PR) rather than leave it implicit.
The CLI half is more mechanical. packages/gittensory-miner/bin/gittensory-miner.js dispatches every subcommand with a flat sequence of if (cliArgs[0] === "<command>") { process.exit(run<X>Cli(...)); } blocks (see queue/ledger/plan/governor at lines 41-55), each delegating to a run<X>Cli export from a sibling lib/<name>-cli.js file, and packages/gittensory-miner/lib/cli.js's printHelp (lines 5-37) lists every command's usage string in one place. A new feasibility command should mirror this exactly. Because the composer only takes already-known discriminants (claimStatus, duplicateClusterRisk, issueStatus) and does no fetching of its own, the CLI command needs a way to supply them — at minimum as flags, and possibly sourcing claimStatus from the local claim ledger (packages/gittensory-miner/lib/claim-ledger.js, see the sibling claim-ledger CLI issue) once that lands. That data-sourcing design is left to the implementer.
Deliverables
Register a new MCP tool (e.g. gittensory_feasibility_gate) wired to buildFeasibilityVerdict — in packages/gittensory-mcp/bin/gittensory-mcp.js (preferred, see reasoning above) or src/mcp/server.ts; document which was chosen and why in the PR
New packages/gittensory-miner/lib/feasibility-cli.js exporting a runFeasibilityCli(args, options)-style entrypoint that calls buildFeasibilityVerdict, following the parse → execute → render(json|table) → exit-code convention used by runQueueCli (packages/gittensory-miner/lib/portfolio-queue-cli.js:209-215)
New gittensory-miner feasibility ... dispatch branch added to packages/gittensory-miner/bin/gittensory-miner.js, mirroring the queue/ledger/plan blocks at lines 41-51
printHelp in packages/gittensory-miner/lib/cli.js updated with the new command's usage line(s)
Tests for both the MCP tool wiring and the CLI command's argument parsing + output rendering
References
packages/gittensory-engine/src/feasibility.ts:50 (buildFeasibilityVerdict, the composer)
The feasibility-gate composer itself is done:
buildFeasibilityVerdict(packages/gittensory-engine/src/feasibility.ts:50) is a pure, fully-implemented go/raise/avoid verdict over claim status, duplicate-cluster risk, and issue quality/lifecycle status, exported from the package's public entrypoint (packages/gittensory-engine/src/index.ts:219-228). Nothing calls it yet — this issue is only the wiring around it.Confirmed by grep: there is no feasibility MCP tool registration anywhere in
src/mcp/server.tsorpackages/gittensory-mcp/bin/gittensory-mcp.js(noserver.registerTool("gittensory_..._feasibility_..."), nor an equivalent tool-name/shape declaration, in either file).There are two plausible homes for the MCP tool, with a real trade-off between them:
packages/gittensory-mcp/bin/gittensory-mcp.js(the local stdio MCP wrapper,@jsonbored/gittensory-mcp) already depends on@jsonbored/gittensory-engine(>=0.1.0 <1.0.0,packages/gittensory-mcp/package.json:41) and already imports subpaths from it elsewhere in the same package (packages/gittensory-mcp/lib/local-branch.js:5), even thoughbin/gittensory-mcp.jsitself doesn't import the engine yet. Its closest sibling tools aregittensory_validate_linked_issue(packages/gittensory-mcp/bin/gittensory-mcp.js:385-397) andgittensory_check_before_start(same file, lines 399-415) — feasibility.ts's own header comment says the composer "composes the same go/raise/avoid decision as the pre-start check's core recommendation logic." But those two sibling tools both proxy to the hosted API (apiPostagainst/v1/repos/{owner}/{repo}/check-before-start, etc.) — a feasibility tool would be meaningfully different in shape: a pure, synchronous, LOCAL computation with no API round-trip, which is exactly what feasibility.ts's header means by "without pulling in repo records or GitHub caches."src/mcp/server.tsis the hosted, in-process MCP server (70+server.registerTool(...)calls, e.g.gittensory_get_contributor_profileat lines 1304-1305) where tools call internal functions directly with no round-trip. But the rootpackage.jsondoes not depend on@jsonbored/gittensory-engineat all today (confirmed — no such entry) — wiring the tool here means adding that cross-package dependency first, a bigger-footprint change than extending a package that already declares it.Given the composer's explicit local/pure design and that
packages/gittensory-mcpalready declares the dependency, that package is the more natural fit — but this issue should make the call explicitly (and document it in the PR) rather than leave it implicit.The CLI half is more mechanical.
packages/gittensory-miner/bin/gittensory-miner.jsdispatches every subcommand with a flat sequence ofif (cliArgs[0] === "<command>") { process.exit(run<X>Cli(...)); }blocks (seequeue/ledger/plan/governorat lines 41-55), each delegating to arun<X>Cliexport from a siblinglib/<name>-cli.jsfile, andpackages/gittensory-miner/lib/cli.js'sprintHelp(lines 5-37) lists every command's usage string in one place. A newfeasibilitycommand should mirror this exactly. Because the composer only takes already-known discriminants (claimStatus,duplicateClusterRisk,issueStatus) and does no fetching of its own, the CLI command needs a way to supply them — at minimum as flags, and possibly sourcingclaimStatusfrom the local claim ledger (packages/gittensory-miner/lib/claim-ledger.js, see the sibling claim-ledger CLI issue) once that lands. That data-sourcing design is left to the implementer.Deliverables
gittensory_feasibility_gate) wired tobuildFeasibilityVerdict— inpackages/gittensory-mcp/bin/gittensory-mcp.js(preferred, see reasoning above) orsrc/mcp/server.ts; document which was chosen and why in the PRpackages/gittensory-miner/lib/feasibility-cli.jsexporting arunFeasibilityCli(args, options)-style entrypoint that callsbuildFeasibilityVerdict, following the parse → execute → render(json|table) → exit-code convention used byrunQueueCli(packages/gittensory-miner/lib/portfolio-queue-cli.js:209-215)gittensory-miner feasibility ...dispatch branch added topackages/gittensory-miner/bin/gittensory-miner.js, mirroring thequeue/ledger/planblocks at lines 41-51printHelpinpackages/gittensory-miner/lib/cli.jsupdated with the new command's usage line(s)References
packages/gittensory-engine/src/feasibility.ts:50(buildFeasibilityVerdict, the composer)packages/gittensory-engine/src/index.ts:219-228(public export)packages/gittensory-mcp/bin/gittensory-mcp.js:385-397(gittensory_validate_linked_issue, sibling tool pattern)packages/gittensory-mcp/bin/gittensory-mcp.js:399-415(gittensory_check_before_start, the sibling tool feasibility.ts's own header says it mirrors)packages/gittensory-mcp/package.json:41(existing@jsonbored/gittensory-enginedependency)packages/gittensory-mcp/lib/local-branch.js:5(existing subpath-import precedent from the engine package within this file's own package)src/mcp/server.ts:1304-1305(gittensory_get_contributor_profile, the alternate hosted-tool pattern)packages/gittensory-miner/bin/gittensory-miner.js:41-55(CLI dispatch pattern to mirror)packages/gittensory-miner/lib/cli.js:5-37(printHelp, needs the new usage line)packages/gittensory-miner/lib/portfolio-queue-cli.js:209-215(runQueueCli, closest existing CLI-subcommand dispatch pattern)