Skip to content

fix(release): make the npm publish loop re-dispatchable - #212

Merged
oskarhane merged 1 commit into
mainfrom
fix/npm-publish-skip-arm
Nov 11, 2026
Merged

oskarhane merged 1 commit into
mainfrom
fix/npm-publish-skip-arm

Conversation

@oskarhane

Copy link
Copy Markdown
Contributor

Summary

Fix: the npm-publish action's loop failed the whole job on the first
already-published tarball, so an interrupted npm leg could never be
re-dispatched — the runbook's recovery note said to finish the remaining
tarballs manually. The loop now skips a tarball the registry rejects as a
republish, the same arm the crates.io loop carries (#189). This is what
strands @relate/relate 1.0.0 today: in publish run 43094992373 the
platform's job-completion lag closed the run before the queued npm-main
job ran, and a plain re-dispatch would have E403'd on the six published
tarballs and failed again.

Changes

  • npm-publish/action.yml: each npm publish attempt is captured —
    success prints npm's output; a republish rejection
    (cannot publish over / EPUBLISHCONFLICT, case-insensitive)
    logs a per-tarball skip and continues; anything else prints the
    captured output and fails closed. The pattern is deliberately
    narrow to the republish wording: an auth 403 shares the error code
    but not the message, and must still fail the job
  • docs/PUBLISHING.md: the "re-running hits E403 — publish the
    remaining tarballs manually" note replaced with the re-dispatch
    recipe

Verification

  • The action's real run block (extracted from the YAML) exercised
    against a stubbed npm: all-already-published → 3 skips, exit 0;
    mixed → 2 skips + 1 publish, exit 0; auth 403 (same E403 code,
    different message) → exit 1 with the registry's message preserved;
    the expected-count check still fails closed unchanged
  • action.yml parses; bash -n clean on the extracted script
  • Oplane threat model on the diff: 2 requirements (narrow skip
    pattern / no sensitive data in logged output), both graded
    IMPLEMENTED with per-case file:line evidence
  • Re-dispatch of the npm leg after merge — platform+wasm skips its
    six published tarballs, npm-main publishes @relate/relate 1.0.0

This description was auto generated.

@github-actions

Copy link
Copy Markdown

Stellar review: no review-relevant changes (docs/CI-only diff). ✅

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Rust review: no rust-relevant changes (no Rust files modified). ✅

# the message, and it must still fail closed.
if out="$(npm publish "./$tgz" "${args[@]}" 2>&1)"; then
printf '%s\n' "$out"
elif printf '%s\n' "$out" | grep -qiE 'cannot publish over|EPUBLISHCONFLICT'; then

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Low] Integrity: the conflict-skip accepts whatever copy of that version is already on the registry — it never checks that copy matches the tarball the job just attestation-verified.

Why this matters: EPUBLISHCONFLICT / "cannot publish over" only proves a version number exists, not that it is this artifact; a party able to publish to the scope (compromised maintainer token) gets its version kept live while the release reports success and no post-publish npm view check exists to notice.

Suggested fix: on the skip arm, compare the local tarball's sha512 against the registry's dist.integrity (e.g. npm view "<name>@<version>" dist.integrity) and fail closed on mismatch.

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Security review (security-review skill)

The skill reviewed the composite npm-publish action and the publishing doc change: the publish loop now captures npm output and skips tarballs whose version the registry rejects as already published, so an interrupted release can be re-dispatched. No secrets, credentials, auth changes, new dependencies, or new input surfaces are introduced; the change is confined to the release pipeline and still fails closed on unexpected errors. One low-severity release-integrity gap is noted inline: the skip trusts the registry's existing artifact without comparing it to the locally verified tarball.

  • Low — .github/actions/npm-publish/action.yml:109: version-exists skip accepts registry bytes without an integrity comparison against the verified tarball (1 finding)

Security review: ✅ no issues found

@oskarhane
oskarhane marked this pull request as ready for review November 11, 2026 21:10
@oplane-bot

oplane-bot Bot commented Nov 11, 2026

Copy link
Copy Markdown

Oplane Security Review

Oplane reviewed this PR and did not identify any security requirements that need attention. Review the generated threat model.


Change comment settings · Set up Oplane in your agent · Workflow guidance

if out="$(npm publish "./$tgz" "${args[@]}" 2>&1)"; then
printf '%s\n' "$out"
elif printf '%s\n' "$out" | grep -qiE 'cannot publish over|EPUBLISHCONFLICT'; then
echo "$(basename "$tgz"): version already on the registry — skipping"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Low] Supply chain / release integrity: the version-exists skip accepts whatever artifact the registry already holds without comparing it to the locally verified tarball.

Why this matters: the docs now direct maintainers to re-dispatch a failed publish, and if the tarballs were rebuilt at the same version between attempts, the job reports success while the registry keeps serving the older bytes; the skip is also driven by a substring of npm's combined output, so an unrelated failure that echoes that text exits 0 instead of failing the job.
Suggested fix: gate the skip on an identity check, e.g. compare npm view "$pkg@$ver" dist.integrity (sha512) with the tarball's digest and skip only on a match; otherwise fail.

@github-actions

Copy link
Copy Markdown

Spec-harness coverage — 🟡

  • 🟡 spec coverage 98.98% — 344 genuine failures (1.02% of the executed scenarios)
  • scenarios run: 33645 (passed 33301, failed 344)
  • bands: 🟢 zero failures · 🟡 failure share ≤ 10% · 🔴 beyond (ADR-0482 §4 — the light never fails the build)
  • suite runtime: 36s
  • neo4j_expected_fail (not counted): 406
  • nondeterministic (not counted): 5
  • skipped (not counted): 2323
  • harness ref: 0f43b85cf8b015a6542ceaf44c384213ca3ac225
failure category count
missing-validation 105
side-effects 51
error-class-mismatch 44
result-mismatch 34
syntax-error 31
result-temporal-fidelity 29
notification-missing 19
semantic-error 10
type-error 10
other 8
setup-failed-syntax 3

Rerun spec-harness to refresh. Coverage below 100% never fails the build (ADR-0482 §4).

@oskarhane
oskarhane merged commit 545c800 into main Nov 11, 2026
66 of 91 checks passed
@oskarhane
oskarhane deleted the fix/npm-publish-skip-arm branch November 11, 2026 21:18
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