mirror of
https://github.com/hanzoai/vfs.git
synced 2026-11-23 05:37:08 +00:00
Rebuilds the volume engine on content-defined chunks, a Merkle tree of sealed shards, and one fenced Head object committed by a single conditional write. Replaces the old 4 KiB block store; there is one layout, with no version number, and no code reads any other. What it is: FastCDC chunks of 64 KiB to 4 MiB sealed one by one and packed into ~16 MiB objects; metadata as sharded, content-addressed Merkle nodes with files up to 16 KiB inline; a Head (Seq, Root, Next, ID, Seed, Journal, Needs, then a TLV Tail with strictly increasing tags and reserved tags/bits for snapshots, links and base) committed by one conditional PUT under a monotone Round fence; sealed objects bound to volume, kind and place by a fixed-length context with a 32-byte tag keyed from the secret identity (post-quantum hybrid age by default, keys supplied by the caller); sparse extents that cost nothing (a 1 PiB truncate flushes in milliseconds); extension objects under ext/<name>/<keyed hash>; Reseal to move a volume; a FUSE front on which no request is ever answered EINTR except a 3 s grace for cold lookup/getattr/readdir, and fsync waits. docs/SPECIFICATION.md is the normative contract; the HIP is hanzoai/hips#13. Testing: CI run 43908676601: 16 parallel gates, each under 5 minutes (longest 193 s), real-server gates pinned by image digest and failing on a skip. Real kernels: go test -tags fuse ./pkg/mount ./internal/sqlitecheck 10 of 10 on arm64 Linux 7.0 and 10 of 10 on amd64 Linux 6.8 (TestFUSESQLite failed 7 of 7 before the fsync fix); C callers under SIGALRM 5,000 fsync+close with ~19,000 signals and 0 EINTR; 60,000 stats with and without SA_RESTART 0 EINTR; 6 GiB cold reads under signals 0 EINTR/EIO; 564 acknowledged fsyncs over 4 daemon SIGKILLs, 0 missing. Head parser: 3,000,000 differential inputs against an independent decoder plus 8.2M native fuzz executions, no divergence, every accepted Head re-encodes byte for byte; extension names match 300 vectors from an independent BLAKE3; real hanzoai/s3 server passes the shared backend suite. Seven review rounds; 250 of 250 mutations killed on the final tree. Object cost: 14,690 to 34,937 objects for a 150 GiB tree (39,321,600 in the old layout); 3.2 objects per 20 KiB file through the mount with a commit per close. Risk: the layout freezes with this merge and every Volume written by any earlier build of this branch will not open (no migration; nothing in production writes any layout). Known limits, all in SPEC 11 with numbers: store calls have no deadlines, so while the store is stalled every call that needs it waits and SIGKILL frees no caller (kill the daemon: ~20 ms, uncommitted writes lost); ~134 KiB per abandoned request; SIGTERM against a stalled store takes up to 21 s and exits non-zero; every close is a full commit (~143 files/s); rename, links, symlinks, chmod, chown, utimens, xattr, statfs and unlink-while-open are not built (git, tar, npm fail on the mount); no GC, quota or snapshots yet; tenants must not hold store write credentials. Not for tenant sandboxes until the journal integration, deadlines and a supervisor watchdog land. How to revert: revert this commit and retag the previous patch release. Volumes created by this build do not open in the code before it; copy their files out through a mount of this build first. Nothing else in the repository depends on the layout (the journal and tools packages are standalone). Claude-Session: https://claude.ai/code/session_015XYKLnBbrbajqj1GpRydF8