Refuse to publish without provenance, and gate every publish path against regression
DEFECT
After three failed provenance publish attempts the release step called npm publish without --provenance and reported success. The only signal was a GitHub warning annotation. A transient registry failure therefore downgrades the package's supply-chain attestation permanently for that version, and consumers cannot tell an unattested publish caused by a 404 storm apart from one that never had provenance at all.
The fallback was added while the registry was returning 404s, to get a release out. That trade is wrong for a supply-chain artifact: an unattested publish is not a degraded success, it is a different artifact. Failing the job leaves main holding the prepared version so the next run resumes the same release rather than inventing another one, which is exactly what the surrounding transaction was designed to do.
Non-vacuity proof
Test A (restore fallback): exit 1
FAIL - .github/workflows/release.yml: a publish invocation does not enable --provenance, so it would publish an unattested artifact: npm publish --access public --ignore-scripts
verify-release-publish-attestation: 1 failure(s).
Test B (--provenance=false): exit 1
FAIL - .github/workflows/release.yml: a publish invocation does not enable --provenance, so it would publish an unattested artifact: npm publish --access public --provenance=false --ignore-scripts
verify-release-publish-attestation: 1 failure(s).
Test C (clean tree): exit 0
ok - .github/workflows/release.yml: 1 publish invocation(s), each carrying --provenance
verify-release-publish-attestation: every publish invocation is attested.
Gate table
| gate | result |
|---|---|
| typecheck | 0 |
| coverage | 92.57 / 82.89 / 91.75 (thresholds: 88 / 79 / 89) |
| verify:release-publish-attestation | 0 |
pm item
https://github.com/unbraind/pm-github/blob/main/.agents/pm/issues/pm-github-i5b8.toon
Summary by Sourcery
Require provenance for every publish path, safely reconcile only attested registry artifacts, and gate CI and release checks against attestation regressions.
New Features:
- Add a repository-wide verifier that requires every npm publish path to enable provenance and rejects unsupported or disabled attestation forms.
- Extend publish-path analysis to cover workflow commands, package scripts, executable files, shell wrappers, substitutions, runners, variables, redirections, and YAML command forms.
Bug Fixes:
- Prevent failed provenance publishes from falling back to unattested publication and refuse to reconcile registry versions without visible attestations.
- Retry registry reconciliation for late-arriving attestations and fail safely when an occupied version remains unattested.
- Restore release changelog options and update the changelog dependency to handle the full tracker output.
Enhancements:
- Centralize shell command scanning and executable-entry-point detection with fixture-backed coverage for regression-prone publish paths.
Build:
- Add the attestation verifier to release checks and package scripts; update the lockfile and pm-changelog dependency.
CI:
- Run the publish-attestation verification in CI.
Tests:
- Add comprehensive tests proving attested and unattested publish paths, shell bypasses, runner variants, registry-safe reconciliation behavior, and non-vacuous failure reporting.
Chores:
- Repair and normalize PM tracker issue metadata, duplicate links, history records, and provenance corrections.
Summary by cubic
Refuses to publish without provenance so a transient registry failure can no longer permanently downgrade a release to an unattested artifact, and gates every publish path against regression. Closes pm-github-i5b8, pm-github-1rik, and pm-github-nwaz.
Bug Fixes
- After three failed provenance attempts the release job polls the registry five times at 30s intervals and reconciles a late-landing version only when it carries an attestation; an occupied coordinate without one fails the release.
- Reconcile reads never terminate the step, so transient attestation lag is retried instead of leaving npm ahead of git; a failed release leaves main holding the prepared version so a re-run resumes the same release.
- Restores
release.ymlfrom an earlier overwrite withpm-slack's workflow, recovering this package's--item-url-baseand--date-from-versioninvocations. - Bumps the
pm-changelogpin to^2026.8.22so the changelog step stops failing once the tracker outgrows the older version's output budget (pm-github-ypi5). - Repairs corrupted
pmtracker metadata: malformed files and tests rows now carry full scoped fields, duplicate items are linked to their canonical records, a false non-vacuity record is corrected, history provenance is normalized, and PR 57 verification evidence is recorded.
New Features
scripts/verify-release-publish-attestation.tsgates every publish invocation in tracked workflows andpackage.jsonscripts, failing unless it carries--provenanceand rejecting the--provenance=falseand--no-provenancespellings.- The audit tokenises shell text like a shell, so shell-embedded (
eval,sh -c,bash -ec) and runner-spelled (npx,bunx,pnpx,pnpm dlx,yarn dlx,npm exec,bun x) publishes are judged as real commands instead of vanishing from the scan (pm-github-5igz). - Scalar expansion only inlines plain literals so variable-held commands are still caught without breaking the scan on substitution-bearing values; four more bypass shapes are closed — a YAML
run:key carrying the command, a quoted parenthesis inside a substitution, a trailing-backslash script that lent its--provenanceto the next publish, andworkspaceno longer counted as an npm subcommand runner — and a splitevalpayload is proven not to be a bypass. - The shared scanner and main-invocation guard carry their own fixture suite, the gate runs in CI and as part of
release:check, and every bypass shape is revert-checked against the tests.
Added 2026-08-28 — release unblock, two gate bypasses, and tracker repairs
The release was failing before it could publish
Generate changelog and release notes exited non-zero with pm list-all --json answer was incomplete and was refused: truncated=true; has_more=true; count=5 of total=86. The lockfile resolved pm-changelog 2026.8.17, which reads the whole tracker without the unbounded output controls 2026.8.22 added, and npx prefers that locked copy over the registry. At 89 items this tracker crosses the default output budget, the read truncated, and pm-changelog correctly refused to build a changelog from a partial workspace. The refusal is right; the stale pin is the defect. Both of the workflow's own invocations now exit 0 against the full tracker.
Two bypasses of one class in the attestation gate
Both let an unrecognised publish through, which is worse than an unflagged one: nothing in the output says anything went unexamined, and the non-vacuity guard is satisfied by the workflow's ordinary attested publish, so the gate reports clean.
| spelling | before | after |
|---|---|---|
npx npm publish (and bunx, pnpx, pnpm dlx, yarn dlx, npm exec, bun x) | not recognised as a publish at all | judged like any other publish |
bash -ec "npm publish …" (and bash -euc, sh -ec) | string never inspected | string inspected |
Both fixes are proven non-vacuous by reverting them and watching the new cases fail (2 of 32 each time).
Tracker repairs
filesrows declared{path,scope}while carrying three comma-separated values, sopathheld a string that cannot be a path;testsrows did the same tocommand. All three affected items now declarefiles{path,scope,note}andtests{command,scope,timeout_seconds}.pm-github-nwaz,pm-github-1rikandpm-github-i5b8are duplicates of one another (exact_title, score 1.0), now linked withduplicate_of: pm-github-i5b8.pm-github-1rikrecorded its non-vacuity proof asexit 0for the two cases that must fail — a proof asserting its own vacuity. Re-measured here: clean tree exits 0, restoring the fallback exits 1 naming the unattested invocation, restoring the file exits 0. A correction is appended to that item.
PM items
- pm-github-ypi5 — the stale
pm-changelogpin blocking the release - pm-github-5igz — publishes invisible to the attestation gate
- pm-github-i5b8 — canonical record for the unattested-fallback removal
Gates on this branch
build, typecheck, check, docstring, verify:release-publish-attestation, privacy, changelog:check, npm test (32 attestation cases, 323 total), coverage, and pm health --strict-exit run with the pinned ./node_modules/.bin/pm — all pass.