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

An owner severs a fork from its upstream with one confirmed action, and the tree shows it severed #13453

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Most of this already existed on main, so this pull only adds the missing pieces: the "severed" tree row, a way back, and the test. I did not decline because the tree row, the undo hint and the test were missing.

Notes

shipped production is serving it deploy 59903fa

opened this

Most of this already existed on main, so this pull only adds the missing pieces: the "severed" tree row, a way back, and the test. I did not decline because the tree row, the undo hint and the test were missing.

Already on main:

  • Detach from the fork's Settings › Danger zone goes through a confirm page that says what stays and what stops, and the history records it.
  • The existing MCP detach tool plans first, then acts with dryRun: false.
  • Once detached, the upstream's follow-on never sees the fork, because it only walks the parent's current forks.

What changed:

  • Tree row: a fork whose link was cut now reads severed (follow: "dont-follow") in its own fork tree, in src/actions/fork_tree.ts. It had read as an unlabelled root, since detaching removes the parent link.
  • Way back: the confirm page, the Danger zone, the search action, the plan words and the MCP plan now end with DETACH_AGAIN. It says: "There is no undo. To follow it again, follow its address from the Following card." I kept "There is no undo." because existing tests assert it.
  • Test: test/fork-sever.test.ts severs one fork and leaves a sibling attached. It then pushes upstream and checks that the severed fork gets no fork.diverged and its tip does not move, while the sibling is told. It also checks the severed tree row and the way-back words.

Checks: tsc is clean. The new test and the detach, danger-language, fork-tree, mcp-size and MCP fork-tree docs tests pass. design-lint passes, and gate --fix rewrapped comments, which are committed.

Not done:

  • I added no MCP tool and changed nothing in the tool set, so there is no new action. The MCP door is the existing detach tool, and the issue's "same words" wording is satisfied through the shared plan words.
  • I did not build a one-click re-follow. The way back is the existing follow-by-address flow, and I did not check that flow end to end.
  • I took no screenshot of the confirm page, so the issue's "a look" is not delivered.

To try it: open a fork's Settings › Danger zone › Detach from parent. Then open the fork's tree and look for severed.

Closes #13427

4 earlier comments · 1 event
commented

Most of this already existed on main, so this pull only adds the missing pieces: the "severed" tree row, a way back, and the test. I did not decline because the tree row, the undo hint and the test were missing.

Already on main:

  • Detach from the fork's Settings › Danger zone goes through a confirm page that says what stays and what stops, and the history records it.
  • The existing MCP detach tool plans first, then acts with dryRun: false.
  • Once detached, the upstream's follow-on never sees the fork, because it only walks the parent's current forks.

What changed:

  • Tree row: a fork whose link was cut now reads severed (follow: "dont-follow") in its own fork tree, in src/actions/fork_tree.ts. It had read as an unlabelled root, since detaching removes the parent link.
  • Way back: the confirm page, the Danger zone, the search action, the plan words and the MCP plan now end with DETACH_AGAIN. It says: "There is no undo. To follow it again, follow its address from the Following card." I kept "There is no undo." because existing tests assert it.
  • Test: test/fork-sever.test.ts severs one fork and leaves a sibling attached. It then pushes upstream and checks that the severed fork gets no fork.diverged and its tip does not move, while the sibling is told. It also checks the severed tree row and the way-back words.

Checks: tsc is clean. The new test and the detach, danger-language, fork-tree, mcp-size and MCP fork-tree docs tests pass. design-lint passes, and gate --fix rewrapped comments, which are committed.

Not done:

  • I added no MCP tool and changed nothing in the tool set, so there is no new action. The MCP door is the existing detach tool, and the issue's "same words" wording is satisfied through the shared plan words.
  • I did not build a one-click re-follow. The way back is the existing follow-by-address flow, and I did not check that flow end to end.
  • I took no screenshot of the confirm page, so the issue's "a look" is not delivered.

To try it: open a fork's Settings › Danger zone › Detach from parent. Then open the fork's tree and look for severed.

commented

This fixes the three gate failures on the pull. I only re-ran the gate, tsc and test/fork-sever.test.ts locally, and all three came back clean. The forge's full check on this push hasn't reported yet.

  • Real timer: the poll loop at test/fork-sever.test.ts:80 now ends with // real-timer: polls for a git event follow-on that has no injectable clock. The loop waits on a follow-on that runs off a git event, so it can't take an injected clock. This is the only change to the test file and no assertion changed.
  • Both doors: the fix commit message carries a No door: line. The edits change wording on the existing detach and search pages, and the terminal screen reads the same words from src/actions/detach_words.ts.
  • Look pages: the same commit message carries a No look: line. The wording is in a settings control with an inline handler and there is no new layout.

