@git-stunts/git-cas 6.5.3 → 6.5.5

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,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [6.5.5] — 2026-07-26
11
+
12
+ ### Fixed
13
+
14
+ - **Self-contained internal Git commits** - root-set, publication, and vault
15
+ commits now carry git-cas-owned author and committer identity, so bare
16
+ repositories do not depend on ambient Git user configuration.
17
+
18
+ ## [6.5.4] — 2026-07-26
19
+
20
+ ### Added
21
+
22
+ - **Batched staging-workspace page retention** -
23
+ `workspace.pages.putBatch()` writes an explicitly count-and-byte-bounded
24
+ ordered page group and anchors every returned page in one workspace
25
+ generation, avoiding a growing root-set rewrite for each page.
26
+
10
27
  ## [6.5.3] — 2026-07-19
11
28
 
12
29
  ### 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.3 Release Notes](./docs/releases/v6.5.3.md).
52
+ [v6.5.5 Release Notes](./docs/releases/v6.5.5.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, returns only after each handle is
153
- anchored, promotes destination-first, and exposes bounded age, expiry,
154
- logical-content, and direct-root diagnostics with opaque cleanup pagination.
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,10 @@ 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.
224
+ - **[v6.5.5 Release Notes](./docs/releases/v6.5.5.md)**: Self-contained
225
+ identity for git-cas-owned commits in unconfigured bare repositories.
221
226
  - **[Upgrading](./UPGRADING.md)**: Migration guide for v5 → v6.
222
227
  - **[Changelog](./CHANGELOG.md)**: Version history and migration notes.
223
228
 
package/UPGRADING.md CHANGED
@@ -2,6 +2,44 @@
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.4 To v6.5.5
6
+
7
+ v6.5.5 changes no public API and requires no stored-data migration. New
8
+ git-cas-owned root-set, publication, and vault commits carry a stable internal
9
+ author and committer identity, so writes no longer depend on repository-local
10
+ or global `user.name` and `user.email` configuration.
11
+
12
+ Existing refs, stored objects, and handles remain valid. Because Git commit
13
+ identity contributes to commit bytes, a newly created internal commit may have
14
+ a different OID than the same tree, parents, message, and timestamp would have
15
+ produced under an operator's ambient identity. Applications must continue to
16
+ treat these commits as opaque storage generations.
17
+
18
+ See [v6.5.5 Release Notes](./docs/releases/v6.5.5.md) for the exact identity
19
+ contract and clean-bare-repository verification.
20
+
21
+ ## v6.5.3 To v6.5.4
22
+
23
+ v6.5.4 adds `workspace.pages.putBatch()` and requires no stored-data migration.
24
+ Callers that stage many bounded pages can opt into one count-and-byte-bounded
25
+ page write plus one workspace-generation installation:
26
+
27
+ ```js
28
+ const sources = [Uint8Array.of(1), Uint8Array.of(2)];
29
+ const staged = await workspace.pages.putBatch({
30
+ pages: sources.map((source) => ({ source })),
31
+ maxBatchPages: 256,
32
+ });
33
+ ```
34
+
35
+ Results preserve input order, including repeated content, and every result has
36
+ an exact retained witness for the same workspace generation. Existing
37
+ `workspace.pages.put()` behavior is unchanged. Applications do not need to
38
+ adopt the batch API unless they need to remove per-page root-set rewrites.
39
+
40
+ See [v6.5.4 Release Notes](./docs/releases/v6.5.4.md) for the measured
41
+ 8,188-page migration workload and compatibility details.
42
+
5
43
  ## v6.5.2 To v6.5.3
6
44
 
7
45
  v6.5.3 changes no public API and requires no stored-data migration. Long-lived
package/build-info.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
- "sha": "00df607",
3
- "timestamp": "2026-07-19T17:10:30.099Z"
2
+ "sha": "9ea91a7",
3
+ "timestamp": "2026-07-26T17:04:12.629Z"
4
4
  }
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.put({ source: firstShard });
1346
- const second = await workspace.pages.put({ source: secondShard });
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.
@@ -0,0 +1,43 @@
1
+ # git-cas v6.5.5 Release Notes
2
+
3
+ v6.5.5 makes every git-cas-owned Git commit independent of ambient user
4
+ configuration. Root-set, publication, and vault writes now work in a clean bare
5
+ repository without configuring a personal author or committer.
6
+
7
+ ## Self-Contained Commit Identity
8
+
9
+ `GitRefAdapter.createCommit()` supplies this stable identity to each internal
10
+ `git commit-tree` operation:
11
+
12
+ ```text
13
+ git-cas <git-cas@example.invalid>
14
+ ```
15
+
16
+ The identity is scoped to the individual Git command. git-cas does not invoke
17
+ `git config`, mutate repository or global settings, or require applications to
18
+ provide personal identity.
19
+
20
+ This fixes storage writes performed against bare or automation-owned
21
+ repositories where `user.name` and `user.email` are deliberately absent. The
22
+ failure was exposed by a clean-Linux retained-substrate migration rehearsal:
23
+ post-promotion root-set retention reached `git commit-tree`, which otherwise
24
+ stopped with `Author identity unknown`.
25
+
26
+ ## Verification
27
+
28
+ Unit coverage observes all four author and committer environment variables.
29
+ Real-Git integration reads a root-set commit through native Git and verifies
30
+ both headers exactly. The versioned release candidate passed the complete
31
+ Node, Bun, and Deno unit and integration matrix, public type compatibility,
32
+ examples, lint, build stamping, and package dry-runs.
33
+
34
+ ## Compatibility
35
+
36
+ This release changes no public API or stored-data schema and requires no
37
+ migration. Existing refs, objects, handles, and retained generations remain
38
+ valid.
39
+
40
+ Git identity is part of commit bytes, so newly created internal commit OIDs may
41
+ differ from commits that previously inherited an operator identity. Internal
42
+ commit OIDs remain opaque generations; callers must not derive them in advance
43
+ or interpret personal attribution from them.
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",
3
+ "version": "6.5.5",
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,8 @@
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",
44
+ "docs/releases/v6.5.5.md",
43
45
  "docs/THREAT_MODEL.md",
44
46
  "docs/VAULT_INTERNALS.md",
45
47
  "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
- 'writeBlob', 'writeTree', 'readBlob', 'readTree', 'readObjectType', 'readObjectSize',
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'])],
@@ -14,6 +14,12 @@ import Oid from '../../domain/value-objects/Oid.js';
14
14
  */
15
15
  const DEFAULT_POLICY = Policy.timeout(30_000);
16
16
  const FORBIDDEN_REF_CHARACTERS = new Set(['~', '^', ':', '?', '*', '[', '\\']);
17
+ const INTERNAL_COMMIT_IDENTITY = Object.freeze({
18
+ GIT_AUTHOR_EMAIL: 'git-cas@example.invalid',
19
+ GIT_AUTHOR_NAME: 'git-cas',
20
+ GIT_COMMITTER_EMAIL: 'git-cas@example.invalid',
21
+ GIT_COMMITTER_NAME: 'git-cas',
22
+ });
17
23
  const MAX_REF_ITERATION_LIMIT = 1001;
18
24
  const REF_NAME_ENCODER = new globalThis.TextEncoder();
19
25
 
@@ -103,7 +109,7 @@ export default class GitRefAdapter extends GitRefPort {
103
109
  args.push('-p', parent);
104
110
  }
105
111
  return this.policy.execute(() =>
106
- this.plumbing.execute({ args }),
112
+ this.plumbing.execute({ args, env: INTERNAL_COMMIT_IDENTITY }),
107
113
  );
108
114
  }
109
115
 
@@ -1 +1 @@
1
- export const PACKAGE_VERSION = '6.5.3';
1
+ export const PACKAGE_VERSION = '6.5.5';