@git-stunts/git-cas 5.3.2 → 6.0.1

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.
Files changed (173) hide show
  1. package/ADVANCED_GUIDE.md +1027 -0
  2. package/ARCHITECTURE.md +514 -0
  3. package/CHANGELOG.md +449 -5
  4. package/CODE_OF_CONDUCT.md +33 -0
  5. package/GUIDE.md +926 -0
  6. package/README.md +106 -366
  7. package/SECURITY.md +993 -0
  8. package/SUPPORT.md +54 -0
  9. package/UPGRADING.md +299 -0
  10. package/bin/actions.js +70 -21
  11. package/bin/agent/cli.js +51 -0
  12. package/bin/agent/commands/doctor.js +99 -0
  13. package/bin/agent/commands/index.js +1489 -0
  14. package/bin/agent/input.js +619 -0
  15. package/bin/agent/passphrase-source.js +123 -0
  16. package/bin/agent/protocol.js +193 -0
  17. package/bin/build-version.js +64 -0
  18. package/bin/credentials.js +425 -0
  19. package/bin/git-cas.js +595 -449
  20. package/bin/passphrase-source.js +266 -0
  21. package/bin/restore-output-target.js +28 -0
  22. package/bin/ui/blocks/asset-card.js +109 -0
  23. package/bin/ui/blocks/health-dashboard.js +149 -0
  24. package/bin/ui/blocks/heatmap-block.js +67 -0
  25. package/bin/ui/blocks/merkle-explorer.js +163 -0
  26. package/bin/ui/blocks/operation-feed.js +176 -0
  27. package/bin/ui/blocks/wizard-block.js +168 -0
  28. package/bin/ui/components/short-sha.js +36 -0
  29. package/bin/ui/context.js +56 -1
  30. package/bin/ui/dashboard-cmds.js +1578 -13
  31. package/bin/ui/dashboard-view.js +612 -145
  32. package/bin/ui/dashboard.js +1255 -212
  33. package/bin/ui/encryption-card.js +69 -26
  34. package/bin/ui/heatmap.js +26 -54
  35. package/bin/ui/history-timeline.js +51 -19
  36. package/bin/ui/manifest-view.js +115 -60
  37. package/bin/ui/merkle-dag.js +83 -0
  38. package/bin/ui/progress.js +15 -9
  39. package/bin/ui/repo-treemap.js +328 -0
  40. package/bin/ui/shaders/bak-sneppen.js +180 -0
  41. package/bin/ui/shaders/fractal-zoom.js +99 -0
  42. package/bin/ui/shaders/merkle-tree.js +142 -0
  43. package/bin/ui/shaders/organic-flow.js +96 -0
  44. package/bin/ui/shaders/phase-portrait.js +93 -0
  45. package/bin/ui/store-wizard.js +367 -0
  46. package/bin/ui/theme.js +155 -0
  47. package/bin/ui/vault-report.js +495 -0
  48. package/build-info.json +4 -0
  49. package/docs/API.md +2254 -0
  50. package/docs/ENCRYPTION_MODES.md +33 -0
  51. package/docs/EXTENDING.md +174 -0
  52. package/docs/STORE_RESTORE_PIPELINE.md +199 -0
  53. package/docs/THREAT_MODEL.md +269 -0
  54. package/docs/VAULT_INTERNALS.md +251 -0
  55. package/docs/WALKTHROUGH.md +1868 -0
  56. package/docs/demo.gif +0 -0
  57. package/docs/releases/v6.0.0.md +104 -0
  58. package/examples/README.md +260 -0
  59. package/index.d.ts +273 -80
  60. package/index.js +220 -59
  61. package/package.json +35 -6
  62. package/scripts/migrate-encryption.js +680 -0
  63. package/src/domain/bytes/ByteLayout.js +96 -0
  64. package/src/domain/encoding/base64.js +91 -0
  65. package/src/domain/encoding/hex.js +14 -0
  66. package/src/domain/encoding/utf8.js +123 -0
  67. package/src/domain/encryption/schemes.js +132 -0
  68. package/src/domain/errors/CannotRemoveLastRecipientError.js +10 -0
  69. package/src/domain/errors/CasError.d.ts +28 -0
  70. package/src/domain/errors/CasError.js +43 -6
  71. package/src/domain/errors/Codes.js +54 -0
  72. package/src/domain/errors/DekUnwrapFailedError.js +10 -0
  73. package/src/domain/errors/GitError.js +10 -0
  74. package/src/domain/errors/GitPlumbingInitializationError.js +10 -0
  75. package/src/domain/errors/IntegrityError.js +10 -0
  76. package/src/domain/errors/InvalidChunkingStrategyError.js +10 -0
  77. package/src/domain/errors/InvalidOidError.js +10 -0
  78. package/src/domain/errors/InvalidOptionsError.js +10 -0
  79. package/src/domain/errors/ManifestIntegrityError.js +10 -0
  80. package/src/domain/errors/ManifestNotFoundError.js +10 -0
  81. package/src/domain/errors/NoMatchingRecipientError.js +10 -0
  82. package/src/domain/errors/PersistenceCapabilityRequiredError.js +10 -0
  83. package/src/domain/errors/PortNotImplementedError.js +10 -0
  84. package/src/domain/errors/RecipientAlreadyExistsError.js +10 -0
  85. package/src/domain/errors/RecipientNotFoundError.js +10 -0
  86. package/src/domain/errors/RestoreTooLargeError.js +10 -0
  87. package/src/domain/errors/RotationNotSupportedError.js +10 -0
  88. package/src/domain/errors/createCasError.js +68 -0
  89. package/src/domain/errors/index.js +20 -0
  90. package/src/domain/helpers/buildKdfMetadata.js +4 -2
  91. package/src/domain/helpers/codecBytes.js +34 -0
  92. package/src/domain/helpers/gitRefErrors.js +84 -0
  93. package/src/domain/helpers/scryptMaxmem.js +22 -0
  94. package/src/domain/outcomes/RestoreFailure.js +15 -0
  95. package/src/domain/outcomes/RestoreOutcome.js +11 -0
  96. package/src/domain/outcomes/RestoreSuccess.js +34 -0
  97. package/src/domain/outcomes/StoreFailure.js +15 -0
  98. package/src/domain/outcomes/StoreOutcome.js +11 -0
  99. package/src/domain/outcomes/StoreSuccess.js +17 -0
  100. package/src/domain/schemas/ManifestSchema.d.ts +40 -9
  101. package/src/domain/schemas/ManifestSchema.js +67 -13
  102. package/src/domain/services/CasService.d.ts +153 -53
  103. package/src/domain/services/CasService.js +322 -837
  104. package/src/domain/services/ChunkRepository.js +268 -0
  105. package/src/domain/services/CompressionStreams.js +72 -0
  106. package/src/domain/services/ConvergentEncryption.js +128 -0
  107. package/src/domain/services/GitTreeBuilder.js +86 -0
  108. package/src/domain/services/IntegrityVerifier.js +199 -0
  109. package/src/domain/services/KeyResolver.js +49 -42
  110. package/src/domain/services/ManifestDiff.js +56 -0
  111. package/src/domain/services/ManifestRepository.js +286 -0
  112. package/src/domain/services/PrefetchWindow.js +48 -0
  113. package/src/domain/services/RecipientService.js +157 -0
  114. package/src/domain/services/RedactingObservability.js +169 -0
  115. package/src/domain/services/RestorePipeline.js +68 -0
  116. package/src/domain/services/StorePipeline.js +201 -0
  117. package/src/domain/services/VaultKeyVerifier.js +101 -0
  118. package/src/domain/services/VaultMetadataCodec.js +206 -0
  119. package/src/domain/services/VaultMutationRetryPolicy.js +105 -0
  120. package/src/domain/services/VaultPersistence.js +410 -0
  121. package/src/domain/services/VaultPrivacyIndex.js +191 -0
  122. package/src/domain/services/VaultService.js +749 -251
  123. package/src/domain/services/VaultStateCache.js +225 -0
  124. package/src/domain/services/VaultTreeCodec.js +121 -0
  125. package/src/domain/services/rotateVaultPassphrase.js +37 -20
  126. package/src/domain/strategies/Aad.js +39 -0
  127. package/src/domain/strategies/FramedRecordCodec.js +204 -0
  128. package/src/domain/strategies/RestoreCompressed.js +40 -0
  129. package/src/domain/strategies/RestoreConvergent.js +44 -0
  130. package/src/domain/strategies/RestoreFramed.js +55 -0
  131. package/src/domain/strategies/RestorePlain.js +37 -0
  132. package/src/domain/strategies/RestoreStrategy.js +35 -0
  133. package/src/domain/strategies/RestoreWhole.js +135 -0
  134. package/src/domain/strategies/StoreConvergent.js +28 -0
  135. package/src/domain/strategies/StoreFramed.js +39 -0
  136. package/src/domain/strategies/StorePlain.js +20 -0
  137. package/src/domain/strategies/StoreStrategy.js +61 -0
  138. package/src/domain/strategies/StoreWhole.js +34 -0
  139. package/src/domain/value-objects/Chunk.js +1 -2
  140. package/src/domain/value-objects/EncryptionMetadata.js +87 -0
  141. package/src/domain/value-objects/Manifest.d.ts +40 -4
  142. package/src/domain/value-objects/Manifest.js +61 -20
  143. package/src/domain/value-objects/Oid.js +45 -0
  144. package/src/domain/value-objects/Slug.js +124 -0
  145. package/src/domain/value-objects/StoreEncryptionConfig.js +114 -0
  146. package/src/helpers/aesGcmMeta.js +55 -0
  147. package/src/helpers/canonicalBase64.js +1 -0
  148. package/src/helpers/kdfPolicy.js +194 -0
  149. package/src/infrastructure/adapters/BunCryptoAdapter.js +124 -8
  150. package/src/infrastructure/adapters/FileIOHelper.js +180 -13
  151. package/src/infrastructure/adapters/GitPersistenceAdapter.js +235 -42
  152. package/src/infrastructure/adapters/GitPlumbingFactoryAdapter.js +62 -0
  153. package/src/infrastructure/adapters/GitRefAdapter.js +19 -6
  154. package/src/infrastructure/adapters/NodeCompressionAdapter.js +64 -0
  155. package/src/infrastructure/adapters/NodeCryptoAdapter.js +130 -10
  156. package/src/infrastructure/adapters/WebCryptoAdapter.js +187 -77
  157. package/src/infrastructure/chunkers/CdcChunker.js +53 -19
  158. package/src/infrastructure/chunkers/FixedChunker.js +15 -7
  159. package/src/infrastructure/chunkers/resolveChunker.js +10 -6
  160. package/src/infrastructure/codecs/CborCodec.js +3 -3
  161. package/src/infrastructure/codecs/JsonCodec.js +5 -5
  162. package/src/infrastructure/createGitPlumbing.js +22 -0
  163. package/src/package-version.js +1 -0
  164. package/src/ports/ChunkingPort.js +3 -3
  165. package/src/ports/CodecPort.js +4 -4
  166. package/src/ports/CompressionPort.js +57 -0
  167. package/src/ports/CryptoPort.js +138 -50
  168. package/src/ports/GitPersistencePort.js +32 -2
  169. package/src/ports/GitPlumbingFactoryPort.js +16 -0
  170. package/src/ports/GitRefPort.js +1 -1
  171. package/src/types/ambient.d.ts +10 -5
  172. package/test/CONVENTIONS.md +94 -0
  173. package/test/cycles/README.md +13 -0
package/CHANGELOG.md CHANGED
@@ -5,18 +5,416 @@ 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
- ## [5.3.2] — Unreleased
8
+ ## [Unreleased]
9
+
10
+ ### Added
11
+
12
+ - **GitHub tracker templates** — added issue forms for goalposts, slices, bugs,
13
+ debt, and ideas, plus a pull request template that links issues, design proof,
14
+ validation, and release impact.
15
+
16
+ ### Changed
17
+
18
+ - **GitHub Issues as canonical tracker** — release milestones, goalposts, slices,
19
+ and follow-on work now live in GitHub Issues and Milestones. Repo Markdown
20
+ carries design docs, witnesses, release history, public docs, and archived
21
+ planning source material, but does not own the active queue.
22
+ - **Root-doc accuracy cleanup** — the README product statement is now
23
+ version-neutral, `STATUS.md` records the latest docs validation snapshot,
24
+ `CLAUDE.md` delegates to `AGENTS.md`, and the stale root `GRAVEYARD.md` file
25
+ has been removed.
26
+
27
+ ## [6.0.1] — 2026-05-09
28
+
29
+ ### Added
30
+
31
+ - **Per-operation chunking overrides** — `ContentAddressableStore.store()` and
32
+ `storeFile()` now accept a `chunking` option for a single operation, allowing
33
+ CDC or fixed chunking without mutating the facade's default chunker.
34
+ - **Active release-doc drift guard** — active release documents now have a unit
35
+ guard against stale pre-v6.0.0 claims resurfacing after publication.
9
36
 
10
37
  ### Changed
38
+
39
+ - **Release workflow future-runtime hardening** — The GitHub Release job now
40
+ opts JavaScript actions into the Node 24 action runtime so GitHub's Node 20
41
+ action deprecation warning is caught before it becomes a release blocker.
42
+ - **README front-door trim** — The README now stays focused on positioning,
43
+ quick start, capability routing, safety posture, runtime support, and doc
44
+ navigation. Dense restore streaming detail moved to `GUIDE.md`, while the
45
+ security hardening table in `ADVANCED_GUIDE.md` now carries the detailed
46
+ limits previously summarized in the README.
47
+ - **Post-v6 planning truth** — `STATUS.md`, `ROADMAP.md`, `BEARING.md`, and the
48
+ METHOD backlog now describe `v6.0.x` maintenance rather than the completed
49
+ `v6.0.0` pre-tag state.
50
+ - **6.0.1 release verification** — `npm run release:verify -- --skip-jsr`
51
+ passed 12/12 steps with 5,383 observed tests. JSR remains intentionally
52
+ skipped for this patch line.
53
+
54
+ ### Fixed
55
+
56
+ - **TUI Store Wizard execution** — the Operations workspace Store Wizard now
57
+ threads passphrase encryption, forced convergent encryption, gzip
58
+ compression, and fixed/CDC chunking into the actual `storeFile()` call before
59
+ publishing the manifest tree to the vault.
60
+ - **Store Wizard state flow** — passphrase and convergent selections collect a
61
+ passphrase before the compression step, and the wizard step count remains
62
+ contiguous when encryption is skipped.
63
+
64
+ ## [6.0.0] — 2026-05-09
65
+
66
+ ### Breaking Changes
67
+
68
+ - **JSR publication deferred for v6.0.0** — The npm package and GitHub Release
69
+ are the release targets for v6.0.0. JSR metadata and the `jsr-publish`
70
+ verification step remain in the repository, while
71
+ `npm run release:verify -- --skip-jsr` records the skipped dry-run during the
72
+ upstream JSR/Deno toolchain blocker. Consumers of the
73
+ `@git-stunts/git-cas` JSR package should migrate to npm for v6.0.0 or stay on
74
+ the last JSR-published version.
75
+ - **Encryption scheme identifiers simplified** — `whole-v1`/`whole-v2` collapsed to `whole`, `framed-v1`/`framed-v2` collapsed to `framed`, `convergent-v1` collapsed to `convergent`. Legacy v1/v2 scheme strings in stored manifests now throw `LEGACY_SCHEME` at `readManifest()` time with migration guidance. The `scheme` field in `ManifestSchema` is now required for all encryption metadata (previously optional for backward-compatible schemeless whole manifests).
76
+ - **AAD is always on** — `whole` and `framed` encryption always bind slug-based AAD into the GCM tag. The v1 no-AAD path is removed.
77
+ - **Core byte contract is now `Uint8Array`** — public and port byte surfaces now accept and return `Uint8Array` rather than Node-specific `Buffer` types. Node callers can continue passing `Buffer` values because `Buffer` extends `Uint8Array`, but restored data, chunkers, codecs, and Web Crypto adapter outputs should be treated as `Uint8Array`.
78
+ - **`ContentAddressableStore.open()` is async** — callers must now use
79
+ `await ContentAddressableStore.open({ cwd })` so the `@git-stunts/plumbing`
80
+ v3 factory can validate the working directory and select the runtime runner
81
+ before returning the facade.
82
+ - **WebCryptoAdapter no longer falls back to Node for scrypt** — Web Crypto does not provide scrypt. The Web adapter now reports that capability gap instead of dynamically importing `node:crypto`.
83
+ - See [UPGRADING.md](./UPGRADING.md) for the full migration guide.
84
+
85
+ ### Added
86
+
87
+ - **Migration script (`npm run upgrade`)** — fully implemented `scripts/migrate-encryption.js` for v6.0.0 encryption scheme upgrades. Two modes: **fast** (rename-only for v2 schemes and `convergent-v1`) and **full** (re-encryption for v1 whole/framed schemes that lacked AAD). Supports `--execute` (default dry-run), `--passphrase-file`, `--key-file`, privacy-vault key options, and `--cwd`. Inline `--passphrase` and `--vault-passphrase` remain compatibility paths and now warn because command-line arguments can leak through shell history, process listings, CI logs, and terminal transcripts. Reads every vault entry, classifies it, and reports what will/did change.
88
+ - **`ContentAddressableStore.open({ cwd })`** — new default facade factory that
89
+ constructs the Git plumbing adapter for normal application setup.
90
+ - **Store/restore pipeline state-machine docs** — added
91
+ `docs/STORE_RESTORE_PIPELINE.md` as the maintainer map for store, restore,
92
+ tree publication, and vault boundaries.
93
+ - **Vault internals maintainer docs** — added
94
+ `docs/VAULT_INTERNALS.md` to document the vault collaborator model, cache
95
+ rules, boundary codecs, privacy index, key verifier, and retry policy.
96
+ - **Public `CasError` export** — `CasError` is now re-exported from the package
97
+ root for callers that need typed error handling without deep imports.
98
+ - **`CasService.readManifestRaw()`** — reads a manifest from a Git tree OID and returns the raw decoded object without Manifest construction or scheme assertion. Migration entry point for inspecting legacy manifests.
99
+ - **`CasService` `legacyMode` constructor option** — when `true`, `readManifest()` maps legacy scheme identifiers (v1/v2) to their current names instead of throwing `LEGACY_SCHEME`. Legacy v1 manifests (no AAD) are correctly decrypted without AAD during restore.
100
+ - **`mapToCurrentScheme()` and `isLegacyNoAad()` in `schemes.js`** — public helpers for mapping legacy scheme strings to current names and detecting v1 no-AAD schemes.
101
+ - **Convergent encryption (`convergent`)** — new per-chunk encryption scheme that preserves CDC deduplication across encrypted stores. Each chunk is encrypted with a deterministic key and nonce derived from its plaintext content hash via HMAC-SHA256, so identical plaintext chunks always produce identical ciphertext blobs that Git deduplicates at the object level. The scheme is the default when CDC chunking and encryption are both active. Opt out with `encryption: { convergent: false }`. Force it on any chunker with `encryption: { scheme: 'convergent' }` or `encryption: { convergent: true }`. Manifests record `{ scheme: 'convergent', algorithm: 'aes-256-gcm', encrypted: true }` with no per-chunk nonce or tag fields — those are derived from the existing `digest` field at restore time. The 16-byte GCM auth tag is appended to each blob.
102
+ - **`CryptoPort.encryptBufferWithNonce(buffer, key, nonce)`** — new abstract method for AES-256-GCM encryption with a caller-provided nonce. Implemented in `NodeCryptoAdapter`, `BunCryptoAdapter`, and `WebCryptoAdapter`. Used by convergent encryption for deterministic ciphertext.
103
+ - **`CryptoPort.decryptBufferWithNonceTag(buffer, key, nonce, tag)`** — new abstract method for AES-256-GCM decryption with explicit nonce and tag. Implemented in all three crypto adapters.
104
+ - **Vault privacy mode** — opt-in HMAC slug masking for vault tree entries. When enabled via `initVault({ passphrase, privacy: true })`, tree entry names become `HMAC-SHA256(privacyKey, slug)` (64-char hex), preventing metadata discovery by anyone with repo read access. A privacy key is derived deterministically from the vault encryption key via `HMAC-SHA256(encryptionKey, "git-cas-privacy-v1")`. An encrypted `.privacy-index` blob stores the slug-to-HMAC mapping for listing/enumeration. Privacy mode requires vault encryption. All public vault methods (`addToVault`, `removeFromVault`, `listVault`, `resolveVaultEntry`) accept an optional `encryptionKey` parameter for privacy-enabled vaults.
105
+ - **Encrypted vault passphrase verifier** — new encrypted vaults store an
106
+ AES-GCM verifier in `.vault.json`, `readState({ encryptionKey })` validates
107
+ it when a key is supplied, CLI/agent vault passphrase flows reject wrong
108
+ passphrases before accepting empty-vault writes, and legacy encrypted vaults
109
+ gain verifier metadata on the next keyed vault write.
110
+ - **`CryptoPort.hmacSha256(key, data)`** — new abstract method implemented by the runtime crypto adapters. Works across Node.js, Bun, and Web Crypto runtimes. Returns a 32-byte HMAC-SHA256 digest.
111
+ - **AES-GCM AAD (Additional Authenticated Data) support** — `CryptoPort`, `NodeCryptoAdapter`, `BunCryptoAdapter`, and `WebCryptoAdapter` now accept an optional `aad` parameter on `encryptBuffer`, `decryptBuffer`, `createEncryptionStream`, and `createDecryptionStream`. `whole` and `framed` stores always provide AAD from the manifest slug context so ciphertext cannot be moved across manifests without authentication failure. `_buildMeta` now defaults to the current `whole` scheme identifier.
112
+ - **Agent CLI OS-keychain passphrase sources** — `git cas agent` now accepts explicit OS-keychain passphrase lookup for vault-derived key flows, including `osKeychainTarget` / `osKeychainAccount` on store, restore, and vault init, plus distinct old/new keychain sources for vault rotation.
113
+ - **Framed authenticated encryption** — encrypted stores can opt into `encryption: { scheme: 'framed', frameBytes }`, which serializes independently authenticated AES-256-GCM records so `restoreStream()` and `restoreFile()` can emit verified plaintext incrementally instead of buffering the full ciphertext.
114
+ - **METHOD planning surface** — added [docs/method/process.md](./docs/method/process.md), [docs/method/release.md](./docs/method/release.md), METHOD backlog lanes, METHOD legends, retro and graveyard entrypoints, and the active cycle doc [docs/design/0020-method-adoption/adopt-method.md](./docs/design/0020-method-adoption/adopt-method.md) so fresh work now runs through one explicit method instead of the older legends/backlog workflow.
115
+ - **`git cas agent recipient ...`** — added machine-facing recipient inspection and mutation commands so Relay can list recipients and perform add/remove flows through structured protocol data instead of human CLI text.
116
+ - **`git cas agent rotate`** — added a machine-facing rotation flow so Relay can rotate recipient keys by slug or detached tree OID and expose the resulting tree and vault side effects explicitly.
117
+ - **`git cas agent vault rotate`** — added a machine-facing vault passphrase rotation flow so Relay can rotate encrypted vault state with explicit commit, KDF, and rotated/skipped-entry results.
118
+ - **`git cas agent vault init|remove`** — added machine-facing vault lifecycle commands so Relay can initialize encrypted or plaintext vaults and remove entries without scraping human CLI output.
119
+ - **Docs maintainer checklist** — added [docs/DOCS_CHECKLIST.md](./docs/DOCS_CHECKLIST.md) as the short pre-review pass for doc-heavy branches, covering boundary clarity, canonical-source links, index hygiene, and empty-state wording discipline.
120
+ - **Pre-PR doc cross-link audit** — added a lightweight routing audit to [docs/DOCS_CHECKLIST.md](./docs/DOCS_CHECKLIST.md), [WORKFLOW.md](./WORKFLOW.md), and [CONTRIBUTING.md](./CONTRIBUTING.md) so doc-heavy branches verify canonical adjacent links before review instead of discovering missing cross-links late in PR feedback.
121
+ - **Planning-index consistency review** — added an explicit planning-surface review to [docs/DOCS_CHECKLIST.md](./docs/DOCS_CHECKLIST.md) and [WORKFLOW.md](./WORKFLOW.md), defining when to verify backlog, design, archive, and legend alignment.
122
+ - **Benchmark baselines doc** — added [ADVANCED_GUIDE.md](./ADVANCED_GUIDE.md) with the first published chunking baseline, including fixed-size versus CDC throughput, dedupe reuse results, and refresh instructions.
123
+ - **Threat model doc** — added [docs/THREAT_MODEL.md](./docs/THREAT_MODEL.md) as the canonical statement of attacker models, trust boundaries, exposed metadata, and explicit non-goals.
124
+ - **Workflow model** — added [WORKFLOW.md](./WORKFLOW.md), explicit legends/backlog/invariants directories, and a cycle-first planning model for fresh work.
125
+ - **Review automation baseline** — added `.github/CODEOWNERS` with repo-wide ownership for `@git-stunts`.
126
+ - **Release runbook** — added `docs/RELEASE.md` and linked it from `CONTRIBUTING.md` as the canonical patch-release workflow.
127
+ - **`npm run release:verify`** — new maintainer-facing release helper runs the full release checklist, captures observed test counts, and prints a Markdown summary that can be pasted into release notes or changelog prep.
128
+ - **JSR-deferred release verification** — `npm run release:verify -- --skip-jsr` now supports release-candidate sanity checks when the external JSR/Deno toolchain is broken, records skipped steps in Markdown and JSON summaries, and keeps the v6.0.0 tag workflow focused on npm plus GitHub Release publication.
129
+ - **`git cas vault stats`** — new vault summary command reports logical size, chunk references, dedupe ratio, encryption coverage, compression usage, and chunking strategy breakdowns.
130
+ - **`git cas doctor`** — new diagnostics command scans `refs/cas/vault`, validates every referenced manifest, and exits non-zero with structured issue output when it finds broken entries or a missing vault ref.
131
+ - **Deterministic property-based envelope coverage** — added a `fast-check`-backed property suite for envelope-encrypted store/restore round-trips and tamper rejection across empty, boundary-adjacent, and multi-chunk payload sizes.
132
+ - **`CompressionPort`** — new abstract port (`src/ports/CompressionPort.js`) for buffer and streaming compression/decompression. Follows the same abstract-port pattern as `ChunkingPort` and `CryptoPort`.
133
+ - **`NodeCompressionAdapter`** — new adapter (`src/infrastructure/adapters/NodeCompressionAdapter.js`) implementing `CompressionPort` via `node:zlib` gzip/gunzip. Both buffer and async-iterable streaming interfaces.
134
+
135
+ ### Changed
136
+
137
+ - **CasService de-sludged into runtime strategy boundaries** — `CasService.js`
138
+ is now a lean facade under 500 lines. Byte-level chunk I/O, compression,
139
+ manifest/tree publication, integrity verification, recipient mutation, framed
140
+ record parsing, and store/restore strategy execution now live in dedicated
141
+ domain services and strategy entities with direct unit coverage. Public
142
+ `CasService` store/restore/manifest/recipient APIs are unchanged.
143
+ - **VaultService decomposed into cohesive collaborators** — `VaultService.js`
144
+ now orchestrates public vault use cases while `VaultPersistence` owns
145
+ `refs/cas/vault` persistence, `VaultStateCache` owns tree-OID keyed state
146
+ memoization, `VaultMetadataCodec` and `VaultTreeCodec` own pure boundary
147
+ encoding, and dedicated privacy, verifier, and retry-policy collaborators own
148
+ HMAC index handling, constant-time key verification, and CAS retry timing.
149
+ Public vault APIs and the on-disk vault tree format are unchanged.
150
+ - **Privacy vault passphrase rotation preserved** — vault passphrase rotation now
151
+ reads metadata before full state so privacy-enabled vaults can derive the old
152
+ key, decrypt `.privacy-index`, and rebuild the index under the replacement key.
153
+ - **Structured KDF algorithm errors** — unsupported stored or requested KDF
154
+ algorithms now fail with `KDF_POLICY_VIOLATION`, and vault metadata decoding
155
+ normalizes those policy failures to `VAULT_METADATA_INVALID` instead of
156
+ leaking raw `Error` instances.
157
+ - **Vault ref creation is create-only** — first vault writes now pass Git's
158
+ all-zero expected OID when `expectedOldOid` is `null`, preserving CAS
159
+ semantics during concurrent vault initialization.
160
+ - **Metadata blob limits reach the default Git adapter** — `maxBlobSize`
161
+ constructor options now configure `GitPersistenceAdapter.readBlob()` when no
162
+ per-call limit is supplied.
163
+ - **Git blob per-call limits are validated** — `GitPersistenceAdapter.readBlob()`
164
+ now rejects invalid caller-provided `maxBytes` limits with `INVALID_OPTIONS`
165
+ before opening a Git blob stream.
166
+ - **API `maxBlobSize` wording** — `docs/API.md` now documents the constructor
167
+ option as the metadata blob read limit, matching the runtime service contract.
168
+ - **Manifest diff JSDoc boundary** — `ManifestDiff.js` now declares its
169
+ `Manifest` typedef locally so generated docs and declaration checks can
170
+ resolve the pure diff helper parameters.
171
+ - **Vault metadata API docs** — `docs/API.md` now includes the optional
172
+ `privacy` shape in the `VaultMetadata` example alongside the privacy error
173
+ codes.
174
+ - **Vault keyed caches snapshot key bytes** — privacy-entry and verifier caches
175
+ now reject stale hits when a reused `Uint8Array` key object has been mutated.
176
+ - **Vault state caches return defensive entry maps** — `VaultStateCache` now
177
+ copies cached plain and privacy entry maps before returning them, so caller
178
+ mutations cannot poison subsequent reads from the same tree snapshot.
179
+ - **Vault privacy cache deduplicates in-flight work** — concurrent privacy
180
+ reads for the same cached tree and key object now share one `.privacy-index`
181
+ resolution instead of decrypting the same index multiple times.
182
+ - **Vault tree cache is bounded** — `VaultStateCache` now uses a validated
183
+ LRU capacity instead of retaining every immutable tree snapshot for the
184
+ lifetime of the service.
185
+ - **Vault verifier checks reuse cached proofs** — keyed list, resolve, and
186
+ mutation paths now reuse the verifier memo stored by `readState()` for the
187
+ same immutable vault tree instead of decrypting the verifier repeatedly.
188
+ - **Vault verifier cache regression coverage** — mutation memoization tests now
189
+ exercise the intended cross-operation path by calling
190
+ `readState({ encryptionKey })` before the keyed vault write.
191
+ - **Review-feedback test style guards** — privacy error assertions now use
192
+ `ErrorCodes` constants, and ManifestDiff declaration checks use regex matching
193
+ so benign JSDoc formatting does not break release tests.
194
+ - **Stdout-only missing vault refs** — Git ref resolution now treats
195
+ `rev-parse refs/cas/vault` failures that only echo the unresolved ref on
196
+ stdout as `GIT_REF_NOT_FOUND`, preventing empty-vault initialization flakes
197
+ from surfacing as `VAULT_HEAD_INVALID`.
198
+ - **Vault metadata enforces the AES-GCM cipher boundary** — `.vault.json`
199
+ metadata now rejects unsupported `encryption.cipher` values with
200
+ `VAULT_METADATA_INVALID`; the v6 vault metadata format remains AES-256-GCM.
201
+ - **Vault metadata rejects malformed encryption placeholders** — `.vault.json`
202
+ payloads with present but falsy `encryption` values now fail with
203
+ `VAULT_METADATA_INVALID` instead of being treated as plaintext vaults.
204
+ - **Doctor rejects vault heads without metadata** — `git cas doctor` now fails
205
+ with `VAULT_METADATA_INVALID` when `refs/cas/vault` exists but `.vault.json`
206
+ is missing or invalid.
207
+ - **Unreadable vault heads stay visible** — vault head resolution now returns an
208
+ empty state only when the vault ref is absent; unreadable refs or commits that
209
+ cannot resolve to a tree fail with `VAULT_HEAD_INVALID`.
210
+ - **Vault ref update failures stay non-retryable unless they are CAS conflicts**
211
+ — `VaultPersistence` now emits `VAULT_REF_UPDATE_FAILED` for generic
212
+ update-ref failures and reserves `VAULT_CONFLICT` for structured
213
+ expected-vs-actual OID mismatches.
214
+ - **Plumbing missing-ref errors stay non-fatal** — vault head resolution now
215
+ recognizes `@git-stunts/plumbing` missing-ref stderr details as an absent
216
+ vault while still surfacing unrelated ref failures. Object database failures
217
+ and corrupt head stderr are reported as `VAULT_HEAD_INVALID`.
218
+ - **Git ref missing errors are structured at the adapter boundary** —
219
+ `GitRefAdapter.resolveRef()` now normalizes known Git missing-ref stderr to
220
+ `GIT_REF_NOT_FOUND`, leaving VaultPersistence's text fallback only for
221
+ third-party ref ports.
222
+ - **Vault missing-ref fallback documented** — `VaultPersistence` now documents
223
+ its third-party-port missing-ref stderr fallback as C/English-locale
224
+ best-effort behavior; structured `GIT_REF_NOT_FOUND` remains the primary path.
225
+ - **Vault metadata snapshot docs** — `VaultPersistence.readMetadataSnapshot()`
226
+ now explicitly documents that iterator metadata reads avoid full-tree
227
+ materialization and therefore return no cache snapshot.
228
+ - **VaultService DI guard** — the constructor now rejects mixed
229
+ `vaultPersistence` and legacy `persistence`/`ref` injection, and reports a
230
+ focused dependency error when the legacy pair is incomplete.
231
+ - **Doctor can inspect privacy vaults** — human and agent `doctor` commands now
232
+ accept raw vault keys, vault passphrase sources, and OS-keychain targets so
233
+ privacy-enabled vaults can be diagnosed without falling back to a missing-key
234
+ failure. Agent diagnostics now ignore passphrase input with a warning when the
235
+ vault is plaintext, and the TUI operations doctor forwards the already-unlocked
236
+ vault key.
237
+ - **Privacy index mismatches fail closed** — privacy-mode `readState()`,
238
+ `listVault()`, and doctor scans now fail with `VAULT_PRIVACY_INDEX_INVALID`
239
+ when `.privacy-index` does not cover every raw HMAC tree entry, avoiding
240
+ partial listings that could hide vault corruption.
241
+ - **Privacy index metadata fails closed** — privacy-enabled vaults missing
242
+ `privacy.indexMeta` now fail with structured `VAULT_PRIVACY_INDEX_INVALID`
243
+ metadata before decrypting or resolving privacy-mode entries.
244
+ - **Doctor reports byte-level dedupe** — vault stats and doctor output now
245
+ include total chunk bytes, unique chunk bytes, duplicate chunk bytes, and a
246
+ byte-level dedupe ratio alongside chunk-reference counts.
247
+ - **TUI doctor dashboard shows byte economics** — the health dashboard now
248
+ renders chunk bytes, unique chunk bytes, duplicate chunk bytes, and the
249
+ byte-level dedupe ratio instead of only reference counts.
250
+ - **Recipient rotation scans every candidate** — unlabeled `rotateKey()` now
251
+ attempts every recipient unwrap before selecting the first match, reducing
252
+ recipient-position timing leakage while preserving existing rotation results.
253
+ - **Behavior-focused vault tests** — removed the source-layout-only
254
+ `VaultService` structure test and added a test-style guard against
255
+ `.structure.test.js` files.
256
+ - **Current vault tree-path terminology** — renamed the stale
257
+ `encodeSlug.test.js` coverage to `VaultTreePath.test.js` and updated comments
258
+ to describe the `Slug` tree-path boundary.
259
+ - **Facade restore guidance links to versioned docs** — missing
260
+ `restoreFile({ baseDirectory })` errors now serialize a v6.0.0 API docs URL
261
+ and use the centralized `INVALID_OPTIONS` error code.
262
+ - **Restore path symlink boundary** — `restoreFile()` now canonicalizes
263
+ existing path components before stream or bounded-file publication, blocking
264
+ symlinked output directories that resolve outside `baseDirectory`.
265
+ - **CLI restore output validation** — restore target resolution now rejects
266
+ empty `--out` values with `INVALID_OPTIONS` instead of resolving them to the
267
+ current directory.
268
+ - **Vault retry policies validate injected hooks** — `VaultMutationRetryPolicy`
269
+ now rejects non-function `random`/`sleep` dependencies at construction and
270
+ freezes configured policy instances.
271
+ - **Walkthrough documents per-operation Merkle thresholds** — Merkle guidance
272
+ now shows `storeFile({ merkleThreshold })` as the primary override and keeps
273
+ constructor-level thresholds framed as defaults.
274
+ - **VaultService module header normalized** — the fileoverview block now
275
+ appears before imports, and the service header imports errors through the
276
+ internal errors barrel.
277
+ - **Per-operation Merkle threshold** — `store()` and `storeFile()` now accept a
278
+ `merkleThreshold` option that carries through to the corresponding
279
+ `createTree()` publication unless an explicit `createTree()` threshold is
280
+ supplied.
281
+ - **Restore guidance surfaced in errors and docs** — missing `restoreFile()`
282
+ `baseDirectory` errors now explain the trusted-local `process.cwd()` option,
283
+ structured CLI/agent errors can include documentation URLs, and the v6 docs
284
+ call out the mandatory restore boundary.
285
+ - **Metadata blob limit constantized** — `GitPersistenceAdapter` now uses a
286
+ named `DEFAULT_MAX_BLOB_SIZE` constant for the default 10 MiB metadata-read
287
+ cap and reports the effective limit in `RESTORE_TOO_LARGE` errors.
288
+ - **OS-keychain passphrase lookup awaits vault v2 secrets** — CLI credential
289
+ resolution now awaits the async `@git-stunts/vault` secret lookup before
290
+ validating and returning the passphrase.
291
+ - **Git plumbing dependency aligned to npm latest** — `@git-stunts/plumbing`
292
+ now targets `^3.0.3`. `@git-stunts/vault` remains on the registry-latest
293
+ `^1.0.1`, and `@git-stunts/trailer-codec` remains outside the runtime
294
+ dependency graph because `git-cas` does not use commit trailers.
295
+ - **Async Git plumbing factory boundary** — `ContentAddressableStore.open()` and
296
+ shared CLI plumbing construction now await the `@git-stunts/plumbing` v3
297
+ async factory through a dedicated infrastructure adapter and factory port,
298
+ keeping working-directory validation, runtime selection, and package-specific
299
+ errors out of the domain layer.
300
+ - **Platform-neutral core byte pipeline** — `CasService`, `KeyResolver`, `VaultService`, convergent encryption, manifest/KDF metadata helpers, schemas, codecs, and fixed/CDC chunkers now use pure `Uint8Array` byte helpers and protocol encoders instead of `Buffer` methods. `store()` now has regression coverage for `Readable.from([new Uint8Array(...)])` in both fixed and CDC chunking modes.
301
+ - **Slug value object** — vault slug validation and plain vault tree-entry
302
+ percent encoding now live in `Slug`, including `.toTreePath()` for the Git
303
+ tree-entry representation used by `VaultService`.
304
+ - **Architecture guard added** — `test/unit/docs/platform-boundary.test.js` now fails if platform-neutral source directories introduce `node:*` imports, `Buffer` runtime APIs, runtime globals, platform text codecs, or Node stream classes.
305
+ - **WebCryptoAdapter HMAC is Web Crypto native** — HMAC-SHA256 now uses `crypto.subtle.sign()` instead of importing Node crypto into the Web adapter.
306
+ - **Plaintext+compressed restore is now streaming** — compressed unencrypted data uses `_restoreCompressedStreaming` instead of the buffered path, eliminating the `maxRestoreBufferSize` constraint for this case.
307
+ - **`formatVersion` stamped into new manifests** — new manifests include a `formatVersion` field carrying the package semver at store time. The field is optional on read for backward compatibility with older manifests.
308
+ - **`CryptoPort._buildMeta` default scheme** — changed to the current `whole` identifier.
309
+ - **CompressionPort extraction** — `CasService` no longer imports `node:zlib`, `node:stream`, or `node:util` directly. Compression is now delegated through a `CompressionPort` abstract port. Direct `CasService` construction must inject `compressionAdapter`; the facade still provides the Node gzip default for normal callers.
310
+ - **AES-GCM adapter enforcement** — Node, Bun, and Web Crypto decrypt paths now all reject malformed AES-256-GCM metadata at the adapter boundary, enforce the declared algorithm before decrypting, and reject short or malformed nonce/tag fields before any runtime-specific decrypt call runs.
311
+ - **Buffered restore adapter contract** — hard-limited buffered restore modes now require `readBlobStream()` on the persistence adapter instead of silently degrading to whole-blob `readBlob()` fallback behavior. Plaintext restore keeps the compatibility fallback.
312
+ - **KDF salt shape hardening** — stored KDF salt metadata now rejects malformed base64 at both the manifest schema layer and the runtime stored-KDF policy path, keeping vault metadata and passphrase-restore behavior aligned before derive work starts.
313
+ - **Encrypted write auto-selection** — fixed-chunk encrypted stores default to `framed`, CDC encrypted stores default to `convergent`, and `encryption.frameBytes` implies framed mode even when `scheme` is omitted.
314
+ - **KDF policy hardening** — passphrase-bearing store, restore, vault init, and vault rotation now default to PBKDF2 `600000` or scrypt `N=131072`, reject out-of-policy KDF metadata with `KDF_POLICY_VIOLATION`, and keep a bounded compatibility window for older stored metadata instead of trusting arbitrary repository-controlled parameters.
315
+ - **Encrypted manifest schema hardening** — manifest parsing now accepts only current `whole`, `framed`, and `convergent` scheme identifiers, rejects legacy scheme strings with `LEGACY_SCHEME`, rejects malformed nonce/tag values and framed manifests without `frameBytes`, and applies the same validation through both JSON and CBOR `readManifest()` paths.
316
+ - **Web Crypto decrypt guard** — `WebCryptoAdapter` now accepts `maxDecryptionBufferSize` and rejects oversized whole-object decrypt buffers with `DECRYPTION_BUFFER_EXCEEDED`, making the Deno/browser-class `whole` restore path bounded instead of silently unbounded.
317
+ - **Encrypted restore routing** — `whole` remains the compatibility whole-object mode, while `framed` restores frame-by-frame and can stream through gunzip when combined with gzip compression. `verifyIntegrity()` now authenticates framed payloads by parsing and checking every record.
318
+ - **Bounded file restore for buffered modes** — `restoreFile()` no longer inherits the full-memory restore path for `whole` and compression-buffered manifests. It now verifies chunks, writes tentative bytes to a temp file, and renames into place only after whole-object auth and optional gunzip succeed.
319
+ - **File restore plan seam** — `restoreFile()` now consumes `CasService.createFileRestorePlan()` instead of reconstructing bounded whole-object restore flows from underscore helper calls inside the file adapter.
320
+ - **Store write failure contract** — raw chunk-write failures during `store()` now normalize to `STORE_ERROR`, existing `CasError` write failures keep their original code, and both paths now carry `chunksDispatched`, `orphanedBlobs`, and `failedIndex` metadata.
321
+ - **Unified vault mutation retry** — `initVault()` now shares the same CAS-conflict retry orchestration path as `addToVault()` and `removeFromVault()`, so all core vault mutations run through one draft-based read-apply-write-retry helper.
322
+ - **CasService decomposition trajectory** — `ARCHITECTURE.md` now publishes the explicit extraction order for `CasService`: store write coordination first, manifest/tree publication second, recipient mutation flows third, and restore pipeline extraction only after platform-port work lands.
323
+ - **METHOD signposts and legacy planning compatibility** — [WORKFLOW.md](./WORKFLOW.md) and [docs/RELEASE.md](./docs/RELEASE.md) now act as signposts into `docs/method/`, active backlog cards now live in METHOD backlog lanes with non-numeric filenames, and [docs/BACKLOG/](./docs/BACKLOG/README.md) plus [docs/legends/](./docs/legends/README.md) now remain as legacy compatibility surfaces instead of active planning truth.
324
+ - **README rewritten** — the front page now focuses on current product truth, clear quick starts, operational caveats, and the canonical doc map instead of mixing release history, marketing copy, and reference detail.
325
+ - **Planning lifecycle clarified** — live backlog items now exclude delivered work, archive directories now hold retired backlog history and reserved retired design space, landed cycle docs use explicit landed status, and the design/backlog indexes now reflect current truth instead of stale activity.
326
+ - **Architecture map repaired** — [ARCHITECTURE.md](./ARCHITECTURE.md) now describes the shipped system instead of an older flat-manifest-only model, including Merkle manifests, the extracted `VaultService` and `KeyResolver`, current ports/adapters, and the real storage layout for trees and the vault.
327
+ - **Architecture navigation clarified** — [ARCHITECTURE.md](./ARCHITECTURE.md) now distinguishes the public package boundary from internal domain helpers and links directly to [docs/THREAT_MODEL.md](./docs/THREAT_MODEL.md) as adjacent truth.
328
+ - **Guide repaired** — the long-form guide now lives at [GUIDE.md](./GUIDE.md), links back to the canonical API/security docs, uses current `restore --oid` syntax, and no longer teaches stale EventEmitter-first or internal-import-heavy workflows for common use.
329
+ - **Markdown surface map added** — [docs/MARKDOWN_SURFACE.md](./docs/MARKDOWN_SURFACE.md) now records a per-file `KEEP` / `CUT` / `MERGE` / `MOVE` recommendation across the tracked Markdown surface, including which root docs still belong at the repo front door and which remaining artifacts are migration or local-only candidates.
330
+ - **Examples surface audited** — [examples/README.md](./examples/README.md) now records the recommendation for each maintained example, and the store/restore example now uses the public `readManifest()` helper instead of manual manifest decoding through service internals.
331
+ - **Security doc discoverability improved** — [README.md](./README.md), [CONTRIBUTING.md](./CONTRIBUTING.md), [WORKFLOW.md](./WORKFLOW.md), [ARCHITECTURE.md](./ARCHITECTURE.md), [docs/API.md](./docs/API.md), and [docs/DOCS_CHECKLIST.md](./docs/DOCS_CHECKLIST.md) now link more directly to [SECURITY.md](./SECURITY.md) and [docs/THREAT_MODEL.md](./docs/THREAT_MODEL.md) so maintainers and agents can find the canonical security guidance from the docs they read first.
332
+ - **GitHub Actions runtime maintenance** — CI and release workflows now run on `actions/checkout@v6` and `actions/setup-node@v6`, clearing the Node 20 deprecation warnings from GitHub-hosted runners.
333
+ - **Ubuntu-based Docker test stages** — the local/CI Node, Bun, and Deno test images now build on `ubuntu:24.04`, copying runtime binaries from the official upstream images instead of inheriting Debian-based runtime images directly, and the final test commands now run as an unprivileged `gitstunts` user.
334
+ - **Test conventions expanded** — `test/CONVENTIONS.md` now documents Git tree filename ordering, Docker-only integration policy, pinned integration `fileParallelism: false`, and direct-argv subprocess helpers.
335
+
336
+ ### Fixed
337
+
338
+ - **Agent diagnostic passphrase resolver guard** — encrypted `git cas agent doctor`
339
+ requests now fail with a controlled credential error when a structured
340
+ passphrase source is supplied without the resolver dependency.
341
+ - **Doctor byte dedupe metric** — vault health statistics now compute byte
342
+ dedupe from stored chunk bytes instead of logical file size, keeping
343
+ compression and deduplication signals separate.
344
+ - **Docker version fallback** — CLI version resolution now ignores the
345
+ `unknown` build metadata sentinel written when Docker test images have neither
346
+ `.git` metadata nor a stamped package SHA, so `git-cas --version` falls back to
347
+ plain semver instead of emitting `+unknown`.
348
+ - **Docker unit-test stability** — vault passphrase-rotation unit coverage now
349
+ uses in-memory persistence and ref ports, keeping domain behavior validation
350
+ independent from Docker Git subprocess scheduling.
351
+ - **Shared CLI/agent credential resolution** — human CLI and agent protocol
352
+ flows now use `bin/credentials.js` for key-file length checks, ambiguous
353
+ credential-source rejection, vault passphrase-derived key verification, and
354
+ encrypted-restore input classification.
355
+ - **CLI restore output authority** — human and agent CLI restore commands now
356
+ treat an explicit `--out` path as authority to write in that path's parent
357
+ directory, while `restoreFile()` keeps enforcing its library-level
358
+ `baseDirectory` boundary. The low-level path check now uses path-relative
359
+ containment instead of a string-prefix comparison.
360
+ - **Type declaration accuracy** — `CasServiceOptions` now marks `chunker` and `compressionAdapter` as required for direct domain-service construction, and `StoreEncryptionOptions` exposes the supported `convergent` opt-in/opt-out flag.
361
+ - **Constructor validation consistency** — direct `CasService` construction now
362
+ validates all required ports through the unified constructor argument
363
+ validator.
364
+ - **Caretaker dependency ranges** — `@flyingrobots/bijou-*` dependencies now
365
+ use consistent `^5.0.0` ranges for the v6 release line.
366
+ - **v6 documentation coverage** — README, GUIDE, ADVANCED_GUIDE, API docs, walkthrough docs, and examples now align with the actual v6 CLI, direct-service port requirements, `Uint8Array` byte contract, agent command surface, and CDC/convergent encryption defaults.
367
+ - **Release documentation finalization** — added public v6.0.0 release notes, made README migration guidance more prominent for existing v5 users, and aligned UPGRADING examples with the safer `--passphrase-file` migration path.
368
+ - **Release-gate hardening** — `npm run release:verify` now executes every maintained example, `commander` is pinned to an exact version, and CLI help regression coverage preserves passphrase-source guidance.
369
+ - **Facade factory option forwarding** — `createJson()` and `createCbor()` now
370
+ pass advanced facade options through to the underlying service instead of
371
+ silently dropping them.
372
+ - **Convergent auto-selection observability** — CDC encrypted stores now warn
373
+ when deterministic `convergent` encryption is selected implicitly.
374
+ - **Git tree-entry formatting boundary** — `CasService` now delegates manifest,
375
+ sub-manifest, and chunk tree-entry construction to `GitTreeBuilder`.
376
+ - **In-memory persistence test helper** — `MemoryPersistenceAdapter` now proves
377
+ domain store/tree/read/restore workflows without Git subprocesses.
378
+ - **CasService orchestration boundaries** — store write scheduling,
379
+ backpressure, in-flight write tracking, and store error normalization now live
380
+ in `StorePipeline`; restore strategy classification and handler dispatch now
381
+ live in `RestorePipeline`. The public `CasService` API is unchanged.
382
+ - **Vault state read caching** — `VaultService.readState()` now caches parsed
383
+ vault tree state by unchanged tree OID, returns defensive copies to callers,
384
+ and invalidates automatically when the vault ref resolves to a different tree.
385
+ - **Agent CLI module boundary** — `bin/agent/cli.js` is now a thin protocol
386
+ shell, command handlers live under `bin/agent/commands/`, shared request and
387
+ credential-input helpers live in `bin/agent/input.js`, and a module-boundary
388
+ regression test guards the split.
389
+ - **Vault metadata validation** — malformed vault `encryptionCount` metadata is rejected before encrypted vault writes can corrupt nonce accounting or bypass the configured encryption-count cap.
390
+ - **Vault passphrase rotation verifier preservation** — vault passphrase
391
+ rotation now authenticates the old key against verifier metadata when present
392
+ and writes a fresh verifier for the new key.
393
+ - **Migration credential hardening** — the migration script now reads full-migration passphrases from `--passphrase-file <path>` or `--passphrase-file -`, rejects ambiguous credential sources, and warns on inline migration passphrases.
394
+ - **npm package documentation surface** — the published package now excludes internal audit, METHOD backlog, archive, and unused media artifacts while preserving the public docs and demo media linked from README.
395
+ - **Reporting paths** — SUPPORT, CODE_OF_CONDUCT, and SECURITY now publish concrete support, conduct, and vulnerability reporting paths instead of referring to absent maintainer/reporting channels.
396
+ - **Hard buffered restore bounds** — buffered restore now enforces `maxRestoreBufferSize` against actual blob-read sizes and streamed gunzip output instead of only manifest-declared preflight estimates and post-materialization checks.
397
+ - **CLI credential edge cases** — `store --recipient` now ignores ambient `GIT_CAS_PASSPHRASE` state when no explicit vault passphrase flag/file was provided, store/restore/init now reject ambiguous explicit credential combinations consistently, `vault init --algorithm` no longer silently falls back to plaintext without a passphrase source, and `vault rotate` now rejects whitespace-only old/new passphrase inputs instead of treating them as valid credentials.
398
+ - **Bun blob writes in Git persistence** — `GitPersistenceAdapter.writeBlob()` now hashes temp files instead of piping large buffers through `git hash-object --stdin` under Bun, avoiding unhandled `EPIPE` failures during real Git-backed stores.
399
+ - **Release verification runner failures** — `runReleaseVerify()` now converts thrown step-runner errors into structured step failures with a `ReleaseVerifyError` summary instead of letting raw exceptions escape.
400
+ - **Machine-readable release verification** — `npm run release:verify -- --json` now emits structured JSON on both success and failure paths, making CI automation and release-note tooling consume the same verification source of truth.
401
+ - **Dashboard launch context normalization** — `launchDashboard()` now treats injected Bijou contexts without an explicit `mode` as interactive, avoiding an incorrect static fallback, and the CLI mode tests now lock the `BIJOU_ACCESSIBLE` and `TERM=dumb` branches.
402
+
403
+ ## [5.3.2] — 2026-03-15
404
+
405
+ ### Changed
406
+
11
407
  - **Vitest workspace split** — unit, integration, and benchmark suites now live in explicit workspace projects so the integration suite always runs with `fileParallelism: false`, regardless of the exact CLI invocation shape.
12
408
  - **Status semantics** — `STATUS.md` now distinguishes the last released version (`v5.3.1`) from the current branch version (`v5.3.2`).
13
409
 
14
410
  ### Fixed
411
+
15
412
  - **CLI version drift** — `bin/git-cas.js` now reads the package version instead of carrying a stale hardcoded literal, so `git-cas --version` tracks the in-repo release line correctly.
16
413
 
17
414
  ## [5.3.1] — 2026-03-15
18
415
 
19
416
  ### Fixed
417
+
20
418
  - **Repeated chunk tree emission** — `createTree()` and `_createMerkleTree()` now emit one chunk blob tree entry per unique digest, preserving first-seen order at write time while leaving the manifest unchanged as the authoritative ordered index of chunk occurrences.
21
419
  - **Invalid Git trees for repetitive content** — repetitive files no longer produce duplicate tree entry names, so emitted trees pass `git fsck --full` without `duplicateEntries` failures.
22
420
  - **Regression coverage for tree reachability** — added unit tests for first-seen dedupe behavior and integration tests that store repetitive content, verify restore correctness, and assert clean `git fsck` results on a real Git repository.
@@ -24,6 +422,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
24
422
  ## [5.3.0] — 2026-03-08
25
423
 
26
424
  ### Added
425
+
27
426
  - **Vault rotate passphrase-file support** — `vault rotate` now accepts `--old-passphrase-file` and `--new-passphrase-file` flags, bringing it to parity with the store/restore passphrase-file support.
28
427
  - **CLI store flags** — `--gzip`, `--strategy <fixed|cdc>`, `--chunk-size <n>`, `--concurrency <n>`, `--codec <json|cbor>`, `--merkle-threshold <n>`, `--target-chunk-size <n>`, `--min-chunk-size <n>`, `--max-chunk-size <n>`. All library-level chunking, compression, codec, and concurrency options are now accessible from the CLI.
29
428
  - **CLI restore flags** — `--concurrency <n>`, `--max-restore-buffer <n>`. Parallel I/O and restore buffer limit now configurable from CLI.
@@ -42,6 +441,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
42
441
  - **16.7 — Lifecycle method naming** — Added `inspectAsset()` (replaces `deleteAsset()`) and `collectReferencedChunks()` (replaces `findOrphanedChunks()`) as canonical names on both `CasService` and the facade. Old names are preserved as deprecated aliases that emit observability warnings. Type definitions updated with `@deprecated` JSDoc.
43
442
 
44
443
  ### Changed
444
+
45
445
  - **`runAction` injectable delay** — `runAction()` now accepts an optional `{ delay }` dependency, replacing the hardcoded `setTimeout` call. Tests inject a spy instead of using `vi.useFakeTimers()`, making INTEGRITY_ERROR rate-limit tests deterministic across Node, Bun, and Deno.
46
446
  - **Test conventions** — Added `test/CONVENTIONS.md` documenting rules for deterministic, cross-runtime tests: inject time dependencies, use `chmod()` instead of `writeFile({ mode })`, avoid global state patching.
47
447
  - **VaultService test observability wiring** — `VaultService.test.js` now passes a `mockObservability()` port to all tests instead of relying on the silent no-op default. `rotateVaultPassphrase.test.js` now passes `SilentObserver` explicitly. If observability wiring breaks, the test suite will catch it.
@@ -52,6 +452,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
52
452
  - **16.4 — FixedChunker pre-allocated buffer** — Replaced `Buffer.concat()` loop with a pre-allocated `Buffer.allocUnsafe(chunkSize)` working buffer, eliminating O(n²) copies for many small input buffers. Matches the allocation strategy used by `CdcChunker`.
53
453
 
54
454
  ### Fixed
455
+
55
456
  - **Post-decompression size guard** — `_restoreBuffered` now enforces `maxRestoreBufferSize` after decompression, not just before. Compressed payloads that inflate beyond the configured limit now throw `RESTORE_TOO_LARGE` instead of silently allocating unbounded memory.
56
457
  - **CLI passphrase prompt deferral** — `resolveEncryptionKey` now checks vault metadata before calling `resolvePassphrase`, avoiding unnecessary TTY prompts for unencrypted vaults. Store action recipient-conflict check inspects flags/env without consuming stdin.
57
458
  - **CRLF passphrase normalization** — `readPassphraseFile` now strips trailing `\r\n` (Windows line endings) in addition to `\n`, preventing passphrase mismatches from Windows-edited files.
@@ -74,6 +475,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
74
475
  ## [5.2.4] — Prism polish (2026-03-03)
75
476
 
76
477
  ### Fixed
478
+
77
479
  - **`CryptoPortBase.sha256()` type** — `index.d.ts` declaration corrected from `string | Promise<string>` to `Promise<string>`, matching the async implementation since v5.2.3.
78
480
  - **`keyLength` passthrough** — `KeyResolver.#resolveKeyFromPassphrase` and `deriveKekFromKdf` now forward `kdf.keyLength` to `deriveKey()`, fixing a latent bug for vaults configured with non-default key lengths.
79
481
  - **Deno test compatibility** — `createCryptoAdapter.test.js` no longer crashes on Deno by guarding immutable `globalThis.Deno` restoration with try/catch and skipping Node-only tests on non-Node runtimes.
@@ -82,6 +484,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
82
484
  - **Vestigial `lastchat.txt`** removed from `jsr.json` exclude list.
83
485
 
84
486
  ### Changed
487
+
85
488
  - **`keyResolver` is now private** — `CasService.keyResolver` changed to `#keyResolver`, preventing external access to an internal implementation detail.
86
489
  - **`VaultPassphraseRotator.js` → `rotateVaultPassphrase.js`** — renamed to follow camelCase convention for files that export a function (PascalCase is reserved for classes).
87
490
  - **`resolveChunker` validation** — `chunkSize` now validated as a finite positive number before constructing `FixedChunker`; invalid values fall through to CasService default.
@@ -93,6 +496,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
93
496
  ## [5.2.3] — Prism refactor (2026-03-03)
94
497
 
95
498
  ### Changed
499
+
96
500
  - **Async `sha256()` across all adapters** — `NodeCryptoAdapter.sha256()` now returns `Promise<string>` (was sync `string`), matching Bun and Web adapters. Fixes Liskov Substitution violation; all callers already `await`. `CryptoPort` JSDoc and `CasService.d.ts` updated to `Promise<string>`.
97
501
  - **Extract `KeyResolver`** — ~170 lines of key resolution logic (`wrapDek`, `unwrapDek`, `resolveForDecryption`, `resolveForStore`, `resolveRecipients`, `resolveKeyForRecipients`, passphrase derivation, mutual-exclusion validation) extracted from `CasService` into `src/domain/services/KeyResolver.js`. CasService delegates via `this.keyResolver`. No public API changes. 24 new unit tests.
98
502
  - **Move `createCryptoAdapter`** — runtime crypto detection moved from `index.js` to `src/infrastructure/adapters/createCryptoAdapter.js`; test helper now delegates instead of duplicating.
@@ -109,12 +513,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
109
513
  ## [5.2.2] — JSDoc total coverage (2026-02-28)
110
514
 
111
515
  ### Added
516
+
112
517
  - `tsconfig.checkjs.json` — strict `checkJs` configuration; `tsc --noEmit` passes with zero errors.
113
518
  - `src/types/ambient.d.ts` — ambient type declarations for `@git-stunts/plumbing` and `bun` modules.
114
519
  - `@types/node` dev dependency for typecheck support.
115
520
  - JSDoc `@typedef` types: `EncryptionMeta`, `KdfParamSet`, `DeriveKeyParams` (CryptoPort); `VaultMetadata`, `VaultState`, `VaultEncryptionMeta` (VaultService).
116
521
 
117
522
  ### Changed
523
+
118
524
  - Every exported and internal function, class method, and callback across all 32 source files now has complete JSDoc `@param`/`@returns` annotations.
119
525
  - CryptoPort return types widened to `string | Promise<string>` (sha256), `Buffer | Uint8Array` (randomBytes), sync-or-async for encrypt/decrypt — accurately reflecting adapter implementations.
120
526
  - Port `@param` names corrected to match underscore-prefixed abstract parameters (fixes TS8024).
@@ -124,19 +530,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
124
530
  ## [5.2.1] — Carousel polish (2026-02-28)
125
531
 
126
532
  ### Added
533
+
127
534
  - CLI reference in `docs/API.md` for `git cas rotate` and `git cas vault rotate` flags.
128
535
 
129
536
  ### Changed
537
+
130
538
  - Rotation helpers in `CasService` use native `#private` methods, matching the facade's style.
131
539
  - `VAULT_CONFLICT` and `VAULT_METADATA_INVALID` error code docs now list `rotateVaultPassphrase()`.
132
540
 
133
541
  ### Fixed
542
+
134
543
  - `rotateVaultPassphrase` now honours `kdfOptions.algorithm` instead of silently using the old algorithm.
135
544
  - Rotation integration test no longer flaps under CI load (reduced test-only KDF iterations).
136
545
 
137
546
  ## [5.2.0] — Carousel (2026-02-28)
138
547
 
139
548
  ### Added
549
+
140
550
  - **Key rotation without re-encrypting data** — `CasService.rotateKey()` re-wraps the DEK with a new KEK, leaving data blobs untouched. Enables key compromise response without re-storing assets.
141
551
  - **`keyVersion` tracking** — manifest-level and per-recipient `keyVersion` counters track rotation history for audit compliance. Optional field, backward-compatible with existing manifests.
142
552
  - **`git cas rotate` CLI command** — rotate a recipient's key via `--slug` (vault round-trip) or `--oid` (manifest-only). Supports `--label` for targeted single-recipient rotation.
@@ -148,6 +558,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
148
558
  ## [5.1.0] — Locksmith (2026-02-28)
149
559
 
150
560
  ### Added
561
+
151
562
  - **Envelope encryption (DEK/KEK)** — multi-recipient model where a random DEK encrypts content and per-recipient KEKs wrap the DEK. Recipients can be added/removed without re-encrypting data.
152
563
  - **`RecipientSchema`** — Zod schema for validating recipient entries in manifests.
153
564
  - **`recipients` field on `EncryptionSchema`** — optional array of `{ label, wrappedDek, nonce, tag }` entries.
@@ -158,6 +569,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
158
569
  - 48 new unit tests covering envelope store/restore, recipient management, edge cases, and fuzz round-trips.
159
570
 
160
571
  ### Fixed
572
+
161
573
  - **`_wrapDek` / `_unwrapDek` missing `await`** — these called async `encryptBuffer()` / `decryptBuffer()` without `await`, silently producing garbage on Bun/Deno runtimes where crypto is async.
162
574
  - **`--recipient` + `--vault-passphrase` not guarded** — CLI now rejects combining `--recipient` with `--key-file` or `--vault-passphrase`.
163
575
  - **Dead `_resolveEncryptionKey` method removed** — superseded by `_resolveDecryptionKey` but left behind.
@@ -173,10 +585,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
173
585
  ## [5.0.0] — Hydra (2026-02-28)
174
586
 
175
587
  ### Breaking Changes
588
+
176
589
  - **`CasService` constructor accepts `chunker` port** — a new optional `ChunkingPort` parameter controls chunking strategy. Existing code that does not pass `chunker` is unaffected (defaults to `FixedChunker`).
177
590
  - **Major version bump** — new hexagonal port (`ChunkingPort`) and manifest schema extension warrant a semver-major release for downstream tooling awareness.
178
591
 
179
592
  ### Added
593
+
180
594
  - **Content-defined chunking (CDC)** — Buzhash rolling-hash engine with configurable `minChunkSize` (64 KiB), `maxChunkSize` (1 MiB), and `targetChunkSize` (256 KiB). CDC limits the dedup blast radius to 1–2 chunks on incremental edits vs. total invalidation with fixed-size chunking. Benchmarked at 265 MB/s and 98.4% chunk reuse on small edits.
181
595
  - **`ChunkingPort`** — new hexagonal port (`src/ports/ChunkingPort.js`) with `async *chunk(source)`, `strategy`, and `params`. Abstracts chunking behind a pluggable interface.
182
596
  - **`FixedChunker`** — adapter wrapping existing fixed-size buffer slicing behind `ChunkingPort`.
@@ -189,12 +603,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
189
603
  - 90 new unit tests (709 total).
190
604
 
191
605
  ### Changed
606
+
192
607
  - `CasService._chunkAndStore()` refactored to delegate to `ChunkingPort` instead of inline buffer slicing.
193
608
  - `ChunkingPort`, `FixedChunker`, `CdcChunker` exported from the main entry point.
194
609
 
195
610
  ## [4.0.1] — M8 Spit Shine + M9 Cockpit (2026-02-28)
196
611
 
197
612
  ### Added
613
+
198
614
  - **`git cas verify`** command — verify stored asset integrity from the CLI (checks blob hashes; no key needed).
199
615
  - **`--json` global flag** — structured JSON output for all commands (`store`, `restore`, `verify`, `inspect`, `vault list/init/remove/info/history`).
200
616
  - **`runAction` error handler** (`bin/actions.js`) — centralized `try`/`catch` with CasError code display and actionable hints for 5 common errors.
@@ -206,6 +622,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
206
622
  - `WebCryptoAdapter.finalize()` guard — throws `STREAM_NOT_CONSUMED` if called before encrypt stream is fully consumed.
207
623
 
208
624
  ### Fixed
625
+
209
626
  - `verify` command uses `process.exitCode = 1` instead of `process.exit(1)` to allow stdout to drain on pipes.
210
627
  - `runAction` uses `process.exitCode = 1` for consistent exit behavior across all commands.
211
628
  - `vault info --json --encryption` now includes encryption metadata in JSON output.
@@ -219,16 +636,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
219
636
  - `_doDeriveKey` in `NodeCryptoAdapter` now properly `await`s promisified calls.
220
637
 
221
638
  ### Changed
639
+
222
640
  - `CryptoPort` is now the single source of truth for key validation, metadata building, and KDF parameter normalization. All three adapters override only `_doDeriveKey()`.
223
641
  - ROADMAP.md pruned: completed M1–M7 task cards moved to COMPLETED_TASKS.md.
224
642
 
225
643
  ## [4.0.0] — Conduit (2026-02-27)
226
644
 
227
645
  ### Breaking Changes
646
+
228
647
  - **`CasService` no longer extends `EventEmitter`** — event subscriptions must use the new `ObservabilityPort` adapters instead of `service.on()`. The `EventEmitterObserver` adapter provides full backward compatibility for existing event-based code.
229
648
  - **`observability` is a required constructor port** for `CasService`. The facade (`ContentAddressableStore`) defaults to `SilentObserver` when omitted.
230
649
 
231
650
  ### Added
651
+
232
652
  - **ObservabilityPort** — new hexagonal port (`src/ports/ObservabilityPort.js`) with `metric(channel, data)`, `log(level, msg, meta?)`, and `span(name)` methods. Decouples the domain layer from Node's event infrastructure.
233
653
  - **SilentObserver** — no-op adapter (default). Zero overhead when observability is not needed.
234
654
  - **EventEmitterObserver** — bridges `metric()` calls to EventEmitter events (`chunk:stored`, `file:restored`, etc.) for backward-compatible progress tracking. Exposes `.on()`, `.removeListener()`, `.listenerCount()`.
@@ -240,6 +660,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
240
660
  - 43 new unit tests (567 total).
241
661
 
242
662
  ### Changed
663
+
243
664
  - CLI `store` and `restore` commands now create an `EventEmitterObserver` and pass it to the CAS instance, attaching progress tracking to the observer instead of the service.
244
665
  - `restore()` reimplemented as a collector over `restoreStream()`.
245
666
  - `_chunkAndStore()` refactored to use semaphore-gated parallel writes with `Promise.all`, sorting results by index after completion.
@@ -248,6 +669,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
248
669
  ## [3.1.0] — Bijou (2026-02-27)
249
670
 
250
671
  ### Added
672
+
251
673
  - **Interactive vault dashboard** (`git cas vault dashboard`) — TEA-based TUI with split-pane layout, manifest detail view, keyboard navigation (`j`/`k`/`Enter`/`/`), and real-time filtering.
252
674
  - **Manifest inspector** (`git cas inspect <tree-oid>`) — renders manifest details with chunk table, encryption info, and compression badges.
253
675
  - **Progress bars** for `store` and `restore` operations — animated progress with throughput reporting, auto-disabled in non-TTY environments.
@@ -259,6 +681,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
259
681
  - New runtime dependencies: `@flyingrobots/bijou`, `@flyingrobots/bijou-node`, `@flyingrobots/bijou-tui`.
260
682
 
261
683
  ### Fixed
684
+
262
685
  - CLI `restore` now uses the canonical `readManifest` path instead of duplicating manifest resolution logic.
