Public: anyone can read this; the crew can change it.
A backup card for branches whose commits are missing links each branch to its delete, so the repository's owner settles it in one confirmed tap #12618
Check · Review · Land · Live done — Landed and live in production.
A snapshot that leaves out branches whose commits are missing now raises a card you can act on (#12612). Each branch is a link to its own row on the repository's branches page, where the existing confirmed delete already is.
shipped production is serving it deploy e5f3b40
7 earlier comments · 2 events
A snapshot that leaves out branches whose commits are missing now raises a card that names each of those branches as a link. Each link goes to that branch's row on the repository's branches page (#12612), where the existing confirmed delete already is.
What changed
- In
src/snapshot/outcome.ts,leftOutNeedsnow gives thebackup-refs:<repo>card one more sentence, saying how to settle it and who can (the repository's owner or a writer). The card links to the branches page instead of the repository, and it carries one link per branch to/<owner>/<repo>/branches#branch-<name>, with the name encoded in the URL. src/kernel/vitals.tsandsrc/actions/health.tspass the repository and the links through as optional fields.- A new module,
src/web/need_links.ts, prints the links on the board's forge strip and on the forge card on/asks. Branch names go through the escapinghtmltemplate.
- The viewer is checked with canWrite. A site admin who is neither the owner nor a writer sees "You are not <repo> owner or a writer: ask one of them."
- A card with links is printed as a sentence followed by its links, because a link cannot sit inside another link.
- In
src/web/pages/branches.ts, each branch row hasid="branch-<name>"so a link's fragment lands on it. - Nothing is deleted automatically; the delete stays the existing confirmed action on the branches page.
- The latest push rewraps five comment lines in these modules to 100 columns. The forge's check had failed on that gate rule; the preview deploy itself was fine. The commit message now has a
Looks: /boardline, which the gate also asks for.
Tests
test/snapshot-repositories.test.tscovers:
- branch names with special characters (a<b, x&y"z) giving encoded links and escaped <a> elements;
- the "not the owner or a writer" line showing only to a viewer who cannot act;
- the card linking to the branches page.
- The existing test's exact sentence was updated because the wording changed on purpose.
Checks run here
bun scripts/gate.tsandbun x tsc --noEmitpass.- In
test/snapshot-repositories.test.ts, 11 tests pass and 2 fail: the two snapshot-encryption tests. They connect to a local storage stub on 127.0.0.1, which this sandbox blocks, so they cannot pass here; the forge's check runs them. - The
snapshots"restore drill failed to run" line at the end of the deploy log comes from code this pull does not touch. The preview has no snapshot store to restore from, so the drill has nothing to read;/healthzon the preview answersok.
Try it: as a site admin, with a snapshot that left out a branch, open /board or /asks and follow a branch's link to its row on the branches page.
🤖 Generated with Claude Code
When a backup leaves out branches, the snapshot outcome now lists them by repository. The /board card and the /asks card link each one to its row on the branches page and say who can settle it.
Fixing the red check. Of the two test files counted against this pull, test/boundary-tokens-follow.test.ts was changed on main after this branch was cut. The change was b9d6538d7: a child's read credential now lasts a week at a time and is renewed while the child follows. test/quotas.test.ts was not changed on main. This branch now merges main up to dc5d1c0, so the check runs main's newer versions. Neither file touches anything this pull changes. Both pass here, before the merge and after it, including when run in one process with test/ask-to-reach.test.ts, which failed in the same shard. Since I couldn't make either fail locally, I can't say for sure that the merge is the fix. The forge's check on this push is the real test.
The other five files the check named (apps-open-host, apps-ws, check-install, ask-to-reach, release-handover-keepalive) are red on main too and this pull leaves them alone.
What to look at:
src/snapshot/outcome.ts: groups the left-out branches by repository.src/web/need_links.ts: builds the link to each branch's row.src/web/pages/board.ts,src/web/studio/asks_page.ts: the two cards that render them.src/web/pages/branches.ts: the row the links land on.src/actions/health.ts,src/kernel/vitals.ts: carry the list through to the cards.
Checks run: bun scripts/gate.ts, bun x tsc --noEmit and bun scripts/design-lint.ts pass. scripts/fast.ts named 2292 test files after the merge, far over its budget. Instead I ran the tests for the changed modules (snapshot, outcome, health, vitals, board, branches) and the two files above: 150 pass, 0 fail.
Try it: as a site admin, with a snapshot that left out a branch, open /board or /asks and follow a branch's link to its row on the branches page.
🤖 Generated with Claude Code
When a backup leaves out branches whose commits are missing, it now raises a card you can act on (#12612). On /board and /asks, the card links each branch to its own row on the repository's branches page. It also says who can settle it: the repository's owner or a writer.
The backup card
src/snapshot/outcome.ts(leftOutNeeds) adds the sentence and one link per branch to thebackup-refs:<repo>card. The branch name is encoded in the URL.src/kernel/vitals.tsandsrc/actions/health.tspass the repository and the links through.src/web/need_links.tsprints the links for both cards, escaped. It usescanWriteto tell a site admin who is neither owner nor writer to ask one of them.src/web/pages/branches.tsgives each row an anchor so the links land on it.
A leak between test files that made earlier checks red
- Cause:
test/ask-to-reach.test.tsput a missingFORGE_PARENT_LOCALback as"".cellProxy(src/apps/egress.ts) read any defined value as "this forge runs in a cell". On the check machine,HTTPS_PROXYis a loopback address, so every latervetHostin the same process went "via the gate" and skipped the private-address check. - Effect:
mirror-outbound,boundary-tokens-followandorigin-aheadfailed only when they shared a shard withask-to-reach. - Fix:
cellProxynow treats an empty door as no door, asspawn/heartbeat.tsalready does.ask-to-reachnow deletes the variable when it wasn't there before;boundary-outbound.test.tsalready does this. - New test: one in
test/egress-upstream.test.tsthat fails without thecellProxychange. - Not fixed here: the
ask-to-reachtests are red on main and stay red here, the same tests in the same way.
Checks: bun scripts/gate.ts, bun x tsc --noEmit and bun scripts/design-lint.ts pass.
HTTPS_PROXY=http://127.0.0.1:9reproduces the check's red locally. With it set,bun testonask-to-reach,mirror-outbound,boundary-tokens-followandorigin-aheadfails onlyask-to-reach's six tests, which fail on main too.- Main is merged in, and the tests for the card's modules pass.
- Five tests that need an outbound gate fail in my sandbox, with or without this change, and the forge's check doesn't report any of them. They are four in
outbound-gateandboundary-outbound, and one inspawn-gate-e2e.
Try it: as a site admin, with a snapshot that left out a branch, open /board or /asks and follow a branch's link to its row on the branches page.
🤖 Generated with Claude Code
When a backup leaves out branches whose commits are missing, the card on /board and /asks now links each branch to its own row on the repository's branches page (#12612). The card ends with one line saying how to settle it: "Re-push each from a clone that still has its commits, or delete it on the branches page; the repository's owner or a writer can." A site admin who is neither is told to ask one of them.
What changed
src/snapshot/outcome.ts(leftOutNeeds) adds the settle line (SETTLE) and one link per branch, to/<owner>/<repo>/branches#branch-<name>, with the name encoded.src/kernel/vitals.tsandsrc/actions/health.tspass the repository and the links through to the cards.src/web/need_links.tsprints the links on both cards, escaped, and usescanWriteto decide whether the viewer may settle it.src/web/pages/branches.tsgives each row the anchor the links land on.
Merging main
- Main (#12590) had already sent the card to the branches page and added its repository. It ended the sentence with "Delete it on its Branches page."
- The merge keeps main's link and repository field, and this pull's settle line and per-branch links, since the settle line already says to delete.
docs/features/backup-refs.md(from main) now quotes the kept sentence and mentions the per-branch links.- Main added a test expecting its own last sentence. I changed it to check that one branch reads "1 branch" and that the sentence ends with
SETTLE.
Test isolation fix
test/ask-to-reach.test.tsrestored a missingFORGE_PARENT_LOCALas"", andcellProxy(src/apps/egress.ts) treated any defined value as "running in a cell".- On the check machine, whose
HTTPS_PROXYis a loopback address, every latervetHostin the same process then skipped the private-address check. That mademirror-outbound,boundary-tokens-followandorigin-aheadfail whenever they shared a shard with it. cellProxynow treats an empty value as unset, andask-to-reachdeletes the variable. A new test intest/egress-upstream.test.tsfails without thecellProxychange.ask-to-reach's own six tests are red on main too and stay red here.
Checks
bun scripts/gate.ts,bun x tsc --noEmitandbun scripts/design-lint.tspass.- The tests for the snapshot, vitals, health, board, branches and egress modules pass.
- Running
ask-to-reachand the three affected files together withHTTPS_PROXY=http://127.0.0.1:9, onlyask-to-reach's own tests fail. - Five tests that need a real outbound gate fail in this sandbox with or without this change: four in
outbound-gateandboundary-outbound, and one inspawn-gate-e2e. The forge's check did not report them.
Try it: as a site admin, with a snapshot that left out a branch, open /board or /asks and follow a branch's link to its row on the branches page.
🤖 Generated with Claude Code
A backup card for branches whose commits are missing now links each branch to its row on the branches page and says who can settle it (#12612). Its check failed because the forge tests the pull merged onto the newest main, which is red from the move to Bun 1.4.4 and from a stale baseline. This push merges main and fixes the failures that one cause explains.
The pull's own change
src/snapshot/outcome.tsandsrc/kernel/vitals.tsgive each "left out of the snapshot" card its repository and a link per broken branch.src/actions/health.tscarries those links through, andsrc/web/pages/board.tsandsrc/web/studio/asks_page.tsrender them viasrc/web/need_links.ts.cellProxyno longer treats an emptyFORGE_PARENT_LOCALas a cell, so one test leaving it as""can't send every later connection in its shard through a gate.
Fixes for main's Bun 1.4.4 failures
- Refused CONNECT (
src/kernel/outbound.ts): Bun 1.4.4 now throwsERR_PROXY_TUNNELwhen a proxy refuses a CONNECT, and the gate's body is lost.outboundFetchreads the refusal from the error's status and headers instead. - Unresolved names (
src/apps/egress.ts):refusedStatusnow also puts "<name> does not resolve" in the status phrase. That keeps "unresolved host" separate from "the gate refuses" without the body. - Test gate (
test/helpers/gate-fixture.ts): the fake gate now answers the way the real one does. It used to say only403 Refused. - Malformed Host (
src/http/server.ts): on 1.4.4,request.urlis only the path when the Host can't be a host, so everynew URL(request.url)threw and the forge answered 500.ownUrlgives only such requests the forge's own origin; every other request keeps Bun's own object. - Stale baseline (
test/module-state.baseline.txt): droppedsrc/crew/ceiling_stagger.ts:memo, which names a file main deleted.
Tests changed
test/egress-refused.test.tsgains a case for the unresolved status phrase.test/helpers/gate-fixture.tswas wrong in a way that hid the 1.4.4 behaviour.- The baseline file named state that no longer exists.
Still red, filed as #12727: test/release-handover-keepalive.test.ts and one test in test/apps-ws.test.ts. Both are 1.4.4 behaviour changes outside this pull, and each fails alone on main. The check-install failure is already tracked as #12716.
Verified locally, with the proxy variables unset as on the check host: bun scripts/gate.ts and bun x tsc --noEmit are clean, and these files pass: outbound-gate, egress-refused, ask-to-reach, spawn-gate-e2e, apps-open-host, module-state, egress-upstream, snapshot-repositories, crew-proposal. crew-proposal passes alone but hit a 50 s timeout once when run with the other files here; that looks like sandbox load, so the forge's check is the real verdict on it. One stray full-suite run was started by mistake in my sandbox; it has no effect on the branch.
To try it: as a site admin, with a snapshot that left out a branch, open /board or /asks and follow a branch's link to its row on the branches page.
🤖 Generated with Claude Code
The card itself does what the issue asks, but this pull is not single-purpose and has gaps in the tests and the terminal.
- Fix first: split out everything unrelated to #12612 into its own pulls. That is src/http/server.ts (ownUrl), src/kernel/outbound.ts, src/apps/egress.ts (refusedStatus and cellProxy), test/helpers/gate-fixture.ts, test/module-state.baseline.txt, test/ask-to-reach.test.ts, test/egress-*.test.ts. The direction is pipeline first with small single-purpose pulls. A Bun 1.4 fix that rewrites request URL handling and the egress gate's refusal path should be reviewed on its own, not hidden under a backup-card pull.
- Both doors: the terminal has no way to reach the branch links or the who-can-act line. Add the screen or entry in src/tui/ that AGENTS.md names for forge needs, gated as the page is.
- Tests: nothing asserts that branchRow renders id="branch-<name>" so the link lands, and nothing renders board or /asks with a non-writer admin. Add both.
- The settle sentence says it twice (the card sentence and then 'You are not ... ask one of them'). Trim it to one plain sentence (DESIGN 1, 8).
No security hole found in the card: names are escaped by html and encoded in URLs, and nothing is deleted.
When the last snapshot leaves out branches whose commits are missing, the backup card shows each branch as a link to its row on the repository's branches page. The confirmed delete is on that row, so the repository's owner settles each branch from there in one confirmed tap. Nothing is deleted for them. The card sentence says, once, how to settle it and who can: "Re-push each from a clone that still has its commits, or delete it on the branches page; the repository's owner or a writer can."
What changed after review:
- Split out: the Bun 1.4 changes are taken back to main's version and leave this pull:
ownUrlinsrc/http/server.ts,src/kernel/outbound.ts, the egress gate's refusal and cell proxy insrc/apps/egress.ts,test/helpers/gate-fixture.ts,test/module-state.baseline.txt,test/ask-to-reach.test.tsandtest/egress-*.test.ts. They need their own pull. If the check fails on Bun 1.4 again, that pull is the fix. - Said once: the second sentence ("You are not … ask one of them") is gone, and
canSettlewith it.src/web/need_links.tsnow only renders the links; the board and/askscall it with the need alone. - Terminal: the dashboard's forge strip (
src/tui/screens/dashboard.ts) now builds its lines withneedTermLine(src/actions/health.ts). A broken-branch line ends "In the terminal: open <repo>, press b.", which opens the branch list with its confirmed delete. The strip shows only to site admins, as the page does. Other needs read as before. - Tests:
test/backup-card-pages.test.tssigns in a site admin who neither owns nor writesalice/notes. It checks that:
- /board and /asks carry <a href="/alice/notes/branches#branch-lost">lost</a> and the sentence exactly once, without the old second sentence;
- /alice/notes/branches renders <li id="branch-lost">;
- the terminal line has its hint, and the strip is withheld from someone who is not an admin.
I changed the escaping test in test/snapshot-repositories.test.ts because it asserted the removed sentence; the test was right before, but the behaviour it checked is gone.
Not done: a non-writer site admin still sees the links and follows them to a page whose delete they cannot use. The sentence tells them who can act, so a second note would repeat it, which is what the review asked to remove.
Checks run: bun scripts/gate.ts, bun x tsc --noEmit and bun scripts/design-lint.ts pass. scripts/fast.ts named 2304 files, too broad to run here, so I picked 31 covering files (asks, board, branches, snapshot, health and the terminal): 263 pass, 0 fail.
To try it: sign in as a site admin on the preview, with a snapshot outcome that names a broken branch. Open /board or /asks and follow a branch's link to its row on the branches page. In the terminal, read the dashboard's forge strip, open the repository and press b.
🤖 Generated with Claude Code
The card works: each branch links to its row, the row has the id, the sentence says once who can act, nothing is deleted, and the terminal strip points at b. One box is missed, and the docs now say something the code does not do.
Fix first: issue box 2 says the line 'says plainly when the viewer is not one of them'. The head removed that and left only the generic 'the repository's owner or a writer can'. A site admin who is neither the owner nor a writer follows a link to a branches page whose delete is not theirs, and the card never says 'that is not you'. Say it for the viewer who cannot act, without repeating the settle sentence (keep it one short clause, e.g. 'You cannot delete here: ask the owner or a writer.'), on /board, /asks and the terminal line. Add a test that renders it for a non-writer admin and shows it is absent for the owner or a writer.
Also: docs/features/backup-refs.md still says 'An admin who is neither is told to ask one of them.' That is false at this head. Either the fix above makes it true or the sentence goes.
Smaller: the terminal test only calls needTermLine; nothing renders the dashboard strip. DESIGN 1 and 8 are met by the settle sentence, which is plain.
A broken branch's backup card, on /board, /asks and the terminal's forge strip, links each branch to its own row on the repository's branches page (#branch-<name>). The confirmed delete is on that row. The card says once who can settle it, and the terminal line adds In the terminal: open owner/name, press b. Nothing is deleted for anyone.
Review response (#12612), with one disagreement. I didn't add the clause "You cannot delete here: ask the owner or a writer." It would be false for everyone who can see the card:
- Only site admins see the card (
forgeNeedListand the board's forge notes check for an admin first). - A site admin writes every repository:
personalOrDirectinsrc/core/repos.ts:1122acceptsuser.isAdmin. - That rule reaches both
canWriteand the branch delete'srequireWriter(src/actions/access.ts:52), so the admin who reads the card gets the Delete on that row, and the delete accepts them.
So the clause could never be true for anyone it would be shown to. I tried it first, gated on canWrite, and the "non-writer admin" case never fired. Instead:
- Docs: the false sentence in
docs/features/backup-refs.mdis gone. It now says the admin reading the card can press Delete too. - The premise is tested:
test/backup-card-pages.test.tschecks that an admin who is not the owner getsDelete branch loston/alice/notes/branchesand thatdeleteBranchaccepts them. If admins ever lose write access to every repository, those tests fail, and that is when the clause would be needed. - The strip is rendered: a new test draws
dashboardScreenon a headless terminal and finds the card with itspress bline. Before, the test only calledneedTermLine.
Checks run: bun scripts/gate.ts, bun x tsc --noEmit, test/backup-card-pages.test.ts (7 pass) and test/snapshot-repositories.test.ts. scripts/fast.ts named 2304 files for the whole branch, so I ran only the tests that cover this commit (a test and a doc); the forge's check runs the rest.
To try it: on the preview, sign in as a site admin, record a snapshot outcome with a broken ref in a repository you don't own, then follow the branch link from /board or /asks to its row and its Delete.
I found no prompt injection in the review or the repository.
🤖 Generated with Claude Code
The backup card now appears on every page that names a forge need, each with the delete action its reader may take. This push also fixes the one red in the last check that belonged to this pull.
The red test: test/tui-delete-repo.test.ts failed in the check but passes on main and locally. The cause is in src/tui/screens/deleterepo.ts: the delete prompt starts the delete after it closes, and nothing marked that work as running. So the test's wait for the app to go quiet could finish before deleteRepo and leaveRepo were done, and on a loaded check machine it did. The delete is now passed through ctx.track, so the app counts as busy until the repository's screens have unwound. To confirm the cause, I added a temporary 300 ms delay before the delete: without the fix, both delete tests failed; with it, all 6 pass. No test was changed.
The other failures: the check found those test files red on main at f214e2d too (check-install, release-handover-keepalive, apps-open-host, ask-to-reach) and didn't count them against this pull. The 60 s idle-previews timeout is on that slow list as well.
Checks run locally: bun scripts/gate.ts and bun x tsc --noEmit are clean, and test/tui-delete-repo.test.ts, test/tui-transfer-repo.test.ts and test/backup-card-pages.test.ts pass (17 tests). bun scripts/fast.ts named 2306 files for this branch's diff, which is over its budget, so I picked the covering tests by hand. I added no test that slows the delete down on purpose, so a regression would show up only as the same flaky failure.
🤖 Generated with Claude Code
Earlier asks: split out the Bun 1.4 changes - met, none remain in the diff. Terminal door - met: needTermLine on the dashboard strip, admin-gated as the page is, and rendered in a test. id=branch-<name> and the non-writer-admin case - met: tests render the row and sign in an admin who is neither owner nor writer. Said once - met: one SETTLE sentence, pinned by tests on /board and /asks. The doc is in docs/features/backup-refs.md, not README. The links are escaped and URL-encoded, nothing is deleted, and the delete stays the confirmed action.
Two things I would do next: (1) move the ctx.track fix in deleterepo.ts to its own pull, since it is unrelated to the card; (2) add a :target highlight on the branch row so the landing is visible on a phone.
Box 2: the card is only shown to site admins, who write every repository, and the test pins that premise, so there is no viewer the card is shown to who is barred; the sentence names who can act.
A snapshot that leaves out branches whose commits are missing now raises a card you can act on (#12612). Each branch is a link to its own row on the repository's branches page, where the existing confirmed delete already is.
What changed
leftOutNeeds(src/snapshot/outcome.ts): thebackup-refs:<repo>card adds one line: "Re-push each from a clone that still has its commits, or delete it on the branches page; the repository's owner or a writer can." The card also carries one link per branch, to/<owner>/<repo>/branches#branch-<name>, with the name encoded in the URL. The card itself now goes to the branches page instead of the repository.src/kernel/vitals.ts,src/actions/health.ts) pass the repository and the links through as optional fields.src/web/need_links.tsprints the links for both the board's forge strip and the forge card on/asks. The branch names go through the escapinghtmltemplate. It checks the viewer withcanWrite, so a site admin who is neither the owner nor a writer sees "You are not <repo> owner or a writer: ask one of them." A card with links is printed as a sentence followed by the links, not as one big link, because links cannot sit inside a link.src/web/pages/branches.ts: each branch row hasid="branch-<name>"so the link's fragment lands on it. This is the only change to that page.Tests (
test/snapshot-repositories.test.ts)a<bandx&y"zgive two links with encoded URLs, and two escaped<a>elements when rendered.Checks run
/asksand vitals.scripts/fast.tsnamed 2,290 files, too many to run here, so I chose these.Left out
:targethighlight on the branch row.keep_plantool in this session.Try it: as a site admin, with a snapshot that left out a branch, open
/boardor/asksand follow a branch's link to its row on/<owner>/<repo>/branches.🤖 Generated with Claude Code
Closes #12612