oficina / docs Public

feat/oficina-id-native-connect

🤖 Oficina ID native slice A: Docs wiring for the consumer (connect) half. Docs is the first app (Q7). It uses Home branch feat/oficina-id-native-connect (hub oficina/home), whose description holds the full change list and the wire notes. Home spec: docs/superpowers/specs/2026-11-14-oficina-id-native.md §7, §8 and §13, which Paul approved and cleared to build on 2026-11-14. Do not merge without review. No deploy.

What changed

  • Pins. amadan.net/oficina/home/connect and /handoff are pinned to Home main e03a01a, the landed native connect slice.
  • Members choose (team mode). connect's new Config.Admit is wired to Runtime.AdmitUnlinked (homeRoutes.admit), which allocates nothing. A roster member with no account here gets "Welcome to the team" at GET/POST /account/home/choose, with "Connect my existing account" and "I'm new here — continue with Oficina ID", instead of an automatic Home-only principal. Unlinked/EnsureHome run only after "I'm new here". Non-members and an undecidable roster answer exactly as before. The page is views/home_link.html with a Choice branch: two POSTs carrying connect's form token. The copy is in Catalog as docs.home.choose_*, worded as the spec has it.
  • Native sign-in. Docs mounts connect.Bridge.NativeExchange at POST /native/oficina-id. Its session is minted through MintNativeSession with the same rastrillo session store and cookie name, no cookie set, and method home-assertion-native. This works outside team mode too, for linked accounts.
  • IsHomeDerived adoption. The identity resolver, admission's address fallback, the "missing adapter fails closed" guard, the team account-group guard and the "Connect your Oficina account" menu label all ask connect.IsHomeDerived. The resolver also refuses a native or native-web session 7 days after it was minted (connect.Expired). Docs resolves sessions itself, so it must refuse what connect refuses.
  • implementation/team-mode-integration.md gains a dated amendment: ordinary completion no longer allocates.

Tests

  • Router level, home_native_test.go: a linked account's native session opens the JSON list; the session is refused after 7 days; a browser-shaped POST is refused; in team mode a member gets 409 choose with nothing allocated, then choice:"new" signs in and opens the list; non-members get the identical 403 whatever they send; an undecidable roster gives 503.
  • Team tests follow a member's first browser entry through the choose page (chooseNew).
  • TestTeamAdmitDecidesAndAllocatesNothing and TestChooseCopyIsTheSpecs.

For Paul

  • Button order on the choose page: "Connect my existing account" is primary and first, in spec order; "I'm new here" is the ghost button. Say if it should be the other way round.

Not here

  • The Swift client, which another agent is building. The app must send the exchange without an Origin header (wire note 2 on the Home branch).
  • An unlink path. Docs has none, and its triggers forbid deleting links.
  • The other four apps (slice C).

Gate

.amadan/ci.d/10-gate prints gate: ok at the tip. I ran it with TMPDIR=/tmp/dg (a short socket path for cmd/docs) and GOTOOLCHAIN=go1.26.5. I did not run 20-native (Swift tests), because this branch changes no Swift.

Review

Fable reviewed e9b8932: APPROVE AFTER FIXES. Fixes:

  • origin/main (f663e9f) is merged in.
  • New router tests in home_choose_test.go: - "Connect my existing account" spends the proof, resumes the local link, and the member's Oficina ID then opens Alice's account. - "I'm new here" is refused while the browser holds a session, and the proof survives. - A cross-origin choose POST is stopped by the real csrf.Protect and allocates nothing.
  • Repinned to Home main e03a01a at 9f1354c: go mod tidy and verify are clean, 10-gate prints gate: ok, and hub CI passed.
Commits 7
Discussions 0 0 open
Tasks 4/5 done

Activity