263
686
  - Progress trackers wrapped in `try`/`finally` to prevent event listener leaks when `storeFile` or `restoreFile` throws.
264
687
  - Dashboard filter and error lines clamped to pane width to prevent wrapping artifacts in narrow terminals.
@@ -272,6 +695,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
272
695
  ## [3.0.0] — Vault (2026-02-08)
273
696
 
274
697
  ### Added
698
+
275
699
  - **Vault** — GC-safe ref-based storage via `refs/cas/vault`. A single Git ref pointing to a commit chain indexes all stored assets by slug. `git gc` can no longer silently discard stored data.
276
700
  - `initVault()` — initialize the vault, optionally with passphrase-based encryption (vault-level KDF policy).
277
701
  - `addToVault()` — add or update an entry by slug + tree OID, with `force` flag for overwrites.
@@ -295,6 +719,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
295
719
  - 46 vault unit tests + facade delegation smoke test.
296
720
 
297
721
  ### Fixed
722
+
298
723
  - `#validateMetadata` now requires `kdf.keyLength` in encryption metadata, preventing downstream KDF failures from manually edited `.vault.json` files.
299
724
  - `#casUpdateRef` now preserves the original error in `VAULT_CONFLICT` meta for better diagnostics.
300
725
  - CLI `--vault-passphrase` now emits a stderr warning when the vault is not encrypted, instead of silently ignoring the passphrase.
@@ -308,6 +733,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
308
733
  - CLI uses `program.parseAsync()` instead of `program.parse()` to prevent Bun from hanging on async action handlers.
309
734
 
310
735
  ### Changed
736
+
311
737
  - **Vault promoted to domain layer** — all vault logic extracted from facade (`index.js`) into `VaultService` (`src/domain/services/VaultService.js`) with `GitRefPort`/`GitRefAdapter` for ref operations. Facade now delegates to VaultService.
312
738
  - CLI `restore` command no longer takes a positional `<tree-oid>` argument. Use `--oid <tree-oid>` or `--slug <slug>` instead.
313
739
  - Purged completed milestones (M1–M7) and their task cards from ROADMAP.md, reducing it from 3,153 to 1,675 lines.
@@ -315,6 +741,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
315
741
  ## [2.0.0] — M7 Horizon (2026-02-08)
316
742
 
317
743
  ### Added
744
+
318
745
  - **Compression support** (Task 7.1): Optional gzip compression pipeline via `compression: { algorithm: 'gzip' }` option on `store()`. Compression is applied before encryption when both are enabled. Manifests include a new optional `compression` field. Decompression on `restore()` is automatic.
319
746
  - **KDF support** (Task 7.2): Passphrase-based encryption using PBKDF2 or scrypt via `deriveKey()` method and `passphrase` option on `store()`/`restore()`. KDF parameters are stored in `manifest.encryption.kdf` for deterministic re-derivation. All three crypto adapters (Node, Bun, Web) implement `deriveKey()`.
320
747
  - **Merkle tree manifests** (Task 7.3): Large manifests (chunk count exceeding `merkleThreshold`, default 1000) are automatically split into sub-manifests stored as separate blobs. Root manifest uses `version: 2` with `subManifests` references. `readManifest()` transparently reconstitutes v2 manifests into flat chunk lists. Full backward compatibility with v1 manifests.
@@ -324,6 +751,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
324
751
  - Updated API reference (`docs/API.md`), guide (`GUIDE.md`), and README with v2.0.0 feature documentation.
325
752
 
326
753
  ### Changed
754
+
327
755
  - **BREAKING**: Manifest schema now includes `version` field (defaults to 1). Existing v1 manifests are fully backward-compatible.
328
756
  - `CasService` constructor accepts new `merkleThreshold` option (must be a positive integer).
329
757
  - `ContentAddressableStore` constructor now accepts and forwards `merkleThreshold` to `CasService`.
@@ -332,6 +760,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
332
760
  - Static imports for `createGzip` and `Readable` in `CasService` (previously dynamic imports on every call).
333
761
 
334
762
  ### Fixed
763
+
335
764
  - **Sub-manifest blobs are now included as tree entries** (`sub-manifest-N.json`), preventing them from being garbage-collected by `git gc`.
336
765
  - `storeFile()` now forwards `passphrase`, `kdfOptions`, and `compression` options to `store()` (previously silently dropped).
337
766
  - `store()` and `restore()` reject when both `passphrase` and `encryptionKey` are provided (`INVALID_OPTIONS`).
@@ -348,19 +777,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
348
777
  ## [1.6.2] — OIDC publishing + JSR docs coverage (2026-02-07)
349
778
 
350
779
  ### Added
780
+
351
781
  - JSDoc comments on all exported TypeScript interfaces (`CryptoPort`, `CodecPort`, `GitPersistencePort`, `CasServiceOptions`, `EncryptionMeta`, `ManifestData`, `ContentAddressableStoreOptions`) to reach 100% JSR symbol documentation coverage.
352
782
 
353
783
  ### Fixed
784
+
354
785
  - npm publish workflow now uses OIDC trusted publishing (no stored token). Upgrades npm to >=11.5.1 at publish time since pnpm does not yet support OIDC natively.
355
786
 
356
787
  ## [1.6.1] — JSR quality fixes (2026-02-07)
357
788
 
358
789
  ### Added
790
+
359
791
  - TypeScript declaration files (`.d.ts`) for all three entrypoints and shared value objects, resolving JSR "slow types" scoring penalty.
360
792
  - `@ts-self-types` directives in `index.js`, `CasService.js`, and `ManifestSchema.js`.
361
793
  - `@fileoverview` module doc to `CasService.js` (required by JSR for module docs scoring).
362
794
 
363
795
  ### Fixed
796
+
364
797
  - JSR package name corrected to `@git-stunts/git-cas`.
365
798
  - JSR publication now excludes tests, docs, CI configs, and other non-distribution files via `jsr.json` exclude list.
366
799
  - `index.d.ts` added to `package.json` files array for npm distribution.
@@ -368,6 +801,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
368
801
  ## [1.6.0] — M4 Compass + M5 Sonar + M6 Cartographer (2026-02-06)
369
802
 
370
803
  ### Added
804
+
371
805
  - `CasService.readManifest({ treeOid })` — reads a Git tree, locates and decodes the manifest, returns a validated `Manifest` value object.
372
806
  - `CasService.deleteAsset({ treeOid })` — returns logical deletion metadata (`{ slug, chunksOrphaned }`) without performing destructive Git operations.
373
807
  - `CasService.findOrphanedChunks({ treeOids })` — aggregates referenced chunk blob OIDs across multiple assets, returning `{ referenced: Set<string>, total: number }`.
@@ -390,18 +824,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
390
824
  ## [1.3.0] — M3 Launchpad (2026-02-06)
391
825
 
392
826
  ### Added
827
+
393
828
  - Native Bun support via `BunCryptoAdapter` (uses `Bun.CryptoHasher`).
394
829
  - Native Deno/Web standard support via `WebCryptoAdapter` (uses `crypto.subtle`).
395
830
  - Automated, secure release workflow (`.github/workflows/release.yml`) with:
396
- - **NPM OIDC support** including build provenance.
397
- - **JSR support** via `jsr.json` and automated publishing.
398
- - **GitHub Releases** with automated release notes.
399
- - **Idempotency & Version Checks** to prevent failed partial releases.
831
+ - **NPM OIDC support** including build provenance.
832
+ - **JSR support** via `jsr.json` and automated publishing.
833
+ - **GitHub Releases** with automated release notes.
834
+ - **Idempotency & Version Checks** to prevent failed partial releases.
400
835
  - Dynamic runtime detection in `ContentAddressableStore` to pick the best adapter automatically.
401
836
  - Hardened `package.json` with repository metadata, engine constraints, and explicit file inclusion.
402
837
  - Local quality gates via `pre-push` git hook and `scripts/install-hooks.sh`.
403
838
 
404
839
  ### Changed
840
+
405
841
  - **Breaking Change:** `CasService` cryptographic methods (`sha256`, `encrypt`, `decrypt`, `verifyIntegrity`) are now asynchronous to support Web Crypto and native optimizations.
406
842
  - `ContentAddressableStore` facade methods are now asynchronous to accommodate lazy service initialization and async crypto.
407
843
  - Project migrated from `npm` to `pnpm` for faster, more reliable dependency management.
@@ -409,6 +845,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
409
845
  - `Dockerfile` now uses `corepack` for pnpm management.
410
846
 
411
847
  ### Fixed
848
+
412
849
  - Fixed recursion bug in `BunCryptoAdapter` where `randomBytes` shadowed the imported function.
413
850
  - Resolved lazy-initialization race condition in `ContentAddressableStore` via promise caching.
414
851
  - Fixed state leak in `WebCryptoAdapter` streaming encryption.
@@ -418,6 +855,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
418
855
  ## [1.2.0] — M2 Boomerang (v1.2.0)
419
856
 
420
857
  ### Added
858
+
421
859
  - `CryptoPort` interface and `NodeCryptoAdapter` — extracted all `node:crypto` usage from the domain layer.
422
860
  - `CasService.store()` — accepts `AsyncIterable<Buffer>` sources (renamed from `storeFile`).
423
861
  - Multi-stage Dockerfile (Node 22, Bun, Deno) with `docker-compose.yml` for per-runtime testing.
@@ -430,14 +868,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
430
868
  - Deterministic test digest helper (`digestOf`).
431
869
 
432
870
  ### Changed
871
+
433
872
  - `CasService` domain layer has zero `node:*` imports — all platform dependencies injected via ports.
434
873
  - Constructor requires `crypto` and `codec` params (no defaults); facade supplies them.
435
874
  - Facade `storeFile()` now opens the file and delegates to `CasService.store()`.
436
875
 
437
876
  ### Fixed
877
+
438
878
  - None.
439
879
 
440
880
  ### Security
881
+
441
882
  - None.
442
883
 
443
884
  ## [1.0.0] - 2025-05-30
@@ -454,10 +895,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
454
895
  - Docker-based test runner for reproducible CI builds.
455
896
 
456
897
  ### Changed
898
+
457
899
  - None.
458
900
 
459
901
  ### Fixed
902
+
460
903
  - None.
461
904
 
462
905
  ### Security
906
+
463
907
  - None.