Skip to content

feat(skills): teach dependency-updates where a security floor propagates - #565

Draft
rhysyngsun wants to merge 2 commits into
mainfrom
skill-dependency-floors
Draft

rhysyngsun wants to merge 2 commits into
mainfrom
skill-dependency-floors

Conversation

@rhysyngsun

@rhysyngsun rhysyngsun commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

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, 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 — constraint-dependencies is absent from requires-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 in references/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:

  • a package gains the dependency indirectly and now needs a floor it never had;
  • a package loses it and carries one it no longer justifies;
  • a package reaches it only through a sibling it declares unpinned, so an older pre-floor release of that sibling satisfies the requirement and the floor does not hold at all.

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), the providers mechanism that makes inheritance sound, the direct escape hatch, and where reachability deliberately over-reports.

Also records that Renovate's osvVulnerabilityAlerts covers 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-skills passes.
  • uv run prek run passes on every touched file (markdownlint included).
  • evals.json stays valid JSON and the diff is purely additive — no reformatting of the existing six.
  • The uvx invocation in the docs was verified against a built wheel rather than assumed, which caught a real defect: uvx mitol-dependency-floors check originally did not work, because the console script was dependency-floors and did not match the distribution name — uv responded Use '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-floors is published. It is built and stacked in mitodl/ol-django#618 but not yet on PyPI, so the uvx invocations here do not resolve yet. Marking this ready for review once it is released.

SKILL.md goes from 499 to 518 lines, against the ~500 guideline in creating-skills. The material that could move to a reference did — the new reference is 200 lines. What stayed in SKILL.md corrects advice already there, so it has to sit beside it.

🤖 Generated with Claude Code

rhysyngsun and others added 2 commits October 28, 2026 12:45
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

No deployments
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