oficina / docs Public

Smart door (Home step 6): Docs adopts rastrillo's one-way sign-in screen in estilo's door open

On branch feat/smart-door

Home spec 2026-11-19-smart-door.md step 6, Docs first, following home/connect MIGRATING.md's step-6 checklist. Web only; native/ untouched. Not for merge yet: CI is red on one test, TestColophonsMatchWhatShips, until estilo's catalog gains three projects (estilo branch colophon/rastrillo-v040-deps, below). It needs a highest-model review and copy review.

What the branch does

  • One bump (estilo AGENTS.md: past 8da96ff needs rastrillo ≥ v0.38.0 in the same change): rastrillo v0.29.2 → v0.40.0, connect + handoff → Home main 83c36b8, estilo → main 487cadb. go mod tidy.
  • The door: SigninScreen + SigninOneWay on, SigninPath = connect.SigninPath, Forget at /signin/forget. Every state (door, chooser, Sent, Keymail continuation, RenderConfirm's confirm step, refusal) is estilo-signin-screen over auth.SigninState. HideBrand is estilo's.
  • Routes with Home: GET /signin → Routes.SigninDoor, /signin/local → Routes.SigninLocal, /signin/oficina → Routes.SigninOficina. The first and the last sit behind Docs' admission check (admitted + withoutCookie). /signin no longer hops to id.* (Paul's answer 1).
  • Continue with Oficina ID: FederatedDoor{Provider: oficina, Href: connect.OficinaHref(r), Label: "Oficina ID", Icon: chrome.OficinaGlyph} wherever OficinaHref is set. It is not set on /signin/local, on a step-up, or standalone.
  • Refusal in the app-problem slot (AppProblem{Ask: true}), with the email field.
  • Remembering: MintHomeSession stores the session, then writes RememberJar().Remember(MethodFederated, ProviderOficina, Address: connect.MintedPerson(r).Label). A Home-only person gets no address, and nothing carries over. Email, link and Keymail are rastrillo's.
  • Signed out: estilo .Forgetting ("Forget me on this device"). With Home the form posts chain=oficina. After rastrillo's Forget answers, Docs redirects to {issuer}/forget?return=<origin>/signed-out. The door's "Use a different email" uses the same Forget without the chain.
  • Return path: POST /signin takes return_to off Begin's form. Docs remembers it in its sealed return memory instead, so a local sign-in still lands on /auth/local/complete, connect's resume point (its README requires this). Docs puts it back on Begin's redirect to the door.
  • Title: the door's <title> is rastrillo's for its state (estilo-signin-screen-title, which already names Docs).

rastrillo v0.30–v0.40 changes handled

  • v0.30: chromedp v0.21's generic API. All five browser test files are ported (commit a33ebb3), with Evaluates that may return null read through pointers.
  • v0.31: Assets minifies vendored paths. Docs' estilo theme (static/theme.css) and busy shim (static/rastrillo.js) sit at vendored names, so they are now served minified, and their hashes changed. The theme and busy tests expect the minified bytes. The door looks right in Chromium (screenshots checked).
  • v0.31/0.34: new linked deps fiesta, tdewolff/minify and parse. These are the Colophon gap.
  • v0.38: SigninOneWay, FederatedDoor, AppProblem, lastsignin MethodFederated; the link step-up is now /signin/local?reauth=1.
  • v0.39: HideBrand. An unknown subject is now refused in every mode. Docs sets no SubjectFor, so nothing changes.
  • With SigninScreen on, a Keymail start is 303 /signin?continue= (Docs' own continuation page and keymailDestination are gone). A stray Keymail callback now leaves the attempt alone (rastrillo's otherAttempt). Tests are updated to match.

Copy review

