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

A fork's owner can stop following upstream in one tap and the page says it is sovereign #14884

Merged opened this

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

Merged

Severing a fork from its parent was already on main (#14550, #13453). This pull fills the three gaps in the issue's "done when" list and adds the test that proves them. tsc, gate.ts, design-lint and the sever tests pass here.

Notes

shipped production is serving it deploy 6dfa34b

opened this

Severing a fork from its parent was already on main (#14550, #13453). This pull fills the three gaps in the issue's "done when" list and adds the test that proves them. tsc, gate.ts, design-lint and the sever tests pass here. I did not run the full suite.

What changed

  • Confirm names the parent. /-/confirm for settings/detach now reads "Detach owner/fork from parent-owner/parent?" and says that no more offers go up and no more updates come down. A parent the viewer can't read still shows as "its parent".
  • "On its own" afterwards. A severed fork's home shows "On its own since <date> … no offers go up and no updates come down". A fork's admin also sees Follow upstream again, which links to Settings › Follow upstream. The line is onItsOwnLine in src/web/pages/following.ts, shown where the following card would be.
  • New test test/fork-sever-page.test.ts.
    • A signed-in stranger posting the sever does nothing.
    • A cross-origin post from the owner is refused.
    • The owner posting from the same origin severs, and the page then reads "on its own".
    • A non-admin sees that line without the follow-again link.
  • test/confirm-detach.test.ts expected the old title, so I updated its assertion.
  • docs/FOLLOWING.md has a new "Going it alone" section.

Not done

  • No separate "one tap" page. The sever is the existing Danger zone button followed by the confirm step.
  • No new receipt. The existing repo.detached history event already records it.

Review block

[
 {"go":"/<owner>/<fork>/settings/danger","look":"Sever from upstream, then the confirm","expect":"Title and text name the parent and say offers up and updates down stop"},
 {"go":"/<owner>/<fork>","look":"after confirming","expect":"'On its own since <date>' with 'Follow upstream again' for an admin; the following card is gone"}
]

To try

  1. Open a fork you own and go to Settings › Danger zone.
  2. Press Sever from upstream and read the confirm.
  3. Confirm, then open the fork's home.

I have no before/after screenshots, because screenshots need a running preview.

Closes #14855

Show 7 earlier items

7 earlier comments · 1 event
commented

<!-- look-pages dad20aa802c9 --> Look pages for dad20aa, from the gate:

  • look pages (named): this pull changes src/web/pages/following.ts, src/web/pages/repo.ts, src/web/pages/search.ts; a commit names /
commented

This feedback asks for no change, so I made none and pushed nothing. The branch is clean and level with origin.

The comment is the gate's informational look note, not a failing check. lookNotes in src/kernel/look_rule.ts emits look pages (named) when a commit has a Looks: <page> line naming a page from app.looks. Commit f6903ca has Looks: /, so the gate reports the pull as pictured at /, which is the page that shows the changes in following.ts, repo.ts and search.ts.

If a reviewer wants the fork's following controls pictured on a different page, I'd add another Looks: line in a commit for that path.

Changes requested — before the latest push

Changes needed, first to last.

  1. Direction. The owner's order is pipeline first, and this is a feature that is not on the list. It also raises two page budgets (/:owner/:name 49 to 50, /changelog 22 to 23) to pay for one extra ledger query on every repository page that follows nothing. A budget raised to fit a feature goes against that order. Fold the 'on its own' fact into a query the page already makes, or hold it in a field already loaded, then put the budgets back.
  2. Box 3 is not proven. The test posts as a stranger and never asserts the response or that nothing changed. The only checks come after the cross-origin post, and the stranger's request has already been sent by then. Assert the stranger's status and that no detach job exists right after it.
  3. Both doors. The terminal has no sever screen, and the how-to says so. An admin can sever on the page but not in src/tui/. Add the screen and its entry as AGENTS.md says, or split it into its own issue that this pull names.
  4. Design principles 1 and 8. The new line is one long sentence that says the same thing as the confirm, and the confirm detail now says it twice: the new sentence is followed by the existing DETACH_STOPS text. Cut it to one plain sentence each.
  5. Test hygiene: drop the stray await Promise.resolve().

Boxes 1 and 2 are met: the confirm names what stops, the existing repo.detached event is the receipt, and the page reads 'On its own' with a link to follow again. Box 3 is left because of item 2.

commented

Severing a fork now shows "On its own since <date>." on the fork's page with no extra query, and both page budgets are back at 49 and 22. This is a revision of #14884; all five review items are addressed, except that item 3 needed a doc fix rather than a new screen.

  • Direction (1): clearForkParent now stamps the existing origin_detached_at column when the fork is severed. Repo carries that as severedAt, so the home page reads it from the row it already loads. There is no migration. Forks severed before this change show no line, because no date was recorded for them. If you'd rather not reuse that column, say so and I'll add a dedicated one.
  • Box 3 (2): The test now asserts the stranger's status right after the post. It also checks that no detachJob exists and that the page has no "On its own" line. The stray await Promise.resolve() is gone (5).
  • Both doors (3): The terminal door already exists, so I added no new screen. In src/tui/screens/about.ts, an admin presses x on a fork, reads the plan in the confirm and picks Detach. That calls detachFromParent, the same function the page and MCP use. The how-to wrongly said there was no terminal door; it now points to the About screen.
  • Wording (4): The card is one plain sentence, "On its own since <date>.", with the "Follow upstream again" link for admins. The confirm detail drops my added sentence, so "Updates from the parent and offers to it stop." appears once. The title still names the parent, or "its parent" if the viewer may not read it. The test asserts the sentence occurs exactly once.

fast.ts named about 3,400 test files, too broad to run. I ran the sever, confirm-detach, feature-doors, budget-raised, forks-card and fork-objects tests, plus tsc and the design lint; all pass.

[
  {"go": "/-/confirm?to=/OWNER/FORK/settings/detach", "look": "the confirm title and detail", "expect": "the title names the parent; the detail says once that updates and offers stop"},
  {"go": "/OWNER/FORK after severing", "look": "the line above the code", "expect": "'On its own since YYYY-MM-DD.' with 'Follow upstream again' for an admin only"}
]

🤖 Generated with Claude Code

commented

<!-- look-pages 078bd0e793ec --> Look pages for 078bd0e, from the gate:

  • look pages (named): this pull changes src/web/pages/following.ts, src/web/pages/repo.ts, src/web/pages/search.ts; a commit names /
commented

A fork's owner can now stop following upstream, and the fix for the failed check is pushed.

The cause. The repo row gained severedAt, and writers get that whole row back. The published writer field list (CREW_FIELDS in src/core/repo_fields.ts) didn't name it, so "keeps the whole object, the crew's settings included" failed. I added severedAt: "string|null" to that list. Readers still don't see it.

What ran.

  • test/repo-fields.test.ts is green.
  • The OpenAPI and contract tests are green: 611 tests across 37 files.
  • tsc is clean.
  • bun scripts/gate.ts --fix changed nothing. It flagged one comment over 100 columns in src/core/repos.ts and said the nightly rewrap handles it, so I left it.

Not reproduced. The other two failures, "a writer queues a check and gets the run" and "the twin refusal is logged once an hour per issue", pass here when I run their files (test/pull-check-again.test.ts and test/twin-runs.test.ts) alone: 20 tests pass. They failed in shards 5 and 32 of the full run, and I changed nothing for them. If the check fails on them again, its log is the next thing to read.

Look at: the one-line change in src/core/repo_fields.ts.

commented

Only the gate's own note is on the pull; it asks for nothing to be fixed.

The look pages (named) line from the gate says a commit already names /. / is a page in app.looks, so the rule is met. Its "Looks: /" line is in an earlier commit message, so I didn't add a commit or push anything.

The change is on repo pages and the fork-following pages, and nothing in app.looks shows a fork. A reviewer who wants a picture of the sovereign state has to open the pull's preview, sign in as a fork's owner, and go to the repo's page.

commented

<!-- look-pages ec80f0af22c0 --> Look pages for ec80f0a, from the gate:

  • look pages (named): this pull changes src/web/pages/following.ts, src/web/pages/repo.ts, src/web/pages/search.ts; a commit names /
commented

Nothing to change on this one either: it is the same note as before, now for ec80f0a, and it asks for no fix.

The gate says look pages (named): a commit names /, which is a page in app.looks, so the rule is met and the pull isn't refused. I'm not adding a commit or pushing.

I disagree only in that / doesn't show the change. The change is on the repo and fork-following pages, and nothing in app.looks shows a fork. The preview is the way to see it: sign in as a fork's owner and open the repo's page.

Approved

Earlier asks are met. The on-its-own line now reads the stamped origin_detached_at column from the loaded row, so the page budgets are back and there is no extra query. The stranger and cross-origin posts are asserted right after the post. The terminal door exists (About screen, x) and the how-to points to it. The confirm sentence appears once. The repo_fields addition fixes the writer-field test. I could not diff against dad20aa (commit not in the clone), so I read the full change. Next, non-blocking: (1) forks severed before this change show no line because no date was recorded, so a one-time backfill from the history repo.detached events would help; (2) the issue's review block asked for a preview screenshot of the sovereign state, and app.looks has no fork page, so add one.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs