diff --git a/README.md b/README.md index 0838f89..3ec9708 100644 --- a/README.md +++ b/README.md @@ -367,6 +367,7 @@ container automatically. ๐Ÿช„ | `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 ` | โœ‰๏ธ Mint an invite token granting a role (`--reshare` for `+s`); attenuation-enforced (M8a) | +| `devbox invite revoke ` | ๐Ÿ—‘๏ธ Kill a pending invite before it's redeemed (only a caller who could mint it) | | `devbox members ` | ๐Ÿ‘ฅ 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)* | @@ -384,6 +385,7 @@ container automatically. ๐Ÿช„ | `devbox-hub readonly ` | ๐Ÿ”’ Mark a device read-only on a share | | `devbox-hub member set/rm/list` ยท `principal` | ๐Ÿ›ก๏ธ Per-share roles + principals (M8a) | | `devbox-hub serve --dashboard` | ๐Ÿ“Š Serve the live web dashboard (loopback `:8099` by default) | +| `devbox-hub serve --gc-every ` | ๐Ÿงน Opt-in in-process periodic GC (off by default; each sweep animates on the dashboard) | | `devbox-hub gc` | ๐Ÿงน Garbage-collect unreferenced chunks | @@ -400,21 +402,24 @@ container automatically. ๐Ÿช„ ```bash devbox-hub serve --dashboard # loopback http://127.0.0.1:8099 (safe default) devbox-hub serve --dashboard --dashboard-addr 0.0.0.0:8099 # expose on the LAN (unauthenticated โ€” warns you) +devbox-hub serve --dashboard --gc-every 24h # also self-maintain (in-process GC) โ€” each sweep animates ``` A mission-control flow visualization rendered on `` at 60fps: a **breathing hub core**, your -**devices orbiting** (bright = active), **shares** on the outer ring โ€” and when a device pushes, a glowing -**particle streams device โ†’ hub โ†’ share** and fans out to the subscribers. Plus live **metric tiles** with -sparklines (devices online, shares, snapshots, chunks, total data, pushes/min, bytes/min) and a streaming, -color-coded **activity feed**. +**devices orbiting** (bright = active), **shares** on the outer ring โ€” and the fabric comes alive with **five +flow events**: `push` (device โ†’ hub โ†’ share, fans out to subscribers), `pull` (a calm teal pulse inbound as a +device syncs), `conflict` (a red collision burst when a stale push is rejected), `gc` (an amber hub-wide sweep ++ toast when garbage-collection runs), and `join`. Plus live **metric tiles** and a **server-side history +sparkline** (stacked push/pull/conflict/gc per minute, last hour) that **survives a page reload**, and a +streaming, color-coded **activity feed**. | How it works | | |---|---| | ๐Ÿ–ฅ๏ธ **Served from the hub** | single `go:embed`'d HTML, vanilla JS + canvas, zero CDN/build | -| ๐Ÿ”Œ **`GET /api/state`** | snapshot: hub, totals, devices, shares (UI polls every 10s) | -| ๐Ÿ“ก **`GET /api/events`** | SSE live flow stream (`join`, `push`) โ€” the dashboard animates each one | +| ๐Ÿ”Œ **`GET /api/state`** | snapshot: hub, totals, devices, shares + a 60-minute `history` window (UI polls every 10s) | +| ๐Ÿ“ก **`GET /api/events`** | SSE live flow stream (`join` ยท `push` ยท `pull` ยท `conflict` ยท `gc`) โ€” the dashboard animates each one | | ๐Ÿ”’ **Loopback by default** | unauthenticated read-only metrics; bind non-loopback only deliberately (it warns) | -| ๐ŸŽฌ **`?demo=1`** | synthesizes a live stream โ€” instant wow + works offline (`file://`) | +| ๐ŸŽฌ **`?demo=1`** | synthesizes a live stream of all five event types โ€” instant wow + works offline (`file://`) | ```mermaid flowchart LR diff --git a/dashboard-p3.png b/dashboard-p3.png new file mode 100644 index 0000000..0d69ab4 Binary files /dev/null and b/dashboard-p3.png differ diff --git a/plan.md b/plan.md index 986714b..98b39b5 100644 --- a/plan.md +++ b/plan.md @@ -2,7 +2,7 @@ # ๐Ÿ—บ๏ธ devbox โ€” What's Next (PRD) -![status](https://img.shields.io/badge/status-%F0%9F%9A%80%20P1%2BP2%20shipped%20%C2%B7%20P3%20next-blueviolet?style=for-the-badge) +![status](https://img.shields.io/badge/status-%E2%9C%85%20P1%2BP2%2BP3%20shipped%20%C2%B7%20M9%2B%20demand--driven-brightgreen?style=for-the-badge) ![base](https://img.shields.io/badge/builds_on-v1%20hardened%20%C2%B7%20v2%20M8%20shipped-00ADD8?style=for-the-badge) ![release](https://img.shields.io/badge/release-%F0%9F%93%A6%20latest%20live-success?style=for-the-badge) ![public](https://img.shields.io/badge/github-%F0%9F%8C%8D%20public%20%C2%B7%20AGPLv3-181717?style=for-the-badge) @@ -29,12 +29,12 @@ clean two-scanner git-history secret sweep. Verified end-to-end on clean no-Go a flowchart LR NOW["โœ… adoption tooling
installers ยท docker ยท dashboard"] --> P1["โœ… P1
Releases + CI
+ public repo"] P1 --> P2["โœ… P2
M8a auth audit
2 fixes + tests"] - P2 --> P3["๐Ÿ”จ P3
dashboard depth"] + P2 --> P3["โœ… P3
dashboard depth
pullยทgcยทconflict + history"] P3 -.demand-driven.-> LATER["๐Ÿ”ฎ M9โ€“M11
E2E ยท P2P ยท HA ยท TUI"] style NOW fill:#1e5a2e,stroke:#51cf66,color:#fff style P1 fill:#1e5a2e,stroke:#51cf66,color:#fff style P2 fill:#1e5a2e,stroke:#51cf66,color:#fff - style P3 fill:#5a4a1e,stroke:#ffd43b,color:#fff + style P3 fill:#1e5a2e,stroke:#51cf66,color:#fff style LATER fill:#0d1117,stroke:#4F9CF9,color:#fff ``` @@ -86,18 +86,19 @@ This is the M7.5 treatment for v2's new attack surface, **before** anyone relies --- -## ๐Ÿฅ‰ P3 โ€” Dashboard depth (delight, not load-bearing) +## โœ… P3 โ€” Dashboard depth โ€” **SHIPPED 2026-06-23** -**Why:** the live dashboard wows already, but it only animates `join` + `push`. More flow types + a terminal -view would make it a genuinely complete ops surface. +**Why:** the live dashboard wowed already, but it only animated `join` + `push`. P3 made it a genuinely +complete ops surface. -**Scope** -- [ ] Emit `pull` (head fetch / propagation), `gc` (sweep), and `conflict` flow events from the hub; animate them. -- [ ] A historical sparkline window persisted server-side (currently the frontend computes rates from the live stream only). -- [ ] *(Optional)* an **M11 TUI** over the daemon control socket (`devbox top`?) โ€” re-adds the `/events` SSE stream we trimmed, now with a real consumer (bubbletea). +**Shipped** +- [x] Hub emits `pull` (head fetch / propagation, `handleHead`), `conflict` (stale-parent push, `handlePush`), and `gc` (in-process sweep) flow events. GC runs in-process via opt-in `serve --gc-every ` (default off โ€” auto-deleting blobs on a timer is opt-in) so the hub self-maintains *and* each sweep animates. +- [x] **Server-side history window**: per-minute activity buckets (push/pull/conflict/gc + bytes, last 60 min) in `/api/state` โ†’ the sparkline now survives a page reload (was live-stream-only). Recorded under the `Emit` lock; race-clean. +- [x] Frontend (`index.html`, one file, no new deps): `pull` = teal inbound pulse, `conflict` = red collision burst, `gc` = amber hub sweep + toast; stacked per-minute history sparkline seeded from `/api/state` and growing live. +- [~] *(Optional M11 TUI)* โ€” skipped, demand-driven (no consumer yet). -**Acceptance** -- โœ… A `gc` run and a multi-device `pull` both visibly animate; new event types fleet-verified on the SSE stream. +**Acceptance โ€” met โœ…** +- โœ… `gc`, `pull`, `conflict` (plus `join`/`push`) all visibly animate; **all 5 verified on the live SSE stream** by `scripts/dashboard-fleet-verify.sh` (now with a `LOCAL=1` mode). Frontend rendered headless with **0 console errors**; history sparkline + gc toast + all event feeds present. Tests: `TestHistoryRing`; `go test ./... -race` clean. **Effort:** Sโ€“M ยท **Risk:** low.