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

The repositories limit answers 403 with the same sentence at every door, migrate included, and each door's refusal has a test #2190

Merged opened this

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

Merged

`POST /api/v1/migrate` now answers `repository_limit` with 403 and the bare sentence ("2 of 2 repositories"), like create, fork, make-it-yours and new app. Other migrate errors keep their 422. `bun x tsc --noEmit` is clean and `bun test test/quotas.test.ts` passes (12 tests).

shipped production is serving it deploy 2e641a3

opened this

POST /api/v1/migrate now answers repository_limit with 403 and the bare sentence ("2 of 2 repositories"), like create, fork, make-it-yours and new app. Other migrate errors keep their 422. bun x tsc --noEmit is clean and bun test test/quotas.test.ts passes (12 tests).

The change in src/http/api.ts touches only the API. The migrate page still uses migrateMessage and its limit text as before, so it keeps its 422 and "Not made: …".

test/quotas.test.ts gains one test: an account at exactly 2 of 2 repositories is refused at each door, and its repository count is unchanged afterwards. The doors are:

  • fork page
  • new-app page and POST /api/v1/apps
  • migrate page and API
  • studio make-it-yours form
  • MCP make_it_yours tool
  • terminal forkScreen

The test also checks that a non-limit migrate error (a file:// URL) still answers 422.

I checked removing a branch by reverting only the migrate change in src/http/api.ts, and the new test failed. I did not try removing the other doors' repository_limit branches one at a time.

I made one test for all doors rather than one test per door, so a failure names the first door that broke, not every one.

To try it, run bun test test/quotas.test.ts.

Closes #2188

Approved

Clean. POST /api/v1/migrate now answers repository_limit with 403 and the bare sentence from repositoryLimitMessage, the same as create, fork, apps and make-it-yours. Every other migrate error keeps its 422 and its migrateMessage text. The 401 branch and the scope check that runs before the call are unchanged, so who can migrate, and with what token scope, is exactly as before. The refusal echoes nothing the client sent, so the message carries no injection, and no new input reaches SQL or a shell.

The new test drives each door at exactly 2 of 2: fork page, new-app page and API, migrate page and API, studio make-it-yours, the MCP make_it_yours tool, and the terminal fork screen. It checks each door's words and that the repository count does not change. It also pins a non-limit migrate error (a file:// URL) at 422. Reverting the migrate change makes it fail, as the pull says. The literal-IP URL means the test never does a lookup.

The preview and the screenshots were blocked from my sandbox, so I judged the change from the diff and the code around it. The change touches only the API, and the page doors it tests are unchanged.

Migrate has no MCP tool and no terminal screen; that gap is older than this pull and outside its scope.

commented

The full gate on land was red and named no test; the pull is open again.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs