@git-stunts/git-cas 5.3.1 → 6.0.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 +1006 -0
- package/ARCHITECTURE.md +514 -0
- package/CHANGELOG.md +401 -4
- package/CODE_OF_CONDUCT.md +33 -0
- package/GUIDE.md +872 -0
- package/README.md +219 -325
- package/SECURITY.md +993 -0
- package/SUPPORT.md +54 -0
- package/UPGRADING.md +299 -0
- package/bin/actions.js +72 -20
- package/bin/agent/cli.js +51 -0
- package/bin/agent/commands/doctor.js +99 -0
- package/bin/agent/commands/index.js +1489 -0
- package/bin/agent/input.js +619 -0
- package/bin/agent/passphrase-source.js +123 -0
- package/bin/agent/protocol.js +193 -0
- package/bin/build-version.js +64 -0
- package/bin/credentials.js +425 -0
- package/bin/git-cas.js +604 -450
- package/bin/io.js +86 -0
- package/bin/passphrase-source.js +266 -0
- package/bin/restore-output-target.js +28 -0
- package/bin/ui/blocks/asset-card.js +109 -0
- package/bin/ui/blocks/health-dashboard.js +149 -0
- package/bin/ui/blocks/heatmap-block.js +67 -0
- package/bin/ui/blocks/merkle-explorer.js +163 -0
- package/bin/ui/blocks/operation-feed.js +176 -0
- package/bin/ui/blocks/wizard-block.js +168 -0
- package/bin/ui/components/short-sha.js +36 -0
- package/bin/ui/context.js +56 -1
- package/bin/ui/dashboard-cmds.js +1578 -13
- package/bin/ui/dashboard-view.js +612 -145
- package/bin/ui/dashboard.js +998 -214
- package/bin/ui/encryption-card.js +69 -26
- package/bin/ui/heatmap.js +26 -54
- package/bin/ui/history-timeline.js +51 -19
- package/bin/ui/manifest-view.js +115 -60
- package/bin/ui/merkle-dag.js +83 -0
- package/bin/ui/progress.js +15 -9
- package/bin/ui/repo-treemap.js +328 -0
- package/bin/ui/shaders/bak-sneppen.js +180 -0
- package/bin/ui/shaders/fractal-zoom.js +99 -0
- package/bin/ui/shaders/merkle-tree.js +142 -0
- package/bin/ui/shaders/organic-flow.js +96 -0
- package/bin/ui/shaders/phase-portrait.js +93 -0
- package/bin/ui/store-wizard.js +296 -0
- package/bin/ui/theme.js +155 -0
- package/bin/ui/vault-report.js +495 -0
- package/build-info.json +4 -0
- package/docs/API.md +2224 -0
- package/docs/ENCRYPTION_MODES.md +33 -0
- package/docs/EXTENDING.md +174 -0
- package/docs/STORE_RESTORE_PIPELINE.md +199 -0
- package/docs/THREAT_MODEL.md +269 -0
- package/docs/VAULT_INTERNALS.md +251 -0
- package/docs/WALKTHROUGH.md +1868 -0
- package/docs/demo.gif +0 -0
- package/docs/releases/v6.0.0.md +104 -0
- package/examples/README.md +260 -0
- package/index.d.ts +208 -65
- package/index.js +163 -54
- package/package.json +35 -6
- package/scripts/migrate-encryption.js +680 -0
- package/src/domain/bytes/ByteLayout.js +96 -0
- package/src/domain/encoding/base64.js +91 -0
- package/src/domain/encoding/hex.js +14 -0
- package/src/domain/encoding/utf8.js +123 -0
- package/src/domain/encryption/schemes.js +132 -0
- package/src/domain/errors/CannotRemoveLastRecipientError.js +10 -0
- package/src/domain/errors/CasError.d.ts +28 -0
- package/src/domain/errors/CasError.js +43 -6
- package/src/domain/errors/Codes.js +54 -0
- package/src/domain/errors/DekUnwrapFailedError.js +10 -0
- package/src/domain/errors/GitError.js +10 -0
- package/src/domain/errors/GitPlumbingInitializationError.js +10 -0
- package/src/domain/errors/IntegrityError.js +10 -0
- package/src/domain/errors/InvalidChunkingStrategyError.js +10 -0
- package/src/domain/errors/InvalidOidError.js +10 -0
- package/src/domain/errors/InvalidOptionsError.js +10 -0
- package/src/domain/errors/ManifestIntegrityError.js +10 -0
- package/src/domain/errors/ManifestNotFoundError.js +10 -0
- package/src/domain/errors/NoMatchingRecipientError.js +10 -0
- package/src/domain/errors/PersistenceCapabilityRequiredError.js +10 -0
- package/src/domain/errors/PortNotImplementedError.js +10 -0
- package/src/domain/errors/RecipientAlreadyExistsError.js +10 -0
- package/src/domain/errors/RecipientNotFoundError.js +10 -0
- package/src/domain/errors/RestoreTooLargeError.js +10 -0
- package/src/domain/errors/RotationNotSupportedError.js +10 -0
- package/src/domain/errors/createCasError.js +68 -0
- package/src/domain/errors/index.js +20 -0
- package/src/domain/helpers/buildKdfMetadata.js +4 -2
- package/src/domain/helpers/codecBytes.js +34 -0
- package/src/domain/helpers/gitRefErrors.js +84 -0
- package/src/domain/helpers/scryptMaxmem.js +22 -0
- package/src/domain/outcomes/RestoreFailure.js +15 -0
- package/src/domain/outcomes/RestoreOutcome.js +11 -0
- package/src/domain/outcomes/RestoreSuccess.js +34 -0
- package/src/domain/outcomes/StoreFailure.js +15 -0
- package/src/domain/outcomes/StoreOutcome.js +11 -0
- package/src/domain/outcomes/StoreSuccess.js +17 -0
- package/src/domain/schemas/ManifestSchema.d.ts +40 -9
- package/src/domain/schemas/ManifestSchema.js +67 -13
- package/src/domain/services/CasService.d.ts +123 -38
- package/src/domain/services/CasService.js +298 -834
- package/src/domain/services/ChunkRepository.js +230 -0
- package/src/domain/services/CompressionStreams.js +72 -0
- package/src/domain/services/ConvergentEncryption.js +128 -0
- package/src/domain/services/GitTreeBuilder.js +86 -0
- package/src/domain/services/IntegrityVerifier.js +199 -0
- package/src/domain/services/KeyResolver.js +49 -42
- package/src/domain/services/ManifestDiff.js +56 -0
- package/src/domain/services/ManifestRepository.js +286 -0
- package/src/domain/services/PrefetchWindow.js +48 -0
- package/src/domain/services/RecipientService.js +157 -0
- package/src/domain/services/RedactingObservability.js +169 -0
- package/src/domain/services/RestorePipeline.js +68 -0
- package/src/domain/services/StorePipeline.js +201 -0
- package/src/domain/services/VaultKeyVerifier.js +101 -0
- package/src/domain/services/VaultMetadataCodec.js +206 -0
- package/src/domain/services/VaultMutationRetryPolicy.js +105 -0
- package/src/domain/services/VaultPersistence.js +410 -0
- package/src/domain/services/VaultPrivacyIndex.js +191 -0
- package/src/domain/services/VaultService.js +749 -251
- package/src/domain/services/VaultStateCache.js +225 -0
- package/src/domain/services/VaultTreeCodec.js +121 -0
- package/src/domain/services/rotateVaultPassphrase.js +37 -20
- package/src/domain/strategies/Aad.js +39 -0
- package/src/domain/strategies/FramedRecordCodec.js +204 -0
- package/src/domain/strategies/RestoreCompressed.js +40 -0
- package/src/domain/strategies/RestoreConvergent.js +44 -0
- package/src/domain/strategies/RestoreFramed.js +55 -0
- package/src/domain/strategies/RestorePlain.js +37 -0
- package/src/domain/strategies/RestoreStrategy.js +35 -0
- package/src/domain/strategies/RestoreWhole.js +135 -0
- package/src/domain/strategies/StoreConvergent.js +28 -0
- package/src/domain/strategies/StoreFramed.js +39 -0
- package/src/domain/strategies/StorePlain.js +20 -0
- package/src/domain/strategies/StoreStrategy.js +61 -0
- package/src/domain/strategies/StoreWhole.js +34 -0
- package/src/domain/value-objects/Chunk.js +1 -2
- package/src/domain/value-objects/EncryptionMetadata.js +87 -0
- package/src/domain/value-objects/Manifest.d.ts +40 -4
- package/src/domain/value-objects/Manifest.js +61 -20
- package/src/domain/value-objects/Oid.js +45 -0
- package/src/domain/value-objects/Slug.js +124 -0
- package/src/domain/value-objects/StoreEncryptionConfig.js +114 -0
- package/src/helpers/aesGcmMeta.js +55 -0
- package/src/helpers/canonicalBase64.js +1 -0
- package/src/helpers/kdfPolicy.js +194 -0
- package/src/infrastructure/adapters/BunCryptoAdapter.js +124 -8
- package/src/infrastructure/adapters/FileIOHelper.js +178 -13
- package/src/infrastructure/adapters/GitPersistenceAdapter.js +235 -42
- package/src/infrastructure/adapters/GitPlumbingFactoryAdapter.js +62 -0
- package/src/infrastructure/adapters/GitRefAdapter.js +19 -6
- package/src/infrastructure/adapters/NodeCompressionAdapter.js +64 -0
- package/src/infrastructure/adapters/NodeCryptoAdapter.js +130 -10
- package/src/infrastructure/adapters/WebCryptoAdapter.js +187 -77
- package/src/infrastructure/chunkers/CdcChunker.js +53 -19
- package/src/infrastructure/chunkers/FixedChunker.js +15 -7
- package/src/infrastructure/chunkers/resolveChunker.js +3 -1
- package/src/infrastructure/codecs/CborCodec.js +3 -3
- package/src/infrastructure/codecs/JsonCodec.js +5 -5
- package/src/infrastructure/createGitPlumbing.js +22 -0
- package/src/package-version.js +1 -0
- package/src/ports/ChunkingPort.js +3 -3
- package/src/ports/CodecPort.js +4 -4
- package/src/ports/CompressionPort.js +57 -0
- package/src/ports/CryptoPort.js +138 -50
- package/src/ports/GitPersistencePort.js +32 -2
- package/src/ports/GitPlumbingFactoryPort.js +16 -0
- package/src/ports/GitRefPort.js +1 -1
- package/src/types/ambient.d.ts +10 -5
- package/test/CONVENTIONS.md +94 -0
- package/test/cycles/README.md +13 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,9 +5,360 @@ 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
|
|
9
|
+
|
|
10
|
+
### Breaking Changes
|
|
11
|
+
|
|
12
|
+
- **JSR publication deferred for v6.0.0** — The npm package and GitHub Release
|
|
13
|
+
are the release targets for v6.0.0. JSR metadata and the `jsr-publish`
|
|
14
|
+
verification step remain in the repository, while
|
|
15
|
+
`npm run release:verify -- --skip-jsr` records the skipped dry-run during the
|
|
16
|
+
upstream JSR/Deno toolchain blocker. Consumers of the
|
|
17
|
+
`@git-stunts/git-cas` JSR package should migrate to npm for v6.0.0 or stay on
|
|
18
|
+
the last JSR-published version.
|
|
19
|
+
- **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).
|
|
20
|
+
- **AAD is always on** — `whole` and `framed` encryption always bind slug-based AAD into the GCM tag. The v1 no-AAD path is removed.
|
|
21
|
+
- **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`.
|
|
22
|
+
- **`ContentAddressableStore.open()` is async** — callers must now use
|
|
23
|
+
`await ContentAddressableStore.open({ cwd })` so the `@git-stunts/plumbing`
|
|
24
|
+
v3 factory can validate the working directory and select the runtime runner
|
|
25
|
+
before returning the facade.
|
|
26
|
+
- **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`.
|
|
27
|
+
- See [UPGRADING.md](./UPGRADING.md) for the full migration guide.
|
|
28
|
+
|
|
29
|
+
### Added
|
|
30
|
+
|
|
31
|
+
- **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.
|
|
32
|
+
- **`ContentAddressableStore.open({ cwd })`** — new default facade factory that
|
|
33
|
+
constructs the Git plumbing adapter for normal application setup.
|
|
34
|
+
- **Store/restore pipeline state-machine docs** — added
|
|
35
|
+
`docs/STORE_RESTORE_PIPELINE.md` as the maintainer map for store, restore,
|
|
36
|
+
tree publication, and vault boundaries.
|
|
37
|
+
- **Vault internals maintainer docs** — added
|
|
38
|
+
`docs/VAULT_INTERNALS.md` to document the vault collaborator model, cache
|
|
39
|
+
rules, boundary codecs, privacy index, key verifier, and retry policy.
|
|
40
|
+
- **Public `CasError` export** — `CasError` is now re-exported from the package
|
|
41
|
+
root for callers that need typed error handling without deep imports.
|
|
42
|
+
- **`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.
|
|
43
|
+
- **`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.
|
|
44
|
+
- **`mapToCurrentScheme()` and `isLegacyNoAad()` in `schemes.js`** — public helpers for mapping legacy scheme strings to current names and detecting v1 no-AAD schemes.
|
|
45
|
+
- **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.
|
|
46
|
+
- **`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.
|
|
47
|
+
- **`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.
|
|
48
|
+
- **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.
|
|
49
|
+
- **Encrypted vault passphrase verifier** — new encrypted vaults store an
|
|
50
|
+
AES-GCM verifier in `.vault.json`, `readState({ encryptionKey })` validates
|
|
51
|
+
it when a key is supplied, CLI/agent vault passphrase flows reject wrong
|
|
52
|
+
passphrases before accepting empty-vault writes, and legacy encrypted vaults
|
|
53
|
+
gain verifier metadata on the next keyed vault write.
|
|
54
|
+
- **`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.
|
|
55
|
+
- **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.
|
|
56
|
+
- **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.
|
|
57
|
+
- **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.
|
|
58
|
+
- **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.
|
|
59
|
+
- **`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.
|
|
60
|
+
- **`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.
|
|
61
|
+
- **`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.
|
|
62
|
+
- **`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.
|
|
63
|
+
- **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.
|
|
64
|
+
- **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.
|
|
65
|
+
- **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.
|
|
66
|
+
- **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.
|
|
67
|
+
- **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.
|
|
68
|
+
- **Workflow model** — added [WORKFLOW.md](./WORKFLOW.md), explicit legends/backlog/invariants directories, and a cycle-first planning model for fresh work.
|
|
69
|
+
- **Review automation baseline** — added `.github/CODEOWNERS` with repo-wide ownership for `@git-stunts`.
|
|
70
|
+
- **Release runbook** — added `docs/RELEASE.md` and linked it from `CONTRIBUTING.md` as the canonical patch-release workflow.
|
|
71
|
+
- **`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.
|
|
72
|
+
- **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.
|
|
73
|
+
- **`git cas vault stats`** — new vault summary command reports logical size, chunk references, dedupe ratio, encryption coverage, compression usage, and chunking strategy breakdowns.
|
|
74
|
+
- **`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.
|
|
75
|
+
- **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.
|
|
76
|
+
- **`CompressionPort`** — new abstract port (`src/ports/CompressionPort.js`) for buffer and streaming compression/decompression. Follows the same abstract-port pattern as `ChunkingPort` and `CryptoPort`.
|
|
77
|
+
- **`NodeCompressionAdapter`** — new adapter (`src/infrastructure/adapters/NodeCompressionAdapter.js`) implementing `CompressionPort` via `node:zlib` gzip/gunzip. Both buffer and async-iterable streaming interfaces.
|
|
78
|
+
|
|
79
|
+
### Changed
|
|
80
|
+
|
|
81
|
+
- **CasService de-sludged into runtime strategy boundaries** — `CasService.js`
|
|
82
|
+
is now a lean facade under 500 lines. Byte-level chunk I/O, compression,
|
|
83
|
+
manifest/tree publication, integrity verification, recipient mutation, framed
|
|
84
|
+
record parsing, and store/restore strategy execution now live in dedicated
|
|
85
|
+
domain services and strategy entities with direct unit coverage. Public
|
|
86
|
+
`CasService` store/restore/manifest/recipient APIs are unchanged.
|
|
87
|
+
- **VaultService decomposed into cohesive collaborators** — `VaultService.js`
|
|
88
|
+
now orchestrates public vault use cases while `VaultPersistence` owns
|
|
89
|
+
`refs/cas/vault` persistence, `VaultStateCache` owns tree-OID keyed state
|
|
90
|
+
memoization, `VaultMetadataCodec` and `VaultTreeCodec` own pure boundary
|
|
91
|
+
encoding, and dedicated privacy, verifier, and retry-policy collaborators own
|
|
92
|
+
HMAC index handling, constant-time key verification, and CAS retry timing.
|
|
93
|
+
Public vault APIs and the on-disk vault tree format are unchanged.
|
|
94
|
+
- **Privacy vault passphrase rotation preserved** — vault passphrase rotation now
|
|
95
|
+
reads metadata before full state so privacy-enabled vaults can derive the old
|
|
96
|
+
key, decrypt `.privacy-index`, and rebuild the index under the replacement key.
|
|
97
|
+
- **Structured KDF algorithm errors** — unsupported stored or requested KDF
|
|
98
|
+
algorithms now fail with `KDF_POLICY_VIOLATION`, and vault metadata decoding
|
|
99
|
+
normalizes those policy failures to `VAULT_METADATA_INVALID` instead of
|
|
100
|
+
leaking raw `Error` instances.
|
|
101
|
+
- **Vault ref creation is create-only** — first vault writes now pass Git's
|
|
102
|
+
all-zero expected OID when `expectedOldOid` is `null`, preserving CAS
|
|
103
|
+
semantics during concurrent vault initialization.
|
|
104
|
+
- **Metadata blob limits reach the default Git adapter** — `maxBlobSize`
|
|
105
|
+
constructor options now configure `GitPersistenceAdapter.readBlob()` when no
|
|
106
|
+
per-call limit is supplied.
|
|
107
|
+
- **Git blob per-call limits are validated** — `GitPersistenceAdapter.readBlob()`
|
|
108
|
+
now rejects invalid caller-provided `maxBytes` limits with `INVALID_OPTIONS`
|
|
109
|
+
before opening a Git blob stream.
|
|
110
|
+
- **API `maxBlobSize` wording** — `docs/API.md` now documents the constructor
|
|
111
|
+
option as the metadata blob read limit, matching the runtime service contract.
|
|
112
|
+
- **Manifest diff JSDoc boundary** — `ManifestDiff.js` now declares its
|
|
113
|
+
`Manifest` typedef locally so generated docs and declaration checks can
|
|
114
|
+
resolve the pure diff helper parameters.
|
|
115
|
+
- **Vault metadata API docs** — `docs/API.md` now includes the optional
|
|
116
|
+
`privacy` shape in the `VaultMetadata` example alongside the privacy error
|
|
117
|
+
codes.
|
|
118
|
+
- **Vault keyed caches snapshot key bytes** — privacy-entry and verifier caches
|
|
119
|
+
now reject stale hits when a reused `Uint8Array` key object has been mutated.
|
|
120
|
+
- **Vault state caches return defensive entry maps** — `VaultStateCache` now
|
|
121
|
+
copies cached plain and privacy entry maps before returning them, so caller
|
|
122
|
+
mutations cannot poison subsequent reads from the same tree snapshot.
|
|
123
|
+
- **Vault privacy cache deduplicates in-flight work** — concurrent privacy
|
|
124
|
+
reads for the same cached tree and key object now share one `.privacy-index`
|
|
125
|
+
resolution instead of decrypting the same index multiple times.
|
|
126
|
+
- **Vault tree cache is bounded** — `VaultStateCache` now uses a validated
|
|
127
|
+
LRU capacity instead of retaining every immutable tree snapshot for the
|
|
128
|
+
lifetime of the service.
|
|
129
|
+
- **Vault verifier checks reuse cached proofs** — keyed list, resolve, and
|
|
130
|
+
mutation paths now reuse the verifier memo stored by `readState()` for the
|
|
131
|
+
same immutable vault tree instead of decrypting the verifier repeatedly.
|
|
132
|
+
- **Vault verifier cache regression coverage** — mutation memoization tests now
|
|
133
|
+
exercise the intended cross-operation path by calling
|
|
134
|
+
`readState({ encryptionKey })` before the keyed vault write.
|
|
135
|
+
- **Review-feedback test style guards** — privacy error assertions now use
|
|
136
|
+
`ErrorCodes` constants, and ManifestDiff declaration checks use regex matching
|
|
137
|
+
so benign JSDoc formatting does not break release tests.
|
|
138
|
+
- **Stdout-only missing vault refs** — Git ref resolution now treats
|
|
139
|
+
`rev-parse refs/cas/vault` failures that only echo the unresolved ref on
|
|
140
|
+
stdout as `GIT_REF_NOT_FOUND`, preventing empty-vault initialization flakes
|
|
141
|
+
from surfacing as `VAULT_HEAD_INVALID`.
|
|
142
|
+
- **Vault metadata enforces the AES-GCM cipher boundary** — `.vault.json`
|
|
143
|
+
metadata now rejects unsupported `encryption.cipher` values with
|
|
144
|
+
`VAULT_METADATA_INVALID`; the v6 vault metadata format remains AES-256-GCM.
|
|
145
|
+
- **Vault metadata rejects malformed encryption placeholders** — `.vault.json`
|
|
146
|
+
payloads with present but falsy `encryption` values now fail with
|
|
147
|
+
`VAULT_METADATA_INVALID` instead of being treated as plaintext vaults.
|
|
148
|
+
- **Doctor rejects vault heads without metadata** — `git cas doctor` now fails
|
|
149
|
+
with `VAULT_METADATA_INVALID` when `refs/cas/vault` exists but `.vault.json`
|
|
150
|
+
is missing or invalid.
|
|
151
|
+
- **Unreadable vault heads stay visible** — vault head resolution now returns an
|
|
152
|
+
empty state only when the vault ref is absent; unreadable refs or commits that
|
|
153
|
+
cannot resolve to a tree fail with `VAULT_HEAD_INVALID`.
|
|
154
|
+
- **Vault ref update failures stay non-retryable unless they are CAS conflicts**
|
|
155
|
+
— `VaultPersistence` now emits `VAULT_REF_UPDATE_FAILED` for generic
|
|
156
|
+
update-ref failures and reserves `VAULT_CONFLICT` for structured
|
|
157
|
+
expected-vs-actual OID mismatches.
|
|
158
|
+
- **Plumbing missing-ref errors stay non-fatal** — vault head resolution now
|
|
159
|
+
recognizes `@git-stunts/plumbing` missing-ref stderr details as an absent
|
|
160
|
+
vault while still surfacing unrelated ref failures. Object database failures
|
|
161
|
+
and corrupt head stderr are reported as `VAULT_HEAD_INVALID`.
|
|
162
|
+
- **Git ref missing errors are structured at the adapter boundary** —
|
|
163
|
+
`GitRefAdapter.resolveRef()` now normalizes known Git missing-ref stderr to
|
|
164
|
+
`GIT_REF_NOT_FOUND`, leaving VaultPersistence's text fallback only for
|
|
165
|
+
third-party ref ports.
|
|
166
|
+
- **Vault missing-ref fallback documented** — `VaultPersistence` now documents
|
|
167
|
+
its third-party-port missing-ref stderr fallback as C/English-locale
|
|
168
|
+
best-effort behavior; structured `GIT_REF_NOT_FOUND` remains the primary path.
|
|
169
|
+
- **Vault metadata snapshot docs** — `VaultPersistence.readMetadataSnapshot()`
|
|
170
|
+
now explicitly documents that iterator metadata reads avoid full-tree
|
|
171
|
+
materialization and therefore return no cache snapshot.
|
|
172
|
+
- **VaultService DI guard** — the constructor now rejects mixed
|
|
173
|
+
`vaultPersistence` and legacy `persistence`/`ref` injection, and reports a
|
|
174
|
+
focused dependency error when the legacy pair is incomplete.
|
|
175
|
+
- **Doctor can inspect privacy vaults** — human and agent `doctor` commands now
|
|
176
|
+
accept raw vault keys, vault passphrase sources, and OS-keychain targets so
|
|
177
|
+
privacy-enabled vaults can be diagnosed without falling back to a missing-key
|
|
178
|
+
failure. Agent diagnostics now ignore passphrase input with a warning when the
|
|
179
|
+
vault is plaintext, and the TUI operations doctor forwards the already-unlocked
|
|
180
|
+
vault key.
|
|
181
|
+
- **Privacy index mismatches fail closed** — privacy-mode `readState()`,
|
|
182
|
+
`listVault()`, and doctor scans now fail with `VAULT_PRIVACY_INDEX_INVALID`
|
|
183
|
+
when `.privacy-index` does not cover every raw HMAC tree entry, avoiding
|
|
184
|
+
partial listings that could hide vault corruption.
|
|
185
|
+
- **Privacy index metadata fails closed** — privacy-enabled vaults missing
|
|
186
|
+
`privacy.indexMeta` now fail with structured `VAULT_PRIVACY_INDEX_INVALID`
|
|
187
|
+
metadata before decrypting or resolving privacy-mode entries.
|
|
188
|
+
- **Doctor reports byte-level dedupe** — vault stats and doctor output now
|
|
189
|
+
include total chunk bytes, unique chunk bytes, duplicate chunk bytes, and a
|
|
190
|
+
byte-level dedupe ratio alongside chunk-reference counts.
|
|
191
|
+
- **TUI doctor dashboard shows byte economics** — the health dashboard now
|
|
192
|
+
renders chunk bytes, unique chunk bytes, duplicate chunk bytes, and the
|
|
193
|
+
byte-level dedupe ratio instead of only reference counts.
|
|
194
|
+
- **Recipient rotation scans every candidate** — unlabeled `rotateKey()` now
|
|
195
|
+
attempts every recipient unwrap before selecting the first match, reducing
|
|
196
|
+
recipient-position timing leakage while preserving existing rotation results.
|
|
197
|
+
- **Behavior-focused vault tests** — removed the source-layout-only
|
|
198
|
+
`VaultService` structure test and added a test-style guard against
|
|
199
|
+
`.structure.test.js` files.
|
|
200
|
+
- **Current vault tree-path terminology** — renamed the stale
|
|
201
|
+
`encodeSlug.test.js` coverage to `VaultTreePath.test.js` and updated comments
|
|
202
|
+
to describe the `Slug` tree-path boundary.
|
|
203
|
+
- **Facade restore guidance links to versioned docs** — missing
|
|
204
|
+
`restoreFile({ baseDirectory })` errors now serialize a v6.0.0 API docs URL
|
|
205
|
+
and use the centralized `INVALID_OPTIONS` error code.
|
|
206
|
+
- **Restore path symlink boundary** — `restoreFile()` now canonicalizes
|
|
207
|
+
existing path components before stream or bounded-file publication, blocking
|
|
208
|
+
symlinked output directories that resolve outside `baseDirectory`.
|
|
209
|
+
- **CLI restore output validation** — restore target resolution now rejects
|
|
210
|
+
empty `--out` values with `INVALID_OPTIONS` instead of resolving them to the
|
|
211
|
+
current directory.
|
|
212
|
+
- **Vault retry policies validate injected hooks** — `VaultMutationRetryPolicy`
|
|
213
|
+
now rejects non-function `random`/`sleep` dependencies at construction and
|
|
214
|
+
freezes configured policy instances.
|
|
215
|
+
- **Walkthrough documents per-operation Merkle thresholds** — Merkle guidance
|
|
216
|
+
now shows `storeFile({ merkleThreshold })` as the primary override and keeps
|
|
217
|
+
constructor-level thresholds framed as defaults.
|
|
218
|
+
- **VaultService module header normalized** — the fileoverview block now
|
|
219
|
+
appears before imports, and the service header imports errors through the
|
|
220
|
+
internal errors barrel.
|
|
221
|
+
- **Per-operation Merkle threshold** — `store()` and `storeFile()` now accept a
|
|
222
|
+
`merkleThreshold` option that carries through to the corresponding
|
|
223
|
+
`createTree()` publication unless an explicit `createTree()` threshold is
|
|
224
|
+
supplied.
|
|
225
|
+
- **Restore guidance surfaced in errors and docs** — missing `restoreFile()`
|
|
226
|
+
`baseDirectory` errors now explain the trusted-local `process.cwd()` option,
|
|
227
|
+
structured CLI/agent errors can include documentation URLs, and the v6 docs
|
|
228
|
+
call out the mandatory restore boundary.
|
|
229
|
+
- **Metadata blob limit constantized** — `GitPersistenceAdapter` now uses a
|
|
230
|
+
named `DEFAULT_MAX_BLOB_SIZE` constant for the default 10 MiB metadata-read
|
|
231
|
+
cap and reports the effective limit in `RESTORE_TOO_LARGE` errors.
|
|
232
|
+
- **OS-keychain passphrase lookup awaits vault v2 secrets** — CLI credential
|
|
233
|
+
resolution now awaits the async `@git-stunts/vault` secret lookup before
|
|
234
|
+
validating and returning the passphrase.
|
|
235
|
+
- **Git plumbing dependency aligned to npm latest** — `@git-stunts/plumbing`
|
|
236
|
+
now targets `^3.0.3`. `@git-stunts/vault` remains on the registry-latest
|
|
237
|
+
`^1.0.1`, and `@git-stunts/trailer-codec` remains outside the runtime
|
|
238
|
+
dependency graph because `git-cas` does not use commit trailers.
|
|
239
|
+
- **Async Git plumbing factory boundary** — `ContentAddressableStore.open()` and
|
|
240
|
+
shared CLI plumbing construction now await the `@git-stunts/plumbing` v3
|
|
241
|
+
async factory through a dedicated infrastructure adapter and factory port,
|
|
242
|
+
keeping working-directory validation, runtime selection, and package-specific
|
|
243
|
+
errors out of the domain layer.
|
|
244
|
+
- **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.
|
|
245
|
+
- **Slug value object** — vault slug validation and plain vault tree-entry
|
|
246
|
+
percent encoding now live in `Slug`, including `.toTreePath()` for the Git
|
|
247
|
+
tree-entry representation used by `VaultService`.
|
|
248
|
+
- **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.
|
|
249
|
+
- **WebCryptoAdapter HMAC is Web Crypto native** — HMAC-SHA256 now uses `crypto.subtle.sign()` instead of importing Node crypto into the Web adapter.
|
|
250
|
+
- **Plaintext+compressed restore is now streaming** — compressed unencrypted data uses `_restoreCompressedStreaming` instead of the buffered path, eliminating the `maxRestoreBufferSize` constraint for this case.
|
|
251
|
+
- **`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.
|
|
252
|
+
- **`CryptoPort._buildMeta` default scheme** — changed to the current `whole` identifier.
|
|
253
|
+
- **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.
|
|
254
|
+
- **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.
|
|
255
|
+
- **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.
|
|
256
|
+
- **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.
|
|
257
|
+
- **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.
|
|
258
|
+
- **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.
|
|
259
|
+
- **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.
|
|
260
|
+
- **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.
|
|
261
|
+
- **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.
|
|
262
|
+
- **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.
|
|
263
|
+
- **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.
|
|
264
|
+
- **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.
|
|
265
|
+
- **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.
|
|
266
|
+
- **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.
|
|
267
|
+
- **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.
|
|
268
|
+
- **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.
|
|
269
|
+
- **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.
|
|
270
|
+
- **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.
|
|
271
|
+
- **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.
|
|
272
|
+
- **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.
|
|
273
|
+
- **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.
|
|
274
|
+
- **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.
|
|
275
|
+
- **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.
|
|
276
|
+
- **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.
|
|
277
|
+
- **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.
|
|
278
|
+
- **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.
|
|
279
|
+
|
|
280
|
+
### Fixed
|
|
281
|
+
|
|
282
|
+
- **Agent diagnostic passphrase resolver guard** — encrypted `git cas agent
|
|
283
|
+
doctor` requests now fail with a controlled credential error when a structured
|
|
284
|
+
passphrase source is supplied without the resolver dependency.
|
|
285
|
+
- **Doctor byte dedupe metric** — vault health statistics now compute byte
|
|
286
|
+
dedupe from stored chunk bytes instead of logical file size, keeping
|
|
287
|
+
compression and deduplication signals separate.
|
|
288
|
+
- **Docker version fallback** — CLI version resolution now ignores the
|
|
289
|
+
`unknown` build metadata sentinel written when Docker test images have neither
|
|
290
|
+
`.git` metadata nor a stamped package SHA, so `git-cas --version` falls back to
|
|
291
|
+
plain semver instead of emitting `+unknown`.
|
|
292
|
+
- **Docker unit-test stability** — vault passphrase-rotation unit coverage now
|
|
293
|
+
uses in-memory persistence and ref ports, keeping domain behavior validation
|
|
294
|
+
independent from Docker Git subprocess scheduling.
|
|
295
|
+
- **Shared CLI/agent credential resolution** — human CLI and agent protocol
|
|
296
|
+
flows now use `bin/credentials.js` for key-file length checks, ambiguous
|
|
297
|
+
credential-source rejection, vault passphrase-derived key verification, and
|
|
298
|
+
encrypted-restore input classification.
|
|
299
|
+
- **CLI restore output authority** — human and agent CLI restore commands now
|
|
300
|
+
treat an explicit `--out` path as authority to write in that path's parent
|
|
301
|
+
directory, while `restoreFile()` keeps enforcing its library-level
|
|
302
|
+
`baseDirectory` boundary. The low-level path check now uses path-relative
|
|
303
|
+
containment instead of a string-prefix comparison.
|
|
304
|
+
- **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.
|
|
305
|
+
- **Constructor validation consistency** — direct `CasService` construction now
|
|
306
|
+
validates all required ports through the unified constructor argument
|
|
307
|
+
validator.
|
|
308
|
+
- **Caretaker dependency ranges** — `@flyingrobots/bijou-*` dependencies now
|
|
309
|
+
use consistent `^5.0.0` ranges for the v6 release line.
|
|
310
|
+
- **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.
|
|
311
|
+
- **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.
|
|
312
|
+
- **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.
|
|
313
|
+
- **Facade factory option forwarding** — `createJson()` and `createCbor()` now
|
|
314
|
+
pass advanced facade options through to the underlying service instead of
|
|
315
|
+
silently dropping them.
|
|
316
|
+
- **Convergent auto-selection observability** — CDC encrypted stores now warn
|
|
317
|
+
when deterministic `convergent` encryption is selected implicitly.
|
|
318
|
+
- **Git tree-entry formatting boundary** — `CasService` now delegates manifest,
|
|
319
|
+
sub-manifest, and chunk tree-entry construction to `GitTreeBuilder`.
|
|
320
|
+
- **In-memory persistence test helper** — `MemoryPersistenceAdapter` now proves
|
|
321
|
+
domain store/tree/read/restore workflows without Git subprocesses.
|
|
322
|
+
- **CasService orchestration boundaries** — store write scheduling,
|
|
323
|
+
backpressure, in-flight write tracking, and store error normalization now live
|
|
324
|
+
in `StorePipeline`; restore strategy classification and handler dispatch now
|
|
325
|
+
live in `RestorePipeline`. The public `CasService` API is unchanged.
|
|
326
|
+
- **Vault state read caching** — `VaultService.readState()` now caches parsed
|
|
327
|
+
vault tree state by unchanged tree OID, returns defensive copies to callers,
|
|
328
|
+
and invalidates automatically when the vault ref resolves to a different tree.
|
|
329
|
+
- **Agent CLI module boundary** — `bin/agent/cli.js` is now a thin protocol
|
|
330
|
+
shell, command handlers live under `bin/agent/commands/`, shared request and
|
|
331
|
+
credential-input helpers live in `bin/agent/input.js`, and a module-boundary
|
|
332
|
+
regression test guards the split.
|
|
333
|
+
- **Vault metadata validation** — malformed vault `encryptionCount` metadata is rejected before encrypted vault writes can corrupt nonce accounting or bypass the configured encryption-count cap.
|
|
334
|
+
- **Vault passphrase rotation verifier preservation** — vault passphrase
|
|
335
|
+
rotation now authenticates the old key against verifier metadata when present
|
|
336
|
+
and writes a fresh verifier for the new key.
|
|
337
|
+
- **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.
|
|
338
|
+
- **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.
|
|
339
|
+
- **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.
|
|
340
|
+
- **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.
|
|
341
|
+
- **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.
|
|
342
|
+
- **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.
|
|
343
|
+
- **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.
|
|
344
|
+
- **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.
|
|
345
|
+
- **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.
|
|
346
|
+
|
|
347
|
+
## [5.3.2] — 2026-03-15
|
|
348
|
+
|
|
349
|
+
### Changed
|
|
350
|
+
|
|
351
|
+
- **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.
|
|
352
|
+
- **Status semantics** — `STATUS.md` now distinguishes the last released version (`v5.3.1`) from the current branch version (`v5.3.2`).
|
|
353
|
+
|
|
354
|
+
### Fixed
|
|
355
|
+
|
|
356
|
+
- **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.
|
|
357
|
+
|
|
8
358
|
## [5.3.1] — 2026-03-15
|
|
9
359
|
|
|
10
360
|
### Fixed
|
|
361
|
+
|
|
11
362
|
- **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.
|
|
12
363
|
- **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.
|
|
13
364
|
- **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.
|
|
@@ -15,6 +366,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
15
366
|
## [5.3.0] — 2026-03-08
|
|
16
367
|
|
|
17
368
|
### Added
|
|
369
|
+
|
|
18
370
|
- **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.
|
|
19
371
|
- **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.
|
|
20
372
|
- **CLI restore flags** — `--concurrency <n>`, `--max-restore-buffer <n>`. Parallel I/O and restore buffer limit now configurable from CLI.
|
|
@@ -33,6 +385,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
33
385
|
- **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.
|
|
34
386
|
|
|
35
387
|
### Changed
|
|
388
|
+
|
|
36
389
|
- **`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.
|
|
37
390
|
- **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.
|
|
38
391
|
- **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.
|
|
@@ -43,6 +396,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
43
396
|
- **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`.
|
|
44
397
|
|
|
45
398
|
### Fixed
|
|
399
|
+
|
|
46
400
|
- **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.
|
|
47
401
|
- **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.
|
|
48
402
|
- **CRLF passphrase normalization** — `readPassphraseFile` now strips trailing `\r\n` (Windows line endings) in addition to `\n`, preventing passphrase mismatches from Windows-edited files.
|
|
@@ -65,6 +419,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
65
419
|
## [5.2.4] — Prism polish (2026-03-03)
|
|
66
420
|
|
|
67
421
|
### Fixed
|
|
422
|
+
|
|
68
423
|
- **`CryptoPortBase.sha256()` type** — `index.d.ts` declaration corrected from `string | Promise<string>` to `Promise<string>`, matching the async implementation since v5.2.3.
|
|
69
424
|
- **`keyLength` passthrough** — `KeyResolver.#resolveKeyFromPassphrase` and `deriveKekFromKdf` now forward `kdf.keyLength` to `deriveKey()`, fixing a latent bug for vaults configured with non-default key lengths.
|
|
70
425
|
- **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.
|
|
@@ -73,6 +428,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
73
428
|
- **Vestigial `lastchat.txt`** removed from `jsr.json` exclude list.
|
|
74
429
|
|
|
75
430
|
### Changed
|
|
431
|
+
|
|
76
432
|
- **`keyResolver` is now private** — `CasService.keyResolver` changed to `#keyResolver`, preventing external access to an internal implementation detail.
|
|
77
433
|
- **`VaultPassphraseRotator.js` → `rotateVaultPassphrase.js`** — renamed to follow camelCase convention for files that export a function (PascalCase is reserved for classes).
|
|
78
434
|
- **`resolveChunker` validation** — `chunkSize` now validated as a finite positive number before constructing `FixedChunker`; invalid values fall through to CasService default.
|
|
@@ -84,6 +440,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
84
440
|
## [5.2.3] — Prism refactor (2026-03-03)
|
|
85
441
|
|
|
86
442
|
### Changed
|
|
443
|
+
|
|
87
444
|
- **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>`.
|
|
88
445
|
- **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.
|
|
89
446
|
- **Move `createCryptoAdapter`** — runtime crypto detection moved from `index.js` to `src/infrastructure/adapters/createCryptoAdapter.js`; test helper now delegates instead of duplicating.
|
|
@@ -100,12 +457,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
100
457
|
## [5.2.2] — JSDoc total coverage (2026-02-28)
|
|
101
458
|
|
|
102
459
|
### Added
|
|
460
|
+
|
|
103
461
|
- `tsconfig.checkjs.json` — strict `checkJs` configuration; `tsc --noEmit` passes with zero errors.
|
|
104
462
|
- `src/types/ambient.d.ts` — ambient type declarations for `@git-stunts/plumbing` and `bun` modules.
|
|
105
463
|
- `@types/node` dev dependency for typecheck support.
|
|
106
464
|
- JSDoc `@typedef` types: `EncryptionMeta`, `KdfParamSet`, `DeriveKeyParams` (CryptoPort); `VaultMetadata`, `VaultState`, `VaultEncryptionMeta` (VaultService).
|
|
107
465
|
|
|
108
466
|
### Changed
|
|
467
|
+
|
|
109
468
|
- Every exported and internal function, class method, and callback across all 32 source files now has complete JSDoc `@param`/`@returns` annotations.
|
|
110
469
|
- CryptoPort return types widened to `string | Promise<string>` (sha256), `Buffer | Uint8Array` (randomBytes), sync-or-async for encrypt/decrypt — accurately reflecting adapter implementations.
|
|
111
470
|
- Port `@param` names corrected to match underscore-prefixed abstract parameters (fixes TS8024).
|
|
@@ -115,19 +474,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
115
474
|
## [5.2.1] — Carousel polish (2026-02-28)
|
|
116
475
|
|
|
117
476
|
### Added
|
|
477
|
+
|
|
118
478
|
- CLI reference in `docs/API.md` for `git cas rotate` and `git cas vault rotate` flags.
|
|
119
479
|
|
|
120
480
|
### Changed
|
|
481
|
+
|
|
121
482
|
- Rotation helpers in `CasService` use native `#private` methods, matching the facade's style.
|
|
122
483
|
- `VAULT_CONFLICT` and `VAULT_METADATA_INVALID` error code docs now list `rotateVaultPassphrase()`.
|
|
123
484
|
|
|
124
485
|
### Fixed
|
|
486
|
+
|
|
125
487
|
- `rotateVaultPassphrase` now honours `kdfOptions.algorithm` instead of silently using the old algorithm.
|
|
126
488
|
- Rotation integration test no longer flaps under CI load (reduced test-only KDF iterations).
|
|
127
489
|
|
|
128
490
|
## [5.2.0] — Carousel (2026-02-28)
|
|
129
491
|
|
|
130
492
|
### Added
|
|
493
|
+
|
|
131
494
|
- **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.
|
|
132
495
|
- **`keyVersion` tracking** — manifest-level and per-recipient `keyVersion` counters track rotation history for audit compliance. Optional field, backward-compatible with existing manifests.
|
|
133
496
|
- **`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.
|
|
@@ -139,6 +502,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
139
502
|
## [5.1.0] — Locksmith (2026-02-28)
|
|
140
503
|
|
|
141
504
|
### Added
|
|
505
|
+
|
|
142
506
|
- **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.
|
|
143
507
|
- **`RecipientSchema`** — Zod schema for validating recipient entries in manifests.
|
|
144
508
|
- **`recipients` field on `EncryptionSchema`** — optional array of `{ label, wrappedDek, nonce, tag }` entries.
|
|
@@ -149,6 +513,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
149
513
|
- 48 new unit tests covering envelope store/restore, recipient management, edge cases, and fuzz round-trips.
|
|
150
514
|
|
|
151
515
|
### Fixed
|
|
516
|
+
|
|
152
517
|
- **`_wrapDek` / `_unwrapDek` missing `await`** — these called async `encryptBuffer()` / `decryptBuffer()` without `await`, silently producing garbage on Bun/Deno runtimes where crypto is async.
|
|
153
518
|
- **`--recipient` + `--vault-passphrase` not guarded** — CLI now rejects combining `--recipient` with `--key-file` or `--vault-passphrase`.
|
|
154
519
|
- **Dead `_resolveEncryptionKey` method removed** — superseded by `_resolveDecryptionKey` but left behind.
|
|
@@ -164,10 +529,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
164
529
|
## [5.0.0] — Hydra (2026-02-28)
|
|
165
530
|
|
|
166
531
|
### Breaking Changes
|
|
532
|
+
|
|
167
533
|
- **`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`).
|
|
168
534
|
- **Major version bump** — new hexagonal port (`ChunkingPort`) and manifest schema extension warrant a semver-major release for downstream tooling awareness.
|
|
169
535
|
|
|
170
536
|
### Added
|
|
537
|
+
|
|
171
538
|
- **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.
|
|
172
539
|
- **`ChunkingPort`** — new hexagonal port (`src/ports/ChunkingPort.js`) with `async *chunk(source)`, `strategy`, and `params`. Abstracts chunking behind a pluggable interface.
|
|
173
540
|
- **`FixedChunker`** — adapter wrapping existing fixed-size buffer slicing behind `ChunkingPort`.
|
|
@@ -180,12 +547,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
180
547
|
- 90 new unit tests (709 total).
|
|
181
548
|
|
|
182
549
|
### Changed
|
|
550
|
+
|
|
183
551
|
- `CasService._chunkAndStore()` refactored to delegate to `ChunkingPort` instead of inline buffer slicing.
|
|
184
552
|
- `ChunkingPort`, `FixedChunker`, `CdcChunker` exported from the main entry point.
|
|
185
553
|
|
|
186
554
|
## [4.0.1] — M8 Spit Shine + M9 Cockpit (2026-02-28)
|
|
187
555
|
|
|
188
556
|
### Added
|
|
557
|
+
|
|
189
558
|
- **`git cas verify`** command — verify stored asset integrity from the CLI (checks blob hashes; no key needed).
|
|
190
559
|
- **`--json` global flag** — structured JSON output for all commands (`store`, `restore`, `verify`, `inspect`, `vault list/init/remove/info/history`).
|
|
191
560
|
- **`runAction` error handler** (`bin/actions.js`) — centralized `try`/`catch` with CasError code display and actionable hints for 5 common errors.
|
|
@@ -197,6 +566,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
197
566
|
- `WebCryptoAdapter.finalize()` guard — throws `STREAM_NOT_CONSUMED` if called before encrypt stream is fully consumed.
|
|
198
567
|
|
|
199
568
|
### Fixed
|
|
569
|
+
|
|
200
570
|
- `verify` command uses `process.exitCode = 1` instead of `process.exit(1)` to allow stdout to drain on pipes.
|
|
201
571
|
- `runAction` uses `process.exitCode = 1` for consistent exit behavior across all commands.
|
|
202
572
|
- `vault info --json --encryption` now includes encryption metadata in JSON output.
|
|
@@ -210,16 +580,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
210
580
|
- `_doDeriveKey` in `NodeCryptoAdapter` now properly `await`s promisified calls.
|
|
211
581
|
|
|
212
582
|
### Changed
|
|
583
|
+
|
|
213
584
|
- `CryptoPort` is now the single source of truth for key validation, metadata building, and KDF parameter normalization. All three adapters override only `_doDeriveKey()`.
|
|
214
585
|
- ROADMAP.md pruned: completed M1–M7 task cards moved to COMPLETED_TASKS.md.
|
|
215
586
|
|
|
216
587
|
## [4.0.0] — Conduit (2026-02-27)
|
|
217
588
|
|
|
218
589
|
### Breaking Changes
|
|
590
|
+
|
|
219
591
|
- **`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.
|
|
220
592
|
- **`observability` is a required constructor port** for `CasService`. The facade (`ContentAddressableStore`) defaults to `SilentObserver` when omitted.
|
|
221
593
|
|
|
222
594
|
### Added
|
|
595
|
+
|
|
223
596
|
- **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.
|
|
224
597
|
- **SilentObserver** — no-op adapter (default). Zero overhead when observability is not needed.
|
|
225
598
|
- **EventEmitterObserver** — bridges `metric()` calls to EventEmitter events (`chunk:stored`, `file:restored`, etc.) for backward-compatible progress tracking. Exposes `.on()`, `.removeListener()`, `.listenerCount()`.
|
|
@@ -231,6 +604,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
231
604
|
- 43 new unit tests (567 total).
|
|
232
605
|
|
|
233
606
|
### Changed
|
|
607
|
+
|
|
234
608
|
- 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.
|
|
235
609
|
- `restore()` reimplemented as a collector over `restoreStream()`.
|
|
236
610
|
- `_chunkAndStore()` refactored to use semaphore-gated parallel writes with `Promise.all`, sorting results by index after completion.
|
|
@@ -239,6 +613,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
239
613
|
## [3.1.0] — Bijou (2026-02-27)
|
|
240
614
|
|
|
241
615
|
### Added
|
|
616
|
+
|
|
242
617
|
- **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.
|
|
243
618
|
- **Manifest inspector** (`git cas inspect <tree-oid>`) — renders manifest details with chunk table, encryption info, and compression badges.
|
|
244
619
|
- **Progress bars** for `store` and `restore` operations — animated progress with throughput reporting, auto-disabled in non-TTY environments.
|
|
@@ -250,6 +625,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
250
625
|
- New runtime dependencies: `@flyingrobots/bijou`, `@flyingrobots/bijou-node`, `@flyingrobots/bijou-tui`.
|
|
251
626
|
|
|
252
627
|
### Fixed
|
|
628
|
+
|
|
253
629
|
- CLI `restore` now uses the canonical `readManifest` path instead of duplicating manifest resolution logic.
|
|
254
630
|
- Progress trackers wrapped in `try`/`finally` to prevent event listener leaks when `storeFile` or `restoreFile` throws.
|
|
255
631
|
- Dashboard filter and error lines clamped to pane width to prevent wrapping artifacts in narrow terminals.
|
|
@@ -263,6 +639,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
263
639
|
## [3.0.0] — Vault (2026-02-08)
|
|
264
640
|
|
|
265
641
|
### Added
|
|
642
|
+
|
|
266
643
|
- **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.
|
|
267
644
|
- `initVault()` — initialize the vault, optionally with passphrase-based encryption (vault-level KDF policy).
|
|
268
645
|
- `addToVault()` — add or update an entry by slug + tree OID, with `force` flag for overwrites.
|
|
@@ -286,6 +663,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
286
663
|
- 46 vault unit tests + facade delegation smoke test.
|
|
287
664
|
|
|
288
665
|
### Fixed
|
|
666
|
+
|
|
289
667
|
- `#validateMetadata` now requires `kdf.keyLength` in encryption metadata, preventing downstream KDF failures from manually edited `.vault.json` files.
|
|
290
668
|
- `#casUpdateRef` now preserves the original error in `VAULT_CONFLICT` meta for better diagnostics.
|
|
291
669
|
- CLI `--vault-passphrase` now emits a stderr warning when the vault is not encrypted, instead of silently ignoring the passphrase.
|
|
@@ -299,6 +677,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
299
677
|
- CLI uses `program.parseAsync()` instead of `program.parse()` to prevent Bun from hanging on async action handlers.
|
|
300
678
|
|
|
301
679
|
### Changed
|
|
680
|
+
|
|
302
681
|
- **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.
|
|
303
682
|
- CLI `restore` command no longer takes a positional `<tree-oid>` argument. Use `--oid <tree-oid>` or `--slug <slug>` instead.
|
|
304
683
|
- Purged completed milestones (M1–M7) and their task cards from ROADMAP.md, reducing it from 3,153 to 1,675 lines.
|
|
@@ -306,6 +685,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
306
685
|
## [2.0.0] — M7 Horizon (2026-02-08)
|
|
307
686
|
|
|
308
687
|
### Added
|
|
688
|
+
|
|
309
689
|
- **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.
|
|
310
690
|
- **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()`.
|
|
311
691
|
- **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.
|
|
@@ -315,6 +695,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
315
695
|
- Updated API reference (`docs/API.md`), guide (`GUIDE.md`), and README with v2.0.0 feature documentation.
|
|
316
696
|
|
|
317
697
|
### Changed
|
|
698
|
+
|
|
318
699
|
- **BREAKING**: Manifest schema now includes `version` field (defaults to 1). Existing v1 manifests are fully backward-compatible.
|
|
319
700
|
- `CasService` constructor accepts new `merkleThreshold` option (must be a positive integer).
|
|
320
701
|
- `ContentAddressableStore` constructor now accepts and forwards `merkleThreshold` to `CasService`.
|
|
@@ -323,6 +704,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
323
704
|
- Static imports for `createGzip` and `Readable` in `CasService` (previously dynamic imports on every call).
|
|
324
705
|
|
|
325
706
|
### Fixed
|
|
707
|
+
|
|
326
708
|
- **Sub-manifest blobs are now included as tree entries** (`sub-manifest-N.json`), preventing them from being garbage-collected by `git gc`.
|
|
327
709
|
- `storeFile()` now forwards `passphrase`, `kdfOptions`, and `compression` options to `store()` (previously silently dropped).
|
|
328
710
|
- `store()` and `restore()` reject when both `passphrase` and `encryptionKey` are provided (`INVALID_OPTIONS`).
|
|
@@ -339,19 +721,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
339
721
|
## [1.6.2] — OIDC publishing + JSR docs coverage (2026-02-07)
|
|
340
722
|
|
|
341
723
|
### Added
|
|
724
|
+
|
|
342
725
|
- JSDoc comments on all exported TypeScript interfaces (`CryptoPort`, `CodecPort`, `GitPersistencePort`, `CasServiceOptions`, `EncryptionMeta`, `ManifestData`, `ContentAddressableStoreOptions`) to reach 100% JSR symbol documentation coverage.
|
|
343
726
|
|
|
344
727
|
### Fixed
|
|
728
|
+
|
|
345
729
|
- 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.
|
|
346
730
|
|
|
347
731
|
## [1.6.1] — JSR quality fixes (2026-02-07)
|
|
348
732
|
|
|
349
733
|
### Added
|
|
734
|
+
|
|
350
735
|
- TypeScript declaration files (`.d.ts`) for all three entrypoints and shared value objects, resolving JSR "slow types" scoring penalty.
|
|
351
736
|
- `@ts-self-types` directives in `index.js`, `CasService.js`, and `ManifestSchema.js`.
|
|
352
737
|
- `@fileoverview` module doc to `CasService.js` (required by JSR for module docs scoring).
|
|
353
738
|
|
|
354
739
|
### Fixed
|
|
740
|
+
|
|
355
741
|
- JSR package name corrected to `@git-stunts/git-cas`.
|
|
356
742
|
- JSR publication now excludes tests, docs, CI configs, and other non-distribution files via `jsr.json` exclude list.
|
|
357
743
|
- `index.d.ts` added to `package.json` files array for npm distribution.
|
|
@@ -359,6 +745,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
359
745
|
## [1.6.0] — M4 Compass + M5 Sonar + M6 Cartographer (2026-02-06)
|
|
360
746
|
|
|
361
747
|
### Added
|
|
748
|
+
|
|
362
749
|
- `CasService.readManifest({ treeOid })` — reads a Git tree, locates and decodes the manifest, returns a validated `Manifest` value object.
|
|
363
750
|
- `CasService.deleteAsset({ treeOid })` — returns logical deletion metadata (`{ slug, chunksOrphaned }`) without performing destructive Git operations.
|
|
364
751
|
- `CasService.findOrphanedChunks({ treeOids })` — aggregates referenced chunk blob OIDs across multiple assets, returning `{ referenced: Set<string>, total: number }`.
|
|
@@ -381,18 +768,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
381
768
|
## [1.3.0] — M3 Launchpad (2026-02-06)
|
|
382
769
|
|
|
383
770
|
### Added
|
|
771
|
+
|
|
384
772
|
- Native Bun support via `BunCryptoAdapter` (uses `Bun.CryptoHasher`).
|
|
385
773
|
- Native Deno/Web standard support via `WebCryptoAdapter` (uses `crypto.subtle`).
|
|
386
774
|
- Automated, secure release workflow (`.github/workflows/release.yml`) with:
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
775
|
+
- **NPM OIDC support** including build provenance.
|
|
776
|
+
- **JSR support** via `jsr.json` and automated publishing.
|
|
777
|
+
- **GitHub Releases** with automated release notes.
|
|
778
|
+
- **Idempotency & Version Checks** to prevent failed partial releases.
|
|
391
779
|
- Dynamic runtime detection in `ContentAddressableStore` to pick the best adapter automatically.
|
|
392
780
|
- Hardened `package.json` with repository metadata, engine constraints, and explicit file inclusion.
|
|
393
781
|
- Local quality gates via `pre-push` git hook and `scripts/install-hooks.sh`.
|
|
394
782
|
|
|
395
783
|
### Changed
|
|
784
|
+
|
|
396
785
|
- **Breaking Change:** `CasService` cryptographic methods (`sha256`, `encrypt`, `decrypt`, `verifyIntegrity`) are now asynchronous to support Web Crypto and native optimizations.
|
|
397
786
|
- `ContentAddressableStore` facade methods are now asynchronous to accommodate lazy service initialization and async crypto.
|
|
398
787
|
- Project migrated from `npm` to `pnpm` for faster, more reliable dependency management.
|
|
@@ -400,6 +789,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
400
789
|
- `Dockerfile` now uses `corepack` for pnpm management.
|
|
401
790
|
|
|
402
791
|
### Fixed
|
|
792
|
+
|
|
403
793
|
- Fixed recursion bug in `BunCryptoAdapter` where `randomBytes` shadowed the imported function.
|
|
404
794
|
- Resolved lazy-initialization race condition in `ContentAddressableStore` via promise caching.
|
|
405
795
|
- Fixed state leak in `WebCryptoAdapter` streaming encryption.
|
|
@@ -409,6 +799,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
409
799
|
## [1.2.0] — M2 Boomerang (v1.2.0)
|
|
410
800
|
|
|
411
801
|
### Added
|
|
802
|
+
|
|
412
803
|
- `CryptoPort` interface and `NodeCryptoAdapter` — extracted all `node:crypto` usage from the domain layer.
|
|
413
804
|
- `CasService.store()` — accepts `AsyncIterable<Buffer>` sources (renamed from `storeFile`).
|
|
414
805
|
- Multi-stage Dockerfile (Node 22, Bun, Deno) with `docker-compose.yml` for per-runtime testing.
|
|
@@ -421,14 +812,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
421
812
|
- Deterministic test digest helper (`digestOf`).
|
|
422
813
|
|
|
423
814
|
### Changed
|
|
815
|
+
|
|
424
816
|
- `CasService` domain layer has zero `node:*` imports — all platform dependencies injected via ports.
|
|
425
817
|
- Constructor requires `crypto` and `codec` params (no defaults); facade supplies them.
|
|
426
818
|
- Facade `storeFile()` now opens the file and delegates to `CasService.store()`.
|
|
427
819
|
|
|
428
820
|
### Fixed
|
|
821
|
+
|
|
429
822
|
- None.
|
|
430
823
|
|
|
431
824
|
### Security
|
|
825
|
+
|
|
432
826
|
- None.
|
|
433
827
|
|
|
434
828
|
## [1.0.0] - 2025-05-30
|
|
@@ -445,10 +839,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
445
839
|
- Docker-based test runner for reproducible CI builds.
|
|
446
840
|
|
|
447
841
|
### Changed
|
|
842
|
+
|
|
448
843
|
- None.
|
|
449
844
|
|
|
450
845
|
### Fixed
|
|
846
|
+
|
|
451
847
|
- None.
|
|
452
848
|
|
|
453
849
|
### Security
|
|
850
|
+
|
|
454
851
|
- None.
|