@git-stunts/git-cas 6.5.7 → 6.5.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/ARCHITECTURE.md +9 -0
  2. package/CHANGELOG.md +39 -0
  3. package/GUIDE.md +54 -0
  4. package/README.md +17 -9
  5. package/UPGRADING.md +68 -0
  6. package/build-info.json +2 -2
  7. package/docs/API.md +115 -12
  8. package/docs/releases/v6.5.8.md +89 -0
  9. package/docs/releases/v6.5.9.md +119 -0
  10. package/index.d.ts +75 -0
  11. package/index.js +19 -1
  12. package/package.json +4 -2
  13. package/src/domain/services/AssetService.js +201 -10
  14. package/src/domain/services/BoundedWriteWavePersistence.js +235 -0
  15. package/src/domain/services/BundleBatchPlanner.js +349 -0
  16. package/src/domain/services/BundleService.js +225 -2
  17. package/src/domain/services/CasService.d.ts +16 -0
  18. package/src/domain/services/CasService.js +9 -18
  19. package/src/domain/services/ManifestRepository.js +129 -50
  20. package/src/domain/services/ManifestTreeService.js +47 -0
  21. package/src/domain/services/PageService.js +36 -10
  22. package/src/domain/services/RootSet.js +32 -0
  23. package/src/domain/services/RootSetPersistence.js +58 -1
  24. package/src/domain/services/StagedTarget.js +19 -0
  25. package/src/domain/services/StagingWorkspace.js +95 -20
  26. package/src/domain/services/StagingWorkspaceRegistry.js +9 -4
  27. package/src/domain/services/WorkspaceCompoundAdmission.js +61 -0
  28. package/src/domain/services/WorkspaceCompoundScope.js +193 -0
  29. package/src/domain/services/forkCasPersistence.js +20 -0
  30. package/src/infrastructure/adapters/GitObjectSessionPool.js +47 -5
  31. package/src/infrastructure/adapters/GitPersistenceAdapter.js +169 -0
  32. package/src/infrastructure/adapters/GitPersistenceWriteScope.js +154 -0
  33. package/src/infrastructure/adapters/GitRefAdapter.js +38 -3
  34. package/src/infrastructure/adapters/GitUpdateRefSessionPool.js +115 -0
  35. package/src/package-version.js +1 -1
  36. package/src/ports/GitPersistencePort.js +43 -0
  37. package/src/ports/GitRefPort.js +8 -0
package/ARCHITECTURE.md CHANGED
@@ -182,6 +182,15 @@ The facade is orchestration glue. It is not the storage engine itself.
182
182
  bundles build deterministic bounded-fanout trees and support targeted member
183
183
  traversal without hydrating the complete structure.
184
184
 
185
+ - **`StagingWorkspaceRegistry` and `StagingWorkspace`** — own renewable
186
+ temporary RootSet generations for multi-step application construction.
187
+ `WorkspaceCompoundAdmission` and `WorkspaceCompoundScope` serialize an
188
+ explicitly bounded sequence of provisional page and bundle batches through
189
+ one operation-owned persistence view, then install the union of prior and new
190
+ targets in one exact generation. Existing workspace methods retain each
191
+ result independently and remain the boundary when a handle leaves private
192
+ construction code before later writes begin.
193
+
185
194
  - **`RetentionService` and `PublicationService`** — validate complete handle
186
195
  graphs, then either retain them in a RootSet with generation-scoped evidence
187
196
  or publish them atomically under an allowlisted application ref.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,45 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [6.5.9] — 2026-08-24
11
+
12
+ ### Added
13
+
14
+ - **Compound staging-workspace admission** - `workspace.batch()` runs an
15
+ explicitly operation-bounded sequence of dependent page and ordered-bundle
16
+ batches through one private persistence scope, then returns the callback
17
+ value only after one exact workspace generation retains every staged handle.
18
+ Scope calls serialize by invocation order, return frozen handle arrays, stop
19
+ queued work after failure, and preserve the prior generation on refusal.
20
+
21
+ ### Performance
22
+
23
+ - **One retained generation for dependent write waves** - a clean five-sample
24
+ SHA-1/SHA-256 witness reduced a 33-operation, 81-handle graph from 200 to 23
25
+ Git child processes and from 33 workspace commits and checked ref updates to
26
+ one, with identical application-handle digests. Median wall time fell by
27
+ 80.5% on the measured host. Compound admission changes workspace-ref update
28
+ frequency, while object bytes, handle identity, ref layout and namespaces,
29
+ readers, and existing independently retained workspace methods remain
30
+ compatible.
31
+
32
+ ## [6.5.8] — 2026-08-23
33
+
34
+ ### Added
35
+
36
+ - **Bounded application write waves** - `assets.putBatch()` and
37
+ `bundles.putOrderedBatch()` accept explicit count, object, and byte limits,
38
+ preserve input-order results, and are mirrored by scoped staging workspaces.
39
+ A successful workspace batch anchors every returned handle in one exact
40
+ generation.
41
+
42
+ ### Performance
43
+
44
+ - **Pipelined Git object and ref protocols** - bounded asset and bundle writes
45
+ pipeline blob, manifest-tree, descriptor-tree, and target-metadata waves;
46
+ checked ref updates reuse one typed `update-ref --stdin` process. Existing
47
+ single-write and older-Plumbing fallbacks remain available.
48
+
10
49
  ## [6.5.7] — 2026-08-23
11
50
 
12
51
  ### Performance
package/GUIDE.md CHANGED
@@ -173,6 +173,60 @@ order, and uses one scoped Git write session when the plumbing adapter supports
173
173
  it. Use individual `pages.put()` calls when inputs should not share one bounded
174
174
  memory envelope.
175
175
 
176
+ Independent assets and ordered bundles have equivalent bounded write-wave
177
+ surfaces:
178
+
179
+ ```js
180
+ const stagedAssets = await cas.assets.putBatch({
181
+ assets: assetRequests,
182
+ maxBatchAssets: 4,
183
+ maxBatchObjects: 4096,
184
+ maxBatchBytes: 256 * 1024 * 1024,
185
+ });
186
+
187
+ const stagedBundles = await cas.bundles.putOrderedBatch({
188
+ bundles: orderedBundleRequests,
189
+ maxBatchBundles: 64,
190
+ maxBatchMembers: 8192,
191
+ maxBatchObjects: 256,
192
+ maxBatchBytes: 64 * 1024 * 1024,
193
+ });
194
+ ```
195
+
196
+ Asset batching keeps at most `maxBatchAssets` source pipelines active, shares
197
+ bounded blob phases, and emits complete manifest trees in one final dependency
198
+ wave. Bundle batching collects only the explicitly bounded request array,
199
+ preplans its deterministic descriptor graph, and writes each bottom-up tree
200
+ depth as one bounded wave. Both methods preserve input-order output and return
201
+ no partial result array on failure. Higher `maxBatchAssets` values can reduce
202
+ protocol round trips when the caller can afford more simultaneously live
203
+ source pipelines; the default remains four.
204
+
205
+ When later bundle waves depend on handles created by earlier waves, keep the
206
+ intermediate handles inside one compound staging-workspace operation:
207
+
208
+ ```js
209
+ const admitted = await workspace.batch({
210
+ maxOperations: 3,
211
+ operation: async (scope) => {
212
+ const pages = await scope.pages.putBatch({ pages: pageRequests });
213
+ const leaves = await scope.bundles.putOrderedBatch({
214
+ bundles: leafRequests(pages),
215
+ });
216
+ return (await scope.bundles.putOrderedBatch({
217
+ bundles: [rootRequest(leaves)],
218
+ }))[0];
219
+ },
220
+ });
221
+ ```
222
+
223
+ `admitted.value` becomes caller-visible only with `admitted.retention`, after
224
+ one exact workspace generation anchors every staged handle. The default
225
+ operation ceiling is 64 and the hard ceiling is 1,024; each scope call also
226
+ preserves its ordinary page or bundle batch bounds. Use the existing
227
+ independently retained workspace methods when intermediate handles must leave
228
+ the private callback.
229
+
176
230
  Repeated `pages.get()` calls reuse immutable payload reads within the store's
177
231
  bounded page cache. The defaults retain at most 128 payloads and 8 MiB; use
178
232
  `pageCacheEntries` and `pageCacheBytes` to tune that ceiling. Every result is a
package/README.md CHANGED
@@ -40,7 +40,10 @@ Unlike traditional LFS which moves files to external servers, `git-cas` treats t
40
40
  typed Git sessions behind the adapter. On session-capable adapters, streaming
41
41
  blob reads at or below a fixed 10 MiB ceiling use one bounded session read;
42
42
  larger payloads retain the genuine one-shot streaming path. Explicitly
