Milestone 7: the app normal people install (macOS)

A Tauri menu-bar app runs the same sync engine as `lunesync run`. It
connects from the website with no code typed (lune://join and
lune://pair links), shows status in the menu bar, and lets a person
resolve held secrets, held big changes and kept-both notes side by
side. Uninstall shares and hands over first, then removes only what
Lune created.

Releases are signed on the hub that holds the key (`lunehub release
keygen/publish`); other hubs `release import` them. Apps verify the
signature and the signed version. Clients older than the previous
release are asked to update and keep saving locally.

A device can now be on several hubs at once (own and workplace), each
with its own key; the CLI takes --team when it matters. The supervisor
and status summary moved into core, shared by the CLI and the app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-29 11:47:35 +07:00
parent 8be559817c
commit 6cb85004fb
59 changed files with 6871 additions and 210 deletions

View File

@@ -153,38 +153,44 @@ Only the current milestone gets detailed below. The next one is detailed when th
---
## 6. Milestone 6 — Canvas for health and leaving
## 6. Milestone 7 — The app normal people install
Milestones 1–5 (sync, safety checks, the hub, taking access back, the canvas for access) are built; their detail lives in the code and tests now.
Milestones 1–6 (sync, safety checks, the hub, taking access back, the canvas) are built; their detail lives in the code and tests now.
### Goal
Before you need someone's work, you can see whether it has reached the team, and ask for it. Everything that needs a human decision — a note changed in two places, a handover, removing someone from the team — can be done on the canvas, including from a phone.
Someone who has never opened a terminal installs Lune on a Mac from the team's website, connects without typing a code, and from then on only notices it in the menu bar. Updates arrive on their own, signed. Uninstalling leaves nothing behind except notes that never got shared.
### What Sen does (on the canvas)
- Sees each person ringed by freshness and each device dotted the same way: green current, amber behind, grey offline (X6). A red dot means a possible secret was held back on that device.
- Opens a behind device: "4 changes not shared · 2 days" → **Nudge**.
- A vault shows "1 note to tidy" → **Compare** shows both versions side by side → keep one, or keep both.
- A vault shows a handover → see which notes it changes → **Keep** / **Discard**. A device that never came back → **Delete without saving**.
- A person → **Remove from team** (owner, asks to confirm, says how much unshared work will come back first). A removed person stays visible to the owner, dimmed, with **Restore** (gives a one-time sign-in link).
This milestone ships **macOS (Apple silicon) only** (§8). The code stays portable; Windows, Linux and Intel Macs come after the pilot.
### What a person does
- Opens their invite link (or the team canvas → **Get the Mac app**) → downloads `Lune.dmg` → drags Lune to Applications → opens it.
- Back on the page, clicks **Open Lune to join** (invite) or **Connect this Mac** (already on the team). Lune opens, shows the device name it will use (editable) → **Join** / **Connect**. No code to copy.
- Picks where shared vaults live (default `~/Vaults`) → vaults arrive.
- The menu-bar icon shows the worst status: synced, waiting, offline, held secret (same colours as X6). Its menu: status line, **Open Lune**, **Open team canvas**, **Share now**, **Uninstall Lune…**, **Quit**.
- The Lune window lists vaults with plain status and anything that needs them: a held big change (**Share anyway** / **Undo**), a possible secret (**Replace with a pointer** / **Not a secret**), notes to tidy (**Compare** side by side → keep this Mac's, the other, or both).
- When a new version is published, Lune downloads it quietly and the menu says **Restart to update**.
- **Uninstall Lune…** asks once, then: shares what it can, removes the vault folders Lune created, signs this Mac out of the hub, removes its settings and login item, and moves the app to the Trash.
### Behavior
- **Health reports**: while `lunesync run` is going, each device tells the hub every ~30 s, per vault: when it last synced, how many changes are waiting, and whether something is held (a big change, or a possible secret — counts only, never content). The hub knows work exists, not what it is.
- **Freshness**: current = reported in the last 2 minutes with nothing waiting; behind = something waiting or held; offline = not heard from in 2 minutes (shown with when it was last seen). A person's ring shows their worst device.
- **Nudge** reaches the device on its next check-in (~30 s): it saves what has settled and syncs at once. If something is held, the panel says so instead of pretending a nudge will help.
- **Tidy on the canvas** reads the two versions from the hub's copy of the vault (members only; Edit to decide). Keeping one, or both as separate notes, is a normal change on the hub that every device receives — same outcome as `lunesync tidy keep`.
- **Handovers on the canvas** are the M4 review (show / keep / discard / delete without saving), shown in the vault and person panels.
- **Remove from team / Restore** are the M4 flows; this is the only gesture on the canvas that asks for confirmation (X2).
- Status colors are used only for status; red only for a held secret (X6).
- **One engine**: the app runs the same sync engine as `lunesync run`, in-process. Both share one config, so the CLI still works next to the app. Lune starts at login once connected.
- **Connecting without a code**: the web page asks the hub for a short-lived pairing code (signed-in person) or uses the invite token, and opens `lune://pair?…` / `lune://join?…`. Typing a hub address and code in the window stays as a fallback.
- **Releases** (D3): `lunehub release keygen` creates the update-signing key on the hub's server (password-protected, never leaves it). `lunehub release publish` takes a built app, signs it there, and makes it the version the hub offers for download and update. The app trusts only that public key.
- **Too-old clients** (D3): every client says its version in its User-Agent. The hub serves the newest published version and the one before it. Older clients are refused with "Update Lune to keep syncing" and keep saving locally. Clients that don't say a version (0.1.x CLI, plain Git) are let through.
- **Several hubs on one device**: a Mac (or server) can belong to more than one team, e.g. Sen's own hub and a workplace hub. Each connection has its own device key; vaults from all of them sync side by side, and leaving one team never touches another's vaults.
- **One signing key for every hub**: releases are signed once where the key lives; other hubs `lunehub release import` an already-signed release and never hold the key.
- **Uninstall** never loses work: a vault with changes that couldn't be shared (offline, held, read-only) keeps its folder, and the dialog says which. Folders Lune didn't create are never deleted (A9).
- **Unsigned pilot** (D4): the first open needs "Open Anyway" in System Settings; the download page says so. OS code signing comes before a wider rollout.
### Acceptance — Sen acts this out
1. Laptop offline with edits: its ring turns amber, then grey with "last seen"; back online it turns green on its own.
2. A behind laptop that's online but idle: **Nudge** → green within a minute.
3. Same lines edited on two devices: the vault shows 1 to tidy; compare side by side on the canvas; keep one; the copy disappears on every device.
4. Remove someone from a vault with unshared work: review and keep the handover on the canvas.
5. From a phone: remove someone from the team (confirm), see their devices leave; restore them.
1. From an invite link on a Mac that has never run Lune: download, install, **Open Lune to join**, pick a folder; the team's vaults arrive and the menu bar shows synced.
2. On the canvas of an existing member: **Connect this Mac** pairs it with no code typed.
3. A possible secret: the menu bar turns red; resolve it from the window.
4. Same lines edited on two devices: compare side by side in the window, keep one.
5. Publish a new version on the hub: the app picks it up, **Restart to update**, and comes back as the new version still synced.
6. **Uninstall Lune…**: vault folders it created and its settings are gone, the device disappears from the canvas, and a folder you added yourself is untouched.
### Out of scope for M6
Desktop app, tray, installers, updates (M7). Push notifications for Nudge (the next check-in is enough for now).
### Out of scope for M7
Windows and Linux installers, Intel Macs, server install script (D2), OS code signing (D4), security audit and release evidence (before a wider rollout, not the pilot).
## 7. Open questions
None open.
@@ -196,3 +202,7 @@ Record here: date, what changed, why, which decision number. Example:
- 2026-10-28 — Secret detection (open question, P2): our own short list of ~20 high-confidence rules, not an embedded gitleaks-style set. Fewer false alarms, easy to read. (Sen)
- 2026-10-29 — Hub storage (open question): plain bare repos on the hub's volume served by the hub itself (device key + role check, then Git's own HTTP backend); no Gitea underneath. (Sen)
- 2026-10-29 — Web canvas sign-in (new): no passwords; a one-time link from `lunesync open` or a pairing code typed on the hub's sign-in page; 30-day session cookie. (Sen)
- 2026-10-29 — Milestone 7 ships macOS (Apple silicon) only; Windows, Linux and Intel Macs after the pilot (D1). (Sen)
- 2026-10-29 — The update-signing key lives on the hub's server and `lunehub` signs releases there, so losing a laptop doesn't lose the key (D3). (Sen)
- 2026-10-29 — A device can connect to several hubs at once (Sen's own and a workplace hub), each with its own device key (A1, new in M7). (Sen)
- 2026-10-29 — One update-signing key, on Sen's VPS, signs releases for every hub; other hubs import signed releases (D3). Accepted trade-off: that server is trusted by every hub's Macs. (Sen)