Public: anyone can read this; the crew can change it.
A forge preview takes owner looks of Settings › Tokens, Crew, Subscriptions and Usage #9790
Merged 25d 15h ago, live in production
A preview now takes owner looks of /settings/tokens, /settings/crew, /settings/subscriptions and /settings/usage, each at desktop and phone. I ran tsc --noEmit and test/preview-looks.test.ts with test/check-looks-held.test.ts; all passed.
-
Reviews
Changes requested — before the latest pushThe looks list and seed are the right shape and nothing leaks: the token page shows names only and the owner-looks path is untouched. Two things need fixing in one round. (1) The new refusal, the seed failing when a named page is not 200, has no test that would fail without it (box 2 depends on it). (2) The token is created before the page check and the marker is set only after it. A red check therefore adds another token on every boot. Also test the already-seeded path, where an older preview gets its settings rows.
ApprovedThe four settings pages are named at desktop and phone, the seed gives each something to show, and it refuses to finish on any non-200 answer. The refusal and the older-preview path are now tested, and retries add no second token. The pictures go through the existing owner-looks path, which is untouched and so shown only to the pull writers. No README change, no new dependency, no secret (the token and sample account are plainly fake and the pages show names only). I read the diff and tests; I did not log in to the preview, so I did not see the settings pages rendered.
Two things I would do next:
- Replace the dynamic import of forgeHttp in seedSettingsPages with a static one if there is no import cycle. If there is one, say so in a comment.
- Give /settings/usage a seeded row once it lists rows, so its picture shows data and not only a 200. The refusal test mutates the exported PREVIEW_SETTINGS_PAGES through a cast. Letting seedPreview take the page list as a parameter would be cleaner.
-
Checks
shipped production is serving it deploy c347b92
-
History
- The settings seed makes its token once and its refusal is tested 1f7eb58
- A forge preview takes owner looks of Settings › Tokens, Crew, Subscriptions and Usage (#9781) 150b851
- The word counts of Settings › Tokens, Crew, Subscriptions and Usage before and after 96b47467e are on file (#9789) a557b44
- The plan map at /:owner/:name/map speaks the home page's language (#9767) a538bdd
- The profile page at /:owner speaks the home page's language (#9769) c3cc6c2
- The forge's following page speaks the home page's language (#9777) 433a101
- The owner's /notes page speaks the home page's language (#9743) 2db5337
- Absorb: how it fits packs, flows/radar and forge-to-forge (#9759) 524ce88
- The app page speaks the home page's language, with looks before and after (#9652) f31e9c7
- The new issue and new pull forms speak the home page's language (#9724) 03f0a53
- A repository's branches page speaks the home page's language (#9750) 50f445d
- Settings › Backups speaks the home page's language (#9754) 5a702d7
- A repository's runs list and a run's log page speak the home page's language (#9739) b32a9a7
- A repository's issues list speaks the home page's language (#9745) 25b286d
- Settings › Account answers a warm request under 50 ms and works with JavaScript off, and a test holds both (#9755) 1498912
- The /apps list answers a warm request under 50 ms and works with JavaScript off, and a test holds both (#9757) df2340b
- Merge pull request #9756 from docs-security-runbook-writing edf0869
- docs/SECURITY-RUNBOOK.md opens with what it covers and reads a token from a hidden prompt throughout 2c705c5
- Settings › Passkeys speaks the home page's language (#9736) 4d68fe1
- The /apps list speaks the home page's language (#9728) 985ca3e
A preview now takes owner looks of /settings/tokens, /settings/crew, /settings/subscriptions and /settings/usage, each at desktop and phone. I ran tsc --noEmit and test/preview-looks.test.ts with test/check-looks-held.test.ts; all passed. I did not run bun scripts/gate.ts (I listed scripts/ but never ran it) or scripts/design-lint.ts.
What changed
- Looks list:
PREVIEW_SETTINGS_PAGESinsrc/spawn/preview-looks.tsnames the four pages and is added toPREVIEW_OWNER_LOOKS. The pictures are taken as the owner and shown to the pull's writers through the existing owner-looks path, which I did not touch. - Seed:
- New step:
seedSettingsPagesinsrc/spawn/preview-seed.tsruns once for new and already-seeded previews, behind its own marker. - Rows: it adds one read-only token named "preview fake token, not a credential", and one agent,
preview-agent, for the crew page. The "preview sample" subscription was already seeded for new samples; the step adds it only if none exists, so older seeded previews get it too. - Refusal: it then requests each named page in-process as the admin and refuses to finish unless every one answers 200.
- Secret: the token page lists names only, so no secret reaches a picture. The token's real value is random and never shown.
- New step:
- Test:
test/preview-looks.test.tsasserts that the four pages are named at both widths. It also seeds a preview and checks that each page answers 200 and shows its seeded row. It fails without the change.
What I left out
- The usage page lists route patterns, not rows. It is only checked for 200.
- Heights for these pages wait on #9385.
- The forge's own check, including the cell-only suites, runs on push.
To try it Push to a pull of this repository and open the preview's Looks.
This round fixes both points @sentinel raised, and I agree with both. bun x tsc --noEmit, bun scripts/gate.ts and test/preview-looks.test.ts (7 tests) pass here. I did not run the rest of the suite; the forge's check does that on the push.
What changed
- One token across retries.
seedSettingsPagesinsrc/spawn/preview-seed.tsnow creates the "preview fake token" only if the admin doesn't already have one by that name. This is the same guard the agent and the subscription use. A red check no longer adds a token on each boot. I kept the marker where it was, after the page check, so a refused seed still tries again on the next boot. - Refusal test. A new test in
test/preview-looks.test.tsadds a page that answers non-200 toPREVIEW_SETTINGS_PAGESand expectsseedPreviewto return an error naming that path. It also checks that a retry leaves exactly one token. Deleting the page loop makes it fail, and it removes the extra page again afterwards. - Older preview. A second new test seeds a preview, then deletes its token and its
preview_settings_seededmarker to look like one seeded before this change. It checks that the nextseedPreviewreturnsseeded: false, gives the preview its settings rows, and that a further seed still leaves one token.
Not done: I didn't change how the page check itself works; it still asks each page as the admin through the in-process HTTP handler.
Try it: bun test test/preview-looks.test.ts.
A preview now takes owner looks of
/settings/tokens,/settings/crew,/settings/subscriptionsand/settings/usage, each at desktop and phone. I rantsc --noEmitandtest/preview-looks.test.tswithtest/check-looks-held.test.ts; all passed. I did not runbun scripts/gate.ts(I listedscripts/but never ran it) orscripts/design-lint.ts.What changed
PREVIEW_SETTINGS_PAGESinsrc/spawn/preview-looks.tsnames the four pages and is added toPREVIEW_OWNER_LOOKS. The pictures are taken as the owner and shown to the pull's writers through the existing owner-looks path, which I did not touch.seedSettingsPagesinsrc/spawn/preview-seed.tsruns once for new and already-seeded previews, behind its own marker.preview-agent, for the crew page. The "preview sample" subscription was already seeded for new samples; the step adds it only if none exists, so older seeded previews get it too.test/preview-looks.test.tsasserts that the four pages are named at both widths. It also seeds a preview and checks that each page answers 200 and shows its seeded row. It fails without the change.What I left out
To try it Push to a pull of this repository and open the preview's Looks.
Closes #9781