Commit graph

4 commits

Author SHA1 Message Date
8c5d576a72 feat(device): --json output, streaming chunker, pause --for, per-mount exclude, rescan knob ✨
Five device-side wins from the feature review:

- 🤖 `--json` on status/log/conflicts: machine-readable output for fleet
  scripting/monitoring. status prefers live daemon state (paused +
  base-snapshot), falls back to disk; not-joined → {"joined":false}.
- 🌊 streaming chunker: chunk.SplitReader feeds FastCDC from an io.Reader so
  the manifest build no longer slurps whole files into RAM — a multi-GB file
  can't OOM the daemon. Identical boundaries/hashes (proven vs fragmented reads).
- ⏱️  `devbox pause --for 2h`: control socket carries a duration; the daemon
  schedules an auto-resume timer. Re-pause replaces it; plain pause/resume
  cancel it (no surprise resume).
- 🙈 per-mount `devbox mount --exclude <pat>`: device-local ignore layered on
  the shared .devignore (LoadIgnoreWith) — skip a local build dir without
  touching the shared file. Honored by daemon sync, restore, and deploy.
- 🎛️  rescan cadence is now settings.sync.rescan_seconds (was a hardcoded 60s
  const) — tune the watcher fallback per machine without a rebuild.

#6 (doctor non-zero exit) was already shipped — doctor returns an error on ❌.
Tests: SplitReader-vs-buffered, PauseFor auto-resume + cancel, wire duration,
LoadIgnoreWith layering, status/conflicts --json. go test ./... -race clean.
2026-06-30 12:29:02 -05:00
3213149974 refactor: ponytail-audit cuts — dead Windows Publish stub + dedup Daemon iface 🧹
Repo-wide audit (per request) came back lean — no dead exports, no
reinvented stdlib. Two real cuts:
- delete the Windows control.Server.Publish no-op: Publish was removed
  from the real server when /events was trimmed, so nothing calls it.
- move the control.Daemon interface into shared control.go (was duplicated
  across server.go + server_windows.go build-tag split → drift risk).

Kept (disagreed with cutting): blobstore.Store interface is the documented
M9 S3 seam (6 lines, clean contract); c.Bearer() is a tiny test accessor.
2026-06-23 11:13:38 -05:00
9f90f2c147 refactor(M8): drop the control /events SSE stream — no consumer yet (ponytail) ✂️
ponytail-review caught it: publishActivity -> ctrl.Publish -> broker -> SSE
was a producer with nothing on the other end. GET /events only feeds the
M11 TUI, which is demand-driven and not built. /state + /pause + /resume
cover every real caller (devbox status/pause/resume). Cut the broker,
handleEvents, Publish, publishActivity, and the ctrl handle — re-add the
(small, known) fan-out when a TUI actually consumes it. Net -100 lines.
2026-06-23 10:50:45 -05:00
20579b0aae feat(M8): daemon control socket + pause/resume 🎛️
Add internal/control: an HTTP/1.1 control plane the daemon hosts on a
0600 Unix socket (control.sock) in the config dir — GET /state, GET
/events (SSE), POST /pause|/resume — plus a stdlib net/http client
(DialState/Pause/Resume) that returns a typed ErrNotRunning when the
daemon is down so callers can fall back.

Wire into the daemon: paused atomic.Bool gates runMount's trigger loop
(drains while paused, no-ops the initial nudge), a per-mount nudge
registry lets Resume catch every mount up, and StateSnapshot feeds
/state. The control server starts in Run and is non-fatal — sync never
depends on it. Windows gets a build-tagged stub (named-pipe upgrade
path noted).

CLI: devbox pause/resume call the client (friendly 'daemon not running'
when absent); status prefers the live socket but ONLY on a TTY, so piped
output stays byte-identical to v1 for scripts.
2026-06-23 10:38:22 -05:00