@git-stunts/git-cas 6.5.10 → 6.5.12
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 +16 -0
- package/README.md +3 -1
- package/UPGRADING.md +8 -0
- package/build-info.json +2 -2
- package/docs/releases/v6.5.11.md +15 -0
- package/docs/releases/v6.5.12.md +13 -0
- package/package.json +11 -8
- package/src/domain/services/RootSetPersistence.js +14 -0
- package/src/infrastructure/adapters/GitMetadataRequestWindows.js +52 -0
- package/src/infrastructure/adapters/GitPersistenceAdapter.js +25 -13
- package/src/package-version.js +1 -1
- package/test/CONVENTIONS.md +2 -4
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [6.5.12] — 2026-10-20
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Object-metadata reads split uncached targets into ordered request windows of at most 1000 objects and 64 KiB of encoded cat-file commands, including SHA-256 object names. Root-set admission validates targets in bounded windows before writing. Root sets with more than 1000 targets (or more than 936 SHA-256 targets) no longer fail with `ROOT_SET_TARGET_UNREADABLE` caused by the Plumbing batch limit. Request order, duplicate results, cached entries, and per-target failures are preserved; a missing or mismatched target in any window still blocks publication.
|
|
15
|
+
|
|
16
|
+
## [6.5.11] — 2026-10-02
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- Require published Plumbing 3.3.2 so stale mktree transports after external Git GC enter the existing single fresh-process retry for single and batch tree writes. Producer and unrelated transport errors retain their identity; retry remains bounded at two attempts.
|
|
21
|
+
|
|
22
|
+
- CI and release Node unit checks and examples run through COPY-based Docker. Tests and benchmarks refuse host execution before loading test modules, including forged Docker and CI environment flags.
|
|
23
|
+
|
|
24
|
+
- Replace the host BATS platform launcher with sequential COPY-based Docker orchestration; a failed runtime stops the platform command.
|
|
25
|
+
|
|
10
26
|
## [6.5.10] — 2026-08-24
|
|
11
27
|
|
|
12
28
|
### Added
|
package/README.md
CHANGED
|
@@ -53,7 +53,9 @@ Unlike traditional LFS which moves files to external servers, `git-cas` treats t
|
|
|
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
55
|
For the release overview, see the
|
|
56
|
-
[v6.5.
|
|
56
|
+
[v6.5.12 Release Notes](./docs/releases/v6.5.12.md).
|
|
57
|
+
|
|
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.
|
|
57
59
|
|
|
58
60
|
### 1. CLI Usage
|
|
59
61
|
|
package/UPGRADING.md
CHANGED
|
@@ -725,3 +725,11 @@ The manifest blob was corrupted or tampered with after storage. The original dat
|
|
|
725
725
|
### Constructor throws "chunker is required"
|
|
726
726
|
|
|
727
727
|
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
|
+
|
|
729
|
+
## v6.5.10 To v6.5.11
|
|
730
|
+
|
|
731
|
+
Update the package normally. The Plumbing minimum becomes 3.3.2 to recover closed mktree transports with the existing one-retry bound. No stored-data or application migration is required; unrelated and producer errors remain unchanged.
|
|
732
|
+
|
|
733
|
+
## v6.5.11 To v6.5.12
|
|
734
|
+
|
|
735
|
+
Update the package normally. Object-metadata reads and root-set admission now run in bounded request windows, so large root sets no longer fail with `ROOT_SET_TARGET_UNREADABLE`. No API, stored-data, or application migration is required; missing and mismatched targets fail exactly as before.
|
package/build-info.json
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# git-cas v6.5.11 Release Notes
|
|
2
|
+
|
|
3
|
+
This patch release adopts published Plumbing 3.3.2 so a stale mktree process closed by external Git repacking enters the existing bounded immutable-object recovery. Single-tree and batched-tree writes reopen a failed process once. Two failed attempts stop with GitProtocolError; unrelated transport errors and producer errors retain their original identity.
|
|
4
|
+
|
|
5
|
+
## Compatibility
|
|
6
|
+
|
|
7
|
+
No API, handle, stored object, descriptor, ref namespace, encryption, or reader format changes. No application or stored-data migration is required. Mutable-ref retry and publication rules remain unchanged.
|
|
8
|
+
|
|
9
|
+
## Test Isolation
|
|
10
|
+
|
|
11
|
+
All tests and benchmarks require a physical Docker marker before test modules load. Environment flags do not authorize host execution. CI/release Node unit gates and maintained examples use COPY-based Docker without repository or Git-directory mounts.
|
|
12
|
+
|
|
13
|
+
## Evidence And Delivery
|
|
14
|
+
|
|
15
|
+
Issue [#131](https://github.com/git-stunts/git-cas/issues/131) and PR [#132](https://github.com/git-stunts/git-cas/pull/132) own delivery. [Preparatory evidence](https://github.com/git-stunts/git-cas/blob/243592ce1b72865ce4f1fd552f504e9488780246/docs/design/0062-mktree-transport-recovery/witness/preparation.md) pins candidate behavior separately from registry delivery. The six recovery checks fail in four cases against Plumbing 3.3.0 and pass against published Plumbing 3.3.2. The reviewed merge passed all 14 release gates; signed tag, trusted npm/GitHub publication and independent public-consumer verification are recorded in the [publication witness](https://github.com/git-stunts/git-cas/pull/132). JSR dry-run passed; JSR publication is not part of the release workflow.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# git-cas v6.5.12 Release Notes
|
|
2
|
+
|
|
3
|
+
This patch release bounds object-metadata requests. `readObjectInfos` splits uncached targets into ordered windows of at most 1000 objects and 64 KiB of encoded cat-file commands, including SHA-256 object names, for both the persistent cat-file session and the command fallback. Root-set admission validates targets in bounded windows before any root-set object is written.
|
|
4
|
+
|
|
5
|
+
Root sets with more than 1000 targets (936 for SHA-256) previously failed admission with `ROOT_SET_TARGET_UNREADABLE`, caused by Plumbing's cat-file batch limit. Downstream, git-warp checkpoints failed with "Workspace staged an object but could not establish retention" near 1600 live nodes ([git-warp#958](https://github.com/git-stunts/git-warp/issues/958)).
|
|
6
|
+
|
|
7
|
+
## Compatibility
|
|
8
|
+
|
|
9
|
+
No API, handle, stored object, descriptor, ref namespace, encryption, or reader format changes. Plumbing's request limits are unchanged and target validation is not bypassed. Request order, duplicate results, cache hits, and per-target failures are preserved; a missing or mismatched target in any window still blocks publication.
|
|
10
|
+
|
|
11
|
+
## Evidence And Delivery
|
|
12
|
+
|
|
13
|
+
Issue [#147](https://github.com/git-stunts/git-cas/issues/147) and PR [#148](https://github.com/git-stunts/git-cas/pull/148) own delivery. The window witnesses fail 18 cases against v6.5.11, including real SHA-256 repositories at 999 targets, and pass on the candidate across Node, Bun, and Deno. Full release verification, merge, tag, npm publication and registry consumer evidence remain required; this candidate document claims no published 6.5.12 artifact.
|
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.12",
|
|
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",
|
|
@@ -55,7 +55,9 @@
|
|
|
55
55
|
"test/CONVENTIONS.md",
|
|
56
56
|
"test/cycles/README.md",
|
|
57
57
|
"LICENSE",
|
|
58
|
-
"CHANGELOG.md"
|
|
58
|
+
"CHANGELOG.md",
|
|
59
|
+
"docs/releases/v6.5.11.md",
|
|
60
|
+
"docs/releases/v6.5.12.md"
|
|
59
61
|
],
|
|
60
62
|
"engines": {
|
|
61
63
|
"node": ">=22.0.0"
|
|
@@ -86,17 +88,17 @@
|
|
|
86
88
|
"provenance": true
|
|
87
89
|
},
|
|
88
90
|
"scripts": {
|
|
89
|
-
"test": "
|
|
91
|
+
"test": "docker compose run --build --rm test-node",
|
|
90
92
|
"test:local": "vitest run test/unit",
|
|
91
93
|
"test:node": "docker compose run --build --rm test-node",
|
|
92
94
|
"test:bun": "docker compose run --build --rm test-bun",
|
|
93
95
|
"test:deno": "docker compose run --build --rm test-deno",
|
|
94
|
-
"test:integration": "vitest run test/integration --no-file-parallelism",
|
|
96
|
+
"test:integration": "docker compose run --build --rm test-node pnpm vitest run test/integration --no-file-parallelism",
|
|
95
97
|
"test:integration:node": "docker compose run --build --rm test-node npx vitest run test/integration --no-file-parallelism",
|
|
96
98
|
"test:integration:bun": "docker compose run --build --rm test-bun bunx vitest run test/integration --no-file-parallelism",
|
|
97
99
|
"test:integration:deno": "docker compose run --build --rm test-deno deno run -A npm:vitest run test/integration --no-file-parallelism",
|
|
98
|
-
"test:platforms": "
|
|
99
|
-
"benchmark": "vitest bench test/benchmark",
|
|
100
|
+
"test:platforms": "docker compose run --build --rm test-node && docker compose run --build --rm test-bun && docker compose run --build --rm test-deno",
|
|
101
|
+
"benchmark": "docker compose run --build --rm test-node pnpm vitest bench test/benchmark",
|
|
100
102
|
"benchmark:local": "vitest bench test/benchmark",
|
|
101
103
|
"release:verify": "node scripts/release/verify.js",
|
|
102
104
|
"stamp": "node scripts/stamp-build.js",
|
|
@@ -112,7 +114,7 @@
|
|
|
112
114
|
"@flyingrobots/bijou-tui": "^7.2.0",
|
|
113
115
|
"@flyingrobots/bijou-tui-app": "^7.2.0",
|
|
114
116
|
"@git-stunts/alfred": "^0.10.0",
|
|
115
|
-
"@git-stunts/plumbing": "^3.3.
|
|
117
|
+
"@git-stunts/plumbing": "^3.3.2",
|
|
116
118
|
"@git-stunts/vault": "^1.0.1",
|
|
117
119
|
"cbor-x": "^1.6.0",
|
|
118
120
|
"commander": "14.0.3",
|
|
@@ -131,6 +133,7 @@
|
|
|
131
133
|
"fast-check": "^4.6.0",
|
|
132
134
|
"jsr": "^0.14.2",
|
|
133
135
|
"prettier": "^3.4.2",
|
|
134
|
-
"vitest": "^2.1.8"
|
|
136
|
+
"vitest": "^2.1.8",
|
|
137
|
+
"@git-stunts/docker-guard": "^0.1.0"
|
|
135
138
|
}
|
|
136
139
|
}
|
|
@@ -13,6 +13,8 @@ const UPDATE_REF_CONFLICT_MARKERS = Object.freeze({
|
|
|
13
13
|
});
|
|
14
14
|
const GIT_REPOSITORY_LOCKED = 'GIT_REPOSITORY_LOCKED';
|
|
15
15
|
const GIT_FATAL_EXIT_CODE = 128;
|
|
16
|
+
/** Targets validated per metadata request; bounds buffered admission evidence. */
|
|
17
|
+
const TARGET_ADMISSION_WINDOW = 1000;
|
|
16
18
|
|
|
17
19
|
function hasExactUpdateRefArgs(err, {
|
|
18
20
|
rootSetRef,
|
|
@@ -395,7 +397,19 @@ export default class RootSetPersistence {
|
|
|
395
397
|
}
|
|
396
398
|
}
|
|
397
399
|
|
|
400
|
+
/**
|
|
401
|
+
* Validates targets in bounded admission windows, in entry order, before
|
|
402
|
+
* any root-set object is written. Only one window of metadata is buffered
|
|
403
|
+
* at a time; a window that reports a missing object is re-inspected per
|
|
404
|
+
* target so the first failing entry is named exactly.
|
|
405
|
+
*/
|
|
398
406
|
async #assertTargets(entries) {
|
|
407
|
+
for (let start = 0; start < entries.length; start += TARGET_ADMISSION_WINDOW) {
|
|
408
|
+
await this.#assertTargetWindow(entries.slice(start, start + TARGET_ADMISSION_WINDOW));
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
async #assertTargetWindow(entries) {
|
|
399
413
|
if (typeof this.persistence.readObjectInfos === 'function') {
|
|
400
414
|
try {
|
|
401
415
|
const infos = await this.persistence.readObjectInfos(entries.map((entry) => entry.oid));
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Splits object-metadata requests into windows that every Git metadata
|
|
3
|
+
* transport accepts.
|
|
4
|
+
*
|
|
5
|
+
* Plumbing's persistent cat-file session refuses a request with more than
|
|
6
|
+
* 1000 objects or more than 64 KiB of encoded `info <oid>\n` commands. The
|
|
7
|
+
* command fallback writes shorter `<oid>\n` lines, so the session bound also
|
|
8
|
+
* bounds its stdin. Windows preserve the caller's order exactly.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export const MAX_METADATA_WINDOW_OBJECTS = 1000;
|
|
12
|
+
export const MAX_METADATA_WINDOW_COMMAND_BYTES = 64 * 1024;
|
|
13
|
+
|
|
14
|
+
const COMMAND_PREFIX = 'info ';
|
|
15
|
+
const COMMAND_TERMINATOR = '\n';
|
|
16
|
+
const ENCODER = new globalThis.TextEncoder();
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @param {string} objectName
|
|
20
|
+
* @returns {number} Encoded bytes of one cat-file info command.
|
|
21
|
+
*/
|
|
22
|
+
function commandBytes(objectName) {
|
|
23
|
+
return ENCODER.encode(`${COMMAND_PREFIX}${objectName}${COMMAND_TERMINATOR}`).length;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @param {ReadonlyArray<string>} objectNames - Object names in request order.
|
|
28
|
+
* @returns {Array<Array<string>>} Ordered, non-empty request windows.
|
|
29
|
+
*/
|
|
30
|
+
export function metadataRequestWindows(objectNames) {
|
|
31
|
+
const windows = [];
|
|
32
|
+
let current = [];
|
|
33
|
+
let currentBytes = 0;
|
|
34
|
+
for (const objectName of objectNames) {
|
|
35
|
+
const bytes = commandBytes(objectName);
|
|
36
|
+
if (
|
|
37
|
+
current.length > 0 &&
|
|
38
|
+
(current.length >= MAX_METADATA_WINDOW_OBJECTS ||
|
|
39
|
+
currentBytes + bytes > MAX_METADATA_WINDOW_COMMAND_BYTES)
|
|
40
|
+
) {
|
|
41
|
+
windows.push(current);
|
|
42
|
+
current = [];
|
|
43
|
+
currentBytes = 0;
|
|
44
|
+
}
|
|
45
|
+
current.push(objectName);
|
|
46
|
+
currentBytes += bytes;
|
|
47
|
+
}
|
|
48
|
+
if (current.length > 0) {
|
|
49
|
+
windows.push(current);
|
|
50
|
+
}
|
|
51
|
+
return windows;
|
|
52
|
+
}
|
|
@@ -8,6 +8,7 @@ import { CasError, createCasError, ErrorCodes } from '../../domain/errors/index.
|
|
|
8
8
|
import BoundedPromiseCache from '../../helpers/boundedPromiseCache.js';
|
|
9
9
|
import GitTreeObjectCodec from '../codecs/GitTreeObjectCodec.js';
|
|
10
10
|
import GitObjectSessionPool from './GitObjectSessionPool.js';
|
|
11
|
+
import { metadataRequestWindows } from './GitMetadataRequestWindows.js';
|
|
11
12
|
import GitPersistenceWriteScope from './GitPersistenceWriteScope.js';
|
|
12
13
|
|
|
13
14
|
/**
|
|
@@ -31,6 +32,7 @@ const MIN_METADATA_CACHE_ENTRIES = 1;
|
|
|
31
32
|
const MAX_BLOB_SIZE_LIMIT = Number.MAX_SAFE_INTEGER;
|
|
32
33
|
const OBJECT_INFO_ARGUMENT = '--batch-check=%(objectname) %(objecttype) %(objectsize)';
|
|
33
34
|
const GIT_OBJECT_TYPES = new Set(['blob', 'tree', 'commit', 'tag']);
|
|
35
|
+
const SETTLED = () => undefined;
|
|
34
36
|
|
|
35
37
|
/**
|
|
36
38
|
* {@link GitPersistencePort} implementation backed by `@git-stunts/plumbing`.
|
|
@@ -467,28 +469,38 @@ export default class GitPersistenceAdapter extends GitPersistencePort {
|
|
|
467
469
|
missing.push(oid);
|
|
468
470
|
}
|
|
469
471
|
}
|
|
470
|
-
const byOid = this.#cacheObjectInfoBatch(missing);
|
|
472
|
+
const { byOid, settled } = this.#cacheObjectInfoBatch(missing);
|
|
471
473
|
for (let index = 0; index < objectNames.length; index += 1) {
|
|
472
474
|
pending[index] ??= byOid.get(objectNames[index]);
|
|
473
475
|
}
|
|
474
|
-
|
|
476
|
+
const results = Promise.all(pending);
|
|
477
|
+
results.catch(SETTLED);
|
|
478
|
+
await settled;
|
|
479
|
+
return await results;
|
|
475
480
|
});
|
|
476
481
|
}
|
|
477
482
|
|
|
483
|
+
/**
|
|
484
|
+
* Caches uncached metadata as bounded request windows. Windows run one at a
|
|
485
|
+
* time so a large target set never holds more than one backend request; a
|
|
486
|
+
* failed window rejects only its own targets. `settled` resolves once every
|
|
487
|
+
* window has finished, so no request outlives the owning operation.
|
|
488
|
+
*/
|
|
478
489
|
#cacheObjectInfoBatch(objectNames) {
|
|
479
490
|
const byOid = new Map();
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
491
|
+
let previous = Promise.resolve();
|
|
492
|
+
for (const window of metadataRequestWindows(objectNames)) {
|
|
493
|
+
const batch = previous.then(() => this.#readObjectInfosUncached(window));
|
|
494
|
+
previous = batch.then(SETTLED, SETTLED);
|
|
495
|
+
for (let index = 0; index < window.length; index += 1) {
|
|
496
|
+
const oid = window[index];
|
|
497
|
+
byOid.set(
|
|
498
|
+
oid,
|
|
499
|
+
this.#metadataCache.getOrCreate(`object\0${oid}`, async () => (await batch)[index])
|
|
500
|
+
);
|
|
501
|
+
}
|
|
490
502
|
}
|
|
491
|
-
return byOid;
|
|
503
|
+
return { byOid, settled: previous };
|
|
492
504
|
}
|
|
493
505
|
|
|
494
506
|
async #readObjectInfosUncached(objectNames) {
|
package/src/package-version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const PACKAGE_VERSION = '6.5.
|
|
1
|
+
export const PACKAGE_VERSION = '6.5.12';
|
package/test/CONVENTIONS.md
CHANGED
|
@@ -66,11 +66,9 @@ sorted output semantics instead of assuming first-seen insertion order.
|
|
|
66
66
|
If insertion order matters, assert it at the lower-level boundary that builds
|
|
67
67
|
the tree entries before they are handed to Git.
|
|
68
68
|
|
|
69
|
-
##
|
|
69
|
+
## Test Runtime Policy
|
|
70
70
|
|
|
71
|
-
**
|
|
72
|
-
refuse to run on the host and require `GIT_STUNTS_DOCKER=1` so Git, Bun, and
|
|
73
|
-
Deno run in a consistent environment.
|
|
71
|
+
**All tests and benchmarks are Docker-only.** Vitest setup uses `@git-stunts/docker-guard` with a physical Docker marker before test modules load. Environment flags do not authorize host execution. Use COPY-based Docker Compose services without repository or Git-directory mounts. `npm test` routes to the Node service; `test:local` is an in-container command.
|
|
74
72
|
|
|
75
73
|
**Integration files run with `fileParallelism: false`.** These tests spawn real
|
|
76
74
|
Git and CLI subprocesses, so the integration workspace is intentionally kept to
|