initial-prompt.md
c4. Messaging
The brief, verbatim, as the c137 session handed it to this one on 2026-11-11. It produced CYCLE.md and the slice recorded there.
Background (from the session that started this one):
../qnative (this folder) is Qpoint's native desktop app for the endpoint, a Cargo workspace on GPUI Kit, driven by the design repo at ../design (cycles c130–c138 there). Its cycles: c0 naming (open), c1 the spike (done), c2 Expressive Range (the Inventory section, the Tour guide, closing now), c3 Developer Mode (design c138, at a review stop, another session works on it in this tree). You start c4. Design cycle c137 "App Messaging: Overseer and Citizen" designed the channel between the control plane (the overseer, publicly Qplane today) and the person at the endpoint (the citizen): the message bones (schema), the ports (inbox, tray, OS notification, web app), the citizen's controls, ten example messages in brand voice, and on 2026-11-11 Mark answered its ten open questions. Phase 3 of c137 is the V1 slice in this app, ruled to start now as a fresh session. Rules of this repo: read CLAUDE.md first; one DataNozzle switch with three sources (synthetic, local, plane), types written from the backend's contract (here: c137's bones), honest states, stories as tests, the budget measured with strobe; the tree is shared with other sessions, so commit only your own paths with messages that name the cycle, pull before editing a shared file (router.rs, the shell's navigation, main.rs, Cargo.toml) and tell the other sessions by message when you do; qnative has no remote, never push. Overseer and citizen stay internal words; the product words come from c0.
Task: Create qnative cycle c4, the messaging slice (design c137 Phase 3), and build it to a review stop.
Read first: CLAUDE.md, cycles/CYCLES.md (conventions and the state of c2 and c3), the c2 record and review-tour.md (the tour runtime you will hook into later), crates/types/src/, crates/nozzle/src/ (the trait, Request, Repo, the three sources, router::reopen and the data generation), crates/app/src/{tray.rs,router.rs,shell.rs,main.rs}, crates/app/src/pages/ (how a page loads and draws its states), crates/stories/, scripts/publish-stories.py. Then design's c137: ../design/cycles/c137.app-messaging/plan.md (parties, ports, bones, the citizen's control, R1–R7, D1–D13), bones.md (the schema in the wire shape: fields, severities info · attention · required, states new · seen · acknowledged · done · expired with transitions and expires_at defaults, the required rule counted per recipient per month, threads, mute keys), ports.md (the four ports, the controls, and §5 "Answered by Mark on 2026-11-11": three delivery modes per kind quiet · normal · priority mapped to OS interruption levels, priority only for required; alert permission asked once at Connect; open required and new lifted above seen; a toast after an action; no acknowledge from the notification; one sender label per plane; local mode's Contact IT a one-way mailto from qcontrol's config), inventory.md (the 16 kept rows and their default delivery), and ../design/cycles/c131.native-app-v1/plan.md D8 (the plumbing ships in V1; only the Connect confirmation flows; the Root's notification host for toasts) and synthetic-data.md (the worlds; messages for the connected world come from bones.md's ten examples).
Stage 1: cycles/c4.<kebab-name>/initial-prompt.md (this brief, verbatim) and CYCLE.md (Why, Objective, Scope, Key Changes, Outcome; mode: evolution), and the c4 line in cycles/CYCLES.md.
Build, in this order, each step committed on its own:
types: theMessageand related types written from bones.md (serde, with the states and severities as enums, therequiredcounter shape, the citizen's control settings per kind: mode quiet · normal · priority or off · inbox); a drift test against the ten example messages in bones.md turned into a fixture file.- The inbox store: SQLite beside the app's settings (D1), with the state transitions and expiry; in
localmode messages exist locally only;syntheticseeds the store from the fixture for theconnectedandpilotworlds and leaves it empty forfresh. - The ports: the inbox page (list with the lift: open
requiredandnewaboveseen, then by time; the card with "why am I seeing this"; acknowledge and the toast through the Root's notification host; the honesty line "N notices went to your inbox quietly"), the tray count and its one line, and the OS notification on macOS first (the interruption level from the mode: passive · active · time-sensitive, time-sensitive only when the entitlement exists, else active plus the tray), with the settings view per kind (quiet · normal · priority, off · inbox) and quiet hours in front of the OS's Focus. Windows and Linux: the plumbing behind one trait, implemented where the crate you choose supports it, honest "not available here" otherwise. - The one flowing type: the identity confirmation on Connect ("this machine is connected as …") arriving as a message; the enforcement notice type present in the fixture and drawn, flowing only in synthetic worlds until qcontrol sends it.
- Stories: one per state of the inbox (empty, new, lifted required, acknowledged, expired, the withheld count) and of the settings, per world where it matters, captured off-screen with the existing capture path and published to design's atlas with
scripts/publish-stories.py(threadc4-messaging), and the budget read with strobe after the slice (the tray at rest with an inbox open).
Record as you go (c4 CYCLE.md Key Changes, CYCLES.md), and when the slice stands, stop at a review stop with review-1.md: what to look at, the figures, and the calls for Mark (among them: the mailto's it_contact source, the OS crates chosen, what the entitlement question needs from a signed build). Do not edit design except to publish captures and to add one Key Changes bullet to ../design/cycles/c137.app-messaging/CYCLE.md ("Phase 3 (date): started as qnative c4 …") committing only that file in design with a message naming c137; do not push anywhere.
Shared notes folder for this group of sessions (outside the repo; read siblings' notes there, leave hand-over notes or large findings there instead of pasting them into messages): /Users/mark/Library/Application Support/Claude/side-session-notes/local_48dcacbb-6e97-49e9-b5dd-cdec294ad88f