43
- bounded page batches amortize writes without changing content identity.
43
+ bounded page, asset, and ordered-bundle batches pipeline independent Git
44
+ writes. `workspace.batch()` can compose dependent page and bundle waves in
45
+ one private persistence scope and retain their union under one exact final
46
+ generation without changing content identity.
44
47
  - **Key Lifecycle**: Envelope encryption separates DEKs from KEKs. Rotate passphrases across an entire vault without re-encrypting data blobs. Privacy mode HMAC-hashes slug names to prevent metadata discovery.
45
48
  - **Runtime-Adaptive**: A single core supports Node.js 22+, Bun, and Deno through a strict hexagonal port architecture with runtime-specific crypto adapters.
46
49
 
@@ -49,7 +52,7 @@ Unlike traditional LFS which moves files to external servers, `git-cas` treats t
49
52
  Existing v5 users should read [UPGRADING.md](./UPGRADING.md) and run
50
53
  `npm run upgrade` in dry-run mode before restoring old encrypted vault entries.
51
54
  For the release overview, see the
52
- [v6.5.7 Release Notes](./docs/releases/v6.5.7.md).
55
+ [v6.5.9 Release Notes](./docs/releases/v6.5.9.md).
53
56
 
54
57
  ### 1. CLI Usage
55
58
 
@@ -150,14 +153,15 @@ Core capabilities:
150
153
  read-only, and `sweep()` can release only markers whose expiry has passed.
151
154
  - **Application storage**: `assets`, `pages`, `bundles`, `retention`, and
152
155
  `publications` compose streaming CAS writes, bounded structured
153
- materializations, explicitly bounded page batches, direct-reference or
154
- complete-validation member reads, reachability roots, compare-and-swap refs,
155
- and immutable lifecycle evidence.
156
+ materializations, explicitly bounded asset/page/bundle batches,
157
+ direct-reference or complete-validation member reads, reachability roots,
158
+ compare-and-swap refs, and immutable lifecycle evidence.
156
159
  - **Scoped staging workspaces**: `workspaces.open()` mirrors application writes
157
- behind one renewable temporary RootSet, supports one-generation bounded page
158
- batches, returns only after each handle is anchored, promotes
159
- destination-first, and exposes bounded age, expiry, logical-content, and
160
- direct-root diagnostics with opaque cleanup pagination.
160
+ behind one renewable temporary RootSet, supports one-generation bounded
161
+ asset/page/bundle batches plus compound dependent page/bundle admission,
162
+ returns only after each public result is anchored, promotes destination-first,
163
+ and exposes bounded age, expiry, logical-content, and direct-root diagnostics
164
+ with opaque cleanup pagination.
161
165
  - **Envelope recipients**: multi-recipient key wrapping and recipient rotation
162
166
  avoid re-encrypting data blobs.
163
167
  - **Operational diagnostics**: `cas.diagnostics.doctor()` streams repository
@@ -232,6 +236,10 @@ All three runtimes are tested in CI on every push. The hexagonal architecture is
232
236
  cockpit ownership and deterministic checked-ref conflict classification.
233
237
  - **[v6.5.7 Release Notes](./docs/releases/v6.5.7.md)**: Bounded persistent
234
238
  sessions for small streaming blob reads while large payloads remain streamed.
239
+ - **[v6.5.8 Release Notes](./docs/releases/v6.5.8.md)**: Bounded application
240
+ write waves, one-generation workspace batches, and reusable ref sessions.
241
+ - **[v6.5.9 Release Notes](./docs/releases/v6.5.9.md)**: Compound dependent
242
+ write waves retained under one exact staging-workspace generation.
235
243
  - **[Upgrading](./UPGRADING.md)**: Migration guide for v5 → v6.
236
244
  - **[Changelog](./CHANGELOG.md)**: Version history and migration notes.
237
245
 
package/UPGRADING.md CHANGED
@@ -2,6 +2,74 @@
2
2
 
3
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.
4
4
 
5
+ ## v6.5.8 To v6.5.9
6
+
7
+ v6.5.9 adds `workspace.batch()` and requires no application or stored-data
8
+ migration. Existing handles, object bytes, workspace descriptors, ref
9
+ namespaces, retention witnesses, read paths, and independently retained
10
+ workspace methods remain compatible. Existing repositories open in place.
11
+
12
+ Use the new method only when intermediate page and bundle handles remain
13
+ private to one bounded construction:
14
+
15
+ ```js
16
+ const admitted = await workspace.batch({
17
+ maxOperations: 3,
18
+ operation: async (scope) => {
19
+ const pages = await scope.pages.putBatch({ pages: pageRequests });
20
+ const leaves = await scope.bundles.putOrderedBatch({
21
+ bundles: buildLeafRequests(pages),
22
+ });
23
+ return (await scope.bundles.putOrderedBatch({
24
+ bundles: [buildRootRequest(leaves)],
25
+ }))[0];
26
+ },
27
+ });
28
+
29
+ admitted.value; // retained root BundleHandle
30
+ admitted.retention; // exact final workspace generation and witnesses
31
+ ```
32
+
33
+ The operation defaults to at most 64 scope calls and cannot exceed 1,024.
34
+ Every page or bundle call retains its existing count, object, member, and byte
35
+ bounds. A callback or staged-write failure publishes no compound generation;
36
+ immutable objects written before failure remain unreachable for Git's normal
37
+ reclamation. Use the existing workspace methods when a handle must become
38
+ independently retained before arbitrary caller code observes it.
39
+
40
+ The release changes physical admission cost only. It does not introduce a new
41
+ transaction format, migration command, authority cutover, or mixed-version
42
+ rewrite.
43
+
44
+ ## v6.5.7 To v6.5.8
45
+
46
+ v6.5.8 adds bounded application-write batches and requires no application or
47
+ stored-data migration. Existing single-write methods, handles, object bytes,
48
+ refs, retention evidence, and custom persistence fallbacks remain compatible.
49
+
50
+ Callers with independent assets or ordered bundles can opt into the new
51
+ input-ordered APIs:
52
+
53
+ ```js
54
+ const assets = await cas.assets.putBatch({ assets: assetRequests });
55
+ const bundles = await cas.bundles.putOrderedBatch({ bundles: bundleRequests });
56
+ ```
57
+
58
+ The same methods are available under scoped staging workspaces. Every result
59
+ from a successful workspace batch carries the same exact retained generation.
60
+ Count, planned-object, aggregate-member, and byte bounds reject oversized
61
+ admission before success is returned; partial immutable object creation remains
62
+ possible on failure, as with repeated single writes.
63
+
64
+ The default asset batch admits four active source pipelines with a 4,096-object
65
+ and 256 MiB envelope. Ordered-bundle batches default to 64 bundles, 8,192
66
+ members, 256 planned objects, and 64 MiB of admitted descriptor material.
67
+ Tune these only when the caller owns the corresponding source and memory
68
+ budget.
69
+
70
+ See [v6.5.8 Release Notes](./docs/releases/v6.5.8.md) for the exact identity,
71
+ process-topology, fallback, and publication-boundary evidence.
72
+
5
73
  ## v6.5.6 To v6.5.7
6
74
 
7
75
  v6.5.7 changes no public API, package export, object identity, manifest, ref,
package/build-info.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
- "sha": "eebc6e3",
3
- "timestamp": "2026-08-23T12:01:03.041Z"
2
+ "sha": "a16e31a",
3
+ "timestamp": "2026-08-24T19:12:20.728Z"
4
4
  }
package/docs/API.md CHANGED
@@ -939,7 +939,7 @@ explicit lifecycle operations. It composes the lower-level store, manifest,
939
939
  tree, RootSet, commit, and ref operations without requiring callers to manage
940
940
  payload OIDs.
941
941
 
942
- ### `assets.put()`
942
+ ### `assets.put()` and `assets.putBatch()`
943
943
 
944
944
  ```javascript
945
945
  const staged = await cas.assets.put({
@@ -955,6 +955,13 @@ const staged = await cas.assets.put({
955
955
  merkleThreshold,
956
956
  chunking,
957
957
  });
958
+
959
+ const stagedBatch = await cas.assets.putBatch({
960
+ assets: [firstAssetOptions, secondAssetOptions],
961
+ maxBatchAssets: 4,
962
+ maxBatchObjects: 4096,
963
+ maxBatchBytes: 256 * 1024 * 1024,
964
+ });
958
965
  ```
959
966
 
960
967
  Streams an `AsyncIterable<Uint8Array>` through the existing CAS pipeline,
@@ -966,7 +973,26 @@ limits documented in the streaming matrix.
966
973
  `filename` defaults to `slug`. All other storage options have the same meaning
967
974
  as `store()`.
968
975
 
