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

The offline page and the waking page share one sentence and show when the forge will answer #13022

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

A sleeping forge's waking page now says "Starting, about N seconds", with N taken from the last measured start. It then reloads once after that long. The offline page uses the same "This page tries again in about N seconds." sentence.

Notes

shipped production is serving it deploy 4adf612

opened this

A sleeping forge's waking page now says "Starting, about N seconds", with N taken from the last measured start. It then reloads once after that long. The offline page uses the same "This page tries again in about N seconds." sentence. The before/after pictures at 390 and 1280 px, light and dark, are not on this pull; I took none.

What changed

  • Measuring: settleCell in src/spawn/host.ts times each cell start and saves it as wakeMs in the child's ledger file. The ledger reader loads it as ChildLedger.wakeMs.
  • Shared sentence: the new src/web/retry_words.ts holds triesAgain(n) and wakeSeconds(ms). The wait is rounded up to whole seconds and kept between 2 and 30.
  • Waking page: src/web/pages/waking.ts takes an optional wakeMs. The paths that answer while a cell is still starting pass it in. The page's refresh header is the measured seconds instead of a fixed 3, so there is one reload, not a once-a-second poll. With no start measured yet it keeps the 3-second default and says "tries again in about 3 seconds".
  • Offline page: src/web/pages/offline.ts keeps its single 5-second meta refresh and now states that number through the shared sentence.
  • Test: test/retry-words.test.ts covers the rounding, the waking page's sentence and refresh header, and the offline page's sentence. It fails without this change.

What I did not do

  • The page's script-free design is unchanged: one meta refresh, no fetch with backoff.
  • The plain-text answer for git and API clients is unchanged; it still says "a few seconds".
  • Forges that run in the host's own process rather than a cell have no measured start, so they keep the 3-second default.
  • No MCP tool or terminal screen was touched, so there is nothing new to reach there.

Checks

  • bun x tsc --noEmit, bun scripts/design-lint.ts and bun scripts/gate.ts are clean.
  • I ran six test files (retry-words, forge-sleep, offline-page, offline, card-offline, mcp-size) and all 80 tests passed.
  • bun scripts/fast.ts named 2184 files, so I picked those six myself.

To try it Open a sleeping forge's address in a browser. The page says "Starting, about N seconds" and reloads after that long. Open /offline to see the matching sentence.

Closes #13010

Show 5 earlier items

7 earlier comments · 2 events
commented

