oficina / equipo Public

Smart door (Home step 6): Equipo 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 Equipo (web only), after Calls, Calendar, Slides, Sheets, Docs and Memoria, with every fix their reviews asked for built in up front, each with a test. native/ and the person API are untouched. Not for merge: it needs the highest-model review and copy review.

The bump (one change)

  • rastrillo v0.30.3 → v0.43.0; connect + handoff e9829fd/e03a01a → Home main 150d94e; estilo (indirect 260f98c) → direct 468fab1. go mod tidy also: x/crypto 0.55, x/sys 0.47, x/text 0.41, x/mod 0.38, x/sync 0.22, x/tools 0.48, go-sdk 1.8.0, fsnotify 1.10.1; new indirect fiesta 1.5.0, tdewolff minify v2.24.19 + parse v2.8.16, and github.com/carlosframework/rastrillo v0.23.0 (estilo chrome still imports the old path, as in every app).
  • rastrillo doctor --fix: tokens.css, shell.css/js, rastrillo.js, live.js, busy.js, select.js, datetime.js, calendar.js re-copied; fiesta.js, transition.js, copy.js added. layout.html links fiesta.js right after rastrillo.js (v0.34). Doctor's other notes, not acted on: migrate-templates would add $L to 27 templates (old syntax still renders; left to avoid churn with the busy branches); "layout still has the old phone menu card or back strip" (one-header-row upgrade, a separate change).
  • Locale pack: Equipo already linked locales/en. chromedp: already on v0.21. Minified assets: TestRastrilloUpgradeContract now compares each served file with what rastrillo.Assets serves for the library's copy.
  • Migrations: Home linkstore 0003choiceproofs (additive, in BootSchema). Nothing of Equipo's own.