969
- **Returns:** `Promise<StagedAsset>`
976
+ `putBatch()` requires an explicit array of ordinary asset options and returns
977
+ an immutable result array in the same order. It keeps at most
978
+ `maxBatchAssets` source pipelines active, pipelines immutable blob and manifest
979
+ writes through bounded Git protocol waves, and writes all complete manifest
980
+ trees in one final dependency phase. Defaults are four active assets, 4,096
981
+ aggregate written objects, and 256 MiB of aggregate written bytes. Supported
982
+ upper bounds are 64 active assets, 100,000 objects, and 1 GiB. Plumbing protocol
983
+ requests remain internally capped at 256 objects and 64 MiB per request.
984
+
985
+ A failed source, bound, persistence operation, or result-cardinality check
986
+ rejects the whole call; it never returns a partial array as a complete batch.
987
+ The error metadata includes bounded staging counts for immutable objects that
988
+ may have been written before failure. `maxBatchAssets` is a resource/performance
989
+ choice: raising it can reduce protocol rounds while increasing the number of
990
+ simultaneously live caller streams.
991
+
992
+ **`assets.put()` returns:** `Promise<StagedAsset>`
993
+
994
+ **`assets.putBatch()` returns:** `Promise<ReadonlyArray<StagedAsset>>`, ordered
995
+ one-for-one with the input `assets` array.
970
996
 
971
997
  ```javascript
972
998
  {
@@ -1078,7 +1104,7 @@ The canonical page token is:
1078
1104
  git-cas:1:page:blob:raw:<sha1|sha256>:<oid>
1079
1105
  ```
1080
1106
 
1081
- ### `bundles.put()` and `bundles.putOrdered()`
1107
+ ### `bundles.put()`, `bundles.putOrdered()`, and `bundles.putOrderedBatch()`
1082
1108
 
1083
1109
  ```javascript
1084
1110
  const staged = await cas.bundles.put({
@@ -1093,6 +1119,17 @@ const staged = await cas.bundles.put({
1093
1119
  const streamed = await cas.bundles.putOrdered({
1094
1120
  members: orderedAsyncMemberPairs,
1095
1121
  });
1122
+
1123
+ const stagedBatch = await cas.bundles.putOrderedBatch({
1124
+ bundles: [
1125
+ { members: firstOrderedMemberPairs },
1126
+ { members: secondOrderedMemberPairs },
1127
+ ],
1128
+ maxBatchBundles: 64,
1129
+ maxBatchMembers: 8192,
1130
+ maxBatchObjects: 256,
1131
+ maxBatchBytes: 64 * 1024 * 1024,
1132
+ });
1096
1133
  ```
1097
1134
 
1098
1135
  Members are named application handles, byte sources, or `{ source, maxBytes }`
@@ -1103,6 +1140,20 @@ to every member handle. `put()` sorts an in-memory object, `Map`, or pair array.
1103
1140
  out-of-order canonical paths, enabling construction with bounded resident
1104
1141
  state.
1105
1142
 
1143
+ `putOrderedBatch()` requires an explicit array of ordered-bundle requests,
1144
+ collects only that declared group, and returns an immutable input-ordered array.
1145
+ It defaults to at most 64 bundles, 8,192 aggregate members, 256 planned objects,
1146
+ and 64 MiB across inline pages, descriptors, and trees. Callers may lower any
1147
+ limit; supported maxima are 256 bundles, 100,000 aggregate members, 256 objects,
1148
+ and 64 MiB. Per-bundle repository limits still apply independently.
1149
+
1150
+ After admission, the batch validates shared immutable handles once, writes
1151
+ inline pages together, writes all descriptor blobs in bounded windows, and
1152
+ writes independent tree nodes bottom-up by depth. Grouping changes scheduling,
1153
+ not descriptor bytes, tree entries, handles, or member order. A failure returns
1154
+ no complete result array and carries bounded staging evidence for immutable
1155
+ objects already written.
1156
+
1106
1157
  Repository defaults, which an operation may only lower, are:
1107
1158
 
1108
1159
  | Limit | Default |
@@ -1376,23 +1427,75 @@ The workspace mirrors only application-storage writes:
1376
1427
 
1377
1428
  ```javascript
1378
1429
  await workspace.assets.put(options);
1430
+ await workspace.assets.putBatch(options);
1379
1431
  await workspace.assets.adopt(options);
1380
1432
  await workspace.pages.put(options);
1381
1433
  await workspace.pages.putBatch(options);
1382
1434
  await workspace.bundles.put(options);
1383
1435
  await workspace.bundles.putOrdered(options);
1436
+ await workspace.bundles.putOrderedBatch(options);
1384
1437
  ```