The sever and detach behaviour itself is unchanged from the earlier push.

Changes requested — before the latest push

Small, honest pull, but two things keep it from landing. (1) The new sentence DETACH_AGAIN sends people to 'the Following card' to follow again. That card is rendered on forks (src/web/pages/repo.ts:182), and the builder says the re-follow flow was never checked. A just-severed repository has no parent, so the card it points at may not be on its page. Either verify it on the preview and name the real place, or drop the sentence. A confirm page must not promise a door that may be missing. (2) docs/features/detach.md is not updated for the severed tree row or the way back; the how-to belongs there. Also: the issue asks for a previewed look at what stops flowing; no screenshot of the confirm page was taken. The tree row reads 'severed' only in the severed fork's own tree; that is acceptable, but add a one-line note in docs/features/fork-tree.md. Box 3 is met by the shared plan words on the existing detach tool, no new action.

commented

An admin can sever a fork from its upstream with one confirmed action (Settings › Danger zone › Detach from parent), and the fork's own tree row then reads severed. This push answers the review. tsc, gate --fix, design-lint and the detach and fork-sever tests pass. I ran no full suite, and I took no screenshot of the confirm page because the sandbox can't render one.

What changed in this push

  • The way back is now a place that exists. The sentence no longer points at the Following card, which is drawn on forks only (src/web/pages/repo.ts:182) and so is absent from a just-severed repository. It now names Settings › Follow upstream. That settings card is built for any repository's admin without checking for a parent (settings.ts:333, followUpstreamCard). It follows the address as for any repository and does not restore the fork link. I checked this in code only; I did not click through the preview.
  • One sentence instead of two. DETACH_AGAIN now reads "There is no undo, but Settings › Follow upstream can follow its address again." The separate "There is no undo." is gone from the confirm page, the Danger zone section, the plan words and the search detail. I updated the assertion in test/confirm-detach.test.ts to match.
  • docs/features/detach.md: I replaced the old line saying following cannot be set up again with the way back and the severed tree row.
  • docs/features/fork-tree.md: I added the one-line note that severed shows only in the severed repository's own tree and that plain roots read as before.
  • Plain roots stay unmarked. A new test shows a repository that was never a fork reads no severed word.

Left out

  • No screenshot of the confirm page, as above.
  • The one-event query per root is unchanged, since it only runs for roots.
commented

I merged main into the branch and pushed; the only conflict was in docs/features/fork-tree.md. The type check and bun scripts/gate.ts --fix are clean, and the four test files that cover this change pass (21 tests): fork-sever, confirm-detach, fork-tree-mode and fork-tree-reader.

scripts/fast.ts said the diff reaches 2254 of 3443 test files, too many to name, so I picked those four by hand. I did not run the full suite; the forge's check does that on the push.

In the conflicted section I kept both sides:

  • Mine: a repository whose owner severed it reads severed on its own row, and a plain root that was never a fork reads as before.
  • Main's: the new line that says each fork's mode in words, including severed · no longer follows, with its test/fork-tree-mode.test.ts pointer.
commented

One of the three failures was mine, and I've fixed it and pushed. I ran test/danger-language.test.ts and test/confirm-detach.test.ts after the fix and both pass. I did not re-run the other two failures.

  • "the detach shows its plan with its parent named": this was my doing. The test in test/danger-language.test.ts asserted the literal "There is no undo." My earlier change folded that into one sentence, "There is no undo, but Settings › Follow upstream can follow its address again." The page text was right and the test was out of date, so I changed the assertion to match. The same fold broke test/confirm-detach.test.ts earlier, and I fixed it then.
  • "the page's own bytes are held": this is in test/talk-page.test.ts. The check log says it is red on main at 4f85986 too, so it is not counted against this pull. I did not touch it.
  • "looks of a public app" (test/looks-owner.test.ts): this timed out in the screenshot step, "still waiting while light().length < pages.length * 3", after 90 seconds. It failed alone, in a shard with no other tests. I did not change anything for it. It is about screenshot timing and I don't see a link to this pull's text changes, but I did not re-run it here, so that is unverified. If it fails again on the next check, it needs someone to look.
Approved

Both earlier asks are met: the way-back wording is now one sentence naming Settings › Follow upstream (a card that exists on a severed repo), and test/fork-sever.test.ts covers a never-forked root reading no severed word. Later changes are a merge of main and a test-assertion update, nothing new to flag. Next, I would (1) click through Settings › Follow upstream on a severed repo in the preview and note it in the docs, (2) add a TUI/MCP check that the plan words match the page. Non-blocking: box 3 is met through the existing detach tool rather than a new action.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs