@git-stunts/git-cas 6.5.6 → 6.5.7

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,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [6.5.7] — 2026-08-23
11
+
12
+ ### Performance
13
+
14
+ - **Bounded stream session reads** - `readBlobStream()` now reuses the
15
+ persistent `cat-file` session for blobs at or below a fixed 10 MiB ceiling,
16
+ removing process-per-payload startup for small reads. Larger objects retain
17
+ the genuine one-shot streaming path without a speculative content read, and
18
+ plumbing without typed sessions retains the existing fallback.
19
+
10
20
  ## [6.5.6] — 2026-07-30
11
21
 
12
22
  ### Changed
package/README.md CHANGED
@@ -37,10 +37,10 @@ Unlike traditional LFS which moves files to external servers, `git-cas` treats t
37
37
  or publish them with generation-scoped evidence instead of managing Git
38
38
  objects, trees, or payload OIDs directly.
39
39
  - **Bounded Git Process Reuse**: Immutable object metadata and tree reads reuse
40
- typed Git sessions behind the adapter, while explicitly bounded page batches
41
- amortize writes without changing content identity. Read and payload streams
42
- remain streaming; complete page-batch inputs are collected and validated only
43
- within the explicit count-and-byte envelope.
40
+ typed Git sessions behind the adapter. On session-capable adapters, streaming
41
+ blob reads at or below a fixed 10 MiB ceiling use one bounded session read;
42
+ larger payloads retain the genuine one-shot streaming path. Explicitly
43
+ bounded page batches amortize writes without changing content identity.
44
44
  - **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
45
  - **Runtime-Adaptive**: A single core supports Node.js 22+, Bun, and Deno through a strict hexagonal port architecture with runtime-specific crypto adapters.
46
46
 
@@ -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.6 Release Notes](./docs/releases/v6.5.6.md).
52
+ [v6.5.7 Release Notes](./docs/releases/v6.5.7.md).
53
53
 
54
54
  ### 1. CLI Usage
55
55
 
@@ -230,6 +230,8 @@ All three runtimes are tested in CI on every push. The hexagonal architecture is
230
230
  identity for git-cas-owned commits in unconfigured bare repositories.
231
231
  - **[v6.5.6 Release Notes](./docs/releases/v6.5.6.md)**: Bijou 7 hosted
232
232
  cockpit ownership and deterministic checked-ref conflict classification.
233
+ - **[v6.5.7 Release Notes](./docs/releases/v6.5.7.md)**: Bounded persistent
234
+ sessions for small streaming blob reads while large payloads remain streamed.
233
235
  - **[Upgrading](./UPGRADING.md)**: Migration guide for v5 → v6.
234
236
  - **[Changelog](./CHANGELOG.md)**: Version history and migration notes.
235
237
 
package/UPGRADING.md CHANGED
@@ -2,6 +2,25 @@
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.6 To v6.5.7
6
+
7
+ v6.5.7 changes no public API, package export, object identity, manifest, ref,
8
+ or retention contract and requires no application or stored-data migration.
9
+
10
+ On session-capable Git persistence adapters, `readBlobStream()` now inspects
11
+ immutable object metadata through the persistent `cat-file` session. Blobs at
12
+ or below a fixed 10 MiB ceiling are returned as one bounded chunk through that
13
+ session. This changes backpressure granularity for admitted small reads, but
14
+ the method remains an `AsyncIterable` with identical bytes and errors.
15
+
16
+ Objects above 10 MiB retain the genuine one-shot streaming path and are never
17
+ speculatively session-read. Raising `maxBlobSize` cannot raise this fixed
18
+ ceiling. Adapters without typed sessions, plus exceptional metadata or bounded
19
+ read failures, retain the existing one-shot fallback.
20
+
21
+ See [v6.5.7 Release Notes](./docs/releases/v6.5.7.md) for the measured process
22
+ topology, fixed residency boundary, and compatibility details.
23
+
5
24
  ## v6.5.5 To v6.5.6
6
25
 
7
26
  v6.5.6 changes no public API or stored-data schema and requires no migration.
