diff --git a/AGENTS.md b/AGENTS.md index a73fd02..20404b0 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -70,8 +70,8 @@ signatures, source-bound provenance, and a clean exact-version consumer with scripts disabled. Manual workflow dispatch prepares only. See [release operations](docs/RELEASING.md) and the -[first-publication handoff](docs/BOOTSTRAP.md). The source is the `0.1.1` -candidate for the first advertised trusted release. Maintainer 2FA bootstrap of +[first-publication handoff](docs/BOOTSTRAP.md). The source is the `0.2.0` +release candidate; `0.1.1` is published as npm `latest` with tag `v0.1.1`. Maintainer 2FA bootstrap of `0.1.0` is complete with exact registry bytes confirmed; it supplies no OIDC provenance. Verify actual npm distribution tags after bootstrap and investigate unexpected defaults; the publish tag argument alone does not prove their state. diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..c6b61a8 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,43 @@ +# Changelog + +## 0.2.0 + +- Add `listGrants(browserContext, { ownerPrincipal, cursor?, limit?, statuses? })` for + owner-scoped grant discovery. Pages return safe grant views, default to 20 + entries, allow at most 100 entries, and use owner-bound opaque cursors. Each + call rechecks the trusted browser session and current owner authority. The optional + `statuses` filter accepts `pending`, `active`, `revoked`, and `expired`; filtering + can return fewer items than the page limit while a continuation cursor remains. +- Maintain the new `agent-access.owner-index.v1` Storage Core collection during + approval. The owner index uses a separate partition from each grant; listing + re-reads authoritative grant heads and claims no cross-partition atomicity. +- Add the bounded, idempotent `backfillGrantIndex({ cursor, limit })` maintenance + API to index approved grants created before 0.2.0. Each call scans at most + `limit` physical grant rows (default 100, maximum 1000). +- Add opt-in `multipart: { maxBytes }` mode to + `createProtectedResourceAuthenticator`. `maxBytes` defaults to 1 MiB + (1048576 bytes) and must be a positive integer no greater than 16 MiB + (16777216 bytes). Bearers remain header-only; credential fields in parts are + rejected, parsed form data is returned as `result.form`, and authorization is + rechecked after parsing. + +### Host upgrade + +Before deploying, provision `agent-access.owner-index.v1` with the same +read/write/transaction rights as `agent-access.records.v1` if the host explicitly +provisions collections, tables, or roles. Run `backfillGrantIndex` once to +completion for each configured issuer/resource: pass each returned `nextCursor` +to the next call until it is null. Run this through host maintenance, never an +agent-facing route. Existing grants remain usable and revocable by ID before +backfill, but do not appear in owner listings until indexed. Hosts that prune +index entries also need recurring backfill as described in [the API +guide](docs/API.md#owner-grant-listing). + +Multipart remains off by default. Enable it explicitly only on authenticators +that accept uploads and select an appropriate body limit; omitting `maxBytes` +within the option uses the 1 MiB default. + +## 0.1.1 + +- Published package baseline preceding the owner-listing and opt-in multipart + additions in 0.2.0. diff --git a/README.md b/README.md index c250e1b..cba23c9 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,10 @@ reading, draft writing, and test-evidence submission. Future capabilities require explicit registration and fresh consent; changing the registry cannot silently widen an existing grant. -As of 2026-11-07, the source is the `@pegma/agent-access@0.1.1` candidate for -the first advertised trusted release. Maintainer 2FA bootstrap of all five +The source is the `@pegma/agent-access@0.2.0` release candidate. +`@pegma/agent-access@0.1.1` is already published as npm `latest`, and its +`v0.1.1` tag exists; this does not establish provenance for the new candidate. +Maintainer 2FA bootstrap of all five `0.1.0` packages, the four Knowledge Base packages and Agent Access, is complete with exact registry bytes confirmed and no OIDC provenance. The [bootstrap receipt](docs/BOOTSTRAP.md#bootstrap-receipt-2026-11-07) records the @@ -41,7 +43,9 @@ paginated `listGrants` ([owner grant listing](docs/API.md#owner-grant-listing)) and can opt individual protected-resource authenticators in to bounded multipart uploads with header-only bearer credentials ([opt-in multipart uploads](docs/HTTP.md#opt-in-multipart-uploads)). Both are -unreleased source additions and change no package version. +additions in the `0.2.0` candidate. Hosts upgrading grants created before 0.2.0 must run +the bounded `backfillGrantIndex` maintenance call as a one-time upgrade step; multipart remains off by default. +See the [changelog](CHANGELOG.md) for the upgrade notes. Read the [architecture](docs/ARCHITECTURE.md), [API](docs/API.md), and [HTTP composition](docs/HTTP.md) before wiring a host. The @@ -50,13 +54,13 @@ Read the [architecture](docs/ARCHITECTURE.md), [API](docs/API.md), and and later trusted-publisher path. The [maintainer bootstrap handoff](docs/BOOTSTRAP.md) records the initial 2FA publication under the requested `bootstrap` tag. Operators must verify actual distribution tags and investigate unexpected defaults. -The `0.1.1` candidate still needs fresh gates and review, verified publisher +The `0.2.0` candidate still needs fresh gates and review, verified publisher configuration, an approved signed tag and release, and successful exact registry consumer and trusted-provenance verification. Release preparation preserves exact tarball bytes, an independently retained manifest digest, and the verified signed-tag identity. External protection, signer, environment, and trusted-publisher/direct-publish configuration remain maintainer gates. -Knowledge Base's advertised release waits for verified Agent Access `0.1.1`. +Knowledge Base's advertised release waits for verified Agent Access `0.2.0`. SD-02 requires verified advertised Knowledge Base dependencies; real host assembly requires verified advertised dependencies from both components. Merged source and release preparation authorize no tags, releases, publication, diff --git a/docs/API.md b/docs/API.md index c25013e..04c8e56 100644 --- a/docs/API.md +++ b/docs/API.md @@ -1,6 +1,7 @@ # Public API and host boundary -The source package is not yet published. It composes the released +Use an exact registry version after its release has been verified as described in +[release operations](RELEASING.md). The package composes the released `@pegma/authorization-core` AccessContext, `@pegma/spine` Clock/PrincipalId/ IsoTimestamp, `@pegma/storage-core` Store, and transactional `@pegma/audit`. The host keeps its existing login, session, administrator policy, browser diff --git a/docs/BOOTSTRAP.md b/docs/BOOTSTRAP.md index 7fde7ed..f42d77a 100644 --- a/docs/BOOTSTRAP.md +++ b/docs/BOOTSTRAP.md @@ -4,10 +4,11 @@ The maintainer owns npm publication and external configuration. As of 2026-11-07, `@pegma/agent-access@0.1.0` has completed maintainer 2FA bootstrap -with exact registry bytes confirmed and no OIDC provenance. Source version -`0.1.1` is the candidate for the first advertised trusted release; that release -is not yet verified. Knowledge Base has its own release handoff and waits for -verified Agent Access `0.1.1` before its advertised release. +with exact registry bytes confirmed and no OIDC provenance. Version `0.1.1` +is already published as npm `latest`, and its `v0.1.1` tag exists. Source version +`0.2.0` is the new release candidate; its release is not yet verified. +Knowledge Base has its own release handoff and waits for +verified Agent Access `0.2.0` before its advertised release. Creating the package name and advertising the first trusted release are separate steps. Maintainer 2FA publication supplies no OIDC provenance and @@ -15,6 +16,29 @@ cannot substitute for strict `verify` in [release operations](RELEASING.md). The historical AUTH-01 source result does not replace this change's required current-head code/security review and Node 22/24 gate. +## Observed 0.1.1 publication pointers: 2026-11-10 + +Read-only checks on 2026-11-10 found the existing +[0.1.1 GitHub release](https://github.com/pegma-dev/agent-access/releases/tag/v0.1.1) +and its linked [Publish run](https://github.com/pegma-dev/agent-access/actions/runs/42420302775). +GitHub reports that release-triggered run completed successfully, including +signed-identity validation, both Node release gates, preparation, exact-artifact +publication, and the separate registry-release/consumer verification job. +The npm registry reports version `0.1.1`, with `latest=0.1.1` and +`bootstrap=0.1.0`. Recheck mutable distribution tags before relying on them: + +```sh +npm view @pegma/agent-access@0.1.1 version dist-tags --json --registry https://registry.npmjs.org +gh api repos/pegma-dev/agent-access/releases/tags/v0.1.1 +gh api repos/pegma-dev/agent-access/actions/runs/42420302775 +gh api repos/pegma-dev/agent-access/actions/runs/42420302775/jobs +``` + +These are pointers to observed public metadata, not a reconstructed publication +receipt. This repository does not retain a 0.1.1 artifact ID or independently +recorded manifest digest here; this check did not download or re-verify registry +bytes, signatures, or provenance. It supplies no release evidence for 0.2.0. + ## Bootstrap receipt: 2026-11-07 The operator manually reran the post-publication preflight commands below at @@ -79,7 +103,7 @@ requested publish tag alone does not establish actual distribution-tag state. The following procedure records the completed first publication. Do not recreate or move its tag, rebuild its artifact, or republish the immutable -version. Use the separate trusted-release procedure for the `0.1.1` candidate. +version. Use the separate trusted-release procedure for the `0.2.0` candidate. 1. Confirm npm ownership and publishing permission for `@pegma/agent-access`. Record the responsible maintainer and keep credentials and one-time codes @@ -141,7 +165,7 @@ before advertisement. Do not infer actual tag state from `--tag bootstrap`. Do not advertise `0.1.0` as the trusted production dependency or authorize host installation from it. -## First advertised trusted release +## Next trusted release Once the name exists, the maintainer configures its trusted publisher, the protected `npm-publish` environment, approved signers, and immutable tag @@ -150,8 +174,8 @@ to `pegma-dev/agent-access`, exact workflow `publish.yml`, and environment `npm-publish`; explicitly permit direct publishing. Check npm's first-use timing before configuring it for the reviewed trusted release. -The `0.1.1` candidate proposes the package-version change for the first -advertised release; dependent pins must be synchronized across consumers. +The `0.2.0` candidate adds owner-scoped grant listing, the owner index, and +opt-in multipart bearer transport; dependent pins must be synchronized across consumers. It still requires fresh current-head code/security review and the full Node 22/24 gate. A manually published version cannot be republished through OIDC to acquire provenance. After the candidate's gates pass and external publisher @@ -166,6 +190,6 @@ job succeeds: registry bytes/dependencies, a clean exact-version registry consumer, registry signatures, and matching source/workflow/tag/commit provenance. Preserve that result with the release identity and independent manifest digest. Knowledge Base's advertised release follows verified Agent -Access `0.1.1`. Both hosts additionally require verified advertised Knowledge Base +Access `0.2.0`. Both hosts additionally require verified advertised Knowledge Base and their retained actual login/Admin-consent/client/staging acceptance before activation. Registry publication closes none of those host gates. diff --git a/docs/PROJECT_PLAN.md b/docs/PROJECT_PLAN.md index ed82a28..7d75b6c 100644 --- a/docs/PROJECT_PLAN.md +++ b/docs/PROJECT_PLAN.md @@ -4,7 +4,9 @@ AUTH-01 is the scoped-credential prerequisite inserted before KB-04 in the [Knowledge/AI plan](https://github.com/pegma-dev/support-desk/blob/main/docs/KNOWLEDGE_AI_PLAN.md). This repository owns reusable authorization-server source; Knowledge Base continues to own content and resource operations. The current source is the -`@pegma/agent-access@0.1.1` candidate for the first advertised trusted release. +`@pegma/agent-access@0.2.0` release candidate. Version `0.1.1` is already +published as npm `latest`, and its `v0.1.1` tag exists. The additive owner-scoped +grant API, owner index, and opt-in multipart transport require the new minor version. AUTH-01 source and the original release preparation are merged. As of 2026-11-07, maintainer 2FA bootstrap of all five `0.1.0` packages, the four Knowledge Base packages and Agent Access, is complete with exact registry bytes @@ -33,7 +35,7 @@ distinct from the recorded squash merge commits. They are not fixed test-count requirements or publication guards. The [2026-11-07 bootstrap receipt](BOOTSTRAP.md#bootstrap-receipt-2026-11-07) records completion of all five `0.1.0` uploads and exact-byte confirmation, -without OIDC provenance. The `0.1.1` candidate still needs fresh current-head +without OIDC provenance. The `0.2.0` candidate still needs fresh current-head review, validation, publisher configuration, a signed tag and release, and strict registry/provenance verification in [release operations](RELEASING.md). @@ -44,7 +46,7 @@ strict registry/provenance verification in [release operations](RELEASING.md). | KB-04 transport source exit | Reviewed head [c897626](https://github.com/pegma-dev/knowledge-base/commit/c897626de6c7b2ea574f4154b0bc7a7731ee106e); [primary Node 22/24 CI](https://github.com/pegma-dev/knowledge-base/actions/runs/42390433045). 372 runtime tests and official SDK proof of all five initial tools. | Merged via [Knowledge Base #5](https://github.com/pegma-dev/knowledge-base/pull/5) as [b61fc77](https://github.com/pegma-dev/knowledge-base/commit/b61fc77aedd22e888ac7292c3597f93e54fcda8e); retained host acceptance open. | | KB-05 release preparation | Reviewed head [c8ef14a](https://github.com/pegma-dev/knowledge-base/commit/c8ef14af0ec32e3903b9399543b7a9f2e48df2f9); [primary Node 22/24 CI](https://github.com/pegma-dev/knowledge-base/actions/runs/42398508042). Each lane passed 372 runtime tests plus 128 release regressions (500 per lane), with zero skips. Packaging checks cover four KB packages; the packed protocol proof uses all five packages (four KB plus Agent Access). | Merged via [Knowledge Base #6](https://github.com/pegma-dev/knowledge-base/pull/6) as [7f5eee6](https://github.com/pegma-dev/knowledge-base/commit/7f5eee68be692b5489de3965f3f5ede7ef7a812d); historical release-preparation source. | | First-publication bootstrap | Maintainer 2FA uploads of all five `0.1.0` packages (four KB plus Agent Access) were accepted; exact registry bytes match the prepared artifacts. See the [bootstrap receipt](BOOTSTRAP.md#bootstrap-receipt-2026-11-07). | Complete; OIDC provenance absent. Operators must verify distribution tags and investigate unexpected defaults. | -| First advertised publication | Agent Access `0.1.1` requires [full current-head Node 22/24 CI and code/security review](RELEASING.md#repository-and-development-artifact-gates), the [external release checklist](RELEASING.md#external-release-checklist), an approved signed tag and release, and [strict exact-version registry/provenance verification](RELEASING.md#registry-verification-and-availability). | Pending. Knowledge Base advertisement waits for verified Agent Access `0.1.1`. | +| Next trusted publication | Agent Access `0.2.0` requires [full current-head Node 22/24 CI and code/security review](RELEASING.md#repository-and-development-artifact-gates), the [external release checklist](RELEASING.md#external-release-checklist), an approved signed tag and release, and [strict exact-version registry/provenance verification](RELEASING.md#registry-verification-and-availability). | Pending. Knowledge Base advertisement waits for verified Agent Access `0.2.0`. | | SD-02 AI coordinator | Requires verified advertised Knowledge Base dependencies. | Pending. | | Retained host acceptance | PG-01/RG-01 require exact verified advertised Agent Access and Knowledge Base dependencies, real existing-login/current-Admin consent, and actual per-client protected API/MCP, credential-failure, and exact-revision evidence-attestation proof on both hosts. | Pending; required before activation/A-01/pilots. | @@ -78,9 +80,9 @@ clients or unsupported flows remain explicit host acceptance gaps. The source prerequisites, original release preparation, and `0.1.0` bootstrap are complete. The remaining sequence is fresh review and gates for Agent Access -`0.1.1`, verified external publisher configuration, its approved signed tag and +`0.2.0`, verified external publisher configuration, its approved signed tag and release, and strict registry/provenance verification before advertisement. -Knowledge Base's advertised release waits for verified Agent Access `0.1.1`. +Knowledge Base's advertised release waits for verified Agent Access `0.2.0`. SD-02 follows verified advertised Knowledge Base dependencies; PG-01/RG-01 host assembly follows verified advertised dependencies from both components. Real existing-login/current-Admin consent and actual-client proof then remain diff --git a/docs/RELEASING.md b/docs/RELEASING.md index ea44d91..6550cc0 100644 --- a/docs/RELEASING.md +++ b/docs/RELEASING.md @@ -2,8 +2,11 @@ ## Status and release boundary -This repository releases only `@pegma/agent-access`. As of 2026-11-07, its source -is the `0.1.1` candidate for the first advertised trusted release. Maintainer +This repository releases only `@pegma/agent-access`. Its source is the `0.2.0` +release candidate. Version `0.1.1` is already published as npm `latest`, and +`v0.1.1` exists; do not reuse that version or tag. See the +[dated public metadata pointers](BOOTSTRAP.md#observed-011-publication-pointers-2026-11-10) +for the prior release and the limits of that observation. Maintainer 2FA bootstrap of all five `0.1.0` packages, the four Knowledge Base packages and Agent Access, is complete with exact registry bytes confirmed and no OIDC provenance. The [bootstrap receipt](BOOTSTRAP.md#bootstrap-receipt-2026-11-07) @@ -14,7 +17,7 @@ reviewed source heads, separate squash merge commits, exact primary CI runs, historical per-lane results, and review receipts. Those observations do not replace any current-head review, validation, or release preflight below. -The `0.1.1` candidate still requires fresh current-head gates and review, +The `0.2.0` candidate still requires fresh current-head gates and review, verified release protection and publisher configuration, an approved signed tag and release, and strict exact-version registry/provenance verification. Operators must verify actual npm distribution tags after bootstrap and @@ -25,7 +28,7 @@ GitHub releases, publication, external configuration, or deployment. Follow the remaining trusted-release gates. Knowledge Base retains its own release process; its advertised release waits -for verified Agent Access `0.1.1`. SD-02 requires verified advertised Knowledge +for verified Agent Access `0.2.0`. SD-02 requires verified advertised Knowledge Base dependencies. Production host assembly requires exact verified advertised dependencies from both components. Source tests, local adapter conformance, and the official SDK protocol fixture establish source behavior; they do not establish real host @@ -64,7 +67,11 @@ released dependencies, and imports the public package. The runtime pins remain `@pegma/audit@0.2.0`, `@pegma/authorization-core@0.4.0`, `@pegma/spine@0.1.2`, and `@pegma/storage-core@0.4.0`. This candidate changes the package version to -`0.1.1` without changing runtime scope or dependency pins. +`0.2.0` for the additive owner-scoped grant-listing API, package-maintained +owner index, and opt-in multipart bearer transport, without changing dependency +pins. Hosts with pre-0.2.0 grants must run `backfillGrantIndex` as a one-time +upgrade step; multipart remains +off by default. See the [changelog](../CHANGELOG.md). `pnpm run release:pack` preserves development artifacts and a schema-1 manifest in a new `.release/agent-access-*` directory. It requires no tag and supplies no release identity or provenance. Publication rejects that development manifest; @@ -72,6 +79,11 @@ use strict `prepare` for a releasable artifact. ## Strict release preparation +Before merging release source, ensure the changelog has a version-only heading +for the target version (for example, `## 0.2.0`), with no `Unreleased` label. +A publication date need not be predicted; retain actual publication timing in +the release record after publication. + Merge reviewed release source and exact version/pin changes to protected `origin/main` first. Configure immutable protected `v*` tags and approved SSH release signers outside this source change. A stable `vX.Y.Z` must be a signed diff --git a/packages/agent-access/README.md b/packages/agent-access/README.md index d2e6718..2f824bd 100644 --- a/packages/agent-access/README.md +++ b/packages/agent-access/README.md @@ -2,6 +2,13 @@ Administrator-approved, scoped OAuth credentials for Pegma hosts. +Install an exact version after verifying its release. Replace `` +with that version: + +```sh +pnpm add --save-exact @pegma/agent-access@ +``` + Agent Access supports public-client device authorization and authorization-code grants with mandatory S256 PKCE. It owns consent snapshots, opaque access credentials, rotating refresh families, revocation, discovery, and protocol @@ -30,15 +37,26 @@ context for the actual operation. Keep browser approval and its CSRF/origin checks in the host. Hosts that render a connected-agents page list the signed-in owner's approved -grants with `listGrants(browserContext, { ownerPrincipal, cursor, limit })`. +grants with `listGrants(browserContext, { ownerPrincipal, cursor?, limit?, statuses? })`. Pages are owner-only, bounded (default 20, maximum 100), and continue with an -owner-bound opaque cursor. Each item is the same safe `GrantView` that +owner-bound opaque cursor. The optional `statuses` filter accepts `pending`, +`active`, `revoked`, and `expired`; filtered pages can contain fewer items than +the limit while still returning `nextCursor`. Each item is the same safe `GrantView` that `getGrant` returns, including its current status, and can be revoked with `revokeGrant`. Grants approved before listing existed appear after the host -runs the bounded, idempotent `backfillGrantIndex` maintenance call. +runs the bounded, idempotent `backfillGrantIndex({ cursor, limit })` maintenance +call. On upgrade to 0.2.0, run it once to completion, passing `nextCursor` to the +next call until it is null (default 100 physical grant rows per call, maximum +1000). Hosts that explicitly provision storage collections or roles must first +provision `agent-access.owner-index.v1` with the same read/write/transaction +rights as `agent-access.records.v1`. The owner index is maintained by the +package in a separate collection; it has no cross-partition atomicity with +grant records. File-upload endpoints may opt in to multipart bodies per authenticator with `createProtectedResourceAuthenticator({ service, configuration, multipart: { maxBytes } })`. +`maxBytes` defaults to 1 MiB (1048576 bytes) and must be a positive integer no +greater than 16 MiB (16777216 bytes). Multipart remains off by default. The bearer still comes only from the `Authorization` header. The body is bounded before and during streaming, parsed from a clone so the original request stays readable on success, rejected (with the upload source cancelled) when any part diff --git a/packages/agent-access/package.json b/packages/agent-access/package.json index a323bb8..e84fe0e 100644 --- a/packages/agent-access/package.json +++ b/packages/agent-access/package.json @@ -1,6 +1,6 @@ { "name": "@pegma/agent-access", - "version": "0.1.1", + "version": "0.2.0", "description": "Scoped, administrator-approved OAuth credentials for Pegma hosts.", "license": "MIT", "type": "module", diff --git a/tests/release/arguments.test.mjs b/tests/release/arguments.test.mjs index c928efb..64ec137 100644 --- a/tests/release/arguments.test.mjs +++ b/tests/release/arguments.test.mjs @@ -20,14 +20,14 @@ const manifestSha256 = "b".repeat(64); test("existing check and pack commands accept no publication options", () => { for (const command of ["check", "pack"]) { assert.deepEqual(parseArguments([command]), { command, options: {} }); - assert.throws(() => parseArguments([command, "--tag", "v0.1.0"])); + assert.throws(() => parseArguments([command, "--tag", "v0.2.0"])); } }); test("prepare requires an exact stable tag and independent commit before any work", () => { assert.deepEqual( - parseArguments(["prepare", "--tag", "v0.1.0", "--expected-commit", commit]), - { command: "prepare", options: { tag: "v0.1.0", expectedCommit: commit } }, + parseArguments(["prepare", "--tag", "v0.2.0", "--expected-commit", commit]), + { command: "prepare", options: { tag: "v0.2.0", expectedCommit: commit } }, ); assert.deepEqual( parseArguments([ @@ -60,7 +60,7 @@ test("preflight, publish, and verify require the same prepared artifact identity "--manifest-sha256", manifestSha256, "--tag", - "v0.1.0", + "v0.2.0", "--expected-commit", commit, ]), @@ -69,7 +69,7 @@ test("preflight, publish, and verify require the same prepared artifact identity options: { preparedDir: "synthetic/prepared", expectedManifestSha256: manifestSha256, - expectedTag: "v0.1.0", + expectedTag: "v0.2.0", expectedCommit: commit, }, }, @@ -78,7 +78,7 @@ test("preflight, publish, and verify require the same prepared artifact identity }); test("missing, duplicate, unknown, malformed, and credential options fail closed", () => { - const prepare = ["prepare", "--tag", "v0.1.0", "--expected-commit", commit]; + const prepare = ["prepare", "--tag", "v0.2.0", "--expected-commit", commit]; const publish = [ "publish", "--prepared-dir", @@ -86,7 +86,7 @@ test("missing, duplicate, unknown, malformed, and credential options fail closed "--manifest-sha256", manifestSha256, "--tag", - "v0.1.0", + "v0.2.0", "--expected-commit", commit, ]; @@ -94,13 +94,13 @@ test("missing, duplicate, unknown, malformed, and credential options fail closed [], ["unknown"], ["prepare"], - ["prepare", "--tag", "v0.1.0"], + ["prepare", "--tag", "v0.2.0"], ["prepare", "--expected-commit", commit], - ["prepare", "--tag", "v0.1.0-rc.1", "--expected-commit", commit], - ["prepare", "--tag", "0.1.0", "--expected-commit", commit], + ["prepare", "--tag", "v0.2.0-rc.1", "--expected-commit", commit], + ["prepare", "--tag", "0.2.0", "--expected-commit", commit], ["prepare", "--tag", "v01.1.0", "--expected-commit", commit], - ["prepare", "--tag", "v0.1.0", "--expected-commit", "HEAD"], - [...prepare, "--tag", "v0.1.0"], + ["prepare", "--tag", "v0.2.0", "--expected-commit", "HEAD"], + [...prepare, "--tag", "v0.2.0"], [...prepare, "--out"], [...prepare, "--out", ""], [...prepare, "--out", "--tag"], @@ -122,7 +122,7 @@ test("missing, duplicate, unknown, malformed, and credential options fail closed "--manifest-sha256", "B".repeat(64), "--tag", - "v0.1.0", + "v0.2.0", "--expected-commit", commit, ], diff --git a/tests/release/contract.test.mjs b/tests/release/contract.test.mjs index 383be8d..416a75c 100644 --- a/tests/release/contract.test.mjs +++ b/tests/release/contract.test.mjs @@ -22,14 +22,14 @@ test("the reviewed release package order and exact dependency pins are fixed", ( ); for (const specification of specifications) { assert.deepEqual( - releaseDependencies(specification.directory, "0.1.0"), + releaseDependencies(specification.directory, "0.2.0"), specification.dependencies, ); } - assert.throws(() => releaseDependencies("unknown", "0.1.0")); + assert.throws(() => releaseDependencies("unknown", "0.2.0")); for (const version of [ - "v0.1.0", - "0.1.0-rc.1", + "v0.2.0", + "0.2.0-rc.1", "01.1.0", "1.0", "1.0.0+build", @@ -41,9 +41,9 @@ test("the reviewed release package order and exact dependency pins are fixed", ( function verify(fixture, overrides = {}) { return verifyReleaseIdentity({ root: fixture.root, - tag: "v0.1.0", + tag: "v0.2.0", expectedCommit: fixture.commit, - version: "0.1.0", + version: "0.2.0", ...overrides, }); } @@ -53,9 +53,9 @@ test("an approved SSH signed annotated tag at the exact clean main commit verifi const result = verify(fixture); assert.deepEqual(result, { repository: "pegma-dev/agent-access", - tag: "v0.1.0", + tag: "v0.2.0", commit: fixture.commit, - version: "0.1.0", + version: "0.2.0", }); assert.ok(Object.isFrozen(result)); }); @@ -63,8 +63,8 @@ test("an approved SSH signed annotated tag at the exact clean main commit verifi test("release identity rejects a wrong tag, version, or event commit", async (t) => { const fixture = await signedGitFixture(t); for (const overrides of [ - { tag: "v0.2.0" }, - { version: "0.1.0-rc.1" }, + { tag: "v0.3.0" }, + { version: "0.2.0-rc.1" }, { expectedCommit: "0".repeat(40) }, { expectedCommit: fixture.commit.toUpperCase() }, { expectedCommit: "HEAD" }, @@ -75,15 +75,15 @@ test("release identity rejects a wrong tag, version, or event commit", async (t) test("a lightweight tag cannot satisfy the signed annotated release contract", async (t) => { const fixture = await signedGitFixture(t); - fixture.git("tag", "-d", "v0.1.0"); - fixture.git("tag", "v0.1.0"); + fixture.git("tag", "-d", "v0.2.0"); + fixture.git("tag", "v0.2.0"); assert.throws(() => verify(fixture), /annotated tag object/u); }); test("an unsigned annotated tag cannot satisfy the release contract", async (t) => { const fixture = await signedGitFixture(t); - fixture.git("tag", "-d", "v0.1.0"); - fixture.git("tag", "-a", "v0.1.0", "-m", "Unsigned fixture"); + fixture.git("tag", "-d", "v0.2.0"); + fixture.git("tag", "-a", "v0.2.0", "-m", "Unsigned fixture"); assert.throws(() => verify(fixture), /signature/u); }); @@ -191,7 +191,7 @@ test("trusted global signer configuration remains available to verification", as test("a tag object changed after signing fails cryptographic verification", async (t) => { const fixture = await signedGitFixture(t); - const signed = fixture.git("cat-file", "tag", "refs/tags/v0.1.0"); + const signed = fixture.git("cat-file", "tag", "refs/tags/v0.2.0"); assert.ok(signed.includes("Synthetic signed release")); const changed = join(fixture.directory, "modified-tag-object"); await writeFile( @@ -199,7 +199,7 @@ test("a tag object changed after signing fails cryptographic verification", asyn `${signed.replace("Synthetic signed release", "Unreviewed tag message")}\n`, ); const object = fixture.git("hash-object", "-t", "tag", "-w", changed); - fixture.git("update-ref", "refs/tags/v0.1.0", object); + fixture.git("update-ref", "refs/tags/v0.2.0", object); assert.throws(() => verify(fixture), /signature/u); }); diff --git a/tests/release/fixtures.mjs b/tests/release/fixtures.mjs index 5d0d591..94facf1 100644 --- a/tests/release/fixtures.mjs +++ b/tests/release/fixtures.mjs @@ -16,9 +16,9 @@ const temporaryPrefix = "pegma-agent-access-release-test-"; export const identity = Object.freeze({ repository: "pegma-dev/agent-access", - tag: "v0.1.0", + tag: "v0.2.0", commit: "a".repeat(40), - version: "0.1.0", + version: "0.2.0", }); export const specifications = [ @@ -42,7 +42,7 @@ const certificates = new Map(); export function syntheticCertificate({ repository = "pegma-dev/agent-access", - tag = "v0.1.0", + tag = "v0.2.0", workflow = ".github/workflows/publish.yml", issuer = "https://token.actions.githubusercontent.com", } = {}) { @@ -137,11 +137,11 @@ export async function preparedFixture(t) { // Manifest verification treats tarballs as opaque, previously reviewed // blobs. These fixtures exercise its byte boundary without executing npm. const bytes = Buffer.from(`synthetic artifact: ${specification.name}\n`); - const filename = `${specification.name.slice(1).replace("/", "-")}-0.1.0.tgz`; + const filename = `${specification.name.slice(1).replace("/", "-")}-0.2.0.tgz`; await writeFile(join(preparedDir, filename), bytes); artifacts.push({ name: specification.name, - version: "0.1.0", + version: "0.2.0", filename, size: bytes.length, shasum: digest(bytes, "sha1"), @@ -260,6 +260,6 @@ export async function signedGitFixture(t) { "https://github.com/pegma-dev/agent-access.git", ); git("update-ref", "refs/remotes/origin/main", commit); - git("tag", "-s", "v0.1.0", "-m", "Synthetic signed release"); + git("tag", "-s", "v0.2.0", "-m", "Synthetic signed release"); return { directory, root, git, env, commit, allowedSigners }; } diff --git a/tests/release/manifest.test.mjs b/tests/release/manifest.test.mjs index e0f1ccf..d1bce02 100644 --- a/tests/release/manifest.test.mjs +++ b/tests/release/manifest.test.mjs @@ -71,10 +71,10 @@ test("manifest digest and expected source identity come from independent trusted { expectedManifestSha256: undefined }, { expectedManifestSha256: "0".repeat(64) }, { expectedManifestSha256: fixture.written.manifestSha256.toUpperCase() }, - { expectedTag: "v0.2.0" }, + { expectedTag: "v0.3.0" }, { expectedCommit: "b".repeat(40) }, { expectedCommit: "HEAD" }, - { expectedVersion: "0.2.0" }, + { expectedVersion: "0.3.0" }, ]) { await assert.rejects( verifyPreparedManifest({ ...fixture.options, ...overrides }), @@ -191,13 +191,13 @@ test("recomputed manifest hashes cannot authorize altered package sets, order, p [ "wrong package version", (manifest) => { - manifest.artifacts[0].version = "0.2.0"; + manifest.artifacts[0].version = "0.3.0"; }, ], [ "prerelease", (manifest) => { - manifest.identity.version = "0.1.0-rc.1"; + manifest.identity.version = "0.2.0-rc.1"; }, ], [ @@ -215,7 +215,7 @@ test("recomputed manifest hashes cannot authorize altered package sets, order, p [ "different release tag", (manifest) => { - manifest.identity.tag = "v0.2.0"; + manifest.identity.tag = "v0.3.0"; }, ], [ diff --git a/tests/release/registry.test.mjs b/tests/release/registry.test.mjs index 475abea..84d58c7 100644 --- a/tests/release/registry.test.mjs +++ b/tests/release/registry.test.mjs @@ -307,7 +307,7 @@ test("matching integrity alone cannot authorize wrong metadata or a foreign tarb [ "version", (value) => { - value.version = "0.2.0"; + value.version = "0.3.0"; }, ], [ @@ -343,7 +343,7 @@ test("matching integrity alone cannot authorize wrong metadata or a foreign tarb [ "foreign registry path", (value) => { - value.dist.tarball = `${registry}other/-/other-0.1.0.tgz`; + value.dist.tarball = `${registry}other/-/other-0.2.0.tgz`; }, ], [ @@ -734,7 +734,7 @@ test("cryptographically verified provenance must still bind every prepared packa "wrong certificate tag", (audit) => { audit.verified[0].attestationBundles[0].bundle.verificationMaterial.certificate.rawBytes = - syntheticCertificate({ tag: "v0.2.0" }); + syntheticCertificate({ tag: "v0.3.0" }); }, ], [ @@ -766,7 +766,7 @@ test("cryptographically verified provenance must still bind every prepared packa "wrong tag", (statement) => { statement.predicate.buildDefinition.externalParameters.workflow.ref = - "refs/tags/v0.2.0"; + "refs/tags/v0.3.0"; }, ], [ @@ -1078,7 +1078,7 @@ test("consumer lock and provenance failures stop verification before package run ); const installed = packages[`node_modules/${prepared.artifacts[0].name}`]; - if (problem === "wrong version") installed.version = "0.2.0"; + if (problem === "wrong version") installed.version = "0.3.0"; if (problem === "workspace link") installed.link = true; if (problem === "wrong integrity") installed.integrity = "sha512-unreviewed";