oficina / home Public

Spec: the smart door — remember how you last signed in (draft for Paul)

Paul 2026-11-19 asked for a sign-in screen that remembers the last method,
like Tito and ElevenLabs. Records his three rulings (sealed address cookie,
existing methods only, web first), maps what rastrillo already ships, and
lists the new pieces: Oficina ID as a remembered method, a Last used chip,
Home's own jar under a proposed ruling 26. Three questions for Paul.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 9554aee6ea761bd4af96a3959dd34bbefe1add9c parent 0731690
1 file changed, +184 −0
  • docs/superpowers/specs/2026-11-19-smart-door.md +184 −0

CI cancelled — superseded by a newer push — run details

CI log
amadan: .amadan/timeout: this job's budget is 20m0s (this runner allows up to 30m0s)
=== vet ===
CGO_ENABLED=0 go vet ./...
CGO_ENABLED=0 go vet -tags browser ./internal/home/
cd handoff && CGO_ENABLED=0 go vet ./...
cd roster && CGO_ENABLED=0 go vet ./...
cd dashboard && CGO_ENABLED=0 go vet ./...
cd connect && CGO_ENABLED=0 go vet ./...
cd teammode && CGO_ENABLED=0 go vet ./...
=== fmt ===
=== build ===
CGO_ENABLED=0 go build ./...
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build ./cmd/home ./cmd/oficina ./internal/operatorlaunch
cd handoff && CGO_ENABLED=0 go build ./...
cd roster && CGO_ENABLED=0 go build ./...
cd dashboard && CGO_ENABLED=0 go build ./...
cd connect && CGO_ENABLED=0 go build ./...
cd teammode && CGO_ENABLED=0 go build ./...
=== go-test ===
CGO_ENABLED=0 go test -count=1 ./...
?   	amadan.net/oficina/home/cmd/home	[no test files]
ok  	amadan.net/oficina/home/cmd/home-placeholder	0.869s
?   	amadan.net/oficina/home/cmd/oficina	[no test files]
ok  	amadan.net/oficina/home/internal/guardstest	0.125s
ok  	amadan.net/oficina/home/internal/home	50.797s
ok  	amadan.net/oficina/home/internal/home/directorydata	1.392s
ok  	amadan.net/oficina/home/internal/home/logtest	0.005s
ok  	amadan.net/oficina/home/internal/home/seal	0.003s
ok  	amadan.net/oficina/home/internal/home/sealtest	0.003s
ok  	amadan.net/oficina/home/internal/home/wisp	0.041s
ok  	amadan.net/oficina/home/internal/operator	6.375s
ok  	amadan.net/oficina/home/internal/operatorlaunch	4.115s
ok  	amadan.net/oficina/home/internal/provisioner	48.737s
cd handoff && CGO_ENABLED=0 go test -count=1 ./...
ok  	amadan.net/oficina/home/handoff	0.667s
ok  	amadan.net/oficina/home/handoff/seal	0.002s
cd roster && CGO_ENABLED=0 go test -count=1 ./...
ok  	amadan.net/oficina/home/roster	5.125s
cd dashboard && CGO_ENABLED=0 go test ./...
ok  	amadan.net/oficina/home/dashboard	0.010s
cd connect && CGO_ENABLED=0 go test -count=1 ./...
ok  	amadan.net/oficina/home/connect	1.346s
ok  	amadan.net/oficina/home/connect/linkstore	0.436s
cd teammode && CGO_ENABLED=0 go test -count=1 ./...
ok  	amadan.net/oficina/home/teammode	0.101s
?   	amadan.net/oficina/home/teammode/teammodetest	[no test files]
=== race ===
go test -race -count=1 ./internal/home/ ./internal/operator/ ./internal/operatorlaunch/ ./internal/home/directorydata/

