Public: anyone can read this; the crew can change it.
The home page's forge-name field says "free" or "taken" as you type #11283
Typing in the home page's "Forge name" field now writes one line under it: "Free", "Taken", or why the name isn't allowed. I ran the gate (clean), tsc --noEmit (no errors), scripts/design-lint.ts (clean) and 12 related test files (112 pass, 0 fail).
stopped parked by the crew deploy 9836a5e
5 earlier comments
Typing in the home page's "Forge name" field now writes one line under it: "Free", "Taken", or why the name isn't allowed. I ran the gate (clean), tsc --noEmit (no errors), scripts/design-lint.ts (clean) and 12 related test files (112 pass, 0 fail). The diff was too broad for scripts/fast.ts to name tests, so I picked those 12 myself. I did not run the full suite or open a browser: the typing behaviour is not exercised by any test, only the endpoint and the page markup.
What changed
- Check:
src/spawn/name_check.tsis new. It answersGET /forges/check?name=…with{state, message}where state isfree,taken,reservedorinvalid. It applies the door's name pattern,reservedNamefromsrc/core/reserved.ts, and a newforgeNameTakeninsrc/actions/spawn.ts. That last one is the same ledger-or-in-flight test the door uses for its 409. - Name pattern: I exported
NAMEfromsrc/spawn/plan.tsso the check and the door share it. - Responses: The answer is a fixed sentence and never echoes the typed name. It is sent with
Cache-Control: no-store. - Rate limit: The check is counted per address through a new
namedoor insrc/http/strangers.ts: 120 a minute per address, 1200 for the whole forge, then 429 withRetry-After. A separate door because the existingplandoor allows only 10 a minute, which typing would use up. - Home page:
src/web/studio/home.tsadds a<p id="start-check" aria-live="polite">under the field. A script of about 10 lines waits 250 ms after typing, then asks the endpoint. It drops answers that arrive out of order, and it only runs wherefetchexists. - Layout shift:
.start-checkhas a fixedmin-heightinsrc/web/style/content.ts, so the line never moves the page. It is listed indocs/design/areas/front.md. - No JavaScript: the form still posts to
/forges/new, and the door still makes the final decision. - Docs and tests:
docs/features/start-my-forge.mdhas a new "The name check" section.test/forge-name-check.test.tscovers free, taken, reserved and invalid, the no-echo and no-store headers, the 429 after the limit, and the new line in the form.
Not done
- The door itself doesn't call
reservedNamefor forge names; that rule is made for account names. The live check does apply it, so a name could show "not allowed" while the door would still accept it. I didn't change the door, since behaviour was to stay as it is. If you want the two to agree, that's a separate change. - The layout-shift test only checks that the line is in the markup. It doesn't measure rendering.
- No new dependencies.
To try it: open / signed out and type admin (not allowed), Bad Name (not allowed), an existing forge's name (Taken), then a fresh name (Free). Or run curl '/forges/check?name=admin'.
I merged main into this branch and pushed it. The one conflict, in docs/features/start-my-forge.md, is resolved by keeping both sections. They are this pull's "The name check" and main's "Three screens, no link to copy". src/http/server.ts merged automatically.
The gate and the type check ran clean. test/forge-name-check.test.ts and test/stranger-three-screens.test.ts pass (9 tests). I did not run the full suite; the forge runs it on the push.
How to try it: open / signed out and type a name in the Forge name field. A line under it says Free, Taken or why not.
One of the two failing tests was caused by this pull and is fixed; the other looks like a timeout under shard load and I changed nothing for it. The fix is pushed.
- "every top-level page has an entry in the audit": the new
GET /forges/checkroute returns a small JSON answer for the name field, not a page.test/design-audit.test.tscounted it as a page with no audit entry. I addedforges/checkto the list of non-page routes in that test. The test was wrong here, not the code.test/design-audit.test.tsnow passes (4 tests). - "a sleeping preview woken at the limit > stays asleep…": the check log shows it failing after 120 s in shard 13. Run alone,
test/quotas-running.test.tspasses all 7 tests in 18 s. This pull doesn't touch that area, so I changed nothing for it. If it fails again on the next check, it needs a person to look at the shard.
Nothing to change or push this time: I couldn't reproduce the failure, and I believe it is load noise rather than something this pull caused.
budgets > /map and / answer under their p95 and statement budgets in test/snappy.test.ts passed on all three isolated runs here. It is a wall-clock p95 test, and in the check it ran in shard 49 beside many other test files, where timing varies. It is the only failure in the log, and the log says it was not re-run alone.
This pull's only effect on / is a small inline name-check script for signed-out visitors. It adds no database statements, so the statement budgets are unchanged. The route it adds, GET /forges/check, is not one of the routes this test times.
If the next check fails on this test again, someone should look at that shard's load or loosen the p95 margin.
I merged main into the branch and pushed it. Four files conflicted, and one of them needed more than a textual fix. main had added its own live name check on the home page, which only asks whether a forge exists and so can't say why a name is refused. I kept this pull's check, which uses the door's rules, and made it write into main's markup.
- Home page markup:
main's form, ids and.door-saysline are kept, including the new/forges/startaction and thearia-describedbywiring. The check script now writes into#start-name-says. main's script and test: I removedmain'sstartNameJsscript, which asked/forges/<name>/ready. Intest/home-start-forge.test.tsI rewrote its live-check test to run this pull's script instead.nameCheckJsis now the home page's only name script. Theokflag I added to that test file's fakefetchresponse is how the script reads its answer.src/http/server.ts: both imports and both routes are kept,/forges/checkand/forges/start.docs/design/areas/front.md,src/web/style/content.ts:main's.door-saysreplaces my.start-check.docs/features/start-my-forge.mdandtest/forge-name-check.test.tsnow use the new id and action.
The gate, tsc and the design lint are clean. test/forge-name-check.test.ts, test/home-start-forge.test.ts, test/design-audit.test.ts and test/stranger-three-screens.test.ts pass. I did not run the full suite; the forge runs it on the push.
One sandbox denial showed up in the test run (an outbound connection to sunny-day--localhost:80), and it did not fail anything.
To try it, open / signed out and type a name. The line under the field says Free, Taken, or why not.
Typing in the home page's "Forge name" field now writes one line under it: "Free", "Taken", or why the name isn't allowed. I ran the gate (clean),
tsc --noEmit(no errors),scripts/design-lint.ts(clean) and 12 related test files (112 pass, 0 fail). The diff was too broad forscripts/fast.tsto name tests, so I picked those 12 myself. I did not run the full suite or open a browser: the typing behaviour is not exercised by any test, only the endpoint and the page markup.What changed
src/spawn/name_check.tsis new. It answersGET /forges/check?name=…with{state, message}where state isfree,taken,reservedorinvalid. It applies the door's name pattern,reservedNamefromsrc/core/reserved.ts, and a newforgeNameTakeninsrc/actions/spawn.ts. That last one is the same ledger-or-in-flight test the door uses for its 409.NAMEfromsrc/spawn/plan.tsso the check and the door share it.Cache-Control: no-store.namedoor insrc/http/strangers.ts: 120 a minute per address, 1200 for the whole forge, then 429 withRetry-After. A separate door because the existingplandoor allows only 10 a minute, which typing would use up.src/web/studio/home.tsadds a<p id="start-check" aria-live="polite">under the field. A script of about 10 lines waits 250 ms after typing, then asks the endpoint. It drops answers that arrive out of order, and it only runs wherefetchexists..start-checkhas a fixedmin-heightinsrc/web/style/content.ts, so the line never moves the page. It is listed indocs/design/areas/front.md./forges/new, and the door still makes the final decision.docs/features/start-my-forge.mdhas a new "The name check" section.test/forge-name-check.test.tscovers free, taken, reserved and invalid, the no-echo and no-store headers, the 429 after the limit, and the new line in the form.Not done
reservedNamefor forge names; that rule is made for account names. The live check does apply it, so a name could show "not allowed" while the door would still accept it. I didn't change the door, since behaviour was to stay as it is. If you want the two to agree, that's a separate change.To try it: open
/signed out and typeadmin(not allowed),Bad Name(not allowed), an existing forge's name (Taken), then a fresh name (Free). Or runcurl '/forges/check?name=admin'.Closes #11239