Docs adds no catalog key. User-visible changes:

  • Removed Docs keys (rastrillo's approved copy covers them): docs.signin.keymail "Continue to Keymail", docs.signin.error.rate, .address, .expired, .unknown.
  • Kept: docs.signin.error.refused, "That address can’t sign in to Docs. Use a different address, or ask whoever runs this team to add it." It now sits in the app-problem slot. Note that it says "address" while the door now says "email".
  • New label: "Oficina ID", a name, so it is not a catalog key, the same as the door's "Docs". rastrillo draws it as "Continue with Oficina ID" (new in the spec).
  • Now rastrillo's words, where estilo's were: - heading "Sign in" → "Sign in to Docs"; - label "Email address" → "Email"; - help line "We’ll email you a link… 15 minutes." removed; - submit "Sign in" → "Continue"; - Sent: "If that address can sign in here, we’ve sent it a link…" → "We sent a link to your inbox. The link works once and expires soon." (or "…to {address}."); - "Use a different address" link → "Use a different email" button; - confirm heading "Sign in" → "Sign in to Docs".
  • Tab titles: - "Sign in · Docs" → "Sign in to Docs"; - "Check your email · Docs" → "Check your email to sign in to Docs"; - new: "Other ways to sign in to Docs", "Problem signing in to Docs", "Taking you to Keymail to sign in to Docs".
  • Signed out: adds estilo's "Forget me on this device" (new).

Tests

  • New signin_smart_door_test.go: - every route and state, with and without Home; - Oficina ID remembered, including for a Home-only person; no carry-over; nothing remembered on unknown; - the chained Forget, including a cross-site refusal; - the refusal slot; - the estilo contract: [estilo-signin-screen] > section has the door as its only element child. It covers first visit, Oficina ID remembered, email remembered, the chooser, a problem, Sent, a step-up, /signin/local and the confirm step.

Each new test was seen to fail against a mutation of the code it covers.

  • New signin_browser_test.go: every state reflows at 320px, every target is at least 24px, and the glyph is drawn.
  • Local go test ./... is green except TestColophonsMatchWhatShips. The suite needs the official toolchain, because Homebrew Go has no LICENSE, and a short TMPDIR for the unix-socket tests on macOS.
  • All browser tests pass (chromedp suite and the Playwright engines, Chromium and WebKit) in headless Chrome forced to light, through a RASTRILLO_CHROME wrapper that adds preferredColorScheme=1 to --blink-settings (this Mac is dark).

Open

  • Colophon: estilo colophon/rastrillo-v040-deps adds Fiesta, minify and parse. Once it lands, re-pin estilo here and run go run ./cmd/docs-colophon. That combination passes locally under a replace.
  • Two small inaccuracies in MIGRATING.md for Docs: - Docs never set auth SigninPath to /signin/local; only its "Use a different address" link went there. - Docs with Home already drew /signed-out through connect's SignedOut.
  • rastrillo nit: a standalone app with only email shows an empty chooser at a hand-typed /signin?ways=1. Nothing links to it.
LLM

Docs moves to the smart door: rastrillo v0.40.0 + connect 83c36b8 + estilo 487cadb in one bump, /signin is the door with Continue with Oficina ID, Oficina ID remembered in MintHomeSession, Forget on signed-out chained to id.*. CI red only on TestColophonsMatchWhatShips until estilo colophon/rastrillo-v040-deps lands. Needs review + copy review; not for merge yet.

Follow-ups:

  • The estilo catalog branch is open as oficina/estilo #40 (colophon/rastrillo-v040-deps).
  • Hub CI on a0efc7c fails only on TestColophonsMatchWhatShips, as expected. Everything else in the gate passed: Rust, wasm, wire and the rest of go test ./....
  • Browser checks, forced to light: the whole -tags browser suite passes, chromedp and Playwright Chromium and WebKit, including the new TestSmartDoorInABrowser.
  • scripts/browser-drive.sh hangs after "driving" on this Mac, on this branch and on origin/main alike (240–420 s timeouts). I didn't investigate; it is not this branch.

Review fixes for Fable's A2–A6 are in 455d60b.

  • A2. MintHomeSession now asks the signed-in routes about the session it has just minted (admittedAs). It writes the Oficina ID record only if that session is admitted. - A refused session reaching /signin, /signin/oficina or /signin/local (or standalone /signin) now gets the door with the refusal in the app-problem slot and the email field. - That door also forgets a remembered Oficina ID, so the loop can't start again. A remembered email way is kept. - Test: a linked guest, revoked, signs in through Oficina ID.
  • A3. A plain /signin/local remembers nothing new, and its form carries the page already remembered. With its own return_to, it remembers that page.
  • A4. A post without return_to remembers /.
  • A5. return_to comes off Begin's form even when the body fails to parse.
  • A6. New tests: - a step-up post keeps reauth=1 and return_to, for both a bad address and Sent; - confirming a link leaves the remembered record alone; - the browser test forces light itself, through Emulation.setEmulatedMedia, and passed with the plain Chrome on this dark Mac. It now also measures the widest states: a long remembered "Continue as", Keymail, confirm, the continuation (in preview) and a refusal; - the asset test asks rastrillo.Assets what it serves.

Each fix was seen to fail its test when reverted.

No wording changed. The local suite is green apart from TestColophonsMatchWhatShips, and so is the full -tags browser suite. Hub CI on 455d60b fails only that test, which stays red until A1, after estilo #40 lands.

N1 is fixed in 24429d6. The refusal now shows only on the plain door. The chooser (?ways=) and a way's own page (?way=) show no refusal, so a refused person can reach Other ways, including Oficina ID under another account. Standalone Docs has only email, so it has no chooser to reach.

Test: TestARefusedSessionCanReachOtherWays, run with Home and standalone. It fails when the fix is reverted.

Hub CI on 24429d6 fails only TestColophonsMatchWhatShips. A1 still waits on estilo #40.

A1 and copy review #3 are in ab69196.

  • Colophon (A1): estilo is pinned to main 6b55b0e (#40 landed), the only module here that pins it. go run ./cmd/docs-colophon regenerated internal/docs/colophon.json, and TestColophonsMatchWhatShips and internal/shipped now pass.
  • Copy review #3: Paul approved everything as drafted. docs.signin.error.refused is now "That email can’t sign in to Docs. Use a different email, or ask whoever runs this team to add it.", and a test pins it. Docs has only English, so there are no other locales to translate. The tab title stays rastrillo's "Sign in to Docs", with the title-test exception kept.
  • Tests: the local Go suite passes; one load timeout in cmd/docs passed when re-run alone. The full -tags browser suite, forced to light, passes.
  • Hub CI on ab69196: passed in full (exit 0).

Ready to merge when you are. Not merged.

Review: Claude Fable (claude-fable-5-2). a0efc7c APPROVE AFTER FIXES (A1-A6); 455d60b APPROVE apart from A1, with one low finding N1, fixed in 24429d6; A1 done in ab69196 after estilo 6b55b0e landed. Copy: Paul approved #3 as drafted (2026-11-21). CI passed at ab69196.