amadan: job cancelled — a newer push superseded it
diff --git a/docs/superpowers/specs/2026-11-19-smart-door.md b/docs/superpowers/specs/2026-11-19-smart-door.md
new file mode 100644
index 0000000..aa4091f
--- /dev/null
+++ b/docs/superpowers/specs/2026-11-19-smart-door.md
@@ -0,0 +1,184 @@
+# 🤖 The smart door: remember how you last signed in
+
+Status: **draft for Paul's approval**, 2026-11-19. No code before approval.
+Author: Claude (Opus 5.5), for Paul.
+
+## The ask and the rulings
+
+Paul, 2026-11-19: "Can we level up our ID flow? Inspired by e.g. Tito and
+Eleven, there should be a smart sign in screen that remembers the last
+signin method used."
+
+Paul's three rulings, picked the same day:
+
+1. **Remember the address too, sealed.** It lives in a cookie on the person's
+ own device, sealed so only that host can read it. It is never kept at rest
+ on any server. The door shows it back only to that browser. This amends
+ Home's one rule (see "Home's one rule" below).
+2. **Methods are the ones we have:** passkey, emailed link or Keymail, and
+ Oficina ID. No Apple or Google sign-in, which would need its own spec.
+3. **Slice 1 is the web:** id.oficina.works plus estilo's door, the sign-in
+ page every app shares. Native sign-in sheets come later.
+
+## What already exists (most of it)
+
+- **rastrillo has shipped a remembering sign-in screen since v0.27**
+ (2026-09-28, plan `rastrillo/docs/superpowers/plans/2026-09-27-signin-screen.md`,
+ copy approved in copy review). `auth.Config.SigninScreen` turns it on.
+ `lastsignin` keeps the way in (keymail, magic link or passkey) plus the
+ address, in a sealed, host-only, HttpOnly cookie that lasts 400 days. The
+ cookie is bound to its origin, renewed on every sign-in, and kept on sign-out.
+ `auth.Forget` is the "Use a different email" button. The `ui` partial
+ `signin` draws these doors: *ask*, *link* ("Continue as {address}"),
+ *keymail*, *passkey* ("Sign in with your passkey" first), *sent*, *confirm*
+ and *continue*. The cookie is never evidence of anything: a one-tap posts the
+ address to `Begin`, which checks it from scratch, and the screen consults no
+ store, so it can't reveal whether an address is known.
+- **Of the suite, only Equipo has it turned on.** Every other app draws estilo's
+ door (`chrome.SignIn`), which is a bare email form. Docs, Sheets, Slides,
+ Calendar, Calls and Memoria pin rastrillo v0.27.1 to v0.29.2; Fichas and Mapa
+ pin v0.35. All of them are new enough.
+- **Home (id.oficina.works) has its own sign-in**, not rastrillo `auth`,
+ because Home is blind. It shows a passkey button once script runs, then the
+ email form. It remembers nothing.
+- **Docs with Home configured** sends `/signin` straight to Oficina ID. The
+ email form is at `/signin/local`.
+
+So most of the level-up is **adoption**. Three pieces are new: Oficina ID as a
+remembered method, a "Last used" chip, and Home remembering for itself.
+
+## What each door shows
+
+The method used last on this browser goes first, as the primary button. The
+other methods follow an "or". Once two or more methods are on the card, the
+remembered one wears a small **Last used** chip. Every remembered door ends
+with the ghost button **Use a different email**, which forgets this browser's
+record. Unless marked *new*, all copy is rastrillo's approved copy.
+
+**An app's door** (Docs shown; any app with Oficina ID configured):
+
+| Last used here | First | Then |
+|---|---|---|
+| nothing | *new* **Continue with Oficina ID** | or · Email field · Continue |
+| Oficina ID | *new* **Continue with Oficina ID** · Last used | or · Continue as {address}, if one is remembered, else the field · Use a different email |
+| emailed link | **Continue as {address}** · Last used | or · Continue with Oficina ID · Use a different email |
+| Keymail | **Continue to Keymail** as {address} · Last used | or · Continue with Oficina ID · Use a different email |
+
+An app without Oficina ID configured gets rastrillo's screen unchanged, with
+no chip, inside estilo's door.
+
+**id.oficina.works** (the brand is "Oficina ID"):
+
+| Last used here | First | Then |
+|---|---|---|
+| nothing | **Sign in with a passkey** | or · Email field, which also offers passkeys as autofill (WebAuthn conditional UI) · Continue |
+| passkey | **Sign in with your passkey** · Last used | or · Continue as {address} (or the field) · Use a different email |
+| emailed link / Keymail | **Continue as {address}** · Last used | or · Sign in with a passkey · Use a different email |
+
+**Signed out** (every app): "You're signed out", **Sign in again**, and a
+quiet *new* **Forget me on this device**, which posts to `Forget` for a shared
+computer.
+
+**The returning path for an Oficina ID user** on an app: tap Continue with
+Oficina ID; id.oficina.works opens on Sign in with your passkey; one touch;
+back in the app. If an id.* session is still alive, it's the existing
+Continue page instead of the passkey. Skipping that Continue stays a separate
+question (native spec, question 3).
+
+## The cookie
+
+It is lastsignin's cookie, unchanged in format. Every host keeps its own,
+because a parent-domain cookie is ruled out. Docs on `paulca.docs.oficina.works`
+and id.oficina.works each remember for themselves. That is what we want: each
+door reflects how *that* door was last used.
+
+Two changes to lastsignin:
+
+- **A federated method:** `MethodFederated` plus a closed, app-set `Provider`
+ label (`"oficina"`). rastrillo stays generic, and the label names nothing
+ about the person. Home's `connect` writes it when it mints a Home-derived
+ session (`Bridge.Finish`), using a jar the app hands it (`auth.RememberJar`).
+- **The address carries over.** A passkey or federated sign-in keeps any
+ address the record already held, instead of blanking it. An Oficina ID
+ assertion carries no email (slice 1 spec), so this is the only way an app
+ can still offer "Continue as {address}" as the second option.
+
+The jar on id.oficina.works is built with `lastsignin.New` directly. Its
+instance key is derived from `HOME_DEK` with its own HKDF label
+(`home/lastsignin/v1`), and the origin is `https://id.oficina.works`.
+
+## Home's one rule
+
+Rastrillo's blind mode turns off address-remembering cookies on purpose,
+because Home's rule is "never stores a readable address". Paul's ruling 1
+allows the following, and nothing wider. It becomes **Home ruling 26**,
+recorded in the design spec's §1 table and in AGENTS.md's gloss when this
+lands:
+
+> Home may seal the address a person typed into a cookie on **that person's
+> own device**, and render it back **only to the browser that presents it**.
+> It is never written at rest by Home: not to the database, a log, an error,
+> a metric or a queue. It is not evidence of identity, and the page that
+> shows it consults no store.
+
+The falsifiable form is unchanged. Publish Home's database in full, and
+nothing in it is a readable address. Gates 1 and 2 stay as they are. Gate 9
+gains the cookie's name and value as a canary, so neither may appear in a log
+line.
+
+What this costs, stated plainly: anyone using that browser sees the
+address, and so does anyone holding the cookie, who can load the door with it.
+"Use a different email" and "Forget me on this device" are the answer. Rotating
+`HOME_DEK` forgets everyone, which is harmless: the cookie reads as Invalid
+and is cleared.
+
+## Script, flashes and layout
+
+- Every door works with script off, except passkeys, which need their ceremony
+ script (ruling 25).
+- **No pop-in on a remembered passkey.** Today rastrillo writes the passkey
+ button `hidden` and the module reveals it. On the passkey door, where the
+ button is the primary, that moves the page after load. On that door alone,
+ the button is drawn visible and disabled, with its space reserved; the
+ module enables it. Without script, the button stays disabled with a single
+ line saying passkeys need JavaScript, and the email option sits right below
+ it.
+- The chip is plain text in the button's row. No new font and no icon font
+ (never FOUT).
+
+## The work, in order
+
+1. **rastrillo:** `MethodFederated` + `Provider`, address carry-over, a
+ federated slot in the `signin` partial, the Last used chip, the
+ passkey-door no-shift fix and the new strings. Browser drives and axe run
+ on every new state, as for the existing ones. Release as a minor version.
+2. **estilo:** `estilo-signin-screen`, rastrillo's `signin` partial inside the
+ door chrome (sky, card, app mark), taking `SigninState`, `Brand`, `Sky` and
+ an optional Oficina ID action. `estilo-signin` stays for apps that haven't
+ moved. The signed-out page gains Forget me on this device.
+3. **Home `connect`:** `Bridge.Finish` remembers the federated method through
+ the jar the app passes in.
+4. **Home id.oficina.works:** the jar, the three doors above, conditional UI
+ in `passkey.js`, ruling 26 and the gate 9 canary.
+5. **The apps,** Docs first, then Sheets, Slides, Calendar, Calls, Memoria and
+ Fichas. Each one turns `SigninScreen` on, renders `estilo-signin-screen`,
+ bumps estilo and rastrillo, and keeps its own error strings only where
+ rastrillo's don't cover them. Equipo moves its existing screen into the
+ door chrome. Docs stops redirecting `/signin` to Oficina ID and shows the
+ door, with Oficina ID first (see question 1).
+6. **Later, native:** the kit's sign-in sheet reads the last-used method from
+ the App Group, which already holds the last-used (identity, team).
+
+Reviews follow the Amadan workflow, with a Fable (or Astra) review before each
+merge. New copy goes through copy review.
+
+## Questions for Paul
+
+1. **Docs's instant hop to Oficina ID.** Should `/signin` keep jumping
+ straight to id.oficina.works, or show the door with Continue with Oficina
+ ID first? *Recommended: show the door.* It costs one tap, and it lets
+ someone pick email after signing out, which the hop doesn't.
+2. **The chip's word.** "Last used" (ElevenLabs), or "You used this last
+ time"? *Recommended: "Last used".*
+3. **Forget me on this device** on the signed-out page. *Recommended: yes.*
+ It is the shared-computer answer for an address we now remember.