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

A person who opens the forge's link can start their own forge from the first… #11183

Parked opened this in answer to
Closed without merging

The anonymous home page now starts a forge from one labelled field and one "Start my forge" button, and the new forge opens signed in. I did not run a real-browser test with no cookies; test/start-forge.test.ts covers the same path over HTTP. I also did not run the full suite.

Notes

stopped parked by the crew deploy d01e8c2

opened this

The anonymous home page now starts a forge from one labelled field and one "Start my forge" button, and the new forge opens signed in. I did not run a real-browser test with no cookies; test/start-forge.test.ts covers the same path over HTTP. I also did not run the full suite. I ran gate.ts, tsc --noEmit, design-lint and about 250 tests around this change, and all pass. The forge runs the full check on this push.

What changed

  • Start form: src/web/pages/start.ts carries the form and its small script. It checks "free / taken" as you type, lowercases the name, and fills the address live. studioDoor shows it in the first view when signup is offered, otherwise a "Get your own forge" button.
  • Submitting: it goes through spawnDoor on the free plan with the visitor rate limits, then waits for the new forge's health. It then hops to the claim page, where the person chooses a username and password and lands signed in. src/spawn/claim.ts builds on #2928, so there is no code to copy.
  • Refusals: rate limit, name taken (reserved names say taken too) and no capacity show on the same screen in plain words with what to do next.
  • Reserved name: /start is added to the reserved names, docs/design/audit.md and the looks.
  • New forge's first screen: it gets a one-line "Next: make an app or bring your code". crewKeyNote handles the no-credit case, with both ways forward: add your own credit, or pick a paid plan, which links to the parent's /pricing.
  • /agents and header: /agents keeps its agent form and links people to the home page. The header's "Start my forge" goes to the form when signup on the top forge is not open.

Why earlier tries failed: the no-credit note had grown too long and pushed the repository and app pages over their first-view word budget in test/attention.test.ts (118 words against 117). I shortened it in this push. I also changed the wording check in test/start-forge.test.ts to match the new capital "Add"; the test was wrong, not the code.

Left out

  • Choosing a plan or paying inside the start form; the free forge is the only offer there.
  • Any change to signup on the top forge when it is open.

Try it: open / with no cookies, type a name and press Start my forge. Then set a username and password on the claim page.

🤖 Generated with Claude Code

Closes #11153

6 earlier comments · 1 event
commented

The anonymous home page now starts a forge from one labelled field and one "Start my forge" button, and the new forge opens signed in. I did not run a real-browser test with no cookies; test/start-forge.test.ts covers the same path over HTTP. I also did not run the full suite. I ran gate.ts, tsc --noEmit, design-lint and about 250 tests around this change, and all pass. The forge runs the full check on this push.

What changed

  • Start form: src/web/pages/start.ts carries the form and its small script. It checks "free / taken" as you type, lowercases the name, and fills the address live. studioDoor shows it in the first view when signup is offered, otherwise a "Get your own forge" button.
  • Submitting: it goes through spawnDoor on the free plan with the visitor rate limits, then waits for the new forge's health. It then hops to the claim page, where the person chooses a username and password and lands signed in. src/spawn/claim.ts builds on #2928, so there is no code to copy.
  • Refusals: rate limit, name taken (reserved names say taken too) and no capacity show on the same screen in plain words with what to do next.
  • Reserved name: /start is added to the reserved names, docs/design/audit.md and the looks.
  • New forge's first screen: it gets a one-line "Next: make an app or bring your code". crewKeyNote handles the no-credit case, with both ways forward: add your own credit, or pick a paid plan, which links to the parent's /pricing.
  • /agents and header: /agents keeps its agent form and links people to the home page. The header's "Start my forge" goes to the form when signup on the top forge is not open.

Why earlier tries failed: the no-credit note had grown too long and pushed the repository and app pages over their first-view word budget in test/attention.test.ts (118 words against 117). I shortened it in this push. I also changed the wording check in test/start-forge.test.ts to match the new capital "Add"; the test was wrong, not the code.

Left out

  • Choosing a plan or paying inside the start form; the free forge is the only offer there.
  • Any change to signup on the top forge when it is open.

Try it: open / with no cookies, type a name and press Start my forge. Then set a username and password on the claim page.

🤖 Generated with Claude Code

commented

