docs: M8a teams COMPLETE + cross-machine fleet-verified 👥🌐📊

invites + members + write enforcement all shipped & proven on arm64 Pis
(.13 owner invited an editor, .15 redeemed and pushed). README CLI table
+ M8 rows + V2-SPEC §5.2 updated; 3 migrations verified on a real hub-DB
copy (0→1→2→3). M8-3 (sidecar/restore-copy) still the open M8 piece.
This commit is contained in:
shoemoney 2026-06-23 11:38:27 -05:00
parent 2f51f2c463
commit df4e617a34
2 changed files with 15 additions and 7 deletions

View file

@ -49,7 +49,7 @@
> | M7 — Hardening: `devbox doctor`, reconnect/backoff, rescan fallback, name-clash, release builds | ✅ done — **doctor/stop/hooks + share-name guard + dead-watcher rescan fleet-verified** 🛡️ |
> | M7.5 — Adversarial security/data-loss audit + fixes (path-traversal, blob integrity, never-clobber, safe GC) | ✅ done — **26 findings, all promise-breakers fixed, race-clean** 🔐 |
> | M7.6 — Hardening: fsync durability · DoS caps + timeouts · pidfile PID-reuse guard · join proof-of-possession | ✅ done — fleet-verified on arm64 🛡️ |
> | 🔮 **M8 — v2 Foundations**: migration runner · per-`(share,id)` snapshots · control socket + `pause`/`resume` · principals/roles + write enforcement | 🔨 in progress — **migration runner, control socket & M8a role enforcement shipped; both migrations verified on a copy of the real hub DB** 🏗️ |
> | 🔮 **M8 — v2 Foundations**: migration runner · per-`(share,id)` snapshots · control socket + `pause`/`resume` · **M8a teams** (principals/roles/invites + write enforcement) | 🔨 in progress — **M8a complete & cross-machine fleet-verified** (Pi `.13` owner invited an editor, Pi `.15` redeemed & pushed); 3 migrations verified on a copy of the real hub DB 🏗️👥 |
---
@ -329,6 +329,9 @@ container automatically. 🪄
| `devbox hook edit <share> <event>` | 🪝 Scaffold/open a hook in `$EDITOR`; `hook list <share>` shows installed |
| `devbox doctor` | 🩺 Diagnose watcher limits, perms, bash, hub connectivity + bearer |
| `devbox pause` / `resume` | ⏸️▶️ Suspend/resume the running daemon's syncing via its control socket (M8) |
| `devbox invite <share> <principal> <role>` | ✉️ Mint an invite token granting a role (`--reshare` for `+s`); attenuation-enforced (M8a) |
| `devbox members <share>` | 👥 Show who can access a share, or "legacy share" (M8a) |
| `devbox-hub member set/rm/list` · `principal` | 🛡️ Hub-side role admin (M8a) |
| `devbox peers` | 🌐 *Planned — needs a hub peers endpoint (M10)* |
</details>
@ -534,7 +537,7 @@ flowchart LR
| ✅ | **M7 — Hardening** 🛡️ | `devbox doctor`, `stop`/pidfile, `hook edit/list`, SSE backoff+jitter, **60s rescan fallback** (survives dead/limited inotify watchers — PRD risk #1), share-name guard, release builds — fleet-verified |
| ✅ | **M7.5 — Audit hardening** 🔐 | adversarial security/data-loss audit + fixes: blob-hash **path-traversal** blocked, **download blob-integrity** check, manifest-path **containment**, secret-guard **case-insensitive** + more patterns, **never-clobber** ignored/guarded files, **GC made safe** vs cross-share refcount undercount — all with regression tests, race-clean, fleet-verified |
| ✅ | **M7.6 — Hardening complete** 🛡️ | 💽 **fsync durability** on atomic writes (power-loss safe), 🚪 **request size caps + server timeouts** (DoS), 🆔 **pidfile PID-reuse guard** (start-time token), 🪪 **join proof-of-possession** (ed25519 signature, token not burned on a bad request) — fanned out to parallel worktree agents, regression-tested, race-clean, fleet-verified |
| 🔨 | **M8 — v2 Foundations** 🏗️ | 🔑 **schema migration runner** (`PRAGMA user_version`, transactional, `VACUUM INTO` backup, refuses a newer DB) · 🔢 **per-`(share,id)` snapshots** (fixes the cross-share refcount undercount; GC + head-backfill reworked) · 🎛️ **daemon control socket** (Unix socket, HTTP/1.1, `0600`) wiring `devbox pause`/`resume` + live-socket-aware `status` · 👥 **M8a: principals + per-share roles + write enforcement** (`devbox-hub member`/`principal`; legacy shares = v1, first grant flips to deny-by-default; role≥editor AND the writable clamp). **Both migrations verified on a copy of the real `.10` hub DB** (counts preserved, 3 legacy heads repaired, chains 0→1→2). 👀 **read side: `GET /v1/members` + `devbox members <share>`**. **Next in M8:** device-facing invites with privilege attenuation (M8a cont.), conflict sidecar + `restore`/`deploy` conflict-copy (M8-3) |
| 🔨 | **M8 — v2 Foundations** 🏗️ | 🔑 **schema migration runner** (`PRAGMA user_version`, transactional, `VACUUM INTO` backup, refuses a newer DB) · 🔢 **per-`(share,id)` snapshots** (fixes the cross-share refcount undercount; GC + head-backfill reworked) · 🎛️ **daemon control socket** (Unix socket, HTTP/1.1, `0600`) wiring `devbox pause`/`resume` + live-socket-aware `status` · 👥 **M8a: principals + per-share roles + write enforcement** (`devbox-hub member`/`principal`; legacy shares = v1, first grant flips to deny-by-default; role≥editor AND the writable clamp). **Both migrations verified on a copy of the real `.10` hub DB** (counts preserved, 3 legacy heads repaired, chains 0→1→2). 👀 read side (`GET /v1/members` + `devbox members`) · ✉️ **device-facing invites** (`POST /v1/invite` + `devbox invite`, privilege **attenuation** server-enforced via pure `meta.MayGrant`, self-seed on the legacy→explicit flip) — **cross-machine fleet-verified on arm64 Pis**. **Next in M8:** conflict sidecar + `restore`/`deploy` conflict-copy (M8-3, deferred — needs base-awareness); read-side ACL gating is M9 |
<details>
<summary>🔮 <b>still ahead in M8 / genuinely v2</b></summary>

View file

@ -141,10 +141,15 @@ The highest-leverage theme — and the **membership layer E2E + P2P both need un
> owner); the first `devbox-hub member set` flips it to **explicit/deny-by-default**. The push gate now
> enforces `EffectiveRole ≥ editor AND the writable clamp` (legacy shares reduce to the v1 writable bit
> exactly). Admin populate path: `devbox-hub member set/rm/list` + `principal`. Verified chaining 0→1→2 on
> a copy of the real hub DB. ✅ Plus the read side: `GET /v1/members` + a `devbox members <share>` client
> command. **Still ahead in M8a:** the device-facing **invite** flow (bind `(principal, share, role)` via the
> existing `/v1/join` PoP, with privilege *attenuation* — a member can only grant ≤ their own role, and only
> with `+s`) + `POST /v1/members/role`. **Read-side gating stays M9.**
> a copy of the real hub DB. ✅ Read side: `GET /v1/members` + `devbox members`. ✅ **Device-facing invites**:
> `POST /v1/invite` + `devbox invite <share> <principal> <role> [--reshare]`; the invitee redeems through the
> existing `/v1/join` PoP and lands as the bound principal with the bound role. **Privilege attenuation** is
> enforced server-side via the pure, unit-tested `meta.MayGrant` (never grant above your own role, never touch
> a superior, viewers can't grant, editors need `+s`); minting an invite on a legacy share **self-seeds the
> inviter as owner** before the explicit flip so they never lock themselves out. **Cross-machine fleet-verified
> on arm64 Pis** (owner on `.13` invited an editor, `.15` redeemed and pushed). **M8a write-side is complete.**
> Still optional later: `POST /v1/members/role` (re-grade in place — `devbox-hub member set` already covers it
> admin-side). **Read-side gating stays M9.**
- **Principals.** Insert a *principal* (person/account/service) above the device:
`devices.principal_id`. The **device stays the auth + revocation unit** (its ed25519 key never
@ -279,7 +284,7 @@ flowchart LR
| Milestone | Ships | Gated by |
|---|---|---|
| 🏗️ **M8 — Foundations** 🔨 | ✅ migration runner (`PRAGMA user_version`) · ✅ per-`(share,id)` snapshots + reworked GC (refcount undercount fixed) · ✅ daemon **control socket** + real `pause`/`resume` · ✅ **M8a: principals/roles + write enforcement** (admin CLI; invites/`GET /members` still ahead) · ⬜ conflict sidecar + `Entry.Binary` + pin + conflict-copy on `restore`/`deploy` (M8-3) · ⬜ `snapshot_chunks` edge table (deferred to M9 — no consumer yet) — **both migrations verified on a copy of the real hub DB, chaining 0→1→2** | — |
| 🏗️ **M8 — Foundations** 🔨 | ✅ migration runner (`PRAGMA user_version`) · ✅ per-`(share,id)` snapshots + reworked GC (refcount undercount fixed) · ✅ daemon **control socket** + real `pause`/`resume` · ✅ **M8a teams COMPLETE**: principals/roles + write enforcement + members read + **device-facing invites with attenuation** (admin CLI + `devbox invite`/`members`) — **cross-machine fleet-verified on arm64 Pis** · ⬜ conflict sidecar + `Entry.Binary` + pin + conflict-copy on `restore`/`deploy` (M8-3) · ⬜ `snapshot_chunks` edge table (deferred to M9 — no consumer yet) — **3 migrations verified on a copy of the real hub DB, chaining 0→1→2→3** | — |
| 🔐 **M9 — Trust & durability** | **read-side ACL** (deny-by-default) · **E2E** per-share keyed-convergent encryption · **S3/R2** blob backend + **Litestream** HA | M8 (membership, migration runner, refcounts) |
| 🤝 **M10 — Cluster & merge** | **LAN peer chunk-exchange** (P2P, hub-authoritative) · **interactive conflict resolver** + **diff3 3-way text merge** | M8 sidecar · M9 convergent-encryption co-design |
| ✨ **M11 — Polish** | **full TUI** dashboard · **power** sanity (battery/metered/windows) · groups · packfile batching | M8 control socket |