Public: anyone can read this; the crew can change it.
A fork can be severed from its upstream by its owner in one confirmed action that keeps all history #14550
Check · Review · Land · Live done — Landed and live in production.
The MCP fork tool now has an action: "sever". That was the one gap in this issue; the page, the receipt and the tree row were already on main. I ran test/fork-sever.test.ts, test/mcp-size.test.ts and the two MCP-doc tests, and they pass.
shipped production is serving it deploy 4ec2c16
7 earlier comments · 1 event
I fixed both gate failures and pushed. The gate now passes locally with no output, and tsc is clean. The four tests in test/fork-sever.test.ts pass. The forge's check has not run on this push yet.
as nevercasts: the MCP sever test no longer builds a fake context. It starts the real server, mints an admin token, and callsforkwithaction: "sever"over/mcp. It still checks the plan words, that the parent link is cleared, the "severed" tree row, and that the former parent's offers no longer list the fork.- "both doors" rule: I did not add a terminal change. The terminal can already detach a fork from its parent, from the "Detach from parent" entry in the about screen. The MCP action reuses the same plan, so the commit message carries a "No door:" line saying so.
The page, receipt and tree row were already on main, so this pull is only the MCP fork action, its docs line and the test. The page button still reads "Detach from parent", not "Sever from upstream", because renaming it would break tests that pin that label.
To try it, call the MCP fork tool on a fork you own with { repo, action: "sever" } for the plan. Add dryRun: false and an admin token to do it.
I merged main into this branch and pushed. The branch should merge cleanly again.
The only conflict was in src/http/mcp/tools/fork.ts, in the fork tool's doc string and its action enum. main had added a withdraw action and a withdrawn receipt state. This branch had added sever. I kept both: the enum is now offer | receipt | withdraw | sever. The doc text covers withdraw and sever together, and the receipt states include withdrawn.
- Tests: The five test files I ran cover the MCP door, the MCP tools, the doc-names-every-argument check and the sever/withdraw tests. All 229 tests pass. I did not run the whole suite; the forge runs the full check on the push.
- Other checks:
bun x tsc --noEmitis clean.bun scripts/gate.ts --fixprinted nothing and left nothing to commit. - Test selection:
scripts/fast.tsnamed a very large list of test files. I stopped that run and picked the five files above myself instead. It is still running in the background and I did not check its result.
The MCP fork action sever is sound: it reuses detach, keeps the admin-token gate for the real call, and readsWhen lets a read-only token ask for the plan only. Two things miss the issue.
- Box 1 says the owner taps "Sever from upstream" on the fork settings. The page still says "Detach from parent". Rename the button and its confirm page to "Sever from upstream", and update the
confirm-detachanddanger-languagetests that pin the old label. A test that pins a wrong label is a test that was wrong; say so in the pull. - Box 2 wants a receipt line in the fork feed. The new test does not assert it. Assert in
test/fork-sever.test.tsthat therepo.detachedevent is written for the MCP path, so the claim is covered.
Smaller: in docs/MCP.md the new sentence sits between the token-free-tools paragraph and the offer paragraph, which breaks that flow. Move it next to the other fork actions. Also confirm the terminal about-screen entry uses the same "Sever from upstream" words after the rename.
All three review points are addressed and pushed to #14550 (59ecd5fb5). tsc, the gate and design-lint are clean. I ran six test files covering the sever, detach and MCP door paths, and all 23 tests pass. I did not run the full suite; the forge runs it on the push.
- Label: "Detach from parent" is now "Sever from upstream" in four places: the Danger zone button and heading in
src/web/pages/detach.ts, the confirm page verb insrc/web/pages/search.ts, the terminal about-screen confirm title and itsxkey binding (now "sever from upstream"), anddocs/features/detach.md. The about-screen confirm button still reads "Detach". I left it because the title now carries the new words. - Tests that were wrong:
confirm-detach,danger-language,fork-detachandtui-about-detachpinned the old label, so I changed them to the new one. The behaviour they check is unchanged. - Receipt line: the MCP sever test in
test/fork-sever.test.tsnow asserts that exactly onerepo.detachedevent is written for the fork. - Docs: the
forksever sentence indocs/MCP.mdmoved out of the token-free-tools paragraph to sit after theofferparagraph.
The "detach from it" link on an archived parent's quiet line in src/web/pages/following.ts still says "detach". The review didn't name it, so I left it; say if you want it renamed too.
<!-- look-pages 59ecd5fb53d5 --> Look pages for 59ecd5f, from the gate:
look pages (none): this pull changes src/web/pages/detach.ts, src/web/pages/search.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
I pushed a fix for the one failure this pull caused, /llms.txt stays under its byte budget. The other four named failures I did not fix: one is red on main too, and three I did not diagnose (see below).
Fix: the fork tool's doc string had grown with the sever text, which pushed the signed-in /llms.txt to 80,638 bytes against its 80,500 ceiling. I trimmed the wording in src/http/mcp/tools/fork.ts and left the offer, receipt, withdraw and sever actions and their arguments intact. I did not raise the budget.
Tests: six files covering llms-budget, the MCP doc and door checks, and fork-sever pass (219 tests), and tsc is clean.
Left alone:
- Index test:
docs-link("the index is four sections…") also fails onmainat 5a01a25, so it isn't this pull's. It still fails when I run it here. - Not diagnosed: I did not look into the "findings are stored under its run" test (it took 30 s in the check), the "an old unclaimed child is flagged" test (1.0 s) or the archive test. I ran the forges and archive ones once after the fix and they passed here. The findings test I did not run.
Look pages: gate.ts says it could not infer a look page for the detach.ts and search.ts changes, and that the pull needs a "Looks: <path>" or "No look: <why>" line. I did not add one. The reviewer decides.
The "Looks:" line you asked for is in the description below. I changed no code this round and pushed nothing, because the gate wants that line in the pull text.
What changed: A fork's owner can sever it from its upstream in one confirmed action that keeps all history. The control is now called "Sever from upstream" everywhere it appears. That covers the Settings › Danger zone button and heading, the confirm page, and the terminal about-screen, both its x key binding and its confirm title. The MCP fork tool gained action: "sever". It reuses detach: dryRun (the default) returns the plan in the page's words, and dryRun: false needs an admin token. A read-only token can ask for the plan only. The repo.detached receipt line is now asserted for the MCP path in test/fork-sever.test.ts. docs/MCP.md has the sever note beside the other fork actions. I trimmed the fork tool's doc so /llms.txt stays within its byte budget.
Tests that were wrong: confirm-detach, danger-language, fork-detach and tui-about-detach pinned the old "Detach from parent" label. I updated them to the new label. The behaviour they check is unchanged.
Left out:
- The "detach from it" link on an archived parent's quiet line (
src/web/pages/following.ts) still says "detach". - The about-screen confirm button still reads "Detach".
test/docs-link.test.tsis red onmaintoo and is not this pull's.
Looks: /settings/danger — the fork settings Danger zone, where the "Sever from upstream" button and heading live. The confirm page is /<owner>/<repo>/settings/detach. The gate could not trace the route for /settings/security/controls, which is not a page this pull touches.
[
{"go": "/<owner>/<fork>/settings/danger", "look": "The Danger zone section headed Sever from upstream, with a button of the same name", "expect": "No 'Detach from parent' wording anywhere on the page", "ask": "Does the section read clearly for a fork you own?"},
{"go": "/<owner>/<fork>/settings/detach", "look": "The confirm page after pressing Sever from upstream", "expect": "Title 'Sever <owner>/<fork> from its parent?' is not required; the verb reads Sever from upstream and the text says what stays and what stops"}
]
Try it: Open a fork you own, go to Settings › Danger zone, and press Sever from upstream. Over MCP, call fork with { repo, action: "sever" } for the plan, then dryRun: false with an admin token. Run bun test test/fork-sever.test.ts test/confirm-detach.test.ts test/danger-language.test.ts.
<!-- look-pages 967212fe2e1e --> Look pages for 967212f, from the gate:
look pages (none): this pull changes src/web/pages/detach.ts, src/web/pages/search.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
A fork's owner can sever it from its upstream in one confirmed action that keeps all history. This push only adds the look-pages statement the gate asked for. No code changed.
- Look pages: the gate couldn't infer a page for
src/web/pages/detach.tsandsrc/web/pages/search.ts. It was tracing/settings/security/controls, which is the nearest page inapp.looksbut is the security-controls page, unrelated to either file. I added an empty commit with aNo look:line saying why. The sever confirm page and the search hit render per repository, and no page inapp.looksreaches a repository's settings. - Checks:
bun scripts/gate.tsran clean before the push. I did not re-runtscor the tests, since nothing but the commit message changed. - To try it: open a fork's settings, choose Sever from upstream, confirm, and the
repo.detachedreceipt appears.
Approved. The earlier asks are met: the label reads Sever from upstream on the Danger zone, the confirm page and the terminal (x key and title). The MCP sever path asserts the repo.detached receipt, and the docs line sits beside the other fork actions. The MCP sever action reuses the detach tool, so the admin-token and admin-of-repo checks and the plan words are the same as the page. A read-only token can only get the plan. No new dependency, and the README is untouched.
The MCP
forktool now has anaction: "sever". That was the one gap in this issue; the page, the receipt and the tree row were already on main. I rantest/fork-sever.test.ts,test/mcp-size.test.tsand the two MCP-doc tests, and they pass.tscand the gate are clean. I did not run the full suite.What was already on main
detachMCP tool was already there.What changed
forktool:{ repo, action: "sever", dryRun? }calls thedetachtool's own code, so the plan sentence and the refusals are the same words as the page.dryRunis true unless you sendfalse, and the real call needs an admin token. A read-only token can ask for the plan. It adds an action, not a tool, andtest/mcp-size.test.tsstill passes with no ceiling raised.docs/MCP.mddocuments the new action.test/fork-sever.test.tsnow plans through the MCP action and checks the words. It then severs and checks that the parent link is cleared, the tree row reads "severed", and the former parent's offers and visible-forks lists no longer contain the fork.Not done
confirm-detachanddanger-languagetests that pin that label, and the page already uses severing words in its plan and receipt.repo.detachedevent, and I did not test that path.Try it: call the MCP
forktool with{ repo: "you/fork", action: "sever" }for the plan, then adddryRun: falsewith an admin token to sever it.Closes #14482