Skip to content

ci(031): increment 6, the release workflow with build provenance - #163

Merged
bartekus merged 2 commits into
mainfrom
impl/031-release-workflow
Oct 22, 2026
Merged

bartekus merged 2 commits into
mainfrom
impl/031-release-workflow

Conversation

@bartekus

@bartekus bartekus commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Spec 031 increment 6: the release workflow with build provenance. Increment 5 (#162) has merged; this PR is rebased onto main.

This is a workflow change: it needs the owner's approval of the statecraft-review-exception Environment.

.github/workflows/release.yml runs only when dispatched by hand on the signed release tag (gh workflow run release.yml --ref vX.Y.Z -f tag=vX.Y.Z). It is not a required job and changes no managed file.

  • tag: refuses a tag other than the release set's, a lightweight tag, a signature that does not verify against tools/rustev-release/allowed_signers, or a dispatch on another ref.
  • bindings: spec 027's bindings workflow at the tag; supplies each platform's addon.
  • cli: rustev on the seven platforms in the bindings images at the commit's source date; --help and a plan check of the lodging reference plan that must equal its golden; archived with the license and attested.
  • pack: rustev-release manifests, the WebAssembly package built as make bindings does, each addon staged, exactly the private guard removed, the nine npm members packed in release order and attested.
  • Attestations: actions/attest-build-provenance 4.2.2, keyless Sigstore signatures over SLSA v1.0 provenance (Build Level 2, 031 3.9.5).
  • npm: publishes with npm provenance through trusted publishing (no token), only with publish-npm: true and after the owner approves the npm-publish Environment. Nothing here dispatches it, creates that Environment or the trusted publisher, or publishes.

Review findings answered

  • Round 3 (17d292e), npm job never sets NODE_AUTH_TOKEN: fixed differently. Publication is by npm trusted publishing (OIDC), which needs no token but needs npm 11.5.1 or later (Node 22 bundles npm 10). The job now installs npm 11.21.0 pinned and checks it, and no longer passes registry-url, so no .npmrc expects a token.
  • Round (ba6fed2), npm pinned by version only: fixed. The job downloads the npm 11.21.0 tarball, checks its SHA-512 against the registry integrity recorded in the workflow (sha512-Zov8...qivPg==, verified locally), and installs that file with --ignore-scripts.
  • Round (a2c5447), process.argv[1] under node -e is empty: not so. With -e there is no script path, so argv[1] is the first argument: node -e 'console.log(JSON.stringify(process.argv.slice(1)))' integrations/x prints ["integrations/x"] (Node 24.6.0; the same layout on Node 22). A comment in the step now states it.
  • Round (c697c11), the bindings call would deny id-token/attestations: not applicable. bindings.yml declares only permissions: contents: read at the top level and no job asks for more (grep -n 'id-token\|attestations' .github/workflows/bindings.yml finds nothing); upload-artifact needs no token permission. The call now states contents: read explicitly with that reason; the attestations are made in pack.

Open, recorded in 031's record

  • The CLI has no version command (spec 006), so 031 3.9.7d's version step cannot run as written.
  • macOS and Windows CLI archives use bsdtar without fixed order or times, so they are not yet reproducible (3.9.3); the Linux ones are.
  • Not yet: two-build comparison for tarballs and binaries, the npm audit (3.9.2), their SBOMs (3.9.1), and the hosted release (layer 8).

Checks

  • actionlint .github/workflows/release.yml: clean. make gate: passed. spec-spine couple: OK.
  • The workflow has not been dispatched: it needs a signed tag, and publication waits for the owner's instruction (021 3.9, 031 3.11).

@github-actions

Copy link
Copy Markdown

AI review (no-findings)

I'll review the two changed files: the new .github/workflows/release.yml and the spec increment in specs/031-public-api-and-release-family/spec.md.

Workflow structure and security

  • inputs.tag is used via an env var (TAG: ${{ inputs.tag }}) throughout the tag job's shell steps, never interpolated directly into script text. Git commands (git cat-file, git verify-tag) receive it as "refs/tags/$TAG" -- variable expansion inside double quotes, no command-substitution risk.
  • All third-party actions are pinned to full SHA digests (checkout, setup-node, attest-build-provenance, upload-artifact, download-artifact). This is correct.
  • needs.tag.outputs.commit (a 40-char hex SHA from git rev-parse) and needs.tag.outputs.version (from a jq read of the verified tag's release-set.json) are passed via env: blocks to shell steps, not inline.
  • The npm job's publication gate is enforced by a GitHub environment: npm-publish requiring explicit owner approval, consistent with spec 031 §3.11.
  • No NODE_AUTH_TOKEN is stored; OIDC trusted publishing is used with id-token: write. This is the correct pattern.

Logic and correctness

  • The pack job downloads pattern: rustev-*; CLI artifacts are named cli-{platform} and are therefore excluded, which is the intended separation.
  • The SHA256SUMS file is written in pack and re-verified in npm before publishing -- the chain is intact.
  • The core.autocrlf false git-config step correctly precedes checkout in the cli job to prevent line-ending corruption on Windows.
  • The run() function in the smoke-test step uses ${{ matrix.platform }} via template expansion (a static literal per matrix entry), not a runtime variable; no injection surface.
  • bsdtar non-reproducibility for macOS/Windows archives is acknowledged in both the workflow comment and the spec as an open item (3.9.3), not a silent defect.

Spec increment

The increment 6 description accurately matches the workflow: tag verification, bindings reuse, CLI build/archive/attest, npm pack/attest, gated publish, and the documented open items (no CLI version command, macOS/Windows archive reproducibility, missing SBOMs, hosted release manifest).

No concrete defects found.

{"head": "f9cf0d27ebb590587a3dd0005bb196e674cca48b", "verdict": "no-findings", "findings": []}

Subject: 3670e6b...f9cf0d2, diff digest 8048a5abd0fde337aa52acb7a92120b921387a81d5e882f90394edd523594c58, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception October 22, 2026 02:00 — with GitHub Actions Error
@bartekus
bartekus force-pushed the impl/031-npm-members branch from 3670e6b to 419b664 Compare October 22, 2026 02:13
@bartekus
bartekus force-pushed the impl/031-release-workflow branch from f9cf0d2 to 5f5380a Compare October 22, 2026 02:13
@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the new release workflow and the spec increment.

Workflow: .github/workflows/release.yml

  • Input handling: inputs.tag is passed to the shell only through an env: block (TAG: ${{ inputs.tag }}), never interpolated directly into the script body. All shell use is "$TAG", which is safe from injection.
  • ${{ matrix.image }} / ${{ matrix.platform }} in run: blocks: These are evaluated from a hardcoded matrix, not from user-controlled input; no injection surface.
  • Action pinning: All five actions are pinned to commit SHAs with version comments; Docker images include SHA256 digests.
  • Permissions: Top-level contents: read default; jobs that attest add only id-token: write and attestations: write; the npm job adds id-token: write for OIDC trusted publishing. No over-privileged write-all.
  • Tag verification: The tag job checks (a) GITHUB_REF matches the dispatched tag, (b) the dispatched tag matches the release-set file's tag, (c) the tag is annotated, and (d) the SSH signature verifies against allowed_signers. The checkout uses the tag ref before these checks, but checkout is not gated on them — this is the standard pre-verify-then-exit pattern; the subsequent exit 1 stops all downstream jobs.
  • concurrency.cancel-in-progress: false: Correct for a release workflow.
  • SHA256 round-trip in npm job: SHA256SUMS is written in pack, uploaded as part of the npm artifact, downloaded, and verified before publishing. Sound.
  • --ignore-scripts on npm pack: Correct hardening.
  • pack does not depend on cli: Intentional — CLI tarballs and npm packages are independent artifacts; pack downloads only the Node.js addon artifacts (matching rustev-*), not the CLI archives (cli-${{ matrix.platform }}).
  • macOS/Windows non-reproducibility and missing version command: Explicitly noted as open items in the spec increment; not a defect introduced here.

Spec: specs/031-public-api-and-release-family/spec.md

The increment 6 prose accurately describes the workflow: tag verification, bindings reuse, cli build and smoke test, pack manifest/wasm/addon/attest steps, and the gated npm job. Open items (bsdtar, version command, SBOM, digest comparison, hosted release) are faithfully listed.

No concrete defects found.

{"head": "5f5380a5c7a0893f6b851a387b35baae8e370a00", "verdict": "no-findings", "findings": []}

Subject: 419b664...5f5380a, diff digest 8048a5abd0fde337aa52acb7a92120b921387a81d5e882f90394edd523594c58, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception October 22, 2026 02:17 — with GitHub Actions Error
@bartekus
bartekus force-pushed the impl/031-npm-members branch from 419b664 to 912471d Compare October 22, 2026 02:18
@bartekus
bartekus force-pushed the impl/031-release-workflow branch from 5f5380a to 17d292e Compare October 22, 2026 02:18
@github-actions

Copy link
Copy Markdown

AI review (findings)

Reviewing the new release workflow and the spec increment 6 additions.

Workflow structure and tag validation look sound: the tag job checks $GITHUB_REF == "refs/tags/$TAG", verifies the tag is annotated, and verifies the SSH signature against allowed_signers before emitting the commit SHA. All user-supplied input (inputs.tag) flows through an env var (TAG=) before touching any shell command, avoiding script injection. All actions and Docker images are pinned to full SHA digests.

cli and pack jobs use the verified commit SHA (needs.tag.outputs.commit) for checkout, the archive is deterministic on Linux (GNU tar flags present), and both jobs emit SLSA provenance attestations. The private-guard removal is guarded with an explicit check before delete p.private.

npm job — missing NODE_AUTH_TOKEN: The setup-node step is invoked with registry-url: https://registry.npmjs.org but without a node-auth-token: input. That action writes a project-level .npmrc containing:

//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}

The job never sets NODE_AUTH_TOKEN — neither from a secret nor from an OIDC token exchange. npm publish --provenance uses the OIDC JWT for provenance attestation only; the registry still requires a bearer token for authentication. As written every npm publish call will fail with a 401/auth error. The header comment ("no registry token is stored or read here") describes an intent that is not yet realised in the workflow.

The spec text in increment 6 is consistent with the workflow's behaviour and correctly acknowledges the open items (no version command, bsdtar non-reproducibility).

{"head": "17d292e7229e1c9246564bd5f6616a2b5201e142", "verdict": "findings", "findings": [{"path": ".github/workflows/release.yml", "line": null, "summary": "The `npm` job never sets NODE_AUTH_TOKEN: setup-node with registry-url writes .npmrc expecting that variable for registry authentication, so every npm publish call will fail with an auth error."}]}

Subject: 912471d...17d292e, diff digest 8048a5abd0fde337aa52acb7a92120b921387a81d5e882f90394edd523594c58, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception October 22, 2026 02:23 — with GitHub Actions Error
@bartekus
bartekus force-pushed the impl/031-npm-members branch 3 times, most recently from 9ad8a9b to 385371a Compare October 22, 2026 03:26
@bartekus
bartekus force-pushed the impl/031-release-workflow branch from 17d292e to 0bbc6c0 Compare October 22, 2026 03:38
@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reading the diff: new .github/workflows/release.yml and an increment-6 update to specs/031-public-api-and-release-family/spec.md.

Security and correctness review of release.yml:

  • Top-level permissions are contents: read; per-job escalation to id-token: write + attestations: write is properly scoped.
  • inputs.tag is consumed only via env: TAG: and a ref: field, never interpolated directly into a bare shell expansion; shell comparisons use "$TAG".
  • The tag job enforces four independent guards: dispatch-ref == tag ref, tag == release-set file's tag, annotated tag, SSH signature against allowed_signers. This is sound.
  • All external action refs are pinned to full SHA digests.
  • The node -e '...' "$dir" invocation correctly passes $dir as process.argv[1], not via the single-quoted script body.
  • The docker run image ref comes from the hardcoded matrix, not user input.
  • sha256sum -c SHA256SUMS verification in the npm job before publication is correct.
  • wasm-bindgen and wasm-opt installs use --locked and pinned versions.
  • The alpine and bookworm image digests are shared across x64/arm64 variants of each libc flavour; for multi-arch manifest-list digests this is the correct pattern (Docker resolves the platform variant on the appropriate runner).
  • The concurrency group release-${{ inputs.tag }} with cancel-in-progress: false is appropriate.
  • The bindings call (uses: ./.github/workflows/bindings.yml, no with:) inherits the dispatch ref, which is the intended behaviour per the inline comment and the spec ("the workflow and spec 027's bindings workflow it calls are the tag's own files").
  • The bsdtar reproducibility caveat and the absent CLI version-command step are correctly acknowledged as open items in both the workflow and the spec increment.
  • Spec text is consistent with the implementation on version strings, action versions, npm version, Environment name, and what is explicitly deferred.

No concrete defects found.

{"head": "0bbc6c0fdf91d6dfe88c1ee3cae6887aa6489c5b", "verdict": "no-findings", "findings": []}

Subject: 385371a...0bbc6c0, diff digest b2ce8acaf8d0219ebe59d943bbaa01a41226b87055622c3030f21b4a8d1fd63d, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception October 22, 2026 03:41 — with GitHub Actions Error
@bartekus
bartekus force-pushed the impl/031-npm-members branch 2 times, most recently from 9a461fe to e299fa3 Compare October 22, 2026 04:02
@bartekus
bartekus force-pushed the impl/031-release-workflow branch from 0bbc6c0 to b346e93 Compare October 22, 2026 04:08
@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the PR: a new release workflow (.github/workflows/release.yml) and the corresponding spec 031 increment-6 text.

Governance check

AGENTS.md states any change under .github/workflows/ needs the owner's approval of the statecraft-review-exception Environment once. The spec correctly labels this a non-managed workflow owned by spec 031 (§3.12); enforcement of the exception gate is handled by CI, not this review.

Workflow security

  • All external actions are pinned by SHA digest (actions/checkout, actions/setup-node, actions/attest-build-provenance, actions/upload-artifact, actions/download-artifact). Good.
  • inputs.tag (the only user-controlled dispatch input) is passed via env: TAG: in every shell step, never interpolated into script text. Injection-safe.
  • Tag verification gates all subsequent work: ref equality, annotated-tag check, SSH-signature verification against allowed_signers, and equality with the committed release-set tag — before any output is produced.
  • Downstream jobs (cli, pack, npm) check out at needs.tag.outputs.commit (a git-resolved, GPG-verified commit hash), not at the raw string input.
  • Docker images in the cli matrix are pinned by SHA digest in the YAML, so ${{ matrix.image }} in the shell is safe.
  • The node -e in pack receives $dir as process.argv[1], not interpolated into the script string; the JS reads and modifies package.json without eval of external content.
  • sha256sum -c SHA256SUMS in npm verifies tarballs before npm publish. The npm job uses OIDC trusted publishing; no token is stored or expected in .npmrc.
  • Job-level permissions are correctly scoped: top-level contents: read; cli and pack add id-token: write and attestations: write only where needed; npm adds only id-token: write.
  • CLI artifact names (cli-$platform) and addon artifact names (rustev-$platform) are disjoint, so the pattern: rustev-* download in pack captures only bindings addons.

Spec text

The increment-6 description accurately reflects the workflow structure and honestly records the open items (no version command, non-reproducible macOS/Windows archives, unimplemented 3.9.1/3.9.2/3.9.3 items, no npm-publish Environment configured yet).

No concrete defect found.

{"head": "b346e93343f4feaf8c61129ebf9dd4925ca54a0e", "verdict": "no-findings", "findings": []}

Subject: e299fa3...b346e93, diff digest b2ce8acaf8d0219ebe59d943bbaa01a41226b87055622c3030f21b4a8d1fd63d, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception October 22, 2026 04:11 — with GitHub Actions Error
@bartekus
bartekus force-pushed the impl/031-npm-members branch from e299fa3 to d703970 Compare October 22, 2026 06:02
@bartekus
bartekus force-pushed the impl/031-release-workflow branch from b346e93 to 412ea99 Compare October 22, 2026 06:06
@github-actions

Copy link
Copy Markdown

AI review (findings)

Reading the diff: a new release workflow (.github/workflows/release.yml) and the corresponding spec increment for 031.

Governance note checked: AGENTS.md says any change under .github/workflows/ needs the owner's approval of the statecraft-review-exception Environment once; that approval is enforced externally and I cannot verify its status, so I do not report it as a finding.

Security review of the workflow:

  • Top-level permissions are contents: read, elevated per-job only where needed. Good.
  • inputs.tag is never interpolated directly into a run shell script; it flows through the TAG env var. Safe.
  • All action references are pinned to commit SHAs. Good.
  • set -eu in every run block. Good.
  • publish-npm defaults to false; the npm job is behind the npm-publish Environment gate. Good.
  • sha256sum -c SHA256SUMS integrity check before publishing. Good.
  • node -e '...' "$dir" passes dir as argv[1], not interpolated into the script body. Safe.

Concrete defect found:

In the tag job (line ~71), the SSH allowed-signers file is read from the commit the user-supplied tag points to:

git -c gpg.format=ssh \
    -c gpg.ssh.allowedSignersFile=tools/rustev-release/allowed_signers \
    verify-tag "refs/tags/$TAG"

The checkout immediately above this (line ~52) places the tag's own tree on disk. A repository collaborator with write access can therefore push a commit that adds their own SSH public key to tools/rustev-release/allowed_signers, tag that commit with their own key, and dispatch the workflow — the verify-tag call will succeed because the signers file it reads was supplied by the very commit being validated. The release owner's exclusive authority to authorize a publication (spec 031 §3.11, spec 021 §3.9) is undermined: anyone who can push commits and tags can self-authorize a release by manipulating the signers list in the same commit.

The allowed_signers file should be read from a trusted reference that is independent of the commit being validated (e.g., from HEAD of the protected default branch, or pinned separately outside the repository tree), not from the checked-out tag commit.

{"head": "412ea99fa9e5459a46017ab0e21beb6712c24db2", "verdict": "findings", "findings": [{"path": ".github/workflows/release.yml", "line": 71, "summary": "The SSH allowed_signers file used to verify the release tag is read from the same commit the tag points to, so a collaborator with push access can add their own key to that file, sign a commit with it, and bypass the owner-exclusive release authorization gate."}]}

Subject: d703970...412ea99, diff digest b2ce8acaf8d0219ebe59d943bbaa01a41226b87055622c3030f21b4a8d1fd63d, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception October 22, 2026 06:10 — with GitHub Actions Error
@bartekus
bartekus force-pushed the impl/031-npm-members branch from d703970 to 7c4ea89 Compare October 22, 2026 06:32
@bartekus
bartekus force-pushed the impl/031-release-workflow branch from 412ea99 to ba6fed2 Compare October 22, 2026 06:35
@github-actions

Copy link
Copy Markdown

AI review (findings)

Reading through the diff: a new release workflow is introduced (.github/workflows/release.yml) and spec 031 gains an increment 6 describing it.

Workflow structure and security review:

  • Tag verification is correct: annotated-tag check, SSH signature against tools/rustev-release/allowed_signers, ref equality, and release-set tag match all run before any build work.
  • inputs.tag is passed to the shell only via env: (as $TAG), never interpolated directly into a run: script — safe pattern.
  • matrix.image is hardcoded in the workflow matrix, not derived from user input.
  • Cargo toolchain installs use --locked, binding to Cargo.lock for reproducibility and integrity.
  • The node -e '...' "$dir" pattern passes $dir as process.argv[1], not via shell string interpolation — safe.
  • SLSA attestation, checksum verification on publication (sha256sum -c SHA256SUMS), and environment gate for publication are all present and correctly wired.

Concrete defect found:

In the npm job, npm itself is installed by version string only:

npm install -g [email protected]
test "$(npm --version)" = 11.21.0

The version check afterward runs the binary it just installed, so it cannot detect a version substitution attack at the registry level. By contrast, every cargo install in this same workflow uses --locked, and container images are pinned by SHA256 digest. In a release workflow that then uses npm publish --provenance, a tampered npm binary is a meaningful supply chain exposure. The spec describes this as "npm 11.21.0 pinned" but the pinning is by mutable version tag, not by content hash.

{"head": "ba6fed2fc3d033ba93c43c1c11ea5f0181066cc8", "verdict": "findings", "findings": [{"path": ".github/workflows/release.yml", "line": 248, "summary": "npm is installed pinned by version string only (npm install -g [email protected]), not by content hash; the post-install version check cannot detect a registry-side substitution, unlike the cargo --locked and digest-pinned container images used elsewhere in the same workflow."}]}

Subject: 7c4ea89...ba6fed2, diff digest b2ce8acaf8d0219ebe59d943bbaa01a41226b87055622c3030f21b4a8d1fd63d, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception October 22, 2026 06:38 — with GitHub Actions Error
@bartekus
bartekus force-pushed the impl/031-release-workflow branch from ba6fed2 to a2c5447 Compare October 22, 2026 06:39
@github-actions

Copy link
Copy Markdown

AI review (findings)

Reviewing the new release workflow and the spec increment carefully.

Workflow structure and security checks: The tag job correctly enforces GITHUB_REF == refs/tags/$TAG before proceeding, uses git verify-tag against a known signers file, checks the tag is annotated, and that the dispatched tag matches the release-set file. All action and Docker image references are pinned by SHA. The npm tarball is integrity-checked before installation. The npm-publish Environment gate for publication is correct. The --ignore-scripts flag on npm pack and the npm install are appropriate. The pack and npm jobs check out at the verified commit SHA from needs.tag.outputs.commit, not at a mutable tag name.

Concrete defect — process.argv[1] in the node -e invocation

In the pack job's "Stage each addon" step, the inline Node.js script is invoked as:

node -e '
  const fs = require("fs"); const f = process.argv[1] + "/package.json";
  ...
' "$dir"

When Node.js is started with -e 'code', process.argv[1] is set to the empty string '' (since there is no script file; this is documented behaviour in Node.js v12+ and confirmed for Node 22). The user-supplied argument $dir lands at process.argv[2]. As a result, f is computed as '' + "/package.json" = "/package.json". The subsequent fs.readFileSync("/package.json", "utf8") will throw ENOENT, causing every iteration of the loop to fail and the entire pack job to error out. The fix is to use process.argv[2].

No other concrete defects were found. The governance requirement that .github/workflows/ changes need the statecraft-review-exception Environment approval is enforced outside this review per the governance instructions.

{"head": "a2c54475359c0568ec9d3757eafcc17293c5f7ea", "verdict": "findings", "findings": [{"path": ".github/workflows/release.yml", "line": 224, "summary": "The node -e script reads process.argv[1] to get the directory argument, but Node.js sets process.argv[1] to the empty string when using -e; the user-supplied \"$dir\" argument is at process.argv[2], so f becomes \"/package.json\" and the readFileSync call throws ENOENT, failing every pack iteration."}]}

Subject: 7c4ea89...a2c5447, diff digest 9d2c263c2c49689012ed92afa2e34870522989fa489db0b97196b946d968938e, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception October 22, 2026 06:45 — with GitHub Actions Error
@bartekus
bartekus force-pushed the impl/031-release-workflow branch from a2c5447 to a50c0ec Compare October 22, 2026 06:46
@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the new release workflow and spec increment for correctness and security.

.github/workflows/release.yml - security analysis:

  1. Shell injection / input handling: The inputs.tag value is used exclusively via an env: block (TAG: ${{ inputs.tag }}), and all downstream shell references use $TAG. This correctly avoids template-expansion injection into script text.

  2. matrix.image interpolation: ${{ matrix.image }} is directly expanded into the run script (lines ~138, ~157). The values come from the workflow's own hardcoded matrix.include, not from user input, so there is no injection path. Not a security defect.

  3. Tag verification order: The tag job checks (a) dispatched ref matches refs/tags/$TAG, (b) release-set file's tag matches, (c) annotated tag (not lightweight), (d) SSH signature against allowed_signers — all before emitting commit to downstream jobs. Sound.

  4. npm tarball integrity check: sha512-$(openssl dgst -sha512 -binary ... | base64 -w0) is compared to a pinned SRI value before installation. base64 -w0 is GNU coreutils; the step runs on ubuntu-24.04, so this is correct. The encoded length (88 chars, decoding to 64 bytes) is consistent with SHA-512.

  5. npm publish / OIDC: id-token: write is granted, no registry-url in setup-node (so no .npmrc token expectation), npm publish --provenance is the correct invocation for npm trusted publishing. Correct.

  6. Artifact download pattern: The pack job downloads rustev-* artifacts (the Node addons from bindings). CLI artifacts are named cli-$platform and are intentionally not matched — they exist for manual download only. Correct.

  7. SHA256SUMS round-trip: Created in pack (sha256sum ./*.tgz > SHA256SUMS, relative paths) and verified in npm (sha256sum -c SHA256SUMS) within the same directory. Correct.

  8. set -eu coverage: Present in all non-trivial shell scripts.

  9. Action pinning: All actions pinned to full commit SHAs with version comments. Correct.

specs/031-public-api-and-release-family/spec.md - accuracy check:

The Increment 6 description accurately reflects the workflow structure, including the gating via the npm-publish Environment, the SLSA Build Level 2 attestation, the npm 11.21.0 integrity pin, the non-reproducibility caveat for macOS/Windows archives (bsdtar), the absent version command, and that nothing in this increment configures or dispatches the publish path.

No concrete defects found.

{"head": "a50c0eccb0d8b544ddbfafb466fd846118172a56", "verdict": "no-findings", "findings": []}

Subject: 7c4ea89...a50c0ec, diff digest 08bcd5a4c809fbb9fb041a8d1969c2c682506b6639f266b949904eb4ba5de5a5, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception October 22, 2026 06:51 — with GitHub Actions Error
Base automatically changed from impl/031-npm-members to main October 22, 2026 07:15
@bartekus
bartekus force-pushed the impl/031-release-workflow branch from a50c0ec to da662c2 Compare October 22, 2026 07:17
@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the two changed paths: a new .github/workflows/release.yml and an update to specs/031-public-api-and-release-family/spec.md.

Workflow security and correctness

  • inputs.tag is always passed through env: (TAG: ${{ inputs.tag }}) before reaching the shell, never interpolated directly into a run: script — no injection risk.
  • The tag job enforces four hard checks before any subsequent job runs: dispatch must be on refs/tags/$TAG, the tag must equal the release-set file's tag, it must be annotated, and the SSH signature must verify against allowed_signers. Order and completeness look correct.
  • Subsequent jobs check out at needs.tag.outputs.commit (the resolved commit hash), not the symbolic tag ref — correct practice.
  • The npm integrity check (sha512-$(openssl dgst -sha512 -binary | base64 -w0)) matches the SRI format of NPM_INTEGRITY. The base64 -w0 flag is only used on the Ubuntu runner where it is supported.
  • permissions: contents: read at the top level is minimal; jobs that attest declare id-token: write and attestations: write locally — good hygiene.
  • The npm-publish environment gate protects the publish step; no registry token is stored or written to .npmrc.
  • Same Docker image digests for x64 and arm64 Linux runners is correct: these are manifest-list digests, and Docker resolves the platform-specific layer from them automatically.
  • pack does not depend on cli and downloads only the binding addons (pattern: rustev-*) from the bindings reusable workflow call. The CLI tarballs (cli-*) are uploaded independently and are not consumed by pack. The artifact naming is consistent.
  • The inline node -e script uses process.argv[1] for the directory path (a separate positional argument, not interpolated into the script); no injection path exists.
  • Open items (bsdtar non-reproducibility on macOS/Windows, missing version command, wasm SOURCE_DATE_EPOCH) are honestly documented in both the spec text and the workflow comments and are not bugs.

Spec text

The prose in specs/031-public-api-and-release-family/spec.md accurately describes the workflow: platform count, gate conditions, attest action version (4.2.2), npm version pin (11.21.0), and the npm-publish Environment requirement all match the YAML. The open items listed in the spec match what is visibly deferred in the workflow. No contradiction found.

{"head": "da662c23c3b0c76c30aeb7095819f924f366637f", "verdict": "no-findings", "findings": []}

Subject: 6060167...da662c2, diff digest 08bcd5a4c809fbb9fb041a8d1969c2c682506b6639f266b949904eb4ba5de5a5, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception October 22, 2026 07:21 — with GitHub Actions Error
@bartekus
bartekus had a problem deploying to statecraft-review-exception October 22, 2026 07:54 — with GitHub Actions Error
@bartekus
bartekus force-pushed the impl/031-release-workflow branch from da662c2 to c697c11 Compare October 22, 2026 07:58
@github-actions

Copy link
Copy Markdown

AI review (findings)

Looking at this PR, which adds .github/workflows/release.yml and documents the release workflow in spec 031.

Security and correctness pass on .github/workflows/release.yml:

  • Tag verification in the tag job is solid: checks GITHUB_REF matches the dispatched tag, verifies it is annotated (not lightweight), verifies the SSH signature against allowed_signers, and confirms it matches the release-set file's tag.
  • All external actions are pinned to full commit SHAs.
  • inputs.tag is correctly passed via env: rather than inlined into shell syntax, preventing injection.
  • npm tarball integrity check using openssl dgst -sha512 | base64 is correct for the ubuntu-24.04 runner (where -w0 is supported).
  • SOURCE_DATE_EPOCH is set for CLI builds on both Linux (via Docker -e) and macOS/Windows (via shell assignment).
  • SHA256SUMS is created in pack and verified in npm before publishing.
  • concurrency: cancel-in-progress: false is correct for a release workflow.

Finding:

The bindings job calls .github/workflows/bindings.yml as a reusable workflow:

bindings:
  name: bindings
  needs: tag
  uses: ./.github/workflows/bindings.yml

No job-level permissions: key is present, so the called workflow is constrained by the release workflow's top-level permissions: contents: read. GitHub Actions caps a called reusable workflow's permissions at those the caller grants. If bindings.yml (the existing standalone CI workflow for spec 027) declares id-token: write or attestations: write in any of its jobs — as is common for a workflow that builds platform addons and could produce signed artifacts — those permissions will be denied and the corresponding steps will fail. The pack job's artifact download (pattern: rustev-*) depends on the bindings workflow successfully uploading its addon artifacts; a mid-run permission failure in the called workflow would silently break the downstream pack step. The fix is to add a job-level permissions: block to the bindings job granting at minimum id-token: write and attestations: write, consistent with the permissions already granted to cli and pack.

Spec text:

The spec increment 6 description is internally consistent with the workflow. The open items (no CLI version command, non-reproducible bsdtar archives, missing SBOMs, undeployed npm-publish Environment) are honestly documented.

{"head": "c697c1109406dacf6e6fbabda7545ab7dbe32f67", "verdict": "findings", "findings": [{"path": ".github/workflows/release.yml", "line": 107, "summary": "The `bindings` job calls bindings.yml as a reusable workflow with no job-level permissions override, leaving it constrained to the top-level `contents: read`; if bindings.yml's jobs declare `id-token: write` or `attestations: write` (as expected for a workflow that produces signed platform addons), those permissions are denied at runtime and addon artifact uploads would fail, breaking the downstream `pack` job."}]}

Subject: 21a00fc...c697c11, diff digest 08bcd5a4c809fbb9fb041a8d1969c2c682506b6639f266b949904eb4ba5de5a5, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus had a problem deploying to statecraft-review-exception October 22, 2026 08:04 — with GitHub Actions Error
.github/workflows/release.yml runs only when dispatched by hand on the
signed release tag. It verifies the tag against the release set and the
allowed signers, runs spec 027's bindings workflow at the tag, builds and
smoke tests the rustev CLI on the seven platforms, packs the nine npm
members with exactly their private guard removed, and attests every
archive and tarball with SLSA v1.0 build provenance (Build Level 2). The
npm job publishes with npm provenance through trusted publishing only
when dispatched with publish-npm and after the owner approves the
npm-publish Environment. Nothing is dispatched, configured or published.
@bartekus
bartekus force-pushed the impl/031-release-workflow branch from c697c11 to fd17f50 Compare October 22, 2026 08:05
@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the new .github/workflows/release.yml and the accompanying spec update.

Workflow security model

  • Top-level permissions: contents: read with job-level escalation only where needed (id-token: write and attestations: write for CLI and pack). The npm publish job uses id-token: write for OIDC trusted publishing — no stored token.
  • All uses: actions are pinned by commit SHA with version comments; Docker images are pinned by digest.
  • workflow_dispatch inputs are referenced via env vars (TAG: ${{ inputs.tag }}) before being consumed in shell, avoiding direct injection into commands.

Tag verification chain

The tag job checks: annotated tag, matches release-set, SSH signature verifies against allowed_signers, dispatch ref equals refs/tags/$TAG. Subsequent jobs use needs.tag.outputs.commit (a git SHA from rev-parse) for checkout, so they're not re-trusting the raw input string. bindings inherits the dispatch ref implicitly; it needs: tag so it only runs after verification succeeds.

Pack / npm steps

  • node -e '...' "$dir": the script is a single-quoted literal; $dir is passed as process.argv[1], not interpolated — no shell injection.
  • jq -r '.npm[].name' ... | while read -r name; do ... file="dist/npm/$(printf %s "$name" | sed ...)-$VERSION.tgz" — $name comes from a committed JSON file; the sed pipeline is correct for npm's scoped-package tarball naming.
  • sha256sum -c SHA256SUMS in npm verifies the downloaded artifact before publishing, catching accidental corruption.
  • npm 11.21.0 tarball pinned by SRI integrity (sha512-<88-char base64>) and verified with openssl dgst -sha512 -binary | base64 -w0. Format and encoding are correct for Ubuntu-only execution.

Known limitations (documented)

macOS/Windows archives use bsdtar without --sort or --mtime, so they are not yet reproducible; the CLI has no version command; SBOMs and hosted release layer are absent. All are recorded as open items in both the workflow header and the spec increment text.

Spec update

Increment 6 accurately describes the workflow behaviour and open items. The long run-on sentence in the spec paragraph is a readability issue but not a defect.

No concrete defect found.

{"head": "fd17f501142d8dc30bf927f2420d2882d6beb01d", "verdict": "no-findings", "findings": []}

Subject: 21a00fc...fd17f50, diff digest d162f17c8fe7f888fed62bbbe45c0d8be73ed2df42465344e59fd26eb34e6090, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus temporarily deployed to statecraft-review-exception October 22, 2026 08:09 — with GitHub Actions Inactive
@bartekus
bartekus enabled auto-merge (squash) October 22, 2026 15:05
@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the new .github/workflows/release.yml and the spec update.

Actions pinning: All five action references are pinned by SHA digest with version comments. No issues.

Input handling: The tag input is passed to shell through an env: block (TAG: ${{ inputs.tag }}), never interpolated inline into the script. No injection risk.

Tag verification: The tag job enforces: (1) GITHUB_REF must equal refs/tags/$TAG, (2) the dispatched tag must match the release-set's .tag, (3) the tag must be annotated, and (4) the SSH signature must verify against tools/rustev-release/allowed_signers. Checkout uses the verified commit SHA in downstream jobs, avoiding tag-name races.

npm integrity check: openssl dgst -sha512 -binary | base64 -w0 runs on ubuntu-24.04 (GNU coreutils), so -w0 is valid. The SRI format sha512-<base64> matches the npm registry integrity format. SHA-512 of 64 bytes encodes to 88 base64 chars with two padding =, which the stored value ...Pg== satisfies.

Permissions: Top-level permissions are contents: read; id-token: write and attestations: write are declared only in the cli, pack, and npm jobs that need them. The bindings reusable workflow call correctly limits to contents: read.

Artifact download in pack: pattern: rustev-* targets bindings artifacts; cli artifacts are named cli-<platform>, so there is no overlap. The sha256sum -c SHA256SUMS check in the npm job re-verifies the packed tarballs before publishing.

bsdtar non-reproducibility: The workflow explicitly branches on GNU tar vs bsdtar, and the spec text (line ~808, "stays open") matches: macOS and Windows archives are noted as not yet reproducible. Consistent.

node -e invocation: $dir is passed as process.argv[1], not interpolated into the script string; no injection path.

npm publish --access public: Correct for scoped packages that default to private.

Spec consistency: The increment 6 description in the spec accurately reflects the workflow's structure, the actions/attest-build-provenance version (4.2.2), the npm version (11.21.0), and the open items.

No concrete defects found.

{"head": "3daac4ddbe71a0dfeadf4d9553390870574be75d", "verdict": "no-findings", "findings": []}

Subject: c25ae7d...3daac4d, diff digest d162f17c8fe7f888fed62bbbe45c0d8be73ed2df42465344e59fd26eb34e6090, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus temporarily deployed to statecraft-review-exception October 22, 2026 15:24 — with GitHub Actions Inactive
@bartekus
bartekus disabled auto-merge October 22, 2026 16:29
@bartekus
bartekus enabled auto-merge (squash) October 22, 2026 16:31
@bartekus
bartekus merged commit ed1d191 into main Oct 22, 2026
26 checks passed
@bartekus
bartekus deleted the impl/031-release-workflow branch October 22, 2026 16:42

This branch was previously deployed

1 inactive deployment
statecraft-review-exception — 3daac4dd Deployed Oct 22, 2026 by bartekus via review-exception #1157
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant