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

Severing a fork from its upstream asks one confirm that says what stays and what stops, and is receipted #11404

Merged opened this

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

Merged

Detaching a fork now asks one confirm that says what stays and what stops, and the repository's history records the severing. The new test, `fork-detach` and `danger-language` pass, as do `tsc`, the gate and the design lint. I did not run the full suite; the forge runs it on this push.

shipped production is serving it deploy abf00b0

opened this

Detaching a fork now asks one confirm that says what stays and what stops, and the repository's history records the severing. The new test, fork-detach and danger-language pass, as do tsc, the gate and the design lint. I did not run the full suite; the forge runs it on this push.

  • Confirm wording: the /-/confirm page (in src/web/pages/search.ts) and the Danger zone section (src/web/pages/detach.ts) now say "The code and its history stay, with the branches, issues and pulls. Updates from the parent and offers to it stop. It is recorded in this repository's history. There is no undo." Both read from one shared constant in src/actions/detach.ts.
  • Receipt: the existing repo.detached event now reads "severed this fork from its upstream: code and history kept, updates and offers stopped" (src/design/activity.ts). Its row in the history carries the time. The event payload is unchanged ({ parentId }), so the parent's name still never leaks to readers who can't see it.
  • Flash after confirming: it now says "Severing from X (time UTC)… the history will record it when it lands", since the repack finishes after the redirect.
  • Test: a new case in test/confirm-detach.test.ts checks the confirm wording and posts the detach. It then checks the history verb and that the event has a timestamp. It fails without the wording or the receipt.

Left out on purpose:

  • "Following can be set up again": I left this out because it isn't true. Detach clears the parent link, so the only way back is to fork the upstream afresh.
  • Detach behaviour: unchanged. The same-origin check and the POST route are untouched.
  • src/web/pages/upstream-follow.ts: I didn't change it, since nothing there concerns the detach.

I added Try: to the commit message because the pre-push hook rejected the push without it.

To try it, open a fork's /settings/danger and press Detach from parent. After it lands, the receipt appears in the repository's history.

Closes #11338

commented

Detaching a fork now asks one confirm that says what stays and what stops, and the repository's history records the severing. The new test, fork-detach and danger-language pass, as do tsc, the gate and the design lint. I did not run the full suite; the forge runs it on this push.

  • Confirm wording: the /-/confirm page (in src/web/pages/search.ts) and the Danger zone section (src/web/pages/detach.ts) now say "The code and its history stay, with the branches, issues and pulls. Updates from the parent and offers to it stop. It is recorded in this repository's history. There is no undo." Both read from one shared constant in src/actions/detach.ts.
  • Receipt: the existing repo.detached event now reads "severed this fork from its upstream: code and history kept, updates and offers stopped" (src/design/activity.ts). Its row in the history carries the time. The event payload is unchanged ({ parentId }), so the parent's name still never leaks to readers who can't see it.
  • Flash after confirming: it now says "Severing from X (time UTC)… the history will record it when it lands", since the repack finishes after the redirect.
  • Test: a new case in test/confirm-detach.test.ts checks the confirm wording and posts the detach. It then checks the history verb and that the event has a timestamp. It fails without the wording or the receipt.

Left out on purpose:

  • "Following can be set up again": I left this out because it isn't true. Detach clears the parent link, so the only way back is to fork the upstream afresh.
  • Detach behaviour: unchanged. The same-origin check and the POST route are untouched.
  • src/web/pages/upstream-follow.ts: I didn't change it, since nothing there concerns the detach.

I added Try: to the commit message because the pre-push hook rejected the push without it.

To try it, open a fork's /settings/danger and press Detach from parent. After it lands, the receipt appears in the repository's history.

Changes requested — before the latest push

The web wording and the receipt work and the test covers them. Three things to fix in one round:

  1. Fix first: the terminal's confirm (src/tui/screens/about.ts, detachPlanWords) and the MCP dry run still use the old plan sentence. Add DETACH_STAYS and DETACH_STOPS to detachPlanWords so the terminal and MCP tell the same story as the page. Add a test for it.
  2. docs/features/detach.md is not updated. The what-stays and what-stops wording and the history receipt belong there.
  3. The flash invents a timestamp from new Date() at request time, which will not match the history row's time. Drop it, or read the event's createdAt. Nothing tests the flash text.

Smaller points are in the line comments.

commented

All three review points and the line comments are fixed and pushed. The detach, fork-detach, danger-language and terminal-detach tests pass, and tsc and the gate are clean. I did not run the full suite or the design lint on this round.

  • Terminal and MCP: detachPlanWords now ends with the same two lines the page shows, what stays and what stops. A new test covers the plan sentence both when the fork still borrows objects and when it doesn't.
  • Shared wording: the lines now live in a new src/actions/detach_words.ts, as you suggested. The activity module and the confirm page import from there, so the design layer no longer depends on an action module.
  • Receipt verb: it now reads "severed a fork from its upstream: code and history kept, updates and offers stopped". The history row supplies the repository and the time.
  • Danger zone paragraph: it is down to one sentence plus the two shared lines.
  • Flash: the invented timestamp is gone. It now says "The repack runs on its own; the history records it when it lands."
  • Docs: docs/features/detach.md has the what-stays and what-stops wording, the receipt, and the note that following can't be set up again on the same repository.
  • Test: imports are at the top of test/confirm-detach.test.ts. The test now checks the Danger zone and confirm wording, the flash text, and the exact history verb.
Approved

Clean and small. The confirm page, the Danger zone, the terminal plan and the MCP plan now say the same two lines from one module, and the repo.detached history row carries the receipt (who and when come from the row). The flash is honest about the async repack. The docs are in docs/features/detach.md, not the README, and nothing in src/web adds markup beyond one paragraph. The test fails without the wording and the receipt. One note, not blocking: the flash no longer names the parent or says Detaching, so it reads a little bare.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs