Repository navigation
feat(skills): teach dependency-updates where a security floor propagates - #565
Draft
rhysyngsun wants to merge 2 commits into
Draft
rhysyngsun wants to merge 2 commits into
rhysyngsun wants to merge 2 commits into
Conversation
The skill tells you to pin a floor alongside a security bump, and for a transitive dependency it says to use `[tool.uv] constraint-dependencies`, npm `overrides`, Yarn `resolutions` or pnpm `overrides`. That is right for an application and wrong for anything that publishes: none of those four appear in a built artifact's metadata, so they steer your own resolution and reach no consumer. A library carrying only a constraint ships a package whose consumers can resolve the vulnerable version straight back in, while its own CI stays green. An org-wide certifi remediation found 15 of 20 repos had expressed the floor that way. Every application among them was correct; every library among them propagated nothing. Adds the publish/consume distinction to the cooldown section and to the floor table in references/release-age-cooldowns.md, and a new references/dependency-floors.md covering the second failure: a floor declared narrowly — which is right, since a floor in a package that never resolves the dependency forces it on consumers who have no use for it — goes stale as the graph moves. A package can gain the dependency indirectly and need a floor it never had, or reach it only through a sibling it declares unpinned, so an older pre-floor release satisfies it. No vulnerability scanner catches either, and that is the point worth internalising: once the floor holds, the dependency resolves safe in the lockfile, so scanners stay green while the published metadata is wrong. `mitol-dependency-floors` checks the part a scanner cannot see. Also records that Renovate's `osvVulnerabilityAlerts` covers direct dependencies only, which matters because the same file notes most CVEs land in transitive ones. SKILL.md goes from 499 to 518 lines, over the ~500 guideline. The material that could move to a reference did; what is left corrects advice that is already in SKILL.md and has to stay beside it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
mitodl/ol-django#618 now registers the entry point under the distribution name as well, so `uvx mitol-dependency-floors check` resolves and the `--from` workaround is no longer needed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This branch has not been deployed
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.
What are the relevant tickets?
Follows #529. Related to https://github.com/mitodl/hq/issues/14074 and https://github.com/mitodl/hq/issues/14065.
Description (What does it do?)
The skill already tells you to pin a floor alongside a security bump. For a transitive dependency it says to use
[tool.uv] constraint-dependencies, npmoverrides, Yarnresolutionsor pnpmoverrides.That is right for an application and wrong for anything that publishes. None of those four appear in a built artifact's metadata —
constraint-dependenciesis absent fromrequires-dist, and the npm-family mechanisms are consumer-side directives a dependent never sees. They protect your own resolution and nobody else's. A library carrying only a constraint ships a package whose consumers can resolve the vulnerable version straight back in, while its own CI stays green.This is not hypothetical: the org-wide certifi remediation found 15 of 20 repos had expressed the floor that way. Every application among them was correct; every library among them propagated nothing.
So this PR adds two things.
1. The publish/consume distinction, in
SKILL.md's cooldown section and beside the floor table inreferences/release-age-cooldowns.md. Short version: a constraint guards your lockfile, a declared dependency guards your consumers, an application needs only the former, and a library needs the latter and a release — a declared floor in an unreleased package reaches nobody.2.
references/dependency-floors.md, covering the second failure mode. Declaring a floor narrowly is correct — a floor in a package that never resolves the dependency forces it on consumers with no use for it — but "where it is needed" is a fact about the dependency graph, and the graph moves:No vulnerability scanner catches any of these, and that is the part worth internalising: once the floor and the cooldown are in place the dependency always resolves safe in your lockfile, so every scanner stays green while the published metadata is wrong. The lockfile is a dev artifact; what ships is
requires-dist.The reference documents
mitol-dependency-floors— its six checks, both modes (two that need no workspace and nothing published, four for a repo that publishes), theprovidersmechanism that makes inheritance sound, thedirectescape hatch, and where reachability deliberately over-reports.Also records that Renovate's
osvVulnerabilityAlertscovers direct dependencies only, which matters precisely because the same file notes most CVEs land in transitive ones.Adds eval 7, exercising the distinction end to end: a transitive certifi advisory in a publishing uv workspace where the author has already added a constraint and thinks they are done.
How can this be tested?
just check-skillspasses.uv run prek runpasses on every touched file (markdownlint included).evals.jsonstays valid JSON and the diff is purely additive — no reformatting of the existing six.uvxinvocation in the docs was verified against a built wheel rather than assumed, which caught a real defect:uvx mitol-dependency-floors checkoriginally did not work, because the console script wasdependency-floorsand did not match the distribution name — uv respondedUse 'uvx --from mitol-dependency-floors dependency-floors' instead. Fixed upstream in feat(dependency_floors): add mitol-dependency-floors ol-django#618 by registering the entry point under both names, and re-verified against a rebuilt wheel. The docs use the plain form.Additional Context
Important
Draft until
mitol-dependency-floorsis published. It is built and stacked in mitodl/ol-django#618 but not yet on PyPI, so theuvxinvocations here do not resolve yet. Marking this ready for review once it is released.SKILL.mdgoes from 499 to 518 lines, against the ~500 guideline increating-skills. The material that could move to a reference did — the new reference is 200 lines. What stayed inSKILL.mdcorrects advice already there, so it has to sit beside it.🤖 Generated with Claude Code