1385
1438
 
1439
+ Dependent page and bundle waves can instead share one bounded compound
1440
+ admission:
1441
+
1442
+ ```javascript
1443
+ const admitted = await workspace.batch({
1444
+ maxOperations: 3,
1445
+ operation: async (scope) => {
1446
+ const pages = await scope.pages.putBatch({ pages: pageRequests });
1447
+ const leaves = await scope.bundles.putOrderedBatch({
1448
+ bundles: buildLeafRequests(pages),
1449
+ });
1450
+ return (await scope.bundles.putOrderedBatch({
1451
+ bundles: [buildRootRequest(leaves)],
1452
+ }))[0];
1453
+ },
1454
+ });
1455
+
1456
+ admitted.value; // BundleHandle returned by the callback
1457
+ admitted.retention; // exact WorkspaceCheckpointResult
1458
+ ```
1459
+
1460
+ `batch({ operation, maxOperations })` calls `operation` exactly once. Its scope
1461
+ exposes only `pages.putBatch()` and `bundles.putOrderedBatch()`. Both methods
1462
+ retain their existing per-call limits and validation, serialize by invocation
1463
+ order, and return frozen arrays of provisional handles rather than staged
1464
+ result objects. The operation defaults to at most 64 scope calls and rejects a
1465
+ limit above the exported hard maximum of 1,024.
1466
+
1467
+ Success installs the union of previously retained targets and every compound
1468
+ target in one exact workspace generation. The returned `value` is the callback
1469
+ value; it becomes caller-visible only after scoped Git resources close and the
1470
+ paired `retention` result proves the final generation. The scope closes before
1471
+ the outer promise settles. Calling an escaped scope later fails with
1472
+ `WORKSPACE_STATE_INVALID`.
1473
+
1474
+ The callback is trusted application code, not a JavaScript capability sandbox.
1475
+ The API cannot prevent a callback from assigning a provisional handle into
1476
+ external state as a side effect. Such a handle has no compound retention
1477
+ witness and must not be used outside the callback. Only the settled outer
1478
+ result carries the admission guarantee.
1479
+
1480
+ An empty operation, invalid bound, callback failure, staged-write failure,
1481
+ session-close failure, or final checked-ref failure returns no admitted value.
1482
+ Queued work stops after the first failure, the prior workspace generation does
1483
+ not move, and distinct callback/write or operation/close failures remain
1484
+ available through `AggregateError`. Immutable objects written before refusal
1485
+ may remain unreachable for Git's ordinary reclamation. Compound admission is
1486
+ not a cross-workspace, cross-ref, or arbitrary application transaction.
1487
+
1386
1488
  Each method returns only after a direct workspace generation reaches the
1387
1489
  returned typed handle. The result is otherwise the ordinary staged result plus
1388
1490
  a workspace `RetentionWitness`. Calls on one workspace serialize their ref
1389
1491
  mutations so concurrent staging cannot silently lose an accumulated root.
1390
1492
 
1391
- `workspace.pages.putBatch()` accepts the same `pages`, `maxBatchBytes`, and
1392
- `maxBatchPages` bounds as `cas.pages.putBatch()`. It returns one retained result
1393
- per input in input order, while all results from the batch name the same exact
1394
- workspace generation. Duplicate page content preserves ordered results but is
1395
- retained only once in that generation.
1493
+ The three workspace batch methods accept the same options as their top-level
1494
+ counterparts. Each returns one retained result per input in input order, while
1495
+ all results from that batch name the same exact workspace generation. Duplicate
1496
+ content preserves ordered results but is retained only once in that generation.
1497
+ Batch construction and the one-generation installation remain serialized with
1498
+ all other mutations on that workspace.
1396
1499
 
1397
1500
  This guarantee starts when the method returns. Like all Git object composition,
1398
1501
  the object-write-to-ref-update interval still relies on Git's ordinary
@@ -3384,7 +3487,7 @@ new CasError({ message, code, meta, documentationUrl });
3384
3487
  | `MANIFEST_NOT_FOUND` | No manifest entry found in the Git tree | `readManifest()`, `inspectAsset()`, `collectReferencedChunks()` |
3385
3488
  | `GIT_ERROR` | Underlying Git plumbing command failed | `readManifest()`, `inspectAsset()`, `collectReferencedChunks()` |
3386
3489
  | `GIT_REF_NOT_FOUND` | Git ref lookup found no ref; vault reads normalize this to empty state | `GitRefAdapter`, `VaultPersistence` |
3387
- | `INVALID_OPTIONS` | Mutually exclusive options provided or unsupported option value | `store()`, `restore()` |
3490
+ | `INVALID_OPTIONS` | Mutually exclusive options, malformed batch input, or unsupported option value | `store()`, `restore()`, asset and bundle batches |
3388
3491
  | `RESOURCE_CLOSED` | A facade or persistence adapter operation began while or after closure was in progress | `ContentAddressableStore`, `GitPersistenceAdapter` |
3389
3492
  | `HANDLE_INVALID` | Handle object, canonical token, or staged result is malformed or unsupported | Application handles and staged results |
3390
3493
  | `HANDLE_KIND_MISMATCH` | A handle has a valid envelope but the wrong content kind | Handle parsing and application storage |
@@ -3395,14 +3498,14 @@ new CasError({ message, code, meta, documentationUrl });
3395
3498
  | `PAGE_BATCH_LIMIT` | Page batch count or aggregate bytes exceed the explicit batch policy | `pages.putBatch()` |
3396
3499
  | `BUNDLE_CORRUPT` | Persisted bundle descriptors, edges, ranges, or target summaries disagree | Bundle reads, retention, publication |
3397
3500
  | `BUNDLE_DESCRIPTOR_LIMIT` | Bundle descriptor bytes exceed admission or repository read policy | Bundle construction and validation |
3398
- | `BUNDLE_DUPLICATE_PATH` | Two ordered bundle members use the same canonical path | `bundles.putOrdered()` |
3501
+ | `BUNDLE_DUPLICATE_PATH` | Two ordered bundle members use the same canonical path | `bundles.putOrdered()`, `bundles.putOrderedBatch()` |
3399
3502
  | `BUNDLE_FANOUT_LIMIT` | Bundle tree width, depth, or nesting exceeds policy | Bundle construction and validation |
3400
3503
  | `BUNDLE_LIMIT_INVALID` | Configured or per-operation bundle limits are malformed or attempt to raise repository policy | Facade construction, bundle writes |
3401
3504
  | `BUNDLE_MEMBER_INVALID` | Bundle member input or resolved handle target is invalid | Bundle construction |
3402
- | `BUNDLE_MEMBER_LIMIT` | Bundle member count exceeds admission or repository read policy | Bundle construction and validation |
3505
+ | `BUNDLE_MEMBER_LIMIT` | Bundle or aggregate batch member count exceeds admission or repository read policy | Bundle construction and validation |
3403
3506
  | `BUNDLE_MEMBER_NOT_FOUND` | Requested bundle member path is absent | `bundles.openMember()` |
3404
3507
  | `BUNDLE_MEMBER_NOT_STREAMABLE` | Requested member is a nested structured bundle rather than bytes | `bundles.openMember()` |
3405
- | `BUNDLE_MEMBER_ORDER` | Ordered bundle input is not strictly increasing by canonical path | `bundles.putOrdered()` |
3508
+ | `BUNDLE_MEMBER_ORDER` | Ordered bundle input is not strictly increasing by canonical path | `bundles.putOrdered()`, `bundles.putOrderedBatch()` |
3406
3509
  | `BUNDLE_PATH_INVALID` | Bundle member path is empty, unsafe, or non-canonical | Bundle writes and reads |
3407
3510
  | `BUNDLE_PATH_LIMIT` | Bundle member path exceeds its UTF-8 byte bound | Bundle construction and validation |
3408
3511
  | `COLLECTION_NAMESPACE_INVALID` | Managed collection namespace or cache ref is not canonical | `caches.open()` |
@@ -0,0 +1,89 @@
1
+ # git-cas v6.5.8 Release Notes
2
+
3
+ v6.5.8 removes process-per-artifact write amplification for bounded groups of
4
+ independent assets and ordered bundles. It adds input-ordered batch APIs and
5
+ one-generation workspace retention without changing existing object bytes,
6
+ handles, refs, single-write behavior, or stored-data formats.
7
+
8
+ ## Bounded Application Write Waves
9
+
10
+ `assets.putBatch()` admits a caller-supplied array under explicit active-asset,
11
+ planned-object, and aggregate-byte limits. Each asset retains the same store,
12
+ chunking, encryption, compression, manifest, and handle semantics as
13
+ `assets.put()`. Independent chunk and manifest blobs are submitted in bounded
14
+ waves, followed by the manifest trees that depend on them. Results preserve
15
+ input order, including repeated content.
16
+
17
+ `bundles.putOrderedBatch()` validates and preplans a bounded array of the
18
+ existing deterministic ordered-bundle graphs. Descriptor blobs are written
19
+ together, and tree layers are written bottom-up. The batch is limited by bundle
20
+ count, aggregate members, planned object count, and admitted bytes. Serialized
21
+ descriptors, fanout topology, tree entries, and returned handles remain
22
+ identical to repeated `bundles.putOrdered()` calls.
23
+
24
+ Scoped staging workspaces mirror both APIs. A successful batch installs one
25
+ exact RootSet generation and every returned retention witness names that same
26
+ generation. The authoritative ref write remains checked and no-dereference;
27
+ concurrent head movement returns the existing conflict instead of being
28
+ retried or hidden.
29
+
30
+ ## Session and Compatibility Behavior
31
+
32
+ On Plumbing 3.3.0, git-cas pipelines blob, tree, and metadata groups through
33
+ typed sessions and reuses one `update-ref --stdin` child across successful
34
+ checked mutations. A failed update-ref transaction is discarded and closed;
35
+ later semantic work may open a fresh session. Adapter closure drains every
36
+ owned child.
37
+
38
+ Existing single methods remain supported. Persistence adapters without the
39
+ new optional batch methods retain ordered per-item fallbacks. A blob above the
40
+ 64 MiB fast-import ceiling deliberately uses the existing one-shot writer
41
+ while eligible members remain batched. No unbounded source is collected merely
42
+ because its operation participates in a batch.
43
+
44
+ ## Process-Topology Witness
45
+
46
+ The committed five-sample witness uses the published
47
+ `@git-stunts/plumbing@3.3.0` artifact in temporary SHA-1 and SHA-256 bare
48
+ repositories. Before-and-after semantic digests match in every sample.
49
+
50
+ | Operation | Git children | Typed interactions | Median wall reduction |
51
+ | ---------------------------- | -----------: | -----------------: | --------------------: |
52
+ | 16 SHA-1 assets | 49 -> 2 | 64 -> 19 | 87.137% |
53
+ | 16 SHA-256 assets | 49 -> 2 | 64 -> 19 | 86.673% |
54
+ | 16 SHA-1 workspace bundles | 147 -> 8 | 224 -> 13 | 91.047% |
55
+ | 16 SHA-256 workspace bundles | 147 -> 8 | 224 -> 13 | 90.930% |
56
+
57
+ Process and interaction counts plus semantic identity are the deterministic
58
+ acceptance evidence. Wall time and worker CPU are host observations, not
59
+ universal speed guarantees. The residual children preserve Git authority for
60
+ tree construction, commit identity, ref containment checks, and checked
61
+ publication.
62
+
63
+ ## Failure and Reachability
64
+
65
+ Wrong batch result cardinality rejects the entire semantic batch. Source
66
+ failure records its input index and bounded staging evidence, closes admitted
67
+ sibling iterators at their next chunk boundary, and never starts later queued
68
+ sources. Immutable objects written before a failure may remain unreachable;
69
+ no partial result array is presented as success.
70
+
71
+ Real-Git tests stage asset and bundle batches, prune immediately, verify all
72
+ retained content, release the workspace, prune again, and observe released
73
+ bundle roots become collectible. SHA-1 and SHA-256 identity tests compare the
74
+ complete returned handle sequence against repeated singles.
75
+
76
+ ## Verification
77
+
78
+ The release candidate passed the repository's complete 14-step verifier with
79
+ 7,057 observed tests across Node, Bun, and Deno. The matrix includes public
80
+ type compatibility, executable examples, 203 real-Git integration tests on
81
+ each runtime, build stamping, npm packing, and JSR publication dry-runs.
82
+
83
+ ## Compatibility
84
+
85
+ This release requires no application or stored-data migration. Applications
86
+ may keep every existing single-write call unchanged. Batch adoption is
87
+ explicit and additive; custom adapters and older Plumbing implementations keep
88
+ their established fallback paths. JSR metadata remains validation-only because
89
+ the release workflow publishes npm plus the GitHub Release.