BUILDING: Oficina ID entitlements, the Developer ID profile, the launch check and the screenshot gate
Human
Prompt
5. Adopt RastrilloSnapshots for Docs' key screens (library, onboarding, settings) per the adoption steps; note web/Metal views draw blank and bundled fonts must be registered first; push baselines in small commits (<700 KB each — the hub rejects packs over ~1 MB).
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
Where each build's entitlements live and why Docs' own keychain group comes first; the profile's local path and --provisioning-profile; what an ad hoc or simulator build cannot do; the launch check; and how to run, record and push the screenshot gate.
1 file changed,
+66
−0
native/BUILDING.md+66 −0
CI passed — run details
diff --git a/native/BUILDING.md b/native/BUILDING.md| index 6788229..a1b8474 100644 |
| --- a/native/BUILDING.md |
| +++ b/native/BUILDING.md |
| @@ -54,3 +54,69 @@ Native UI tests use fresh local credentials and isolated databases. See |
| [REVIEW.md](REVIEW.md) for their runner, exact evidence, and untested behavior. |
| Performance measurements and their limits are in |
| [benchmarks/README.md](benchmarks/README.md). |
| + |
| +## Oficina ID: entitlements, profiles and the launch check |
| + |
| +Docs signs in with Oficina ID first (Home's |
| +`docs/superpowers/specs/2026-11-14-oficina-id-native.md`, slice A), through |
| +rastrillo/native's `RastrilloApple/OficinaID` kit. "Other ways to sign in…" |
| +keeps the server address and browser approval. The kit needs these grants on |
| +every build: |
| + |
| +| Build | File | App group | |
| +| --- | --- | --- | |
| +| Mac, Sparkle (Developer ID) | `macos/DeveloperID.entitlements`, named by `mac-updates.json` | `9U4A84C4WK.works.oficina` | |
| +| Mac App Store | `macos/AppStore.entitlements` | `9U4A84C4WK.works.oficina` | |
| +| iPhone and iPad | `ios/DocsPhone.entitlements` | `group.works.oficina` | |
| + |
| +All three have `keychain-access-groups` = `9U4A84C4WK.works.oficina.docs` |
| +**first**, then `9U4A84C4WK.works.oficina.id` (a query that names no group |
| +lands in the first, and Docs' own items must never land in the group every |
| +Oficina app reads), and `webcredentials:id.oficina.works`. |
| + |
| +A Developer ID Mac app that claims these without an embedded provisioning |
| +profile is killed at launch. `mac-updates.json` names the profile by its local |
| +path, `~/private_keys/oficina/profiles/Oficina-Docs-macOS-Developer-ID.provisionprofile`; |
| +the profile itself is never committed. Elsewhere, pass |
| +`--provisioning-profile <path>`, which wins over the configuration, to |
| +`scripts/build-mac.sh` and to rastrillo's `release_mac.py`. A signed build: |
| + |
| +```sh |
| +native/scripts/build-mac.sh --updates-config mac-updates.json \ |
| + --sign-identity 'Developer ID Application: Team Tito Limited (9U4A84C4WK)' |
| +``` |
| + |
| +An ad hoc build (no `--sign-identity`) drops those grants and says so on |
| +stderr. It still runs, but Oficina ID cannot read the keychain there |
| +(-34018), so Welcome says it couldn't be read. Simulator builds |
| +(`CODE_SIGNING_ALLOWED=NO`) are the same. |
| + |
| +**The launch check** is the spec's launch gate (§13): before any Sparkle |
| +publish, run the final signed, notarised artifact's executable with |
| +`--oficina-id-launch-check`. |
| + |
| +```sh |
| +"native/build/Oficina Docs.app/Contents/MacOS/DocsMac" --oficina-id-launch-check |
| +``` |
| + |
| +macOS checks the embedded profile as the process starts. The check then reads |
| +the entitlement's group order, both keychain groups and the App Group, prints |
| +counts (never an identity or a session) and exits 0 only if all of them work. |
| +An ad hoc build fails it. |
| + |
| +Sign-in itself needs Home's native endpoints at `id.oficina.works` and the |
| +directory at `oficina.works`; passkeys also need Home's association file. The |
| +kit's in-memory `FakeOficinaIDService` stands in for all of them in |
| +`OficinaIDAdoptionTests` and the screenshot gate. |
| + |
| +## The screenshot gate |
| + |
| +`native/scripts/snapshots.sh [compare|record] [mac|iphone|all]` draws Docs' key |
| +screens (library, Oficina ID onboarding, Other ways to sign in, the team |
| +picker, Mac Settings) in light and dark, and on iPhone at AX3 too, and compares |
| +them with `apple/Tests/DocsSnapshots/__Snapshots__/docs`. The contact sheet is |
| +`apple/.build/snapshots/docs/index.html`. It is not in `.amadan/ci.d`: |
| +baselines are exact only on the OS and simulator runtime that drew them |
| +(`ENVIRONMENT` beside them). After an intended change, `record`, read the |
| +contact sheet, and commit the pictures in pushes under about 700 KB: the hub |
| +drops a push whose pack is over about 1 MB. |