oficina / sheets Public

Smart door (Home step 6): Sheets 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 for Sheets (web only), following Docs' reviewed version (2e21630, oficina/docs #139). native/ and the native exchange are untouched. Not for merge: it needs the highest-model review (AGENTS.md §Review) and copy review.

The bump (one change)

  • rastrillo v0.27.1 → v0.42.0; connect + handoff → Home main 98726fa; estilo → main 468fab1 (door pills). go mod tidy (go line 1.25 → 1.26).

The door, as in Docs

  • SigninScreen + SigninOneWay on, SigninPath = connect.SigninPath, ForgetPath = /signin/forget. Every state (door, chooser, Sent, Keymail continuation, RenderConfirm's confirm step, refusal) is estilo-signin-screen over auth.SigninState. The tab title is rastrillo's for the state.
  • With Home, GET /signin → SigninDoor, /signin/local → SigninLocal (still under LocalGuard), /signin/oficina → SigninOficina. All three sit behind admittedOnly, which runs Sheets' real signed-in guard (signedInRequire) on a probe. A guard 503 is not treated as a refusal.
  • Continue with Oficina ID: FederatedDoor{ProviderOficina, connect.OficinaHref(r), "Oficina ID", chrome.OficinaGlyph} wherever OficinaHref is set. It is never set on /signin/local, on a step-up, or standalone.
  • Refusal (auth's Refused, or a session the guard refuses) goes in the app-problem slot with the email field, in a 403 for Refused. It shows only on the plain door, so ?ways= and ?way= stay reachable. A refused session's remembered Oficina ID is forgotten; a remembered email way is kept.
  • MintHomeSession stores the session, then remembers MethodFederated/ProviderOficina with connect.MintedPerson(r).Label. It does this only if the guard admits the session just minted (admittedAs), and carries nothing over.
  • Signed out: connect.PageFor(r, "signedout") + .Forgetting(...). With Home it posts chain=oficina and then redirects to {issuer}/forget?return=<origin>/signed-out; standalone it uses /signin/forget with no chain.
  • Return memory: Sheets had none, so this ports Docs' sealed returnMemory (Home DEK, __Host-oficina-sheets-home-return). - With Home, POST /signin removes return_to from Begin's form even when the body fails to parse, remembers it (/ when absent), and puts it back on Begin's redirect. - /auth/local/complete lands on the remembered page in place of /sheets, once. A plain /signin remembers /. - A plain /signin/local remembers nothing new and carries the kept page on its form. - Standalone, rastrillo's own return_to carry does the job.
  • Lagged / no Home: the door is email only, and /signin/oficina and /signin/local answer 404 as before.

rastrillo v0.27.1 → v0.42.0 changes handled

  • v0.29: a language with no pack is refused at start, so rastrillo.Serve would have refused to boot. _ ".../locales/en" is now linked (serving.go). RequireSession now carries return_to itself.
  • v0.30: browser tests ported to chromedp v0.21 (browser_steps_test.go: evalInto, command, setCookie).
  • v0.31: Assets minifies vendored paths, so tokens.css, theme.css and rastrillo.js are served minified. The asset tests now ask rastrillo.Assets what it serves.
  • v0.34: Fiesta. static/tokens.css is re-vendored from ui.TokensCSS(), which theme_assets_test pins. rastrillo doctor refuses to compare because go.mod still requires the pre-move github.com/carlosframework/rastrillo for native.go, which is native and not mine to touch. Screenshots of the share page are identical before and after.
  • v0.38: - SigninOneWay, FederatedDoor, AppProblem, lastsignin. - Sent is now /signin?sent=1&attempt=…; tests use sentAnswer, and the oracle test masks the attempt id. - Keymail continues on the door at /signin?continue=, so connect.OAuthContinuation, renderHomeOAuth and home_oauth.html are removed. - The link step-up is /signin/local?reauth=1.
  • v0.39: an unknown subject is now refused in every mode. Sheets sets no SubjectFor, so nothing changes.
  • v0.40–v0.42: nothing Sheets uses.
  • estilo: the appearance form gained estilo-appearance … data-busy="false", the sky moved to v3, and the signed-out primary gained estilo-signin-action. Tests are updated.

Native constraints (oficina-43): all kept

  • The NativeExchange mount sits ahead of /native/*.
  • cfg.Admit, MintNativeSession, the choose page and its failed fallback are unchanged.
  • All seven IsHomeDerived checks and the 7-day connect.Expired check are unchanged.
  • nativeApprover is unchanged.
  • No guard body changed. native_contract_test.go is untouched and passes.

Copy review

Added

  • Refusal, as approved by Paul on 2026-11-21: "That email can’t sign in to Sheets. Use a different email, or ask whoever runs this team to add it." A test pins it.
  • "Oficina ID", as a name. rastrillo draws it as "Continue with Oficina ID" (new in the spec).
  • Signed out gains estilo's "Forget me on this device" (new).

Removed (Sheets' own; rastrillo's approved copy covers them)

  • "Too many attempts. Wait a few minutes, then try again."
  • "That doesn’t look like an email address."
  • "That link has expired or was already used. Enter your email to get a new one."
  • "Your keymail sign-in couldn’t be completed. Enter your email to get a link instead."
  • "We couldn’t sign you in. Enter your email to get a new link."
  • The old refusal: "That address can’t sign in to Sheets. Use a different address, or ask someone to share a sheet with it."
  • The confirm lede: "Select Sign in to finish signing in."
  • The Keymail page body: "Taking you to Keymail to finish signing in."

Now rastrillo's words where estilo's were

  • Heading "Sign in" → "Sign in to Sheets".
  • Label "Email address" → "Email".
  • The help line "We’ll email you a link… 15 minutes." is gone.
  • 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."
  • "Use a different address" → "Use a different email".
  • Continuation → "Taking you to Keymail" / "Taking you to Keymail to confirm it's you." / "Continue to Keymail".

Tab titles

  • "Sign in · Sheets" → "Sign in to Sheets"
  • "Check your email · Sheets" → "Check your email to sign in to Sheets"
  • New: "Other ways to sign in to Sheets", "Problem signing in to Sheets", "Taking you to Keymail to sign in to Sheets"
  • "Signed out · Sheets" is unchanged.

Tests

  • New signin_door_*_test.go (split for the 300-line cap) covers: - every route and state, with and without Home; - the refusal slot, both modes, plus Paul's wording; - a refused session at /signin and /signin/local: the refusal shows, the Oficina ID record is forgotten, the email record is kept, and Other ways is reachable; - Oficina ID remembered with the address; a Home-only member with none; no carry-over; nothing on unknown or unadmitted; rememberOficina only for an admitted minted session; - the chained Forget and a cross-site refusal; standalone Forget; - the estilo contract ([estilo-signin-screen] > section has only the door) across 8 states plus confirm; - a step-up post keeping reauth=1 and return_to, for a bad address and for Sent; - the link step-up end to end (stale → /signin/local?reauth=1 → email → /account/home); - confirm leaving the record alone; - the return memory: landing, a plain /signin/local, a post without return_to, a parse failure, and standalone landing.
  • New signin_browser_test.go (TestSmartDoorInABrowser, added to make test-browser): - 15 states at 320px and 1280px, the widest included: a long remembered address, Keymail, confirm, the continuation, a refusal and signed out; - no sideways scroll, 24px targets, and the glyph is drawn; - the test forces light itself via Emulation.setEmulatedMedia.
  • Local results: - the make test steps (vet with the browser tag, fmt, build, migration check, go test ./..., race) pass on Homebrew Go 1.27.3; - the browser suite (OnTap|DocumentStyles|SmartDoorInABrowser|FormatMenuFits) passes in headless Chrome forced to light.

Notes for the record

  • MIGRATING.md on Sheets: - auth SigninPath was already /signin; signinFormPath only drove the Sent link. - Sheets does have an admission step before /signin: its guards sign a refused session out (#39). That ends the loop, but the next door can't say why. admittedOnly now covers a refused session that reaches the door itself.
  • Colophon: Sheets has no Colophon (no colophon.json, no generator, no TestColophonsMatchWhatShips), so nothing panics and there's nothing to regenerate. I did not open the estilo colophon/sheets-rastrillo-v040 branch; Sheets' Colophon is its own piece of work.
LLM

Sheets moves to the smart door, as Docs did: rastrillo v0.42.0 + connect/handoff 98726fa + estilo 468fab1 in one bump. /signin is the door with Continue with Oficina ID, admission-checked; Oficina ID remembered in MintHomeSession for admitted sessions; Forget chained to id.*; Docs' return memory ported. Needs highest-model review + copy review; not for merge.

Hub CI on 7b33142 passed in full: vet (incl. the browser tag), fmt, build, migrations, go test ./... and race. main has not moved since 03d52db.

Fable's fixes are in 3d9e3f2. Hub CI passed on it. make test passes, and make test-browser passes in Chrome forced to light. Each new test was seen to fail with its fix reverted.

  1. The 503 branch is proved. In team mode with the identity table dropped, the guard answers 503, and /signin then: - draws no refusal; - keeps the remembered Oficina ID; - keeps the session.

rememberOficina remembers nothing on a 503 and leaves the session alive. An admitted /signin sets no cookie on the real response.

  1. Return memory negatives. - //evil.example/x, https://evil.example/ and /\evil.example each land on /sheets. - A tampered, an expired and a duplicated cookie each read as /.
  2. AGENTS.md. doctor refuses while native.go needs the pre-move path. Until that moves, static/tokens.css is re-copied from ui.TokensCSS() and pinned by TestSharedThemeAssetFingerprintAndCache, and doctor's template checks are blind.
  3. /signed-out. returnMemory.remember treats /signed-out (with or without a query) as /. Tested.
  4. Refused session cookie. admittedOnly now clears the refused session's cookie on the door's own response.
  5. Return cookie. __Host-oficina-sheets-home-return is cleared by forget and by Home Sign out (homeSignout wraps connect's). Standalone never sets it.
  6. Further bumps that came with the change, not listed above: - github.com/modelcontextprotocol/go-sdk 1.7.0 → 1.8.0; - github.com/go-json-experiment/json 20250725 → 20260820 (c27c302e5fc3); - golang.org/x/net 0.57.0 → 0.58.0; - golang.org/x/tools 0.48.0 (new indirect); - chromedp's gobwas/* and sysutil dropped; - the go line 1.25.0 → 1.26.0.
  7. Makefile. The comment names the four tests the filter runs (OnTap matches both TestNoZoomOnTap and TestFormatMenuFitsOnTap). It also says how Chromium is found: the Playwright cache glob is Linux-only, so on a Mac set RASTRILLO_CHROME.

Follow-up, not fixed here (5). grants.go Admits returns false on a DB error. On a read failure, the admission probe therefore reads a refusal: the door shows the refusal and forgets a remembered Oficina ID. The guard has the same shape, since it signs such a session out. A fix would make Admits report "could not check" separately, and have the guard and probe treat that as their 503.

The refusal wording stays as is while it's with Paul.

Review: Claude Fable (claude-fable-5-2). 7b33142: APPROVE AFTER FIXES (no blockers; every native constraint verified). 3d9e3f2: APPROVE. Open follow-ups, not blocking: Admits returning false on a DB error; a team-mode door refusal test. Copy: the refusal wording is with Paul (copy review #4); the merge waits on it.

Copy: Paul approved the refusal wording as drafted (2026-11-22): 'That email can’t sign in to Sheets. Use a different email, or ask whoever runs this team to add it.' Every other string is already approved (rastrillo's door copy, or Docs' wording with the name swapped).