oficina / docs Public

native/oficina-id-slice-a

Docs is the first native app on Oficina ID (Home docs/superpowers/specs/2026-11-14-oficina-id-native.md, slice A), on rastrillo/native main f1c7a14 (a6bc64b): c989034 plus the landed kit branch native/oficina-id-team-refresh (refreshTeams, 69e7c88). It also takes the shared menu-name fix and the screenshot gate. Fable reviewed d143194: APPROVE AFTER FIXES. All MUST and SHOULD items are fixed in fe88428, 523cb59 and 808018e; the re-review of d143194..808018e returned APPROVE, and its two small follow-ups are in 61e06d0. Not merged. No deploys, Sparkle publishing, portal changes or device installs.

What changed

  • Pin (6d327dc): rastrillo/native c989034 in Package.swift/.resolved, both XcodeGen projects, the notice provenance and the Colophon (regenerated).
  • Entitlements (7313cde): macos/DeveloperID.entitlements (Sparkle), macos/AppStore.entitlements, ios/DocsPhone.entitlements. Each has keychain-access-groups [9U4A84C4WK.works.oficina.docs first, 9U4A84C4WK.works.oficina.id], an app group (9U4A84C4WK.works.oficina on Mac, group.works.oficina on iOS) and webcredentials:id.oficina.works. mac-updates.json names the entitlements and the profile by its local path, ~/private_keys/oficina/profiles/Oficina-Docs-macOS-Developer-ID.provisionprofile (mac_updates.py expands ~). --provisioning-profile overrides it at release, and an ad hoc build never reads it. The profile is not committed. The file also lists the twelve localizations, and both Xcode projects declare CFBundleLocalizations.
  • Sign-in (45d7e53): - DocsOficinaSession wraps OficinaIDModel.live(configuration: docs/Docs, appGroup:). There is one per app, started once. - Workspaces are keyed oficina-id.<identity>.<team> and read their team's latest session on every request. The offline store and outbox therefore survive the 24-hour re-mint and the 401 re-mint. - A 401 or 303 from the instance calls sessionRejected(), at most once a minute per account, and then restores the drainer. renewIfNeeded() runs whenever a scene becomes active. - OficinaOnboardingView is the first screen. "Other ways to sign in…" is the old server-address and browser sign-in, with "Sign in with Oficina ID" beneath it. - DocsSignInRoute keeps anyone already signed in the old way on that route until an Oficina ID replaces it (Appendix C). - The toolbar's Accounts button becomes Teams. DocsTeamPicker lists the kit's cached teams that have Docs, then "Other ways…", then "Sign out of <label>". Sign-out is refused while anything is unsent or while a document window of any of that identity's teams is open. - The passkey nudge sits under the workspace.
  • Mac chrome (45d7e53): PlainAppNameCommands() is first in .commands. Settings { … } shows the account and the version, with .navigationTitle("Docs") (localised native.docs).
  • Launch check (45d7e53): DocsMac --oficina-id-launch-check is the spec's §13 launch gate. It reads the entitlement order, both keychain groups (decoding identity records through OficinaIDStore) and the App Group. It prints counts only, and exits 0 only if every check works.
  • Screenshot gate (79ad073, baselines dbd5399 9a2500e 7909ee8 c929ef5): - Tests/DocsSnapshots runs on Mac and DocsPhoneSnapshots on iPhone, sharing the same file. - Screens: library (with documents, and empty), onboarding welcome/code/teams, other ways, the team picker, and Mac Settings (Oficina ID and server). - Variants: 18 Mac images and 28 iPhone images (iOS 27.0 sim, AX3 included). - native/scripts/snapshots.sh [compare|record] [mac|iphone|all] runs it. It is deliberately not in ci.d. - Bundled fonts are registered first. The editor is left out: web and Metal content draws blank, and TextKit's first layout can outlast the settle window.
  • Quiet updates (59b047b): "install": "automatic" in mac-updates.json, NativeUpdater(policy: .quiet), NativeUpdateNotice under the Home window only while canInstallPendingUpdate (as Calendar a90867e). localizations lists exactly the twelve .lproj languages.
  • Lint (d143194): skipDir skips .build. 10-gate failed locally once the native build had made native/apple/.build/checkouts/native/server (rastrillo/native's Go server, pre-move imports); a fresh hub clone passed.
  • Docs: BUILDING.md has a section on Oficina ID, profiles, the launch check and the snapshot gate (332992f). Ten new strings are translated into all twelve languages. The kit's own strings stay English until its review.

Review fixes (Fable on d143194)

  • B1: teams refresh at launch, when the picker opens (the kit refreshes at most every 5 min) and on any 403 from the instance (at most once a minute). The kit side is rastrillo/native native/oficina-id-team-refresh 69e7c88: OficinaIDModel.refreshTeams(maxAge:) with 4 tests, and make ci green there.
  • B2: store keys survive an origin change. An Oficina ID account's sealed-store key is filed under a fixed origin. A label move, rename or self-host DNS change therefore keeps the store and the unsent outbox. Server accounts still key by host.
  • B3: document windows use the current session. Sharing, export, images, Jump and the editor context take a NativeTransport resolved when used: the watched supplier, falling back to the window's client.
  • S1: route. It changes only on a sign-in made here (DocsOficinaSession.signIns), never on a restore.
  • S2: workspace stays mounted. mounted keeps the team on screen while the model is at unavailable for that same team. The "Can't reach Oficina ID" line and Try again show over it. A failed team switch shows model.error in the same place and in the picker. "Use another" is cancelled, with the reason, when Docs' guard refuses.
  • S3: launch check. It now checks the App Group and associated-domains entitlements via SecTask.
  • S4/S5: guards. DocsLeaveBlock.check is identity-wide: open document windows of any team, then every team's outbox, including crash-left ones on disk. Sign-out, Use another, the picker and Settings (Change team… and Sign out) all use it and show one line saying why. The two new strings are in all twelve languages.
  • Also fixed: - Account-ID parts that aren't base64url-safe are encoded. - The disabled sign-out in the picker no longer looks enabled. - New snapshots: team-picker-blocked and settings-blocked.
  • S7: tests added. Purge on identity replacement; a re-mint restarting a stopped outbox; a 401 with Home down; restore vs sign-in; the 24 h renew; refresh at launch, on the menu and on a 403; the store surviving an origin change; crash-left unsent changes blocking sign-out; guard order; the launch check failing unsigned; the Mac identity-wide window guard. Mutations of the key origin, the mounted case, the sign-in count and the live client each fail their test.
  • Later (noted, not done): kit string translations (S6). The light iPhone library toolbar contrast needs checking on a real device before changing.

Gates at d143194

  • .amadan/ci.d/10-gate: gate: ok. .amadan/ci.d/20-native: Native checks passed, with 109 XCTest tests (4 skipped, 0 failures) plus the Swift Testing suites. Both ran locally (GOTOOLCHAIN=go1.26.5, rustup cargo).
  • Hub CI passed.
  • native/scripts/snapshots.sh compare all is green: 18 Mac and 28 iPhone images.

What ran for real (this Mac, macOS 27, 2026-11-14)

  • The Developer ID Sparkle build with the profile embedded launches and stays up. taskgated-helper logged "allowing entitlement(s) for works.oficina.docs due to provisioning profile". codesign shows the three entitlements in order. The launch check passes.
  • An ad hoc build fails the launch check: entitlements are dropped and the result is -34018.
  • Shared keychain across apps: a Developer ID probe signed as works.oficina.sheets (rastrillo's tools/oficina-id-probe) wrote a Secure-Enclave identity to the shared group. The real Docs artifact then read and decoded it ("1 identities"), and could not see Sheets' session in its own group ("0 sessions"). The probe removed the identity afterwards.
  • OficinaIDAdoptionTests (8 tests) run the whole flow against FakeOficinaIDService: sign-in, the session supplier, re-mint after a refused session plus the rate limit, team switch, and sign-out leaving no transport. Mutations of the rate limit and of the sign-out clear make them fail.
  • Snapshot compare is green on Mac and iPhone. Changing "Teams" to "Teamz" fails it (35/41 px).
  • Builds succeeded: iOS simulator DocsPhone and Mac App Store DocsMacStore, both unsigned.

Not exercised

  • Correction: Home's native endpoints are deployed (prod c998720). Read-only probes: code/start answers 400 to an empty body, assert answers 401, the AASA on id.oficina.works lists 9U4A84C4WK.works.oficina.docs, and /api/native/teams answers 401. A real sign-in (email code from Paul's inbox) was not run: this session can't drive the GUI. paulca.docs.oficina.works didn't answer TLS: the Docs server deploy of main 9de84e4 is still in progress by another agent.
  • The app GUI driven on screen: screen capture and Accessibility are not permitted in this session.
  • iOS on a device. Notarisation. A Sparkle update from the old build.

Release dry run (built and notarised from 61e06d0; not published)

  • build-mac.sh --configuration release --updates-config mac-updates.json --version 0.1.8 --build 10 with the Team Tito Developer ID, then release_mac.py with the declared entitlements and profile (--team 9U4A84C4WK --notary-profile slopbox-notary).
  • Output: /Users/paulcampbell/amadan.net/oficina/sparkle-worktrees/releases/docs-0.1.8-10/works.oficina.docs-10.zip, 14 739 653 bytes, sha256 29029b65ca568b79b4b65975862dbc012c770da9fb102350fc879ee8565fff62. Notarization ID ff12f32d-cc5e-419a-ab86-a0e8bb04b2b4; profile UUID e031a486-2b28-41d5-b922-aa21422de4fb.
  • Checks on the app unzipped from that archive: - stapler validate passes. - spctl: accepted, "Notarized Developer ID". - The profile is embedded. - --oficina-id-launch-check prints all five lines ok and exits 0. - The app launches; taskgated-helper logs "allowing entitlement(s) for works.oficina.docs due to provisioning profile".
  • Publisher plan-only (no --publish): release docs-10, download …/-/releases/docs-10/works.oficina.docs-10.zip, feed docs/appcast.xml. The native-releases clone is untouched.
  • The published feed is at 0.1.7 (9). Sparkle installing over the net.amadan.oficina.docs app is untested; the fallback is the manual reinstall.

Open questions / for Paul

  1. A 401 in a document window of a team that is not active can't be re-minted without switching team. That window shows the session as ended until its team is chosen again.
  2. Snapshot findings to check on a device. On the Mac, the home sidebar's "Recent" label draws dark on dark blue in dark mode. On iPhone, the glass toolbar icons and the search field draw almost white on light. Either may be the off-screen renderer.
Human

Docs becomes the first native app on Oficina ID (slice A): rastrillo/native c989034, entitlements and profiles for the shared keychain, the kit's onboarding as the primary sign-in with the old server-address sign-in under Other ways to sign in, PlainAppNameCommands and a Settings window, and the RastrilloSnapshots gate. Work in progress.

Commits 16
Discussions 0 0 open
Tasks 9/13 done

Activity