Skip to main content

Module dependency_deltas

Module dependency_deltas 

Source
Expand description

Dependency deltas for the decision surface: what a changed package.json adds or moves across a major version, read from the base and head manifest text, projected onto DependencyAnchors. Pure over its inputs; the CLI reads base text through git and the typed runtime through the base worktree, and both hand the pairs to dependency_anchors_from_manifests so the two routes cannot drift.

Firing precision mirrors the public-API rule R1: a manifest yields at most one “added” candidate set and one “major bump” candidate set, never one decision per package. Minor and patch bumps are not candidates; a range that does not start with a numeric version (a workspace, catalog, file, git, or tag specifier) is skipped rather than guessed at.

Structs§

DependencyChange
One dependency entry that changed between base and head.
ManifestDependencyDeltas
The dependency changes in one manifest, split by candidate kind.
ManifestPair
A changed manifest with its base and head text.

Functions§

dependency_anchors_from_manifests
Project manifest pairs onto dependency anchors, one per manifest per kind, in manifest order. Importer counts come from the graph’s package usage; a package the graph never saw counts zero.
dependency_delta_key
The stable delta key for one dependency entry: <manifest>::<name> for an added entry, <manifest>::<name>@<from>-><to> for a bump. The decision candidate key joins these with |, so the brief’s deltas and the decision’s signal_key name the same change.
fill_dependency_delta_keys
Mirror the dependency anchors onto the brief’s deltas as stable keys so the JSON envelope names what changed even when the cap collapses the decision.
is_major_bump
Whether moving a range from from to to crosses a major version. Both sides must start with a numeric version once the range operator is stripped; anything else (workspace, catalog, file, git, tag, wildcard) is not a bump fallow can classify. A 0.x line treats a minor move as major, the semver convention for pre-1.0 packages.
is_manifest_path
Whether rel_path is a package.json manifest fallow should diff.
manifest_dependency_deltas
Diff the dependency sections of a manifest between base and head text. Malformed JSON on either side reads as empty: an unreadable base makes every head entry new, an unreadable head yields nothing.