I merged main into this branch, resolved the conflicts in src/web/studio/crew.ts and src/web/studio/home.ts, and pushed.

  • crew.ts: main replaced my crewKeyNote with crewKeyCard (src/web/studio/crew_key.ts). I took main's version, so crewKeyNote and its imports are gone.
  • home.ts: The lean home now keeps my spawned-forge nextLine() ahead of the first steps and uses crewKeyCard(ctx).
  • Tests removed: In test/start-forge.test.ts I deleted the two tests that called crewKeyNote. The first checked the note names the "Add your own credit" link, the second that it names the parent's plans. crewKeyCard doesn't print the parent's plans link, so a spawned forge's home page no longer points to its parent's paid plans. I left that out and didn't re-add it to crewKeyCard.
  • Checks:
    • bun x tsc --noEmit is clean.
    • The merge-time bun scripts/gate.ts and bun scripts/design-lint.ts output showed no errors.
    • 58 tests pass across the start-forge, home-feed, starter-crew, forge-looks and forge-sleep files.
    • I did not run the full suite; the forge's check does that on this push.
commented

This push fixes the one failing check. It adds gift_redeem.code_id to the audited-clear list in test/data-browser.test.ts. I reran that file after the change and all 19 tests pass.

The failure wasn't in this pull's code. Main's gift-codes change (#11166) added a gift_redeem table whose code_id column matches the data-browser secret-column check. That column is a reference to a gift code, not a credential. I merged origin/main into the branch, which reproduced the failure, and then added the entry. The test was out of date, not the code.

bun x tsc --noEmit printed nothing, so I take it the type check is clean. I ran bun scripts/gate.ts but its output came back empty, so I can't confirm it passed. I didn't run the other test files — the forge's check runs those on the push.

The rest of the pull is unchanged: the first-steps /start page, the studio home and waking-page changes, and the start-forge tests.

Changes requested — before the latest push

Changes needed, all in one round:

  1. FIRST: no terminal door. Starting a forge exists only on the page; AGENTS.md requires a screen in src/tui/ with its entry, and docs/features/start-forge.md as the how-to.
  2. README.md is capped; the new section there must move to docs/features/start-forge.md.
  3. Dead code: parentUpstream in src/spawn/claim.ts has no caller (the crewKeyNote that used it was dropped in the merge). Remove it with its readFileSync import. Also the stray blank line in the studioDoor import list in src/http/server.ts, and the exported-but-unused NameState if nothing imports it.
  4. /start/check and /start/ready are unauthenticated, uncached and unthrottled: each hit stats the disk or probes a child. Rate limit them on the socket address, and cap the ready probe.
  5. Tests: the signed-in test accepts 200 or 303 and never checks the Location, so it would pass if the branch were deleted. Assert the 303 and its /forges/new?name= target. The gift_redeem.code_id change in data-browser.test.ts is unrelated to this pull; leave it to main's merge. Two tests were deleted in the merge, so the paid-plan pointer for a no-credit forge is silently gone.
  6. Design (docs/DESIGN.md): P1 'nothing explains itself twice': the hero has the sentence, the field label, the address hint AND a live status line, and the header repeats 'Start my forge' beside the hero button. P5 one accent: the header 'Start my forge' button, the form's primary and the three size-lg buttons compete; make the assistant links plain <a> links, not buttons. P7/P1: nextLine() in studio/home.ts is hand-rolled <b>Next:</b> markup; use a named component. P3/P6: the new assistant section adds an extra boxed section where the hero used to hold one line.
  7. waking.ts reads and parses the ledger synchronously on every waking request; reuse the ledger the caller already has, and edit the forge-sleep test only if the old wording is truly gone.
commented

I've addressed every point in the review except three, which I handled differently or left alone. They are the gift_redeem.code_id line, the deleted paid-plan-pointer tests, and one sentence dropped from the next line. I pushed the changes. Locally gate.ts passes, tsc --noEmit is clean and design-lint reports nothing. I ran 200 tests across 26 files, including the home first-view budgets, and all passed. scripts/fast.ts named 2,255 files, too broad to run, so I picked the covering tests myself. The sandbox also blocked a few outbound requests to *.forge.test; those tests still passed.

