Skip to content

Commit aa0840e

Browse files
authored
v3.0.0 — Vault
v3.0.0 — Vault
2 parents 4da828d + 98b0214 commit aa0840e

19 files changed

Lines changed: 3502 additions & 1069 deletions

AUDITS.md

Lines changed: 0 additions & 136 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,47 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [Unreleased]
8+
## [3.0.0] — Vault (2026-02-08)
9+
10+
### Added
11+
- **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.
12+
- `initVault()` — initialize the vault, optionally with passphrase-based encryption (vault-level KDF policy).
13+
- `addToVault()` — add or update an entry by slug + tree OID, with `force` flag for overwrites.
14+
- `listVault()` — list all entries sorted by slug.
15+
- `removeFromVault()` — remove an entry by slug.
16+
- `resolveVaultEntry()` — resolve a slug to its tree OID.
17+
- `getVaultMetadata()` — inspect vault metadata (encryption config, version).
18+
- Vault metadata (`.vault.json`) supports versioning and optional encryption configuration.
19+
- CAS-safe writes with automatic retry (up to 3 attempts with exponential backoff) on concurrent update conflicts.
20+
- Strict slug validation: rejects empty strings, `..` traversal, control characters, oversized segments.
21+
- New CLI subcommands: `vault init`, `vault list`, `vault info <slug>`, `vault remove <slug>`, `vault history`.
22+
- CLI `store --tree` now auto-vaults the entry (adds to vault after creating tree).
23+
- CLI `restore` now supports `--slug` (resolve via vault) and `--oid` (direct tree OID) flags.
24+
- CLI `--vault-passphrase` flag for vault-level encryption on `store`, `restore`, and `vault init`.
25+
- New error codes: `INVALID_SLUG`, `VAULT_ENTRY_NOT_FOUND`, `VAULT_ENTRY_EXISTS`, `VAULT_CONFLICT`, `VAULT_METADATA_INVALID`, `VAULT_ENCRYPTION_ALREADY_CONFIGURED`.
26+
- TypeScript declarations for `VaultEntry`, `VaultMetadata`, `VaultState`, `VaultService`, `GitRefPort` types.
27+
- `VaultService` — first-class domain service with proper port/adapter separation (hexagonal architecture).
28+
- `GitRefPort` and `GitRefAdapter` — new port/adapter for Git ref and commit operations.
29+
- `getVaultService()` on facade exposes the underlying `VaultService` for advanced usage.
30+
- Vault-specific integration tests (`test/integration/vault.test.js`).
31+
- 46 vault unit tests + facade delegation smoke test.
32+
33+
### Fixed
34+
- `#validateMetadata` now requires `kdf.keyLength` in encryption metadata, preventing downstream KDF failures from manually edited `.vault.json` files.
35+
- `#casUpdateRef` now preserves the original error in `VAULT_CONFLICT` meta for better diagnostics.
36+
- CLI `--vault-passphrase` now emits a stderr warning when the vault is not encrypted, instead of silently ignoring the passphrase.
37+
- `vault history` command now uses `VAULT_REF` constant instead of hardcoded string.
38+
- API docs: fixed invalid import path `@git-stunts/cas/vault``@git-stunts/cas`.
39+
- API docs: fixed `_readVaultState()``readState()` in error codes table.
40+
- API docs and GUIDE: added `text` language identifier to fenced code blocks (markdownlint MD040).
41+
- CLI version string updated from `2.0.0` to `3.0.0`.
42+
- CLI `vault history --max-count` now validates input as a positive integer.
43+
- Stale JSDoc in `GitPersistenceAdapter` corrected (removed mention of retries).
44+
45+
### Changed
46+
- **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.
47+
- CLI `restore` command no longer takes a positional `<tree-oid>` argument. Use `--oid <tree-oid>` or `--slug <slug>` instead.
48+
- Purged completed milestones (M1–M7) and their task cards from ROADMAP.md, reducing it from 3,153 to 1,675 lines.
949

1050
## [2.0.0] — M7 Horizon (2026-02-08)
1151

0 commit comments

Comments
 (0)