Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_dispatch:
inputs:
release_ref:
description: 'Existing vX.Y.Z tag to validate, publish, and release'
description: 'Existing vX.Y.Z or vX.Y.Z-prerelease tag to validate, publish, and release'
required: true
default: 'v6.0.0'
type: string
Expand All @@ -25,6 +25,8 @@ jobs:
outputs:
version: ${{ steps.check-version.outputs.version }}
tag: ${{ steps.check-version.outputs.tag }}
npm-dist-tag: ${{ steps.check-version.outputs.npm-dist-tag }}
prerelease: ${{ steps.check-version.outputs.prerelease }}
steps:
- uses: actions/checkout@v6
with:
Expand All @@ -45,6 +47,15 @@ jobs:
fi
echo "version=$PKG_VERSION" >> "$GITHUB_OUTPUT"
echo "tag=$TAG_NAME" >> "$GITHUB_OUTPUT"
# A prerelease (any version with a hyphen, such as 8.0.0-rc.1) goes to
# npm under `next` and to GitHub as a prerelease; never to `latest`.
if [[ "$PKG_VERSION" == *-* ]]; then
echo "npm-dist-tag=next" >> "$GITHUB_OUTPUT"
echo "prerelease=true" >> "$GITHUB_OUTPUT"
else
echo "npm-dist-tag=latest" >> "$GITHUB_OUTPUT"
echo "prerelease=false" >> "$GITHUB_OUTPUT"
fi

test:
needs: validate
Expand Down Expand Up @@ -98,7 +109,20 @@ jobs:
}
JS
- name: Publish to npm
run: npm publish --access public
env:
RELEASE_VERSION: ${{ needs.validate.outputs.version }}
NPM_DIST_TAG: ${{ needs.validate.outputs.npm-dist-tag }}
run: |
if [[ "$RELEASE_VERSION" == *-* ]]; then
EXPECTED_TAG=next
else
EXPECTED_TAG=latest
fi
if [ -z "$RELEASE_VERSION" ] || [ "$NPM_DIST_TAG" != "$EXPECTED_TAG" ]; then
echo "::error::Version $RELEASE_VERSION must publish under dist-tag $EXPECTED_TAG, got $NPM_DIST_TAG"
exit 1
fi
npm publish --access public --tag "$NPM_DIST_TAG"

github-release:
needs: [validate, publish-npm]
Expand All @@ -116,3 +140,4 @@ jobs:
with:
tag_name: ${{ needs.validate.outputs.tag }}
generate_release_notes: true
prerelease: ${{ needs.validate.outputs.prerelease == 'true' }}
2 changes: 1 addition & 1 deletion BEARING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ timeline

## Current State

`v7.0.0` shipped on `2026-11-01`, moving the public schema boundary and Plumbing dependency to Zod 4 and rejecting unsafe integer metadata. It requires published Plumbing 3.3.3. The v7.1.0 reservation capability from [#157](https://github.com/git-stunts/git-cas/issues/157) is merged in PR #158 at `4782052`; the maintainer explicitly authorized an admin merge after independent reviewers became unavailable. [#162](https://github.com/git-stunts/git-cas/issues/162) records successful v7.1.0 publication and a fresh registry consumer in both Git object formats. The signed tag and npm artifact identify release source `18f87dd`. Earlier Plumbing recovery work classifies closed mktree transport input for bounded immutable-object retry; mutable-ref semantics are unchanged. Published `v7.2.0` path-compresses the reservation index ([#167](https://github.com/git-stunts/git-cas/issues/167)); the signed tag, npm gitHead and release workflow identify source `3008b4a`, and [#169](https://github.com/git-stunts/git-cas/issues/169) holds the verification record. git-cas 7.1.0 refuses an index 7.2.0 has written, so processes sharing a ledger upgrade together.
`v7.0.0` shipped on `2026-11-01`, moving the public schema boundary and Plumbing dependency to Zod 4 and rejecting unsafe integer metadata. It requires published Plumbing 3.3.3. The v7.1.0 reservation capability from [#157](https://github.com/git-stunts/git-cas/issues/157) is merged in PR #158 at `4782052`; the maintainer explicitly authorized an admin merge after independent reviewers became unavailable. [#162](https://github.com/git-stunts/git-cas/issues/162) records successful v7.1.0 publication and a fresh registry consumer in both Git object formats. The signed tag and npm artifact identify release source `18f87dd`. Earlier Plumbing recovery work classifies closed mktree transport input for bounded immutable-object retry; mutable-ref semantics are unchanged. Published `v7.2.0` path-compresses the reservation index ([#167](https://github.com/git-stunts/git-cas/issues/167)); the signed tag, npm gitHead and release workflow identify source `3008b4a`, and [#169](https://github.com/git-stunts/git-cas/issues/169) holds the verification record. git-cas 7.1.0 refuses an index 7.2.0 has written, so processes sharing a ledger upgrade together. The unpublished `v8.0.0-rc.1` candidate moves git-cas to `@git-stunts/plumbing` `^4.0.0-rc.1`, starts one-shot `readBlobStream()` reads lazily and adds `materializeFile()`; it is bound for the npm `next` dist-tag while plumbing 4.0.0 is itself a release candidate. It is not the planned v8.0.0 Cleave workspace split ([#133](https://github.com/git-stunts/git-cas/issues/133)), whose numbering now needs revisiting.
Application asset, bundle, page, cache,
expiry, witness, and repository-diagnostics APIs sit above mutable root sets
and the low-level CAS pipeline. Direct bundle-reference reads and bounded
Expand Down
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [8.0.0-rc.1] — 2026-12-01

### Breaking Changes

- git-cas depends on `@git-stunts/plumbing` 4 (`^4.0.0-rc.1`) instead of 3.x. Plumbing 4 itself changes behavior for applications that also call it directly; see `UPGRADING.md`.
- An application that passes its own plumbing instance to git-cas must use plumbing 4, installed as the same copy git-cas uses. git-cas recognises plumbing's errors by class, so an instance from a separate 3.x copy turns, for example, a missing object into plumbing's `GitObjectMissingError` instead of git-cas's `GIT_OBJECT_NOT_FOUND`.
- `GitPersistenceAdapter.readBlobStream()` starts its one-shot `git cat-file blob` command when the caller first reads the returned stream, not when the stream is returned. A stream that is never read starts no git process, and a stream first read after the adapter closed fails with `RESOURCE_CLOSED`.

### Added

- Optional `@git-stunts/git-cas/files` helper `materializeFile()` streams an async byte source to a private sibling file, then renames on success, and resolves if and only if the file was published. It does not fsync. It supports cancellation, which rejects with `signal.reason` until the rename starts, and optional whole-plaintext SHA-256 verification. It follows a destination symlink, including a dangling one, that resolves inside the base and replaces or creates the file it names. It reuses restore path confinement, rejects an output path that resolves to the base directory before reading the source, rejects source chunks that are not `Uint8Array` with `INVALID_OPTIONS`, and leaves the core byte-stream and buffer APIs unchanged. `restoreFile()` changes only by the path fixes listed under Fixed.

### Changed

- `@git-stunts/plumbing` is pinned to exactly `4.0.0-rc.1`, the first 4.0.0 release candidate (npm `next` tag), in place of `^3.3.3`. An application that passes its own plumbing instance to git-cas must use the same version, `4.0.0-rc.1`, so that git-cas recognises plumbing's errors; see `UPGRADING.md`. git-cas already accepts 40- and 64-digit object ids, installs no signal handlers, supplies no custom command runner, and does not retry on plumbing timeouts. The unit and integration suites pass on Node, Bun and Deno, and 500 consecutive two-writer guarded root-set replacements (`scripts/diagnostics/stress-root-set-replacement.js`) each accept exactly one winner.
- `@git-stunts/plumbing` moves from `^3.3.3` to `^4.0.0-rc.1`, which accepts the first 4.0.0 release candidate (npm `next` tag) and every later 4.x release, including 4.0.0 final. The lockfile resolves `4.0.0-rc.1`. An application that passes its own plumbing instance to git-cas must use plumbing 4 resolved to the same installed copy, so that git-cas recognises plumbing's errors; see `UPGRADING.md`. git-cas already accepts 40- and 64-digit object ids, installs no signal handlers, supplies no custom command runner, and does not retry on plumbing timeouts. The unit and integration suites pass on Node, Bun and Deno, and 500 consecutive two-writer guarded root-set replacements (`scripts/diagnostics/stress-root-set-replacement.js`) each accept exactly one winner.
- With 4.0.0-rc.1, a guarded `update-ref` that loses a compare-and-swap race through `plumbing.execute()` reports git's complete stderr and arrives as `GitRepositoryLockedError` (git-stunts/plumbing#9). Root-set persistence keeps its fallback that treats an exit-128 failure with empty stderr and an observed head advance as a conflict.
- Manifests record `formatVersion` as the `MAJOR.MINOR.PATCH` core of the package version, so 8.0.0-rc.1 writes `"8.0.0"`. The manifest schema, in this release and every release since 6.0.0, accepts only three numeric components; stamping `8.0.0-rc.1` would have made every new manifest fail validation. The encryption migration script stamps the same value. Stable versions are unchanged.
- The release workflow publishes a version that contains a hyphen, such as `8.0.0-rc.1`, to npm under the `next` dist-tag and marks its GitHub Release as a prerelease. A plain version publishes under `latest` as before. The publish step refuses to run if the dist-tag does not match the version.

### Performance

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ reads and updates, but 7.1.0 refuses an index 7.2.0 has written; see the
[release notes](./docs/releases/v7.2.0.md) and
[#169](https://github.com/git-stunts/git-cas/issues/169).

The v8.0.0-rc.1 release candidate moves git-cas to `@git-stunts/plumbing` 4 and is bound for npm's `next` dist-tag; `latest` stays on 7.2.0. An application that passes its own plumbing instance must use plumbing 4 too, and `readBlobStream()` now starts git on first read. See the [migration guidance](./UPGRADING.md#v720-to-v800-rc1) and [release notes](./docs/releases/v8.0.0-rc.1.md).

The published v6.5.12 release 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).

### 1. CLI Usage
Expand Down
2 changes: 1 addition & 1 deletion STATUS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# STATUS

**Last tagged release:** `v7.2.0` (`2026-11-06`)
**Current release state:** `v7.2.0` is published to npm and GitHub Releases ([#169](https://github.com/git-stunts/git-cas/issues/169)).
**Current release state:** `v7.2.0` is published to npm and GitHub Releases ([#169](https://github.com/git-stunts/git-cas/issues/169)); `v8.0.0-rc.1`, which moves git-cas to plumbing 4, is an unpublished release candidate bound for the npm `next` dist-tag ([release notes](./docs/releases/v8.0.0-rc.1.md)).
**Verification:** Signed tag `v7.2.0`, npm gitHead and release workflow `42249242979` agree on `3008b4a`. The 14-step release verifier passes at the tag, with test suites in Docker: 2,416 unit tests on Node and Bun (3 skips each), 2,407 on Deno (12 skips), and 353 integration tests on each runtime. git-warp installed the registry artifact by lockfile integrity and passed 333 custody, Warp and migration-golden tests ([git-warp#1083](https://github.com/git-stunts/git-warp/pull/1083)). [#169](https://github.com/git-stunts/git-cas/issues/169#issuecomment-7308539667) retains the verification record. v7.1.0 evidence remains in [#162](https://github.com/git-stunts/git-cas/issues/162).
**Playback truth:** `main`
**Runtimes:** Node.js 22.x, Bun, Deno
Expand Down
20 changes: 17 additions & 3 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,25 @@

This guide covers breaking changes and migration steps for git-cas releases.

## Unreleased: `@git-stunts/plumbing` 4.0.0-rc.1
## v7.2.0 To v8.0.0-rc.1

git-cas now depends on `@git-stunts/plumbing` `4.0.0-rc.1`. git-cas's own API and stored data do not change. If your application also uses plumbing directly, read the plumbing 4.0.0 changelog: a deadline now kills git's whole process group and is not retried, more than 10 MiB of unread stdout fails with `UnreadOutputLimitError`, `GitSha` accepts SHA-256 ids, and plumbing forwards `SIGINT`, `SIGTERM` and `SIGHUP` to running git commands (declare a handler plumbing cannot see with `declareSignalHandler()`).
git-cas 8.0.0-rc.1 is a release candidate on npm's `next` dist-tag (`npm install @git-stunts/git-cas@next`); `latest` stays on 7.2.0. It depends on `@git-stunts/plumbing` `^4.0.0-rc.1`, which accepts plumbing 4.0.0 final and later 4.x releases. The stored data format and the public API's signatures do not change, but three behaviors are breaking for consumers. See the [release notes](./docs/releases/v8.0.0-rc.1.md).

If you pass your own plumbing instance to `ContentAddressableStore` (or to `GitPersistenceAdapter`, `GitRefAdapter` or `GitRepositoryInspectionAdapter`), change your application's `@git-stunts/plumbing` dependency to exactly `4.0.0-rc.1` as well, so that your package manager installs one copy shared with git-cas. git-cas recognises plumbing's errors (`GitObjectMissingError`, `GitProtocolError`, `InvalidArgumentError`) by class. An instance from a separately installed 3.x copy throws errors of other classes, so, for example, reading a missing object reports plumbing's `GitObjectMissingError` instead of git-cas's `GIT_OBJECT_NOT_FOUND`, and git-cas's one-time recovery of a failed object session does not run.
### Plumbing 4

If your application also uses plumbing directly, read the plumbing 4.0.0 changelog: a deadline now kills git's whole process group and is not retried, more than 10 MiB of unread stdout fails with `UnreadOutputLimitError`, `GitSha` accepts SHA-256 ids, and plumbing forwards `SIGINT`, `SIGTERM` and `SIGHUP` to running git commands (declare a handler plumbing cannot see with `declareSignalHandler()`).

### Injected plumbing instances

If you pass your own plumbing instance to `ContentAddressableStore` (or to `GitPersistenceAdapter`, `GitRefAdapter` or `GitRepositoryInspectionAdapter`), change your application's `@git-stunts/plumbing` dependency to a plumbing 4 range that resolves to the same version git-cas uses, such as `^4.0.0-rc.1`, so that your package manager installs one copy shared with git-cas. Check with `npm ls @git-stunts/plumbing` or `pnpm why @git-stunts/plumbing` that only one copy is installed. git-cas recognises plumbing's errors (`GitObjectMissingError`, `GitProtocolError`, `InvalidArgumentError`) by class. An instance from a separately installed 3.x copy throws errors of other classes, so, for example, reading a missing object reports plumbing's `GitObjectMissingError` instead of git-cas's `GIT_OBJECT_NOT_FOUND`, and git-cas's one-time recovery of a failed object session does not run.

### Lazy `readBlobStream()`

`GitPersistenceAdapter.readBlobStream()` now starts its one-shot `git cat-file blob` command when you first read the returned stream, not when the call returns. This path serves blobs over 10 MiB, blobs the adapter's `cat-file` session cannot describe or read, and plumbing without object sessions. Code that obtained such a stream and read it only after closing the adapter (or the store that owns it) now gets `RESOURCE_CLOSED`; read the stream before closing. A stream you never read no longer starts a git process. Blobs of 10 MiB or less that the session reads are unchanged: they are read into memory before the call returns, and their streams still yield after close.

### Manifest `formatVersion`

New manifests record `formatVersion: "8.0.0"`, the `MAJOR.MINOR.PATCH` core of the package version, not `8.0.0-rc.1`. The manifest schema accepts only three numeric components, so 7.x readers accept manifests this candidate writes.

## v6.5.12 To v7.0.0 (candidate)

Expand Down
25 changes: 25 additions & 0 deletions docs/releases/v8.0.0-rc.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# git-cas v8.0.0-rc.1: plumbing 4 release candidate

This release candidate moves git-cas onto `@git-stunts/plumbing` 4. It is a major release because applications that share a plumbing instance with git-cas must move to plumbing 4 with it, and because `GitPersistenceAdapter.readBlobStream()` now starts git lazily. Plumbing 4.0.0 is itself only a release candidate, so this version publishes to npm under the `next` dist-tag and leaves `latest` on 7.2.0. The plumbing upgrade merged in [PR #177](https://github.com/git-stunts/git-cas/pull/177). This document claims no published 8.0.0-rc.1 artifact. See [UPGRADING.md](../../UPGRADING.md#v720-to-v800-rc1) before adopting it.

## Breaking changes

git-cas depends on `@git-stunts/plumbing` `^4.0.0-rc.1` instead of `^3.3.3`. The range accepts plumbing 4.0.0 final and later 4.x releases without a new git-cas release. Plumbing 4 changes behavior for applications that also call it directly: a deadline kills git's whole process group and is not retried, more than 10 MiB of unread stdout fails with `UnreadOutputLimitError`, `GitSha` accepts SHA-256 ids, and plumbing forwards `SIGINT`, `SIGTERM` and `SIGHUP` to running git commands.

An application that passes its own plumbing instance to `ContentAddressableStore`, `GitPersistenceAdapter`, `GitRefAdapter` or `GitRepositoryInspectionAdapter` must use plumbing 4, installed as the same copy git-cas uses. git-cas recognises plumbing's errors by class. An instance from a separate 3.x copy throws errors of other classes, so a missing object reports plumbing's `GitObjectMissingError` instead of git-cas's `GIT_OBJECT_NOT_FOUND`, and git-cas's one-time recovery of a failed object session does not run.

`GitPersistenceAdapter.readBlobStream()` starts its one-shot `git cat-file blob` command when the caller first reads the returned stream, not when the stream is returned. That path serves a blob over 10 MiB, a blob the adapter's `cat-file` session cannot describe or read, and plumbing without object sessions. A stream that is never read starts no git process. A stream first read after the adapter closed fails with `RESOURCE_CLOSED`. A blob of 10 MiB or less that the session reads is still read into memory before the call returns, and its stream still yields after close.

## Other changes

The optional `@git-stunts/git-cas/files` entrypoint adds `materializeFile()`, which streams an async byte source to a private sibling file and renames it on success. `restoreFile()` and `materializeFile()` resolve destination symlinks one component at a time, refuse a dangling link that points outside the base directory, and accept names such as `..cache`. The default JSON façade decodes UTF-8 natively, 2.6x to 6x faster on Node 22 for manifest-shaped metadata. [CHANGELOG.md](../../CHANGELOG.md) lists each change.

## Stored data

Stored objects, refs and manifests keep their format. New manifests record `formatVersion: "8.0.0"`, the `MAJOR.MINOR.PATCH` core of the package version. The manifest schema has accepted only three numeric components since 6.0.0, so stamping `8.0.0-rc.1` would have made every new manifest fail validation, and 6.x and 7.x readers would refuse it. With the core version, 7.x readers accept manifests written by this candidate.

## Publication

The release workflow now chooses the npm dist-tag from the version. A version that contains a hyphen publishes with `npm publish --access public --tag next`, and its GitHub Release is marked as a prerelease. A plain version publishes under `latest`. The publish step refuses to run if the dist-tag and the version disagree.

This candidate does not contain the planned v8.0.0 Cleave workspace split ([#133](https://github.com/git-stunts/git-cas/issues/133)). Merge approval, a signed tag, a successful release workflow and registry-consumer evidence remain required before any claim of publication.
Loading
Loading