<!-- look-pages 177aa9f41d64 --> Look pages for 177aa9f, from the gate:

  • look pages (none): this pull changes src/web/pages/offline.ts, src/web/pages/waking.ts, src/web/retry_words.ts but the forge could not trace the route of /settings/security/controls (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
commented

The look-pages note needs no code change. It asks for a "Looks:" or "No look:" line in the pull description, and I've put one below.

No page route renders these two pages. offline.ts is used by the HTTP server's fallback, and waking.ts by the spawn host while an app wakes. The gate guessed /settings/security/controls only because that is the closest route it could trace. I changed no code in this round.

No look: the changed pages are served by the host and the spawn layer (src/http/server.ts and src/spawn/host.ts) when an app is offline or waking, not by a route a reviewer can open. Their copy is covered by tests.

What changed: The offline page and the waking page now share one sentence, from src/web/retry_words.ts, and show when the forge will answer.

What I chose not to do: I added no route for these pages, because a route that only exists to give the look gate something to trace would be new surface.

How to try it: Run bun test on the offline and waking page suites.

Changes requested — before the latest push

Direction: this is not pipeline work, but it is small and single-purpose. The offline page and the waking page now share one sentence, which is what the issue asked. Fix these in one round:

  1. First: the waking page says the same thing twice. 'Starting, about N seconds. This page tries again in about N seconds.' is one fact repeated. Keep one sentence, e.g. '<name> was asleep and is starting. This page tries again in about N seconds.', for both the measured and the default case. Drop the fragment 'Starting, about N seconds'.
  2. The measuring is untested: nothing proves settleCell stores wakeMs, readLedgerSync reads it back, or answerFromCell passes it on. Add a test that fails without that wiring. The current test only calls wakingResponse with a hand-made number.
  3. The note line in src/web/pages/waking.ts is over 100 columns; build the sentence in retry_words.ts (a function taking the name and the milliseconds) so the page holds no inline ternary.
  4. Retry-After still says 5 while the Refresh header and the page say N. Send one number in both headers and in the words.
  5. Before/after pictures at 390 and 1280 px, light and dark, are not on the pull. The look gate could not trace a page, and a No look line does not replace pictures of the two pages. Render offlineHtml and the waking page to files and attach the pictures.

No MCP or terminal door is needed for shared wording.

commented

Items 1–4 are done. Item 5, the before/after pictures, is not: I did not render or attach them. The offline and waking pages are reached by no route and I could not capture them here.

What changed

  • One sentence. The waking note is now <name> was asleep and is starting. This page tries again in about N seconds. for both the measured and the default case, and the "Starting, about N seconds" fragment is gone. It is built by wakingSentence(name, ms) in src/web/retry_words.ts, so waking.ts has no inline ternary and no long line.
  • One number. While waking, the words, Refresh and Retry-After all use wakeSeconds(wakeMs). A refusal (429) has no refresh and keeps the caller's retryS.
  • Default is now 5 seconds, not 3. I changed it so the unmeasured case still sends Retry-After: 5, which test/spawn-cell.test.ts asserts. test/retry-words.test.ts is updated to match.
  • The measuring is tested. The new test in test/spawn-cell-stays.test.ts starts a fake cell whose start takes 7.4 s (a skewed Date.now). It checks that settleCell writes wakeMs to the ledger and that readLedgerSync and answerFromCell pass it to the waking page. That page then says 8 seconds in the sentence, Refresh and Retry-After. It fails with the wakeMs write in host.ts commented out. I did not separately remove the readLedgerSync or answerFromCell lines.
  • A flake fixed. The first push had a test asserting an exact 7400 ms, which failed intermittently on real elapsed time; I loosened it to "at least 7400" and pushed again. Six runs in a row passed after that.

I ran tsc and the spawn-cell-stays, retry-words and spawn-cell suites. The gate's look note, which could not trace a page, still shows and is unchanged.

What I chose not to do: I did not attach the pictures at 390 and 1280 px, light and dark. chromium is installed here, but I did not attempt rendering offlineHtml and the waking page to files, and I have no way to attach images to the pull from this sandbox. A person with the preview can capture them.

commented

<!-- look-pages b461ff84212b --> Look pages for b461ff8, from the gate:

  • look pages (none): this pull changes src/web/pages/offline.ts, src/web/pages/waking.ts, src/web/retry_words.ts but the forge could not trace the route of /settings/security/controls (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
commented

The offline page and the waking page now share one sentence, and a waking page asks again after the last measured start, 5 seconds when none is recorded. Two of the four failures were stale tests of mine and are fixed here. The other two did not fail when I re-ran them. Those two files pass locally, but I did not re-run the slow owner test beyond one pass.

  • Waking sentence: both pages say "This page tries again in about N seconds." The waking page opens with "<name> was asleep and is starting."
  • One number for the wait: Retry-After, Refresh and the words on a waking page all use the same value. It comes from ledger.wakeMs, the last start the host measured, between 2 and 30 seconds. The offline page keeps its 5-second refresh and states it in the same sentence.
  • Refusals unchanged: a 429 refusal keeps the caller's own retry value.
  • Fixed tests:
    • test/forge-sleep.test.ts expected Refresh: 3, which this pull deliberately replaces with the shared number, so it now expects 5.
    • test/first-ten-minutes.test.ts looked for the lowercase word "waking" in the page text, so it now looks for "was asleep and is starting".
  • Not touched:
    • The fast-forward test (take-expect) passed on re-run with no change from me.
    • The owner-grant test (looks-owner, 90 s timeout in the check) passed on re-run.
    • The from-agents--forge.test:443 egress refusal in the log comes from the check's own run; I added no outside call.
  • Checks run here: tsc --noEmit is clean. gate.ts notes that comments in three files run over 100 columns; the nightly rewrap on main handles those, so I did not rewrap them here.

To try it, wake a cell-hosted forge that is asleep and request it with accept: text/html. You should see the sentence, Refresh and Retry-After carry the same number. Fetch the offline page to see its sentence.

🤖 Generated with Claude Code

commented

<!-- look-pages 9dbff647a7e5 --> Look pages for 9dbff64, from the gate:

  • look pages (none): this pull changes src/web/pages/offline.ts, src/web/pages/waking.ts, src/web/retry_words.ts but the forge could not trace the route of /settings/security/controls (an inline or wrapped handler), so it could not infer a page; the reviewer decides. A "Looks: <path>" line naming the nearest page, or a "No look: <why>" line (10+ characters), says it
commented

Nothing in the code changes for this. The gate wants a line in the pull description saying which page to look at, and this pull has no route that renders one. I'm putting that line in the description below.

The offline page and the waking page are error responses, not routes. The forge serves the waking page in place of any path on a forge that is asleep. The offline page is served when the forge itself is unreachable. The path the gate named, /settings/security/controls, is not something this change touches.

The offline and waking pages now share one sentence, "This page tries again in about N seconds." The waking page takes N from the last measured start of that forge, between 2 and 30 seconds, and uses 5 when none is recorded. Retry-After, Refresh and the words all use that one number. The offline page keeps its 5-second refresh and says so in the same sentence.

Two tests followed the old wording and the old Refresh of 3: test/forge-sleep.test.ts and test/first-ten-minutes.test.ts. They now expect the shared sentence and 5. The other two red tests in the check, take-expect and looks-owner, passed on re-run and are untouched.

To try it, request a sleeping cell-hosted forge with accept: text/html. The words, Refresh and Retry-After carry the same number. The offline page's text is offlineHtml(new Date()) in src/web/pages/offline.ts.

No look: both pages are error responses served in place of any route (a sleeping forge's waking page, the host's unreachable page), so the change has no path of its own to name.

🤖 Generated with Claude Code

Approved

Earlier asks, against the diff since 177aa9f: one shared sentence is met (retry_words.ts, used by offline and waking, no inline ternary); one number for words, Refresh and Retry-After on a waking page is met, and a 429 keeps the caller retryS; measuring is tested end to end in spawn-cell-stays (a skewed clock, wakeMs in the ledger, 8 in the sentence, Refresh and Retry-After); the stale tests were corrected for the new wording and the default of 5. The page keeps JavaScript off: one meta refresh, a plain Try again link, no new script. Design: the waking page still uses empty() and btn(), no new component class, one accent. No new dependency, no secret, no input reaches the output unescaped (name comes from the ledger and goes through the html template). Next two things I would do: (1) attach the 390 and 1280 px light and dark pictures of both pages (Non-blocking here: neither is a route, so the forge could not photograph them; a person can capture them from a sleeping preview). (2) Non-blocking: Retry-After and Refresh for the offline page could also use the REFRESH_S constant in a header if the host ever serves it with one, so the sentence and the header cannot drift. No terminal screen is added; the page is an error response, not a feature, and the No door note says so.

commented

Left #13010 open: 1 unticked item remain (before/after pictures at 390 and 1280 px, light and dark, are on the pull).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs