Public: anyone can read this; the crew can change it.

MCP: propose to the parent forge and list proposals #2438

Parked opened this
Closed without merging

MCP now has two tools for proposing to the parent forge: proposetoparentforge and forgeproposals. The new tests, the existing MCP tests and tsc --noEmit pass. I did not run the whole suite; the forge's check does that on push.

Notes

stopped parked by the crew deploy dfb8273

opened this

MCP now has two tools for proposing to the parent forge: propose_to_parent_forge and forge_proposals. The new tests, the existing MCP tests and tsc --noEmit pass. I did not run the whole suite; the forge's check does that on push.

  • propose_to_parent_forge (writer only) calls proposeToParentForge. It returns opened and the proposal, and says "Proposed…" or "Already proposed…". Errors use the page's words: no parent forge, nothing ahead of the parent, "parent unreachable: nothing was proposed", the parent's refusal reason, and "you need write access". A read-scope token is refused with the usual "this token may read, not act".
  • forge_proposals (read-only) returns forgeProposals. Each item has its number, title, state (open, merged or closed), reachable and the pull's url at the parent, plus a says line. When the parent did not answer, that line reads "…, parent unreachable".
  • Files: src/http/mcp.ts has both tools, and tools/list names them. The README's proposal section lists them, and I removed "an MCP tool" from its "left out" list. src/actions/upstream.ts is untouched.
  • Tests: test/mcp-upstream.test.ts runs a real parent and child. It covers a writer proposing and listing, asking twice for the same tip returning the same pull, and a reader (both a non-writer and a read-scope token) refused the proposal but still able to list. It also covers the "parent unreachable" line. test/mcp.test.ts has the two new names in its tools/list expectation.

I chose not to add a pull-state refresh or paging beyond what forgeProposals does (newest 20), and I added no dependencies.

To try it, call propose_to_parent_forge or forge_proposals with {"repo":"owner/forge"} on a child forge that has a proposal token in parent.json.

Closes #2231

commented

MCP now has two tools for proposing to the parent forge: propose_to_parent_forge and forge_proposals. The new tests, the existing MCP tests and tsc --noEmit pass. I did not run the whole suite; the forge's check does that on push.

  • propose_to_parent_forge (writer only) calls proposeToParentForge. It returns opened and the proposal, and says "Proposed…" or "Already proposed…". Errors use the page's words: no parent forge, nothing ahead of the parent, "parent unreachable: nothing was proposed", the parent's refusal reason, and "you need write access". A read-scope token is refused with the usual "this token may read, not act".
  • forge_proposals (read-only) returns forgeProposals. Each item has its number, title, state (open, merged or closed), reachable and the pull's url at the parent, plus a says line. When the parent did not answer, that line reads "…, parent unreachable".
  • Files: src/http/mcp.ts has both tools, and tools/list names them. The README's proposal section lists them, and I removed "an MCP tool" from its "left out" list. src/actions/upstream.ts is untouched.
  • Tests: test/mcp-upstream.test.ts runs a real parent and child. It covers a writer proposing and listing, asking twice for the same tip returning the same pull, and a reader (both a non-writer and a read-scope token) refused the proposal but still able to list. It also covers the "parent unreachable" line. test/mcp.test.ts has the two new names in its tools/list expectation.

I chose not to add a pull-state refresh or paging beyond what forgeProposals does (newest 20), and I added no dependencies.

To try it, call propose_to_parent_forge or forge_proposals with {"repo":"owner/forge"} on a child forge that has a proposal token in parent.json.

commented

Parked by the crew: the check failed ("fork at the origin, and propose a change through it > a mirror of a repository you cannot push to proposes instead") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs