| 1 | # Oficina ID slice 1, part A |
| 2 | |
| 3 | Paul approved implementation on 2026-11-13. Work stays on `oficina-id-slice1`; |
| 4 | no deployment or merge. Equipo and changes to its connect adapter are part B. |
| 5 | |
| 6 | ## Tasks |
| 7 | |
| 8 | 1. [x] Require a new authentication gesture for `max_age=300`; add a protected, |
| 9 | fixed-label Continue page for existing sessions. (The Continue page is |
| 10 | superseded 2026-11-20 by Paul's straight-in ruling: an existing session |
| 11 | now mints on the GET; slice 1 spec, Assertion and browser exchange.) Files: `exchange.go`, |
| 12 | `signin.go`, `app.go`, templates, assertion tests. Preserve the closed |
| 13 | consumer manifest and 120-second P-256 assertions. |
| 14 | 2. [x] Add browser-bound, five-minute, single-use direct passkey sign-in and |
| 15 | enrollment. Require UV, exact RP/origin, stored person binding and generated |
| 16 | WebAuthn names. Keep gated legacy credentials. Files: new Home ceremony |
| 17 | handlers/migration/tests, `passkey.go`, `static/passkey.js`, templates. |
| 18 | 3. [x] Implement 80-bit-or-better recovery codes, persistent atomic account/IP |
| 19 | limits, fresh mailbox/browser proof, explicit replacement and atomic |
| 20 | credential/session/code revocation. Keep the notice address only in bounded |
| 21 | memory, with retry and content-free errors. Files: recovery handlers, |
| 22 | migration, ceremony completion, tests. |
| 23 | 4. [x] Preserve Keymail/platform SMTP and sealed-link storage; strengthen |
| 24 | hostile error/address scans and note the later blind-auth-store seam. |
| 25 | Make Home sign-out land locally, including directory outage behavior. |
| 26 | 5. [x] Run local gates, targeted mutations, delegated copy review and Astra |
| 27 | security review. Push regularly, poll hosted CI, repair failures, and write |
| 28 | `../report.md` in the supplied clone's parent with SHA and remaining work. |
| 29 | |
| 30 | ## Test sequence |
| 31 | |
| 32 | Write each behavior test and record its failure before implementation. Exercise |
| 33 | virtual authenticators for direct/gated sign-in, registration, wrong origin/RP, |
| 34 | missing UV, wrong browser/person/purpose, expiry and replay. Test stale and recent |
| 35 | linking sessions, Keymail gesture times and account swaps. Retain assertion |
| 36 | signature/audience/expiry/nonce and scriptless browser-return gates. |
| 37 | |
| 38 | Recovery tests cover entropy, hashed storage, parallel attempts across app |
| 39 | reconstruction, account/IP budgets, code replay, mailbox/browser swaps, expired |
| 40 | proofs, rollback on every replacement write, all-session/code/passkey revocation, |
| 41 | and notice delivery failure/retry without rollback. Scan live SQLite/WAL/SHM, |
| 42 | store objects and logs for canary addresses through all new paths. |
| 43 | |
| 44 | Run `make test`, then relevant browser gates. Record guard-removal mutations and |
| 45 | the tests that kill them in `implementation/oficina-id-slice1-validation.md`. |
| 46 | Existing consumer receipt/link/unlink/admission/pinned-key gates remain part B; |
| 47 | exercise Home's issuance and local outage boundary here. A hanging issuer, not |
| 48 | just a refused connection, must prove directory sign-out lands locally. |
| 49 | |
| 50 | ## Integration choices |
| 51 | |
| 52 | Use Home's current `signin.Flow` plus sealed `linkStore`, opaque session subjects, |
| 53 | and Rastrillo's cryptographic WebAuthn/session primitives. Do not adopt readable |
| 54 | `auth_links.address`. Keep the mailbox-completion seam explicit for the later |
| 55 | `blind-auth-store` release. No signing-key publication endpoint. |
| 56 | |
| 57 | Copy is reviewed by delegated Astra pass, per Paul's override; no review server. |
| 58 | Review is source/test-only because Paul forbids deployments. Record that limit |
| 59 | rather than claiming the repo's deployed-canary review requirement was met. |
| 60 | |