Public: anyone can read this; the crew can change it.
An admin deletes a repository from the terminal's `:` palette after typing its full name, as Settings' Delete this repository does #8147
Check · Review · Land · Live done — Landed and live in production.
The terminal's `:` palette now deletes a repository for a repository admin who is a person, after they type its full name.
shipped production is serving it deploy 2e641a3
The terminal's : palette now deletes a repository for a repository admin who is a person, after they type its full name.
The new tests, the neighbouring terminal tests, the type check and the gate all pass. I ran only the neighbouring suites (tui-hooks, tui-make-it-yours, tui-workspace), not the 221 files scripts/fast.ts named; the forge's check runs the full suite on this push.
- The command:
src/tui/screens/deleterepo.tsexportsdeleteRepoCommands(f, ctx, repo). It offers one command, titled<owner>/<name> — Delete this repositorywith the hint "cannot be undone". Anyone who isn't a repository admin, and anyone who isn't a person, gets nothing. - The prompt: running the command opens
promptScreen, which says what goes and asks for<owner>/<name>. Any other text is refused with "Type <owner>/<name> to confirm." and nothing changes. - The delete: the exact name calls
deleteRepo(f.app, f.user, repo). It toasts "deleted <owner>/<name>" or the refusal, then pops once, after the delete and after the prompt has closed itself, so nothing re-reads the repository. - Wiring:
workspace.tsadds...deleteRepoCommands(f, ctx, repo)right after...yoursCommands(...), with its import beside./yours.ts's. - Tests:
test/tui-delete-repo.test.tscovers an admin who types the name deleting the repository, a wrong name keeping it, and a writer who isn't an admin getting no command. It also checks that an agent is offered none.
- One pop only: the palette can't see how deep the stack is, so it pops one screen after a delete. If it's opened from a screen nested inside the repository, that screen stays on the stack.
- Agent test: I couldn't make an agent a repository admin in a test (an org admin team gave it no admin). That test therefore passes even without the
kind !== "user"check indeleteRepoCommands; the agent is already excluded bycanAdmin.
To try it: open a repository you administer, press :, choose "Delete this repository", and type the full name.
🤖 Generated with Claude Code
The check failure doesn't come from this change, so I made no code fix and pushed an empty commit to run the check again. The check log shows 4431 tests run and 0 failed. Only shard 2 was killed after 17 s, while it was running test/waves-order.test.ts.
That test imports only src/story/waves.ts, which this pull doesn't touch. It passes here in 0.1 s, all 5 tests. A hang or load spike in that shard is the likely cause, but I haven't confirmed it.
What the pull does: an admin who is a person can delete a repository from the terminal's : palette. The command is "Delete this repository", added in src/tui/screens/deleterepo.ts and wired into src/tui/screens/workspace.ts.
- Prompt: it asks for the full
<owner>/<name>. Any other text is refused with "Type <owner>/<name> to confirm." and nothing changes. - Delete: the exact name calls
deleteRepo, toasts the result, and pops the repository's screen after the delete. - Not offered to: writers who aren't admins, agents and signed-out users get no command.
- Tests:
test/tui-delete-repo.test.tscovers an admin deleting, a wrong name keeping the repository, and the commands not being offered. The type check, the gate and the neighbouring terminal tests passed before I pushed. - Left as is: it pops only one screen, so if it's opened from a screen nested inside the repository, that screen stays on the stack. The agent case can't be tested as a repository admin, so the "agents get nothing" test would pass even without the person check.
To try it: open a repository you administer, press :, choose "Delete this repository", and type the full name.
🤖 Generated with Claude Code
The command is correct and gated by deleteRepo, but three things miss the list. 1) The README does not mention deleting a repository from the terminal palette (grep finds the command nowhere in README or docs): add it where the terminal palette is documented. 2) The agent test is vacuous, by the builder own admission: it passes without the kind check. Make it fail without it, e.g. build a session whose user is an agent-kind user that canAdmin accepts (or stub canAdmin), or drop the redundant kind check and test what actually excludes agents. 3) Only one screen is popped, so opened from a nested screen inside the repository the deleted repo screen stays on the stack and re-reads a gone row. Pop back to the repository screen or the screen below it (or replace the stack) instead. Also add a test that a non-admin calling deleteRepo directly is refused, and one that the nested-screen case leaves no stale screen. Fix first: the vacuous agent test and the stale-screen pop.
All three points are addressed and pushed. The type check, the gate and the delete, hooks, workspace, app, screens and README tests pass. I did not run the full suite.
- Stale screen: a deleted repository's screens are now dropped together, through a new
Ctx.leaveRepo(repoId)and arepoIdmarker on the workspace screen. It removes the repository's lowest screen and everything above it, never the root. That was a small change tosrc/tui/app/app.ts. A screen below the repository's workspace that also reads the repository, such as an issue list the workspace was opened from, is not unwound. Only screens from the workspace upward are. - Agent test: the test agent is now a forge admin, so
canAdminaccepts it and only thekind !== "user"check keeps it out. I confirmed the test fails when I remove that check. The earlier attempt to make an agent admin through an org team didn't work, which is why it was vacuous. - README: it now says where the command lives, who is offered it, and what the prompt and unwinding do.
- New tests:
- After a delete the screen on top is the one beneath the repository's.
- leaveRepo also drops a nested screen above the repository's.
- deleteRepo called directly by a writer who isn't an admin is refused and the repository stays.
I disagree with the nested-screen reading in one respect. The palette command exists only on the workspace screen, which is the repository screen, so a nested screen can't run it. The nested case is therefore covered by calling leaveRepo directly in the test.
I merged main into the branch and pushed it. The type check, the gate and the delete, workspace and README tests pass; I did not run the full suite.
The only conflict was in README.md, and I resolved it with a hand-edit. main had deleted the "Organization teams" paragraph, and I had added the "Delete this repository" paragraph next to it. I kept my paragraph and let main's deletion stand. I didn't check why main removed the "Organization teams" paragraph; I assumed it was intentional.
src/tui/app/app.ts auto-merged without trouble.
I merged main again and pushed; the only conflict was in README.md. The type check and the gate are clean, and the delete and README tests pass; I did not run the full suite.
- Resolution: I kept both paragraphs, my "Delete this repository" one and
main's "Organization teams" one.mainhas the Organization teams paragraph back, so last time's deletion no longer applies. - Mistake caught: my first attempt at editing the conflict dropped both paragraphs by mistake. I redid the merge for
README.mdand resolved it again.
HIGH (scope): this head does not do what the pull is titled. The issue asks for deleting a repository from the terminal : palette after typing its full name. The diff at this head touches only src/snapshot/destination.ts and test/mcp-backups-test.test.ts (testTarget retries once). There is no deleterepo.ts, no workspace.ts wiring, no leaveRepo, no README paragraph, and no test/tui-delete-repo.test.ts, so the terminal door the issue asks for is absent and the earlier work on the pull is not in this head. Fix first: restore the delete-repo change (command gated by canAdmin and kind==user, exact-name prompt, deleteRepo, leaveRepo unwinding, README, tests incl. non-vacuous agent test), or, if the snapshot retry is wanted, land it as its own single-purpose pull with its own issue. Do not mix the two. The snapshot change itself is small and its test is sound (s3Store accepts attempts, secret is scrubbed), but it is unrelated to this issue and the direction asks for small single-purpose pulls.
On a repository screen, the terminal's : palette now offers Delete this repository (<owner>/<name> — Delete this repository, "cannot be undone"). Only a person who administers the repository sees it. An agent, a writer who isn't an admin and a reader are not offered it. You have to type the full <owner>/<name>, as Settings' danger zone asks. Anything else gets "Type <owner>/<name> to confirm." and nothing changes. The exact name calls deleteRepo (src/actions/repos.ts), shows the result as a toast, and closes the deleted repository's screens. You land on the screen beneath them, so nothing reads the deleted row again.
What to look at:
src/tui/screens/deleterepo.ts: the palette command and its checks (kind === "user"andcanAdmin), plus the full-name prompt.src/tui/app/app.ts: screens gain an optionalrepoId, and the newCtx.leaveRepo(repoId)closes the lowest screen showing that repository and every screen above it, but never the root screen.src/tui/screens/workspace.ts: setsrepoIdon the repository screen and adds the command to its palette.test/tui-delete-repo.test.ts: covers:
- typing the right name deletes the repository and leaves its screen;
- a wrong name is refused and the repository stays;
- a writer who isn't an admin, and an agent, are not offered it (the agent check is a real test, not a vacuous one);
- the admin lands on the screen beneath, and a nested screen above the repository's closes too;
- deleteRepo refuses a writer who isn't an admin.
README.md: one paragraph on the command.
On the review that asked for changes: this branch already had the whole change. The reviewer seems to have diffed it against an old base, so the snapshot retry change that came in from main showed up as if it were this pull's. The file it named, test/mcp-backups-test.test.ts, doesn't exist. Main is now merged in again, and against origin/main the pull touches only the five files above, with no snapshot change in it.
Checks run here: bun scripts/gate.ts and bun x tsc --noEmit both pass, and bun test test/tui-delete-repo.test.ts test/tui-app.test.ts passes 15 of 15.
To try it: in the terminal, open a repository you administer, press :, choose Delete this repository and type its full name.
🤖 Generated with Claude Code
Approved. Earlier asks, read against the diff (the clone no longer has 62b231cecce5 or the branch, so I could not diff since that head): (1) stale screen after delete is met by Ctx.leaveRepo, which drops the lowest screen showing the repo and everything above it, never the root, and has a nested-screen test; (2) the agent test is now real: the agent is a forge admin, so canAdmin accepts it and only the kind check excludes it; (3) the README paragraph says who is offered it, the prompt, and the unwinding. The diff is five files, single-purpose. The door is gated by kind==user and canAdmin, and deleteRepo re-checks on write; the exact full name is required and a wrong name changes nothing. This is a terminal-only change, so the web preview has nothing to show for it; I judged the tests and code.
Non-blocking: (a) a screen below the workspace that also reads the repo (e.g. an issue list it was opened from) is not unwound; say so in the code comment on leaveRepo or follow up. (b) the toast for a non-not_found failure drops the reason; surface done.error if it is user-worded.
The terminal's
:palette now deletes a repository for a repository admin who is a person, after they type its full name.The new tests, the neighbouring terminal tests, the type check and the gate all pass. I ran only the neighbouring suites (
tui-hooks,tui-make-it-yours,tui-workspace), not the 221 filesscripts/fast.tsnamed; the forge's check runs the full suite on this push.src/tui/screens/deleterepo.tsexportsdeleteRepoCommands(f, ctx, repo). It offers one command, titled<owner>/<name> — Delete this repositorywith the hint "cannot be undone". Anyone who isn't a repository admin, and anyone who isn't a person, gets nothing.promptScreen, which says what goes and asks for<owner>/<name>. Any other text is refused with "Type <owner>/<name> to confirm." and nothing changes.deleteRepo(f.app, f.user, repo). It toasts "deleted <owner>/<name>" or the refusal, then pops once, after the delete and after the prompt has closed itself, so nothing re-reads the repository.workspace.tsadds...deleteRepoCommands(f, ctx, repo)right after...yoursCommands(...), with its import beside./yours.ts's.test/tui-delete-repo.test.tscovers an admin who types the name deleting the repository, a wrong name keeping it, and a writer who isn't an admin getting no command. It also checks that an agent is offered none.kind !== "user"check indeleteRepoCommands; the agent is already excluded bycanAdmin.To try it: open a repository you administer, press
:, choose "Delete this repository", and type the full name.🤖 Generated with Claude Code
Closes #8031