The door (internal/equipo/door, a package of its own: internal/equipo had 3 lines of budget left)

  • SigninScreen + SigninOneWay, SigninPath /signin, ForgetPath /auth/forget. Every state is estilo-signin-screen over auth.SigninState, HideBrand, Equipo's estilo brand mark, the suite's sky; the tab title is rastrillo's. Drawn signed out: its own document, no sidebar, nav or account. The old stage-layout signin_page.html is gone.
  • Routes: Equipo's own, not connect's. Equipo never used connect's Routes/Bridge; it has its own Oficina ID flow (oficinaid: /auth/home, the exchange, /auth/finish, the native exchange). So /signin, /signin/local, /signin/oficina are Equipo's handlers with connect's behaviour (door.go mirrors connect/door.go): /signin is the door (Oficina ID offered with Home), /signin/local email only, /signin/oficina?return_to= → /auth/home?return_to= (oficinaid's Start, which carries the page in the exchange), reauth → /signin/local?reauth=1. Standalone: email only; /signin/local and /signin/oficina not mounted.
  • The federated slot: FederatedDoor{Provider: oficina, Href, Label: "Oficina ID", Icon: chrome.OficinaGlyph}, never on /signin/local or a step-up. The old "Sign in with Oficina ID" button is gone.
  • Admission probe (door/routes.go) runs requireMember (Home Authenticate or rastrillo RequireSession, then the roster and session epoch) on a probe GET /: - web sessions only (magiclink, keymail, oficina-id); home-assertion-native and anything else never judged, refused, remembered or ended; - any 5xx is undecided: no refusal, nothing ended or forgotten, counts as signed in; - a 4xx is a refusal, except somebody no member yet with a pending invitation (MayVerify): left alone; an unreadable invitation store is undecided; - signed-in shortcut on /signin and /signin/oficina unless sent/err/force/reauth/continue.
  • Storage failures answer 503: oficinaid mapped every session-lookup error to ErrRefused, so a storage failure on an Oficina ID session answered the 400 "failed" page, indistinguishable from a refusal. New ErrUnavailable → 503 + Retry-After (no rows/unlinked stay refused).
  • Removal at the door: the probe ends nothing; the door deletes the refused session's row and clears its cookie on its own response, forgets a remembered Oficina ID, keeps an email way, and draws the refusal on the plain door only (chooser and ?way= stay open). Never from the query.
  • Refusal: auth's Refused (a link/Keymail that verified, Authorize said no) now draws the door with the refusal in a 403 instead of rastrillo's bare text.
  • Remembering: oficinaid Finish gained a SignedIn hook (Equipo's MintHomeSession): strict probe of the minted session, federated record with the Equipo account's address from the guard, nothing carried over.
  • Return memory: Equipo keeps no cookie of its own; rastrillo v0.43 keeps the page across the email round trip (rastrillo_return_to, spent at its own landing, reset by a post without one) and oficinaid carries it in the exchange. Added: the Oficina ID landing spends rastrillo's kept page (every landing that mints a session), Forget and both Sign outs clear it, a plain /signin forgets it, and /signed-out (and /account/home/* for Oficina ID) is never a page to land on. "Stripped even on a parse error" has no Equipo counterpart: Equipo never takes return_to off Begin's form (rastrillo forgets on a parse error itself).
  • Signed out: /signed-out in both modes (standalone Sign out now lands there, not /signin), estilo's card plus "Forget me on this device"; with Home it posts chain=oficina → {issuer}/forget?return=<origin>/signed-out. After a Home sign-in it keeps Equipo's existing quiet "Sign out of Oficina ID too" link; without that link the card is estilo's estilo-signed-out byte for byte (tested).
  • Step-up: /account/home/reauth now goes to /signin/local?force=1&reauth=1&…, never offering Oficina ID. Unlinked/failed Oficina ID pages link /signin/local?force=1.
  • No sameAnswer: Equipo never had one; Begin's answers are rastrillo's own. [rst-seg-tabs]: no Equipo template uses seg-tabs, so v0.42's margin can't reach it.

Native

Untouched: native/, oficinaid/native.go, the native exchange and /api/v1. Native sessions (home-assertion-native) are never judged at the door (tested). The oficinaid change on a shared path: a storage failure while reading a web Oficina ID session is now 503; NativeSessionOn still maps every error to refused.

Credits

Equipo builds no credits page (no Colophon, no notices generator, no make credits), so there is nothing to regenerate. Fiesta, minify and parse arrive only as indirect modules.

Copy

  • Added signin.refused: "That email can’t sign in to Equipo. Use a different email, or ask whoever runs this team to add it." (Paul's approved Docs/Sheets pattern, Equipo's name). Marked COPY REVIEW PENDING with scripts/copy-status.py pending (row in the Plan 3 inventory). Equipo had no refusal copy before (rastrillo's bare text).
  • Reused: id.title "Oficina ID" (rastrillo draws "Continue with Oficina ID"); id.home_signout "Sign out of Oficina ID too"; id.email "Sign in by email".
  • Removed: id.door "Sign in with Oficina ID" (now rastrillo's "Continue with Oficina ID"); id.signed_out "You are signed out of Equipo." (now estilo's "You’re signed out" / "You’ve signed out of Equipo on this device.").
  • New from rastrillo/estilo (already approved): one-way door strings (Continue with Oficina ID, Continue as {address}, Other ways to sign in, Email, Back, Use a different email), "Forget me on this device". Tab titles: "Sign in to Equipo" (unchanged), new "Other ways to sign in to Equipo", "Problem signing in to Equipo", "Check your email to sign in to Equipo", "Signed out · Equipo".
  • Nothing outside approved patterns. Known rastrillo nit: standalone /signin?ways=1 typed by hand shows an empty chooser; nothing links to it.

Visual drift (main a883072e vs branch, Playwright Chromium forced light, 1280 and 390)

polish-audit/smart-door/equipo-bump/index.html. Outside the door nothing moves: /conversation, /work, /needs-you, /journey, /projects, /projects/new, /tasks, /connections, /people, /settings, /usage, /specialists/engineering are pixel-identical at both widths, apart from a sub-pixel difference in the composer's + button at 1280. The sign-in pages change on purpose, and every door state (Home) is in door/.

Tests

  • internal/equipo/door: probe classification over a stand-in guard (methods judged, 2xx/4xx/5xx/3xx, invitee, invitation error), the probe ends nothing, remembered only when admitted with the minted address and no carry-over, every landing and sign-out spends the kept page, the Oficina href rules, return paths, the chained Forget URL, static/estilo/ pinned to estilo's bytes, sky and mark served.
  • internal/idtest/door_*_test.go through Equipo's real router and guard, both modes: every route/state with titles, /signin/local, /signin/oficina targets, signed-in shortcut, step-up local only, removed member ended at the door with the refusal and email record kept, refusal plain door only, refused Oficina ID session forgets the record, undecided (roster unreadable) → guard 503 and nothing ended, native never judged, verified stranger → 403 door, Oficina ID remembered with the Equipo address, confirm leaves the record, Forget (plain, chained, cross-site), signed out both modes, kept page, estilo contract over 9 states × 2 jars + refusal, signed-out card equals estilo's.
  • TestBrowserSmartDoor (-tags browser, browser-rest lane): 12 states × 320/1280, forced light, no sideways scroll, 24px targets, glyph drawn. TestBrowserOficinaIDDoor follows the new /signin/oficina button.
  • 19 mutations, one per protection, each run against its test: all 19 caught.
  • Updated: TestIDDoorOffAndUnlinked, TestSigninNoProof (door, not stage), TestRastrilloUpgradeContract (v0.43, minified assets), oficinaid fixture gains linkstore 0003. Budget: equipotest test record 12013 → 12017.
  • Local (go1.26.11, macOS): internal/equipo/..., idtest, thintest pass; staticcheck clean on the touched packages; govulncheck 0 affecting; budget size within. Known not mine (also fail on main a883072e on this Mac): team TestPublishCoreAuthorizationContract, equipotest runner/execution/release tests that need the Linux box, oficinaid TestNativeSessionAbsoluteLifetime (timing flake, 4/40 on main). Expected red: TestPlan3ReleaseBoundaries/inventory reads the new pending row as unreviewed: the copy gate, until Copy or Paul accepts signin.refused. Hub CI result follows.
LLM

Equipo moves to the smart door: rastrillo v0.43.0 + connect/handoff 150d94e + estilo 468fab1; its own /signin, /signin/local, /signin/oficina with connect's behaviour over oficinaid; admission probe around requireMember (web only, 5xx undecided, removal at the door, refusal on the plain door); Oficina ID remembered for admitted sessions; Forget chained to id.*. Native untouched. Needs highest-model review + copy review; not for merge.

Branch is now one commit, ebfd0dd5 (26b6f84a + 8331ab6c squashed, same tree as 8331ab6c). The squash keeps a test instance key that gitleaks flagged out of the branch history. Push tokens revoked. Not merged, not deployed.

Hub CI on ebfd0dd5: failed. Fixed since the first run: gitleaks (no leaks found), runner-dead-references and TestDirectDeadReferencesRepository (the allowlist rows for the re-vendored scripts are recomputed with their existing reason, plus estilo's two stylesheets), and budget size passes. Two things are still red:

  1. TestPlan3ReleaseBoundaries/inventory (expected). The new signin.refused row is COPY REVIEW PENDING, as scripts/copy-status.py pending writes it, and the inventory test accepts only reviewed rows or COPY REVIEW REQUIRED. agent-access (5846f5cb) was in the same state. This is the copy gate until Copy or Paul accepts the string.
  2. The browser-headless-rest lane: a regression from the rastrillo v0.43 bump, not yet understood. Three runs failed twice on a varying set of tests: CopyContinue, EmptyExplore, RefreshRace, MoveIn and ThinkingAndCards. Each waits up to 5 s for the coordinator's reply or activity to render on /conversation. On main, only EmptyExplore flakes, and it passes on retry. - Bisect: experiment 828fba33 (branch deleted) used main's vendored scripts with everything else the same. It failed the same way, so the vendored scripts are not the cause. The cause is on the server side: the rastrillo v0.43 runtime, or the connect/estilo bump. - It is not the door: these tests set the session cookie directly and never touch /signin. - I couldn't reproduce it locally. headless needs Linux and the CI box's pinned tools. A plain Debian container with the pinned bwrap fails these tests on main too, so it can't tell the two apart. - Lead for whoever picks it up: the event stream /api/v1/events (chat/http.go) under rastrillo v0.43's handler stack.

Everything else passed: all other headless lanes (chat flaked once, then passed), thintest, idtest including TestBrowserSmartDoor, staticcheck, govulncheck and perf.

Found and fixed the browser-headless-rest regression: 1e95ddc4. Hub CI on 1e95ddc4: every headless lane passes. TestBrowserCopyContinue flaked once and passed on retry, the same pattern as main's EmptyExplore flake. Gitleaks finds no leaks. The one red step left is the copy gate (below).

Bisect (throwaway branches, now deleted):

  • a, page diagnostics: page-side is clean. No console errors or exceptions, /api/v1/events answers 200, both EventSources stay open, and every event arrives. The move-in's first activity event just arrives late: about 4.8 s into the test, against a 5 s window.
  • b, main + bump + the branch's static files, no door: fails the same way. An earlier experiment, 828fba33, had already reverted busy, live, rastrillo, select, datetime, calendar and shell.js and dropped the fiesta.js tag, and it failed too.
  • c, main + only the go.mod/go.sum bump: fails the same way. So the module bump is the cause, not the door and not the static files.
  • d and e, timelines with a 30 s window: main shows "Moving in…" 4.32 s after the runner starts. Bump-only shows it at 5.14 s. Main is already 0.7 s from the edge.

Cause: the runner re-runs itself as the namespace helper inside every sandbox (equipo-runner __namespace). Each run pays internal/equipo's init, which parsed rastrillo's ui partials again for each of the 53 pages. The v0.43 partials made that init heavier: median 177 ms → 231 ms locally, 95 → 107 MB of allocations, and more under CI load.

Fix: render.go now parses the partials once. The layout and the shared app partials are parsed once over clones of that, and each page is cloned from the base it needs; every page is the same template set as before. The init median is now 88 ms and 76 MB, under main's. internal/equipo and equipotest pass locally, and idtest and thintest are green locally and in CI. No new test: a timing guard would be as flaky as these tests. The measurement is in the commit message.

Copy gate, not done, on purpose: AGENTS.md (binding) says "Engineering never invokes accept or writes acceptance markers". The script's accept path also needs Copy's server records (owner, candidate, revision, text hash), which I don't have. So signin.refused stays COPY REVIEW PENDING, and TestPlan3ReleaseBoundaries/inventory stays red until Paul or the Copy runner records the approval. That is Paul's pattern approval for every app's door (copy review #4), applied to Equipo's instance.

Fable's four fixes are in 1329595f. Hub CI is red only on the copy gate (TestPlan3ReleaseBoundaries/inventory). Every headless and browser lane passes; one TestHeadless/3_empty_repo flake passed on retry. Gitleaks and budgets pass. Push token revoked.

  1. MEDIUM, /signed-out landing. rememberSignIn now rewrites the Location of any answer that mints a session to / when the cleaned path is /signed-out, /signin… or /auth/…. Cleaning resolves dot segments and treats backslashes as slashes, as a browser does. signedOutPage cleans the path the same way. I also found that oficinaid's Start let an exact /auth/home?return_to=/signed-out land there; it now goes to /. (handoff.SafePath already refuses dot segments on that path.) TestDoorNeverLandsOnSignedOut follows each route to the landing in both modes: a dot segment, a dot-dot segment, a direct POST to Begin, a tampered kept-page cookie, a backslash, and a sign-in page. A real page still lands. The door's form no longer carries those values.
  2. LOW-MEDIUM, stale session. On a 4xx the door now asks who the session belongs to. If it's an active member, the session is stale: it's ended, the door is plain, there's no refusal, and nothing is forgotten. An Oficina ID session is judged by its linked account, and a failed lookup is undecided. Tests: TestDoorStaleSessionIsSignedOutNotRefused (email and Oficina ID sessions) and TestTheProbeReadsAStaleSessionAsSignedOut.
  3. LOW, settings loop. Settings redirects only on ErrRefused and answers 503 otherwise. Test: TestDoorOficinaSettingsUnreadableIsNoLoop.
  4. LOW, invitee. TestDoorLeavesAnInviteeAlone uses a real invitation from POST /invites, the real requireMember and the real MayVerifyInvitation, in both modes. The invitee is neither refused nor signed out, and a stranger is still refused.

Each fix fails its test when reverted (6 mutations, 6 caught). The copy marker is untouched and waits on Paul's copy review.

Hub CI passed on cd6c7c6d, the full gate including perf. Not merged.

  • 93411fc2: Copy approved by Paul (2026-11-22, unchanged). signin.refused now carries // COPY APPROVED (Paul, 2026-11-22, copy-review smart-door-copy-5, unchanged), from copy review smart-door-copy-5 (action approve, edited false). The Plan 3 inventory row carries the same status. The inventory test accepts that marker for this key, as it does the failed-reply strings Paul approved the same day; that's one line, so the plan3test size budget holds. copy-status.py verify is valid, make copy-release-check passes, and TestPlan3ReleaseBoundaries passes.
  • cd6c7c6d: perf. The perf step had never run on this branch, because an earlier check step had always failed first. It expected /signin to answer 200 to the signed-in owner, and the door's signed-in shortcut now answers 303, as connect's does. The perf test's Expect now says 303. Every page stays within its weight and time budget.