Repository navigation
feat(lockfiles): Cargo enforces the cooldown and waitHours on what it newly locks - #301
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
count-patchula | 7f15540 | Commit Preview URL Branch Preview URL |
Nov 13 2026, 09:58 PM |
… newly locks Every Cargo invocation the lockfile runner makes — a --precise update, the boundary path, lockfile maintenance — now gets CARGO_REGISTRY_GLOBAL_MIN_PUBLISH_AGE and CARGO_RESOLVER_INCOMPATIBLE_PUBLISH_AGE in its environment. The age is the longer of the directory's committed .cargo/config.toml cooldown, passed verbatim in Cargo's grammar, and the job's effective waitHours, so the transitive crates and maintenance re-resolves that lookup never dated wait like the releases it did. An explicit 0 both disables the check where nothing applies and stops a cooldown configured above the runner's own directories — a parent checkout or an operator's Cargo setup — from leaking into a run. A security fix inside the committed window keeps its cooldown marker end to end (transitive fixes mark only when the catalog dates the target inside it, and a batch carries the reported marker through), so its job alone runs resolver.incompatible-publish-age = "allow" while the branch's other jobs stay deny. An unread committed cooldown fails the directory's jobs, maintenance included, as its lookups already fail; a Rust older than 1.100 still gets the floor on direct targets, with a warning that its Cargo ignores the keys and transitive crates do not wait. Behaviour change: waitHours is passed to Cargo for every Rust repository, so crates a resolve newly locks wait as long as the updates that triggered it; security fixes are allowed through the incompatible-publish-age check; a cooldown in a parent directory's .cargo/config.toml no longer applies. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…til it may be locked A catalog fetched to date a transitive advisory target no longer reaches routine evaluation: evaluate_with returns an empty Evaluation for lockfile-only packages, so a vulnerable transitive crate proposes exactly its fix — no patch/minor/major rows, held-back noise or Major branch, and a grouped branch carrying the fix contains only the fix. transitive_fix applies the same release-age gate as the direct path: a fix younger than security.apply's wait is reported held back with publishedAt/eligibleAt instead of proposed for Cargo to refuse each run, with or without a committed cooldown underneath it. Rebuilt batch jobs take the effective wait for the update's own kind — a batched minor waits as a minor, not the strictest wait any kind carries — as security_wait_hours already answers for fixes. Rebuilt batch items also inherit the reported dependency's advisory records, not an empty slice: batch PR bodies now list the advisories a batched fix resolves, and SecurityMergeWithoutDelivery can see a batch that holds a fix. An unreadable or include-bearing .cargo/config.toml in a sibling workspace member no longer fails every member: fail-closed covers only the configurations Cargo could read for the manifest (its directory's ancestors, and so the workspace root's ancestors inside the repository); readable sibling values still count toward the maximum. Docs: a crossing --workspace job's refusal reads "did not resolve … to requested version"; one job's wait covers everything its one resolve newly locks; maintenance holds to the strictest active waitHours across the repository's crates.io dependencies.
sweepies
force-pushed
the
feat/cargo-cooldown-env
branch
from
November 13, 2026 21:57
c02d1d3 to
7f15540
Compare
Merged
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.
Every Cargo invocation the lockfile runner makes — a --precise update,
the boundary path, lockfile maintenance — now gets
CARGO_REGISTRY_GLOBAL_MIN_PUBLISH_AGE and
CARGO_RESOLVER_INCOMPATIBLE_PUBLISH_AGE in its environment. The age is
the longer of the directory's committed .cargo/config.toml cooldown,
passed verbatim in Cargo's grammar, and the job's effective waitHours,
so the transitive crates and maintenance re-resolves that lookup never
dated wait like the releases it did. An explicit 0 both disables the
check where nothing applies and stops a cooldown configured above the
runner's own directories — a parent checkout or an operator's Cargo
setup — from leaking into a run.
A security fix inside the committed window keeps its cooldown marker
end to end (transitive fixes mark only when the catalog dates the
target inside it, and a batch carries the reported marker through), so
its job alone runs resolver.incompatible-publish-age = "allow" while
the branch's other jobs stay deny. An unread committed cooldown fails
the directory's jobs, maintenance included, as its lookups already
fail; a Rust older than 1.100 still gets the floor on direct targets,
with a warning that its Cargo ignores the keys and transitive crates do
not wait.
Behaviour change: waitHours is passed to Cargo for every Rust
repository, so crates a resolve newly locks wait as long as the updates
that triggered it; security fixes are allowed through the
incompatible-publish-age check; a cooldown in a parent directory's
.cargo/config.toml no longer applies.
PR 3 of 3 for Cargo cooldowns (#297 fixture, #299 floor).
Details
"<n> hours"from the job's effectivewaitHours, else"0". For unnamed crates (those a--preciseresolve walks past, and everything maintenance re-resolves), the wait isEvaluator::lockfile_wait_hours: the strictest active effectivewaitHoursthe rules give the repository's crates.io dependencies.security.apply's wait, none by default, so Cargo never refuses a fresh fix that lookup proposed. Inside a committed cooldown the job also getsallow. A batch's rebuilt update now carries its proposal'sfixesand cooldown marker, so a batched fix keeps both. The batch commit message still ignores fixes, as before.extract/files→ 5,config/config-files/catalog/catalog-controls→ 4. These are unreleased beyond feat(cargo): a committed Cargo cooldown is a floor on the release age #299.Proof
Real Cargo through the sparse registry (
test:tools, 32 passed):waitHourshold too-new transitive releases in updates and maintenance.allowapplies only to the fix's job.Offline tests cover the batch paths, including a batched fix with no committed cooldown at wait 0 and a routine batched update at 24 hours, plus the overflow clamp.
test:unit, clippy and fmt pass on the project VM. Corpus proposals are unchanged.Docs:
guide/lockfiles.md,guide/lookup-policy.md, the compatibility row, and a new departure (#cargo-transitive-wait).Follow-ups
Review fixes (second commit)
evaluate_withnow refuses transitive dependencies outright.security.apply's wait. It is held with its eligibility date, instead of being proposed and then refused by Cargo.SecurityMergeWithoutDeliverycan now fire on a batch..cargo/config.tomlin an unrelated workspace member no longer fails the whole workspace. Readable values still count toward the floor.--workspacerefusal reads "did not resolve … to requested version"; one job's wait covers everything its resolve newly locks; maintenance holds to the strictest activewaitHours.rust/uv/Cargo.lockrows lose routine proposals. The corpus harness gives every dependency a catalog, so those rows always showed proposals. In production, transitive crates never got a catalog, so production behaviour changes only for vulnerable ones.test:unit,test:tools(32), clippy and fmt pass on the project VM.Follow-ups (from the re-check)
security.apply's wait can't be sped up from the dashboard; a direct fix can.deny(Cargo resolves in one pass).