package/build-info.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
- "sha": "257e882",
3
- "timestamp": "2026-07-30T08:25:55.465Z"
2
+ "sha": "eebc6e3",
3
+ "timestamp": "2026-08-23T12:01:03.041Z"
4
4
  }
@@ -0,0 +1,56 @@
1
+ # git-cas v6.5.7 Release Notes
2
+
3
+ v6.5.7 removes process-per-payload startup for small blobs requested through
4
+ the streaming persistence contract. It changes no public package API, object
5
+ identity, stored-data format, ref, or retention behavior.
6
+
7
+ ## Bounded Session-Backed Stream Reads
8
+
9
+ On plumbing that exposes a typed `cat-file --batch-command` session,
10
+ `GitPersistenceAdapter.readBlobStream()` now inspects immutable object type and
11
+ size before choosing a content route. A blob at or below the fixed 10 MiB
12
+ ceiling is read through the existing repository-scoped session and returned as
13
+ one `Buffer` chunk.
14
+
15
+ The ceiling is fixed independently of `maxBlobSize`; callers cannot configure
16
+ the optimization into unbounded allocation. Returning one chunk changes
17
+ backpressure granularity for admitted small objects, but the public
18
+ `AsyncIterable` method, byte sequence, object identity, and error surface remain
19
+ unchanged.
20
+
21
+ Objects above 10 MiB retain the genuine one-shot streaming path. Metadata is
22
+ inspected first, so oversized content is streamed exactly once and never read
23
+ and discarded through the bounded session. Plumbing without typed sessions,
24
+ unsupported object posture, and failed bounded reads retain the previous
25
+ one-shot fallback.
26
+
27
+ ## Process-Topology Witness
28
+
29
+ The committed diagnostic used 32 deterministic 4,096-byte objects. The legacy
30
+ fallback opened 32 one-shot `cat-file` children. The bounded session route
31
+ opened one persistent child, issued 32 metadata requests and 32 bounded reads,
32
+ returned the same semantic digest, and left zero active sessions after close.
33
+
34
+ A 10 MiB + 1 byte object opened one persistent child for metadata and one
35
+ one-shot content stream. It performed no session content read. Docker-backed
36
+ integration tests repeat the small-object law in SHA-1 and SHA-256 repositories
37
+ and verify exact bytes plus deterministic closure.
38
+
39
+ These are structural process-count and semantic-equality results. They are not
40
+ a wall-clock guarantee, a claim that every downstream Git child disappears, or
41
+ an aggregate caller-residency bound.
42
+
43
+ ## Verification
44
+
45
+ The release candidate passed the repository's complete 14-step verifier with
46
+ 6,922 observed tests across Node, Bun, and Deno. The matrix includes public
47
+ type compatibility, executable examples, 202 real-Git integration tests on
48
+ each runtime, build stamping, and npm and JSR dry-runs.
49
+
50
+ ## Compatibility
51
+
52
+ This release requires no application or stored-data migration. Existing
53
+ objects, manifests, handles, refs, retention evidence, package exports, and
54
+ custom persistence adapters remain valid. Consumers automatically receive the
55
+ bounded route when their injected Git plumbing supports typed sessions; large
56
+ payloads and fallback implementations keep the prior streaming behavior.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@git-stunts/git-cas",
3
- "version": "6.5.6",
3
+ "version": "6.5.7",
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",
@@ -43,6 +43,7 @@
43
43
  "docs/releases/v6.5.4.md",
44
44
  "docs/releases/v6.5.5.md",
45
45
  "docs/releases/v6.5.6.md",
46
+ "docs/releases/v6.5.7.md",
46
47
  "docs/THREAT_MODEL.md",
47
48
  "docs/VAULT_INTERNALS.md",
48
49
  "docs/WALKTHROUGH.md",
@@ -19,6 +19,7 @@ import GitObjectSessionPool from './GitObjectSessionPool.js';
19
19
  */
20
20
  const DEFAULT_POLICY = Policy.timeout(30_000);
21
21
  export const DEFAULT_MAX_BLOB_SIZE = 10 * 1024 * 1024;
