Native slice 2: spec §7 with Paul's rulings, and the part 1 plan
Human
Prompt
Paul approved slice 2 with all 12 recommendations as written, and said to start part 1 now. Make the draft the spec's §7 with Paul's rulings recorded (the 12 recommendations; jobs started in Equipo stay in Equipo, jobs started in Base stay in Base; Base takes over Live Activities for Ask jobs in slice 3), and write the part 1 implementation plan: Store and People JSON API and native screens, the collapsible Apps section, attaching files natively, strings for copy review. Don't build yet.
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
Adds section 7 to the native spec (notifications, decisions on cards, Store and People, files, opening Oficina documents; Paul's 2026-11-28 rulings in 7.9) and the slice 2 part 1 plan, 19 tasks, tests first, with gates per task.
Agent notes
Task 4 is a rastrillo/native change: the kit's NativeHTTP can't send Content-Disposition or report upload progress, which Base's upload relay needs. Luna reviews the new strings from 2026-12-02; the release waits for that, building doesn't.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 files changed,
+1,113
−2
docs/superpowers/plans/2026-11-28-native-slice2-part1.md+457 −0docs/superpowers/specs/2026-11-23-base-native-design.md+656 −2
CI passed — run details
CI log
=== build === CGO_ENABLED=0 go build ./... === vet === go vet ./... === fmt-check === === staticcheck === go run honnef.co/go/tools/cmd/staticcheck@v0.7.0 ./... === govulncheck === go run golang.org/x/vuln/cmd/govulncheck@v1.8.0 ./... No vulnerabilities found. === gitleaks === [90m6:51PM[0m [32mINF[0m [1mUnknown SCM platform. Use --platform to include links in findings.[0m [36mhost=[0mamadan.net [90m6:51PM[0m [32mINF[0m [1m1 commits scanned.[0m [90m6:51PM[0m [32mINF[0m [1mscanned ~2780195 bytes (2.78 MB) in 246ms[0m [90m6:51PM[0m [32mINF[0m [1mno leaks found[0m === budget === go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget size budget size: 22 directories within budget === script-test === scripts/prepare-apps_test.sh ok releases lookup failure stops before ship ok app owned elsewhere stops the script ok apps listing failure stops before create ok ambiguous release dir is refused ok explicit version resolves the ambiguity ok releases match is exact, not substring ok shipped version is only promoted, existing app not created ok fresh account creates, ships, promotes to edge, enables ok failing promote stops the script ok ship is retried while uploads are rate limited all passed hack/fonts_test.sh fonts_test: ok === test === go run amadan.net/rastrillo/rastrillo/cmd/rastrillo budget test -count=1 ./... receipt: test step 9.239s against a 60s target (the gate's other steps are not in this figure) receipt: 16 packages ran, 0 cached, 6 without tests, 0 failed receipt: slow package 8.475s amadan.net/oficina/base/internal/webtest receipt: slow package 718ms amadan.net/oficina/base/internal/issuer receipt: slow package 623ms amadan.net/oficina/base/internal/equipo receipt: slow package 584ms amadan.net/oficina/base/internal/operations receipt: slow package 182ms amadan.net/oficina/base/internal/consumer receipt: slow test 1.51s amadan.net/oficina/base/internal/webtest TestHomeDoesNotWaitOnAStalledSnapshot receipt: slow test 1.09s amadan.net/oficina/base/internal/webtest TestAskZoneIsToldOnce receipt: slow test 610ms amadan.net/oficina/base/internal/webtest TestAskUploadStalledBodyFreesItsSlot receipt: slow test 510ms amadan.net/oficina/base/internal/operations TestOperationsRefusals receipt: slow test 500ms amadan.net/oficina/base/internal/equipo TestUploadRefusals === native === strings: copy review's strings.json is not here (git-ignored); its comparison skipped strings: 120 in the catalog, 117 used worktree-lib_test: ok
diff --git a/docs/superpowers/plans/2026-11-28-native-slice2-part1.md b/docs/superpowers/plans/2026-11-28-native-slice2-part1.md| new file mode 100644 |
| index 0000000..f912995 |
| --- /dev/null |
| +++ b/docs/superpowers/plans/2026-11-28-native-slice2-part1.md |
| @@ -0,0 +1,457 @@ |
| +# Base on the Mac and iPhone, slice 2 part 1: Implementation Plan |
| + |
| +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task by task. Steps use checkbox (`- [ ]`) syntax for tracking. Every task is tests first: write the failing test, see it fail, make it pass, then run the task's gate. |
| + |
| +**Goal:** In the Mac and iPhone apps, a person opens Store and People natively instead of on the web, folds the Apps section away (remembered for them on that device), and attaches files in Ask. That means the paperclip or `+`, Photos, Camera and Files, paste, drop, HEIC to JPEG on the device, chips, files in the sent bubble, and Quick Look. |
| + |
| +**Spec:** `docs/superpowers/specs/2026-11-23-base-native-design.md` §7, approved by Paul on 2026-11-28 with every recommendation. Part 1 is 7.4, 7.5 (Apps folding only) and 7.6. The files design (`2026-11-26-ask-attachments-design.md`) binds too: R1, R3, R5, D1 to D8. The mockups are `.superpowers/mockups/native-s2/` (git-ignored; `python3 build.py`), sections 3 and 4. |
| + |
| +**Not in part 1:** notifications (part 2), decisions on the cards (part 3), "Made with Base" and opening documents (part 4). |
| + |
| +**Architecture:** |
| +- **Base's server** gains five JSON routes beside the Store and People pages. They use the same builders and the same owner checks, behind the member gate and the native session. Nothing else changes on the server: the files routes are live (Base `07ec2ec`, `docs/api/base-native-v1.md` "Files"). |
| +- **rastrillo/native** gains one transport call for uploads. Uploads need a `Content-Disposition` header and upload progress, and the kit's `NativeHTTP` offers neither (`responseDetails` takes a path, method, body and content type only; `bb989a7`). Base repins. |
| +- **The app (BaseKit)** gains: |
| + - Store and People models and screens, shared by both platforms; |
| + - the Apps fold; |
| + - `BaseKit/Attachments/`, copied from Equipo (R5) and then adapted to Base's relay and its rules (two uploads at a time, Remove deletes, busy is retried, D5, D8). |
| + |
| +**Tech stack:** as slice 1. |
| +- **Server:** Go (`GOTOOLCHAIN=go1.26.11`, `CGO_ENABLED=0`), chi, rastrillo. |
| +- **Native:** Swift 6.2 / SwiftUI on macOS 26 and iOS 26, RastrilloApple, `PhotosUI`, `QuickLook` / `QuickLookUI`, `ImageIO`, `UniformTypeIdentifiers`. |
| + |
| +**Repositories and branches:** |
| + |
| +| Repo | Tasks | Branch | |
| +|---|---|---| |
| +| **rastrillo/native** | 4 | `upload` from `origin/main` | |
| +| **Base** (this repo) | 1 to 3, 5 to 18 | `native/slice2-part1` from `origin/main`, after `design/native-slice2` (this plan) lands | |
| +| Controller | 19 | copy review (Luna, from 2026-12-02), deploy, release | |
| + |
| +**Equipo** needs no change. The code it lends is copied from origin/main `8bd40ed1`. |
| + |
| +## Machine hygiene (every task) |
| + |
| +- **One heavy job at a time.** Before any `swift test`, `swift build`, `snapshots.sh`, `check-native.sh` or a Go test run, check: |
| + ``` |
| + sysctl -n vm.loadavg; pgrep -fl 'xcodebuild|swift-(build|test)|xctest|go (test|build|vet)' |
| + ``` |
| + Wait while the 1-minute load is over 20, or while two or more heavy jobs from other sessions are running. |
| +- **Cap the job's parallelism:** |
| + - `go test -p 4`; |
| + - `swift test --package-path native/apple -j 4`; |
| + - `xcodebuild -jobs 4`, where the scripts pass it through. |
| +- **Give every heavy command a timeout in minutes.** |
| +- **While iterating, run the narrowest test:** `go test -p 4 ./internal/webtest -run TestAPIStore`, or `swift test --package-path native/apple -j 4 --filter BaseKitTests.StoreModelTests`. |
| +- **Never run the whole Go suite or `make ci` locally.** That's hub CI's job. |
| +- **`check-native.sh` runs once per task, at the task's end. `snapshots.sh` runs only in tasks that change a picture.** |
| +- **Simulators:** reuse the "Rastrillo Snapshots" simulator that `snapshots.sh` uses. Never create one. |
| + |
| +## Gates |
| + |
| +| Gate | Command | When | |
| +|---|---|---| |
| +| Go, narrow | `GOTOOLCHAIN=go1.26.11 go test -p 4 -count=1 ./internal/web ./internal/webtest -run '<tests>'` (timeout 10 min) | Tasks 1 to 3 | |
| +| Swift, narrow | `swift test --package-path native/apple -j 4 --filter '<suite>'` (timeout 15 min) | While iterating, every native task | |
| +| Native gate | `native/scripts/check-native.sh` (timeout 30 min): the catalog, every BaseKit test, BaseMac, and the iPhone Simulator build | End of every native task | |
| +| Screenshots | `native/scripts/snapshots.sh compare mac`, then `iphone` (timeout 20 min each). `record` only for pictures the task means to change; review the contact sheets beside the mockups before committing them | Tasks 7, 9, 14, 15, 16 | |
| +| Hub CI | push, then `AMADAN_HOME=$HOME/.amadan-claude-agent amadan ci status oficina/base -branch native/slice2-part1 -json` | After each pushed task | |
| + |
| +**Hub CI** runs `make ci` (Go) and `95-native` (`check-native.sh`, or `--core-only` off a Mac). It never runs the screenshots, which are exact only on the OS that drew them. Read its verdict before calling a task done; a pass means only that what it ran passed. |
| + |
| +## Plan decisions |
| + |
| +- **P1. Five JSON routes, from the pages' own builders.** |
| + - The routes: `GET /api/v1/store`, `POST /api/v1/store/{app}/install`, `POST /api/v1/store/{app}/uninstall`, `GET /api/v1/people`, `POST /api/v1/people`. |
| + - **Shared builders.** Task 1 moves the reading the pages do into `storeContent` and `peopleContent`, and the writing into `invitePerson`. The page and the JSON answer then can't drift, as with `homeContent` and `/api/v1/home`. |
| + - **Writes** take JSON (`{"email": …}`) or no body. They need the native session and `Origin`, as every write does (Base's CSRF check). Never a form. |
| +- **P2. Answers to writes:** |
| + |
| + | Route | Answers | |
| + |---|---| |
| + | `POST /api/v1/store/{app}/install` | `202 {"store": Store}` (the store as it now stands, the app installing); `403 {"code":"owner_only"}`; `404 {"code":"unknown_app"}` | |
| + | `POST /api/v1/store/{app}/uninstall` | `200 {"store": Store}`; `409 {"code":"busy"}` while it installs; `403`; `404` | |
| + | `POST /api/v1/people` | `200 {"people": People}`; `422 {"code":"bad_email"}`; `502 {"code":"mail_failed"}` (invite again to retry, as on the web); `403 {"code":"owner_only"}` | |
| + |
| + Every answer is `Cache-Control: no-store`. |
| +- **P3. The app falls back to the web for an older server.** If `GET /api/v1/store` or `/people` answers `404` (a Base from before Task 2), the sidebar row opens the web page, as slice 1 does. The app can therefore ship before or after the server. |
| +- **P4. Store polls while installing,** every 2 s with the app in front. It stops when nothing is installing, or when the screen goes away. That matches the web's `<meta refresh content=2>`. |
| +- **P5. Folding is local.** `SidebarFolds` keeps the Apps section's state in `UserDefaults.standard`, keyed `base.fold.apps.<sha256(origin)[0..16]>.<memberID>`. That is per person and per device, never synced. It starts open. The web's `rail_expanded` (migration 0007) is its own. |
| +- **P6. The upload transport is a kit call (Task 4):** |
| + ```swift |
| + NativeHTTP.upload(_ path: String, body: Data, contentType: String, |
| + filename: String, maxBytes: Int, |
| + progress: @Sendable (Double) -> Void) async throws -> NativeResponse |
| + ``` |
| + - It sends `Content-Disposition: attachment; filename*=UTF-8''<percent-encoded>`, as Equipo's client does (`EquipoKit/API/Attachments.swift:21-22`). |
| + - It reports progress from `didSendBodyData`. |
| + - `ScriptedTransport` records the filename and the body size for tests. |
| + - It is a protocol requirement on `NativeTransport`, with a default that throws, so other apps' fakes still build. |
| +- **P7. What's copied from Equipo, and from which revision.** The copy is from Equipo origin/main `8bd40ed1`. Each copied file starts with a line naming its source path and that SHA. |
| + - **Copied as they are:** |
| + - `native/share/Sources/EquipoShareCore/AttachmentFile.swift` and `FileAttachment.swift`: type sniffing, HEIC, HEIF and TIFF to JPEG, a 2560 px long edge, and the regular-file checks; |
| + - `EquipoKit/Attachments/AttachmentViews.swift`: the chips, the bubble's thumbnails and the preview; |
| + - `PhoneAttachmentPicker.swift`; |
| + - `EquipoMac/MacComposer.swift`'s paste and drop part, and `AttachmentPromises.swift`. |
| + - **Copied and then changed** (Task 12): `AttachmentDraft.swift` and the `Attachments.swift` client. |
| + - **Not copied:** `RecentScreenshot.swift` (spec 7.6: it needs Photos permission), `ShareFixture.swift`, and the share extension. |
| + - **Tests** are copied with their code: `AttachmentTests`, `AttachmentReviewTests`, `MacAttachmentTests`, and the fixtures under `Fixtures/attachments`. |
| +- **P8. Where Base differs from Equipo's native files code:** |
| + 1. **Remove deletes the upload** (`DELETE /ask/attachments/{id}`, D6). Equipo's `remove` only cancels (`AttachmentDraft.swift:53`). |
| + 2. **Uploads go two at a time, in order.** A `503 busy` is retried by itself after `Retry-After`. Equipo starts every upload at once. |
| + 3. **Unsent uploads are discarded** (`POST /ask/attachments/discard`, up to five ids a call) when the person signs out, switches account, or quits. On iPhone, also when the scene goes to the background with chips still unsent. This is best effort; Equipo's 24-hour drop catches the rest. |
| + 4. **The paperclip and `+` show only while `can_attach`** (`/ask/state`; `AskSnapshot` gains it). |
| + 5. **D5:** |
| + - A send refused with `409 files:"unavailable"` keeps Ask ready, drops `can_attach`, marks every chip with the web's words, and lets the words go alone. |
| + - `422 files:"stale"` marks the chips "This file has expired. Attach it again." |
| + 6. **D8 on paste:** if the pasteboard holds any text beyond the files' own names, the text is pasted (through `PasteMarkdown`, as now). Otherwise its images and files are attached. |
| + 7. **The refusal words are Base's** (the web's, copy review 13), keyed by Equipo's codes: `attachment_too_large`, `_type`, `_heic`, `_pixels`, `_limit`, `busy`. |
| +- **P9. Opened files live in the app's cache** (7.9, 12). |
| + - The folder is `Caches/Attachments/<account>/`, with `isExcludedFromBackup` set, files `0600`. |
| + - Originals come from `GET /ask/attachments/{id}` through the kit's `download(_:to:)`. |
| + - Previews come from `/preview` (bounded at 2 MiB) into an in-memory cache of 64 items. |
| + - The folder is cleared on sign-out, and anything older than 14 days is cleared at launch. |
| + - The 14-day sweep reads file dates, so `PrivacyInfo.xcprivacy` gains `NSPrivacyAccessedAPICategoryFileTimestamp` with reason `C617.1`. |
| +- **P10. Camera** needs `NSCameraUsageDescription` in `ios/project.yml`. Photos goes through `PhotosPicker`, which needs no permission. Files goes through `fileImporter`. On the Mac, `fileImporter` (multiple selection) takes the nine types plus HEIC, HEIF and TIFF, which become JPEG. |
| +- **P11. Strings.** |
| + - Words the web already has keep the web's approved text, under native keys (copy review 13, `chat.html` `data-w-*`, Store and People templates). |
| + - New words are drafted in the catalog with a `DRAFT` comment, and listed in `copy-review/slice2-part1.json` in the main checkout (git-ignored), for Luna from 2026-12-02. |
| + - `check-strings.py`'s `WAITING` holds nothing new. |
| + - The release (Task 19) waits for the review. Building doesn't. |
| + |
| +## File map |
| + |
| +``` |
| +internal/web/store.go storeContent (moved out of storePage) |
| +internal/web/people.go peopleContent, invitePerson (moved out of people, invite) |
| +internal/web/api_team.go NEW: apiStoreRead, apiStoreInstall, apiStoreUninstall, apiPeopleRead, apiPeopleInvite |
| +internal/web/app.go five routes beside /api/v1/home |
| +internal/webtest/api_team_test.go NEW |
| +docs/api/base-native-v1.md "Store" and "People" sections |
| + |
| +native/apple/Sources/BaseKit/ |
| + API/Client.swift API/Models.swift store, people, uploads, can_attach |
| + Team/StoreModel.swift Team/StoreView.swift Team/PeopleModel.swift Team/PeopleView.swift NEW |
| + Home/SidebarFolds.swift NEW |
| + Home/BaseActions.swift own apps routed natively |
| + Mac/MacMainView.swift MacPane (ask | store | people), Apps fold |
| + Phone/PhoneAskScreen.swift AppsSheet: Apps fold, "Your team", NavigationStack |
| + Attachments/ NEW: AttachmentFile, FileAttachment, AttachmentDraft, |
| + AttachmentViews, PhoneAttachmentPicker, MacAttach, |
| + AttachmentPromises, AttachmentCache, QuickLook |
| + Ask/Composer.swift Ask/Thread.swift Ask/AskModel.swift Ask/PasteMarkdown.swift |
| + Resources/Localizable.xcstrings |
| +native/apple/Tests/BaseKitTests/ StoreModelTests PeopleModelTests SidebarFoldsTests |
| + Attachment*Tests AttachmentCacheTests ClientTests (more) |
| +native/apple/Tests/BaseSnapshots/ TeamSnapshots.swift; AskSnapshots (chips, bubbles) |
| +native/ios/project.yml NSCameraUsageDescription |
| +native/PrivacyInfo.xcprivacy FileTimestamp C617.1 |
| +``` |
| + |
| +--- |
| + |
| +## Task 1: Store and People builders, shared |
| + |
| +**Files:** `internal/web/store.go`, `internal/web/people.go`. Existing tests: `internal/webtest/store_test.go` and `people_test.go`. |
| + |
| +- [ ] Write `internal/web/team_internal_test.go`. |
| + - `storeContent` returns a row per catalogue entry, with the install state and error, `owner`, and `installing`. |
| + - `peopleContent` returns a row per member, with `initial`, `name`, `email`, `role` (`owner` | `member` | `invited`) and `joined`. |
| + - `invitePerson` returns `inviteOK`, `inviteBadEmail` or `inviteMailFailed`, sends the invitation only until one is delivered, and changes nothing for an address already here. |
| +- [ ] Move the reads out of `storePage` and `people`, and the write out of `invite`, into those three functions. The pages render from them, with unchanged output. |
| +- [ ] **Gate:** `go test -p 4 -count=1 ./internal/web -run 'TestStoreContent|TestPeopleContent|TestInvitePerson'` and `./internal/webtest -run 'TestStore|TestPeople|TestInvite'`. The existing page tests pass unchanged. |
| + |
| +## Task 2: `GET /api/v1/store` and `GET /api/v1/people` |
| + |
| +**Files:** `internal/web/api_team.go` (new), `internal/web/app.go`, `internal/webtest/api_team_test.go` (new), `docs/api/base-native-v1.md`. |
| + |
| +- [ ] **Tests first, in `api_team_test.go`, with `newHomeApp`, `link` and `nativeSignIn` (`native_test.go`):** |
| + - **`TestAPIStore`:** the owner gets the following, `no-store`, `application/json`: |
| + ``` |
| + {"owner": true, "rows": [{id, name, summary, tint, icon_svg, state, error}]} |
| + ``` |
| + - in catalogue order; |
| + - an installing app reads `installing`; |
| + - a failed one reads `failed` with its error; |
| + - a member who isn't the owner gets `"owner": false`. |
| + - **`TestAPIPeople`:** |
| + ``` |
| + {"owner": bool, "people": [{id, initial, name, email, role, joined}]} |
| + ``` |
| + The owner, a joined member and an invited address, in the page's order. |
| + - **`TestAPITeamRefusesWithoutSession`:** `401 {"code":"unauthenticated"}` with no session, and for a removed member. |
| +- [ ] Implement both reads in `api_team.go` from Task 1's builders, and route them beside `/api/v1/home`. |
| +- [ ] **Docs:** add "Store" and "People" to `docs/api/base-native-v1.md`, with the shapes above. |
| +- [ ] **Gate:** `go test -p 4 -count=1 ./internal/webtest -run 'TestAPIStore|TestAPIPeople|TestAPITeam'`. |
| + |
| +## Task 3: The Store and People writes |
| + |
| +**Files:** `internal/web/api_team.go`, `internal/web/app.go`, `internal/webtest/api_team_test.go`, `docs/api/base-native-v1.md`. |
| + |
| +- [ ] **Tests first:** |
| + - **`TestAPIStoreInstall`:** for the owner, `202` with the app `installing`, and the installer's `Start` called once. A member gets `403 owner_only`. An unknown app gets `404 unknown_app`. A request without `Origin` gets `403` (CSRF). |
| + - **`TestAPIStoreUninstall`:** `200` with the app gone from `installed`. `409 busy` while it installs (an installer that answers `install.ErrBusy`). An app already uninstalled gets `200`. |
| + - **`TestAPIPeopleInvite`:** |
| + - the owner gets `200` and the invitation is sent once (`capturingMailer`); |
| + - inviting the same address again sends nothing; |
| + - `{"email":"not an address"}` gets `422 bad_email`; |
| + - a failing mailer gets `502 mail_failed`, and a second invite sends again; |
| + - a member gets `403 owner_only`; |
| + - a form body gets `415`. |
| +- [ ] Implement the three writes. The JSON body is bounded at 4 KiB. |
| +- [ ] **Docs:** write P2's table into `base-native-v1.md`. |
| +- [ ] **Gate:** `go test -p 4 -count=1 ./internal/webtest -run 'TestAPIStore|TestAPIPeople'`. Push, and read hub CI (the whole Go suite runs there). |
| + |
| +## Task 4 (rastrillo/native): `NativeHTTP.upload` |
| + |
| +**Files (rastrillo/native):** |
| +- `Sources/RastrilloApple/NativeHTTP.swift` and `NativeTransport.swift`; |
| +- `Sources/RastrilloTestSupport/ScriptedTransport.swift`; |
| +- `Tests/RastrilloAppleTests/NativeHTTPUploadTests.swift` (new); |
| +- `APPLE.md`. |
| + |
| +- [ ] **Tests first:** |
| + - the upload sends `POST`, the body and `Content-Type`; |
| + - `Content-Disposition` is `attachment; filename*=UTF-8''…`, with `é`, spaces and `"` percent-encoded; |
| + - progress reaches `1.0` and only grows; |
| + - a `413` or `503` comes back as a `NativeResponse` with its headers (`Retry-After`), never thrown; |
| + - cancelling the task cancels the upload; |
| + - a `401` calls `sessionRejected()`, as `responseDetails` does. |
| + - `ScriptedTransport` records `filename` and the body's size. |
| +- [ ] Implement it with a `URLSessionUploadTask` and a delegate, reusing `makeRequest` and `BoundedBody`. Add it as a `NativeTransport` requirement, with a default that throws `NativeClientError.message("Uploads aren't supported.")`. |
| +- [ ] **Gate:** `swift test -j 4 --filter NativeHTTPUploadTests` in rastrillo/native, then that repo's own native gate once. |
| +- [ ] **Land it on rastrillo/native main**, and note the SHA. In Base, bump `native/apple/Package.swift` and `ios/project.yml` (`RastrilloNative.revision`) to it, and run Base's `check-native.sh` once. |
| + |
| +## Task 5: The client for Store and People |
| + |
| +**Files:** `native/apple/Sources/BaseKit/API/Models.swift`, `API/Client.swift`, `Tests/BaseKitTests/ClientTests.swift`, `Fixtures/store.json`, `Fixtures/people.json`. |
| + |
| +- [ ] **Tests first (`ScriptedTransport`):** |
| + - `store()` decodes the fixture; |
| + - `install(app:)` posts to `/api/v1/store/contra/install` with `Origin`, and decodes the `202`; |
| + - `uninstall(app:)` maps `409 busy` to `BaseAPIError.refused("busy")`; |
| + - `people()` decodes; |
| + - `invite(email:)` posts JSON, and maps `422 bad_email` and `502 mail_failed`; |
| + - a `404` on either read maps to `.notOnThisBase`, which P3 turns into the web fallback. |
| +- [ ] Add `StoreData`, `StoreRow` (with its `State` enum), `PeopleData`, `Person`, and the five client calls. |
| +- [ ] **Gate:** `swift test --package-path native/apple -j 4 --filter BaseKitTests.ClientTests`. |
| + |
| +## Task 6: Store and People models |
| + |
| +**Files:** `BaseKit/Team/StoreModel.swift`, `Team/PeopleModel.swift`, `Tests/BaseKitTests/StoreModelTests.swift`, `PeopleModelTests.swift`. |
| + |
| +- [ ] **Tests first, with a clock and client you control:** |
| + - **`StoreModel`:** |
| + - it loads; |
| + - it polls every 2 s while any row is installing, and stops when none is or when `stop()` is called; |
| + - `install` shows the row installing at once and reloads; |
| + - `uninstall` asks for a confirmation first (`pendingUninstall`), then posts; |
| + - `busy` shows "This app is still installing. Try again in a moment."; |
| + - a failed row shows its error, or "The install didn't finish."; |
| + - a member sees no buttons, only "Installed". |
| + - **`PeopleModel`:** |
| + - it loads; |
| + - `invite` trims and lowercases, as the web does; |
| + - `bad_email` shows "That doesn't look like an email address."; |
| + - `mail_failed` shows "The invitation wasn't sent. Try inviting them again."; |
| + - success clears the field and reloads; |
| + - Invite is busy while the request runs (the 650 ms spinner rule, as Settings' buttons follow). |
| +- [ ] Implement both as `@MainActor @Observable` classes. |
| +- [ ] **Gate:** `swift test … --filter 'BaseKitTests.StoreModelTests|BaseKitTests.PeopleModelTests'`. |
| + |
| +## Task 7: Store and People screens |
| + |
| +**Files:** `BaseKit/Team/StoreView.swift`, `Team/PeopleView.swift`, `Tests/BaseSnapshots/TeamSnapshots.swift` (new), `ios/project.yml` (the iPhone snapshot target's sources, if listed by file). |
| + |
| +- [ ] **Snapshots first:** in `TeamSnapshots`, as the mockups `mac-store`, `mac-people`, `phone-store` and `phone-people` draw them: |
| + - Store as the owner (one installed, one installing, one failed) and as a member; |
| + - People as the owner (with the invite field and an invited row) and as a member; |
| + - the uninstall confirmation; |
| + - Mac and iPhone, light and dark, iPhone also at AX3. |
| +- [ ] **Build the screens from the look's parts** (glass group, rows, `BaseFont`, frost primary and ghost buttons): |
| + - **Store:** the heading, the lead ("Apps that run on {team}'s Base…") and the rows. Uninstall goes through a `confirmationDialog` with the web's words ("Uninstall {app}? It's removed from Home for everyone at {team}…", Uninstall and Keep it). The line at the foot reads "Coming in later slices: Keymail, Sporran and the Oficina apps." |
| + - **People:** the heading, the lead, the owner's invite field (email keyboard, `.textContentType(.emailAddress)`, Return sends), and the rows (face, name or address, the second line, and the tag). |
| + - **VoiceOver:** each row reads as one element with its action. An installing row says "Installing". |
| +- [ ] **Gate:** `snapshots.sh record mac` and `record iphone` for the new pictures only. Review the contact sheets beside the mockups, then `compare` both. Then `check-native.sh`. |
| + |
| +## Task 8: Getting to Store and People |
| + |
| +**Files:** `BaseKit/Mac/MacMainView.swift`, `Phone/PhoneAskScreen.swift`, `Home/BaseActions.swift`, `Tests/BaseKitTests/AskViewTests.swift`, `OpenerTests.swift`. |
| + |
| +- [ ] **Tests first:** |
| + - choosing `store` or `people` in the sidebar sets `MacPane.store` or `.people` and never calls `openURL`; |
| + - when a read answers `.notOnThisBase`, the same choice opens the web page, as slice 1 does; |
| + - on the iPhone, `AppsSheet` lists "Your team" (Store, and People with the member count) and pushes the screen; |
| + - `settings` still opens the Settings window, or the iPhone's settings. |
| +- [ ] **Mac:** `MacMainView` gains `@State var pane: MacPane`. The sidebar's Ask Base, Store and People rows select it, with the selected row's tint as in the mockups, and the pane shows the chosen screen with its title in the bar. |
| +- [ ] **iPhone:** `AppsSheet` wraps its content in a `NavigationStack`. Below the apps comes a "Your team" group: Store, and People with the count from `/api/v1/people` or `me`. Each pushes its screen, with the system back button. |
| +- [ ] **Gate:** `swift test … --filter 'BaseKitTests.AskViewTests|BaseKitTests.OpenerTests'`, then `snapshots.sh compare` (the Mac main window and the apps sheet change, so record those after review), then `check-native.sh`. |
| + |
| +## Task 9: The Apps section folds |
| + |
| +**Files:** `BaseKit/Home/SidebarFolds.swift` (new), `Mac/MacMainView.swift`, `Phone/PhoneAskScreen.swift`, `Tests/BaseKitTests/SidebarFoldsTests.swift`, `BaseSnapshots/MacSnapshots.swift`. |
| + |
| +- [ ] **Tests first:** |
| + - it starts open; |
| + - folding is remembered across a fresh `SidebarFolds` for the same origin and member; |
| + - another member, or another Base, on the same device has its own state; |
| + - the key never contains the address or the origin in clear (P5); |
| + - signing out leaves it (it's a preference, not data). |
| +- [ ] **Mac:** the "Apps" heading becomes a button with a chevron (rotated when folded) and, when folded, the count ("8"). It works from the keyboard (Space, and ←/→ on the heading). VoiceOver hears "Apps, expanded" or "Apps, collapsed". |
| +- [ ] **iPhone:** the same heading in `AppsSheet`. |
| +- [ ] **Snapshots:** the Mac sidebar folded and unfolded, and the apps sheet folded. |
| +- [ ] **Gate:** `swift test … --filter BaseKitTests.SidebarFoldsTests`, `snapshots.sh compare` (after a reviewed record of the new pictures), `check-native.sh`. |
| + |
| +## Task 10: Copy Equipo's files code into BaseKit (R5) |
| + |
| +**Files:** `BaseKit/Attachments/` (new: the P7 list) and `Tests/BaseKitTests/` (the copied tests and fixtures). |
| + |
| +- [ ] **Copy** the P7 files from Equipo origin/main `8bd40ed1`, each with its provenance line. |
| +- [ ] **Make them compile and nothing more:** |
| + - rename `Equipo*` types to `Base*` where they name the app; |
| + - point strings at `BaseText`; |
| + - put an `AttachmentClient` protocol where Equipo's `EquipoClient` was. It has `upload`, `delete`, `data(id:preview:)` and `download(id:to:)`. |
| + - Behaviour is unchanged. This keeps the next diff (Task 12) readable as "Base's rules". |
| +- [ ] **Run the copied tests as they are.** Where one asserts Equipo-only behaviour that P8 changes, mark it `// Base differs: Task 12` and leave it failing-skipped (`XCTSkip`) for Task 12 to turn around. |
| +- [ ] **Gate:** `swift test … --filter 'BaseKitTests.Attachment'`, then `check-native.sh`. |
| + |
| +## Task 11: The files client |
| + |
| +**Files:** `API/Client.swift`, `API/Models.swift`, `Tests/BaseKitTests/ClientTests.swift`, `Fixtures/attachment.json`. |
| + |
| +- [ ] **Tests first:** |
| + - **`AskSnapshot.canAttach`** decodes `can_attach`, and is `false` when it's missing. |
| + - **`upload`:** |
| + - it calls the kit's `upload` on `/ask/attachments` and decodes `201 Attachment`; |
| + - `413`, `415` and `409` map to their `code`; |
| + - `503 busy` carries `Retry-After`. |
| + - **`deleteAttachment`:** `204`, and `404` count as done; `409 attachment_sent` is reported. |
| + - **`discard(ids:)`** posts at most five `id` fields per call. |
| + - **`attachmentData(id, preview: true)`** is bounded at 2 MiB. |
| + - **`downloadAttachment(id, to:)`** uses the kit's `download`. |
| + - **`send(text, key, attachments:)`** repeats the `attachments` field in order. |
| + - **On send:** `409 {"files":"unavailable"}` maps to `.filesUnavailable`, and `422 {"files":"stale"}` to `.filesStale`. Neither maps to a phase change. |
| +- [ ] Implement these. `BaseClient` conforms to `AttachmentClient`. |
| +- [ ] **Gate:** `swift test … --filter BaseKitTests.ClientTests`. |
| + |
| +## Task 12: Base's rules for drafts and sending |
| + |
| +**Files:** `Attachments/AttachmentDraft.swift`, `Ask/AskModel.swift`, `Tests/BaseKitTests/AttachmentDraftTests.swift` (from the copied tests), `AskModelTests.swift`. |
| + |
| +- [ ] **Tests first, with a scripted client and a controllable clock:** |
| + - the six P8 rules, each a test; |
| + - **limits:** five files a message, refused at the sixth chip with "You can attach up to 5 files to a message."; |
| + - **the PDF line:** a PDF chip says "Ask can't read PDFs yet."; |
| + - **sending:** |
| + - Send waits for every upload; |
| + - text may be empty with files; |
| + - the sent message's files clear the chips; |
| + - a failed send keeps them; |
| + - a resend reuses the key; |
| + - **`can_attach` false:** no paperclip or `+`, and `add` refuses; |
| + - **D5:** after `.filesUnavailable`, Ask is still `ready` and the words can be sent alone with one tap (the chips removed); |
| + - **switching accounts** discards the old account's unsent uploads. |
| +- [ ] Implement these, turning each `// Base differs: Task 12` test around. |
| +- [ ] **Gate:** `swift test … --filter 'BaseKitTests.AttachmentDraftTests|BaseKitTests.AskModelTests'`, then `check-native.sh`. |
| + |
| +## Task 13: Files prepared on the device |
| + |
| +**Files:** `Attachments/AttachmentFile.swift`, `Tests/BaseKitTests/AttachmentFileTests.swift`, `Fixtures/attachments/` (a HEIC, a 48 MP JPEG, a TIFF, a PNG with GPS). |
| + |
| +- [ ] **Tests first:** |
| + - HEIC, HEIF and TIFF become JPEG; |
| + - anything over 2560 px on its long edge is scaled down, keeping its aspect; |
| + - EXIF location is gone from the output; |
| + - a 48 MP photo comes out under 10 MiB and under 40 MP; |
| + - the chip's line says "from HEIC" (DRAFT string) for a converted photo; |
| + - a file over 10 MiB after preparing is refused on the chip with "This file is over the 10 MB limit.", never uploaded; |
| + - an unknown type is refused with the web's types line. |
| +- [ ] Wire the copied conversion into `AttachmentDraft.add`, off the main actor. |
| +- [ ] **Gate:** `swift test … --filter BaseKitTests.AttachmentFileTests`. |
| + |
| +## Task 14: Attaching on the Mac |
| + |
| +**Files:** `Ask/Composer.swift`, `Attachments/MacAttach.swift` (from `MacComposer.swift`), `Attachments/AttachmentPromises.swift`, `Ask/PasteMarkdown.swift`, `Mac/MacMainView.swift`, `Tests/BaseKitTests/MacAttachmentTests.swift`, `BaseSnapshots/AskSnapshots.swift`. |
| + |
| +- [ ] **Tests first:** |
| + - **the paperclip:** it sits left of Send, only while `can_attach`, and opens `fileImporter` with multiple selection and the allowed types; |
| + - **drop:** file URLs, images and promises dropped on the composer or anywhere on the Ask pane are attached; an outline shows while dragging, with "Drop files to attach them"; |
| + - **paste (D8):** |
| + - ⌘V with an image alone attaches it; |
| + - with files alone attaches them; |
| + - with text and an image (Pages, Word, Excel) pastes the text only; |
| + - with a file's name as its only text attaches the file; |
| + - **the menu panel's composer** doesn't attach in part 1 (it opens Base to attach). Drops on it are refused quietly. |
| +- [ ] **Build it:** chips above the field, wrapping, at most 196 pt tall and then scrolling. Remove has the label "Remove {name}". VoiceOver announces "{name} attached" and "{name} not attached: {reason}", the web's words. |
| +- [ ] **Snapshots,** as the mockups `mac-attach` and `mac-drop`: chips (an image done, one uploading, a PDF, a refused file) and the drop outline, light and dark. |
| +- [ ] **Gate:** `swift test … --filter BaseKitTests.MacAttachmentTests`, `snapshots.sh compare mac` (after a reviewed record), `check-native.sh`. |
| + |
| +## Task 15: Attaching on the iPhone |
| + |
| +**Files:** `Ask/Composer.swift`, `Attachments/PhoneAttachmentPicker.swift`, `Phone/PhoneAskScreen.swift`, `ios/project.yml` (`NSCameraUsageDescription`: "Base uses the camera to take a photo for Ask."), `Tests/BaseKitTests/PhoneAttachmentTests.swift`, `BaseSnapshots/AskSnapshots.swift`. |
| + |
| +- [ ] **Tests first:** |
| + - **the `+`:** left of the field, only while `can_attach`. Its menu has Photos, Camera (only when a camera is available) and Files; |
| + - **Photos:** `PhotosPicker` with up to five minus the chips already there, images only; |
| + - **Camera:** the photo is converted as in Task 13; |
| + - **Files:** `fileImporter` with multiple selection; |
| + - **paste** follows D8; |
| + - **the chips** are one line that scrolls sideways. |
| +- [ ] Build it. |
| +- [ ] **Snapshots,** as the mockup `phone-attach`: the menu open, chips with a "from HEIC" photo and one uploading, light and dark, and AX3. |
| +- [ ] **Gate:** `swift test … --filter BaseKitTests.PhoneAttachmentTests`, `snapshots.sh compare iphone` (after a reviewed record), `check-native.sh`. |
| +- [ ] **By hand, once, on a device:** Photos and Camera on an iPhone (TestFlight internal build), including a 48 MP photo. Note the result in the task's commit. |
| + |
| +## Task 16: Files in the thread, and Quick Look |
| + |
| +**Files:** `Ask/Thread.swift` (the names line goes), `Attachments/AttachmentViews.swift`, `Attachments/AttachmentCache.swift` (new), `Attachments/QuickLook.swift` (new), `native/PrivacyInfo.xcprivacy`, `Session/BaseSession.swift` (clear on sign-out), `Tests/BaseKitTests/AttachmentCacheTests.swift`, `AskViewTests.swift`, `BaseSnapshots/AskSnapshots.swift`. |
| + |
| +- [ ] **Tests first:** |
| + - **the bubble:** a person's message draws thumbnails (from `/preview`), then a pill per other file (mark, name, size), then the words. A lone image draws larger. A failed thumbnail shows its name. |
| + - **the cache (P9):** |
| + - originals are downloaded once into `Caches/Attachments/<account>/`, excluded from backup, `0600`; |
| + - signing out clears it; |
| + - files older than 14 days go at launch; |
| + - the in-memory preview cache holds 64 at most. |
| + - **Quick Look:** |
| + - on the Mac, a click, or Space on a selected file, opens `QLPreviewPanel` with the downloaded original; |
| + - on the iPhone, a tap presents `QLPreviewController`, which has Share; |
| + - a `404` (the file is gone, or Ask is disconnected) shows "This file isn't available any more." (DRAFT). |
| +- [ ] Build it, and remove the slice 1 names line, `FilesLine` (`Thread.swift:135-159`). |
| +- [ ] **Snapshots,** as `mac-quicklook` (the bubble only; the panel is the system's) and `phone-sent`. |
| +- [ ] **Gate:** `swift test … --filter 'BaseKitTests.AttachmentCacheTests|BaseKitTests.AskViewTests'`, `snapshots.sh compare` (after a reviewed record), `check-native.sh`. |
| + |
| +## Task 17: Strings |
| + |
| +**Files:** `Resources/Localizable.xcstrings`; `native/scripts/check-strings.py` (no new `WAITING` entries); `copy-review/slice2-part1.json` (main checkout, git-ignored). |
| + |
| +- [ ] Every string from Tasks 6 to 16 is in the catalog. The web's approved words are reused verbatim: |
| + - the Store and People pages; |
| + - `data-w-*` in `chat.html`, for attach, drop, uploading, remove, failed, too many, PDF, unavailable, stale, too large, type, HEIC, pixels, limit, busy, attached and not attached. |
| +- [ ] **New words are drafted** with a `DRAFT 2026-11-28` comment and listed for Luna with their context: |
| + - "from HEIC"; |
| + - Photos, Camera, Files; |
| + - "Your team"; |
| + - "Apps, expanded" and "Apps, collapsed"; |
| + - "This file isn't available any more."; |
| + - the camera's purpose string. |
| +- [ ] **Gate:** `python3 native/scripts/check-strings.py`. |
| + |
| +## Task 18: The branch's last checks |
| + |
| +- [ ] Run `native/scripts/check-native.sh` once, then `snapshots.sh compare` for both platforms once. |
| +- [ ] Push, and read hub CI: `amadan ci status oficina/base -branch native/slice2-part1 -json`. It must pass on the tip. |
| +- [ ] **Hand checks on a Mac with this build:** |
| + - Store install and uninstall on a test Base; |
| + - invite to a test address; |
| + - Apps folds and is remembered after a relaunch; |
| + - drop, paste, the paperclip and Quick Look; |
| + - sign out clears `Caches/Attachments`. |
| +- [ ] **Ask for an independent code review** (Fable, or Codex Astra when Fable is limited) of the whole branch, with this plan and spec 7.4 to 7.6 as its brief. Answer it on the branch. |
| + |
| +## Task 19 (Controller): Copy review, deploy, release |
| + |
| +- [ ] Luna reviews `copy-review/slice2-part1.json` from 2026-12-02. `sync-strings.py`, then `check-strings.py`. |
| +- [ ] Land the branch on main through the hub. |
| +- [ ] Deploy Base's server (the five routes), and check `GET /api/v1/store` live with the app. |
| +- [ ] Release Mac 0.1.3 through Sparkle, and TestFlight 0.1.3, with the usual release scripts (`release-mac.sh`, `testflight.sh`). |
diff --git a/docs/superpowers/specs/2026-11-23-base-native-design.md b/docs/superpowers/specs/2026-11-23-base-native-design.md| index 2ca4c41..634a79a 100644 |
| --- a/docs/superpowers/specs/2026-11-23-base-native-design.md |
| +++ b/docs/superpowers/specs/2026-11-23-base-native-design.md |
| @@ -17,6 +17,12 @@ Decided by Paul so far: |
| (2026-11-23). |
| - **Ask is set up during sign-in, in slice 1** (2026-11-23): nobody approves |
| a code in Equipo before Ask works (3.8). |
| +- **Slice 2 approved with every recommendation** (2026-11-28): section 7, |
| + and its rulings in 7.9. |
| +- **Jobs started in Equipo stay in Equipo, and jobs started in Base stay in |
| + Base** (2026-11-28): notifications, decision cards and Live Activities. |
| +- **Base takes over the Live Activity for jobs started from Ask** in slice 3 |
| + (2026-11-28). |
| Mockups: `.superpowers/mockups/native/` (git-ignored: it holds the licensed |
| font; `python3 build.py` draws it), shown to Paul on 2026-11-23. |
| @@ -186,6 +192,8 @@ fork all of that. |
| moment it changes, and Base only sees it while relaying a chat. |
| - **Blocked on** the CARLOS push verb and the ruling on who holds the Apple |
| push key, the same blockers as Equipo's own push. |
| +- **Decided in section 7** (2026-11-28): Equipo sends, to registrations |
| + Base relays, and each app hears only the jobs started in it (7.2). |
| ### 3.6 The look |
| @@ -259,7 +267,8 @@ Ask's existing "isn't set up for you yet" state. |
| 4. **Store, People and Settings in slice 1?** Recommended: Settings natively |
| (account, appearance, sign out, Equipo connection). Store and People open |
| Base on the web in slice 1 and go native in slice 2. |
| -5. **Notifications:** sent by Equipo (recommended) or by Base. |
| +5. **Notifications:** sent by Equipo (recommended) or by Base. Decided |
| + (Paul, 2026-11-28): Equipo (7.2, 7.9). |
| ## 5. Not doing |
| @@ -277,6 +286,651 @@ Ask's existing "isn't set up for you yet" state. |
| opening as in 3.4, Settings. |
| - Mockups first, for Paul to approve. Then the plan. |
| 2. **Notifications, Store and People native, and the jobs design's |
| - decisions on cards** (if not already built for the web). |
| + decisions on cards** (if not already built for the web). Specified in |
| + section 7, in four parts (7.11); part 1 is planned in |
| + `docs/superpowers/plans/2026-11-28-native-slice2-part1.md`. |
| 3. **Siri and Shortcuts** ("Ask Base"), a share extension ("Send to Base"), |
| and Live Activities for running jobs. |
| + |
| +## 7. Slice 2: notifications, decisions on cards, Store and People, files |
| + |
| +Approved by Paul on 2026-11-28, with every recommendation as written (7.9). |
| +Read against Base main `07ec2ec`, Equipo origin/main `8bd40ed1`, CARLOS |
| +origin/main `e210550b1` and its push branch `379d97d17` |
| +(`design/platform-push-submission`), rastrillo `0033fa0e` (v0.47.0), |
| +rastrillo/native `bb989a7`, Docs `78fb1db`, Sheets `76b7abc`, Slides |
| +`a27d28d`, Home `88f610a`. |
| + |
| +Mockups: `.superpowers/mockups/native-s2/` (git-ignored: it holds the |
| +licensed font; `python3 build.py` draws them), shown to Paul on 2026-11-28. |
| + |
| +Rulings this section works under: |
| + |
| +- **Keep working through the plan in order** (Paul, 2026-11-28). |
| +- **"Equipo jobs started in Equipo should stay in Equipo and jobs started in |
| + Base should stay in Base"** (Paul, 2026-11-28). That covers notifications, |
| + decision cards and, later, Live Activities. Base shows and notifies only |
| + the jobs started from Ask, and Equipo only its own. |
| +- **In slice 3, Base takes over the Live Activity for jobs started from Ask**, |
| + so there's never a duplicate with Equipo's (Paul, 2026-11-28). |
| +- **Files in Ask** (2026-11-26): Equipo holds the bytes (R1), the Assistant |
| + reads a file for 14 days (R3), and native copies Equipo's attachment code |
| + into BaseKit (R5). |
| + |
| +### 7.1 What exists today |
| + |
| +#### Push |
| + |
| +- **CARLOS `/v1/push` is a spec, not code on main.** |
| + - The spec was approved on 2026-11-20: |
| + `docs/superpowers/specs/2026-11-20-platform-push-submission-design.md` |
| + at `379d97d17`. |
| + - The build is uncommitted work in `carlos/platform-wt-push-build` |
| + (`internal/pusher/`, `internal/pushsubmit/`). Main and v0.44.0 have no |
| + pusher. |
| + - A box-local `carlos-pusher` holds the Apple key, plus a grant file that |
| + names which `(account, app)` may push to which topic (decisions 4 and 9, |
| + and §5 `apns.conf`): |
| + ``` |
| + key NS36T57NS4 9U4A84C4WK production works.oficina.equipo |
| + grant <sqid>/equipo works.oficina.equipo |
| + ``` |
| +- **rastrillo's push client** (`push.FromCarlos`, `push.Submit`) is |
| + uncommitted on `feat/push-submit` in `rastrillo/rastrillo-push-submit`, and |
| + has no tag. |
| +- **Equipo can't send to its own app yet.** |
| + - Registrations, the outbox and the payloads are all built. |
| + - The transport is a stub: `push.FromCarlos` refuses boot when |
| + `CARLOS_PUSH=submit` (`internal/equipo/push/transport.go:50-64`, "SEAM |
| + (2026-11-20)"). |
| + - The topic is a constant, `push.Topic = "works.oficina.equipo"` |
| + (`push/push.go:19`). |
| +- **Equipo's registrations have no app or topic.** |
| + - The table is `push_registrations(credential PRIMARY KEY, person, token, |
| + environment, platform, start_token, …)` |
| + (`migrations/0096_push.sql:8`), with `actions_version` and |
| + `binding_id` added in 0111. |
| + - The routes are `POST /api/v1/push-registrations` and |
| + `…/activities` (`chat/http.go:95-96`). |
| + - Recipients are `push.Devices(person)` (`push/store.go:286`). |
| +- **The Apple key is topic-specific and production-only.** From the CARLOS |
| + spec's "Facts (2026-11-20)": |
| + > "key ID `NS36T57NS4`, Team ID `9U4A84C4WK`. It is **production only** |
| + > and **topic-specific**: its only topic is `works.oficina.equipo` … The |
| + > `.p8` has not been downloaded yet; Apple allows one download." |
| + |
| + So Equipo's key can't push to `works.oficina.base`, and Base needs a key of |
| + its own. |
| +- **Base's app has no push.** Both entitlements files say "No push until |
| + slice 2" (`native/ios/BasePhone.entitlements`, |
| + `native/macos/DeveloperID.entitlements`). Equipo's Mac app shows that a |
| + Developer ID app can get push: it carries |
| + `com.apple.developer.aps-environment = production` |
| + (`equipo native/macos/DeveloperID.entitlements:10-11`). |
| + |
| +#### Where a job started (for the ruling) |
| + |
| +- **Every turn, card and task has a lane** (`wire/assistant.go:8-24`). |
| + - `""` is the Coordinator (Equipo's own conversation). |
| + - `assistant` is Base's Ask. |
| + - `job:h_<id>` is "the Coordinator thread of one job Base handed off". |
| +- **A task's lane comes from the turn that made it.** `chat_tasks.lane` is |
| + set in `chat/tasks.go:866` (migration 0084), and cards inherit it |
| + (`tasks.go:898`). |
| +- **Hand-offs list their tasks** in `chat_handoff_tasks(handoff_id, task_id)` |
| + (0079), and their lane in `chat_handoffs.lane` (0083). |
| + - Hand-offs from before job threads existed have an empty lane. |
| + - Their tasks still appear in `chat_handoff_tasks`, so that table is the |
| + reliable test. |
| +- **Equipo's push rules only half follow the ruling today** |
| + (`push/rules.go:123-200`). |
| + - **Followed:** `card_opens` and `reply_unseen` fire only for the |
| + Coordinator lane (`:126`, `:138`). |
| + - **Not followed:** `task_ends`, `task_fails`, `badge` and the four |
| + `activity_*` rules check no lane. A task Base handed off therefore ends, |
| + fails and runs a Live Activity on Equipo's app today. |
| + - **Why:** `pushTask` (`chat/push.go:426`) builds the change from |
| + `wire.Task`, which has no lane field. |
| +- **No message records which client sent it.** `PersonPrincipal` carries |
| + the credential for each request, but it isn't stored |
| + (`personapi/types.go:16-21`). The lane is the origin, and it is enough. |
| + |
| +#### Decisions on cards |
| + |
| +- **"The jobs design's decisions on cards"** means phase 1 of |
| + `2026-11-20-jobs-that-keep-moving-design.md`, plus Paul's addendum on |
| + context and a recommendation: |
| + - **K1:** the job card carries `ask`, `options`, `actions` and |
| + `receipts`. |
| + - **K2:** one act endpoint, bound to the decision and its revision. |
| + - **K6:** stops, with their reasons and next steps. |
| + - **K11:** "What next?" on a first look. |
| + - **Addendum:** each decision gets context, a link, a recommended option |
| + and a line for each option. |
| + - Folding (K9) is phase 4. |
| +- **None of it is built.** |
| + - **Equipo:** there is no `JobAsk` and no job act route on origin/main. |
| + `decision-cards-context` (`cf0614ec`, 11-20) is unmerged. |
| + - **Base:** `equipo.Card` has no `Ask`, `Actions` or `Receipts` |
| + (`internal/equipo/chat.go:60-76`), and there is no `/ask/jobs/{id}/act` |
| + (`internal/web/ask.go:47-68`). |
| +- **What Base can act on today:** |
| + - question, confirm and outcome cards (`POST /ask/cards/{id}/answer`); |
| + - a paused job's Carry on now (`POST /ask/cards/{id}/carry_on`). |
| + - A job pill shows only its state, its status and one more sentence. |
| +- **Waiting cards** (Equipo `50029aba`) aren't something Base draws. They |
| + are a note in the Assistant's frame, listing Equipo's own open cards |
| + (`chat/waiting_cards.go`). |
| + |
| +#### Store and People on the web |
| + |
| +- **Store** (`internal/web/store.go:32-116`, `templates/store.html`): |
| + - It lists the catalogue: Welcome, Scratchpad and Contra |
| + (`internal/catalog/catalog.json`). |
| + - Each app shows its state: installing, installed or failed (with the |
| + reason). |
| + - The owner can Install, Try again, or Uninstall (with a confirm page). |
| + Everyone else sees "Installed". |
| + - The page refreshes every 2 s while anything is installing. |
| +- **People** (`internal/web/people.go:30-96`, `templates/people.html`): |
| + - It lists the members, each with their initial, name or address, and |
| + Owner, Member or Invited ("Invited. Hasn't signed in yet."). |
| + - The owner can invite by address. The invitation is sent again until one |
| + is delivered. |
| + - There is no Remove: `store.RemoveMember` exists but no route calls it. |
| +- **Neither has JSON.** The native app opens both on the web: |
| + `apiHomeRead` points Base's own pages at `origin + href` |
| + (`internal/web/api.go:115-118`). |
| + |
| +#### Files in Ask |
| + |
| +- **The server side is done.** Slice 1 landed on Base `07ec2ec` and in |
| + Equipo (`can_attach`, `wire/assistant.go:157`; `read_attachment`). |
| +- **Native has every route it needs**, documented in |
| + `docs/api/base-native-v1.md:262-311`: upload, delete, discard, read and |
| + preview. |
| +- **The app shows files only as a line of names** today |
| + (`BaseKit/Ask/Thread.swift:135-159`). |
| +- **Equipo's native code to copy (R5):** |
| + |
| + | File | What it does | |
| + |---|---| |
| + | `EquipoKit/API/Attachments.swift` | the client | |
| + | `Attachments/PhoneAttachmentPicker.swift` | `PhotosPicker`, `fileImporter`, paste | |
| + | `AttachmentDraft.swift` | draft state and refusal codes | |
| + | `AttachmentViews.swift` | the chips (`AttachmentDraftStrip`), the bubble's thumbnails (`MessageAttachments`), the full-size preview | |
| + | `native/share/Sources/EquipoShareCore/AttachmentFile.swift:58-93` | HEIC, HEIF and TIFF to JPEG, a 2560 px long edge | |
| + | `EquipoMac/MacComposer.swift:13-31`, `AttachmentPromises.swift` | paste, drag, and file promises on the Mac | |
| + |
| + Equipo has no Quick Look. |
| + |
| +#### Opening Docs, Sheets and Slides |
| + |
| +- **Base can launch the Docs or Sheets app, not open a document in it.** |
| + - On the Mac, `Opener.mac` opens the app by its bundle ID |
| + (`BaseKit/Home/Opener.swift:22`). |
| + - On the iPhone, everything except Calls and Equipo opens on the web |
| + (`Opener.swift:34`). |
| +- **The kit can open a path; the apps don't use it yet.** |
| + - The kit handles `<scheme>://open?path=…` (`rastrillo/native` |
| + `NativeConnection.swift:82-123`, since `8dc540a`). |
| + - Docs and Sheets pin kits from before that change (`0254817` and |
| + `1e36aac`), and neither sets `onOpen`. |
| +- **No universal links:** |
| + - The only association file is Home's, and it is webcredentials only |
| + (`home internal/home/native_passkey.go:285-312`). |
| + - The app hosts' `/.well-known/apple-app-site-association` answer 404. |
| + - No app claims `applinks:`. |
| +- **Slides has no native app**, and doesn't mount `/native/oficina-id`. |
| +- **Nothing can be framed, and there's no read-only view.** |
| + - Every app sends `frame-ancestors 'none'` and `X-Frame-Options: DENY` |
| + (`rastrillo serve.go:464,480`). |
| + - None has a signed-in read-only or embed view. |
| + - The only read-only pages are the owner's public links: Docs `/p/{token}`, |
| + Sheets `/l/{token}`, Slides `/s/{token}`. |
| +- **Exports exist:** |
| + - Docs: `/d/{sqid}/export.pdf` and `.md`. |
| + - Sheets: `/sheets/{id}/export.xlsx`. |
| + - Slides: a PDF job (`POST /d/{sqid}/export`). |
| +- **Path-based team URLs don't work natively.** `NativeHTTP.origin` rejects |
| + an origin with a path (`NativeHTTP.swift:94-100`), and Docs is the pilot |
| + for path-based teams (ruling 11-26). |
| + |
| +### 7.2 Notifications |
| + |
| +#### Who sends |
| + |
| +**Decided (7.9, 1): Equipo, through its outbox, to the Base app's |
| +registrations**, as 3.5 said. Equipo learns of every change in the |
| +transaction that makes it. It already has everything else: the outbox, |
| +once-only dedupe, collapse, holds, sealed payloads, retries, action |
| +bindings and receipts. Base would have to build all of that again. |
| + |
| +- **The app still talks only to Base** (3.2). |
| + - It registers its token with Base: `POST /api/v1/push` with `{token, |
| + environment, platform, install, start_token: null}`. |
| + - Base relays the registration to Equipo with the person's bearer, adding |
| + `app: "base"`. |
| + - Answers from a notification go to Base's own routes, as everything else |
| + does. |
| +- **The alternative** was Base sending. Equipo would call Base, as the |
| + Assistant's host, on every job change, and Base would keep its own |
| + devices, outbox and CARLOS grant. Rejected: it is a second outbox and a |
| + new callback channel, for words Equipo already writes. A job card's words |
| + are already Base-facing (Base shows them as given). |
| + |
| +#### What Equipo changes |
| + |
| +- **E-P1. Registrations know their app and device.** |
| + - `push_registrations` gains `app` (`equipo` | `base`) and `install` (the |
| + app install's id). |
| + - The key becomes `(credential, install)`. Base holds one Equipo |
| + credential per person, but that person may have Base on a Mac and on an |
| + iPhone. |
| + - The topic follows from `app`. `push.Topic` becomes a lookup. |
| +- **E-P2. One rule for where work started.** A change is Base's when: |
| + - its lane is `assistant` or starts `job:`; or |
| + - its task is in `chat_handoff_tasks`, which catches hand-offs from |
| + before job threads. |
| + |
| + The rule is computed once into `push.Change` as `Origin`, because |
| + `wire.Task` has no lane. Every rule then reads it: |
| + - Equipo-origin changes go only to `app = equipo` devices. |
| + - Base-origin changes go only to `app = base` devices. |
| + - The rules that don't look at the lane today (`task_ends`, `task_fails`, |
| + `badge`) gain the check. That stops Equipo's app hearing about Ask jobs, |
| + which fixes a breach of the ruling that exists today. |
| +- **E-P3. Base's rules, from the Assistant-lane job card**, not the task. |
| + - A job is a hand-off that may run several tasks. Base knows it by its |
| + job card id. |
| + - Each rule's collapse id is the job card's id, so a newer state replaces |
| + the older notification on every device. |
| + - Its thread id is `job:<card>`. |
| + - Its dedupe is the card's id, state and decision. |
| + - The table follows. |
| +- **E-P4. Base's payload.** |
| + - `aps.alert{title: job title, body: the decision's text or the state |
| + line}`, plus `category`, `thread-id` and `interruption-level`. |
| + - A custom key: |
| + ``` |
| + base: {origin, member, job, revision, decision, actions: {binding, notification_id}} |
| + ``` |
| + - The app needs `origin` and `member` to pick the right account, since |
| + the kit holds several. The words never name Equipo (Review 8). |
| +- **E-P5. Withdraw on settle.** |
| + - When a decision is settled anywhere (a tap, the web, another device), |
| + Equipo sends a background push for that job. |
| + - The app then removes the notifications delivered in its thread |
| + (`removeDeliveredNotifications`). |
| + - Each app also tidies itself whenever it opens. |
| +- **E-P6. The grant.** On each box running an Equipo that serves a Base: |
| + ``` |
| + key <BASE-KEY-ID> 9U4A84C4WK production works.oficina.base |
| + grant <equipo-sqid>/equipo works.oficina.base |
| + ``` |
| + The Live Activity topic `works.oficina.base.push-type.liveactivity` is |
| + allowed with it (CARLOS spec §5). |
| + |
| +#### Which job events notify |
| + |
| +Decided (7.9, 2): |
| + |
| +| Job state (Base's pill) | Notification | Actions (with K1/K2; until then, a tap opens the job) | |
| +|---|---|---| |
| +| Asking: a question | alert | its choices (recommended first, at most 3), and Something else… when words are allowed | |
| +| Asking: "First look ready" | alert | Build it; Try again… (asks "What should change?") | |
| +| Asking: needs your OK (approvals) or replace | alert | none: a tap opens the job (approvals stay on Equipo's pages, K6; Replace drops work) | |
| +| Ready to try | alert | Try it (opens the link) | |
| +| Stopped, with Try again offered | alert | Try again | |
| +| Stopped, otherwise | alert | none | |
| +| Paused | quiet (`passive`) | none: Carry on now spends money, so it stays in the app | |
| +| Done | quiet (`passive`) | none | |
| +| Working, any stage | never | (Live Activities, slice 3) | |
| +| The Assistant replied with no Ask open | alert, Ask's own (7.9, 4) | none | |
| + |
| +- **Never on a notification:** Drop it, Dismiss, Replace it, or anything |
| + that publishes, spends or grants without a confirm in the app. |
| +- **The badge** on the app's icon counts the jobs waiting on you, the same |
| + number as the sidebar's. |
| +- **In the foreground**, a job on screen shows no banner. Anything else |
| + shows one. |
| + |
| +#### The buttons |
| + |
| +- **Actions answer without opening the app.** They use |
| + `.authenticationRequired` and not `.foreground`, so the device must be |
| + unlocked. |
| + - Each is bound to the decision and revision the notification showed, with |
| + its notification id as the idempotency key. |
| + - A `409` (the decision has moved on) answers nothing. The app posts a |
| + local "That's changed since. Open it to see." with Open. |
| + - Equipo's buttons, by contrast, all bring the app forward |
| + (`NotificationResponse.swift:81-93`). |
| +- **Labels are the decision's own** ("Fri 18 Dec"), so categories can't be |
| + fixed ahead. |
| + - A notification service extension (iOS, and macOS 11 or later) registers |
| + one category per decision before the notification shows. |
| + - If that ever loses the race, the fallback is Equipo's: one "Choose…" |
| + that opens the app at the decision. (7.9, 3) |
| +- **On the Mac,** a banner's actions sit under Options. Alert style shows |
| + them as buttons. Both work the same. |
| + |
| +#### Not notifying twice |
| + |
| +- **By construction** (E-P2). A job started in Ask notifies only Base's |
| + devices, and a job started in Equipo only Equipo's. A person with both |
| + apps hears each job once. |
| +- **Across devices:** collapse by job, and withdraw on settle (E-P5). |
| +- **No fallback** (7.9, 5). With no Base app installed, an Ask |
| + job does not notify through Equipo's app. Web push for Base is for later. |
| + |
| +#### What slice 2 does so that slice 3 can take over Live Activities |
| + |
| +1. **The origin rule (E-P2) decides the Live Activity rules too.** |
| + - Slice 2 makes `activity_*` read `Origin`. |
| + - Until slice 3 ships, Base-origin tasks keep Equipo's Live Activity, as |
| + today (7.9, 6). |
| + - Then one Equipo release switches them to Base's start tokens. It |
| + switches only for people whose Base registration carries a |
| + `start_token`, so there is never both and never a gap. |
| +2. **Registrations carry `start_token` from day one** (null until slice 3). |
| + `app` decides the topic (`works.oficina.base.push-type.liveactivity`). |
| +3. **One activity per job, not per task.** Slice 2's collapse ids already |
| + map a task to its hand-off and then to its job card |
| + (`chat_handoff_tasks`). The activity reuses that mapping. |
| +4. **The payload names `origin` and `member`**, so the widget extension can |
| + pick the account. |
| +5. **The same Base push key serves Live Activities.** The extension needs |
| + its own App ID (`works.oficina.base.activity`) in slice 3. |
| + |
| +### 7.3 Decisions on the cards |
| + |
| +- **Native draws what the web draws, from the same JSON** (3.3). It does |
| + that once the jobs design's phase 1 is in Equipo and Base's web (7.9, 10), and |
| + is never built native-first. |
| +- **`Models.swift` gains** the K1 fields: `ask{kind, decision, text, words, |
| + note}`, `options`, `actions`, `receipts`, `updated_at` and `hidden`. It |
| + also gains the addendum's `context`, `link`, `recommended` and each |
| + option's `detail`. |
| +- **The pill** carries the decision under it, as the mockups show: |
| + - the context, the link to the thing, the question; |
| + - the choices, with Recommended and why; |
| + - Something else as a one-line field. |
| +- **Actions:** |
| + - Try again opens its field. |
| + - Drop it confirms ("Drop this job too?"). |
| + - Stops show their reason and Try again. |
| +- **The act:** `POST /ask/jobs/{id}/act` as JSON, with the idempotency key |
| + and revision. A `409` redraws the card from the answer. |
| +- **The job view** adds the first look's picture as a link, the receipts, |
| + Dismiss with Undo for 8 s, and "Open in Equipo" as the title's link. |
| +- **Placement:** jobs that need you move to the end of the thread. |
| + "Waiting on you" and "N finished" fold, by `state` and `updated_at` |
| + (K9, phase 4, when the web has it). |
| + |
| +### 7.4 Store and People, native |
| + |
| +A small JSON API beside the pages, built from the same builders, behind the |
| +same owner checks: |
| + |
| +- **`GET /api/v1/store`:** `{owner, rows: [{id, name, summary, tint, |
| + icon_svg, state, error}]}`. `state` is `""`, `installing`, `installed` or |
| + `failed`. |
| +- **`POST /api/v1/store/{app}/install`:** `202`, then poll every 2 s while |
| + any row is installing, as the web does. |
| +- **`POST /api/v1/store/{app}/uninstall`:** `200`, `409 busy` while |
| + installing, `403` if not the owner. |
| +- **`GET /api/v1/people`:** `{owner, people: [{id, initial, name, email, |
| + role, joined}]}`. |
| +- **`POST /api/v1/people`:** `{email}`. It answers `200` with the person, |
| + `422 bad_email`, `502 mail_failed` (invite again to retry), or `403`. |
| +- **Where they show:** |
| + - **Mac:** in the window's pane, from the sidebar. |
| + - **iPhone:** pushed from the apps sheet's new "Your team" section. |
| + - Uninstall confirms with the web's words. |
| +- **`GET /api/v1/home`'s** `own` apps keep their web URLs for older builds. |
| + New builds route Store and People natively by `id`. |
| +- **Not doing:** removing a member. The web has no such action either. |
| + |
| +### 7.5 The sidebar |
| + |
| +- **Apps folds** (Paul). |
| + - On the Mac it is a `Section(isExpanded:)` in the sidebar. On the iPhone |
| + it is a header with a chevron in the apps sheet. |
| + - Folded, it shows the count. |
| + - The state is remembered for each person on each device, in |
| + `UserDefaults`, keyed by Base origin and member id. It isn't synced, |
| + and the web's rail setting (migration 0007) is its own. |
| + - It starts open. |
| +- **Made with Base.** Decided yes (7.9, 7). It lists what you made through |
| + Ask that has an address: |
| + - **What:** a published site, which shows a filled dot and its address; or |
| + a first look that is still up, which shows a hollow dot and "First |
| + look". Newest first, at most five, then "Show all". |
| + - **Whose:** only jobs started in Base (the ruling). Equipo's own projects |
| + stay in Equipo. |
| + - **Data:** |
| + - Published sites are in `chat_steps.publish`, and reach a task as |
| + `wire.Task.site{app, url, state, at}` (`wire/tasks.go:457`, |
| + `publish.go:102`). |
| + - A task's job is found through `chat_handoff_tasks`. |
| + - `chat_project_places` (0112) holds the deploy binding but no person. |
| + `GET /api/v1/projects` has no site URL (`api.go:302-334`). |
| + - So Equipo adds `GET /api/v1/assistant/made`: the person's Base-origin |
| + jobs with a site or a live first look, as `{job, title, url, kind, |
| + state, at}`. Base relays it as `GET /api/v1/made`, and the web can |
| + show it too. |
| + - **A click** opens the address in the browser. The context menu adds |
| + "Show the job" and "Copy address". |
| + - **Why yes:** it is what Base is for ("something to see very quickly"). |
| + Without it, a finished site falls out of the snapshot after 7 days |
| + (K9), and the only way back to it is Equipo. |
| + - **Why it might be no:** a new Equipo route and section for what may be |
| + only a handful of sites. It comes last in the slice for that reason. |
| + - **Later**, Docs and Sheets the Assistant made through `use` could list |
| + here too. |
| + |
| +### 7.6 Files in Ask, native (attachments slice 2) |
| + |
| +No server change: the routes exist. BaseKit copies Equipo's code (R5) and |
| +points it at Base's `/ask/attachments`. |
| + |
| +- **Mac:** |
| + - A paperclip left of Send opens the file panel. |
| + - Files can be dropped on the composer or anywhere on the window; the |
| + outline uses the web's words. |
| + - ⌘V pastes. A paste with words pastes the words (D8). |
| + - File promises are honoured, from Photos and Mail. |
| +- **iPhone:** a `+` left of the field, with Photos (`PhotosPicker`, no |
| + permission needed), Camera (`NSCameraUsageDescription`) and Files. |
| +- **On the device,** HEIC, HEIF and TIFF become JPEG, and anything over |
| + 2560 px is scaled down, before uploading (`AttachmentFile.swift`). A chip |
| + says "from HEIC". 48 MP photos stop being refused. |
| +- **Chips:** |
| + - each has a thumbnail, name, size, an upload ring and Remove; |
| + - Remove deletes the upload; |
| + - unsent uploads are discarded, as best the app can, when it quits or |
| + signs out; |
| + - two uploads at a time, with a busy answer retried by itself; |
| + - the paperclip shows only while `can_attach`; |
| + - every refusal has the web's words (copy review 13), and the PDF chip |
| + says "Ask can't read PDFs yet."; |
| + - refused files never take Ask down (D5). |
| +- **In the thread:** thumbnails, then file pills, then the words, as the |
| + web draws them. |
| + - On the Mac, a click or Space opens Quick Look (`QLPreviewPanel`), with |
| + Open with Preview and Share. |
| + - On the iPhone, a tap opens `QLPreviewController`, with Share. |
| + - The original is fetched from `/ask/attachments/{id}` into the app's |
| + cache. It is kept out of backups, and cleared on sign-out and after |
| + 14 days (7.9, 12). |
| +- **Not doing:** Equipo's "recent screenshot" suggestion |
| + (`RecentScreenshot.swift`). It needs Photos permission. |
| + |
| +### 7.7 Opening Docs, Sheets and Slides |
| + |
| +#### In the right app (decided for slice 2: 7.9, 9) |
| + |
| +- **When a reply links an Oficina document,** Base opens it in the |
| + installed app with `works.oficina.docs://open?path=/d/<sqid>` (Sheets: |
| + `/sheets/<id>`), and otherwise on the web. |
| + - Base recognises a link by its host, from `BASE_OFICINA_APPS`, and by |
| + the app's path patterns. |
| + - On the iPhone, Base adds both schemes to `LSApplicationQueriesSchemes`. |
| +- **Each app needs** a kit repin to `8dc540a` or later, and an `onOpen` |
| + that routes the path to the document: |
| + - **Mac:** look up the local document by its sqid and open its window. |
| + - **iPhone:** push the document. |
| +- **Slides** opens on the web: it has no native app. |
| +- **Later:** universal links, once portero serves `applinks` (Home spec |
| + appendix D). They make the same links work from anywhere. |
| +- **Flag:** path-based team URLs (the Docs pilot) need `NativeHTTP.origin` |
| + to accept a path before any of this works for them. |
| + |
| +#### A read-only view inside Base (7.9, 8) |
| + |
| +| | WKWebView of the web app | Render from JSON | Quick Look of an export | |
| +|---|---|---|---| |
| +| **Sign-in** | Needs a web session in the view's cookie store. Home's slice D is for the default browser and isn't built. A cookie bridge (an exchanged native session put into `WKHTTPCookieStore`) is possible, but no spec sanctions it, and `/native/web/end` isn't served | An exchanged session for that app | An exchanged session: Base asks Oficina ID for an assertion addressed to Docs and trades it at Docs' `/native/oficina-id`, as it already does for Equipo. No second sign-in | |
| +| **What each app needs** | A read-only or embed view, which none has today. Framing headers don't matter to a top-level web view | Docs keeps only CRDT updates (`/d/{sqid}/updates`), so Base would need a Yjs reader and a renderer. Sheets' cells are workable | Nothing for Docs (PDF) or Sheets (XLSX). Slides needs `/native/oficina-id` mounted | |
| +| **Fidelity** | Exact and live | Base's own drawing, which drifts from each app | A faithful snapshot, not live | |
| +| **Cost** | High: a new view in three apps, plus a web-session story for embedded views and its security review | Highest, and duplicated per app | Lowest | |
| + |
| +- **Decided: Quick Look of the export now** (7.9, 8). |
| + - Mac: `QLPreviewView` in a pane beside Ask, as in the mockup. |
| + - iPhone: `QLPreviewController`. |
| + - The bar says "Read only" and holds **Edit in Oficina Docs**. It opens |
| + the Docs app at that document when it's installed (as above), and |
| + otherwise the web. |
| + - It reuses slice 2's Quick Look code, and the session is per app and |
| + asked for only when needed. |
| +- **WKWebView later**, once slice D gives embedded views a sanctioned |
| + sign-in and the apps have a read-only view. Then it becomes live. |
| +- **Placement:** after the rest of slice 2. Its Slides half waits on Slides |
| + mounting the exchange. |
| + |
| +### 7.8 Paul's portal steps (Apple Developer, team 9U4A84C4WK) |
| + |
| +1. **Identifiers → `works.oficina.base`:** |
| + - Tick **Push Notifications**, then Save. Changing a capability makes the |
| + existing profiles invalid. |
| + - Don't create a Push certificate: the key replaces it. |
| +2. **Keys → "+":** |
| + - Name: "Oficina Base Push Production". |
| + - Tick **Apple Push Notifications service (APNs)**, then Configure. |
| + - **Environment: Production.** TestFlight and Developer ID builds both |
| + use production. |
| + - **Key restriction: Topic Specific, topic `works.oficina.base`.** This |
| + matches Equipo's key, and CARLOS's decision 5 counts on a key for one |
| + topic. |
| + - Save, Continue, Register. |
| +3. **Download `AuthKey_<KEYID>.p8` once**, and note the Key ID. |
| + - Apple allows a single download. |
| + - It goes to the operator for `/etc/carlos-pusher/` on each box running |
| + an Equipo that serves a Base (E-P6). |
| + - It must never go in a repo or a chat. |
| + - Equipo's own `.p8` (`NS36T57NS4`) hasn't been downloaded yet either. |
| + Doing both in one sitting saves a second trip. |
| +4. **Profiles:** regenerate the iOS App Store profile and the macOS |
| + Developer ID profile for `works.oficina.base`, so that both carry |
| + `aps-environment`. Install them where the release scripts read |
| + `OFICINA_PROVISIONING_PROFILE`. |
| +5. **For the notification service extension (7.9, 3):** |
| + - register `works.oficina.base.notify` (iOS and macOS) with the App |
| + Group `group.works.oficina` on iOS and `9U4A84C4WK.works.oficina` on |
| + the Mac; |
| + - make its two profiles. |
| +6. **In slice 3 (not now):** `works.oficina.base.activity` for the widget |
| + extension. |
| + |
| +### 7.9 Paul's rulings (2026-11-28) |
| + |
| +Paul approved every recommendation as written. Each is now decided: |
| + |
| +1. **Who sends Base's notifications.** **Decided:** Equipo, through its |
| + outbox, to registrations Base relays (7.2). Alternative: Base sends. |
| +2. **Which job states notify.** **Decided:** the table in 7.2. Asking, |
| + first look, ready and stopped alert. Done and paused are quiet. Working |
| + never notifies. |
| +3. **Buttons on notifications.** **Decided:** |
| + - the decision's own choices, answered without opening the app, through |
| + a notification service extension; |
| + - never Drop, Replace, publishing or spending; |
| + - "Choose…" as the fallback. |
| +4. **Assistant replies.** When the Assistant answers and no Ask is open |
| + anywhere, should Base notify? **Decided:** yes, as Equipo does for its |
| + Coordinator (`reply_unseen`). |
| +5. **A person without the Base app.** Should Ask jobs fall back to Equipo's |
| + app? **Decided:** no, by the ruling. Web push for Base later. |
| +6. **Equipo's Live Activities for Ask jobs until slice 3.** **Decided:** |
| + keep them until Base's ship, then switch in one release (7.2), so |
| + there's never a gap. Alternative: stop them now. |
| +7. **"Made with Base" in the sidebar.** **Decided:** yes, named "Made |
| + with Base", listing published sites and live first looks from Ask jobs, |
| + with a new Equipo route. Last in the slice. Alternative names: "Your |
| + sites", "Things you made". |
| +8. **Reading a Doc inside Base.** **Decided:** Quick Look of the export |
| + now, with Edit in Oficina Docs; a web view later, after slice D. |
| +9. **Opening a linked Doc or Sheet in its app.** **Decided:** yes in |
| + slice 2, through `://open?path=`. It needs Docs and Sheets to repin and |
| + route the path. |
| +10. **Decisions on cards wait for the web.** **Decided:** yes. Native |
| + follows phase 1 on the web and is never built first, so both read the |
| + same JSON. |
| +11. **The push key.** **Decided:** a production, topic-specific key for |
| + `works.oficina.base`. Alternative: one team-wide key for every Oficina |
| + app. That is simpler, but it loses the per-app bound CARLOS relies on. |
| +12. **Opened files on the device.** **Decided:** kept in the app's cache, |
| + out of backups, cleared on sign-out and after 14 days (matching R3). |
| + Never anywhere else. |
| + |
| +### 7.10 Blockers |
| + |
| +- **B1. CARLOS `/v1/push`:** the spec is approved, but the build is |
| + uncommitted and undeployed (`carlos/platform-wt-push-build`). |
| +- **B2. rastrillo `push`:** uncommitted, no tag (`feat/push-submit`). |
| +- **B3. Equipo's transport seam:** `push/transport.go:50-64`. It also needs |
| + E-P1 to E-P6 (7.2). |
| +- **B4. Apple:** the Base push key doesn't exist yet, and Paul downloads it |
| + (7.8). The App ID needs Push Notifications and new profiles. Equipo's |
| + `.p8` isn't downloaded either. |
| +- **B5. The jobs design's phase 1** isn't built in Equipo or Base. It is |
| + needed for decisions on the cards and for notification buttons. |
| +- **B6. "Made with Base"** needs Equipo's `GET /api/v1/assistant/made`. |
| +- **B7. Opening documents** needs the Docs and Sheets kit repins and |
| + `onOpen`. Slides needs its exchange mounted. Path-based teams need the |
| + kit's origin fix. |
| + |
| +### 7.11 Slice plan |
| + |
| +In the plan's order (Paul, 2026-11-28). Within slice 2, the unblocked parts |
| +come first. |
| + |
| +1. **2a. No blockers.** |
| + - Store and People: the JSON API (7.4) and native screens. |
| + - Apps folding. |
| + - Files in Ask: native copy of Equipo's code, Quick Look, and the HEIC |
| + conversion. |
| + - Copy review of the new strings. |
| +2. **2b. Notifications, tap to open.** Needs B1 to B4. |
| + - Base: `POST /api/v1/push` relay. |
| + - Equipo: E-P1 to E-P6. |
| + - App: registration, categories, the badge, foreground rules, withdraw. |
| + - Ships without buttons. |
| +3. **2c. Decisions on the cards, and notification buttons.** Needs B5. |
| + - Pills, the job view, the act, folding when the web has it. |
| + - Then the service extension and the bound actions. |
| +4. **2d. Made with Base, and opening documents.** Needs B6 and B7. |
| + - The sidebar section. |
| + - `://open` into Docs and Sheets. |
| + - The Quick Look viewer with Edit in Oficina Docs. |
| + |
| +The mockups are signed off (2026-11-28). Each part gets a plan, reviews as before, |
| +and TestFlight and Sparkle releases. |
| + |
| +### 7.12 Not doing in slice 2 |
| + |
| +- Siri, Shortcuts, the share extension and Live Activities: slice 3. |
| +- Removing members natively. |
| +- Base paths for approvals (K6 keeps them on Equipo's pages). |
| +- A live embedded editor of any Oficina app. |