oficina / home Public

Spec rev 4: members choose (Paul's fork ruling) and Fable's third review applied (not re-reviewed)

Human

Prompt

Revision 4 of spec/oficina-id-native, same branch; push, update discussion 112 + task 110, report tip + changelog + line count. Don't merge. Status: "revision 4: Paul's fork ruling (2026-11-14) and Fable's third READY AFTER FIXES applied; not re-reviewed". [Paul's ruling: members choose — roster decision first; non-members and instances without Unlinked keep today's unknown answer byte-for-byte; only a roster Member with no link sees 'Connect my existing account' / 'I'm new here — continue with Oficina ID'; native gets the same two routes. Fable third pass @575e824: items 3-8 and restored lines.]

From this commit's own message. The prompt ledger has no entries for it — which is what a squashed, rebased or amended commit looks like, and what every commit looks like in a repo without a ledger.

Summary

Replaces the instance-wide AllocatesHomeOnly rule with Paul's members-choose ruling: the roster decision comes first via a non-allocating Admit hook; non-members, an unavailable roster and instances without Unlinked keep today's unknown answer byte for byte; only a roster Member with no link gets /account/home/choose ('Connect my existing account' / 'I'm new here — continue with Oficina ID'), natively 409 choose with the same two routes; the browser path is no longer claimed transactional. Fable's third pass: returning-key exemption limited by end_reason and its own start limit; first enrolment (native or web) revokes passkey-less grants, in slice A; sign-out calls /native/web/end before /signout, also at launch; one-way nonce wording; lockout copy; restored second-app onboarding, no per-team sign-out, slice D handle gates, shared email allowance, /devices URL and the web Open in the app button.
Agent notes
Doc only. 256 lines.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 1b74278f34f8f7215994db013c90e97cd6f62991 parent 575e824
1 file changed, +42 −24
  • docs/superpowers/specs/2026-11-14-oficina-id-native.md +42 −24

CI cancelled — superseded by a newer push — run details

diff --git a/docs/superpowers/specs/2026-11-14-oficina-id-native.md b/docs/superpowers/specs/2026-11-14-oficina-id-native.md
index fa453df..d6a4f45 100644
--- a/docs/superpowers/specs/2026-11-14-oficina-id-native.md
+++ b/docs/superpowers/specs/2026-11-14-oficina-id-native.md
@@ -1,6 +1,6 @@
# 🤖 Oficina ID: the native slice
-Status: revision 3: Paul's answers A–J and lifetimes (2026-11-14) and Fable's second READY AFTER FIXES applied; not re-reviewed. Author: Claude (`claude-opus-5-5`) against Home `e9829fd`. Fable reviewed revision 1 (`4cc21a8`) and revision 2 (`7acf2a1`), returning READY AFTER FIXES both times; this revision applies every finding. No implementation, deployment or merge approval.
+Status: revision 4: Paul's fork ruling (2026-11-14) and Fable's third READY AFTER FIXES applied; not re-reviewed. Author: Claude (`claude-opus-5-5`) against Home `e9829fd`. Fable reviewed revisions 1 (`4cc21a8`), 2 (`7acf2a1`) and 3 (`575e824`), each READY AFTER FIXES; every finding is applied. No implementation, deployment or merge approval.
## 1. Decision and boundary
@@ -22,7 +22,7 @@ This spec extends [Oficina ID slice 1](2026-11-13-oficina-id-slice-1.md) and bin
Both sit in the data-protection keychain, in the shared access group `9U4A84C4WK.works.oficina.id`, with `AfterFirstUnlockThisDeviceOnly`. They are never synced or exported. There is no profile-free variant.
-**At Home: `home_id_grants`.** Columns: `grant_hash`: SHA-256 of the token, primary key; `person_ref`; `identity_id`: HMAC of the person ref under a dedicated Home key; `device_key`; `platform`: self-reported; `method`; `auth_time`; `created_at`; `last_used_day`; `expires_at`; `revoked_at`. Revoked rows keep `device_key` for 365 days so that §4 can recognise a returning device.
+**At Home: `home_id_grants`.** Columns: `grant_hash`: SHA-256 of the token, primary key; `person_ref`; `identity_id`: HMAC of the person ref under a dedicated Home key; `device_key`; `platform`: self-reported; `method`; `auth_time`; `created_at`; `last_used_day`; `expires_at`; `ended_at` and `end_reason` (`expiry`, `lru`, `enrolment`, `signout`, `all_devices`, `revoke`, `replacement`). Ended rows keep `device_key` for 365 days so that §4 can recognise a returning device.
A person holds at most 20 live grants. A 21st revokes the least recently used. Devices store `identity_id`, never the person ref. The ref does reach the app in transit, as the `sub` of the assertions it forwards; the app neither parses nor stores it.
@@ -32,7 +32,7 @@ The calls made before a grant exists are `code/*` and `passkey/begin`/`finish` w
**Lifetime (Paul, confirmed).** A grant lasts 90 days idle and 365 days absolute. `auth_time` is the time of the sign-in gesture. A new factor ceremony on the same grant updates `method` and `auth_time` together. Using a grant never updates them.
-**Revocation.** A grant ends in five ways: device sign-out (§10); "Sign out all devices" (§10); expiry; passkey replacement by recovery code, which revokes every grant; a **first passkey enrolment**, which revokes every grant whose `method` has no passkey, except the grant that enrolled.
+**Revocation.** A grant ends in five ways: device sign-out (§10); "Sign out all devices" (§10); expiry; passkey replacement by recovery code, which revokes every grant; a **first passkey enrolment**, native or on the web, which revokes every grant whose `method` has no passkey, except the enrolling grant. A web enrolment has no enrolling grant, so every code-only grant ends, including the device that showed the nudge; it then signs in with the passkey.
## 4. Email code, for people with no passkey yet
@@ -60,7 +60,7 @@ The answer is identical for known and new addresses.
| Wrong codes per address, from device keys that never held a grant for that person | **20 per day** (B) |
| Live starts | 10,000 in total, at most 20 per IP bucket |
-**Returning devices.** A device key that has held a grant for that person (a live or revoked grant row) is exempt from the per-address start and daily caps. It keeps only its own 5-per-15-minutes limit.
+**Returning devices.** A device key is exempt from the per-address start and daily caps only if it holds a live grant for that person, or one that ended by `expiry`, `lru` or `enrolment`. Keys whose grant ended by "Sign out all devices", per-grant Revoke or recovery replacement are **not** exempt, because those are how a lost device is cut off. An exempt key keeps its own limits: 5 starts and 5 wrong codes per 15 minutes per (address, key). Every native start, exempt or not, also spends the web's in-memory email budget, so an address has one shared allowance across both doors.
**Full table.** When the starts table is full, new starts get `503` "Try again shortly", and existing starts still verify. Filling it takes 500 IP buckets; that is disclosed. The web's link sign-in is unaffected.
@@ -68,7 +68,7 @@ The answer is identical for known and new addresses.
**What B costs (corrected).** The daily cap holds guessing to 20 a day from new devices, under 1% takeover a year for an account with no passkey. An attacker can spend that cap with about 4 mails a day (4 starts × 5 wrong codes). That blocks **new-device** code sign-in for the address until the next day. Returning devices and passkeys are unaffected.
-A blocked new device sees: "Too many attempts for this address today. Use a passkey, or a device you've signed in on before." The code is relayable by a phishing page, which a link is not; that is disclosed.
+A blocked new device sees: "Too many attempts for this address today. Use a passkey or a device you've signed in on before, or sign in at id.oficina.works and make a passkey." The code is relayable by a phishing page, which a link is not; that is disclosed.
**The nudge.** After every code-only sign-in, the app offers "Make a passkey". Native enrolment arrives in slice B; until then the app offers it on the web.
@@ -101,12 +101,11 @@ The label is the email typed on this device. After a passkey-only sign-in, the l
**2. Instance: `POST <origin>/native/oficina-id {assertion, verifier, target?}`.** This is `connect.Bridge.NativeExchange`. It takes JSON only, sets no cookies and refuses `Origin`. In one writer transaction it:
1. verifies the assertion: pinned keys, exact issuer and audience;
-2. recomputes the native nonce from the verifier. A browser or web nonce never matches;
+2. recomputes the native nonce from the verifier. A grant holder cannot obtain an assertion with a browser or web nonce from `assert`, and this endpoint accepts only the native one;
3. reserves `(iss,jti)` in `oficina_handoff_replay`;
-4. resolves the link, then the Home-only person;
-5. may allocate only under §8's rule, evaluated in this same transaction;
-6. rechecks admission;
-7. mints with method `home-assertion-native`.
+4. resolves the link, then the Home-only person, then §8's member choice;
+5. rechecks admission;
+6. mints with method `home-assertion-native`.
The verifier gives the "only the requester redeems" property without slice 1's pending row; a native client has no ambient browser for login CSRF to exploit. There is no Continue page (Paul's ruling A(i)).
@@ -114,11 +113,30 @@ The verifier gives the "only the requester redeems" property without slice 1's p
**Lifetime (Paul, confirmed).** `connect` refuses a `home-assertion-native` or `home-native-web` session more than **7 days** after its `At`: absolute, not sliding. The app re-mints after 24 hours and on any 401. Unlink deletes every `IsHomeDerived` session.
-## 8. No account forks: native and browser (Paul's new ruling)
+## 8. No account forks: members choose (Paul's ruling, 2026-11-14)
-**The rule.** A new hook, `AllocatesHomeOnly(tx)`, is true only when the instance is in team mode **and** holds no local account with an address. Alta-fresh teams pass. It is evaluated inside the minting writer transaction, for **both** paths: `NativeExchange`; slice 1's browser completion, the `FinishAtomic` callback. **This amends slice 1:** `connect`'s `Unlinked` allocation runs only when `AllocatesHomeOnly` is true.
+**The rule, on both paths.** It replaces revision 3's instance-wide rule. When an assertion's subject has no link and no Home-only person, `connect` takes the **roster decision first**, through a new non-allocating hook `Admit(ctx, issuer, subject)`, which is teammode's `AdmitUnlinked` decision. It never asks whether the team has local or email accounts.
+- **Non-members, an unavailable roster, and instances without `Unlinked`** get today's "unknown" answer **byte for byte**: the same status, page, copy and link-resuming marker (`bridge.go:229`). Natively that answer is `403 {"state":"unknown"}`, identical for every such subject.
+- **Only a roster Member with no link** gets the choice, and nothing is allocated until they choose. A guest's local account therefore never blocks a new member's first sign-in.
-**When it is false**, nothing is allocated. **Browser.** `/auth/finish` 303s to `GET /account/home/connect-first`. The link-resuming marker is already set (`bridge.go:229`). The page reads: title: "Connect this account first"; body: "This team has accounts that sign in with email. Sign in with your email once, then we'll connect your Oficina ID — after that, Sign in with Oficina ID works here"; buttons: "Sign in with email" (to `/signin/local`, after which linking begins) and "Cancel". **Native.** The app gets `403 {"state":"connect_first"}` and offers two labelled routes: "Connect on the web", which opens `/account/home/connect-first` explicitly in the default browser (§12); "Sign in with email instead", which is this app's own sign-in (§11).
+**Browser.** `/auth/finish` stores a sealed, single-use choice proof (subject, `auth_time`, browser-bound with a `__Host-` cookie, 10 minutes). It then 303s to `GET /account/home/choose`, a page with request-forgery protection.
+- Title: "Welcome to the team".
+- Body: "Do you already have an account here that signs in with email? Connect it, and your Oficina ID will open it from now on. If you're new here, continue with Oficina ID."
+- Button **"Connect my existing account"** goes to `/signin/local`, with the link-resuming marker set, and then to slice 1's linking.
+- Button **"I'm new here — continue with Oficina ID"** POSTs. That consumes the proof, rechecks `Admit` and that there is still no link, allocates through `Unlinked`, and mints.
+- Unlink clears pending choice proofs together with the other pending sets.
+
+**Native.** `NativeExchange` answers a Member with no link `409 {"state":"choose"}`, rolling back so that nothing, not even the `jti`, is kept. The app then offers the same two labelled routes:
+- **"Connect my existing account"** opens `<origin>/account/home` in the default browser. That is `connect`'s link start, which signs in locally first (`navigation.go:95-110`).
+- **"I'm new here — continue with Oficina ID"** gets a fresh assertion and re-posts with `choice:"new"`, which allocates under the same rechecks.
+
+**Scope of the change.** In `connect`:
+- `Bridge.complete` calls `Admit` in place of `Unlinked`;
+- new choose GET and POST handlers;
+- `NativeExchange`;
+- `Config.Admit`, which all five apps wire to teammode.
+
+The browser `Finish` keeps today's shape (`handoff/http.go` `Finish`: `Store.Finish`, then `Complete`), so the browser path is **not** claimed to be one transaction. Allocation happens only in the explicit choice handlers, which recheck before allocating. The apps' `Unlinked` takes `ctx` and re-checks before it creates (their `EnsureHome`; slice A confirms this in Docs before relying on it). The proof is single-use, so a race between two choices yields one person.
## 9. Teams, store, onboarding
@@ -128,7 +146,7 @@ The verifier gives the "only the requester redeems" property without slice 1's p
`works.oficina.id.changed` tells the other apps to reread.
-**Slice A (Docs):** one identity; onboarding: Welcome, then "Sign in with a passkey" or Email → Code, then a passkey if required, then Team (skipped when there is one; the empty state when there are none); the "Make a passkey" nudge; the zero-teams help text.
+**Slice A (Docs):** one identity; onboarding: Welcome, then "Sign in with a passkey" or Email → Code, then a passkey if required, then Team (skipped when there is one; the empty state when there are none). A second app finds the identity and offers "Continue as <label>" or "Use another"; the "Make a passkey" nudge; the zero-teams help text.
**Slice A2 adds:** up to 5 identities; the account menu (identities, the teams under each, Add, Manage, "Sign out of <label>"), with ⌃⌘1…9 on Mac and a per-window (identity, team), blocked mid-call or with unsaved edits; the Keymail sheet: ephemeral `ASWebAuthenticationSession` (`prefersEphemeralWebBrowserSession = true`, so no Safari cookies). The approval mints **no Home browser session**, only a one-time `start` returned to a fixed `works.oficina.<app>://id` callback, which the app redeems with its proof; the Devices page.
@@ -136,12 +154,12 @@ The verifier gives the "only the requester redeems" property without slice 1's p
**"Sign out of <label>" (Paul's ruling I).** The app first deletes the identity's key, token, record and cache locally, and notifies the other apps. Then, best effort with 5-second timeouts:
1. `POST /native/v1/signout` revokes the grant;
-2. each app sends `POST /signout` for its cached sessions;
-3. each app sends `POST /native/web/end`, authenticated by its native session, to every instance it holds a session on. That ends that person's `home-native-web` browser sessions on the instance, **from all their devices**, as disclosed.
+2. each app sends `POST /native/web/end`, authenticated by its still-valid native session, to every instance it holds a session on. That ends that person's `home-native-web` browser sessions on the instance, **from all their devices**, as disclosed;
+3. each app sends `POST /signout` for its cached sessions.
-Sessions found later under a missing grant are revoked at launch. Nothing waits on Home; the tests use a hanging issuer.
+At launch, sessions found under a missing grant get the same steps 2 and 3. Nothing waits on Home; the tests use a hanging issuer. There is no per-team sign-out.
-**Sign out all devices (slice A).** A minimal **"Sign out all devices"** in `id.*`'s account menu, behind a fresh session and request-forgery protection, revokes every grant. The full Devices page, with fixed self-reported labels and per-grant Revoke, comes in A2.
+**Sign out all devices (slice A).** A minimal **"Sign out all devices"** in `id.*`'s account menu, behind a fresh session and request-forgery protection, revokes every grant. The full Devices page, with fixed self-reported labels and per-grant Revoke, comes in A2, at `https://id.oficina.works/devices`.
**Disclosed residual.** An offline device keeps its team sessions for up to 7 days after a remote revoke.
@@ -170,7 +188,7 @@ Sign-out always completes locally, and nothing loops.
4. **The instance receives it (N1, copying `handoff.Callback`, `handoff/http.go:211-243`).** `POST /native/web/finish` requires the exact issuer `Origin`. It recomputes the web nonce from the handle id in the form, stores a sealed receipt, sets a `__Host-` inbox cookie, and 303s to `GET /native/web/complete`.
5. **The instance finishes.** The GET carries the Lax session cookie. In one writer transaction it consumes the receipt and checks the existing session. If a different person is signed in, it refuses with "Another account is signed in here. Sign out of it first", and nothing is replaced. Otherwise it mints a `home-native-web` session (7 days absolute, §7) and lands on `path`.
-**Which assertion goes where.** `/native/web/finish` accepts only web nonces. `NativeExchange` and `/auth/assertion` never match them: they recompute native nonces, or look up their own pending nonces.
+**Which assertion goes where.** `/native/web/finish` accepts only web nonces, and `NativeExchange` only native ones; both are recomputed, never caller-supplied. `/authorize` still accepts a caller-chosen nonce. The guarantee is therefore one-way: a grant holder cannot obtain an assertion carrying a browser or web nonce through `assert`, and the browser's `/auth/assertion` matches only its own pending nonces.
**Never fresh.** Any method containing `native-web` is refused at enrolment, codes, linking and step-up, alongside the `recovery` checks (`id_passkey.go:128`, `exchange.go:115`).
@@ -180,11 +198,11 @@ Sign-out always completes locally, and nothing loops.
## 13. Gates (slices 0–A2; later gates are in Appendix B)
-**Codes:** no address at rest, and no address or code in logs; entropy, expiry and single use; persistent buckets that survive a restart and parallel requests; the per-(address, key) and daily caps, and the returning-key exemption; per-IP-bucket live starts, and 503 when the table is full; identical answers for known and unknown addresses; no grant from a code alone on an enrolled account.
+**Codes:** the returning-key exemption excludes keys ended by sign-out-all, Revoke or replacement; exempt keys keep their own start limit; one email allowance shared with the web; no address at rest, and no address or code in logs; entropy, expiry and single use; persistent buckets that survive a restart and parallel requests; the per-(address, key) and daily caps, and the returning-key exemption; per-IP-bucket live starts, and 503 when the table is full; identical answers for known and unknown addresses; no grant from a code alone on an enrolled account.
**Proof:** refused for a wrong key, a replayed `jti` (also across a restart), a full table (fails closed), a skewed `iat`, a wrong `htu`, a swapped body, or an `Origin` header; no `jti` row before the grant and signature verify; the per-grant rate limit.
-**Assert and exchange:** an unregistered `aud` is refused; `mintPolicy` is shared with `/authorize`; refused for a wrong verifier, a web nonce, a replay, or a swapped audience; `AllocatesHomeOnly` is false → nothing allocated, on both the native and the browser path, evaluated in the transaction; `IsHomeDerived` everywhere; 7-day refusal; concurrent exchange, unlink and relink.
+**Assert and exchange:** an unregistered `aud` is refused; `mintPolicy` is shared with `/authorize`; refused for a wrong verifier, a web nonce, a replay, or a swapped audience; the roster decision comes first. Non-members, an unavailable roster and instances without `Unlinked` get byte-identical responses on both paths, whether or not the instance has local accounts. A Member gets the choice and nothing is allocated before it. A guest's local account never blocks a new member's first sign-in. A choice proof is single-use, browser-bound and expiring; `IsHomeDerived` everywhere; 7-day refusal; concurrent exchange, unlink and relink.
**Revocation:** first passkey enrolment revokes the passkey-less grants; recovery-based replacement and "Sign out all devices" revoke every grant; a duplicate `identity_id` revokes the new grant; sign-out works against a **hanging** issuer.
@@ -198,7 +216,7 @@ Sign-out always completes locally, and nothing loops.
|---|---|
| **0a** | Profiles on every build; the Mac App Group ID; the launch gate; a shared Secure Enclave key read by two apps. |
| **0b** | The association file on `id.*` plus Apple's CDN; spikes for passkey `clientDataJSON.origin` and Mail AutoFill on both platforms. |
-| **A** | **Docs**, one identity. **Home:** grant and proof, code (Keymail addresses included), native passkey sign-in, `assert`, `signout`, "Sign out all devices", replacement revoking every grant. **connect:** `NativeExchange`, `IsHomeDerived`, the 7-day limit, the `AllocatesHomeOnly` rule on **both** paths, and the connect-first page. **Directory:** `teams` and the zero-teams help. |
+| **A** | **Docs**, one identity. **Home:** grant and proof, code (Keymail addresses included), native passkey sign-in, `assert`, `signout`, "Sign out all devices", replacement revoking every grant, first passkey enrolment (native or web) revoking passkey-less grants. **connect:** `NativeExchange`, `IsHomeDerived`, the 7-day limit, `Admit` with the member choice on **both** paths, and the choose page. **Directory:** `teams` and the zero-teams help. |
| **A2** | Several identities, the account menu, team switching, the Keymail sheet, the Devices page. |
| **B** | Native recovery (ruling C) and native passkey enrolment with the codes. |
| **C–E** | Appendix B: the other four apps and Calls guests; universal links and Open on the web (§12); web multi-account. |
@@ -211,7 +229,7 @@ Sign-out always completes locally, and nothing loops.
Q1 (a): native passkey sign-in ships first; the email code is for people with no passkey yet, and slice 1's rule is intact. Q2 (a): the Keymail sheet, with "Email me a code instead" (moved to A2, with the code as the fallback until then). Q4: grants last 90 days idle and 365 absolute; team sessions last 7 days absolute (confirmed). Q5 (a): web IDs are labelled by their teams' names. Q6 (a): the team colour is derived on the device. Q7: Docs comes first.
-A(i): native sign-in skips Continue. A(ii)(a): one Continue tap signs that browser in to that one app only, never `id.*`. B (a): a daily cap plus a passkey nudge. Its lockout cost is corrected in §4 (about 4 mails a day blocks new devices only). C: recovery codes may be used for routine sign-in, showing what remains and prompting below 3; this moves to slice B. D (a): the shared-credential risk is accepted for slice A and disclosed. Any process in the keychain group can assert for any audience, so a bug in one app exposes every app's data, Memoria's private items included. Per-app keys need attestation and come later. E (a): Calls guests join by name by default, and use their Oficina ID only by explicit choice. F: accepted (§15). G: there is no code entry on the web door. H: "Create a team" through Alta once Alta runs; help text while it is blocked. I (a): app sign-out ends the browser sessions it opened, best effort, on all that person's devices per instance. J: migration covers Paul's machines only; Till must be told before slices C and D. New: fix the browser fork now (§8).
+A(i): native sign-in skips Continue. A(ii)(a): one Continue tap signs that browser in to that one app only, never `id.*`. B (a): a daily cap plus a passkey nudge. Its lockout cost is corrected in §4 (about 4 mails a day blocks new devices only). C: recovery codes may be used for routine sign-in, showing what remains and prompting below 3; this moves to slice B. D (a): the shared-credential risk is accepted for slice A and disclosed. Any process in the keychain group can assert for any audience, so a bug in one app exposes every app's data, Memoria's private items included. Per-app keys need attestation and come later. E (a): Calls guests join by name by default, and use their Oficina ID only by explicit choice. F: accepted (§15). G: there is no code entry on the web door. H: "Create a team" through Alta once Alta runs; help text while it is blocked. I (a): app sign-out ends the browser sessions it opened, best effort, on all that person's devices per instance. J: migration covers Paul's machines only; Till must be told before slices C and D. Fork (replacing revision 3's rule): members choose. The roster decision comes first. Non-members keep today's "unknown" answer byte for byte. A Member with no link chooses "Connect my existing account" or "I'm new here — continue with Oficina ID", on the web and natively (§8).
No questions remain open.
@@ -229,7 +247,7 @@ No questions remain open.
**C: the other apps, and Calls guests (Paul's ruling E).** A link to a Calls instance outside your teams never asserts silently: an assertion would hand that operator your stable cross-team subject. The default is **Join as a guest by name**. "Use Oficina ID <label>" says "This meeting's server will learn your Oficina ID", and with two identities the person picks one. An Oficina ID guest is admitted only with a valid, unconsumed `/j/{token}`, consumed in the minting transaction. `/m/{sqid}` alone grants only Calls' lobby and knock (`native_auth.go:56-87`). The visit is held in memory. Name-only guests keep "Join in the app" (`native_auth.go:349-421`). Push registers per (identity, team). *Gates:* no silent guest assertion; the invitation consumed atomically; `/m/{sqid}` grants nothing.
-**D: universal links and Open on the web (§12).** Each app claims `applinks:<app>.oficina.works` and `applinks:*.<app>.oficina.works`. The wildcard file is fetched from the bare host, so portero serves `/.well-known/apple-app-site-association` (static, label-free); team hosts serve it too. The file lists item routes (Calls: `/m/*`, `/j/*`) and excludes `/auth/*`, `/signin*`, `/signout*`, `/native/*`, `/account/*`, `/api/*` and `/.well-known/*`. Routing: one identity with that origin → use it; several → always ask; none → guest choice (Calls) or "Add an Oficina ID". Self-hosted teams on other domains use the custom scheme only. `NSUserActivity` carries `webpageURL`. *Gates:* the handle GET consumes nothing; Continue POST timing and token binding; the receipt-then-GET finish with no silent replacement of another account; web nonces accepted only at `/native/web/finish`; `native-web` never fresh; `/native/web/end`; excluded paths.
+**D: universal links and Open on the web (§12).** Each app claims `applinks:<app>.oficina.works` and `applinks:*.<app>.oficina.works`. The wildcard file is fetched from the bare host, so portero serves `/.well-known/apple-app-site-association` (static, label-free); team hosts serve it too. The file lists item routes (Calls: `/m/*`, `/j/*`) and excludes `/auth/*`, `/signin*`, `/signout*`, `/native/*`, `/account/*`, `/api/*` and `/.well-known/*`. Routing: one identity with that origin → use it; several → always ask; none → guest choice (Calls) or "Add an Oficina ID". Self-hosted teams on other domains use the custom scheme only. `NSUserActivity` carries `webpageURL`. Web pages offer an "Open in the app" button on the custom scheme, because Safari does not open universal links on same-host taps. *Gates:* the handle is single-use, expires, is bound to its consumer, refuses a foreign path, and mints no Home session; the handle GET consumes nothing; Continue POST timing and token binding; the receipt-then-GET finish with no silent replacement of another account; web nonces accepted only at `/native/web/finish`; `native-web` never fresh; `/native/web/end`; excluded paths.
**E: web multi-account.** `id.*` and the directory hold a set of up to 5 sessions in a sealed `__Host-oficina-ids` cookie, with "current" picked by the intent's subject (`exchange.go:107`). They are labelled by team names (Q5a). An instance keeps one session per host, so two IDs on one team host collide in a browser; that is disclosed. *Gates:* set size; no address rendered on `id.*`.