22
+ const MAX_SESSION_STREAM_BLOB_BYTES = DEFAULT_MAX_BLOB_SIZE;
22
23
  const DEFAULT_METADATA_CACHE_ENTRIES = 2_048;
23
24
  const DEFAULT_SESSION_IDLE_TIMEOUT_MS = 1_000;
24
25
  const DEFAULT_TREE_CACHE_BYTES = 8 * 1024 * 1024;
@@ -189,21 +190,7 @@ export default class GitPersistenceAdapter extends GitPersistencePort {
189
190
  ? this.#maxBlobSize
190
191
  : GitPersistenceAdapter.#validatedReadBlobLimit(maxBytes);
191
192
  if (this.#sessions.supports('catFile')) {
192
- let object;
193
- try {
194
- object = await this.#sessions.read(oid, { maxBytes: limit }, (operation) =>
195
- this.policy.execute(operation)
196
- );
197
- } catch (error) {
198
- throw this.#normalizeObjectReadError(error, oid, limit);
199
- }
200
- if (object.type !== 'blob') {
201
- throw createCasError(`Git object is not a blob: ${oid}`, ErrorCodes.GIT_ERROR, {
202
- oid,
203
- actualType: object.type,
204
- });
205
- }
206
- return GitPersistenceAdapter.#toBuffer(object.content);
193
+ return await this.#readBlobFromSession(oid, limit);
207
194
  }
208
195
  const chunks = [];
209
196
  let bytesRead = 0;
@@ -241,7 +228,48 @@ export default class GitPersistenceAdapter extends GitPersistencePort {
241
228
  * @returns {Promise<AsyncIterable<Buffer>>} The blob content stream.
242
229
  */
243
230
  async readBlobStream(oid) {
244
- return await this.#runOperation(() => this.#openBufferStream(['cat-file', 'blob', oid]));
231
+ return await this.#runOperation(async () => {
232
+ if (!this.#sessions.supports('catFile')) {
233
+ return await this.#openBlobStream(oid);
234
+ }
235
+ let info;
236
+ try {
237
+ info = await this.#readObjectInfo(oid);
238
+ } catch {
239
+ return await this.#openBlobStream(oid);
240
+ }
241
+ if (info.type !== 'blob' || info.size > MAX_SESSION_STREAM_BLOB_BYTES) {
242
+ return await this.#openBlobStream(oid);
243
+ }
244
+ try {
245
+ const content = await this.#readBlobFromSession(oid, MAX_SESSION_STREAM_BLOB_BYTES);
246
+ return GitPersistenceAdapter.#singleBufferStream(content);
247
+ } catch {
248
+ return await this.#openBlobStream(oid);
249
+ }
250
+ });
251
+ }
252
+
253
+ async #readBlobFromSession(oid, maxBytes) {
254
+ let object;
255
+ try {
256
+ object = await this.#sessions.read(oid, { maxBytes }, (operation) =>
257
+ this.policy.execute(operation)
258
+ );
259
+ } catch (error) {
260
+ throw this.#normalizeObjectReadError(error, oid, maxBytes);
261
+ }
262
+ if (object.type !== 'blob') {
263
+ throw createCasError(`Git object is not a blob: ${oid}`, ErrorCodes.GIT_ERROR, {
264
+ oid,
265
+ actualType: object.type,
266
+ });
267
+ }
268
+ return GitPersistenceAdapter.#toBuffer(object.content);
269
+ }
270
+
271
+ async #openBlobStream(oid) {
272
+ return await this.#openBufferStream(['cat-file', 'blob', oid]);
245
273
  }
246
274
 
247
275
  /**
@@ -675,6 +703,10 @@ export default class GitPersistenceAdapter extends GitPersistencePort {
675
703
  }
676
704
  }
677
705
 
706
+ static async *#singleBufferStream(content) {
707
+ yield content;
708
+ }
709
+
678
710
  /**
679
711
  * @param {Buffer|Uint8Array|string} chunk
680
712
  * @returns {Buffer}
@@ -1 +1 @@
1
- export const PACKAGE_VERSION = '6.5.6';
1
+ export const PACKAGE_VERSION = '6.5.7';