oficina / memoria Public

Smart door (Home step 6): Memoria 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 Memoria (web only), following Calls (9220b05, oficina/meet #46), Calendar (b9042ea, #48), Slides (d2e830f, #49), Sheets (66e5391, #71) and Docs (2e21630, #139), with every fix those reviews asked for built in up front, each with a test. native/, native.go, the rastrillo/native pin and the old-path sessions import are untouched. Not for merge: it needs the highest-model review and copy review.

The bump (one change)

  • rastrillo v0.27.1 → v0.43.0 (latest tag; v0.43 only adds named operations, which Memoria doesn't use); connect 14c83d7 + handoff ff16bf5 → Home main 150d94e; estilo 260f98c → main 468fab1. go mod tidy: chromedp v0.14 → v0.21 + cdproto v0.158.6, go-sdk 1.8.0, go-json-experiment c27c302, x/net 0.58, new indirect fiesta 1.5.0, tdewolff minify v2.24.19 + parse v2.8.16, x/tools.

The door

  • SigninScreen + SigninOneWay, SigninPath = connect.SigninPath, BeginPath = /auth/begin (Memoria's Begin route, unchanged), ForgetPath = /signin/forget. Every state is estilo-signin-screen over auth.SigninState (signin.go), titled with rastrillo's words (Frame.WholeTitle), and drawn signed out.
  • With Home: /signin → SigninDoor, /signin/local → SigninLocal (under LocalGuard), /signin/oficina → SigninOficina, each under Home's session middleware and then admittedOnly; choose page mounted. Standalone: /signin is the email door; /signin/local, /signin/oficina and choose answer 404.
  • Admission probe (signin_admission.go) replaces signin's admissionOf/offboard check: requireSession (rastrillo RequireSession, then the owners list through identity and the Home link, or the roster in team mode) on a probe GET /. - Web sessions only (magiclink, keymail, home-assertion); connect's native methods, guests and anything else are never judged, refused, remembered or ended. - Any 5xx is undecided. Outside team mode a Home link that could not be read answered 404, which the probe would read as a refusal; requireSession now answers a no-store 503 (homeUnavailable). This changes that page answer (404 → 503), including on /api/native/* in that storage-failure case; team mode already answered 503 there. - Removal ends the session at the door, not in the probe: offboard skips its sign-out under the probe (probing); refusedSession ends it. - The routes' standing gate is not in the probe (an unlinked local account goes on to /account/home, a way on, not a refusal).
  • Refusal / removal: auth's Refused → Paul's refusal; a session requireSession ends as removed → Memoria's existing removal sentence. App-problem slot, plain door only; cookie cleared on the door's response; Oficina ID forgotten, email way kept; ?err=refused typed in shows nothing.
  • Remembering: MintHomeSession → rememberOficina, strict probe of the minted session (admittedAs), connect.MintedPerson's address, none for a Home-only member, no carry-over.
  • Return memory (Memoria's existing sealed __Host-memoria_return): beginSignin (outermost on POST /auth/begin, both modes) takes return_to off Begin's form even on a parse error, remembers it, forgets on a post without one, puts it back on Begin's redirect; a plain /signin forgets, a plain /signin/local carries the kept page; /signed-out is never kept; every landing (/auth/landed, landedAfter) spends it before it answers (Calls' /continue lesson), so a second landing goes to /; Forget and Sign out clear it.
  • Signed out: connect.PageFor("signedout") + .Forgetting; with Home chain=oficina → {issuer}/forget?return=<origin>/signed-out. /signed-out is mounted in both modes (connect's SignedOut with Home, Memoria's own standalone); a test holds it at 200 without Home.
  • No sameAnswer here. Memoria's equivalent is beginGuard (gate 33: no classifier dial for a non-owner), which is not error hiding: it answers before Begin. It now answers a stranger with rastrillo's AnswerAsSent (Begin's Sent without the mail): a plain ?sent=1 would lack the attempt= and attempt cookie an owner gets, an oracle on the first try. Its server-side address shape check now answers in Begin's shape (?err=address, keeping force and reauth; return_to put back by beginSignin).
  • [rst-seg-tabs]: Memoria, estilo's bar and connect's pages use none, so v0.42's tab margin cannot reach it.

API changes handled

  • connect: Routes.Signin removed → three routes; PageData own struct + ForgetAction; link step-up /signin/local?reauth=1; Config.Admit required with HomeOnly/Unlinked (team mode would not boot) → teamAdmit + choose page in connect's English (home.html); OAuthContinuation/renderOAuth/signin_oauth.html gone (Keymail continues on the door at /signin?continue=).
  • rastrillo: English locale pack linked (serving.go); v0.29 RequireSession carries return_to; v0.31 minified assets (no Memoria test pinned served bytes); v0.38 Sent's attempt=; chromedp v0.21 port of the 8 browser files (Slides' evalInto etc. in browser_steps_test.go; ⌘C/Ctrl+C no longer type a character since chromedp v0.18; Browser.grantPermissions sent by hand, as cdproto v0.158 dropped it).
  • rastrillo doctor: still refuses, documented in AGENTS.md: go.mod requires github.com/carlosframework/rastrillo v0.23.0 for native.go's handle to rastrillo/native's server (native, not mine; Calendar and Sheets are in the same place). Done by hand instead: tools/vendorassets (tokens.css, Fiesta 1.5.0), scripts/writeestilo (theme, chrome, busy files from 468fab1), migrate-templates -write (6 templates; 15 rendered pages byte-identical apart from timestamps; the fragment set now gets ui.Funcs for localizer), make credits. No manifest/app.toml, so no gen/; generate --check isn't in make ci. Sky route v1 → v3.
  • Migrations: Home linkstore 0003_choice_proofs (additive, applied at boot with Home configured; in team mode before the marker check as before). Memoria's own, auth's, sessions' and handoff's unchanged; migration-check passes.

Native

Untouched. Memoria's native sessions are copies minted by rastrillo/native's exchange; the app calls only /api/native/* with them and never reaches a door, and the door only ever ends the one session the browser presented. The one behaviour change on a native-called path is the storage-failure 503 above (was 404).

Credits

/help/open-source is generated by estilo's oficina-notices over the production graph (make credits), with no per-app "uses" notes, so no estilo branch. Regenerated: + Fiesta v1.5.0, minify v2.24.19, parse v2.8.16 (+ rastrillo's new notice files); rastrillo, go-sdk, json bumped.

Copy review

Changed: refusal → "That email can’t sign in to Memoria. Use a different email, or ask whoever runs this team to add it." (was "That address … a different address …"). Kept: "Your access has been removed, so you’ve been signed out. Ask whoever runs this team if that’s wrong." (now in the app-problem slot; the same sentence as Slides and Calls). Added (already approved): "Oficina ID" (a name; rastrillo draws "Continue with Oficina ID"); team choose page in connect's English ("Welcome to the team" / body / "Connect my existing account" / "I’m new here — continue with Oficina ID"; the no-choice fallback is connect's "failed" with "Connect your Oficina account"); signed out "Forget me on this device". Removed (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." · "Keymail couldn’t finish signing you in. Enter your email and we’ll send you a link instead." · "We couldn’t sign you in. Enter your email to get a new link." · Memoria's own "Sign in again to continue." (rastrillo's identical string replaces it) · confirm lede "Select Sign in to finish signing in." · Keymail page "Taking you to Keymail to finish signing in.". Now rastrillo's words: heading "Sign in" → "Sign in to Memoria"; "Email address" → "Email"; help line gone; submit "Sign in" → "Continue"; Sent → "We sent a link to {address}/your inbox. The link works once and expires soon."; "Use a different address" link → "Use a different email" button; problems → "Too many tries. Try again in a few minutes." / "That doesn't look like an email address." / "That link has expired or was already used. Send a new one." / "Keymail couldn't confirm it's you." / "Something went wrong. Try again."; Keymail continuation → "Taking you to Keymail" / "Taking you to Keymail to confirm it's you." / "Continue to Keymail". Tab titles: "Sign in · Memoria" → "Sign in to Memoria"; "Check your email · Memoria" → "Check your email to sign in to Memoria"; new "Other ways to sign in to Memoria", "Problem signing in to Memoria", "Taking you to Keymail to sign in to Memoria"; "Signed out · Memoria" unchanged. Nothing outside approved patterns. (rastrillo nit, known from Docs: standalone /signin?ways=1 typed by hand shows an empty chooser; nothing links to it.)

Visual drift (main 6c03476 vs branch, headless Chromium forced light, 1280 and 390)

polish-audit/smart-door/memoria-bump/index.html (pairs, metrics, and every door state). Outside the door nothing moves: every page the same height, every h1 and control in the same place; the only pixel differences are sub-pixel anti-aliasing on buttons, and Open source gaining Fiesta, minify and parse (+171px). The search field's inner input is 21.4 → 33.9px inside the same wrapper (invisible). No CSS fix needed.

Tests

New in internal/memoria: signin_door_{states,refusal,remember,return,forget,contract,team,helpers}_test.go, and signin_browser_test.go (-tags browser, TestSmartDoorInABrowser: 17 states × 320/1280, forced light via Emulation.setEmulatedMedia; no sideways scroll, 24px targets, glyph drawn; in make vet and make browser). They cover every route and state both modes with titles; signed-in shortcut; refusal/removal plain door only, cookie cleared, Oficina forgotten, email kept, no loop, /signin/oficina restarts; standalone removal and refusal; undecided (local identity table gone → page 503, door no refusal/no cookies, session and record kept, strict probe and rememberOficina refuse); the probe ends nothing; web sessions only (native, native-web, guest); remembering (address, no carry-over, unknown, minted session judged, refused Oficina sign-in, confirm leaves record); return memory (landing, Begin never sees it, Sent's Use a different email keeps it, reset, parse error, unsafe//signed-out values, tampered/expired/duplicated, landing spends before answering, Forget and Sign out); link step-up end to end; stranger's Begin == owner's Sent (status, Location shape, cookie names, nothing mailed); guard's address problem keeps force/reauth/page; signed-out both modes, chain, cross-site, standalone; estilo contract over 10 states + refusal + confirm + standalone; team: choose new (remembered, no address) / connect (email-only door) / no-choice 403, stranger, removed member, unlinked local account, undecided roster storage. 30 mutations, one per protection, each run against its test: 29 caught; 1 survives by design (admittedOnly's withoutCookie: the refused session is already revoked before connect looks, as Calendar found). Existing tests moved to the door (door markup and copy, Sent's attempt=, Keymail on the door, /signin/oficina to start exchanges, the chooser for a remembered email way, reauth=1, the choose step in the team fixture, routes and error-gate entries).

Local: make ci passes (vet incl. both browser-tagged packages, gofmt, go test ./... on the pinned go1.26.5, migration check). make browser passes in headless Chrome for Testing forced light (TMPDIR=/tmp): all 11 memoriatest browser tests and TestSmartDoorInABrowser. On origin/main the same 11 pass with chromedp v0.14. Hub CI result follows.

LLM

Memoria moves to the smart door, as Docs, Sheets, Slides, Calendar and Calls did: rastrillo v0.43.0 + connect/handoff 150d94e + estilo 468fab1 in one bump; /signin is the door with Continue with Oficina ID behind a probe of requireSession (web sessions only, 5xx undecided, removal ended at the door); beginGuard answers strangers with AnswerAsSent; Oficina ID remembered for admitted sessions; Forget chained to id.*; team mode gains Admit and the choose page. Native untouched. Needs highest-model review + copy review; not for merge.

Hub CI passed on ac7b108. Push token revoked. Not merged, not deployed.

For the record: hub CI on main 6c03476 shows a failure in TestBreakerCountersAreSealedAndTheAskerIsOneWay (breaker_test.go:367, "the counts are legible at rest"). This branch does not touch the breaker, the test passes here locally with make's pinned toolchain, and it passed in this branch's CI run, so it looks intermittent on main. Not investigated.

Comparison pages: polish-audit/smart-door/memoria-bump/index.html.

Fable's fixes are in e19e6ac. Hub CI passed. Push token revoked. Not merged.

  1. LOW, kept page: /auth/finish and POST /account/home/choose now spend it on the response that mints a session (spentOnMint). The answers that go on to the choice, or "Connect my existing account" to /signin/local, mint nothing and keep it. - Tests: TestAFinishedExchangeSpendsTheKeptPage; TestTeamTheChoiceSpendsTheKeptPageOnlyWhenItSignsIn ("new" spends it, "connect" keeps it, and finish → choice keeps it). - I first also checked the Location for those two destinations. Its mutation survived, because no minting answer goes there, so that clause could never fail. I deleted it, per AGENTS.md.
  2. LOW, native 503: TestAnUndecidedGateIsNoRefusal now asserts the retryable no-store 503 on GET /api/native/session and POST /api/native/search outside team mode.
  3. LOW, stranger vs owner: TestAStrangersBeginIsAnOwnersSent uses equal-length addresses and compares each cookie's name, path, Max-Age, flags and value length, plus the Location's shape. It runs four cases (plain, reauth=1, expect=keymail, a browser already holding an attempt), each in both modes.
  4. NIT, removed session on the door's states: TestARemovedSessionOnTheDoorsStates covers ?err=expired, ?reauth=1, ?force=1 and ?sent=1 in both modes. Each ends the session and draws the door, with no loop. Each says the removal, except Sent: rastrillo draws Sent with no app problem, as Calendar found.
  5. NIT: homeUnavailable sends Retry-After, as teamUnavailable does.
  6. NIT: beginGuard's comment names response time as the fourth residual.

Each fix fails its test when reverted (5 mutations). make ci and make browser (forced light, TMPDIR=/tmp) pass.

Follow-up, not this branch: Fable thinks TestBreakerCountersAreSealedAndTheAskerIsOneWay (breaker_test.go:366) is the intermittent failure on main 6c03476. It looks for "41" in raw ciphertext, and random bytes contain that about once in a thousand runs. The fix belongs in the test, on main.

Review: Claude Fable (claude-fable-5-2). ac7b108: APPROVE AFTER FIXES (no security findings; owner and stranger compared exhaustively and found equal; native untouched; make ci and make browser pass). Fixes in e19e6ac (landings spend the kept page, native 503 test, stronger owner-gate test, removed-session door states, Retry-After, comment), each failing its test when reverted. Copy follows approved patterns. CI passed at e19e6ac.