|
|
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 |
|
|
|
f6e1f91d67
|
feat(M2): wire protocol foundation 🔌
- pkg/proto: hub<->device wire types + endpoint paths (join/publish/have/blob/push/head/metrics)
- manifest: Marshal/Unmarshal (JSON); ID = BLAKE3 of canonical bytes = blob key = snapshot id
- meta: bearer-token column + IssueBearer/DeviceByBearer + Count (for /metrics)
- identity: FingerprintOf(pubkey) so hub derives the same device id the device does
|
2026-06-22 23:30:01 -05:00 |
|
|
|
3884f732b5
|
feat(M2): SQLite hub metadata store 🗄️
- internal/hub/meta: pure-Go modernc.org/sqlite (no CGO -> trivial cross-compile)
- schema: devices, tokens, shares, access(writable bit), snapshots, chunks(refcount)
- AddSnapshot in a tx: insert + bump distinct-chunk refcounts + advance share head
- single access knob = per-(device,share) writable; tokens redeem-once + expiry
- tests: device lifecycle, token redeem-once/expiry, writable default+override,
shares/snapshots/refcounts (dedup within + across snapshots)
|
2026-06-22 23:24:55 -05:00 |
|
|
|
9788442f32
|
feat(M2): content-addressed BlobStore (disk CAS) 🧊
- internal/hub/blobstore: Store interface (Has/Put/Get/Delete) + Disk impl
- sharded root/<first2>/<hash>, atomic put (temp+rename, never over-existing),
idempotent, ErrNotFound sentinel — the open-core seam (S3/R2 later)
- tests: roundtrip, idempotent, missing-errors, no temp leftovers
|
2026-06-22 23:16:51 -05:00 |
|