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
52 changes: 52 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,32 @@ jobs:
with:
node-version: 24.18.0
package-manager-cache: false
- name: Bootstrap the reviewed npm CLI
shell: bash
run: |
set -euo pipefail
umask 077
npm_directory="$(mktemp -d "${RUNNER_TEMP}/reviewed-npm.XXXXXX")"
npm_archive="${npm_directory}/npm-11.18.0.tgz"
node_path="$(command -v node)"
[[ "${node_path}" == /* && -f "${node_path}" && -x "${node_path}" ]]
curl --disable --fail --silent --show-error --proto '=https' --proxy '' \
--max-time 60 --max-filesize 16777216 \
--output "${npm_archive}" \
'https://registry.npmjs.org/npm/-/npm-11.18.0.tgz'
printf '%s %s\n' \
'73f6155215ebabf4ed96dca1f567c2372cc713c33af2e5b9b62fde4e92373e2e' \
"${npm_archive}" | sha256sum --check --status
tar --extract --gzip --file "${npm_archive}" --directory "${npm_directory}" \
--no-same-owner --no-same-permissions
npm_cli="${npm_directory}/package/bin/npm-cli.js"
[[ -f "${npm_cli}" && ! -L "${npm_cli}" ]]
mkdir "${npm_directory}/bin"
# The archive's bin/npm selects Node's global npm; bypass that wrapper.
printf '#!/bin/bash\nexec %q %q "$@"\n' "${node_path}" "${npm_cli}" \
> "${npm_directory}/bin/npm"
chmod 0700 "${npm_directory}/bin/npm"
printf '%s\n' "${npm_directory}/bin" >> "${GITHUB_PATH}"
- name: Check the npm version
shell: bash
run: |
Expand Down Expand Up @@ -365,6 +391,32 @@ jobs:
with:
node-version: 24.18.0
package-manager-cache: false
- name: Bootstrap the reviewed npm CLI
Comment thread
FlyOverCoderKY marked this conversation as resolved.
Resolved
shell: bash
run: |
set -euo pipefail
umask 077
npm_directory="$(mktemp -d "${RUNNER_TEMP}/reviewed-npm.XXXXXX")"
npm_archive="${npm_directory}/npm-11.18.0.tgz"
node_path="$(command -v node)"
[[ "${node_path}" == /* && -f "${node_path}" && -x "${node_path}" ]]
curl --disable --fail --silent --show-error --proto '=https' --proxy '' \
--max-time 60 --max-filesize 16777216 \
--output "${npm_archive}" \
'https://registry.npmjs.org/npm/-/npm-11.18.0.tgz'
printf '%s %s\n' \
'73f6155215ebabf4ed96dca1f567c2372cc713c33af2e5b9b62fde4e92373e2e' \
"${npm_archive}" | sha256sum --check --status
tar --extract --gzip --file "${npm_archive}" --directory "${npm_directory}" \
--no-same-owner --no-same-permissions
npm_cli="${npm_directory}/package/bin/npm-cli.js"
[[ -f "${npm_cli}" && ! -L "${npm_cli}" ]]
mkdir "${npm_directory}/bin"
# The archive's bin/npm selects Node's global npm; bypass that wrapper.
printf '#!/bin/bash\nexec %q %q "$@"\n' "${node_path}" "${npm_cli}" \
> "${npm_directory}/bin/npm"
chmod 0700 "${npm_directory}/bin/npm"
printf '%s\n' "${npm_directory}/bin" >> "${GITHUB_PATH}"
- name: Check the npm version
shell: bash
run: |
Expand Down
18 changes: 11 additions & 7 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,10 @@ packages. Only the minimal publish job receives OIDC authority.
Publication is integrity-checked, retry-safe, and
dependency-ordered. See `docs/RELEASING.md`.

The sole registration exception is a separately reviewed, metadata-only first
`@pegma/storage-dynamodb@0.4.2` archive under `bootstrap`, which may be published
only by the maintainer with interactive 2FA. It contains no runtime, exports, scripts or
The sole registration exception was the separately reviewed, metadata-only
`@pegma/storage-dynamodb@0.4.2` archive published under `bootstrap`. That exception
requires maintainer interactive 2FA; it authorizes no runtime publication.
The archive contains no runtime, exports, scripts or
dependencies, is not an SDK/release qualification, and is never a host input.
Actual runtime publication remains trusted-publisher only.

Expand All @@ -94,10 +95,13 @@ published code or substitute them for the pinned Core `0.4.0` runtime/error clas
All four packages are in this repository. `@pegma/storage-core` and
`@pegma/storage-azure-tables` are published at `0.4.0`,
`@pegma/storage-cloudflare-d1` carries a `0.4.1` transaction-robustness
patch of its own. DynamoDB `0.4.2` is reserved for registration-only metadata;
`@pegma/storage-dynamodb@0.4.3` is the unpublished first trusted AWS runtime
candidate (see `docs/AWS_ADAPTER.md` and `docs/RELEASING.md`). Do not claim
registration or release before its actual registry evidence. The port offers keyed access,
patch of its own. DynamoDB `0.4.2` is published registration-only metadata.
The `v0.4.3` attempt failed before preparation, with no runtime archive or
publication. Its signed tag remains immutable; retain its release as a failure.
`@pegma/storage-dynamodb@0.4.4` is the unpublished first trusted
AWS runtime candidate (see `docs/AWS_ADAPTER.md` and `docs/RELEASING.md`).
The later D1 feature is planned as `0.4.5`. Do not claim runtime release before
its actual registry qualification. The port offers keyed access,
optimistic concurrency through `update`, version-conditional
`putIfUnchanged` and `deleteIfUnchanged`, partition reads, bounded
authoritative cross-partition scans, and `transact`.
Expand Down
19 changes: 11 additions & 8 deletions docs/AWS_ADAPTER.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@

The runtime adapter is implemented in this repository. It qualifies when every
conformance case passes against **Amazon DynamoDB Local** and the release gates
are satisfied. `@pegma/storage-dynamodb@0.4.3` is the unpublished first trusted
runtime candidate. Version `0.4.2` is reserved for a separately reviewed,
are satisfied. `@pegma/storage-dynamodb@0.4.4` is the unpublished first trusted
runtime candidate. Version `0.4.2` was published as a separately reviewed,
metadata-only registration archive: it contains no runtime, exports, scripts or
dependencies, is not an SDK, and must never be a host input. Registration and
runtime publication remain pending until their actual registry evidence exists.
dependencies, is not an SDK, and must never be a host input. The `v0.4.3` release
attempt failed before preparation, producing no runtime archive or publication.
Its signed tag remains immutable; retain the release as a failed attempt.
Runtime qualification remains pending.

Decided 2026-09-11. This is the assignment record for Storage Core's third
real adapter — read `AGENTS.md` first; its hard rules govern everything here.
Expand Down Expand Up @@ -78,17 +80,18 @@ Node 22 + 24.

The port is unchanged, so `@pegma/storage-core` stays at `0.4.0` and the runtime
candidate pins it exactly. `0.4.2` is registration-only metadata under `bootstrap`,
not a usable adapter release. The first trusted runtime candidate is `0.4.3`;
not a usable adapter release. The first trusted runtime candidate is `0.4.4`;
its publication requires the reviewed signed-source and trusted-publisher flow.
Existing repository-wide tags `v0.4.0` and `v0.4.1` must never be reused.
Existing repository-wide tags `v0.4.0`, `v0.4.1` and failed `v0.4.3` must never
be reused. The later D1 feature is planned as `0.4.5`, after its own review.

Unprivileged validation runs the full gates on Node 22 and 24 before preparation.
Preparation depends on that validation and signed-release identity checks; it
packs only selected source packages and retains the independently pinned exact
original registry archives for unselected packages. Only the minimal publish job
receives OIDC authority. See [RELEASING.md](RELEASING.md) for the separate
registration exception and runtime release procedure; this document records no
completed registration or runtime publication.
registration exception and runtime release procedure. Published metadata
registration does not qualify a runtime, which remains unpublished.

## What it unblocks

Expand Down
53 changes: 31 additions & 22 deletions docs/RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ below is an explicit first-package exception, not a runtime release path.

## Current versions and source ownership

Core and Azure are published at `0.4.0`; D1 at `0.4.1`. DynamoDB `0.4.2` is reserved for
registration-only metadata, and `0.4.3` is the unpublished first trusted runtime
candidate. Registration is not adapter code, conformance evidence or a production
dependency. Do not claim an actual registration or release until its public
registry evidence exists.
Core and Azure are published at `0.4.0`; D1 at `0.4.1`. DynamoDB `0.4.2` is
published registration-only metadata, and `0.4.4` is the unpublished first trusted
runtime candidate. The `v0.4.3` release attempt failed its npm-version check
before preparation: no runtime archive was produced or published. Its signed
tag remains immutable; preserve the release as a failed attempt. Registration is
not adapter code, conformance
evidence or a production dependency; runtime qualification remains pending.

Unversioned Core/Azure/D1 changes in current source are **not** the code published
at those versions. Schema 2 deliberately selects source artifacts by the new tag
Expand All @@ -22,9 +24,8 @@ no Core or host upgrade is implied.

Versions are independently assigned but release tags share a repository-wide
namespace. Never reuse or move a tag/version, including failed publication or
registration versions. First trusted DynamoDB is planned as `v0.4.3`; the separate
later D1 feature must allocate a fresh unused version, such as `0.4.4`, after rebase
and review.
registration versions. First trusted DynamoDB is now planned as `v0.4.4`; the
separate later D1 feature is planned as `0.4.5`, after rebase and its own review.

## Required configuration

Expand All @@ -46,22 +47,22 @@ export refuse before I/O and direct the owner to the protected workflow.

## DynamoDB namespace registration

After the policy PR, full gates and normal merge, the maintainer may create and
verify the signed v0.4.3 source tag without creating its GitHub release yet.
That approved immutable source guards the separate registration preparation.

A registration-only `@pegma/storage-dynamodb@0.4.2` archive contains exactly
The published registration-only `@pegma/storage-dynamodb@0.4.2` archive contains exactly
package.json, README.md and LICENSE. It has no exports/main/module/types/bin,
runtime files, scripts or dependencies of any kind. Metadata/README say that it
only registers the namespace, is not an SDK and has no OIDC provenance. Inspect
and retain its exact bytes/digests before an explicit maintainer 2FA publication
under bootstrap; never install it for a backend/host proof or describe it as the
and retain its exact bytes/digests and the maintainer's bootstrap publication
record; never install it for a backend/host proof or describe it as the
latest runtime. Inspect actual registry bytes/dist-tags afterward. No GitHub
v0.4.2 release is needed.

Then configure and verify trusted publishing and package/account restrictions.
Create the v0.4.3 GitHub release only when this configuration is complete. Never
manually publish the real `0.4.3` artifact first: immutable bytes with missing trusted
Verify trusted publishing and package/account restrictions again for the fresh
runtime candidate. After the corrected source passes full gates and merges,
create and verify its signed annotated `v0.4.4` tag on `origin/main`; create its
GitHub release only when this configuration is complete. Do not move or reuse
the signed `v0.4.3` tag; retain its release as a failed attempt.
Never manually publish the real `0.4.4` artifact
first: immutable bytes with missing trusted
provenance cannot later be repaired by a skip. Registration `0.4.2` remains immutable
and explicitly outside runtime qualification.

Expand Down Expand Up @@ -98,7 +99,7 @@ original invocation and github-hosted builder. Raw outputs and locks are retaine
outside the five-file release inventory. Decoding an attestation is not
cryptographic verification.

Old schema 1 releases and tags remain immutable. New producer code rejects their
Old schema 1 archives and signed tags remain immutable. New producer code rejects their
schema rather than guessing an origin. Recover an old release using its original
reviewed producer and retained artifacts; do not repack or rewrite historical
tags under schema 2.
Expand All @@ -110,6 +111,14 @@ Tests use real Azurite, local Miniflare D1 and Amazon DynamoDB Local with Java 2
The release workflow verifies the signed stable event identity before source
execution, then runs both Node validation lanes before preparation.

Before the npm-version checks in both preparation and publication, the workflow
downloads the official npm `11.18.0` archive into an owned temporary directory,
verifies its pinned SHA-256 and extracts it. A private launcher invokes the exact
Node executable and that archive's `bin/npm-cli.js`; the stock `bin/npm` wrapper
can instead select Node's global npm. Neither job changes the global npm
installation. The publisher still installs no package dependencies and executes
no release-tag or package-source code.

Preparation requires a clean checkout at the signed annotated tag, exact event
commit and origin/main ancestry. The selected runtime comes from that source;
ordinary workspace builds for types/tests do not become unselected release
Expand Down Expand Up @@ -158,8 +167,8 @@ Publisher validates the independently sealed original manifest, policy and
preflight receipts again. It receives only verified original archives and
publishes only selected source tar paths from a fresh private directory, with
ignore-scripts, explicit official registry and provenance. Reused packages are
never republished. Package imports and crypto tool installation remain outside
OIDC authority.
never republished. Consumer package imports and signature/provenance auditing
remain outside OIDC authority.

The verified npm tool is exactly `11.18.0`. By default, unprivileged verification
authenticates the pinned official archive digest, extracts its bounded regular
Expand All @@ -168,7 +177,7 @@ discover or execute host-bundled npm, whose legitimate extra `.bin` links are
outside the original archive. An explicit `npmCli`/`RELEASE_NPM_CLI` remains a
strict reviewed path: every file must match the verified official tree, without
links or extra files, before execution. The minimal OIDC publisher still installs
nothing and uses its separately pinned Node/npm runtime.
no package dependencies and uses the separately verified CLI described above.
Raw audit output is retained before any public consumer import, and its hashes
are checked afterward. Never let a caller-provided qualified boolean or decoded
bundle substitute for that actual cryptographic command.
Expand Down
9 changes: 6 additions & 3 deletions packages/storage-dynamodb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
Amazon DynamoDB adapter for
[`@pegma/storage-core`](https://www.npmjs.com/package/@pegma/storage-core).

Source `0.4.3` is the unpublished first trusted runtime candidate and pins
released Core `0.4.0`. Version `0.4.2` is reserved for registration-only metadata,
Source `0.4.4` is the unpublished first trusted runtime candidate and pins
released Core `0.4.0`. Version `0.4.2` was published as registration-only metadata,
with no runtime exports/scripts/dependencies; it is not this adapter or a host
dependency. Source merge and metadata registration do not establish publication,
dependency. The `v0.4.3` release attempt failed before preparation, producing no
runtime archive or publication. Its signed tag remains immutable, and the
release is retained as a failed attempt.
Source merge and metadata registration do not establish runtime publication,
registry provenance or host acceptance. See the
[release policy](https://github.com/pegma-dev/storage-core/blob/main/docs/RELEASING.md).

Expand Down
2 changes: 1 addition & 1 deletion packages/storage-dynamodb/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pegma/storage-dynamodb",
"version": "0.4.3",
"version": "0.4.4",
"description": "Amazon DynamoDB adapter for @pegma/storage-core.",
"license": "MIT",
"type": "module",
Expand Down
Loading
Loading