oficina / base Public

Add the draft design for Base on the Mac and iPhone

Audit of Base, the native kit, Equipo native and app opening, then the
proposed shape: Ask first, Oficina ID sign-in through a native exchange,
a small JSON API, Base's look, three slices and five questions for Paul.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev d8551fd5dba861d82fefc0952aca5153861a100f parent d8700cf
1 file changed, +235 −0
  • docs/superpowers/specs/2026-11-23-base-native-design.md +235 −0
diff --git a/docs/superpowers/specs/2026-11-23-base-native-design.md b/docs/superpowers/specs/2026-11-23-base-native-design.md
new file mode 100644
index 0000000..661ef68
--- /dev/null
+++ b/docs/superpowers/specs/2026-11-23-base-native-design.md
@@ -0,0 +1,235 @@
+# Base on the Mac and iPhone
+
+Status: draft for Paul's review, 2026-11-23. Read against Base main `d8700cf`,
+rastrillo/native `0254817`, Home `8125a3c`, Docs `d5a328a`, Equipo `a697cde9`.
+
+Decided by Paul so far:
+
+- The native "launcher" we once discussed for Oficina is **Base**, not a
+ native Oficina Home (2026-11-23).
+- Base's branches land on main first (done: `d8700cf`).
+- **Native Base follows Base's look**, not Oficina's Calma (2026-11-23).
+
+## 1. What native Base is for
+
+Base's direction is "all about doing work and giving the user something to see
+very quickly" (Paul, 2026-11-20, jobs design). The native app serves that,
+not app launching. On a Mac the Dock and Spotlight already launch apps, and on
+an iPhone the Home Screen does. A grid of icons in a window would only copy them.
+
+What only a native Base can do:
+
+1. **Ask Base from anywhere.** One keystroke on the Mac, or Siri and Shortcuts
+ on the iPhone, opens Ask without finding a browser tab first.
+2. **Tell you when a job needs you.** It sends a notification when a job is
+ ready, done, stuck or waiting on your decision. The answer's buttons sit on
+ the notification where the platform allows it.
+3. **Sign in once.** It uses the same Oficina ID as Docs, Sheets, Calls and
+ Equipo, and goes straight in if one of them already holds it.
+4. **Open your apps.** It opens the native app when one is installed, and the
+ web app otherwise.
+
+*My call:* the order of importance is 1, 2, 3, 4, and the first slice is
+built to match (section 6).
+
+## 2. What exists today (audit)
+
+### 2.1 Base's server
+
+- **Every screen is a server-rendered page behind a browser cookie**
+ (`internal/web/app.go:160-208`). There is no JSON API for a person. The one
+ bearer API, `/api/v1/operations`, is for Equipo's Assistant
+ (`internal/operations`).
+- **Sign-in is either Base's own** (email link or passkey) **or Oficina ID**,
+ through Home's browser handoff (`internal/web/oficina.go`). There is no
+ native exchange.
+- **Ask runs through Base.** Base enrols with Equipo as a device for each
+ person (`internal/equipo/equipo.go:168-208`). It keeps that person's Equipo
+ key sealed with `BASE_INSTANCE_KEY`, and relays the snapshot, events,
+ messages, cancel and card answers (`internal/web/ask*.go`).
+ - **Connecting Equipo is a one-time code** the person approves in Equipo
+ (`ask_connect.go:41-135`).
+ - **Connecting Oficina apps to the Assistant** goes through
+ oficina-connect (`ask_oficina.go`).
+- **Home's apps come from two places.** The team's Oficina apps come from
+ `BASE_OFICINA_APPS` (`internal/config/oficina.go`) and open in a new tab.
+ The rest are apps installed from the Store. Base's own pages (Store,
+ People, Settings) form the dock (`internal/web/home.go:21-50`).
+- **Appearance** is System, Light or Dark, stored for each member
+ (`internal/web/settings.go:44-47`).
+- **The jobs design** (`2026-11-20-jobs-that-keep-moving-design.md`, direction
+ approved) is not built yet. Until it is, job cards can't carry their own
+ decision, on the web or in a native app.
+
+### 2.2 The shared native kit (RastrilloApple)
+
+- **Oficina ID sign-in:** an email code or a passkey, with straight-in when
+ another app holds the ID and a chooser when there are two or more IDs
+ (`OficinaID/OficinaIDModel.swift`).
+- **Keychain and App Group:** identities go in the shared group
+ `9U4A84C4WK.works.oficina.id`. Sessions go in each app's own group. The App
+ Group is `group.works.oficina` on iOS and `9U4A84C4WK.works.oficina` on the
+ Mac.
+- **Also in the kit:** several accounts, a team step, an offline banner, and
+ quiet Sparkle updates.
+- **Not in the kit:** an account or team menu (Equipo built its own), the
+ Colophon (each app has its own) and a string catalog.
+- **`OficinaApp` has no `base` case** (`OficinaAppearance.swift:7-8`).
+
+### 2.3 Equipo's native app
+
+- **Chat:** `EquipoKit` has public chat pieces: `ConversationScreen`,
+ `ChatMarkdownView`, `ThinkingLine` and an SSE reader. They are bound to the
+ Coordinator's routes and `EquipoSession`, and nothing calls the Assistant
+ routes. Base can adapt them, not drop them in.
+- **Push:** registrations, an outbox and payloads are built. Sending is a stub
+ until the CARLOS `/v1/push` verb and rastrillo's push client exist. Paul
+ has still to rule who holds the Apple push key (Equipo native slice 2 plan).
+- **Live Activities** exist in Equipo's iOS widget extension.
+
+### 2.4 Opening other apps
+
+- **Bundle IDs:** every Oficina native app is `works.oficina.<app>` on every
+ build (D1, ruled 11-14). D2 puts "Oficina <Name>" in Finder and the plain
+ name inside the app.
+- **Docs, Sheets, Calendar and Memoria** only handle `…://signin`. Opening
+ their scheme with anything else just launches them.
+- **Calls** handles `oficina-calls://join`, and **Equipo** handles
+ `works.oficina.equipo://task/<id>`.
+- **Missing:** universal links, and opening a given document by link. "Open
+ on the web, already signed in" is spec'd as Home slice D but not built.
+
+## 3. How it works
+
+### 3.1 Signing in
+
+- **Oficina ID only, with the kit's flow** (email code, passkey, straight-in).
+- **Base becomes a Home consumer.** Its origin is added to `HOME_CONSUMERS`,
+ and it mounts `connect.Bridge.NativeExchange` at `POST /native/oficina-id`,
+ as Docs did in `9de84e4`. The exchange mints a native session (method
+ `home-assertion-native`, seven days). The answer is `ok`, `failed`,
+ `unknown`, `choose` or `unavailable`, with the kit's handling of each.
+- **Also mounted:** `POST /signout`, `POST /native/web/end` and the choose
+ page at `/account/home/choose`.
+- **A Base without Oficina ID** (self-hosted, Base's own sign-in only) gets a
+ "Use the browser instead" path in a later slice, not in slice 1 (*my
+ call*). Every Base Paul runs has Oficina ID.
+
+### 3.2 A small JSON API for people
+
+Under `/api/v1`, with the native session. The routes are the web pages'
+reads and writes, not new behaviour:
+
+- `GET me`: the member, the Base's name and the appearance.
+- `GET home`: the steps and the apps in Home's order. Each app carries:
+ - `kind`: `oficina`, `installed` or `own`;
+ - its name and web address;
+ - its tint and icon;
+ - for Oficina apps, the native bundle ID.
+- `ask/*`: the same relay as today's `/ask/*` (state, events, messages, turn
+ cancel, card answer, connect, check and disconnect), returning JSON and
+ SSE.
+
+*My call:* the native app talks **only to Base**, never to Equipo directly.
+Base already holds each person's Equipo key, registers itself as the
+Assistant's host and translates cards. A second, native path to Equipo would
+fork all of that.
+
+### 3.3 Ask
+
+- **Mac:** one window, with Home's apps on the left and Ask on the right.
+ This matches the web on a wide screen, where Ask docks beside Home.
+ - A **menu-bar item and a global shortcut** open a small Ask panel from
+ anywhere. Its text field has focus, and the reply streams in.
+ - The native-levelup audit says to ask before adding a menu-bar item: this
+ is that ask (Q3).
+- **iPhone:** Ask is the first screen. Home's apps sit behind one button.
+- **Cards:** they draw what Base's web draws today: question, confirm,
+ outcome, connect and job cards, with jobs as pills. When the jobs design
+ lands, the job pill carries its decision on both web and native at once,
+ because both read the same JSON.
+- **Code:** adapted from `EquipoKit`'s chat views and SSE reader, pointed at
+ Base's `ask/*`.
+
+### 3.4 Opening apps
+
+- **Mac:** if the Oficina app's bundle ID is installed, open it with
+ `NSWorkspace`. Otherwise open its web address in the default browser.
+- **iPhone:** an app can't be opened by bundle ID, so the kit's
+ `handleOpenURL` gains `…://open`, a small kit change that every app picks up
+ at its next repin. Until then, the web address.
+- **Store apps** always open on the web.
+- **When Home slice D lands**, "open on the web" arrives already signed in.
+ Until then the browser may ask once.
+
+### 3.5 Notifications (slice 2)
+
+- **Equipo sends them**, to the Base app's device registrations, through
+ Equipo's existing outbox. *My call:* Equipo knows every job's state the
+ 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.
+
+### 3.6 The look
+
+Base's approved look (first-slice spec section 6), translated:
+
+- **Sky and fog:** the deep indigo sky with teal, violet, rose and mist fog,
+ and the swaying amber beam. Drawn with SwiftUI `MeshGradient` and `Canvas`.
+ Fog loops of 10 to 17 seconds, still when Reduce Motion is on.
+- **Glass:** system materials with Base's dark tint (`--glass-base`
+ `rgba(14,17,42,.40)`) and a thin bright top edge. Text keeps WCAG AA on
+ every frame.
+- **Accent and buttons:** teal `#6EE7DC` only for finished steps and progress.
+ Primary buttons are frost white with dark text.
+- **Type:** Timeless Sans, the Grotesk cut for headings, bundled through a
+ fetch step with a pinned checksum. Never committed. No FOUT: the font is in
+ the bundle, so nothing paints in a fallback face.
+- **Appearance:** System, Light and Dark, from the member's setting.
+- **Platform rules:** standard platform controls (menus, sheets, toolbars,
+ Settings), with Base's colours and type. The Mac window is a real window;
+ nothing in it pretends to be an operating system.
+
+### 3.7 Where it lives
+
+- **Code:** `native/` in this repo, laid out like Equipo's: `apple/`
+ (BaseKit), `ios/` and `macos/`, on RastrilloApple.
+- **Kit changes:** a `base` case on `OficinaApp`, and the `open` URL.
+- **Distribution:** Mac through Sparkle and the Mac release assets, iPhone
+ through TestFlight.
+
+## 4. Questions for Paul
+
+1. **Base and Oficina Home.** Does Base eventually replace Home as Oficina's
+ front door, or do they live side by side? This spec works either way. The
+ answer decides whether Home's directory should ever become Base's.
+2. **Bundle ID and name.** Base isn't only Oficina's: it fronts Keymail,
+ Sporran and the rest. Recommended: `works.oficina.base`, named "Base". It
+ lives at base.oficina.works and shares Oficina ID's keychain group. The
+ alternative is a CARLOS ID such as `com.carloku.base`.
+3. **Mac menu-bar item and global shortcut** for Ask. Recommended: yes, with
+ the shortcut off until the person sets one.
+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. Not doing
+
+- A grid-of-icons launcher as the main screen.
+- Base's own sign-in in the native app (slice 1).
+- Installing Oficina, Keymail or Sporran from the Store. That is the web
+ Store's later slice; native follows it.
+- Widgets and Live Activities before notifications.
+
+## 6. Slices
+
+1. **Sign in, Ask, Home.**
+ - Server: native exchange, JSON API.
+ - Native: Mac window with menu-bar Ask, iPhone with Ask first, Home's apps
+ 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).
+3. **Siri and Shortcuts** ("Ask Base"), a share extension ("Send to Base"),
+ and Live Activities for running jobs.