oficina / fichas Public

Smart door (Home step 6): Fichas 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 Fichas, following Memoria (5d9034d, oficina/memoria #49), Calls (9220b05, oficina/meet #46), Calendar (b9042ea, #48), Slides (d2e830f, #49), Sheets (66e5391, #71) and Docs (2e21630, #139). Every fix from those reviews is built in up front, each with a test. Not for merge: it needs the highest-model review and copy review.

The bump (one change)

  • rastrillo 96812be (v0.35.1 pseudo) → v0.43.0; estilo d004805 → main 468fab1. They move together, per estilo's AGENTS.md rule for v0.29–v0.37 apps. Fiesta 1.3.0 → 1.5.0. chromedp was already on v0.21, and minify/parse were already in the graph.
  • No Home connect or handoff. Fichas has never imported them: it is lone-shape only, and suite shape is refused at boot. So there's no Config.Admit, no choose page, no /signin/local and no /signin/oficina; both of those answer 404. Email is the one way in.
  • rastrillo doctor --fix re-copied tokens.css, shell.css and shell.js. scripts/writeestilo re-wrote theme.css and chrome.css.
  • Doctor's Templates step still lists the templates as pending, and refuses four of them, because Fichas threads $L := .L itself. They are left unwritten, as AGENTS.md now says. The step's type check only runs on the pinned go1.26.11.
  • frame.css: the rail stays on --rst-bg, as estilo AGENTS.md warns. Calma now declares --rst-rail-bg.
  • English locale pack: already linked by internal/fichas/locale.
  • rastrillo v0.37 CLDR 48 numbers: es writes 1234 (was 1.234) and fr groups with U+202F (was U+00A0). TestNumbersAreRastrillos was updated.
  • Migrations: none. Fichas' own are unchanged, and its BootSchema takes no subsystem that gained one.
  • mail.FromCarlos wiring is unchanged. main.go changes in one argument: NewAuth(..., app) (a Gate) where it was app.Admit.

The door

  • SigninScreen + SigninOneWay; BeginPath /auth/begin; ForgetPath /signin/forget. RenderConfirm and Refused draw the door (signin.go) through estilo-signin-screen, titled with rastrillo's words.
  • Every door is drawn signed out: the plain layout has no account menu.
  • The confirm step and the Keymail continuation are marked one-way. rastrillo's SigninState returns them before it reads SigninOneWay, so without the mark they drew a square button. Marked, their Sign in is a pill like the rest of the door. This answers the estilo review's note that Fichas' confirm form had no pill hook: the hand-rolled confirm and continuation templates are gone, and with them their missing estilo-signin-form and estilo-signin-action hooks. rastrillo's partial draws both now. Other apps likely draw a square confirm button the same way; that's a rastrillo follow-up.
  • Admission probe (signin_admission.go). /signin runs requireSession on a probe GET / before it treats a session as signed in. - Only web sessions (magiclink, keymail) are judged. - Any 5xx counts as undecided. Fichas' gate reads no store (owners are config), so the rule is pinned by probeVerdict's unit test, plus a dropped-sessions-table test. - A 404 is a refusal. The door ends the session (its own sessions.Sessions over auth's table) and clears the cookie on the same response.
  • Refusal on the plain door only. Typing ?err=refused shows nothing. The email way stays remembered.
  • beginGuard answers strangers with AnswerAsSent, so they get the same attempt cookie and attempt= as an owner. A malformed address goes to Begin's own ?err=address for anybody, so there's no sameAnswer.
  • Return memory is rastrillo's own: - Begin keeps it; a post without return_to forgets it. - Every landing that mints a session spends it (admit, refused included). - Sign out clears it. - Fichas adds beginReturn, which drops /signed-out, the door and /auth/* pages, and any body that fails to parse. The door's form drops the same pages, and Forget clears it.
  • Signed out: new /signed-out page with "Forget me on this device". Sign out lands there. There's no id.* chain, because there's no Home.
  • [rst-seg-tabs]: the margin under the list's Table/Cards tabs is zeroed in [fichas-toolbar]. Main already had the 16px margin: tokens.css is unchanged there. A browser test failed with the rule removed.

Visual drift (main 335ba9d vs branch, Chromium forced light, 1280 and 390)

polish-audit/smart-door/fichas/index.html has the pairs, metrics.json and every door state.

  • The list, cards view and account menu toolbar is 16px shorter, with the tabs on its centre line (the margin fix above). Everything below moves up 16px.
  • A focused field has one focus ring, not two (Fiesta 1.5.0). This shows on New card and New type.
  • The rail's colour is identical. So are the card, History, Edit, Fields, Layout and the File menu open: 0–14 px of anti-aliasing.
  • The door: the old classic form becomes rastrillo's one-way door with pill buttons.

Strings (for copy review)

Added, already approved:

  • Refusal: "That email can’t sign in to Fichas. Use a different email, or ask whoever runs this team to add it."
  • rastrillo's door copy: - "Sign in to Fichas", "Email", "Continue", "Continue as {address}", "Use a different email". - Sent: "Check your email" / "We sent a link to {address}." or "…your inbox." + "The link works once and expires soon." - "Send me a link instead". - 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.", "Sign in again to continue." - Confirm: "Sign in". - Keymail continuation: "Taking you to Keymail" / "Continue to Keymail".
  • estilo's signed-out page, new to Fichas: "You’re signed out", "You’ve signed out of Fichas on this device.", "Sign in", "Forget me on this device".

Tab titles:

  • "Sign in · Fichas" → "Sign in to Fichas".
  • "Check your email · Fichas" → "Check your email to sign in to Fichas".
  • New: "Problem signing in to Fichas", "Taking you to Keymail to sign in to Fichas", "Other ways to sign in to Fichas" (typed URL only), "Signed out · Fichas".

Removed:

  • Fichas' own error strings: - "Too many sign-in attempts for that address. Wait a few minutes, then try again." - "That doesn't look like an email address. Check it and try again." - "That sign-in link has expired or has already been used. Ask for a new one below." - "Keymail couldn't finish signing you in. You can have a link emailed to you instead." - "Something went wrong on our side, not yours. Trying again won't help until it is fixed."
  • The continuation: "Continuing to keymail", "Continuing to keymail to confirm it's you.", "Continue to keymail".
  • estilo's classic door: "Sign in" (heading), "Email address", "We’ll email you a link that signs you in. It works once and expires in 15 minutes.", the "Sign in" button.
  • Sent: "If that address can sign in here, we’ve sent it a link. It works once and expires in 15 minutes." and "Use a different address".

Nothing outside approved patterns. A known rastrillo nit, from Docs and Memoria: /signin?ways=1 typed by hand shows an empty chooser, and nothing links to it.

Credits

Fichas has no credits page or Colophon yet (account() says so), and estilo's catalogue has no Fichas "uses" notes. There is nothing to regenerate, so there's no estilo branch. Adding a Colophon under Help is its own change.

Tests

  • New in internal/fichastest: signin_door_{states,refusal,return,helpers}_test.go, plus signin_door_browser_test.go (TestSmartDoorInABrowser: 11 states × 320/1280, forced light; no sideways scroll, 24px targets, refusal drawn, axe). New in internal/fichas: signin_door_test.go (probe verdicts, judged methods, keepable pages).
  • They cover: - routes and 404s; - every state's title; - the signed-in shortcut and safe return_to, drawn signed out; - the remembered email way and Forget; - signed out, with Forget being same-origin only; - the confirm step: one-way, nothing spent, no address shown; - a mistyped address keeping force and reauth; - stranger and owner indistinguishable (Location shape, cookie name/path/age/flags/length, mail count); - a refused link (403, no session, nothing remembered, kept page spent); - a refused session ended at the door (cookie cleared, row dead, no loop, email way kept), refused on the plain door only; - non-web sessions never judged; - an unreadable session store isn't a refusal; - the return memory (landing, spend, reset, parse error, no-page pages, Forget and Sign out).
  • Existing tests moved to the door.
  • The full -tags browser suite passes in Chrome for Testing forced light (TMPDIR=/tmp), with the existing axe and File-menu tests.
  • make ci passes on go1.26.11. Hub CI result follows.
LLM

Fichas moves to the smart door: rastrillo v0.43.0 + estilo 468fab1 together; email-only (no Home); probe of requireSession (web sessions, 5xx undecided, removal at the door); refusal on the plain door; AnswerAsSent; rastrillo's return memory plus Fichas' guards; /signed-out with Forget; tab margin zeroed. No migrations. Needs highest-model review + copy review; not for merge.

Hub CI passed on 3c47583. TestSmartDoorInABrowser, TestNoZoomOnTap, TestTheViewTabsSitInTheToolbarsRow and TestNoOldBusyRuleIsServed were re-run on 3c47583 in Chrome for Testing forced to light, and pass. The full -tags browser suite passed on the tree before the confirm-step one-way change. Push token revoked. Not merged, not deployed.

Fable's three findings are fixed in 97071b6. Hub CI passed. The push token is revoked. Not merged.

  1. Dot segments. keepableReturn now judges the path the way a browser resolves it: backslashes count as slashes, and path.Clean removes dot segments. A refused value is refused whole; it is never rewritten to its cleaned form. - Now refused: /./signed-out, /x/../signed-out, %2e forms, /x\..\signed-out, and the dot-segment forms of /signin, /signin/forget and /auth/*. - Still kept: /cards/./new, /x/../cards/new. - TestKeepableReturn has these cases. With path.Clean removed, 13 of them fail.
  2. The landing checks the kept page too. landingReturn wraps both /auth/verify and /auth/callback. - The request's own return_to is never read, whether posted, in the query or duplicated, because no door posts one there. - The kept cookie is read only when there is exactly one, it unescapes, and it passes keepableReturn. Otherwise it is cleared on that response and hidden from admit, and the landing is /. - TestTheLandingTrustsNoPageItWasNotKept covers each of these, and each lands on / with the cookie cleared: - tampered cookies: signed-out, dot segments, the door, another site, unescapable; - two cookies; - a posted /signed-out; - a posted page; - a posted duplicate; - a posted page over a bad cookie. - With the wrapper removed, 8 of these cases fail. - Expired cookie: rastrillo's cookie is the bare path, with no issue time, so the server cannot tell an expired cookie from a live one. Its lifetime is the Max-Age that Begin gives it, which is the link's 15 minutes (TestTheKeptPageLivesNoLongerThanItsLink). A cookie sent after that was written by hand, and it is judged as tampered. The comment block says this rather than claiming more.
  3. Keymail continuation. These tests are in signin_door_keymail_test.go. A loopback DNS responder (NXDOMAIN, so the domain is its own Keymail server) and a stub transport stand in for DNS and the Keymail server. Nothing leaves the machine. - TestAKeymailAddressContinuesOnTheDoor: a Keymail owner goes through Begin to /signin?continue=<id>. The Continue step checked here is the one served through rastrillo.Handler, so it carries the served CSP: - it is on the one-way door (the override; with StepContinue dropped from it, the test fails); - its meta refresh and its Continue to Keymail link go to exactly this origin's authorize URL; - it sends no-referrer and no-store; - the CSP still says form-action 'self' and doesn't name the Keymail host; - it has no inline script, and no mail is sent. - TestTheContinuationGoesNowhereItWasNotSent: an id without its cookie, an id the browser never got, or a URL in place of the id each draws the expired door and links nowhere. This replaces the destination-refusal tests. The predicate itself is rastrillo's validAuthorizeURL now, so the test checks what can still reach the page. - TestANonKeymailAddressIsSentALink: the classifier is asked, the address passes through to Sent, and a link is mailed. This replaces the passthrough test.

make ci passes on go1.26.11. In the Playwright headless shell (TMPDIR=/tmp), these browser tests pass: TestSmartDoorInABrowser, TestNoZoomOnTap, TestNoOldBusyRuleIsServed and TestAnExpiredSessionIsNotADeadEnd.