Skip to content

spec(031,056,058): accept npm packages without provenance while npm refuses trusted publishing - #450

Merged
bartekus merged 1 commit into
mainfrom
spec/npm-provenance-accepted
Nov 2, 2026
Merged

bartekus merged 1 commit into
mainfrom
spec/npm-provenance-accepted

Conversation

@bartekus

@bartekus bartekus commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Records the owner's 2026-11-02 decision (row A-74): accept npm packages without npm provenance while npm refuses this repository's trusted-publishing exchange (npm/cli#9969: npm's token exchange rejects GitHub's immutable OIDC subject, which the repository cannot revert). Spec text in 031, 056 and 058; ratifies on merge.

  • 031 3.9.6: provenance is no longer a condition of publication or qualification; a package is still published only as the run's verified tarball whose integrity equals the signed manifest. Section 5 row and Acceptance follow.
  • 058 R-3, 3.3.2, Acceptance: the run keeps npm trusted publishing with provenance; when npm refuses it, the owner publishes the run's verified tarballs by hand and a rerun records them present. No npm token enters the run. The closing release may be qualified by a later qualification run against its tag.
  • 056 3.3, 3.5, section 4, Acceptance: the npm step requires a verified registry signature and manifest integrity instead of provenance; a later harness from the default branch may qualify an earlier tag, reading that tag's release set, adoption subsets and toolchain pin.

Harness (056)

  • npm audit signatures --json lists only invalid and missing packages; the old check read a verified list the command does not emit, so it could never pass. The step now fails on the command's failure or on any @rustev/* package listed as invalid or missing; the manifest-integrity check is kept.
  • RUSTEV_QUALIFY_RELEASE_TREE names the released tree's checkout for the release set, adoption subsets and toolchain pin (default: the harness's own tree).

The workflow side (qualify.yml taking the harness from the default branch) is a separate PR.

Verification

  • make gate, scripts/check-authored-content.sh.
  • Local run of this harness against the published v0.3.0 (its signed manifest from the release, RUSTEV_QUALIFY_RELEASE_TREE at a v0.3.0 checkout), darwin-arm64: crates passed, npm passed, cli passed, image excluded (the manifest names no image). The other six platforms run in the workflow after both PRs merge.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

AI review (findings)

Reviewing the diff against the governance documents and the harness source.

Finding 1 — harness.py: per-package unverified check is dead code

At harness.py line ~292 the subprocess call uses check=True:

subprocess.run(['npm', 'audit', 'signatures', '--json', ...],
               env=self.env, stdout=output, stderr=self.log, check=True)

The accompanying comment (added in this PR) states: "npm audit signatures --json lists only failures; it exits nonzero on any". With check=True, a nonzero exit raises CalledProcessError before report = read(audit) is ever reached. The unverified set is therefore computed only when npm exits 0 — at which point unverified is empty — making the if name in unverified: raise ValueError(...) branch at line ~312 permanently dead for the failure scenario it was written to handle. The npm step still fails correctly (via CalledProcessError), but the stated per-package error message ('npm registry signature not verified: ' + name) is unreachable and the logic that distinguishes invalid from missing entries is never exercised.

Finding 2 — docs/decisions/00-founding-decisions.md: decision row A-73 absent

The base commit ends at A-72 (2026-10-30). This PR adds A-74 directly, leaving no A-73 row. The table is the sequential authority log for this corpus; a gap is observable in the diff and may indicate a missing or mis-numbered entry.

{"head": "f154a6ade0c396c55598e1687dcace079e0ccf14", "verdict": "findings", "findings": [{"path": "tools/rustev-release/qualify/harness.py", "line": 312, "summary": "The per-package `if name in unverified` check is dead code: subprocess.run with check=True raises CalledProcessError on npm nonzero exit before the JSON is parsed, so the ValueError for a failed registry signature is unreachable."}, {"path": "docs/decisions/00-founding-decisions.md", "line": null, "summary": "The decision log skips A-73, jumping directly from A-72 to A-74, leaving an unexplained gap in the sequential authority record."}]}

Subject: 3dc1e1c...f154a6a, diff digest a5ca839b5d1f1e69c33306c7132d53a2deec5f17499bd0c063b6c54a251b6835, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus temporarily deployed to statecraft-review-exception November 2, 2026 10:42 — with GitHub Actions Inactive
@bartekus
bartekus enabled auto-merge November 2, 2026 15:23
@bartekus
bartekus added this pull request to the merge queue Nov 2, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 2, 2026
…efuses the trusted-publishing exchange

A-74 records the owner's 2026-11-02 decision. npm/cli#9969 makes npm's
token exchange reject the repository's immutable OIDC subject, so the
release run cannot publish npm packages or attach npm provenance. The run
keeps trusted publishing; when npm refuses it, the owner publishes the
run's verified tarballs and a rerun records them present. Qualification's
npm step requires a verified registry signature and manifest integrity
instead of provenance, and a published release may be qualified by a later
run with the default branch's harness, so v0.3.0 can close 056 and 058.

The harness's provenance check read a `verified` list that
`npm audit signatures --json` does not emit; it now fails on any
`@rustev/*` package listed as invalid or missing.
@bartekus
bartekus force-pushed the spec/npm-provenance-accepted branch from f154a6a to 7f76fde Compare November 2, 2026 17:12
@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the six changed paths for concrete defects.

docs/decisions/00-founding-decisions.md (A-74 row)
The decision is self-contained and consistent with the spec amendments that follow. No issue.

specs/031-public-api-and-release-family/spec.md
Section 3.9.6 now makes provenance conditional; the invariant table at line 595 is updated from "lacks provenance → not published" to "integrity differs from signed manifest → not published". The acceptance summary (line 611) is correspondingly tightened. All three edits are mutually consistent.

specs/056-release-0-1-1-and-consumer-qualification/spec.md
The npm qualification step is changed to require a verified registry signature and integrity match rather than a verified provenance attestation. The negative-case table and the acceptance narrative are updated to match. The new prose (line 254+) allowing a later harness run to close the lifecycle is consistent with the RELEASE_TREE mechanism introduced in the harness.

specs/058-one-tagged-run-releases-the-family/spec.md
R-3 and section 3.3.2 correctly reflect the conditional-provenance policy and the owner-publish fallback. The acceptance criteria relaxation (later qualification run permitted) is consistent with 056 3.5 and A-74.

tools/rustev-release/qualify/README.md
Documentation matches the harness behaviour introduced below. No issue.

tools/rustev-release/qualify/harness.py

RELEASE_TREE default path — HERE resolves to tools/rustev-release/qualify; HERE.parents[2] is the repo root. The guard checks for tools/rustev-release/release-set.json under that root, which exists in a normal checkout. Correct.

Path rewrites — release-set.json old path was HERE.parent / 'release-set.json' = tools/rustev-release/release-set.json; new path RELEASE_TREE / 'tools/rustev-release/release-set.json' is identical when RELEASE_TREE defaults to the repo root. Same equivalence holds for rust-toolchain.toml and adoption.sh. Correct.

npm audit logic — The subprocess is called with check=True; a nonzero npm exit (which npm emits whenever any invalid or missing package exists) already raises CalledProcessError, so the unverified set is only constructed when npm exits 0. In that case npm guarantees the invalid and missing lists are empty, making the if name in unverified check defence-in-depth rather than the primary gate. The primary gate for @rustev/* packages is the integrity comparison p['integrity'] != a['integrity'], which is preserved unchanged. The PR's own note that the old verified list was never emitted by npm (so the old provenance check always raised) is corroborated by the control flow: verified = read(audit).get('verified', []) would always return [], and not any(...) over an empty list is always True, unconditionally raising the provenance error. The fix is correct.

v.get('name') can return None — None is added to unverified if an entry in invalid/missing lacks a name field, but since real package names are strings, name in unverified never matches None. Harmless.

No concrete defect found.

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

Subject: 50ca9ad...7f76fde, diff digest fdd9e163141133e7a9de1560aee16cf78cd61d23ed29180ab4a8aa3640b080af, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus added this pull request to the merge queue Nov 2, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 2, 2026
@bartekus
bartekus added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit ef6d06f Nov 2, 2026
58 of 60 checks passed
@bartekus
bartekus deleted the spec/npm-provenance-accepted branch November 2, 2026 23:51
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