Public: anyone can read this; the crew can change it.
MCP make_it_yours undo is a real write: it plans without dryRun:false, and an agent cannot undo #14928
Check · Review · Land · Live done — Landed and live in production.
MCP makeityours with undo: true now only plans unless dryRun is false, and an agent can no longer undo (#14912, a finding from #14769). Before this, the tool was marked dryByDefault, so the MCP layer treated undo: true without dryRun: false as a read. The undo still deleted the copy.
shipped production is serving it deploy 6b7374e
3 earlier comments
MCP make_it_yours with undo: true now only plans unless dryRun is false, and an agent can no longer undo (#14912, a finding from #14769). Before this, the tool was marked dryByDefault, so the MCP layer treated undo: true without dryRun: false as a read. The undo still deleted the copy. That let a read-only token remove a repository and skipped the confirm fence.
src/actions/make_it_yours.ts:undoMakeItYourstakes{ dryRun }. It checks every refusal it already had (the copy has its own commits, or a pull was sent from it), then returns{ dryRun: true, repo, says }and removes nothing unlessdryRunis false. It now refuses an agent withinvalid, matchingmakeItYours. The new plan wording isundoPlanWords.src/http/mcp/tools/make_it_yours.ts: passesdryRun: args.dryRun !== false. A real removal is now treated as a write, so a read-only token gets the standard read-only refusal and the confirm fence applies. The tool's doc string and size are unchanged.- Page and terminal (
src/web/studio/make_it_yours.ts,src/tui/screens/yours.ts): these already ask the person to confirm, so they passdryRun: falseand show the agent refusal's message.
Tests. Both of these fail on the unchanged source:
test/make-it-yours.test.ts: an agent's undo of its own fork is refused and the fork is kept; a person's undo plans by default and removes the copy only withdryRun: false.test/explorer-make-it-yours.test.ts: the MCP undo plans and the copy stays; a read-only token gets the plan but is refused the removal. The existing undo calls in this file now passdryRun: false, because without it they now get a plan; the old tests weren't wrong.
These pass: those two files, test/tui-make-it-yours.test.ts, test/tui-working-yours.test.ts, test/mcp-size.test.ts, test/data-move.test.ts, test/conversation-confirm.test.ts and test/mcp-find-tool-queries.test.ts. The gate, bun x tsc --noEmit and the design lint are clean. scripts/fast.ts named 2282 test files, too broad to run here, so the full suite is left to the forge's check. The explorer test logs one [following] … closed database error while still passing.
Not done. I didn't tick the box on #14769 or keep a plan on this issue: the keep_plan tool wasn't available in this run.
To try: call MCP make_it_yours with { repo, undo: true } on a copy you made. It answers a plan and the copy stays; add dryRun: false to remove it.
[{"go":"/explore?q=kind:app","look":"Make it yours on someone else's app, then Undo on the receipt","expect":"the copy is removed and a flash says it is removed and the original was not touched"}]
🤖 Generated with Claude Code
The MCP tool make_it_yours called with { repo, undo: true } now returns a plan and removes nothing. The copy is only removed when the call adds dryRun: false. An agent cannot undo at all. This merges main, where #14823 rewrote the same undo function in src/actions/make_it_yours.ts. The conflict is resolved to keep what both sides meant.
- From
main:ownOfdecides when a copy holds something of its own and so is kept. That covers branches or tags the original doesn't have, a pull sent from the copy, forks of it, its own issues or secrets, and app variables or a domain. If the delete fails, the copy's app is turned back on under its old name. - From this branch: all of
ownOf's refusals are checked first. Then, unlessdryRunis false, the call stops and returns the plan before the app is switched off. The result also says whether it was a plan. - Test change: two cases in the new
test/undo-make-it-yours.test.tsfrommainwere written before undo planned by default. They expect a real removal ("a copy with nothing of its own is removed" and "a delete that fails leaves the copy with its app, under its name"), so they now pass{ dryRun: false }. The test was out of date, not the code; the refusal cases are unchanged.
bun x tsc --noEmit and bun scripts/gate.ts --fix pass. scripts/fast.ts named 3,363 test files because the merge brings in all of main's changes, so I ran the 18 test files that call make-it-yours instead: 280 pass. Two were not run here:
test/quotas-storage.test.tsalso fails on this branch before the merge, with "Cannot use a closed database" while copying from a test origin. It doesn't touch undo and is left to the forge's check.test/helpers/cell-looks-e2e.tsis a helper file, not a suite.
To try it: call make_it_yours with { repo, undo: true } on a copy you made. It answers with a plan and the copy stays. Add dryRun: false to remove it.
🤖 Generated with Claude Code
<!-- look-pages 09488df8b7f7 --> Look pages for 09488df, from the gate:
look pages (none): this pull changes src/web/studio/make_it_yours.ts but the forge could not trace the route of /settings/security/controls (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
The MCP tool make_it_yours called with { repo, undo: true } now returns a plan and removes nothing. The copy is only removed when the call adds dryRun: false. An agent cannot undo at all.
Before deleting, undo checks everything a copy can hold of its own, using ownOf from main (#14823): branches or tags the original doesn't have, a pull sent from the copy, forks of it, its own issues or secrets, and app variables or a domain. Any of these keeps the copy. The plan-only answer is returned only after those checks pass, before the app is switched off. If the delete fails, the copy's app is turned back on under its old name.
The undo button on the web page still removes the copy straight away. Its POST handler in src/web/studio/make_it_yours.ts now passes dryRun: false explicitly. A refusal for bad input now shows its own message in the flash instead of "There is nothing to undo."
Two cases in test/undo-make-it-yours.test.ts (from main) were written before undo planned by default and expected a real removal. They now pass { dryRun: false }. The test was out of date, not the code.
The latest commit (97ee2addf) adds a No look: line for the gate's look-pages note. The form and /explore render as before; only the handler and one flash message changed, so there is no page to picture.
Checks: bun x tsc --noEmit and bun scripts/gate.ts --fix pass, and the 18 test files that cover make-it-yours pass (280 tests). Two were not run here:
test/quotas-storage.test.tsalso fails on this branch before the merge withmain, with "Cannot use a closed database" while copying from a test origin. It doesn't touch undo and is left to the forge's check.test/helpers/cell-looks-e2e.tsis a helper file, not a test suite.
To try it: call make_it_yours with { repo, undo: true } on a copy you made. It answers with a plan and the copy stays. Add dryRun: false to remove it.
🤖 Generated with Claude Code
Undo now plans unless dryRun is false. It is refused for an agent (kind invalid), and a read-only token can ask for the plan but not the removal. The other two callers, the page handler and the TUI screen, pass dryRun: false explicitly. The new tests cover each case, and the pull is green. No markup changed, so the design principles are not touched. One small nit, not blocking: the tool doc string still says undo removes the copy, without saying that it plans first.
MCP
make_it_yourswithundo: truenow only plans unlessdryRunis false, and an agent can no longer undo (#14912, a finding from #14769). Before this, the tool was markeddryByDefault, so the MCP layer treatedundo: truewithoutdryRun: falseas a read. The undo still deleted the copy. That let a read-only token remove a repository and skipped the confirm fence.src/actions/make_it_yours.ts:undoMakeItYourstakes{ dryRun }. It checks every refusal it already had (the copy has its own commits, or a pull was sent from it), then returns{ dryRun: true, repo, says }and removes nothing unlessdryRunis false. It now refuses an agent withinvalid, matchingmakeItYours. The new plan wording isundoPlanWords.src/http/mcp/tools/make_it_yours.ts: passesdryRun: args.dryRun !== false. A real removal is now treated as a write, so a read-only token gets the standard read-only refusal and the confirm fence applies. The tool's doc string and size are unchanged.src/web/studio/make_it_yours.ts,src/tui/screens/yours.ts): these already ask the person to confirm, so they passdryRun: falseand show the agent refusal's message.Tests. Both of these fail on the unchanged source:
test/make-it-yours.test.ts: an agent's undo of its own fork is refused and the fork is kept; a person's undo plans by default and removes the copy only withdryRun: false.test/explorer-make-it-yours.test.ts: the MCP undo plans and the copy stays; a read-only token gets the plan but is refused the removal. The existing undo calls in this file now passdryRun: false, because without it they now get a plan; the old tests weren't wrong.These pass: those two files,
test/tui-make-it-yours.test.ts,test/tui-working-yours.test.ts,test/mcp-size.test.ts,test/data-move.test.ts,test/conversation-confirm.test.tsandtest/mcp-find-tool-queries.test.ts. The gate,bun x tsc --noEmitand the design lint are clean.scripts/fast.tsnamed 2282 test files, too broad to run here, so the full suite is left to the forge's check. The explorer test logs one[following] … closed databaseerror while still passing.Not done. I didn't tick the box on #14769 or keep a plan on this issue: the
keep_plantool wasn't available in this run.To try: call MCP
make_it_yourswith{ repo, undo: true }on a copy you made. It answers a plan and the copy stays; adddryRun: falseto remove it.🤖 Generated with Claude Code
Closes #14912