docs: M8 justified-now scope COMPLETE — restore byte-safety in, sidecar→M10 🏁📊

restore conflict-copy shipped (never-lose-a-byte on revert). Reframed the
conflict sidecar as M10 (only its resolver consumes it — ponytail) and
snapshot_chunks as M9. M8 nodes flipped green in both roadmap mermaids;
tables + §5.1/§5.5 updated. M9–M11 stay demand-driven.
This commit is contained in:
shoemoney 2026-06-23 11:47:29 -05:00
parent abab3b5ff9
commit 82307bd366
2 changed files with 19 additions and 11 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 — 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.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 🛡️ | > | 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` · **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 🏗️👥 | > | 🔮 **M8 — v2 Foundations**: migration runner · per-`(share,id)` snapshots · control socket + `pause`/`resume` · **M8a teams** · `restore` byte-safety | ✅ **justified-now scope complete & fleet-verified** (Pi `.13` owner invited an editor, Pi `.15` redeemed & pushed); 3 migrations verified on a copy of the real hub DB. M9–M11 stay demand-driven 🏗️👥 |
--- ---
@ -511,14 +511,14 @@ flowchart LR
flowchart LR flowchart LR
M6["M6 🕰️\nVersioning"] --> M65["M6.5 🚢\nDeploy"] M6["M6 🕰️\nVersioning"] --> M65["M6.5 🚢\nDeploy"]
M65 --> M7["M7 🛡️\nHardening\n+ M7.5/7.6 audit"] M65 --> M7["M7 🛡️\nHardening\n+ M7.5/7.6 audit"]
M7 --> M8["M8 🏗️\nv2 Foundations\nmigration · control socket"] M7 --> M8["M8 🏗️\nv2 Foundations\nmigration · teams · control socket"]
M8 --> M9["M9 🔐\nTrust + HA\nACL · E2E · S3"] M8 --> M9["M9 🔐\nTrust + HA\nACL · E2E · S3"]
M9 --> M10["M10 🤝\nCluster + merge\nP2P · resolver"] M9 --> M10["M10 🤝\nCluster + merge\nP2P · resolver"]
M10 --> M11["M11 ✨\nPolish\nTUI · power"] M10 --> M11["M11 ✨\nPolish\nTUI · power"]
style M6 fill:#1e5a2e,stroke:#51cf66,color:#fff style M6 fill:#1e5a2e,stroke:#51cf66,color:#fff
style M65 fill:#1e5a2e,stroke:#51cf66,color:#fff style M65 fill:#1e5a2e,stroke:#51cf66,color:#fff
style M7 fill:#1e5a2e,stroke:#51cf66,color:#fff style M7 fill:#1e5a2e,stroke:#51cf66,color:#fff
style M8 fill:#5a4a1e,stroke:#ffd43b,color:#fff style M8 fill:#1e5a2e,stroke:#51cf66,color:#fff
style M9 fill:#0d1117,stroke:#4F9CF9,color:#fff style M9 fill:#0d1117,stroke:#4F9CF9,color:#fff
style M10 fill:#0d1117,stroke:#4F9CF9,color:#fff style M10 fill:#0d1117,stroke:#4F9CF9,color:#fff
style M11 fill:#0d1117,stroke:#4F9CF9,color:#fff style M11 fill:#0d1117,stroke:#4F9CF9,color:#fff
@ -537,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 — 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.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 | | ✅ | **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`) · ✉️ **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 | | 🔨 | **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** via pure `meta.MayGrant`, self-seed on the legacy→explicit flip) — **cross-machine fleet-verified on arm64 Pis** · 🛟 **`restore` preserves uncommitted edits** (never-lose-a-byte on revert). **M8's justified-now scope is complete** — the conflict sidecar moves to M10 (only its resolver consumes it) and read-side ACL gating is M9 |
<details> <details>
<summary>🔮 <b>still ahead in M8 / genuinely v2</b></summary> <summary>🔮 <b>still ahead in M8 / genuinely v2</b></summary>

View file

@ -106,8 +106,10 @@ mental model ("Dropbox you host") intact while unlocking scale and privacy.
> a head-backfill + reworked GC). **Verified on a copy of the live `.10` hub DB** — 13 dev / 12 share / > a head-backfill + reworked GC). **Verified on a copy of the live `.10` hub DB** — 13 dev / 12 share /
> 16 chunk preserved, `user_version 0→1`, 3 legacy cross-share heads repaired. `snapshot_chunks` is > 16 chunk preserved, `user_version 0→1`, 3 legacy cross-share heads repaired. `snapshot_chunks` is
> **deferred to M9** (no consumer yet; the runner makes adding it a one-line migration), and `chunks.refcount` > **deferred to M9** (no consumer yet; the runner makes adding it a one-line migration), and `chunks.refcount`
> stays the maintained ground truth until then. `restore`/`deploy` conflict-copy moves to **M8-3** (it > stays the maintained ground truth until then. ✅ **`restore` conflict-copy shipped** (never-lose-a-byte on a
> needs the sidecar's base/ancestor awareness — a naive version breaks restore-reproduces-snapshot). > deliberate revert): it compares local against BOTH the snapshot and the hub head and preserves only genuinely
> *uncommitted* edits — so a clean restore still reproduces the snapshot exactly (no sidecar needed; head is the
> ancestor reference). `deploy` keeps its as-is behavior (read-only/pinned mounts have no uncommitted edits).
**The bug (verified):** `server.go:300` sets `snapshotID := req.ManifestHash`, and `snapshots.id` is a **The bug (verified):** `server.go:300` sets `snapshotID := req.ManifestHash`, and `snapshots.id` is a
**global** PK (`meta.go`). When two shares hold identical content their snapshot ids collide; **global** PK (`meta.go`). When two shares hold identical content their snapshot ids collide;
@ -227,6 +229,12 @@ real fix here — without touching hub-as-source-of-truth.
### 5.5 🎛️ Conflict resolution & 3-way merge &nbsp;·&nbsp; effort: L &nbsp;·&nbsp; **M8 sidecar / M10 resolver** ### 5.5 🎛️ Conflict resolution & 3-way merge &nbsp;·&nbsp; effort: L &nbsp;·&nbsp; **M8 sidecar / M10 resolver**
> 🦥 **Reassessed (ponytail):** the conflict **sidecar** (`{base, ours, theirs}` + `Entry.Binary` + pin/unpin)
> only feeds the **M10 resolver**, which is demand-driven and not being built — so per the spec's own guard it's
> **deferred to M10** (a producer with no consumer is the same YAGNI we cut from the control socket's `/events`).
> The data-safety win that *did* warrant shipping now — preserving an uncommitted edit on `restore` — landed in
> M8 *without* the sidecar (head is the ancestor reference; see §5.1). Build the sidecar when the resolver does.
v1 already does whole-file 3-way merge and **already tracks the common ancestor** (the per-mount base v1 already does whole-file 3-way merge and **already tracks the common ancestor** (the per-mount base
snapshot in `state.json`); resolution back to the hub is **free** (any local write → next `Sync` push, snapshot in `state.json`); resolution back to the hub is **free** (any local write → next `Sync` push,
no new wire verb). The one real gap: **conflict copies are amnesiac** — a `.conflict-<host>-<ts>` file no new wire verb). The one real gap: **conflict copies are amnesiac** — a `.conflict-<host>-<ts>` file
@ -271,12 +279,12 @@ hasn't fixed yet.
```mermaid ```mermaid
flowchart LR flowchart LR
M8["🏗️ M8 — Foundations<br/>refcount fix + migration runner ·<br/>principals/roles/invites (writes) ·<br/>conflict sidecar · control socket"] M8["🏗️ M8 — Foundations ✅<br/>refcount fix + migration runner ·<br/>principals/roles/invites (writes) ·<br/>restore byte-safety · control socket"]
M9["🔐 M9 — Trust &amp; durability<br/>read-side ACL · E2E (convergent) ·<br/>S3/R2 + Litestream HA"] M9["🔐 M9 — Trust &amp; durability<br/>read-side ACL · E2E (convergent) ·<br/>S3/R2 + Litestream HA"]
M10["🤝 M10 — Cluster &amp; merge<br/>LAN peer chunk-exchange ·<br/>interactive resolver + 3-way merge"] M10["🤝 M10 — Cluster &amp; merge<br/>LAN peer chunk-exchange ·<br/>conflict sidecar + resolver + diff3"]
M11["✨ M11 — Polish<br/>full TUI · power sanity ·<br/>groups · packfile batching"] M11["✨ M11 — Polish<br/>full TUI · power sanity ·<br/>groups · packfile batching"]
M8 --> M9 --> M10 --> M11 M8 --> M9 --> M10 --> M11
style M8 fill:#1e3a5a,stroke:#4F9CF9,color:#fff style M8 fill:#1e5a2e,stroke:#51cf66,color:#fff
style M9 fill:#3a1e5a,stroke:#a06bff,color:#fff style M9 fill:#3a1e5a,stroke:#a06bff,color:#fff
style M10 fill:#1e5a3a,stroke:#51cf66,color:#fff style M10 fill:#1e5a3a,stroke:#51cf66,color:#fff
style M11 fill:#5a4a1e,stroke:#ffd43b,color:#fff style M11 fill:#5a4a1e,stroke:#ffd43b,color:#fff
@ -284,9 +292,9 @@ flowchart LR
| Milestone | Ships | Gated by | | 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 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** | — | | 🏗️ **M8 — Foundations** ✅ | ✅ migration runner (`PRAGMA user_version`) · ✅ per-`(share,id)` snapshots + reworked GC (refcount undercount fixed) · ✅ daemon **control socket** + real `pause`/`resume` · ✅ **M8a teams**: principals/roles + write enforcement + members read + **device-facing invites with attenuation** — **cross-machine fleet-verified on arm64 Pis** · ✅ **`restore` conflict-copy** (never-lose-a-byte on revert) · ↪️ conflict **sidecar** + `Entry.Binary` + pin → **moved to M10** (only the resolver consumes it) · ↪️ `snapshot_chunks` edge table → **M9** (no consumer yet) — **3 migrations verified on a copy of the real hub DB (0→1→2→3); justified-now scope COMPLETE** | — |
| 🔐 **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) | | 🔐 **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 | | 🤝 **M10 — Cluster & merge** | **LAN peer chunk-exchange** (P2P, hub-authoritative) · **conflict sidecar** (`{base,ours,theirs}` + `Entry.Binary` + pin) · **interactive conflict resolver** + **diff3 3-way text merge** | M9 convergent-encryption co-design (sidecar ships with its resolver) |
| ✨ **M11 — Polish** | **full TUI** dashboard · **power** sanity (battery/metered/windows) · groups · packfile batching | M8 control socket | | ✨ **M11 — Polish** | **full TUI** dashboard · **power** sanity (battery/metered/windows) · groups · packfile batching | M8 control socket |
--- ---