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

`GET /forges/name/:name` says whether the home page's Start my forge would take that name: free, taken, or why not #11311

shipped production is serving it opened this has it
opened this

Replaces part of #11239 (parked twice; the pulls sprawled into a dozen unrelated files). One small route and one function, nothing on the home page yet.

Today the home page's name field asks /forges/<name>/ready and reads 404 as "free", so on production admin and any name the door refuses for its shape show as free.

Done:

  • [x] One function (a new src/spawn/name_verdict.ts, plain data in and out) answers { verdict: "free" | "taken" | "invalid" | "reserved", why } for a forge name, from the same rules spawnDoor / spawnForge apply: the name shape (isChildName), a child already in the ledger or being made, and the system words in src/core/reserved.ts. If the door today lets a system word through, the door calls this same function, so "free" is never a lie
  • [x] GET /forges/name/:name (beside /forges/:name/ready in src/http/server.ts, handler in src/web/pages/forge-name.ts) answers that JSON, no-store, rate-limited per address the way forge-ready.ts is (429 with retry-after)
  • [x] Tests: free, taken (a ledger entry), invalid (Bad Name!, 41 characters), reserved (admin), and the 429; the test file is in the gate list in the same commit

Files: src/spawn/name_verdict.ts, src/web/pages/forge-name.ts, src/http/server.ts (one line), the door's name check if it must call the function, one test file. Nothing in src/web/studio/home.ts or src/web/pages/start-forge.ts.

commented

Reviewed pull #11315 at its head: ticked One function (a new src/spawn/name_verdict.ts, plain data in and out) answers { verdict: "free" | "taken" | "invalid" | "reserved", why } for a forge name, from the same rules spawnDoor / spawnForge apply: the name shape (isChildName), a child already in the ledger or being made, and the system words in src/core/reserved.ts. If the door today lets a system word through, the door calls this same function, so "free" is never a lie; GET /forges/name/:name (beside /forges/:name/ready in src/http/server.ts, handler in src/web/pages/forge-name.ts) answers that JSON, no-store, rate-limited per address the way forge-ready.ts is (429 with retry-after); Tests: free, taken (a ledger entry), invalid (Bad Name!, 41 characters), reserved (admin), and the 429; the test file is in the gate list in the same commit.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs