A new forge's first ten minutes
For site admins. A forge started in its own cell (a child forge) is treated gently while it is new.
- Requests are held while it wakes. A request for a sleeping forge, a form's POST included, waits up to 20 seconds (
wakeLimits.waitMsinsrc/spawn/host.ts) for the cell to come up and gets its real answer. A wake that takes longer gets the self-refreshing "waking up" page. At most 16 requests wait on one forge at a time (wakeLimits.waiters); the rest get the waking page at once, so a crowd cannot pin connections. - No idle sleep. The idle sweep leaves a forge alone for 10 minutes after its start (
NEW_FORGE_MSinsrc/spawn/cell.ts). - A minute to start. The parent waits about 60 seconds (
START_PROBES) for a first start to answer. A start that never answers is asked to stop as a sleep is (SIGTERM first), so a slow boot is not written down as a crash. - The boots proof. The forge's reachability proofs include
boots: it fails when a start in the first ten minutes of the child's record never exited cleanly. It is read from the child's ownboots.json, and an early unclean start stops counting an hour after it happened, so the alarm clears on its own. - Its own code is not an app at first boot. The fork of the forge's code that a spawn makes (
<org>/forge, the oneparent.json'sforgeCodenames) is created and visible, but is not registered as an app, so an admin who sees no app for it has not lost it. Its forge.json declares an app, and running it (with Chromium for its looks) is meant to spare a new forge about a core and 1.5 GiB for its first minutes; that is the intent, not a measured figure. Only that recorded fork is skipped: a repository someone else calledforgeis not, and becomes an app like any other whose tip declares one. To turn it on, the repository's owner uses the app settings page on the web,/<org>/forge/settings/app, or the API,POST /api/v1/repos/<org>/forge/app; both runenableApp. The terminal has no screen for making an existing repository an app, so there it is the web or API. Code:ownForkNameinsrc/spawn/first-boot.ts. Test:test/spawn-child-apps.test.ts. - Where a person sees it. On the web,
/forges(Forges you sent); in the terminal, the "Forges you sent" screen. Each forge's line there readsRunning, not reachable: boots 1 unclean restart in the first ten minuteswhile the proof fails, next to any other failing proof. A passing proof adds no words. The proof is read when reachability is next swept (every five minutes). - What the proof cannot see. The newest start is left out: from outside, a start that is still running cannot be told from one that crashed. So a crash with no start after it counts only once the next start is written, for example when the forge next wakes. The window counts from the forge's very first start (
firstAtinboots.json), even after the ledger keeps only its last 50 starts.
Code: src/spawn/cell.ts (firstAnswer, sleepIdle), src/spawn/host.ts (wakeLimits), src/kernel/boots.ts (uncleanInFirstMinutes), src/spawn/reach.ts (proveBoots). Tests: test/first-ten-minutes.test.ts.
The first screen: one box
For the owner of a new forge (the site admin, or their everyday account), the home is one box until they have told the crew something.
- Web.
/shows "What do you want built?", the box, "Tell the crew", and one line about what pays for the crew (crewNoteinsrc/web/studio/crew_key.ts): the included credit with what is left, "spent", or "needs a model key". Without a key of their own an admin also gets a link to Subscriptions (/settings/subscriptions), where the key is added. The first screen carries no key field, no password field and no second form, and exactly one primary button. - Terminal. The home (
loadClientLinesinsrc/tui/screens/dashboard.ts) reads the same two lines, andtopens a prompt "What do you want built?" that keeps the words as the box does (keepThought). - The everyday account is offered after the first tell, not before: once the owner has a tell (an issue they or their everyday account wrote), the home becomes the everyday one, and the "make your everyday account" step (web: a link to its own page,
/settings/everyday, never a form on the home) or line (terminal,Emakes it,Kkeeps admin) appears. Until then neither door mentions it.
Code: src/web/pages/next-steps.ts (firstTell), src/core/next-steps.ts. Tests: test/next-steps-card.test.ts, test/tui-first-tell.test.ts.