@git-stunts/git-cas 6.3.0 → 6.4.0
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 +26 -0
- package/README.md +11 -4
- package/UPGRADING.md +42 -0
- package/build-info.json +2 -2
- package/docs/API.md +163 -17
- package/docs/releases/v6.4.0.md +128 -0
- package/index.d.ts +191 -0
- package/index.js +28 -0
- package/package.json +2 -1
- package/src/domain/errors/Codes.js +10 -0
- package/src/domain/services/RepositoryDoctor.js +97 -2
- package/src/domain/services/RootSetPersistence.js +34 -2
- package/src/domain/services/StagingWorkspace.js +530 -0
- package/src/domain/services/StagingWorkspaceRegistry.js +545 -0
- package/src/domain/services/WorkspaceDescriptorCodec.js +144 -0
- package/src/domain/value-objects/WorkspaceRef.js +151 -0
- package/src/infrastructure/adapters/GitRefAdapter.js +56 -14
- package/src/package-version.js +1 -1
- package/src/ports/GitRefPort.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,32 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [6.4.0] — 2026-07-17
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **Scoped staging workspaces** — `cas.workspaces.open()` now provides a
|
|
15
|
+
renewable, RootSet-backed lifetime for intermediate asset, page, and bundle
|
|
16
|
+
writes. Staging returns only after its typed handle is reachable from the
|
|
17
|
+
exact workspace generation; checkpoint compaction, witness-checked
|
|
18
|
+
destination-first cache or publication promotion, idempotent checked
|
|
19
|
+
release, and serialized mutations preserve explicit ownership under
|
|
20
|
+
concurrency. Expiry is
|
|
21
|
+
observable posture rather than automatic revocation. Namespace-bounded
|
|
22
|
+
inspection and checked sweep expose root count, age, expiry, logical content
|
|
23
|
+
bytes, unique direct-root object bytes, invalid state, conflicts, and
|
|
24
|
+
truncation. Repository doctor includes the same workspace inventory without
|
|
25
|
+
claiming deduplicated or packed physical-byte attribution. Workspace
|
|
26
|
+
witnesses reuse the existing `root-set` kind, and workspace-detail truncation
|
|
27
|
+
uses a dedicated code without widening closed public discriminant unions.
|
|
28
|
+
|
|
29
|
+
### Fixed
|
|
30
|
+
|
|
31
|
+
- **RootSet structured lock retries** — exact managed `update-ref --no-deref`
|
|
32
|
+
lock races surfaced as `GIT_REPOSITORY_LOCKED` now normalize to
|
|
33
|
+
`ROOT_SET_CONFLICT`, allowing the existing bounded retry policy to run.
|
|
34
|
+
Structured lock failures for other refs remain terminal.
|
|
35
|
+
|
|
10
36
|
## [6.3.0] — 2026-07-17
|
|
11
37
|
|
|
12
38
|
### Added
|
package/README.md
CHANGED
|
@@ -44,7 +44,7 @@ Unlike traditional LFS which moves files to external servers, `git-cas` treats t
|
|
|
44
44
|
Existing v5 users should read [UPGRADING.md](./UPGRADING.md) and run
|
|
45
45
|
`npm run upgrade` in dry-run mode before restoring old encrypted vault entries.
|
|
46
46
|
For the release overview, see the
|
|
47
|
-
[v6.
|
|
47
|
+
[v6.4.0 Release Notes](./docs/releases/v6.4.0.md).
|
|
48
48
|
|
|
49
49
|
### 1. CLI Usage
|
|
50
50
|
|
|
@@ -102,6 +102,7 @@ The README is the front door. Detailed mechanics live in the guide set:
|
|
|
102
102
|
| CDC internals, Merkle manifests, KDF policy, and tuning | [Advanced Guide](./ADVANCED_GUIDE.md) |
|
|
103
103
|
| Ports, adapters, and collaborator boundaries | [Architecture](./ARCHITECTURE.md) |
|
|
104
104
|
| Assets, pages, bundles, retention, and publication | [Application storage](./docs/API.md#application-storage) |
|
|
105
|
+
| Temporary retention during multi-step composition | [Scoped staging workspaces](./docs/API.md#scoped-staging-workspaces) |
|
|
105
106
|
| GC retention for caches and derived state | [Root Sets](./docs/API.md#root-sets) |
|
|
106
107
|
| Managed TTL and capacity caches | [Cache Sets](./docs/API.md#cache-sets) |
|
|
107
108
|
| Scoped protection while consuming a cache hit | [Cache acquisitions](./docs/API.md#acquire-and-release) |
|
|
@@ -139,13 +140,17 @@ Core capabilities:
|
|
|
139
140
|
`publications` compose streaming CAS writes, bounded structured
|
|
140
141
|
materializations, targeted member reads, reachability roots,
|
|
141
142
|
compare-and-swap refs, and immutable lifecycle evidence.
|
|
143
|
+
- **Scoped staging workspaces**: `workspaces.open()` mirrors application writes
|
|
144
|
+
behind one renewable temporary RootSet, returns only after each handle is
|
|
145
|
+
anchored, promotes destination-first, and exposes bounded age, expiry,
|
|
146
|
+
logical-content, and direct-root diagnostics with opaque cleanup pagination.
|
|
142
147
|
- **Envelope recipients**: multi-recipient key wrapping and recipient rotation
|
|
143
148
|
avoid re-encrypting data blobs.
|
|
144
149
|
- **Operational diagnostics**: `cas.diagnostics.doctor()` streams repository
|
|
145
150
|
object/ref evidence, classifies anchored, orphaned, and volatile objects,
|
|
146
|
-
and summarizes cache acquisitions, CacheSet, RootSet,
|
|
147
|
-
usage without mutating Git. The `git-cas doctor` CLI
|
|
148
|
-
vault health.
|
|
151
|
+
and summarizes workspaces, cache acquisitions, CacheSet, RootSet,
|
|
152
|
+
ExpiringSet, and Vault usage without mutating Git. The `git-cas doctor` CLI
|
|
153
|
+
continues to validate vault health.
|
|
149
154
|
|
|
150
155
|
## Safety Snapshot
|
|
151
156
|
|
|
@@ -195,6 +200,8 @@ All three runtimes are tested in CI on every push. The hexagonal architecture is
|
|
|
195
200
|
repository diagnostics.
|
|
196
201
|
- **[v6.3.0 Release Notes](./docs/releases/v6.3.0.md)**: Lifetime-safe,
|
|
197
202
|
reference-only cache acquisitions with explicit release and doctor evidence.
|
|
203
|
+
- **[v6.4.0 Release Notes](./docs/releases/v6.4.0.md)**: Scoped staging
|
|
204
|
+
workspaces for temporary multi-object reachability, promotion, and cleanup.
|
|
198
205
|
- **[Upgrading](./UPGRADING.md)**: Migration guide for v5 → v6.
|
|
199
206
|
- **[Changelog](./CHANGELOG.md)**: Version history and migration notes.
|
|
200
207
|
|
package/UPGRADING.md
CHANGED
|
@@ -2,6 +2,48 @@
|
|
|
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.3.0 To v6.4.0
|
|
6
|
+
|
|
7
|
+
v6.4.0 is API-additive and does not require stored-data migration. It adds
|
|
8
|
+
scoped staging workspaces for applications that construct one durable result
|
|
9
|
+
from many intermediate assets, pages, or bundles.
|
|
10
|
+
|
|
11
|
+
Do not use a CacheSet as temporary construction storage. Open one workspace,
|
|
12
|
+
stage the intermediate values through it, compact the retained roots after an
|
|
13
|
+
aggregate becomes transitively complete, and promote only the terminal handle:
|
|
14
|
+
|
|
15
|
+
```javascript
|
|
16
|
+
const workspace = await cas.workspaces.open({
|
|
17
|
+
namespace: 'my-application/materializations',
|
|
18
|
+
ttlMs: 2 * 60 * 60 * 1000,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
try {
|
|
22
|
+
const page = await workspace.pages.put({ source: encodedPage });
|
|
23
|
+
const bundle = await workspace.bundles.putOrdered({
|
|
24
|
+
members: [['pages/result.cbor', page.handle]],
|
|
25
|
+
});
|
|
26
|
+
await workspace.checkpoint({ handles: [bundle.handle] });
|
|
27
|
+
await workspace.promoteToCache({ cache, key, handle: bundle.handle });
|
|
28
|
+
} finally {
|
|
29
|
+
await workspace.release();
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Every returned staged value is anchored by an exact workspace generation.
|
|
34
|
+
Promotion requires matching destination retention evidence before source
|
|
35
|
+
release. Expiry is diagnostic posture, not automatic deletion; abandoned
|
|
36
|
+
workspaces remain reachable until a caller traverses bounded `inspect()` or
|
|
37
|
+
`sweep()` pages using `nextCursor`.
|
|
38
|
+
|
|
39
|
+
The interval between writing an object and publishing the workspace ref still
|
|
40
|
+
depends on Git's ordinary unreachable-object grace period. Concurrent
|
|
41
|
+
immediate-expiry pruning inside that interval is unsupported.
|
|
42
|
+
|
|
43
|
+
See [v6.4.0 Release Notes](./docs/releases/v6.4.0.md) and
|
|
44
|
+
[Scoped Staging Workspaces](./docs/API.md#scoped-staging-workspaces) for the
|
|
45
|
+
complete retention, promotion, and recovery contract.
|
|
46
|
+
|
|
5
47
|
## v6.2.0 To v6.3.0
|
|
6
48
|
|
|
7
49
|
v6.3.0 is API-additive and does not require stored-data migration. It adds
|
package/build-info.json
CHANGED
package/docs/API.md
CHANGED
|
@@ -16,17 +16,18 @@ should treat restored data, chunker output, codec output, and keys as
|
|
|
16
16
|
|
|
17
17
|
1. [ContentAddressableStore](#contentaddressablestore)
|
|
18
18
|
2. [Application Storage](#application-storage)
|
|
19
|
-
3. [
|
|
20
|
-
4. [
|
|
21
|
-
5. [
|
|
22
|
-
6. [
|
|
23
|
-
7. [
|
|
24
|
-
8. [
|
|
25
|
-
9. [
|
|
26
|
-
10. [
|
|
27
|
-
11. [
|
|
28
|
-
12. [
|
|
29
|
-
13. [
|
|
19
|
+
3. [Scoped Staging Workspaces](#scoped-staging-workspaces)
|
|
20
|
+
4. [Root Sets](#root-sets)
|
|
21
|
+
5. [Cache Sets](#cache-sets)
|
|
22
|
+
6. [Expiring Sets](#expiring-sets)
|
|
23
|
+
7. [Repository Diagnostics](#repository-diagnostics)
|
|
24
|
+
8. [Vault](#vault)
|
|
25
|
+
9. [CasService](#casservice)
|
|
26
|
+
10. [Events](#events)
|
|
27
|
+
11. [Value Objects](#value-objects)
|
|
28
|
+
12. [Ports](#ports)
|
|
29
|
+
13. [Codecs](#codecs)
|
|
30
|
+
14. [Error Codes](#error-codes)
|
|
30
31
|
|
|
31
32
|
## ContentAddressableStore
|
|
32
33
|
|
|
@@ -1239,6 +1240,137 @@ generation later.
|
|
|
1239
1240
|
`toJSON()` serializes `handle` to its canonical token and copies the root
|
|
1240
1241
|
evidence fields.
|
|
1241
1242
|
|
|
1243
|
+
## Scoped Staging Workspaces
|
|
1244
|
+
|
|
1245
|
+
Scoped staging workspaces retain intermediate application handles while a
|
|
1246
|
+
caller builds a larger asset or bundle. They are the high-level temporary
|
|
1247
|
+
reachability API. Use them instead of managing Git refs, raw CAS objects, or a
|
|
1248
|
+
general CacheSet as a build scratchpad.
|
|
1249
|
+
|
|
1250
|
+
```javascript
|
|
1251
|
+
const workspace = await cas.workspaces.open({
|
|
1252
|
+
namespace: 'git-warp/materializations',
|
|
1253
|
+
ttlMs: 2 * 60 * 60 * 1000,
|
|
1254
|
+
});
|
|
1255
|
+
|
|
1256
|
+
try {
|
|
1257
|
+
const first = await workspace.pages.put({ source: firstShard });
|
|
1258
|
+
const second = await workspace.pages.put({ source: secondShard });
|
|
1259
|
+
const bundle = await workspace.bundles.putOrdered({
|
|
1260
|
+
members: [
|
|
1261
|
+
['shards/first.cbor', first.handle],
|
|
1262
|
+
['shards/second.cbor', second.handle],
|
|
1263
|
+
],
|
|
1264
|
+
});
|
|
1265
|
+
|
|
1266
|
+
await workspace.checkpoint({ handles: [bundle.handle] });
|
|
1267
|
+
return await workspace.promoteToCache({
|
|
1268
|
+
cache,
|
|
1269
|
+
key: materializationKey,
|
|
1270
|
+
handle: bundle.handle,
|
|
1271
|
+
options: { retention: 'evictable' },
|
|
1272
|
+
});
|
|
1273
|
+
} finally {
|
|
1274
|
+
await workspace.release();
|
|
1275
|
+
}
|
|
1276
|
+
```
|
|
1277
|
+
|
|
1278
|
+
`cas.workspaces.open({ namespace, ttlMs })` creates an in-memory workspace. It
|
|
1279
|
+
does not create a Git ref until the first successful stage or checkpoint. The
|
|
1280
|
+
default TTL is two hours; the maximum is seven days. `ttlMs` must be a positive
|
|
1281
|
+
safe integer.
|
|
1282
|
+
|
|
1283
|
+
The workspace mirrors only application-storage writes:
|
|
1284
|
+
|
|
1285
|
+
```javascript
|
|
1286
|
+
await workspace.assets.put(options);
|
|
1287
|
+
await workspace.assets.adopt(options);
|
|
1288
|
+
await workspace.pages.put(options);
|
|
1289
|
+
await workspace.bundles.put(options);
|
|
1290
|
+
await workspace.bundles.putOrdered(options);
|
|
1291
|
+
```
|
|
1292
|
+
|
|
1293
|
+
Each method returns only after a direct workspace generation reaches the
|
|
1294
|
+
returned typed handle. The result is otherwise the ordinary staged result plus
|
|
1295
|
+
a workspace `RetentionWitness`. Calls on one workspace serialize their ref
|
|
1296
|
+
mutations so concurrent staging cannot silently lose an accumulated root.
|
|
1297
|
+
|
|
1298
|
+
This guarantee starts when the method returns. Like all Git object composition,
|
|
1299
|
+
the object-write-to-ref-update interval still relies on Git's ordinary
|
|
1300
|
+
unreachable-object grace period. Running immediate-expiry prune concurrently
|
|
1301
|
+
inside that interval is unsupported.
|
|
1302
|
+
|
|
1303
|
+
### Checkpoint, renew, promote, and release
|
|
1304
|
+
|
|
1305
|
+
`checkpoint({ handles })` replaces the active roots with the unique supplied
|
|
1306
|
+
handles. Use it after an aggregate bundle transitively reaches its components.
|
|
1307
|
+
An empty checkpoint removes active targets and installs a descriptor-only lease
|
|
1308
|
+
generation, leaving the workspace available for later staging.
|
|
1309
|
+
|
|
1310
|
+
`renew()` preserves the current target set and advances its lease descriptor.
|
|
1311
|
+
Successful staging, checkpoint, and promotion preparation also renew the
|
|
1312
|
+
workspace.
|
|
1313
|
+
|
|
1314
|
+
`promoteToCache({ cache, key, handle, options })` and
|
|
1315
|
+
`promoteToPublication({ handle, commit, ref })` establish destination
|
|
1316
|
+
retention before releasing the workspace. The promoted handle must belong to
|
|
1317
|
+
the active generation. The destination must return an anchored witness for the
|
|
1318
|
+
exact handle, ref, and generation. Rejection, missing evidence, or destination
|
|
1319
|
+
failure leaves the workspace intact and reports
|
|
1320
|
+
`WORKSPACE_PROMOTION_NOT_RETAINED` where applicable. If destination retention
|
|
1321
|
+
succeeds but workspace cleanup conflicts, the operation fails with
|
|
1322
|
+
`WORKSPACE_PROMOTION_CLEANUP_PENDING`; its metadata distinguishes retained
|
|
1323
|
+
destination state from pending temporary cleanup.
|
|
1324
|
+
|
|
1325
|
+
`release()` is idempotent for one workspace object and deletes only its exact
|
|
1326
|
+
observed direct-ref generation. A conflicting generation or symbolic ref fails
|
|
1327
|
+
closed. Calling any staging, checkpoint, renewal, or promotion method after a
|
|
1328
|
+
successful release fails with `WORKSPACE_RELEASED`.
|
|
1329
|
+
|
|
1330
|
+
### Inspect and sweep
|
|
1331
|
+
|
|
1332
|
+
Workspace expiry is operational posture, not automatic revocation. An expired
|
|
1333
|
+
workspace remains Git-reachable until an explicit checked sweep removes it.
|
|
1334
|
+
|
|
1335
|
+
```javascript
|
|
1336
|
+
const inspection = await cas.workspaces.inspect({
|
|
1337
|
+
namespace: 'git-warp/materializations',
|
|
1338
|
+
limit: 100,
|
|
1339
|
+
});
|
|
1340
|
+
|
|
1341
|
+
let cursor = null;
|
|
1342
|
+
do {
|
|
1343
|
+
const cleanup = await cas.workspaces.sweep({
|
|
1344
|
+
namespace: 'git-warp/materializations',
|
|
1345
|
+
limit: 100,
|
|
1346
|
+
cursor,
|
|
1347
|
+
});
|
|
1348
|
+
cursor = cleanup.nextCursor;
|
|
1349
|
+
} while (cursor !== null);
|
|
1350
|
+
```
|
|
1351
|
+
|
|
1352
|
+
Inspection is namespace-scoped and bounded. Each record reports identity,
|
|
1353
|
+
generation, direct-root count, creation time, age, expiry, posture, and two
|
|
1354
|
+
different byte measures:
|
|
1355
|
+
|
|
1356
|
+
- `logicalBytes` sums the validated semantic content size reported by each
|
|
1357
|
+
retained typed handle. Overlapping handles can describe overlapping content.
|
|
1358
|
+
- `rootObjectBytes` sums each unique direct Git root object's loose logical
|
|
1359
|
+
size. It excludes transitive support, deduplication attribution, pack
|
|
1360
|
+
compression, and filesystem overhead.
|
|
1361
|
+
|
|
1362
|
+
Inspection validates the canonical target name, typed handle, OID, Git object
|
|
1363
|
+
type, and complete application handle graph. Invalid persisted state produces
|
|
1364
|
+
`posture: 'invalid'` with structured issue evidence instead of a guessed byte
|
|
1365
|
+
count.
|
|
1366
|
+
|
|
1367
|
+
`sweep()` deletes only records observed as expired, direct, and still at the
|
|
1368
|
+
same generation. Inspection and sweep return an opaque `nextCursor` whenever
|
|
1369
|
+
`truncated` is true; pass that cursor to the next call so active or invalid
|
|
1370
|
+
records cannot starve later expired workspaces. The sweep result reports
|
|
1371
|
+
inspected, changed, conflicted, missing, and truncated counts. Sweep never
|
|
1372
|
+
removes active or invalid records.
|
|
1373
|
+
|
|
1242
1374
|
## Root Sets
|
|
1243
1375
|
|
|
1244
1376
|
Root sets retain a mutable current set of Git blobs or trees. They are intended
|
|
@@ -1786,14 +1918,15 @@ const report = await cas.diagnostics.doctor({
|
|
|
1786
1918
|
console.log(report.repository.objects);
|
|
1787
1919
|
console.log(report.usage.acquisitions);
|
|
1788
1920
|
console.log(report.usage.caches);
|
|
1921
|
+
console.log(report.usage.workspaces);
|
|
1789
1922
|
console.log(report.limitations);
|
|
1790
1923
|
```
|
|
1791
1924
|
|
|
1792
1925
|
Pass either `gracePeriodMs` or an exact canonical `expiresBefore` UTC timestamp,
|
|
1793
1926
|
not both. The default grace period is 14 days. `maxCollectionsPerKind` bounds
|
|
1794
|
-
detailed cache-acquisition, CacheSet, RootSet, and
|
|
1795
|
-
through 1000; its default is 100. Every managed collection or
|
|
1796
|
-
still inspected sequentially and included in `totals`. Coverage reports
|
|
1927
|
+
detailed cache-acquisition, CacheSet, RootSet, ExpiringSet, and workspace rows
|
|
1928
|
+
from 1 through 1000; its default is 100. Every managed collection or
|
|
1929
|
+
acquisition is still inspected sequentially and included in `totals`. Coverage reports
|
|
1797
1930
|
`observed`, `inspected`, `detailed`, and `complete`, so detail truncation is
|
|
1798
1931
|
visible instead of silently dropping managed refs or undercounting repository
|
|
1799
1932
|
usage.
|
|
@@ -1831,9 +1964,12 @@ retention ref remains healthy, `ageMs` is `null`, and the entry reports
|
|
|
1831
1964
|
`maxAgeMs` is `null` when any active acquisition age is incomparable. Cache
|
|
1832
1965
|
summaries report entry count, deterministic logical bytes, age,
|
|
1833
1966
|
expiry, capacity policy, and pinned/evictable counts. RootSet policy counts and
|
|
1834
|
-
Vault entry counts are reported independently from reachability.
|
|
1835
|
-
|
|
1836
|
-
|
|
1967
|
+
Vault entry counts are reported independently from reachability. Workspace
|
|
1968
|
+
summaries report active and expired counts, validated logical bytes, and unique
|
|
1969
|
+
direct-root object bytes; detailed rows carry creation age, exact expiry, and
|
|
1970
|
+
invalid-state evidence. Neither workspace byte field is physical residency. A
|
|
1971
|
+
privacy-mode vault remains healthy but reports `entryCount: null` because
|
|
1972
|
+
repository doctor does not request or retain vault key material.
|
|
1837
1973
|
|
|
1838
1974
|
Git's `for-each-ref` does not enumerate dangling symbolic refs. Repository
|
|
1839
1975
|
doctor therefore reports symbolic acquisition refs that Git returns, but does
|
|
@@ -3195,6 +3331,16 @@ new CasError({ message, code, meta, documentationUrl });
|
|
|
3195
3331
|
| `ROOT_SET_METADATA_INVALID` | `.rootset.json` is malformed, non-canonical, or belongs to another ref | `read()`, `list()`, `doctor()` |
|
|
3196
3332
|
| `ROOT_SET_TREE_INVALID` | Metadata and the Git tree's actual reachability edges disagree | `read()`, `list()`, `doctor()` |
|
|
3197
3333
|
| `ROOT_SET_REF_UPDATE_FAILED` | Root-set ref update failed for a non-conflict reason | Root-set mutations and repair |
|
|
3334
|
+
| `WORKSPACE_REF_INVALID` | Workspace ref namespace, identity, epoch, or canonical encoding is invalid | Workspace creation, inspection, and cleanup |
|
|
3335
|
+
| `WORKSPACE_DESCRIPTOR_INVALID` | Workspace lease descriptor is malformed, non-canonical, inconsistent, or outside bounds | Workspace renewal, inspection, and cleanup |
|
|
3336
|
+
| `WORKSPACE_STATE_INVALID` | Retained target names, handles, OIDs, types, counts, or byte evidence disagree | Workspace staging, checkpoint, inspection, and doctor |
|
|
3337
|
+
| `WORKSPACE_TTL_INVALID` | Workspace TTL or computed expiry is outside supported bounds | `workspaces.open()`, staging, checkpoint, and renewal |
|
|
3338
|
+
| `WORKSPACE_CONFLICT` | Workspace generation changed during a checked operation | Workspace inspection and sweep |
|
|
3339
|
+
| `WORKSPACE_RELEASED` | A mutating operation targeted an already released workspace | Workspace staging, checkpoint, renewal, and promotion |
|
|
3340
|
+
| `WORKSPACE_RETENTION_FAILED` | A low-level stage succeeded but its handle could not be proven in a workspace generation; metadata carries the staged receipt | Workspace asset, page, and bundle staging |
|
|
3341
|
+
| `WORKSPACE_HANDLE_NOT_RETAINED` | Promotion requested a handle absent from the active workspace generation | `promoteToCache()`, `promoteToPublication()` |
|
|
3342
|
+
| `WORKSPACE_PROMOTION_NOT_RETAINED` | Destination did not return exact anchored retention evidence, so the workspace remains active | `promoteToCache()`, `promoteToPublication()` |
|
|
3343
|
+
| `WORKSPACE_PROMOTION_CLEANUP_PENDING` | Destination retention succeeded but checked workspace release failed | `promoteToCache()`, `promoteToPublication()` |
|
|
3198
3344
|
| `REPOSITORY_INSPECTION_INVALID` | Repository doctor options, Git output, dependencies, or safe-integer totals are invalid | `cas.diagnostics.doctor()`, repository inspection adapter |
|
|
3199
3345
|
| `VAULT_ENTRY_NOT_FOUND` | Slug does not exist in vault | `removeFromVault()`, `resolveVaultEntry()` |
|
|
3200
3346
|
| `VAULT_ENTRY_EXISTS` | Slug already exists (use `force` to overwrite) | `addToVault()` |
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# git-cas v6.4.0 Release Notes
|
|
2
|
+
|
|
3
|
+
`v6.4.0` adds a temporary reachability scope for multi-step application-storage
|
|
4
|
+
composition. Applications can build page shards, chunked assets, and structured
|
|
5
|
+
bundles without managing Git refs or paying the index and acquisition lifecycle
|
|
6
|
+
cost of using a general CacheSet as scratch storage.
|
|
7
|
+
|
|
8
|
+
## Scoped Staging Workspaces
|
|
9
|
+
|
|
10
|
+
```javascript
|
|
11
|
+
const workspace = await cas.workspaces.open({
|
|
12
|
+
namespace: 'git-warp/materializations',
|
|
13
|
+
ttlMs: 2 * 60 * 60 * 1000,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
try {
|
|
17
|
+
const page = await workspace.pages.put({ source: encodedShard });
|
|
18
|
+
const bundle = await workspace.bundles.putOrdered({
|
|
19
|
+
members: [['shards/page.cbor', page.handle]],
|
|
20
|
+
});
|
|
21
|
+
await workspace.checkpoint({ handles: [bundle.handle] });
|
|
22
|
+
return await workspace.promoteToCache({
|
|
23
|
+
cache,
|
|
24
|
+
key: materializationKey,
|
|
25
|
+
handle: bundle.handle,
|
|
26
|
+
});
|
|
27
|
+
} finally {
|
|
28
|
+
await workspace.release();
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Workspace capabilities mirror `assets.put()`, `assets.adopt()`, `pages.put()`,
|
|
33
|
+
`bundles.put()`, and `bundles.putOrdered()`. Each call writes through the
|
|
34
|
+
existing application-storage service and returns only after an exact workspace
|
|
35
|
+
generation directly reaches the typed result handle. Mutations serialize within
|
|
36
|
+
one workspace, so concurrent staging cannot replace rather than accumulate
|
|
37
|
+
roots.
|
|
38
|
+
|
|
39
|
+
`checkpoint()` replaces accumulated roots after an aggregate handle makes its
|
|
40
|
+
components transitively reachable. `renew()` extends the current generation's
|
|
41
|
+
lease. `release()` is idempotent and deletes only the exact observed generation;
|
|
42
|
+
symbolic refs and generation races fail closed.
|
|
43
|
+
|
|
44
|
+
## Promotion And Failure Ordering
|
|
45
|
+
|
|
46
|
+
`promoteToCache()` and `promoteToPublication()` require a handle retained by the
|
|
47
|
+
active workspace. They establish destination retention before releasing the
|
|
48
|
+
temporary root. The destination must return an anchored witness for the exact
|
|
49
|
+
handle, ref, and generation. Rejection, malformed evidence, or destination
|
|
50
|
+
failure leaves the workspace reachable and reports
|
|
51
|
+
`WORKSPACE_PROMOTION_NOT_RETAINED` where applicable. A cleanup conflict after
|
|
52
|
+
destination success reports
|
|
53
|
+
`WORKSPACE_PROMOTION_CLEANUP_PENDING`, preserving evidence that the durable
|
|
54
|
+
destination succeeded while temporary cleanup remains due.
|
|
55
|
+
|
|
56
|
+
Workspace expiry never revokes reachability automatically. Operators inspect
|
|
57
|
+
and sweep one bounded namespace explicitly:
|
|
58
|
+
|
|
59
|
+
```javascript
|
|
60
|
+
let cursor = null;
|
|
61
|
+
do {
|
|
62
|
+
const cleanup = await cas.workspaces.sweep({
|
|
63
|
+
namespace,
|
|
64
|
+
limit: 100,
|
|
65
|
+
cursor,
|
|
66
|
+
});
|
|
67
|
+
cursor = cleanup.nextCursor;
|
|
68
|
+
} while (cursor !== null);
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Sweep removes only expired direct refs whose generation still matches the
|
|
72
|
+
inspection. Active, invalid, symbolic, and concurrently renewed workspaces are
|
|
73
|
+
not deleted. When a result is truncated, pass its opaque `nextCursor` to the
|
|
74
|
+
next bounded call so cleanup continues beyond the first page.
|
|
75
|
+
|
|
76
|
+
## Diagnostics
|
|
77
|
+
|
|
78
|
+
Workspace inspection and repository doctor report root count, creation time,
|
|
79
|
+
age, expiry, active or expired posture, and invalid persisted state. Byte
|
|
80
|
+
accounting keeps two meanings separate:
|
|
81
|
+
|
|
82
|
+
- `logicalBytes` is validated semantic content size across retained typed
|
|
83
|
+
handles;
|
|
84
|
+
- `rootObjectBytes` is the loose logical size of unique direct Git root objects.
|
|
85
|
+
|
|
86
|
+
Neither value claims packed physical residency or unique ownership across
|
|
87
|
+
deduplicated support graphs. Inspection validates target names, handles, OIDs,
|
|
88
|
+
Git types, and complete application graphs before reporting either count.
|
|
89
|
+
|
|
90
|
+
## Compatibility
|
|
91
|
+
|
|
92
|
+
This minor release is API-additive. Existing assets, pages, bundles,
|
|
93
|
+
publications, RootSets, CacheSets, ExpiringSets, Vault behavior, and stored
|
|
94
|
+
formats remain unchanged. `RepositoryDoctor` keeps its workspace collaborator
|
|
95
|
+
optional for direct-constructor compatibility. Workspace witnesses use the
|
|
96
|
+
existing `root-set` root kind, while staged-result retention reports
|
|
97
|
+
`protection: 'workspace'`; closed retention and diagnostic discriminant unions
|
|
98
|
+
remain unchanged for exhaustive TypeScript consumers.
|
|
99
|
+
|
|
100
|
+
Like all Git-backed composition, the interval between writing a new object and
|
|
101
|
+
publishing the workspace ref depends on Git's ordinary unreachable-object grace
|
|
102
|
+
period. Immediate-expiry prune running concurrently inside that interval is not
|
|
103
|
+
supported.
|
|
104
|
+
|
|
105
|
+
## Verification
|
|
106
|
+
|
|
107
|
+
Unit coverage proves exact-generation retention, concurrent staging,
|
|
108
|
+
checkpoint compaction, renewal-versus-sweep races, destination-first promotion,
|
|
109
|
+
idempotent release, canonical descriptors and refs, date-range bounds,
|
|
110
|
+
corruption detection, byte accounting, facade wiring, declarations, and doctor
|
|
111
|
+
inventory. Real-Git integration runs `git prune --expire=now` after returned
|
|
112
|
+
operations and proves survival through page, asset, and bundle composition,
|
|
113
|
+
promotion, expiry, sweep, and release.
|
|
114
|
+
|
|
115
|
+
The final release-candidate verifier passed 14/14 steps with 6,538 observed
|
|
116
|
+
tests: 1,993 Node unit tests, 1,992 Bun unit tests, 1,983 Deno unit tests, and
|
|
117
|
+
190 integration tests on each runtime. npm pack and JSR publish dry-runs also
|
|
118
|
+
passed. Twenty repeated real-Git ExpiringSet runs verify that concurrent
|
|
119
|
+
duplicate-writer behavior remains stable after the RootSet retry correction.
|
|
120
|
+
|
|
121
|
+
The unchanged downstream `git-warp` ten-second integration hook remains the
|
|
122
|
+
release adoption gate after package publication. CI, self-review, Code Rabbit,
|
|
123
|
+
and independent Code Lawyer review remain mandatory before tagging.
|
|
124
|
+
|
|
125
|
+
See [Scoped Staging Workspaces](../API.md#scoped-staging-workspaces) for the
|
|
126
|
+
complete API contract and
|
|
127
|
+
[PERF-0049](https://github.com/git-stunts/git-cas/blob/main/docs/design/0049-scoped-staging-workspaces/scoped-staging-workspaces.md)
|
|
128
|
+
for the design and proof obligations.
|