Commit Graph
2 Commits
Author SHA1 Message Date
osobhandClaude Opus 4.7 1bf6cffe0e clawsync-transport: SealedFile/SealedFileAck variants + mTLS PEM constructors
Adds the wire surface and the cert-loading constructors that
omni-sync's QuicTransport needs for sealed-day replication to a
peer Garage node.

Protocol additions (rkyv discriminants are positional — appended
at the end, never inserted):

- `SyncMessage::SealedFile { peer_name, payload }`: sealed `.h5`
  delivery from `omni-sync` clients (omni-cortex daemons
  replicating sealed-day Working / Episodic / Semantic tier
  files to a peer).
- `SyncMessage::SealedFileAck { peer_name, bytes, blake3_hex }`:
  receiver-computed BLAKE3 acknowledgement so the sender can
  verify the bytes landed intact.

QuicConfig constructors for production mTLS:

- `client_with_pem(client_cert, client_key, server_ca)` — loads
  the operator's mTLS leaf identity + the CA whose-issued server
  certs the client trusts. Builds a real rustls `ClientConfig`
  via `with_client_auth_cert`. Server config field gets a
  placeholder (never consumed by `quic_connect`).
- `server_with_pem(server_cert, server_key, client_ca)` — mirror
  for the receive side. Real rustls `ServerConfig` with
  `WebPkiClientVerifier::builder(roots).build()` +
  `with_client_cert_verifier` (mutual auth: clients without a
  CA-issued cert fail the handshake) + `with_single_cert`.

Validated by `omni-sync`'s D193 production-mTLS round-trip test:
rcgen-generates CA + matching server cert + matching client
cert, writes PEMs to a tempdir, spawns a `QuicServer` with
`server_with_pem`, drives a real `QuicTransport` production-mode
client through `SealedFile` → `SealedFileAck` with mutual cert
verification.

Also includes a `rustls-pemfile = "2.2"` dep + ambient
`cargo fmt` line-collapsing in `framed.rs` and `peer.rs` from
when the workspace was reformatted.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
2026-05-02 05:31:32 -07:00
osobhandClaude Sonnet 4.6 260e15f5b6 Initial commit: ClawSync v0.1.0
8-crate pure-Rust workspace for revision-aware HDF5 sync.

## Crates
- clawhdf5-onion: ClawOnion VFD — page-level versioned HDF5 storage,
  binary format, writer/reader, branch DAG, GC, snapshots, provenance
- clawsync-core: BLAKE3, xxHash3, FastCDC (+ SIMD NEON), zstd/lz4
- clawsync-onion: IBLT sketch, Merkle tree differ, packet differ/merger,
  ClawSyncManifest, SyncSelector
- clawsync-hdf5: dataset-level manifest, differ, patcher, wire payload
  reconstruction (apply_received_payloads)
- clawsync-transport: TCP, QUIC (quinn 0.11/TLS 1.3), SyncPeer abstraction,
  length-prefixed rkyv wire protocol (21 SyncMessage variants)
- clawsync-agent: OnionMemory, SyncScheduler, TcpSyncBackend,
  PeerCapabilities negotiation
- clawsync-fs: CDC-based delta sync for any file type; FsSyncClient/Server,
  W=16 pipelining, atomic writes
- clawsync-cli: push/pull/serve/hdf5-sync/serve-hdf5/sync/serve-fs +
  all local management commands; --quic on all network commands

## Key features
- IBLT pre-flight: O(revision count) vs rsync's O(file size)
- W=16 sliding-window push: 13–15x speedup over stop-and-wait at WAN RTT
- Dataset-granular HDF5 sync: only modified datasets transferred
- CDC delta for any file type: insertion-stable chunk boundaries
- Full revision DAG: branch, merge, rollback, export, snapshot, GC
- QUIC transport: TLS 1.3, per-message streams via quinn 0.11

## Tests
~573 passing (default features); ~589 with --features simd-cdc

## Performance (Apple Silicon)
- Reconstruct rev=100: 68 µs (target ≤ 1 ms)
- BLAKE3 Rayon 1 MB: 10.3 GiB/s (target ≥ 5 GB/s)
- GC 500 revisions: 20.6 µs (target ≤ 2 s)
- W=16 vs W=1 at 5 ms RTT: 14.8x speedup
- No-op pre-flight at 16 MB: 4 ms vs rsync 35 ms (7.8x)

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-04 18:41:22 -05:00