oficina / home Public

Spec: straight in, Fable's fixes (S1-S5)

Failure landings enumerated (grant ended, instance outage, not a
member / member chooses, everything else); Welcome follows another
app's sign-in only when an identity is added, never mid sign-in, while
the app's own sign-in is open, or after this app's own sign-out; the
spinner, its ~8 s fallback to "Continue as" and "Other ways…" on both;
an app's own identity with its team gone is kept; Back keeps last-used
first; "Use another" changes nothing until confirmed; an app whose last
route was "Other ways…" keeps that account.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev b187eca77fe2beed868cb0d0a15e9809f95e2596 parent 3437e95
1 file changed, +14 −3
  • docs/superpowers/specs/2026-11-14-oficina-id-native.md +14 −3

CI cancelled — superseded by a newer push — run details

CI log
amadan: .amadan/timeout: this job's budget is 20m0s (this runner allows up to 30m0s)
=== vet ===
CGO_ENABLED=0 go vet ./...
CGO_ENABLED=0 go vet -tags browser ./internal/home/
cd handoff && CGO_ENABLED=0 go vet ./...
cd roster && CGO_ENABLED=0 go vet ./...
cd dashboard && CGO_ENABLED=0 go vet ./...
cd connect && CGO_ENABLED=0 go vet ./...
cd teammode && CGO_ENABLED=0 go vet ./...
=== fmt ===
=== build ===
CGO_ENABLED=0 go build ./...
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build ./cmd/home ./cmd/oficina ./internal/operatorlaunch
cd handoff && CGO_ENABLED=0 go build ./...
cd roster && CGO_ENABLED=0 go build ./...
cd dashboard && CGO_ENABLED=0 go build ./...
cd connect && CGO_ENABLED=0 go build ./...
cd teammode && CGO_ENABLED=0 go build ./...
=== go-test ===
CGO_ENABLED=0 go test -count=1 ./...
?   	amadan.net/oficina/home/cmd/home	[no test files]
ok  	amadan.net/oficina/home/cmd/home-placeholder	0.713s
?   	amadan.net/oficina/home/cmd/oficina	[no test files]
ok  	amadan.net/oficina/home/internal/guardstest	0.090s
ok  	amadan.net/oficina/home/internal/home	50.326s
ok  	amadan.net/oficina/home/internal/home/directorydata	1.353s
ok  	amadan.net/oficina/home/internal/home/logtest	0.003s
ok  	amadan.net/oficina/home/internal/home/seal	0.003s
ok  	amadan.net/oficina/home/internal/home/sealtest	0.005s
ok  	amadan.net/oficina/home/internal/home/wisp	0.049s
ok  	amadan.net/oficina/home/internal/operator	6.286s
ok  	amadan.net/oficina/home/internal/operatorlaunch	4.113s
ok  	amadan.net/oficina/home/internal/provisioner	48.549s
cd handoff && CGO_ENABLED=0 go test -count=1 ./...
ok  	amadan.net/oficina/home/handoff	0.655s
ok  	amadan.net/oficina/home/handoff/seal	0.002s
cd roster && CGO_ENABLED=0 go test -count=1 ./...
ok  	amadan.net/oficina/home/roster	5.119s
cd dashboard && CGO_ENABLED=0 go test ./...
ok  	amadan.net/oficina/home/dashboard	(cached)
cd connect && CGO_ENABLED=0 go test -count=1 ./...
ok  	amadan.net/oficina/home/connect	1.333s
ok  	amadan.net/oficina/home/connect/linkstore	0.410s
cd teammode && CGO_ENABLED=0 go test -count=1 ./...
ok  	amadan.net/oficina/home/teammode	0.096s
?   	amadan.net/oficina/home/teammode/teammodetest	[no test files]
=== race ===
go test -race -count=1 ./internal/home/ ./internal/operator/ ./internal/operatorlaunch/ ./internal/home/directorydata/
ok  	amadan.net/oficina/home/internal/home	382.374s
ok  	amadan.net/oficina/home/internal/operator	82.177s
ok  	amadan.net/oficina/home/internal/operatorlaunch	22.395s
ok  	amadan.net/oficina/home/internal/home/directorydata	23.298s

