@git-stunts/git-cas 6.5.12 → 7.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/CHANGELOG.md CHANGED
@@ -7,6 +7,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [7.0.0] — 2026-11-01
11
+
12
+ ### Breaking Changes
13
+
14
+ - Upgrade `zod` from 3 to 4 (`^4.6.7`). The public
15
+ `@git-stunts/git-cas/schema` exports now use Zod 4 objects and generic types.
16
+ Consumers composing these schemas must use Zod 4 and update annotations that
17
+ depend on Zod 3 generics. Parse-only callers do not need to compose schemas.
18
+ - Integer validation now rejects values above `Number.MAX_SAFE_INTEGER`,
19
+ including manifest/chunk sizes, indices, chunking and KDF parameters, key
20
+ versions, frame sizes, and sub-manifest counts and offsets. Existing stored
21
+ metadata outside that bound can no longer be read; there is no fallback.
22
+ See [UPGRADING.md](UPGRADING.md) for affected callers and fields.
23
+ - Validation text changes where no custom message is set. The
24
+ `Invalid manifest data:` and `Invalid chunk data:` prefixes remain, but a
25
+ matching encryption scheme with a fractional or infinite integer field can
26
+ now report `Invalid input` instead of a specific integer diagnostic.
27
+ Unmatched schemes already reported `Invalid input` with Zod 3.
28
+
29
+ ### Changed
30
+
31
+ - Schema source rules and custom messages are unchanged. Default validation
32
+ messages now follow Zod 4 and any application configuration of the shared
33
+ Zod 4 instance, such as `z.config(...)` locale or error customization.
34
+ - Require published Plumbing `^3.3.3`, which also uses Zod 4. The locked
35
+ production dependency tree no longer contains Zod 3.
36
+
10
37
  ## [6.5.12] — 2026-10-20
11
38
 
12
39
  ### Fixed
package/README.md CHANGED
@@ -52,10 +52,13 @@ Unlike traditional LFS which moves files to external servers, `git-cas` treats t
52
52
 
53
53
  Existing v5 users should read [UPGRADING.md](./UPGRADING.md) and run
54
54
  `npm run upgrade` in dry-run mode before restoring old encrypted vault entries.
55
- For the release overview, see the
56
- [v6.5.12 Release Notes](./docs/releases/v6.5.12.md).
55
+ The v7.0.0 security candidate changes the public schema dependency to Zod 4.
56
+ Before upgrading, read the [migration guidance](./UPGRADING.md#v6512-to-v700-candidate)
57
+ and [candidate release notes](./docs/releases/v7.0.0.md). This candidate requires
58
+ published Plumbing 3.3.3. Publication and registry verification remain tracked in
59
+ [#154](https://github.com/git-stunts/git-cas/issues/154).
57
60
 
58
- The v6.5.12 candidate bounds object-metadata requests so root sets with more than 1000 targets (936 for SHA-256) validate within Plumbing's cat-file request limits. Admission still rejects missing and mismatched targets before publication; see [v6.5.12 Release Notes](./docs/releases/v6.5.12.md). Registry publication is pending release verification and merge.
61
+ The published v6.5.12 release bounds object-metadata requests so root sets with more than 1000 targets (936 for SHA-256) validate within Plumbing's cat-file request limits. Admission still rejects missing and mismatched targets before publication; see [v6.5.12 Release Notes](./docs/releases/v6.5.12.md).
59
62
 
60
63
  ### 1. CLI Usage
61
64
 
package/UPGRADING.md CHANGED
@@ -1,6 +1,62 @@
1
1
  # Upgrading git-cas
2
2
 
3
- v6.0.0 is a major release that simplifies the encryption model, hardens security defaults, and cleans up the architecture. This guide covers every breaking change and what you need to do.
3
+ This guide covers breaking changes and migration steps for git-cas releases.
4
+
5
+ ## v6.5.12 To v7.0.0 (candidate)
6
+
7
+ This is a breaking migration because the
8
+ public schema objects and their generic types change, accepted integer values
9
+ narrow, and validation diagnostics change.
10
+
11
+ | Your usage | What to check or change |
12
+ | --- | --- |
13
+ | Main API, without importing schemas | No Zod composition change is needed. Check stored metadata and error-message handling as described below. |
14
+ | `./schema` with `.parse()` or `.safeParse()` only | The methods remain available. Check integer values, diagnostics, and any code inspecting Zod error details. |
15
+ | Compose exported schemas into your own schemas | Use Zod 4 in your application. Zod 3 schemas cannot contain these Zod 4 objects. |
16
+ | Annotate schema types with Zod generic classes | Update Zod 3 annotations. `ZodEnum` takes an object map; `ZodDiscriminatedUnion` takes options before its discriminator. |
17
+
18
+ ### Stored integer metadata
19
+
20
+ Zod 4 integer checks reject values above `Number.MAX_SAFE_INTEGER`
21
+ (9,007,199,254,740,991). Existing positivity and field-specific bounds still
22
+ apply. Check these fields in stored or externally supplied metadata:
23
+
24
+ - Manifest `size`; chunk `index` and `size`.
25
+ - Chunking `params.chunkSize`, `target`, `min`, and `max`.
26
+ - Encryption `frameBytes` and `keyVersion`; recipient `keyVersion`.
27
+ - KDF `iterations`, `cost`, `blockSize`, `parallelization`, and `keyLength`.
28
+ - Sub-manifest `chunkCount` and `startIndex`.
29
+
30
+ Manifest `version` remains restricted to 1 or 2. Metadata that was accepted
31
+ under Zod 3 but exceeds the new safe-integer bound is rejected on read as well
32
+ as write. There is no legacy parsing fallback or automatic migration. Audit
33
+ existing data before upgrading; do not round a size, index, or cryptographic
34
+ parameter merely to make validation pass.
35
+
36
+ ### Validation diagnostics
37
+
38
+ Custom schema messages and the `Invalid manifest data:` / `Invalid chunk data:`
39
+ prefixes remain. Uncustomized messages use Zod 4 wording, for example
40
+ `Invalid input: expected number, received string`.
41
+
42
+ For a matching encryption scheme, a fractional or infinite integer field such
43
+ as `frameBytes` can now collapse the union error to `Invalid input`. Previously
44
+ it could preserve a specific integer diagnostic. An unmatched scheme already
45
+ produced `Invalid input`; that is not a new failure mode. The value-object error
46
+ text already omitted field paths before this upgrade.
47
+
48
+ Code that branches on exact error strings or inspects Zod issue structures
49
+ needs review. Application calls to `z.config(...)` can change default messages
50
+ when they configure the same Zod 4 instance used by git-cas. Git-cas does not
51
+ isolate that global configuration; explicit schema messages still take priority.
52
+
53
+ ### Dependency boundary
54
+
55
+ Zod is a regular dependency. Applications that compose the public schemas
56
+ should declare their own Zod 4 dependency. This release requires published
57
+ Plumbing `^3.3.3`; the locked production tree uses Zod 4 throughout. The
58
+ production audit has zero findings. This does not claim a clean developer
59
+ dependency audit.
4
60
 
5
61
  ## v6.5.9 To v6.5.10
6
62
 
@@ -430,7 +486,14 @@ Repair cannot recover objects that Git already pruned. Verify
430
486
  `(await rootSet.doctor()).healthy` before garbage collection. Existing vault
431
487
  entries and ordinary branch/tag references need no change.
432
488
 
433
- ## Quick Start
489
+ ## v5.x To v6.0.0
490
+
491
+ The following quick start, breaking changes, API changes, and troubleshooting
492
+ apply to the v5-to-v6.0.0 upgrade. The encrypted-vault migration converts legacy
493
+ v5 encryption metadata. An installation already on v6.5.12 does not need to run
494
+ these commands for the Zod 4 upgrade.
495
+
496
+ ### Quick Start
434
497
 
435
498
  If you have an existing vault with encrypted assets:
436
499
 
@@ -446,9 +509,9 @@ If you only use the library API (no vault), skip to [API Changes](#api-changes).
446
509
 
447
510
  ---
448
511
 
449
- ## Critical Breaking Changes
512
+ ### Critical Breaking Changes
450
513
 
451
- ### `restoreFile()` Requires `baseDirectory`
514
+ #### `restoreFile()` Requires `baseDirectory`
452
515
 
453
516
  `restoreFile()` now requires an explicit directory boundary. This prevents a
454
517
  repository-controlled output path from writing outside the directory your
@@ -476,9 +539,9 @@ for example a job workspace or tenant-scoped artifact directory.
476
539
 
477
540
  ---
478
541
 
479
- ## Encryption Scheme Simplification
542
+ ### Encryption Scheme Simplification
480
543
 
481
- ### What Changed
544
+ #### What Changed
482
545
 
483
546
  v5 had 5 encryption scheme identifiers. v6 has 3:
484
547
 
@@ -490,11 +553,11 @@ v5 had 5 encryption scheme identifiers. v6 has 3:
490
553
  | `framed-v2` | `framed` | Rename only (already had AAD) |
491
554
  | `convergent-v1` | `convergent` | Rename only |
492
555
 
493
- ### Why
556
+ #### Why
494
557
 
495
558
  Version suffixes on scheme names were compatibility cruft. AAD (Additional Authenticated Data) binding is now unconditional — every `whole` and `framed` manifest binds the slug to the ciphertext, preventing cross-manifest blob substitution attacks.
496
559
 
497
- ### What Happens if You Don't Migrate
560
+ #### What Happens if You Don't Migrate
498
561
 
499
562
  Any call to `readManifest()`, `restore()`, `restoreFile()`, or `restoreStream()` on a v5 manifest will throw:
500
563
 
@@ -504,7 +567,7 @@ Run scripts/migrate-encryption.js to upgrade this manifest.
504
567
  [code: LEGACY_SCHEME]
505
568
  ```
506
569
 
507
- ### How to Migrate
570
+ #### How to Migrate
508
571
 
509
572
  ```bash
510
573
  # Dry-run: see what needs migration
@@ -543,7 +606,7 @@ recipient key.
543
606
 
544
607
  Original blobs are never deleted — Git's garbage collection only removes unreferenced objects after `git gc`.
545
608
 
546
- ### Vault Passphrase Verifier Migration
609
+ #### Vault Passphrase Verifier Migration
547
610
 
548
611
  New encrypted vaults write `encryption.verifier` into `.vault.json`. The
549
612
  verifier lets `git-cas` reject a wrong vault passphrase even when the encrypted
@@ -565,9 +628,9 @@ verifier and the next keyed vault write will add it.
565
628
 
566
629
  ---
567
630
 
568
- ## Default Scheme Changes
631
+ ### Default Scheme Changes
569
632
 
570
- ### What Changed
633
+ #### What Changed
571
634
 
572
635
  | Scenario | v5 Default | v6 Default |
573
636
  | --------------------------- | ----------- | ------------ |
@@ -575,7 +638,7 @@ verifier and the next keyed vault write will add it.
575
638
  | Fixed chunking + encryption | `framed-v1` | `framed` |
576
639
  | Explicit `whole` | `whole-v1` | `whole` |
577
640
 
578
- ### What This Means
641
+ #### What This Means
579
642
 
580
643
  - **Convergent encryption** is now the default when using CDC chunking with encryption. This means deduplication works even with encrypted content — identical plaintext chunks produce identical ciphertext.
581
644
  - If you were explicitly passing `encryption: { scheme: 'framed-v1' }`, change to `encryption: { scheme: 'framed' }`.
@@ -583,9 +646,9 @@ verifier and the next keyed vault write will add it.
583
646
 
584
647
  ---
585
648
 
586
- ## API Changes
649
+ ### API Changes
587
650
 
588
- ### Byte Types
651
+ #### Byte Types
589
652
 
590
653
  Public byte-oriented APIs now use `Uint8Array` instead of Node-specific
591
654
  `Buffer` types:
@@ -601,7 +664,7 @@ Node callers can still pass `Buffer` values because `Buffer` is a
601
664
  should compare with `Buffer.from(buffer).equals(...)` or use a runtime-neutral
602
665
  byte comparison helper.
603
666
 
604
- ### CasService Constructor (Library Users)
667
+ #### CasService Constructor (Library Users)
605
668
 
606
669
  **If you use `ContentAddressableStore` (the facade):** No changes needed. The facade handles all defaults.
607
670
 
@@ -623,7 +686,7 @@ byte comparison helper.
623
686
 
624
687
  `chunker` and `compressionAdapter` are now **required**. They were previously optional with internal defaults — the defaults moved to the facade layer to keep the domain service free of infrastructure imports.
625
688
 
626
- ### New CryptoPort Methods
689
+ #### New CryptoPort Methods
627
690
 
628
691
  If you implement a custom `CryptoPort`, you must add these methods:
629
692
 
@@ -638,16 +701,16 @@ decryptBufferWithNonceTag(buffer, key, nonce, tag) { /* return Uint8Array */ }
638
701
 
639
702
  The shipped adapters (`NodeCryptoAdapter`, `BunCryptoAdapter`, `WebCryptoAdapter`) already implement these.
640
703
 
641
- ### Encryption Metadata Schema
704
+ #### Encryption Metadata Schema
642
705
 
643
706
  Encrypted manifests now **require** the `scheme` field. Pre-v5.2 manifests that omitted `scheme` will fail schema validation. The migration script handles this.
644
707
 
645
- ### New Manifest Fields
708
+ #### New Manifest Fields
646
709
 
647
710
  - **`formatVersion`**: Semver string (e.g., `"6.0.0"`) stamped into new manifests. Identifies which library version wrote the manifest. Optional on read — old manifests without it still parse.
648
711
  - **`manifestHash`**: SHA-256 of the codec-encoded manifest content. Verified on read. Catches corruption. Optional on read.
649
712
 
650
- ### New Exports
713
+ #### New Exports
651
714
 
652
715
  ```js
653
716
  // Standalone manifest diffing
@@ -664,7 +727,7 @@ import { CompressionPort, NodeCompressionAdapter } from '@git-stunts/git-cas';
664
727
  import { SCHEME_WHOLE, SCHEME_FRAMED, SCHEME_CONVERGENT } from '@git-stunts/git-cas';
665
728
  ```
666
729
 
667
- ### Behavioral Changes
730
+ #### Behavioral Changes
668
731
 
669
732
  | Change | Impact |
670
733
  | ---------------------------------------- | ------------------------------------------------------------------------------------- |
@@ -677,7 +740,7 @@ import { SCHEME_WHOLE, SCHEME_FRAMED, SCHEME_CONVERGENT } from '@git-stunts/git-
677
740
 
678
741
  ---
679
742
 
680
- ## New Features (Non-Breaking)
743
+ ### New Features (Non-Breaking)
681
744
 
682
745
  These are new capabilities that don't require migration:
683
746
 
@@ -694,9 +757,9 @@ These are new capabilities that don't require migration:
694
757
 
695
758
  ---
696
759
 
697
- ## Troubleshooting
760
+ ### Troubleshooting
698
761
 
699
- ### `LEGACY_SCHEME` error on restore
762
+ #### `LEGACY_SCHEME` error on restore
700
763
 
701
764
  ```
702
765
  CasError: Legacy encryption scheme "whole-v1" is no longer supported.
@@ -706,7 +769,7 @@ Run `printf '%s\n' '<pass>' | npm run upgrade -- --execute --passphrase-file -`
706
769
  or
707
770
  `npm run upgrade -- --execute --key-file <path>` to migrate.
708
771
 
709
- ### `KDF_POLICY_VIOLATION` on deriveKey
772
+ #### `KDF_POLICY_VIOLATION` on deriveKey
710
773
 
711
774
  ```
712
775
  CasError: deriveKey KDF field "iterations" must be between 100000 and 2000000
@@ -714,7 +777,7 @@ CasError: deriveKey KDF field "iterations" must be between 100000 and 2000000
714
777
 
715
778
  v6 enforces minimum KDF parameters. Increase iterations to at least 100,000 (PBKDF2) or cost to at least 16,384 (scrypt).
716
779
 
717
- ### `MANIFEST_INTEGRITY_ERROR` on readManifest
780
+ #### `MANIFEST_INTEGRITY_ERROR` on readManifest
718
781
 
719
782
  ```
720
783
  CasError: Manifest integrity check failed: hash mismatch
@@ -722,7 +785,7 @@ CasError: Manifest integrity check failed: hash mismatch
722
785
 
723
786
  The manifest blob was corrupted or tampered with after storage. The original data may still be recoverable from Git's object database if the corruption was in the tree, not the blob.
724
787
 
725
- ### Constructor throws "chunker is required"
788
+ #### Constructor throws "chunker is required"
726
789
 
727
790
  You're using `CasService` directly. Either switch to the `ContentAddressableStore` facade (recommended) or inject a `chunker` and `compressionAdapter` manually. See [API Changes](#casservice-constructor-library-users).
728
791
 
package/build-info.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
- "sha": "25609d6",
3
- "timestamp": "2026-10-20T03:56:15.258Z"
2
+ "sha": "ae3a81c",
3
+ "timestamp": "2026-11-01T23:22:13.038Z"
4
4
  }
@@ -0,0 +1,27 @@
1
+ # git-cas v7.0.0 Security Release Candidate
2
+
3
+ This candidate migrates the public schema entrypoint to Zod 4. It is a major release because consumers composing exported schemas must use Zod 4, schema generic annotations change, and integer validation rejects values above the JavaScript safe-integer limit. See [UPGRADING.md](../../UPGRADING.md#v6512-to-v700-candidate) before adopting it.
4
+
5
+ ## Observable changes
6
+
7
+ The `@git-stunts/git-cas/schema` entrypoint retains its exported schema names. Its schema objects and generic declarations now belong to Zod 4. The new strict schema fixture checks the declarations without skipping dependency diagnostics and distinguishes defaulted output fields from optional inputs.
8
+
9
+ Stored or externally supplied metadata above `Number.MAX_SAFE_INTEGER` is refused on read and write. There is no automatic migration or legacy parsing fallback. Custom schema messages remain, while default Zod diagnostics and union error text can change. A shared application `z.config(...)` can affect default messages. The migration guide identifies affected fields and callers.
10
+
11
+ ## Scope
12
+
13
+ No package split, CLI relocation, stored object-format rewrite, ref rename, or encryption algorithm change is included. The unfinished Cleave workspace split remains a separate [v8.0.0 release plan](https://github.com/git-stunts/git-cas/milestone/6). Compatible metadata and existing application handles keep their established encoding and identity; unsafe integer metadata is the explicit compatibility exception.
14
+
15
+ ## Manifest version metadata
16
+
17
+ New manifests carry `formatVersion: "7.0.0"` through the existing package-version stamp. This field records the producing package version; it is separate from the manifest schema's `version` field, which remains 1 or 2. The existing parser accepts three numeric components and does not dispatch on the package major version. A prerelease suffix is rejected, so this release uses a stable version rather than changing stored-format validation to accommodate a prerelease.
18
+
19
+ A bounded real-Git witness installed published 6.5.12 and the packed v7 candidate separately, then stored, read, restored and verified a 3,840-byte plaintext file in both directions. Each reader preserved the producer's formatVersion and returned identical payload bytes. This supports ordinary plaintext compatibility; it does not establish every encryption or retention scenario, nor acceptance of unsafe integer metadata.
20
+
21
+ ## Dependency and verification gates
22
+
23
+ This candidate requires published Plumbing `^3.3.3`. The refreshed lockfile contains Zod 4 throughout the production dependency tree, and its production audit reports zero findings. The final release must pass the documented Node, Bun-launcher and Deno checks, both public type fixtures, maintained examples, package checks and JSR dry-run under the repository's bounded Docker workflow. The developer dependency audit is a separate boundary.
24
+
25
+ Issue [#151](https://github.com/git-stunts/git-cas/issues/151) and PR [#152](https://github.com/git-stunts/git-cas/pull/152) own the migration. [#154](https://github.com/git-stunts/git-cas/issues/154) owns dependency adoption, release verification, publication and a fresh registry consumer. The unrelated full-public-declaration export repair remains [#153](https://github.com/git-stunts/git-cas/issues/153).
26
+
27
+ This candidate document claims no published 7.0.0 artifact. Merge approval, an immutable tag, successful publication and registry-consumer evidence remain required. Candidate preparation does not establish that downstream git-warp has adopted this release.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@git-stunts/git-cas",
3
- "version": "6.5.12",
3
+ "version": "7.0.0",
4
4
  "description": "Content-addressed storage backed by Git's object database, with optional encryption and pluggable codecs",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -57,7 +57,8 @@
57
57
  "LICENSE",
58
58
  "CHANGELOG.md",
59
59
  "docs/releases/v6.5.11.md",
60
- "docs/releases/v6.5.12.md"
60
+ "docs/releases/v6.5.12.md",
61
+ "docs/releases/v7.0.0.md"
61
62
  ],
62
63
  "engines": {
63
64
  "node": ">=22.0.0"
@@ -114,11 +115,11 @@
114
115
  "@flyingrobots/bijou-tui": "^7.2.0",
115
116
  "@flyingrobots/bijou-tui-app": "^7.2.0",
116
117
  "@git-stunts/alfred": "^0.10.0",
117
- "@git-stunts/plumbing": "^3.3.2",
118
+ "@git-stunts/plumbing": "^3.3.3",
118
119
  "@git-stunts/vault": "^1.0.1",
119
120
  "cbor-x": "^1.6.0",
120
121
  "commander": "14.0.3",
121
- "zod": "^3.24.1"
122
+ "zod": "^4.6.7"
122
123
  },
123
124
  "pnpm": {
124
125
  "onlyBuiltDependencies": [
@@ -15,7 +15,7 @@ export declare const ChunkSchema: z.ZodObject<{
15
15
 
16
16
  /** Validates KDF parameters stored alongside encryption metadata. */
17
17
  export declare const KdfSchema: z.ZodObject<{
18
- algorithm: z.ZodEnum<["pbkdf2", "scrypt"]>;
18
+ algorithm: z.ZodEnum<{ pbkdf2: "pbkdf2"; scrypt: "scrypt" }>;
19
19
  salt: z.ZodString;
20
20
  iterations: z.ZodOptional<z.ZodNumber>;
21
21
  cost: z.ZodOptional<z.ZodNumber>;
@@ -75,7 +75,7 @@ export declare const EncryptionSchema: z.ZodUnion<
75
75
 
76
76
  /** Validates compression metadata. */
77
77
  export declare const CompressionSchema: z.ZodObject<{
78
- algorithm: z.ZodEnum<["gzip"]>;
78
+ algorithm: z.ZodEnum<{ gzip: "gzip" }>;
79
79
  }>;
80
80
 
81
81
  /** Validates fixed-size chunking parameters. */
@@ -99,8 +99,8 @@ export declare const CdcChunkingSchema: z.ZodObject<{
99
99
 
100
100
  /** Validates chunking metadata (fixed or CDC). */
101
101
  export declare const ChunkingSchema: z.ZodDiscriminatedUnion<
102
- "strategy",
103
- [typeof FixedChunkingSchema, typeof CdcChunkingSchema]
102
+ [typeof FixedChunkingSchema, typeof CdcChunkingSchema],
103
+ "strategy"
104
104
  >;
105
105
 
106
106
  /** Validates a sub-manifest reference in a v2 Merkle manifest. */
@@ -1 +1 @@
1
- export const PACKAGE_VERSION = '6.5.12';
1
+ export const PACKAGE_VERSION = '7.0.0';