Repository navigation
Releases
Releases · sandy-sachin7/shard
v2.5.2
v2.5.2 (2026-11-25) — Windows Checkout Backup Fsync Fix
Fixed
- Windows Backup Durability Handle (
core/src/repo.rs): Open checkout backup files with write access (OpenOptions::new().write(true)) before callingsync_all(), fixingAccess is denied (os error 5)from WindowsFlushFileBuffersduring multi-file checkout.
Full Changelog: v2.5.1...v2.5.2
v2.5.1
v2.5.1 (2026-11-25) — Durable Crash-Atomic Checkout Journal
Fixed
- Crash-Atomic Multi-File Checkout Journal (
.shard/checkout_journal.json): Separatedshard checkoutinto strict phases: stage and hash-verify every manifest, back up every existing target file withsync_all()before mutating any working-tree file, persist an atomic fsynced checkout journal (Swapping->UpdatingHead), swap files, commitHEAD, and remove backups and journal last. - Explicit Rollback Error Propagation: Failed swaps and failed
HEADupdates roll back all previously replaced files via idempotent copy-and-replace from durable backups, restoreHEAD, surface any rollback errors viaShardError::CheckoutRollbackFailed, and keep.shard/checkout_journal.jsonon disk when rollback encounters an error soshard recovercan retry. - Automatic & Explicit Crash Recovery:
shard recover(and subsequent write operationsadd,commit,checkout) replays.shard/checkout_journal.json, rolling back interruptedSwappingcheckouts or rolling forwardUpdatingHeadcheckouts cleanly. - Boundary Fault-Injection Tests (
tests/resilience.rs): Added deterministic tests covering backup failure on file 2, mid-swap failure after file 1 was overwritten,HEAD-update failure, simulated mid-swap crash recovery, simulatedUpdatingHeadcrash recovery, and rollback error propagation.
Full Changelog: v2.5.0...v2.5.1
v2.5.0
v2.5.0 (2026-11-25) — Transactional Checkout, FastCDC Naming & Empirical Checkpoint Benchmarks
Added
- Transactional Multi-File Checkout:
shard checkoutnow stages and verifies every manifest into same-directory temp files before overwriting any working-tree file, snapshots existing targets for rollback on persist errors, fsyncs touched parent directories, and updatesHEADlast. A corrupt or missing chunk on file N of M leaves files 1..N-1 andHEADuntouched. - FastCDC Naming (
--chunker fastcdc): Renamed the Gear-hash content-defined chunker fromRabinChunker/--chunker rabintoFastCdcChunker/--chunker fastcdc, keepingRabinChunker,Chunker::new_rabin,validate_rabin_params, and--chunker rabinas backwards-compatible aliases. - Empirical ML Checkpoint Deduplication Benchmark (
benchmarks/bench_checkpoints.py): Measured real IEEE-754 float32 safetensors-style checkpoints across full fine-tuning (0.0% chunk dedup), frozen 90% backbone + 10% updated head (89.0% dedup), and 1 MiB adapter prepend over a frozen backbone (54.5% dedup vs 0.0% fixed), checked intobenchmarks/checkpoint_dedup_results.json. - Resilience & Property Test Suite (
tests/resilience.rs): Added FastCDC roundtrip/shift-invariance property tests,SHRDv1 envelope bit-flip/truncation/AAD-swap rejection tests, torn/corrupt CRC32 WAL recovery tests, and multi-file transactional checkout rollback tests.
Changed
- Documentation Accuracy: Replaced "Rabin CDC" with "FastCDC", removed "Enterprise" headings, updated the comparison table to note HuggingFace Hub uses FastCDC (Xet), and documented where deduplication helps (frozen backbones, adapters, offset-shifted checkpoints, datasets) vs where it does not (full fine-tune epochs).
Full Changelog: v2.4.1...v2.5.0
v2.4.1
v2.4.1 (2026-11-25) — Dependency Security Patch
- Upgraded
rusqliteto 0.42 andr2d2_sqliteto 0.37, movinglibsqlite3-systo 0.40 and clearingRUSTSEC-2026-0459. - Refreshed the lockfile and audit configuration comment.
Full Changelog: v2.4.0...v2.4.1
v2.4.0
v2.4.0 (2026-11-24) — Production Security, Durability & Correctness Hardening
Security & Trust Boundaries
- P2P Ed25519 challenge-response authentication: Restored real challenge-response handshake using fresh 32-byte
OsRngnonces with 30s TTL, domain separation bound to both client and serverPeerIds,authorized_keysenforcement, and automatic session cleanup onConnectionClosed. - Strict ID & path validation: Added
validate_object_id(64 lowercase hex chars) at everyStorebackend,PartialTransfer, and P2P handler; addedsafe_repo_joinpreventing absolute paths,..,.shard/.git, and symlink escapes acrosscheckout,export,pull, and/api/v1/add; addedvalidate_branch_nameblocking../traversal while supporting hierarchical branch names likefeature/foo. - HuggingFace push key protection:
shard hf pushnow stages only safe public repository artifacts (includingobjects.dbfor Sled/SQLite repos) into an isolated temp directory with a mandatory pre-flight assertion refusingsecret.key,repo.key,keys/archive/,wal.log,partial/, and.shard.lock; passes tokens viaHF_TOKENenv var instead of CLI flags. - Hardened HTTP API (
shard serve): RemovedCorsLayer::permissive(); added constant-time bearer token auth (SHARD_API_TOKENor ephemeralOsRngtoken); confined/api/v1/addinside the repository; fixed/api/v1/committo return realcommit_idand/api/v1/statusto load.shard/index; offloaded blocking operations viatokio::task::spawn_blocking. - Signature trust & key hardening:
verifyandpull/syncrequire valid signatures (with--allow-unsignedopt-in), verifykey_id == blake3(public_key), and anchor trust to local keychain +authorized_keys; all secret keys written atomically with0o600permissions;repo.keywrapped with Argon2id + AES-256-GCM when passphrase is set;key rotatesupports encrypted keys; secret buffers zeroized withzeroize; AEAD AAD binds chunk hashes; removed panickingRepoCipher::key_bytes();SHARD_PASSPHRASEenv var supported across all commands. - Dependency upgrades: Upgraded
libp2pto0.57(and transitivehickory,rustls-webpki,ring,bytes,rand,time), eliminating active security/soundness advisories and pruning.cargo/audit.toml.
Core Storage, Durability, Memory & Correctness
- Atomic writes & crash-safe WAL: Added
atomic_write(write -> sync_all -> rename -> dir fsync) acrossFlatStore,Index, refs,HEAD,tags.json, andconfig.json. WAL now backs upHEAD, active branch ref (refs/heads/<branch>), andindexwith per-record CRC32 checksums,sync_all(), and graceful recovery from truncated trailing records. - Real cross-process locking: Replaced polling
OpQueuewith OS-level advisory locking (fs2on<repo_root>/.shard.lock) combined with in-processRwLockacross all operations. - Eliminated OOM paths: Replaced 1 GiB
zstd::bulk::decompressand unboundedzlibdecompression with bounded streaming decompression (64 MiB default cap); streamedcheckout,export, andpullchunk-by-chunk viaBufWriter; streamedpushobject-by-object fromStore; added key-onlyStorageBackend::iter_keys()for Sled/SQLite GC. - Self-describing
SHRDv1 chunk envelopes: Fixedpushrejection andpullresume corruption forzstd/zlib/--privaterepos and prevented silent corruption when compression/privacy flags change. - 3-way LCA merge: Rewrote
merge()with DAG Lowest Common Ancestor computation, fullFileManifestpreservation (compression, size, content_type, merkle_root), and explicit conflict detection. - Fail-closed GC: Deduplicated
prune->gc::gc(); added recursive branch scanning for slashed branches,KeyRotationandpartial/reachability marking, iterative DAG traversal, RAII panic-safe guard, and fail-closed abort on any mark-phase error. - Backend & chunker fixes: Removed buggy
objects.idxfromFlatStore; enabled SQLite WAL +synchronous=NORMAL+busy_timeout=5000on every pooled connection; reused openStoreinimport/share/syncto fix Sled double-open crashes; replaced broken rolling hash with true shift-invariant FastCDC (64-bit Gear hash + dual normalized masks). - Commit snapshot semantics &
import(): Commits now carry forward unmodified manifests from parent commits;import()preserves source directory hierarchy.
Modularity, Bindings, CLI & Repo Hygiene
- Decomposed 3,566-LOC
core/src/lib.rsinto focused submodules (repo,auth,backup,p2p_sync,hf,chunk_codec,fs_util,error). - Fixed
SHARD_*env var key mapping (preserving underscores) and wiredvalidate_config()(withzlibinstead ofgzip). - Rewrote
python/shard-pyto invokeshard-coredirectly with GIL release (py.allow_threads). - Routed CLI diagnostics strictly to
stderrwhile keeping clean data/JSON onstdout; fixedkey verify --jsonnon-zero exit code on failure. - Un-ignored and stabilized
test_three_node_pullandtest_sync_auto_pull; added comprehensive security, P2P auth, merge, GC, and HTTP API tests. - Hardened
Dockerfile(non-root user),docker-compose.yml, andscripts/install.sh(mktemp -d+trap+ macOSshasum); cleaned root clutter.
What's Changed
- release: v2.3.0 — auth enforcement, share robustness, status --porcelain by @sandy-sachin7 in #1
New Contributors
- @sandy-sachin7 made their first contribution in #1
Full Changelog: v2.3.0...v2.4.0
v2.3.0 — Auth Enforcement, Share Robustness, Status --porcelain
Critical Security Fixes
- Authorization bypass fixed: P2P serve_request now enforces authentication before serving content
- Pull/Push now perform challenge-response auth handshake before data exchange
Major Fixes
- Share re-announces HEAD periodically (30s) and on new connections
- Share subscribes to repo-specific gossipsub topic
- Share CLI accepts --listen address argument
- Proper error logging instead of silent swallows
- OP_QUEUE guard for concurrent safety
Features
- shard status --porcelain mode (git-style output)
- HuggingFace dataset push/pull integration
- validate_chunk_size() public function
Chores
- Version bump v2.2.1 -> v2.3.0
- ignore crate replaces walkdir
- CI: release build + cargo doc steps added
- fmt and cargo audit compliance fixes
- Docker build fix: removed unused reqwest dependency
v2.2.1
chore: bump to v2.2.1 for crates.io publish
v2.2.0
fix: mark flaky test_three_node_pull as ignored