a951d4ab2f
feat(M3): pull + 3-way merge engine — converge without losing a byte 🔱
...
- internal/syncer Pull: fetch hub head manifest, 3-way merge vs base + local tree:
hub-only changes apply (write/delete), local-only stay, both-changed keeps hub
canonical + preserves the local edit as path.conflict-<host>-<ts>.ext
- delete-vs-edit always keeps the edit; identical concurrent edits don't conflict
- Sync: pull->merge->push with conflict-retry loop (converges under races)
- atomic file writes; chunk reassembly via GetBlob
- tests: two devices concurrent-edit -> conflict copy propagates to BOTH, zero data
loss; hub delete propagates to clones
2026-06-23 00:01:06 -05:00
3cfef72a88
harden(M2->M3): parent-aware push + hashed bearers + blob download 🔐
...
From the M2 ponytail review (the load-bearing findings):
- hub push now enforces parent==head: re-push=idempotent, parent==head=fast-forward,
else Conflict (never clobbers head) — the foundation M3 conflict resolution needs
- bearers stored as sha256 (like join tokens), no plaintext creds at rest / timing oracle
- GET /v1/blob/{hash} download + client.GetBlob — pull needs it
- randHex propagates crypto/rand errors (no silent low-entropy tokens)
- syncer/publish are head-aware and surface conflicts
- tests: conflict-when-behind (head not clobbered), manifest download+parse
Kept rw-by-default (intentional single-owner v1 per spec §6).
2026-06-22 23:54:55 -05:00
55175fa2ac
feat(M2): hub server + transport client + push engine + CLI 🛰️
...
- internal/hub: HTTP server (join/publish/have/blob/push/head/metrics), bearer auth,
blob hash-verify, hand-rolled Prometheus /metrics (no dep)
- internal/transport: device HTTP client for the full wire contract
- internal/syncer: device push engine (build manifest -> upload missing blobs ->
commit snapshot) + .devignore loader; in-process e2e test (join->publish->push)
- meta: idempotent AddSnapshot (content-addressed re-push advances head, no double
refcount) + busy_timeout for multi-process CLI access
- cmd/devbox-hub: serve/token/readonly/revoke; cmd/devbox: real join + publish/push
- config: persist bearer + device id
Verified end-to-end with real binaries: secret blocked, node_modules ignored,
re-publish dedups to 0 uploads.
2026-06-22 23:40:18 -05:00