Skip to content

build, compat: compare std by reach, like a vendored dependency - #275

Merged
Kinflou merged 1 commit into
masterfrom
fix/std-by-reach
Nov 14, 2026
Merged

Kinflou merged 1 commit into
masterfrom
fix/std-by-reach

Conversation

@Kinflou

@Kinflou Kinflou commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Problem

comline release reported std's declarations as the package's own new features. A package that uses one std validator got:

🟢 New features (4)
➕ Added validator `IntRange`
➕ Added validator `MinChars`
➕ Added validator `MinItems`
➕ Added validator `NonEmpty`

All four come from std. Each build's compiled schemas include std's, but std is built in and never vendored, so the build has no dep_std entry. Three places separate a package's own schemas from its dependencies': build::compare, compat::Loaded::of and compat::facts_of_context. They only knew dep_<name> entries, or the declared dependencies, so they treated std's schemas as the package's own: compared, numbered and bumped. The docs model (doc.rs) already treats std as a dependency, so only build, release and compat disagreed with it.

Fix

  • compat::dependency_names(deps) returns a version's dependencies plus std.
  • compat::vendored(tree) returns a build tree's dep_<name> entries.
  • compare, Loaded::of and facts_of_context now use both.

std now goes through the same reach path as vendored dependencies. A change to the parts of std the package uses is listed under std's dependency changes. Any other change to std is not counted.

Tests

  • New test cas::std_reach_tests::std_is_compared_by_reach_like_a_dependency: std gains a declaration the package doesn't reach. It checks there are no schema changes, no dependency changes, and a bump below minor (a tree with no stored config is unseen, so it still counts as a patch).
  • cargo test -p comline-core --features deps: all pass (381 lib, 774 integration, plus the rest).

A version's compiled schemas include std's, but std is built in and never
vendored, so a build has no `dep_std` entry. The splits that separate a
package's own schemas from its dependencies' only knew the `dep_<name>`
entries (or, in `facts_of_context`, the declared dependencies), so std's
schemas were compared, numbered and recorded as the package's own.

Every declaration std gained between two builds was then reported as the
package's own feature, and bumped it: a release of a package using one std
validator listed `Added validator IntRange`, `MinChars`, `MinItems` and
`NonEmpty`, all std's. The docs model already treated std as a dependency
(doc.rs), so only build, release and compat disagreed.

`compat::dependency_names` now gives every split its dependencies plus std,
and `compat::vendored` a build tree's `dep_<name>` entries; `compare`,
`Loaded::of` and `facts_of_context` use them. std then goes through the
existing reach path: a change to what the package uses of it is listed
under std's dependency changes, and anything else doesn't count.
@Kinflou
Kinflou merged commit 50aefb4 into master Nov 14, 2026
32 checks passed
@Kinflou
Kinflou deleted the fix/std-by-reach branch November 14, 2026 12:12
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