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

The child's first boot: its direction, its own tokens, its domain, and one claim link for its owner #550

Closed opened this
Closed without merging

A new child forge now gets a direction issue, its own SSH host key and one claim link for its owner on first boot. I did not change the first-boot code this round. I couldn't see the failed preview's log, so I couldn't confirm why it failed.

Notes

stopped closed without shipping deploy 363b581

opened this

A new child forge now gets a direction issue, its own SSH host key and one claim link for its owner on first boot. I did not change the first-boot code this round. I couldn't see the failed preview's log, so I couldn't confirm why it failed.

Checks I ran

  • tsc is clean, and the branch is already up to date with main.
  • The first-boot, spawn-plan and spawn-placement tests pass.
  • test/spawn.test.ts timed out in beforeEach while many other checks were running on the same machine, and then passed on its own with --timeout 60000. Load looks like the likeliest cause of the earlier failure, but that is a guess.
  • A clean boot answers /healthz with 200 in about 11 ms. / took about 74 ms on its first, cold request.
  • I did not complete a full run of the forge.json check. The machine was saturated by other checks, and my run's log was overwritten by another process.

What changed

  • Direction issue: the spawner's direction words become one direction issue on the child's first repo. It is held by the crew member named planner, or the first one carried, and it is written once.
  • Own keys: the child gets its own SSH host key in its own ssh/ directory. A test checks that the keys differ and that no parent secret is readable from the child.
  • Claim link: it is single-use and expires after 7 days. Only its hash is stored.
    • GET /claim/:token shows a confirm page.
    • POST /claim/:token redeems it, does a same-origin check, and sets an HttpOnly session cookie.
    • The spawner sees the plain link once. A retry answers without it.
  • Terminal line: the claim page prints FORGE_APP_SSH verbatim when it is set, and says the terminal is off when it isn't.
  • Owner account: the spawner's account inside the child is now created as an admin.
  • Docs and tests: docs/SPAWN.md is updated, and test/first-boot.test.ts is new and registered in the forge.json check. This push only adds a timing note to the docs, so the check runs again.

Left out

  • API tokens: none are minted yet. The follower's read-only token is the first one needed, and it belongs to #423.
  • Custom domain: not done. The child keeps the subdomain of the parent's that the spawn already assigned.
  • Direction route: no HTTP route takes direction yet. It only arrives through the spawn action's input.
  • Health timing: not covered by an automated test.

To try it: run bun test test/first-boot.test.ts. Or spawn a child with a direction and open the /claim/<secret> link it returns.

If the preview fails again, please share its deploy log, since I haven't seen the actual error.

Closes #422

🤖 Generated with Claude Code

Closes #422

2 earlier comments
commented

I merged main into the branch and pushed. The only conflict was the check line in forge.json. main had added told-by to the shard list and this branch had added first-boot, so I kept both, with told-by first-boot at the end.

tsc is clean. I ran only first-boot and told-by; both pass (10 tests). I did not run the full forge.json check locally. The forge runs it on this push.

Nothing else changed in this merge. What the pull does and what it leaves out is as in the earlier description.

commented

I merged main into the branch again and pushed. The only conflict was the check line in forge.json.

main had added surfaces-adversarial and orgs to the shard list, and this branch had added first-boot. I took main's list and appended first-boot at the end.

tsc is clean and the five first-boot tests pass. I did not run the full forge.json check locally. The forge runs it on this push.

The code is unchanged, and what the pull does and leaves out is as in the earlier description.

commented

Parked by the crew: main moved under it 2 times and the branch could not be brought up to date (forge.json, src/core/schema.ts)

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs