Repository navigation
release: enforce non-latest npm dist-tag for prerelease versions (#9302) - #9552
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018HD9fbAVQpnXMUzif6Y2oh
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018HD9fbAVQpnXMUzif6Y2oh
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 36 minutes. View limit details
Comment |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018HD9fbAVQpnXMUzif6Y2oh
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018HD9fbAVQpnXMUzif6Y2oh
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018HD9fbAVQpnXMUzif6Y2oh
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018HD9fbAVQpnXMUzif6Y2oh
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018HD9fbAVQpnXMUzif6Y2oh
Review of record, head 92eacd0Angles: independent read-only delta review (tokenizer, value-flag handling, dist-tag rules, parent-exists fail-closed, test discrimination, spec) of 60c5d5c..92eacd0; five Devin threads answered and resolved. Nothing was built by the reviewer. Findings: no blockers. All 10 earlier bypasses are closed and covered by tests; no false positives on the current CI: Generated by Claude Code |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018HD9fbAVQpnXMUzif6Y2oh
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018HD9fbAVQpnXMUzif6Y2oh
Review of record update, head 3fbbca7Two further independent read-only delta reviews after 92eacd0:
Local proof: 85 xtask distribution tests pass; clippy CI: the earlier required-check run was affected by known_false ledger drift on main (#9588); I will re-apply Generated by Claude Code |
There was a problem hiding this comment.
Confirmed findings
- The scanner silently ignores workflow files whose extensions are not yml or yaml, despite the workflow directory scan being responsible for enforcing npm publish safety.
Verification questions
- Confirm heavy witnesses (build, cargo-check, cargo-clippy, cargo-test as base) and
riprsensor failed; precommit ran but ended oncovered_bySIGKILL, so no freshcargo xtask check-release-targetsorcargo xtask check_distribution_contractevidence is recorded for the post-3fbbca7e head. Cross-host reproducibility of the new scan is unverified. - Confirm
scan_workflow_npm_tagsis invoked only fromcheck_distribution_contract, socargo xtask check-release-targetsdoes not gate workflow changes independently of the contract check. - Confirm
validate_publish_tagaccepts the literal stringlatestfor stable, but a path with two publishConfig siblings could regress to wrong order afterset_npm_launcher_publish_tagremoves the comma.
Refuted
- The manifest and workflow enforcement should also be applied to adjacent package-manager publish paths such as pnpm or yarn.; refuted because: This PR's governing spec explicitly scopes those tools out; broadening now would require separate acceptance criteria and likely parser behavior, so it is parked rather than silently included.
- The recursive shell tokenizer or workflow path scan could cause aliasing or dangling-reference behavior at the native seam.; refuted because: Tokens and paths are owned values; shell_tokens returns a fresh Vec and recursive calls consume immutable borrowed text only for the call duration. No unsafe code or lifetime-erasing pointer is introduced.
- This PR modifies worker/async JS memory-crossing behavior.; refuted because: The diff changes distribution-policy validation, YAML workflow scanning, release-version maintenance, documentation, and tests; it does not modify worker, async, GC, detach, transfer, native-handle, or JavaScript ownership code.
- The version-bump tests do not exercise the production release path.; refuted because: The PR thread explicitly acknowledges prepare_release_update is not directly tested, but the tests exercise both steps it performs and the seeded review treats that limitation as non-blocking.
- The scanner must recurse into nested workflow directories.; refuted because: The implementation intentionally scans only direct workflow entries, and the acceptance text describes an in-tree workflow scan without a recursive-directory requirement.
Evidence gaps
- The scheduled cargo-test receipt remains the outstanding execution proof for the exact test target.
- Executable proof is incomplete because RIPR failed and cargo-test is scheduled late; local review claims 85 tests and clean clippy are not current sensor receipts.
- Model proof intent was rejected by deterministic validation.
|
Reply to automated review 5612517648:
Generated by Claude Code |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018HD9fbAVQpnXMUzif6Y2oh
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018HD9fbAVQpnXMUzif6Y2oh
|
Independent bounded source review at12b402a156be3abc16d6c8754923a8ec4e1bcd5b found no blocker in the YAML key-column and comment-backslash repairs. Keep the latest reported86 focused tests tied to their actual tested commit; earlier85-test receipts do not qualify this successor by themselves. Next existing-owner action: reconcile current-head integration and applicable required admission after the landed #9588 repair, preserving validation already running rather than dispatching duplicates. CI39763157194 was skipped and ub-review39763157032 was running at observation; Source of Truth/wheel passes are bounded, not end-to-end publishing enforcement. Retain #9601's broader tokenizer forms and the external-workflow/generated-package boundary explicitly. The comment-continuation fix must not be described as all shell/npm publishing syntax enforced. This is ordinary code-review coordination only; no registry, release or deployment action is requested. |
|
Review of record update, head 12b402a. Delta since the earlier reviewed head covers 3fbbca7 (block scalar ends at the key column for list items), a0577e2 (renamed a test-string job key so
Generated by Claude Code |
|
Merged as 2768de5 (squash, expected head 12b402a). Generated by Claude Code |
Governing issue or accepted claim: #9302 (T5 trust-audit finding F1, release_control_defect)
Acceptance delta (one sentence): The existing distribution validator (
cargo xtask check-release-targets,xtask/src/policy/distribution/npm_launcher.rs) now fails a prerelease npm launcher version without an explicit non-latestpublishConfig.tag, and fails any in-tree workflownpm publish/npm dist-tagthat does not use exactly one literal non-latesttag.What changed (head 92eacd0)
PublishConfig.tagplusvalidate_publish_taginsidevalidate_launcher(no second validator). A prerelease with no, empty orlatest(case-insensitive) tag fails; a stable version with a non-latesttag fails. Prerelease detection ignores SemVer build metadata (1.0.0+build-1is stable). The committedpackage.json(stable 0.11.0) is unchanged.validate_workflow_npm_tagsuses a shell-aware tokenizer. It joins\continuations, strips quotes, treats#as a comment only at a word start outside quotes, splits commands on; & | ( )even when glued, and re-tokenizes a quotednpm ...word. It findspublish/dist-tag(s)anywhere afternpm, skipping the values of value-taking flags (-w,--workspace,--otp, ...). It requires exactly one literal non-latest--tag(rejects$VAR,${{ }}, backticks,$(...), repeated or mixed options), exempts--dry-run, and rejectsnpm dist-tag add/set <pkg>with no tag (defaults tolatest).scan_workflow_npm_tagsfails on unreadable workflow directories or files, and on a missing workflows directory whose parent exists (wrong working directory).bump-versionadds"tag": "next"for a prerelease target and removes it for a stable target.Out of scope (stated in the spec)
pnpm/yarn publish,NPM_CONFIG_TAG, composite or reusable actions, and the real publish workflow (sourceriprrepo, ripr#1781/#1784). Generated per-platform packages are not in-tree.Proof
cargo test -p xtask --bin xtask -- policy::distribution npm_launcher_version_tests: 83 passed, 0 failed. Negative experiments cover prerelease with no tag /latest/ empty, stable withnext, multiline, chained, glued-separator, global-flag, interpolated, repeated-tag, dist-tag-without-tag and unreadable-workflow cases, each paired with positive controls (prerelease +next,npm publish --tag next,--dry-run, comments,npm run publish,dist-tag ls).cargo clippy -p xtask --all-targets -- -D warnings: clean.cargo xtask precommiton the final commit: all policy gates throughcheck-local-contextandcheck-covered-byand the rest of the policy list passed, but the run ended with an instrument failure (covered_byenumeration timed out at 300s and was SIGKILLed on the contended shared build host), not a source or policy failure. Earlier attempts were also hit by disk-full and OOM kills. Hosted CI on the exact head remains the outstanding proof; final-merge review is incomplete until then.replace_npm_launcher_versionsplus the validator (the two stepsprepare_release_updateruns), notprepare_release_updateitself.lateststays held for Steven.🤖 Generated with Claude Code
https://claude.ai/code/session_018HD9fbAVQpnXMUzif6Y2oh