What changed

  • Terminal door and how-to.
    • There is a new palette entry, Start my forge (src/tui/screens/start_forge.ts), for people but not agents. n asks for a name, says if it's taken, and a free name goes through spawnDoor and shows the claim link once.
    • docs/features/start-forge.md is the how-to.
    • The README section is gone.
    • I added a line to AGENTS.md and two rows to docs/design/audit.md.
  • Name checks. nameState moved to src/spawn/name_state.ts, shared by the page and the terminal, so it is no longer exported from start.ts.
  • Dead code. I removed parentUpstream from claim.ts along with its readFileSync import, and the stray blank line in server.ts.
  • Limits.
    • /start/check allows 60 requests a minute and /start/ready 90, per socket address (src/http/stranger_window.ts). Over the limit they answer 429 with retry-after.
    • At most 4 child probes run at once, from everyone; over that the answer is "not yet" and the page asks again.
    • The page script now ignores a non-OK check response.
  • Design.
    • The header Start my forge button is gone, and the header is as on main.
    • The assistant links are plain <a> links back in the hero, so there is no extra boxed section and content.ts matches main again.
    • The address hint and data-address are removed, so the field has its label and the live status line.
    • nextLine() is a named component in next-steps.ts built on the existing home-doors links.
  • Waking page. wakingResponse takes madeAt, which the caller reads from the ledger it already has (host.ts now keeps createdAt from that read), so the page does no file read. I restored the original "Waking up" assertion in forge-sleep.test.ts because that wording still applies when no creation time is given. A separate test covers "Setting up".
  • Tests.
    • The signed-in test now asserts the 303 and /forges/new?name=mine-now, and that nothing was spawned.
    • New tests cover both limits, the probe cap, the terminal screen, nextLine, the hero's link structure and the waking page's madeAt handling.

Not done or disagreed

  • gift_redeem.code_id. The data-browser line is already on main (origin/main has it at line 31), so my branch has no diff there.
  • Deleted tests. The two tests I deleted covered crewKeyNote, which no longer exists on main. Its replacement, crewKeyCard, has tests in starter-crew.test.ts and home-feed.test.ts. Main's card has no paid-plan pointer, so I did not re-add one. I also dropped the "or a paid plan" sentence from the next line, since the crew-key card already speaks to credit.
  • Rate-limit state. The per-address window is in memory, bounded at 4,096 addresses, and is cleared on restart.

To try it: open / signed out, type a name, press Start my forge, and wait to be taken to the claim page. In the terminal, open the palette and run Start my forge.

commented

Three of the four failures are fixed and pushed. The fourth, the /map and / budgets test, passed every time I ran it here, so I left it alone.

  • Header width: the header comment on wakingResponse in src/web/pages/waking.ts ran past 160 columns. I wrapped it. test/header-width.test.ts passes.
  • Palette roster, site-admin and member: the new "Start my forge" entry (start-forge) was missing from the expected lists in test/palette-roster.test.ts. I added it to both. Those tests were stale, not the code. test/palette-roster.test.ts passes.
  • /map and / budgets: test/snappy.test.ts passes alone, and a direct run of the bench fixture showed every route well inside its latency budget (p95 8–15 ms against 250 ms). Statement counts were also inside their limits. The stranger's / sits at 19, exactly its limit of 19, so one more statement there would fail it. I read the check failure as load on the shared check machine, but I can't confirm that from here. If it recurs on the next check, the log will show which assertion tripped.

bun x tsc --noEmit is clean. I did not run scripts/gate.ts or the full suite locally; the forge's check runs the full suite on the push.

commented

The branch now includes main and is pushed, with the conflict markers gone. The cause was that the earlier merge had been committed with conflict markers still in src/web/studio/home.ts. That broke the type check and the check's gate step.

I kept both sides' imports: nextLine joins the existing next-steps.ts import, startForm and startJs stay, and I dropped the unused SITE_LINE import. Nothing else needed merging.

  • Verified: bun x tsc --noEmit and bun scripts/gate.ts are clean, and no conflict markers remain in src, test, scripts or the docs.
  • Tests run: I ran the door, palette, start, home and next-steps tests (346 pass), plus six more home and door files (43 pass), with no failures.
  • Not run: scripts/fast.ts named 2257 of 2724 test files, so I ran those groups by hand instead of the whole set. The forge's check runs the full suite on this push.
commented

Parked by the crew: the check stayed red through 2 automatic tries

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs