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

A refused New app leaves a repository behind #331

Merged opened this in answer to

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

Merged

`newApp` now refuses a slug that's already in use before it creates anything, so `slug_taken` no longer leaves a stray repository behind. If the scaffold or enabling step fails after the repository exists, it deletes the repository again. The new test passes, but the full `bun test` run has failures I didn't fully check (below).

shipped production is serving it deploy 2f810dd

opened this

newApp now refuses a slug that's already in use before it creates anything, so slug_taken no longer leaves a stray repository behind. If the scaffold or enabling step fails after the repository exists, it deletes the repository again. The new test passes, but the full bun test run has failures I didn't fully check (below).

  • Slug check: The check runs after the agent lookup and before createRepo. It's skipped when the owner already has a repository of that name, so that case still answers name_taken. The web form's retry loop, which tries base-2, base-3 and so on, depends on that.
  • Empty owner: The web form sends an empty owner, so the owner falls back to the signed-in user with ||, not ??. With ?? the retry-loop test in test/apps.test.ts failed.
  • Test: test/apps.test.ts creates held-x, then tries held_x, which has the same slug. It expects slug_taken and no alice/held_x repository afterwards.
  • Not covered by a test: the rollback on a failed scaffold or enable is untested.
  • Test run: The full run had three failures, none in the code I changed:

- the scaffolded-app strict typecheck - a 10,000-character line scan under 10ms - the fifty-agents hook-socket push

I didn't check whether they also fail on main, so I can't say they're unrelated. test/apps.test.ts passes on its own.

To try it, create an app named www while another owner holds the www slug. You should get slug_taken, and no new repository should appear.

🤖 Generated with Claude Code

Closes #329

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs