@git-stunts/git-cas 6.0.0 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ADVANCED_GUIDE.md CHANGED
@@ -144,9 +144,9 @@ When `normalized: true` (the default), a dual-mask strategy from the FastCDC
144
144
  paper is applied. Instead of a single mask, two masks control boundary
145
145
  probability relative to the current chunk length:
146
146
 
147
- | Region | Mask | Bits | Effect |
148
- | :--- | :--- | :--- | :--- |
149
- | Below target (`chunkLen < targetSize`) | `hardMask` | `bits + 1` | More bits required to match -- boundaries are **less likely**, pushing chunks larger |
147
+ | Region | Mask | Bits | Effect |
148
+ | :-------------------------------------------- | :--------- | :--------- | :------------------------------------------------------------------------------------------- |
149
+ | Below target (`chunkLen < targetSize`) | `hardMask` | `bits + 1` | More bits required to match -- boundaries are **less likely**, pushing chunks larger |
150
150
  | At or above target (`chunkLen >= targetSize`) | `easyMask` | `bits - 1` | Fewer bits required -- boundaries are **more likely**, pulling chunks back toward the target |
151
151
 
152
152
  Concrete formulas:
@@ -168,12 +168,12 @@ const chunker = new CdcChunker({ targetChunkSize: 262144, normalized: false });
168
168
 
169
169
  ### Default Parameters
170
170
 
171
- | Parameter | Default | Bounds |
172
- | :--- | :--- | :--- |
171
+ | Parameter | Default | Bounds |
172
+ | :---------------- | :---------------- | :---------------------------------------- |
173
173
  | `targetChunkSize` | 262,144 (256 KiB) | Must be in `[minChunkSize, maxChunkSize]` |
174
- | `minChunkSize` | 65,536 (64 KiB) | Must not exceed `maxChunkSize` |
175
- | `maxChunkSize` | 1,048,576 (1 MiB) | Hard cap at 100 MiB |
176
- | `normalized` | `true` | Boolean |
174
+ | `minChunkSize` | 65,536 (64 KiB) | Must not exceed `maxChunkSize` |
175
+ | `maxChunkSize` | 1,048,576 (1 MiB) | Hard cap at 100 MiB |
176
+ | `normalized` | `true` | Boolean |
177
177
 
178
178
  ### Encryption Penalty
179
179
 
@@ -286,12 +286,12 @@ frame sequence, so any such tampering causes GCM authentication failure.
286
286
 
287
287
  ### Scheme Selection
288
288
 
289
- | Scenario | Recommended Scheme |
290
- | :--- | :--- |
291
- | Fixed chunking + encryption | `framed` (default) |
292
- | Large assets needing streaming restore | `framed` |
293
- | CDC with encryption (dedup-preserving) | `convergent` |
294
- | Single-envelope simplicity | `whole` |
289
+ | Scenario | Recommended Scheme |
290
+ | :------------------------------------- | :----------------- |
291
+ | Fixed chunking + encryption | `framed` (default) |
292
+ | Large assets needing streaming restore | `framed` |
293
+ | CDC with encryption (dedup-preserving) | `convergent` |
294
+ | Single-envelope simplicity | `whole` |
295
295
 
296
296
  ### Auto-Selection
297
297
 
@@ -362,21 +362,22 @@ at both store time and restore time.
362
362
 
363
363
  ### PBKDF2-SHA512
364
364
 
365
- | Parameter | Default | Min | Max |
366
- | :--- | ---: | ---: | ---: |
367
- | `iterations` | 600,000 | 100,000 | 2,000,000 |
368
- | `keyLength` | 32 | -- | -- (locked) |
365
+ | Parameter | Default | Min | Max |
366
+ | :----------- | ------: | ------: | ----------: |
367
+ | `iterations` | 600,000 | 100,000 | 2,000,000 |
368
+ | `keyLength` | 32 | -- | -- (locked) |
369
369
 
370
370
  ### scrypt
371
371
 
372
- | Parameter | Default | Min | Max |
373
- | :--- | ---: | ---: | ---: |
374
- | `cost` (N) | 131,072 (2^17) | 16,384 (2^14) | 1,048,576 (2^20) |
375
- | `blockSize` (r) | 8 | 8 | 32 |
376
- | `parallelization` (p) | 1 | 1 | 16 |
377
- | `keyLength` | 32 | -- | -- (locked) |
372
+ | Parameter | Default | Min | Max |
373
+ | :-------------------- | -------------: | ------------: | ---------------: |
374
+ | `cost` (N) | 131,072 (2^17) | 16,384 (2^14) | 1,048,576 (2^20) |
375
+ | `blockSize` (r) | 8 | 8 | 32 |
376
+ | `parallelization` (p) | 1 | 1 | 16 |
377
+ | `keyLength` | 32 | -- | -- (locked) |
378
378
 
379
379
  Additional constraints:
380
+
380
381
  - `cost` must be a power of two.
381
382
  - Combined scrypt memory budget `128 * N * r` is capped at **1 GiB**.
382
383
  - Salt must be at least **16 bytes** (128 bits), per NIST SP 800-132.
@@ -451,7 +452,10 @@ import { FixedChunker, NodeCompressionAdapter } from '@git-stunts/git-cas';
451
452
  import CasService from '@git-stunts/git-cas/service';
452
453
 
