chore(cargo): enforce 14-day min-publish-age for crates.io deps - #35
Merged
Conversation
This prevents the resolver from selecting crates.io releases published within the last 14 days unless they are already locked. It matches the existing Dependabot cooldown. The [unstable] table is temporary until Rust 1.100.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a 14-day cooldown for crates.io dependencies through Cargo's new
min-publish-agesetting (RFC 3923), in a root.cargo/config.toml:Dependabot already waits 14 days before proposing a bump. This makes plain
cargo add,cargo update, and hand-edited version requirements follow the same rule, so a freshly published (and possibly compromised) release can't slip in through a developer's PR. Versions already inCargo.lockare left alone. For an urgent fix there is a one-off escape hatch:There is no toolchain pin in this repo. On a nightly from 2026-06-21 or later the cooldown is active. On stable, cargo prints a one-line warning and enforces nothing until Rust 1.100 ships on 2026-11-12.
Tracking: STR-3852.
Type of Change
Notes to Reviewers
One gap worth knowing about: versions already in
Cargo.lockare exempt by design, so a lockfile produced with the override still passescargo build --lockedin CI. If we want CI to catch that,cargo update --dry-runprints aDowngradingline for every locked version that violates the policy and can be turned into a check. That is out of scope for this PR.The
[unstable]table is temporary. Stable cargo ignores it, and nightly cargo needs it until the feature reaches stable in Rust 1.100 (2026-11-12). After that it can be dropped.Verified locally with
cargo update --dry-run --workspace:AI disclosure: the change and this PR body were produced with Claude Code and Codex, then reviewed and tested by me.
Is this PR addressing any specification, design doc or external reference document?
If yes, please add relevant links:
Checklist
Related Issues
STR-3852