amadan: job cancelled — a newer push superseded it
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 8e40088..7015a73 100644
--- a/docs/superpowers/specs/2026-11-14-oficina-id-native.md
+++ b/docs/superpowers/specs/2026-11-14-oficina-id-native.md
@@ -166,12 +166,23 @@ The browser `Finish` keeps today's shape (`handoff/http.go` `Finish`: `Store.Fin
**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 goes straight in (amended by Paul's ruling of 2026-11-19, below; it used to offer "Continue as <label>" or "Use another"); the "Make a passkey" nudge; the zero-teams help text.
**Straight in (Paul's ruling, 2026-11-19).** Launch decides, in this order:
-1. **This app's own last (identity, team)** is still on the device: back to that team, no screen. Unchanged.
+0. **This app's own sign-in comes first.** If the app's last route was "Other ways to sign in…" (a self-hosted or local account), that account opens and nothing goes straight in; straight in applies only when the app's last route was Oficina ID, or there was none. Opening "Other ways…" at any point stops straight in the same way (a launch in flight is abandoned) until the person comes back to Oficina ID.
+1. **This app's own last (identity, team)** is still on the device: back to that team, no screen. Unchanged. If that identity is still here but its team is gone, the app keeps that identity and goes on as rule 2 with it, even with other identities on the device.
2. **Exactly one identity this app can read:** straight in, **no screen at all**: the directory's teams, then the Team step's rules unchanged (one team: signed in; several: the Team step; none: the zero-teams help text). A record only a newer app can read does not count, here or in rule 3; with nothing else on the device the app shows Welcome with "update the app".
-3. **Two or more:** "Choose an Oficina ID", a list of them (the device's last used first), plus "Use another Oficina ID" and "Other ways to sign in…". Picking one goes on as rule 2. Back from a later step returns here.
+3. **Two or more:** "Choose an Oficina ID", a list of them (the device's last used first), plus "Use another Oficina ID" (which adds one) and "Other ways to sign in…". Picking one goes on as rule 2. Back from a later step returns here, in the same order. If identities are removed while it shows, the list follows: one left is "Continue as <label>", none is Welcome.
4. **None:** Welcome.
-Going straight in that fails without a session to fall back on (§11) — Oficina ID refusing the proof, say — lands on "Continue as <label>" with the error, so the person sees who they are, Try again and "Use another". An app waiting on Welcome when another app signs in makes the same decision at once. **"Use another Oficina ID" lives in the account menu** of the signed-in app: in slice A it still replaces the identity, so it confirms ("Sign out of <label> and use another Oficina ID?"), signs it out properly for every app on the device (§10), and goes to Email; cancelling changes nothing. **Signing out of the only identity returns to Welcome** in this app and in every other, and nothing signs back in until someone does.
+**While going straight in** the app shows a spinner ("Signing in") with "Other ways to sign in…" under it from the start. If it has not finished after about **8 seconds** it shows "Continue as <label>" with "Oficina ID is taking a while to answer. You can keep waiting or try again." The attempt carries on: if it then succeeds the app signs in, unless the person has chosen something on that screen meanwhile (Continue, Use another, Other ways), which abandons it.
+
+**Where a failure lands:**
+- **Home says the grant has ended** (signed out elsewhere, expired, revoked): the record is removed, Welcome with "You were signed out of Oficina ID on this device." (§3, §6).
+- **The instance is unavailable** with no session to fall back on: "Can't reach Oficina ID" with Try again and "Other ways…" (§11).
+- **Not a member** of the team, and **a member with no link yet**: their own screens (§8), as from the Team step.
+- **Anything else** (Oficina ID refusing the proof, offline with no cached teams, the keychain refusing): "Continue as <label>" with the error, Try again, "Use another Oficina ID" and "Other ways to sign in…".
+
+**An app waiting on Welcome** follows another app's sign-in only when an identity is **added** that was not on the device when it arrived at Welcome; it then makes the launch decision above, once however many notifications arrive. It follows nothing while a sign-in of its own is under way (a passkey, an email code), while its own sign-in ("Other ways…") is open, or after **this app's own sign-out** or Home ending its grant, until the app is next launched or the person starts again: one of several identities signing out never signs the app straight in as another, and a record that cannot be deleted never loops. If the person has left Welcome by the time the decision runs, nothing happens.
+
+**"Use another Oficina ID" lives in the account menu** of the signed-in app: in slice A it still replaces the identity, so it confirms ("Sign out of <label> and use another Oficina ID?"), signs it out properly for every app on the device (§10), and goes to Email. Asking changes nothing until the person confirms: the session, a renewal in flight and anything on screen carry on, so cancelling changes nothing. **Signing out** returns this app to Welcome, and every app that was using that identity; nothing signs back in until someone does (above), even with another identity on the device. A sign-out the keychain refuses says so ("Oficina ID couldn’t be removed from this device…") and this app stays signed out.
**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.