@git-stunts/git-cas 6.5.3 → 6.5.4
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 +9 -0
- package/README.md +7 -4
- package/UPGRADING.md +22 -0
- package/build-info.json +2 -2
- package/docs/API.md +13 -2
- package/docs/releases/v6.5.4.md +47 -0
- package/index.d.ts +3 -0
- package/package.json +2 -1
- package/src/domain/services/StagingWorkspace.js +64 -1
- package/src/domain/services/StagingWorkspaceRegistry.js +10 -8
- package/src/package-version.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [6.5.4] — 2026-07-26
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **Batched staging-workspace page retention** -
|
|
15
|
+
`workspace.pages.putBatch()` writes an explicitly count-and-byte-bounded
|
|
16
|
+
ordered page group and anchors every returned page in one workspace
|
|
17
|
+
generation, avoiding a growing root-set rewrite for each page.
|
|
18
|
+
|
|
10
19
|
## [6.5.3] — 2026-07-19
|
|
11
20
|
|
|
12
21
|
### Performance
|
package/README.md
CHANGED
|
@@ -49,7 +49,7 @@ Unlike traditional LFS which moves files to external servers, `git-cas` treats t
|
|
|
49
49
|
Existing v5 users should read [UPGRADING.md](./UPGRADING.md) and run
|
|
50
50
|
`npm run upgrade` in dry-run mode before restoring old encrypted vault entries.
|
|
51
51
|
For the release overview, see the
|
|
52
|
-
[v6.5.
|
|
52
|
+
[v6.5.4 Release Notes](./docs/releases/v6.5.4.md).
|
|
53
53
|
|
|
54
54
|
### 1. CLI Usage
|
|
55
55
|
|
|
@@ -149,9 +149,10 @@ Core capabilities:
|
|
|
149
149
|
complete-validation member reads, reachability roots, compare-and-swap refs,
|
|
150
150
|
and immutable lifecycle evidence.
|
|
151
151
|
- **Scoped staging workspaces**: `workspaces.open()` mirrors application writes
|
|
152
|
-
behind one renewable temporary RootSet,
|
|
153
|
-
|
|
154
|
-
|
|
152
|
+
behind one renewable temporary RootSet, supports one-generation bounded page
|
|
153
|
+
batches, returns only after each handle is anchored, promotes
|
|
154
|
+
destination-first, and exposes bounded age, expiry, logical-content, and
|
|
155
|
+
direct-root diagnostics with opaque cleanup pagination.
|
|
155
156
|
- **Envelope recipients**: multi-recipient key wrapping and recipient rotation
|
|
156
157
|
avoid re-encrypting data blobs.
|
|
157
158
|
- **Operational diagnostics**: `cas.diagnostics.doctor()` streams repository
|
|
@@ -218,6 +219,8 @@ All three runtimes are tested in CI on every push. The hexagonal architecture is
|
|
|
218
219
|
object sessions, scoped page batches, and deterministic resource closure.
|
|
219
220
|
- **[v6.5.3 Release Notes](./docs/releases/v6.5.3.md)**: Coherent reuse of
|
|
220
221
|
persistent Git object sessions across compatible immutable writes.
|
|
222
|
+
- **[v6.5.4 Release Notes](./docs/releases/v6.5.4.md)**: Ordered page batches
|
|
223
|
+
retained under one exact staging-workspace generation.
|
|
221
224
|
- **[Upgrading](./UPGRADING.md)**: Migration guide for v5 → v6.
|
|
222
225
|
- **[Changelog](./CHANGELOG.md)**: Version history and migration notes.
|
|
223
226
|
|
package/UPGRADING.md
CHANGED
|
@@ -2,6 +2,28 @@
|
|
|
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.3 To v6.5.4
|
|
6
|
+
|
|
7
|
+
v6.5.4 adds `workspace.pages.putBatch()` and requires no stored-data migration.
|
|
8
|
+
Callers that stage many bounded pages can opt into one count-and-byte-bounded
|
|
9
|
+
page write plus one workspace-generation installation:
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
const sources = [Uint8Array.of(1), Uint8Array.of(2)];
|
|
13
|
+
const staged = await workspace.pages.putBatch({
|
|
14
|
+
pages: sources.map((source) => ({ source })),
|
|
15
|
+
maxBatchPages: 256,
|
|
16
|
+
});
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Results preserve input order, including repeated content, and every result has
|
|
20
|
+
an exact retained witness for the same workspace generation. Existing
|
|
21
|
+
`workspace.pages.put()` behavior is unchanged. Applications do not need to
|
|
22
|
+
adopt the batch API unless they need to remove per-page root-set rewrites.
|
|
23
|
+
|
|
24
|
+
See [v6.5.4 Release Notes](./docs/releases/v6.5.4.md) for the measured
|
|
25
|
+
8,188-page migration workload and compatibility details.
|
|
26
|
+
|
|
5
27
|
## v6.5.2 To v6.5.3
|
|
6
28
|
|
|
7
29
|
v6.5.3 changes no public API and requires no stored-data migration. Long-lived
|
package/build-info.json
CHANGED
package/docs/API.md
CHANGED
|
@@ -1342,8 +1342,12 @@ const workspace = await cas.workspaces.open({
|
|
|
1342
1342
|
});
|
|
1343
1343
|
|
|
1344
1344
|
try {
|
|
1345
|
-
const first = await workspace.pages.
|
|
1346
|
-
|
|
1345
|
+
const [first, second] = await workspace.pages.putBatch({
|
|
1346
|
+
pages: [
|
|
1347
|
+
{ source: firstShard },
|
|
1348
|
+
{ source: secondShard },
|
|
1349
|
+
],
|
|
1350
|
+
});
|
|
1347
1351
|
const bundle = await workspace.bundles.putOrdered({
|
|
1348
1352
|
members: [
|
|
1349
1353
|
['shards/first.cbor', first.handle],
|
|
@@ -1374,6 +1378,7 @@ The workspace mirrors only application-storage writes:
|
|
|
1374
1378
|
await workspace.assets.put(options);
|
|
1375
1379
|
await workspace.assets.adopt(options);
|
|
1376
1380
|
await workspace.pages.put(options);
|
|
1381
|
+
await workspace.pages.putBatch(options);
|
|
1377
1382
|
await workspace.bundles.put(options);
|
|
1378
1383
|
await workspace.bundles.putOrdered(options);
|
|
1379
1384
|
```
|
|
@@ -1383,6 +1388,12 @@ returned typed handle. The result is otherwise the ordinary staged result plus
|
|
|
1383
1388
|
a workspace `RetentionWitness`. Calls on one workspace serialize their ref
|
|
1384
1389
|
mutations so concurrent staging cannot silently lose an accumulated root.
|
|
1385
1390
|
|
|
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.
|
|
1396
|
+
|
|
1386
1397
|
This guarantee starts when the method returns. Like all Git object composition,
|
|
1387
1398
|
the object-write-to-ref-update interval still relies on Git's ordinary
|
|
1388
1399
|
unreachable-object grace period. Running immediate-expiry prune concurrently
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# git-cas v6.5.4 Release Notes
|
|
2
|
+
|
|
3
|
+
v6.5.4 adds ordered page-batch retention to scoped staging workspaces. It lets
|
|
4
|
+
applications write a bounded page group and retain the complete group under one
|
|
5
|
+
exact workspace generation instead of rewriting a growing root set for every
|
|
6
|
+
page.
|
|
7
|
+
|
|
8
|
+
## Batched Workspace Pages
|
|
9
|
+
|
|
10
|
+
`workspace.pages.putBatch()` accepts the existing page-batch count and byte
|
|
11
|
+
limits, delegates page creation to the bounded page service, and installs the
|
|
12
|
+
resulting handles in one compare-and-swap workspace update. Returned pages stay
|
|
13
|
+
in input order and each carries an exact retained witness for the shared
|
|
14
|
+
generation.
|
|
15
|
+
|
|
16
|
+
Repeated content still produces one result per input position while the
|
|
17
|
+
workspace target set deduplicates the content handle. An oversized batch fails
|
|
18
|
+
before workspace-ref mutation, and a failed generation installation returns no
|
|
19
|
+
retained batch.
|
|
20
|
+
|
|
21
|
+
## Measured Effect
|
|
22
|
+
|
|
23
|
+
A disposable bare repository staged 8,188 deterministic tiny pages in 32
|
|
24
|
+
batches of at most 256 pages. It completed in 15.546 seconds, installed 8,188
|
|
25
|
+
page objects under the expected generation chain, and left no garbage reported
|
|
26
|
+
by Git.
|
|
27
|
+
|
|
28
|
+
The motivating pre-change git-warp rehearsal had retained only 5,213 of the
|
|
29
|
+
same 8,188-page cardinality after 75 minutes while producing about 1.16 GiB of
|
|
30
|
+
loose scratch objects. These measurements establish the removed quadratic
|
|
31
|
+
root-set rewrite at that workload; they are local evidence, not a
|
|
32
|
+
cross-platform timing guarantee. The benchmark used synthetic tiny pages,
|
|
33
|
+
contained no Think data, and added no large fixture to this repository.
|
|
34
|
+
|
|
35
|
+
## Verification
|
|
36
|
+
|
|
37
|
+
The versioned candidate passed 2,086 Node unit tests, 2,085 Bun unit tests,
|
|
38
|
+
2,076 Deno unit tests, and 199 real-Git integration tests on each runtime. The
|
|
39
|
+
full release verifier passed all 14 steps with 6,844 observed tests, including
|
|
40
|
+
public type compatibility, examples, build stamping, and npm and JSR dry-runs.
|
|
41
|
+
|
|
42
|
+
## Compatibility
|
|
43
|
+
|
|
44
|
+
This release is API-additive and requires no application or stored-data
|
|
45
|
+
migration. Existing `workspace.pages.put()` calls, handles, object identities,
|
|
46
|
+
workspace refs, witnesses, retention semantics, limits, release behavior, and
|
|
47
|
+
pruning behavior are unchanged. Callers opt into batching explicitly.
|
package/index.d.ts
CHANGED
|
@@ -1637,6 +1637,9 @@ export declare class StagingWorkspace {
|
|
|
1637
1637
|
};
|
|
1638
1638
|
readonly pages: {
|
|
1639
1639
|
put(options: { source: PageSource; maxBytes?: number }): Promise<WorkspaceRetainedPage>;
|
|
1640
|
+
putBatch(
|
|
1641
|
+
options: Parameters<PageCapability['putBatch']>[0],
|
|
1642
|
+
): Promise<ReadonlyArray<WorkspaceRetainedPage>>;
|
|
1640
1643
|
};
|
|
1641
1644
|
readonly bundles: {
|
|
1642
1645
|
put(options: Parameters<BundleCapability['put']>[0]): Promise<WorkspaceRetainedBundle>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@git-stunts/git-cas",
|
|
3
|
-
"version": "6.5.
|
|
3
|
+
"version": "6.5.4",
|
|
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",
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"docs/releases/v6.5.1.md",
|
|
41
41
|
"docs/releases/v6.5.2.md",
|
|
42
42
|
"docs/releases/v6.5.3.md",
|
|
43
|
+
"docs/releases/v6.5.4.md",
|
|
43
44
|
"docs/THREAT_MODEL.md",
|
|
44
45
|
"docs/VAULT_INTERNALS.md",
|
|
45
46
|
"docs/WALKTHROUGH.md",
|
|
@@ -61,6 +61,7 @@ export default class StagingWorkspace {
|
|
|
61
61
|
});
|
|
62
62
|
this.pages = Object.freeze({
|
|
63
63
|
put: (options) => this.#enqueue(() => this.#stage(this.#pages, 'put', options)),
|
|
64
|
+
putBatch: (options) => this.#stagePageBatch(options),
|
|
64
65
|
});
|
|
65
66
|
this.bundles = Object.freeze({
|
|
66
67
|
put: (options) => this.#enqueue(() => this.#stage(this.#bundles, 'put', options)),
|
|
@@ -205,6 +206,68 @@ export default class StagingWorkspace {
|
|
|
205
206
|
}
|
|
206
207
|
}
|
|
207
208
|
|
|
209
|
+
async #stageBatch(service, method, options) {
|
|
210
|
+
this.#assertActive();
|
|
211
|
+
const staged = await service[method](options);
|
|
212
|
+
if (!Array.isArray(staged) || staged.some((page) => !page?.handle)) {
|
|
213
|
+
throw createCasError(
|
|
214
|
+
`Workspace ${method}() did not return staged handles`,
|
|
215
|
+
ErrorCodes.WORKSPACE_STATE_INVALID,
|
|
216
|
+
{ method },
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
if (staged.length === 0) {
|
|
220
|
+
return Object.freeze([]);
|
|
221
|
+
}
|
|
222
|
+
try {
|
|
223
|
+
return await this.#retainBatch(staged);
|
|
224
|
+
} catch (error) {
|
|
225
|
+
if (error?.code === ErrorCodes.WORKSPACE_TTL_INVALID) {
|
|
226
|
+
throw error;
|
|
227
|
+
}
|
|
228
|
+
throw createCasError(
|
|
229
|
+
'Workspace staged a batch but could not establish retention',
|
|
230
|
+
ErrorCodes.WORKSPACE_RETENTION_FAILED,
|
|
231
|
+
{
|
|
232
|
+
method,
|
|
233
|
+
workspaceId: this.id,
|
|
234
|
+
stagedCount: staged.length,
|
|
235
|
+
originalError: error,
|
|
236
|
+
},
|
|
237
|
+
);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
#stagePageBatch(options) {
|
|
242
|
+
return this.#enqueue(() => this.#stageBatch(this.#pages, 'putBatch', options));
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
async #retainBatch(staged) {
|
|
246
|
+
const resolved = [];
|
|
247
|
+
const targets = new Map(this.#targets);
|
|
248
|
+
for (const page of staged) {
|
|
249
|
+
const target = await this.#resolveTarget(page.handle);
|
|
250
|
+
resolved.push(target);
|
|
251
|
+
targets.set(target.handle.toString(), target);
|
|
252
|
+
}
|
|
253
|
+
const installation = await this.#install([...targets.values()]);
|
|
254
|
+
const witnesses = new Map(
|
|
255
|
+
installation.witnesses.map((witness) => [witness.handle.toString(), witness]),
|
|
256
|
+
);
|
|
257
|
+
return Object.freeze(staged.map((page, index) => {
|
|
258
|
+
const handle = resolved[index].handle.toString();
|
|
259
|
+
const witness = witnesses.get(handle);
|
|
260
|
+
if (!witness) {
|
|
261
|
+
throw createCasError(
|
|
262
|
+
'Workspace generation omitted a newly staged batch handle',
|
|
263
|
+
ErrorCodes.WORKSPACE_STATE_INVALID,
|
|
264
|
+
{ handle, generation: installation.generation },
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
return StagingWorkspace.#retainedStage(page, witness);
|
|
268
|
+
}));
|
|
269
|
+
}
|
|
270
|
+
|
|
208
271
|
async #install(targets) {
|
|
209
272
|
if (targets.length > MAX_WORKSPACE_TARGETS) {
|
|
210
273
|
throw createCasError(
|
|
@@ -509,7 +572,7 @@ export default class StagingWorkspace {
|
|
|
509
572
|
['rootSet', StagingWorkspace.#hasMethods(rootSet, ['replace'])],
|
|
510
573
|
['refs', StagingWorkspace.#hasMethods(refs, ['deleteRef'])],
|
|
511
574
|
['assets', StagingWorkspace.#hasMethods(assets, ['put', 'adopt'])],
|
|
512
|
-
['pages', StagingWorkspace.#hasMethods(pages, ['put'])],
|
|
575
|
+
['pages', StagingWorkspace.#hasMethods(pages, ['put', 'putBatch'])],
|
|
513
576
|
['bundles', StagingWorkspace.#hasMethods(bundles, ['put', 'putOrdered'])],
|
|
514
577
|
['resolveHandle', typeof resolveHandle === 'function'],
|
|
515
578
|
['descriptorCodec', StagingWorkspace.#hasMethods(descriptorCodec, ['encode'])],
|
|
@@ -24,6 +24,13 @@ const TARGET_ROOT_TYPES = Object.freeze({
|
|
|
24
24
|
page: 'blob',
|
|
25
25
|
});
|
|
26
26
|
const DEFAULT_CLOCK = Object.freeze({ now: () => new Date() });
|
|
27
|
+
const PERSISTENCE_METHODS = Object.freeze([
|
|
28
|
+
'writeBlob', 'writeTree', 'readBlob', 'readTree', 'readObjectType', 'readObjectSize',
|
|
29
|
+
]);
|
|
30
|
+
const REF_METHODS = Object.freeze([
|
|
31
|
+
'resolveRef', 'resolveTree', 'resolveParents', 'createCommit', 'updateRef', 'deleteRef',
|
|
32
|
+
'iterateRefs',
|
|
33
|
+
]);
|
|
27
34
|
|
|
28
35
|
/** Creates staging workspaces and provides bounded abandoned-workspace operations. */
|
|
29
36
|
export default class StagingWorkspaceRegistry {
|
|
@@ -365,15 +372,10 @@ export default class StagingWorkspaceRegistry {
|
|
|
365
372
|
static #assertDependencies({ persistence, ref, assets, pages, bundles, resolveHandle, crypto,
|
|
366
373
|
clock, descriptorCodec }) {
|
|
367
374
|
const dependencies = [
|
|
368
|
-
['persistence', StagingWorkspaceRegistry.#hasMethods(persistence,
|
|
369
|
-
|
|
370
|
-
])],
|
|
371
|
-
['ref', StagingWorkspaceRegistry.#hasMethods(ref, [
|
|
372
|
-
'resolveRef', 'resolveTree', 'resolveParents', 'createCommit', 'updateRef', 'deleteRef',
|
|
373
|
-
'iterateRefs',
|
|
374
|
-
])],
|
|
375
|
+
['persistence', StagingWorkspaceRegistry.#hasMethods(persistence, PERSISTENCE_METHODS)],
|
|
376
|
+
['ref', StagingWorkspaceRegistry.#hasMethods(ref, REF_METHODS)],
|
|
375
377
|
['assets', StagingWorkspaceRegistry.#hasMethods(assets, ['put', 'adopt'])],
|
|
376
|
-
['pages', StagingWorkspaceRegistry.#hasMethods(pages, ['put', 'get'])],
|
|
378
|
+
['pages', StagingWorkspaceRegistry.#hasMethods(pages, ['put', 'putBatch', 'get'])],
|
|
377
379
|
['bundles', StagingWorkspaceRegistry.#hasMethods(bundles, ['put', 'putOrdered'])],
|
|
378
380
|
['resolveHandle', typeof resolveHandle === 'function'],
|
|
379
381
|
['crypto', StagingWorkspaceRegistry.#hasMethods(crypto, ['randomBytes'])],
|
package/src/package-version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const PACKAGE_VERSION = '6.5.
|
|
1
|
+
export const PACKAGE_VERSION = '6.5.4';
|