Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/mcp/server.integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ describe("MCP server integration", () => {
"grove_check_stop",
"grove_checkout",
"grove_claim",
"grove_contribute",
"grove_create_plan",
"grove_create_session",
"grove_discuss",
Expand All @@ -85,21 +84,22 @@ describe("MCP server integration", () => {
"grove_release",
"grove_report_usage",
"grove_reproduce",
"grove_review",
"grove_search",
"grove_send_message",
"grove_set_goal",
"grove_set_outcome",
"grove_submit_review",
"grove_submit_work",
"grove_thread",
"grove_threads",
"grove_tree",
"grove_update_plan",
]);
});

test("grove_contribute round-trip", async () => {
test("grove_submit_work round-trip", async () => {
const result = await client.callTool({
name: "grove_contribute",
name: "grove_submit_work",
arguments: {
kind: "work",
mode: "evaluation",
Expand Down Expand Up @@ -162,16 +162,17 @@ describe("MCP server integration", () => {
expect(releaseData.status).toBe("completed");
});

test("grove_review round-trip", async () => {
test("grove_submit_review round-trip", async () => {
// Create target
const target = makeContribution({ summary: "Reviewable work" });
await deps.contributionStore.put(target);

const result = await client.callTool({
name: "grove_review",
name: "grove_submit_review",
arguments: {
targetCid: target.cid,
summary: "LGTM",
scores: { quality: { value: 0.9, direction: "maximize" } },
agent: { agentId: "reviewer" },
},
});
Expand Down
10 changes: 5 additions & 5 deletions src/mcp/server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ describe("createMcpServer preset scoping", () => {
// --- Contribution tool names (always registered) -------------------------

const contributionTools = [
"grove_contribute",
"grove_submit_work",
"grove_submit_review",
"grove_discuss",
"grove_reproduce",
"grove_review",
];

// --- Full tool list (matches integration test expectation) ---------------
Expand All @@ -66,7 +66,6 @@ describe("createMcpServer preset scoping", () => {
"grove_check_stop",
"grove_checkout",
"grove_claim",
"grove_contribute",
"grove_create_plan",
"grove_create_session",
"grove_discuss",
Expand All @@ -85,11 +84,12 @@ describe("createMcpServer preset scoping", () => {
"grove_release",
"grove_report_usage",
"grove_reproduce",
"grove_review",
"grove_search",
"grove_send_message",
"grove_set_goal",
"grove_set_outcome",
"grove_submit_review",
"grove_submit_work",
"grove_thread",
"grove_threads",
"grove_tree",
Expand Down Expand Up @@ -281,7 +281,7 @@ describe("createMcpServer preset scoping", () => {
expect(names).not.toContain("grove_check_stop");

// Included groups
expect(names).toContain("grove_contribute");
expect(names).toContain("grove_submit_work");
expect(names).toContain("grove_frontier");
expect(names).toContain("grove_checkout");
expect(names).toContain("grove_send_message");
Expand Down
11 changes: 8 additions & 3 deletions src/mcp/tools/bounties.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,16 +146,21 @@ export function registerBountyTools(server: McpServer, deps: McpDeps): void {
},
);

// --- grove_bounty_claim --------------------------------------------------
// --- grove_bounty_claim --- DEPRECATED ------------------------------------
// DEPRECATED: Use grove_claim instead. Agents should call grove_claim with the
// bounty ID as targetRef. grove_bounty_claim is kept for backwards compatibility.
server.registerTool(
"grove_bounty_claim",
{
description:
"Claim an open bounty. Creates a claim via the existing claim system " +
"and transitions the bounty to 'claimed' status.",
"[DEPRECATED — Use grove_claim instead] " +
"Claim an open bounty by bounty ID. " +
"grove_bounty_claim calls claim internally. Agents should use grove_claim directly.",
inputSchema: claimBountySchema,
},
async (args) => {
// Forward to grove_claim behavior via claimBountyOperation
// (kept for backwards compatibility; agents should use grove_claim)
const result = await claimBountyOperation(
{
bountyId: args.bountyId,
Expand Down
46 changes: 14 additions & 32 deletions src/mcp/tools/contributions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async function callTool(
};
}

describe("grove_contribute", () => {
describe("grove_submit_work", () => {
let testDeps: TestMcpDeps;
let deps: McpDeps;
let server: McpServer;
Expand All @@ -49,12 +49,8 @@ describe("grove_contribute", () => {
});

test("creates a work contribution", async () => {
const result = await callTool(server, "grove_contribute", {
kind: "work",
mode: "evaluation",
const result = await callTool(server, "grove_submit_work", {
summary: "Test work",
tags: ["test"],
relations: [],
artifacts: {},
agent: { agentId: "agent-1" },
});
Expand All @@ -67,12 +63,8 @@ describe("grove_contribute", () => {
});

test("validates artifact hashes exist in CAS", async () => {
const result = await callTool(server, "grove_contribute", {
kind: "work",
mode: "evaluation",
const result = await callTool(server, "grove_submit_work", {
summary: "Bad artifacts",
tags: [],
relations: [],
artifacts: {
"file.txt": "blake3:0000000000000000000000000000000000000000000000000000000000000000",
},
Expand All @@ -87,12 +79,8 @@ describe("grove_contribute", () => {
test("creates contribution with valid artifact hash", async () => {
const hash = await storeTestContent(deps.cas, "hello world");

const result = await callTool(server, "grove_contribute", {
kind: "work",
mode: "evaluation",
const result = await callTool(server, "grove_submit_work", {
summary: "With artifact",
tags: [],
relations: [],
artifacts: { "file.txt": hash },
agent: { agentId: "agent-1" },
});
Expand All @@ -103,18 +91,15 @@ describe("grove_contribute", () => {
});

test("validates relation target CIDs exist", async () => {
const result = await callTool(server, "grove_contribute", {
kind: "work",
mode: "evaluation",
const result = await callTool(server, "grove_submit_work", {
summary: "Bad relation",
tags: [],
artifacts: {},
relations: [
{
targetCid: "blake3:0000000000000000000000000000000000000000000000000000000000000000",
relationType: "derives_from",
},
],
artifacts: {},
agent: { agentId: "agent-1" },
});

Expand All @@ -128,13 +113,10 @@ describe("grove_contribute", () => {
const parent = makeContribution({ summary: "Parent" });
await deps.contributionStore.put(parent);

const result = await callTool(server, "grove_contribute", {
kind: "work",
mode: "evaluation",
const result = await callTool(server, "grove_submit_work", {
summary: "Child",
tags: [],
relations: [{ targetCid: parent.cid, relationType: "derives_from" }],
artifacts: {},
relations: [{ targetCid: parent.cid, relationType: "derives_from" }],
agent: { agentId: "agent-1" },
});

Expand All @@ -144,7 +126,7 @@ describe("grove_contribute", () => {
});
});

describe("grove_review", () => {
describe("grove_submit_review", () => {
let testDeps: TestMcpDeps;
let deps: McpDeps;
let server: McpServer;
Expand All @@ -164,11 +146,11 @@ describe("grove_review", () => {
const target = makeContribution({ summary: "Target work" });
await deps.contributionStore.put(target);

const result = await callTool(server, "grove_review", {
const result = await callTool(server, "grove_submit_review", {
targetCid: target.cid,
summary: "Looks good",
scores: { quality: { value: 0.8, direction: "maximize" } },
agent: { agentId: "reviewer-1" },
tags: [],
});

expect(result.isError).toBeUndefined();
Expand All @@ -178,11 +160,11 @@ describe("grove_review", () => {
});

test("returns not-found for non-existent target", async () => {
const result = await callTool(server, "grove_review", {
const result = await callTool(server, "grove_submit_review", {
targetCid: "blake3:0000000000000000000000000000000000000000000000000000000000000000",
summary: "Review of nothing",
scores: { quality: { value: 0.5, direction: "maximize" } },
agent: { agentId: "reviewer-1" },
tags: [],
});

expect(result.isError).toBe(true);
Expand All @@ -193,7 +175,7 @@ describe("grove_review", () => {
const target = makeContribution({ summary: "Target" });
await deps.contributionStore.put(target);

const result = await callTool(server, "grove_review", {
const result = await callTool(server, "grove_submit_review", {
targetCid: target.cid,
summary: "Detailed review",
scores: { quality: { value: 0.8, direction: "maximize" } },
Expand Down
Loading
Loading