oficina / equipo Public

Clone
git clone https://amadan.net/oficina/equipo

Plain git — no account needed to clone.

Download

Download this file

Equipo native, slice 2 (plan for Paul, 2026-11-20)

Slice 1 landed on 2026-11-19: pairing, the conversation in the Roster look, question cards, Needs you, Tasks and the task view (plan 2026-11-18-equipo-native-slice-1.md). TestFlight has 0.1.0 (2); the Mac has 0.1.0 (1) on Sparkle. Slice 2 makes the apps something you can leave running: they tell you when something needs you, show work in progress without opening them, and let you answer the most common decision on the device.

Paul asked on 2026-11-20 for push notifications and a Live Activity, after merges on the device. Decisions this plan needs are at the end, each with a recommendation.

What a person can do

  1. Answer a merge on the device. The merge card shows the server's question, the preview link when there is one, and its choices (Merge, Wait for a Mac), Merge primary, exactly as the web does. "Does main ship?" cards (merge_ships) too. Other decisions still open the web.
  2. Be told when something needs you. A notification when a decision or a question waits on you, when the coordinator replies while the app is not in front, and when a task you started finishes or stops. The app badge is your Needs you count. Tapping a notification opens the card or task.
  3. Watch a task without opening the app. A Live Activity for each task you started, from the moment work starts until it ends: the title, the five-stop stage track, who is working on it and the latest activity line. When it needs you it turns amber and alerts; tapping opens the decision. On the Mac, macOS 26 shows the iPhone's Live Activities in the menu bar.
  4. Set a card aside (if it fits; D5). The web's Set aside and Undo: never answers, cancels or starts anything; the card stays in Needs you, grouped under Set aside.

What waits

  • The other decision cards (What next, Publish, Add a specialist, Grant access, Research), Copy hold and Wrong project? still open the web.
  • Replies inside an answered card, and the day roll-up (no server support yet).
  • Answering from the notification itself (D4).

Shape of the work

Server (Equipo)

  • Device push registrations. POST /api/v1/push-registrations with the device's APNs token, its environment (development or production) and, on iPhone, its Live Activity push-to-start token. Bound to the paired device credential, replaced on re-registration, deleted when the device is revoked, the person is removed, or Apple answers Unregistered. Tokens are never logged. Documented in the OpenAPI file and covered by the device contract test like every other device route.
  • A push outbox. The engine already appends an event for every change (t.event). Inside the same transaction, a small rule table decides whether the change is a push, and writes a push_outbox row: - a card that waits on the person opens (merge, question, other decisions): an alert, apns-collapse-id the card, priority 10; - the coordinator's reply finishes while the person has no open stream: an alert; - a task the person started reaches done, cancelled or failed: a passive alert; - every Needs you change: the badge count; - a task the person started is dispatched: a Live Activity start; its stage, step or needs-you change: an update (priority 10 for needs you, 5 for the rest); its end: an end with the outcome. Activity lines (the "Reading README.md" line) update the Live Activity at most once a minute, so the activity stays inside Apple's update budget.
  • A sender drains the outbox through a transport, retries with backoff, and records Apple's answer. Transports mirror mail's: the CARLOS platform transport in production (D1), a logged transport only on loopback or staging, as EQUIPO_ALLOW_LOGGED_MAIL is for mail.
  • Notification text is server-rendered from copy.go, in the recipient's locale where Equipo has one, through copy review. The body of a coordinator reply is the reply's first line (D2).
  • Set aside (D5): the store already has SetCardAside and the chat_card_visibility table; the engine gains POST /cards/{id}/visibility and the card's per-person aside field, and Needs you keeps set-aside cards.

Platform (CARLOS), if D1 is the platform