453
454
  const cas = new CasService({
454
- persistence, codec, crypto, observability,
455
+ persistence,
456
+ codec,
457
+ crypto,
458
+ observability,
455
459
  chunker: new FixedChunker({ chunkSize: 256 * 1024 }),
456
460
  compressionAdapter: new NodeCompressionAdapter(),
457
461
  formatVersion: '6.0.0',
@@ -541,10 +545,13 @@ import { FixedChunker, NodeCompressionAdapter } from '@git-stunts/git-cas';
541
545
  import CasService from '@git-stunts/git-cas/service';
542
546
 
543
547
  const cas = new CasService({
544
- persistence, codec, crypto, observability,
548
+ persistence,
549
+ codec,
550
+ crypto,
551
+ observability,
545
552
  chunker: new FixedChunker({ chunkSize: 256 * 1024 }),
546
553
  compressionAdapter: new NodeCompressionAdapter(),
547
- concurrency: 8, // up to 8 parallel chunk reads
554
+ concurrency: 8, // up to 8 parallel chunk reads
548
555
  });
549
556
  ```
550
557
 
@@ -614,13 +621,16 @@ with opaque HMAC digests.
614
621
  ### How It Works
615
622
 
616
623
  1. **Privacy key derivation**:
624
+
617
625
  ```
618
626
  privacyKey = HMAC-SHA256(vaultEncryptionKey, "git-cas-privacy-v1")
619
627
  ```
628
+
620
629
  The 32-byte privacy key is derived deterministically from the vault
621
630
  encryption key using a fixed label.
622
631
 
623
632
  2. **Tree entry masking**: each slug is replaced with its HMAC:
633
+
624
634
  ```
625
635
  treeName = hex(HMAC-SHA256(privacyKey, slug)) // 64-char lowercase hex
626
636
  ```
@@ -667,7 +677,7 @@ await cas.store({
667
677
  filename: 'photo.raw',
668
678
  recipients: [
669
679
  { label: 'alice', key: aliceKek },
670
- { label: 'bob', key: bobKek },
680
+ { label: 'bob', key: bobKek },
671
681
  ],
672
682
  });
673
683
  ```
@@ -771,7 +781,10 @@ import { FixedChunker } from '@git-stunts/git-cas';
771
781
  import CasService from '@git-stunts/git-cas/service';
772
782
 
773
783
  const cas = new CasService({
774
- persistence, codec, crypto, observability,
784
+ persistence,
785
+ codec,
786
+ crypto,
787
+ observability,
775
788
  chunker: new FixedChunker({ chunkSize: 256 * 1024 }),
776
789
  compressionAdapter: new MyBrotliAdapter(),
777
790
  });
@@ -820,14 +833,14 @@ const service = new CasService({
820
833
 
821
834
  ### Required Port Shape
822
835
 
823
- | Port | Required Surface | Notes |
824
- | :--- | :--- | :--- |
825
- | `GitPersistencePort` | `writeBlob`, `writeTree`, `readBlob`, `readBlobStream`, `readTree` | Return and consume `Uint8Array` streams; `readBlobStream()` is required for bounded restore paths. |
826
- | `CodecPort` | `encode`, `decode`, `extension` | `encode()` must return `Uint8Array`; JSON and CBOR are built in. |
827
- | `CryptoPort` | SHA-256, random bytes, AES-GCM buffer/stream methods, nonce/tag helpers, HMAC, KDF | `scrypt` support is runtime-dependent; Web Crypto adapters report capability errors where unsupported. |
828
- | `ObservabilityPort` | `metric`, `log`, `span` | Use `SilentObserver`, `EventEmitterObserver`, or `StatsCollector` unless you need custom telemetry. |
829
- | `ChunkingPort` | `chunk(source)`, `strategy`, `params` | Use `FixedChunker` or `CdcChunker`; direct service callers must inject one. |
830
- | `CompressionPort` | `compressBuffer`, `decompressBuffer`, `compressStream`, `decompressStream` | Direct service callers must inject one even if stores do not request compression. |
836
+ | Port | Required Surface | Notes |
837
+ | :------------------- | :--------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------- |
838
+ | `GitPersistencePort` | `writeBlob`, `writeTree`, `readBlob`, `readBlobStream`, `readTree` | Return and consume `Uint8Array` streams; `readBlobStream()` is required for bounded restore paths. |
839
+ | `CodecPort` | `encode`, `decode`, `extension` | `encode()` must return `Uint8Array`; JSON and CBOR are built in. |
840
+ | `CryptoPort` | SHA-256, random bytes, AES-GCM buffer/stream methods, nonce/tag helpers, HMAC, KDF | `scrypt` support is runtime-dependent; Web Crypto adapters report capability errors where unsupported. |
841
+ | `ObservabilityPort` | `metric`, `log`, `span` | Use `SilentObserver`, `EventEmitterObserver`, or `StatsCollector` unless you need custom telemetry. |
842
+ | `ChunkingPort` | `chunk(source)`, `strategy`, `params` | Use `FixedChunker` or `CdcChunker`; direct service callers must inject one. |
843
+ | `CompressionPort` | `compressBuffer`, `decompressBuffer`, `compressStream`, `decompressStream` | Direct service callers must inject one even if stores do not request compression. |
831
844
 
832
845
  The public byte contract is `Uint8Array`. Node `Buffer` values work at Node
833
846
  boundaries because `Buffer` extends `Uint8Array`, but custom adapters should
@@ -855,22 +868,30 @@ and keeps runtime-specific imports out of the domain.
855
868
  The following security fixes have been applied across the release line. Each
856
869
  row describes the fix and what it prevents.
857
870
 
858
- | # | Fix | Prevents |
859
- | :--- | :--- | :--- |
860
- | 1 | Encrypted manifest metadata downgrade rejection | Attacker strips `encrypted: true` to bypass decryption |
861
- | 2 | Algorithm allowlist (`aes-256-gcm` only) | Attacker substitutes a weaker or non-existent algorithm |
862
- | 3 | Nonce/tag format validation (canonical base64, correct byte length) | Malformed metadata crashes the runtime or produces garbage |
863
- | 4 | Framed record parse hardening (`ciphertextLength <= frameBytes`) | Oversized length field causes unbounded allocation |
864
- | 5 | `maxRestoreBufferSize` enforcement for buffered `restore()` / `restoreStream()` paths | Unbounded memory allocation on large encrypted/compressed memory restores |
865
- | 6 | `maxEncryptionBufferSize` / `maxDecryptionBufferSize` for Web Crypto | One-shot Web Crypto API exhausts memory on large payloads |
866
- | 7 | KDF policy enforcement (bounded iterations, cost, salt, keyLength) | Attacker-controlled manifest requests extreme KDF work or weak params |
867
- | 8 | Manifest integrity hash (`manifestHash` field) | Silent manifest corruption or codec round-trip bugs |
868
- | 9 | CDC + encryption dedup warning | False confidence in dedup savings when ciphertext is pseudorandom |
869
- | 10 | Orphaned blob tracking on `STREAM_ERROR` / `STORE_ERROR` | Lost blob OIDs after partial store failures |
870
- | 11 | AAD binding (always active on all schemes) | Cross-manifest blob substitution and frame reordering attacks |
871
- | 12 | Legacy scheme rejection at runtime | Downgrade to weaker v1/v2 scheme variants |
872
- | 13 | Convergent encryption post-decrypt digest verification | Chunk substitution or corruption after decryption |
873
- | 14 | Encrypted vault key verifier in `.vault.json` | Wrong passphrase accepted for an empty encrypted vault |
871
+ | # | Fix | Prevents |
872
+ | :-- | :------------------------------------------------------------------------------------ | :------------------------------------------------------------------------ |
873
+ | 1 | Encrypted manifest metadata downgrade rejection | Attacker strips `encrypted: true` to bypass decryption |
874
+ | 2 | Algorithm allowlist (`aes-256-gcm` only) | Attacker substitutes a weaker or non-existent algorithm |
875
+ | 3 | Nonce/tag format validation (canonical base64, correct byte length) | Malformed metadata crashes the runtime or produces garbage |
876
+ | 4 | Framed record parse hardening (`ciphertextLength <= frameBytes`) | Oversized length field causes unbounded allocation |
877
+ | 5 | `maxRestoreBufferSize` enforcement for buffered `restore()` / `restoreStream()` paths | Unbounded memory allocation on large encrypted/compressed memory restores |
878
+ | 6 | `maxEncryptionBufferSize` / `maxDecryptionBufferSize` for Web Crypto | One-shot Web Crypto API exhausts memory on large payloads |
879
+ | 7 | KDF policy enforcement (bounded iterations, cost, salt, keyLength) | Attacker-controlled manifest requests extreme KDF work or weak params |
880
+ | 8 | Manifest integrity hash (`manifestHash` field) | Silent manifest corruption or codec round-trip bugs |
881
+ | 9 | CDC + encryption dedup warning | False confidence in dedup savings when ciphertext is pseudorandom |
882
+ | 10 | Orphaned blob tracking on `STREAM_ERROR` / `STORE_ERROR` | Lost blob OIDs after partial store failures |
883
+ | 11 | AAD binding (always active on all schemes) | Cross-manifest blob substitution and frame reordering attacks |
884
+ | 12 | Legacy scheme rejection at runtime | Downgrade to weaker v1/v2 scheme variants |
885
+ | 13 | Convergent encryption post-decrypt digest verification | Chunk substitution or corruption after decryption |
886
+ | 14 | Encrypted vault key verifier in `.vault.json` | Wrong passphrase accepted for an empty encrypted vault |
887
+ | 15 | `restoreFile()` `baseDirectory` boundary | Path traversal outside the trusted restore root |
888
+ | 16 | Metadata blob `maxBlobSize` limit | Oversized manifest or sub-manifest blobs exhausting memory |
889
+ | 17 | Concurrency cap | Unbounded parallel Git/blob operations |
890
+ | 18 | `frameBytes` cap | Oversized framed records causing memory pressure |
891
+ | 19 | Source validation before `store()` processing | Late failures after partial writes from invalid async iterables |
892
+ | 20 | Salt length enforcement | Weak KDF metadata accepted from stored manifests or vault metadata |
893
+ | 21 | Vault encryption-count tracking | Silent drift toward nonce reuse risk |
894
+ | 22 | Constant-time recipient and verifier comparisons | Timing-based key or verifier identification |
874
895
 
875
896
  ---
876
897
 
@@ -926,10 +947,10 @@ should not be treated as source truth when the working tree has moved.
926
947
 
927
948
  The following baselines are published for the current release line.
928
949
 
929
- | Strategy | Asset Size | Total Chunks | Store (ms) | Restore (ms) | Dedupe (%) |
930
- | :--- | :--- | :--- | :--- | :--- | :--- |
931
- | **Fixed (256K)** | 100 MiB | 400 | ~450 | ~300 | 0% |
932
- | **CDC (256K avg)** | 100 MiB | ~390 | ~1200 | ~350 | 98%+ |
950
+ | Strategy | Asset Size | Total Chunks | Store (ms) | Restore (ms) | Dedupe (%) |
951
+ | :----------------- | :--------- | :----------- | :--------- | :----------- | :--------- |
952
+ | **Fixed (256K)** | 100 MiB | 400 | ~450 | ~300 | 0% |
953
+ | **CDC (256K avg)** | 100 MiB | ~390 | ~1200 | ~350 | 98%+ |
933
954
 
934
955
  **Notes:**
935
956
 
@@ -958,45 +979,45 @@ Direct `CasService` constructor options with types, defaults, and bounds. The
958
979
  high-level `ContentAddressableStore` facade supplies defaults for `chunker`,
959
980
  `compressionAdapter`, runtime crypto, and `formatVersion`.
960
981
 
961
- | Option | Type | Default | Bounds | Description |
962
- | :--- | :--- | :--- | :--- | :--- |
963
- | `persistence` | `GitPersistencePort` | *required* | -- | Git blob/tree read/write adapter |
964
- | `codec` | `CodecPort` | *required* | -- | Manifest serialization (JSON or CBOR) |
965
- | `crypto` | `CryptoPort` | *required* | -- | Encryption, hashing, KDF adapter |
966
- | `observability` | `ObservabilityPort` | *required* | Must implement `metric()`, `log()`, `span()` | Metrics, logging, tracing |
967
- | `chunkSize` | `number` | `262144` (256 KiB) | Integer in `[1024, 104857600]` (1 KiB -- 100 MiB) | Chunk size for fixed chunking; warning above 10 MiB |
968
- | `merkleThreshold` | `number` | `1000` | Integer >= 1 | Chunk count above which Merkle manifests are used |
969
- | `concurrency` | `number` | `1` | Integer in `[1, 64]` | Max parallel chunk I/O operations (PrefetchWindow size) |
970
- | `chunker` | `ChunkingPort` | *required* | -- | Chunking strategy instance (`FixedChunker` or `CdcChunker`) |
971
- | `maxRestoreBufferSize` | `number` | `536870912` (512 MiB) | Integer >= 1024 | Max bytes for buffered restore (encrypted/compressed) |
972
- | `compressionAdapter` | `CompressionPort` | *required* | -- | Compression implementation |
973
- | `formatVersion` | `string` | -- | Semver (`/^\d+\.\d+\.\d+$/`) | Version stamp for new manifests (distinct from structural `version`) |
982
+ | Option | Type | Default | Bounds | Description |
983
+ | :--------------------- | :------------------- | :-------------------- | :------------------------------------------------ | :------------------------------------------------------------------- |
984
+ | `persistence` | `GitPersistencePort` | _required_ | -- | Git blob/tree read/write adapter |
985
+ | `codec` | `CodecPort` | _required_ | -- | Manifest serialization (JSON or CBOR) |
986
+ | `crypto` | `CryptoPort` | _required_ | -- | Encryption, hashing, KDF adapter |
987
+ | `observability` | `ObservabilityPort` | _required_ | Must implement `metric()`, `log()`, `span()` | Metrics, logging, tracing |
988
+ | `chunkSize` | `number` | `262144` (256 KiB) | Integer in `[1024, 104857600]` (1 KiB -- 100 MiB) | Chunk size for fixed chunking; warning above 10 MiB |
989
+ | `merkleThreshold` | `number` | `1000` | Integer >= 1 | Chunk count above which Merkle manifests are used |
990
+ | `concurrency` | `number` | `1` | Integer in `[1, 64]` | Max parallel chunk I/O operations (PrefetchWindow size) |
991
+ | `chunker` | `ChunkingPort` | _required_ | -- | Chunking strategy instance (`FixedChunker` or `CdcChunker`) |
992
+ | `maxRestoreBufferSize` | `number` | `536870912` (512 MiB) | Integer >= 1024 | Max bytes for buffered restore (encrypted/compressed) |
993
+ | `compressionAdapter` | `CompressionPort` | _required_ | -- | Compression implementation |
994
+ | `formatVersion` | `string` | -- | Semver (`/^\d+\.\d+\.\d+$/`) | Version stamp for new manifests (distinct from structural `version`) |
974
995
 
975
996
  ### store() Options
976
997
 
977
- | Option | Type | Default | Description |
978
- | :--- | :--- | :--- | :--- |
979
- | `source` | `AsyncIterable<Uint8Array>` | *required* | Input byte stream |
980
- | `slug` | `string` | *required* | Asset identifier |
981
- | `filename` | `string` | *required* | Original filename |
982
- | `encryptionKey` | `Uint8Array` | -- | 32-byte key (mutually exclusive with `passphrase` and `recipients`) |
983
- | `passphrase` | `string` | -- | Derive key via KDF (mutually exclusive with `encryptionKey` and `recipients`) |
984
- | `encryption` | `object` | -- | `{ scheme?, frameBytes?, convergent? }` |
985
- | `encryption.scheme` | `string` | Auto: `convergent` for CDC, `framed` otherwise | `'whole'`, `'framed'`, or `'convergent'` |
986
- | `encryption.frameBytes` | `number` | `65536` (64 KiB) | Frame size for the `framed` scheme; max 64 MiB |
987
- | `encryption.convergent` | `boolean` | -- | Explicit convergent opt-in/opt-out (auto-selected for CDC chunkers) |
988
- | `kdfOptions` | `object` | -- | `{ algorithm?, iterations?, cost?, blockSize?, parallelization? }` |
989
- | `compression` | `object` | -- | `{ algorithm: 'gzip' }` |
990
- | `recipients` | `Array<{label, key}>` | -- | Envelope recipients (mutually exclusive with key/passphrase) |
998
+ | Option | Type | Default | Description |
999
+ | :---------------------- | :-------------------------- | :--------------------------------------------- | :---------------------------------------------------------------------------- |
1000
+ | `source` | `AsyncIterable<Uint8Array>` | _required_ | Input byte stream |
1001
+ | `slug` | `string` | _required_ | Asset identifier |
1002
+ | `filename` | `string` | _required_ | Original filename |
1003
+ | `encryptionKey` | `Uint8Array` | -- | 32-byte key (mutually exclusive with `passphrase` and `recipients`) |
1004
+ | `passphrase` | `string` | -- | Derive key via KDF (mutually exclusive with `encryptionKey` and `recipients`) |
1005
+ | `encryption` | `object` | -- | `{ scheme?, frameBytes?, convergent? }` |
1006
+ | `encryption.scheme` | `string` | Auto: `convergent` for CDC, `framed` otherwise | `'whole'`, `'framed'`, or `'convergent'` |
1007
+ | `encryption.frameBytes` | `number` | `65536` (64 KiB) | Frame size for the `framed` scheme; max 64 MiB |
1008
+ | `encryption.convergent` | `boolean` | -- | Explicit convergent opt-in/opt-out (auto-selected for CDC chunkers) |
1009
+ | `kdfOptions` | `object` | -- | `{ algorithm?, iterations?, cost?, blockSize?, parallelization? }` |
1010
+ | `compression` | `object` | -- | `{ algorithm: 'gzip' }` |
1011
+ | `recipients` | `Array<{label, key}>` | -- | Envelope recipients (mutually exclusive with key/passphrase) |
991
1012
 
992
1013
  ### CdcChunker Options
993
1014
 
994
- | Option | Type | Default | Bounds | Description |
995
- | :--- | :--- | :--- | :--- | :--- |
996
- | `targetChunkSize` | `number` | `262144` | Must be in `[min, max]` | Target average chunk size |
997
- | `minChunkSize` | `number` | `65536` | Must not exceed `maxChunkSize` | Minimum chunk size |
998
- | `maxChunkSize` | `number` | `1048576` | Hard cap at 100 MiB | Maximum chunk size |
999
- | `normalized` | `boolean` | `true` | -- | Enable FastCDC dual-mask normalization |
1015
+ | Option | Type | Default | Bounds | Description |
1016
+ | :---------------- | :-------- | :-------- | :----------------------------- | :------------------------------------- |
1017
+ | `targetChunkSize` | `number` | `262144` | Must be in `[min, max]` | Target average chunk size |
1018
+ | `minChunkSize` | `number` | `65536` | Must not exceed `maxChunkSize` | Minimum chunk size |
1019
+ | `maxChunkSize` | `number` | `1048576` | Hard cap at 100 MiB | Maximum chunk size |
1020
+ | `normalized` | `boolean` | `true` | -- | Enable FastCDC dual-mask normalization |
1000
1021
 
1001
1022
  ---
1002
1023
 
package/ARCHITECTURE.md CHANGED
@@ -116,6 +116,7 @@ The public entrypoint is [index.js](./index.js).
116
116
  - wires persistence, ref, codec, crypto, chunking, compression, and
117
117
  observability adapters
118
118
  - exposes convenience methods like `storeFile()` and `restoreFile()`
119
+ - exposes `rootSets.open()` for mutable current-generation Git reachability
119
120
 
120
121
  The facade is orchestration glue. It is not the storage engine itself.
121
122
 
@@ -138,6 +139,12 @@ The facade is orchestration glue. It is not the storage engine itself.
138
139
  `VaultPrivacyIndex`, vault-key verification to `VaultKeyVerifier`, retry timing
139
140
  to `VaultMutationRetryPolicy`, and slug validation to `Slug`.
140
141
 
142
+ - **`RootSetRegistry` and `RootSet`** — open and mutate caller-owned refs under
143
+ `refs/cas/rootsets/*`. Root-set mutations retain only the current generation,
144
+ validate target existence and type, and use bounded compare-and-swap retries.
145
+ `RootSetPersistence`, `RootSetMetadataCodec`, and `RootSetTreeCodec` own the
146
+ ref, metadata, and real Git reachability boundaries.
147
+
141
148
  - **`KeyResolver`** — resolves key sources: passphrase-derived keys via KDF,
142
149
  envelope recipient DEK wrapping and unwrapping. `CasService` delegates all key
143
150
  material resolution through `this.keyResolver`.
@@ -190,7 +197,9 @@ The facade is orchestration glue. It is not the storage engine itself.
190
197
 
191
198
  - **`Manifest`** — immutable representation of stored asset metadata.
192
199
  - **`Chunk`** — immutable representation of one manifest chunk entry.
193
- - **`Oid`** — immutable Git object identifier value with 40-hex validation.
200
+ - **`Oid`** — immutable Git object identifier value with 40- or 64-hex
201
+ validation.
202
+ - **`RootSetRef`** — immutable validated ref below `refs/cas/rootsets/`.
194
203
  - **`Slug`** — immutable vault slug representation. It enforces vault slug
195
204
  limits and exposes `.toTreePath()` for the percent-encoded Git tree-entry name
196
205
  used by plain vault trees.
@@ -232,8 +241,8 @@ with methods that throw "not implemented" by default.
232
241
  mode.
233
242
  - **`GitPersistencePort`** — blob read/write, tree read/write, and
234
243
  `readBlobStream` for streaming chunk retrieval.
235
- - **`GitRefPort`** — ref resolution, commit creation, and compare-and-swap ref
236
- updates.
244
+ - **`GitRefPort`** — ref/tree/parent resolution, commit creation, and
245
+ compare-and-swap ref updates.
237
246
  - **`ChunkingPort`** — strategy interface for fixed-size and content-defined
238
247
  chunking.
239
248
  - **`CodecPort`** — manifest serialization and deserialization.
package/CHANGELOG.md CHANGED
@@ -5,7 +5,82 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [6.0.0] — Unreleased
8
+ ## [Unreleased]
9
+
10
+ ## [6.1.0] — 2026-07-11
11
+
12
+ ### Added
13
+
14
+ - **Mutable GC-safe root sets** — `cas.rootSets.open()` now anchors named blob
15
+ and tree OIDs under `refs/cas/rootsets/*` while entries are live. Root-set
16
+ generations use parentless commits so removed targets can become prunable
17
+ instead of remaining reachable through storage history.
18
+ - **Root-set doctor and repair** — root sets validate ref, metadata, tree-edge,
19
+ target-existence, and target-type truth; report retention policy separately
20
+ from Git reachability; and can rebuild a malformed head from an authoritative
21
+ live-entry list.
22
+ - **Root-set compare-and-swap mutations** — `put()`, `remove()`, `replace()`,
23
+ and `mutate()` use bounded conflict retries without silently losing
24
+ concurrent updates.
25
+ - **GitHub tracker templates** — added issue forms for goalposts, slices, bugs,
26
+ debt, and ideas, plus a pull request template that links issues, design proof,
27
+ validation, and release impact.
28
+
29
+ ### Changed
30
+
31
+ - **Git object type port** — `GitPersistencePort.readObjectType()` and the Git
32
+ adapter now inspect target type without materializing object content.
33
+ - **GitHub Issues as canonical tracker** — release milestones, goalposts, slices,
34
+ and follow-on work now live in GitHub Issues and Milestones. Repo Markdown
35
+ carries design docs, witnesses, release history, public docs, and archived
36
+ planning source material, but does not own the active queue.
37
+ - **Root-doc accuracy cleanup** — the README product statement is now
38
+ version-neutral, `STATUS.md` records the latest docs validation snapshot,
39
+ `CLAUDE.md` delegates to `AGENTS.md`, and the stale root `GRAVEYARD.md` file
40
+ has been removed.
41
+ - **6.1.0 release verification** — `npm run release:verify -- --skip-jsr`
42
+ passed 12/12 steps with 5,521 observed tests across Node, Bun, Deno, and all
43
+ three integration runtimes. JSR remains intentionally skipped behind the
44
+ documented upstream toolchain gate.
45
+
46
+ ## [6.0.1] — 2026-06-13
47
+
48
+ ### Added
49
+
50
+ - **Per-operation chunking overrides** — `ContentAddressableStore.store()` and
51
+ `storeFile()` now accept a `chunking` option for a single operation, allowing
52
+ CDC or fixed chunking without mutating the facade's default chunker.
53
+ - **Active release-doc drift guard** — active release documents now have a unit
54
+ guard against stale pre-v6.0.0 claims resurfacing after publication.
55
+
56
+ ### Changed
57
+
58
+ - **Release workflow future-runtime hardening** — The GitHub Release job now
59
+ opts JavaScript actions into the Node 24 action runtime so GitHub's Node 20
60
+ action deprecation warning is caught before it becomes a release blocker.
61
+ - **README front-door trim** — The README now stays focused on positioning,
62
+ quick start, capability routing, safety posture, runtime support, and doc
63
+ navigation. Dense restore streaming detail moved to `GUIDE.md`, while the
64
+ security hardening table in `ADVANCED_GUIDE.md` now carries the detailed
65
+ limits previously summarized in the README.
66
+ - **Post-v6 planning truth** — `STATUS.md`, `ROADMAP.md`, `BEARING.md`, and the
67
+ METHOD backlog now describe `v6.0.x` maintenance rather than the completed
68
+ `v6.0.0` pre-tag state.
69
+ - **6.0.1 release verification** — `npm run release:verify -- --skip-jsr`
70
+ passed 12/12 steps with 5,383 observed tests. JSR remains intentionally
71
+ skipped for this patch line.
72
+
73
+ ### Fixed
74
+
75
+ - **TUI Store Wizard execution** — the Operations workspace Store Wizard now
76
+ threads passphrase encryption, forced convergent encryption, gzip
77
+ compression, and fixed/CDC chunking into the actual `storeFile()` call before
78
+ publishing the manifest tree to the vault.
79
+ - **Store Wizard state flow** — passphrase and convergent selections collect a
80
+ passphrase before the compression step, and the wizard step count remains
81
+ contiguous when encryption is skipped.
82
+
83
+ ## [6.0.0] — 2026-05-09
9
84
 
10
85
  ### Breaking Changes
11
86
 
@@ -279,8 +354,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
279
354
 
280
355
  ### Fixed
281
356
 
282
- - **Agent diagnostic passphrase resolver guard** — encrypted `git cas agent
283
- doctor` requests now fail with a controlled credential error when a structured
357
+ - **Agent diagnostic passphrase resolver guard** — encrypted `git cas agent doctor`
358
+ requests now fail with a controlled credential error when a structured
284
359
  passphrase source is supplied without the resolver dependency.
285
360
  - **Doctor byte dedupe metric** — vault health statistics now compute byte
286
361
  dedupe from stored chunk bytes instead of logical file size, keeping