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
Add the new MCP tool gittensory_find_opportunities to the hosted Worker's /mcp surface (GittensoryMcp in src/mcp/server.ts), composing the ranker + goal-model + AI-policy-map pieces from the companion issues into a single advisory, metadata-only, no-writes tool call. This is the hosted half of the two-surface requirement in #1060; the stdio CLI half is a separate issue below.
Deliverables
Register gittensory_find_opportunities via server.registerTool(...) in src/mcp/server.ts, following the exact registration shape of the neighboring tools (e.g. gittensory_get_bounty_advisory at line ~1284 or gittensory_check_before_start at line ~1335): a zod inputSchema (repo-list or search-query + optional MinerGoalSpec fields + a result-count cap), a zod outputSchema, and a description string stating explicitly "metadata-only, no GitHub writes" like every sibling tool.
Input shape: { targets: Array<{owner: string; repo: string}> | undefined; searchQuery: string | undefined; goalSpec: <MinerGoalSpecShape> | undefined; limit: number } — at least one of targets/searchQuery required (validated, mirrors existing tools' input-shape validation conventions).
Output shape: a ranked array of { owner, repo, issueNumber, title, rankScore, laneFit, freshness, dupRisk, aiPolicyAllowed: true } (only ever returns aiPolicyAllowed: true entries — banned repos never appear in the output, they're filtered upstream) — never expose raw reward/score internals, matching this tool family's public-safe convention (publicSafeFinding in src/rules/predicted-gate.ts:86 as the sanitization precedent).
A unit test in test/unit/mcp-discovery.test.ts (or a new sibling test/unit/mcp-find-opportunities.test.ts) connecting a real stdio/Worker MCP client and asserting the tool call returns a well-formed ranked list for a fixture target set, and that a banned-repo target never appears in the result.
References
src/mcp/server.ts lines 1284-1345 (gittensory_get_bounty_advisory, gittensory_check_before_start) — the exact server.registerTool(...) registration shape to mirror
src/rules/predicted-gate.ts:86 (publicSafeFinding) — the public-safe-output sanitization precedent
packages/gittensory-miner/lib/opportunity-fanout.ts, packages/gittensory-engine/lib/opportunity-ranker.ts, packages/gittensory-engine/lib/goal-model.ts (from companion issues) — the pieces this tool composes
test/unit/mcp-discovery.test.ts — existing sibling MCP stdio-client test pattern to mirror
Add the new MCP tool
gittensory_find_opportunitiesto the hosted Worker's/mcpsurface (GittensoryMcpinsrc/mcp/server.ts), composing the ranker + goal-model + AI-policy-map pieces from the companion issues into a single advisory, metadata-only, no-writes tool call. This is the hosted half of the two-surface requirement in #1060; the stdio CLI half is a separate issue below.Deliverables
gittensory_find_opportunitiesviaserver.registerTool(...)insrc/mcp/server.ts, following the exact registration shape of the neighboring tools (e.g.gittensory_get_bounty_advisoryat line ~1284 orgittensory_check_before_startat line ~1335): a zodinputSchema(repo-list or search-query + optionalMinerGoalSpecfields + a result-count cap), a zodoutputSchema, and adescriptionstring stating explicitly "metadata-only, no GitHub writes" like every sibling tool.{ targets: Array<{owner: string; repo: string}> | undefined; searchQuery: string | undefined; goalSpec: <MinerGoalSpecShape> | undefined; limit: number }— at least one oftargets/searchQueryrequired (validated, mirrors existing tools' input-shape validation conventions).{ owner, repo, issueNumber, title, rankScore, laneFit, freshness, dupRisk, aiPolicyAllowed: true }(only ever returnsaiPolicyAllowed: trueentries — banned repos never appear in the output, they're filtered upstream) — never expose raw reward/score internals, matching this tool family's public-safe convention (publicSafeFindinginsrc/rules/predicted-gate.ts:86as the sanitization precedent).test/unit/mcp-discovery.test.ts(or a new siblingtest/unit/mcp-find-opportunities.test.ts) connecting a real stdio/Worker MCP client and asserting the tool call returns a well-formed ranked list for a fixture target set, and that a banned-repo target never appears in the result.References
src/mcp/server.tslines 1284-1345 (gittensory_get_bounty_advisory,gittensory_check_before_start) — the exactserver.registerTool(...)registration shape to mirrorsrc/rules/predicted-gate.ts:86(publicSafeFinding) — the public-safe-output sanitization precedentpackages/gittensory-miner/lib/opportunity-fanout.ts,packages/gittensory-engine/lib/opportunity-ranker.ts,packages/gittensory-engine/lib/goal-model.ts(from companion issues) — the pieces this tool composestest/unit/mcp-discovery.test.ts— existing sibling MCP stdio-client test pattern to mirror