A POST /v1/push verb on the per-instance control socket, as mail submission added POST /v1/mail: the instance submits a device token, topic, push type, priority, collapse ID and payload; a box-local sender with its own uid holds the Team Tito APNs auth key and talks HTTP/2 to Apple. Policy before sending: the topic must be one of the app's bundle IDs, a per-instance rate cap, a pause switch. The instance holds no Apple credential. rastrillo gains a push transport like mail's submit.

iPhone and Mac

  • Notifications (both): ask permission after pairing, not at first launch; register the token; handle a tap by opening the card or task; categories for "Needs you" with "Open" only (D4). The Mac needs the aps-environment entitlement, which means a Developer ID provisioning profile for works.oficina.equipo, as the other Oficina Mac apps already have.
  • Live Activity (iPhone): a widget extension, works.oficina.equipo.activity, with the Lock Screen and Dynamic Island layouts drawn from Roster (the stage track, the specialist's tile, amber for needs you). The app sends its push-to-start token at registration so the server can start an activity without the app running. At most three at once, the three most recently started tasks (D3); Apple caps them anyway.
  • Merge card: native buttons on POST /cards/{id}/answer, bound to the revision seen, the slice 1 rules for stale and lost answers unchanged. Parity row R-02 is must_match: the same question text, choices, primary and outcome line as the web; a test renders both from the same server fixture.

Decisions for Paul

Ruled 2026-11-20: Paul approved the plan with every recommendation below ("Go ahead"), and copy review by Luna ("Luna can probably do copy review"): Luna's verdicts are the review for slice 2's strings.

| | Decision | Recommendation | | --- | --- | --- | | D1 | Who holds the Apple push key | CARLOS platform push, like mail submission: instances hold no sending credential (your 2026-11-12 ruling for mail). It needs a CARLOS piece first. The alternative, the key as a secret on each Equipo instance, is faster but puts the same key on every team's box. | | D2 | What a notification shows on the Lock Screen | The card's question and the reply's first line, as Messages does; iOS already hides previews while locked unless you change that. The alternative is a fixed "Your coordinator replied" with no content. | | D3 | Live Activities | One per task you started, at most three; nothing for the coordinator's own turns (they last seconds and the app's thinking line covers them). | | D4 | Answering from a notification | Not in slice 2: a notification opens the card, and you answer in the app. A merge from a notification button is a tap, but the person API says a notification action is never authentication, and the card's context (Checks, Review, preview) should be in front of you. Revisit after living with it. | | D5 | Set aside in slice 2 | Yes, if the push work lands first; it is small on the server (the store already has it). |

Steps for Paul

  • The Apple push key (an APNs auth key for Team Tito, in the developer portal). I can make it in the browser while you are signed in; it goes to the CARLOS box (D1) and never into a repository.
  • Approving the Push Notifications capability on works.oficina.equipo, the new works.oficina.equipo.activity ID and the profiles they need; I can do these through the App Store Connect API.
  • Copy review of the notification and Live Activity strings, in the copy review app.

Gates

  • Server: failing tests first for the rules (which change pushes what, to whom, never to someone removed or revoked), the outbox written in the same transaction as the event, idempotent sends (collapse IDs, no duplicate after a retry), token deletion on Unregistered, the logged transport refused on a public origin; the device contract test covering the new routes; payload goldens for every push kind. Mutations of each guard.
  • Native: EquipoKit tests for registration, the tap routing and the Live Activity content state from server fixtures; the merge card parity test; the existing native gate.
  • End to end: a local drive with the logged transport, then a real device through TestFlight against staging: a merge card arrives as a notification, the Live Activity starts, moves through its stages and ends, and a merge answered on the phone lands.
  • One Fable review per branch; Paul lands each.

Order

  1. CARLOS push submission (if D1), in parallel with 2.
  2. Equipo: registrations, outbox, rules, logged transport, copy.
  3. Native: the merge card (no push needed; can ship first).
  4. Native: notifications on iPhone and Mac.
  5. Native: the Live Activity extension.
  6. Set aside (D5).
  7. TestFlight and Mac releases; live check on staging.