Skip to main content

Module compare

Module compare 

Source
Expand description

Repository state comparison (decided.services.compare): load_state walks one directory into a fully analysed RepoState; compare_states derives every delta between two states — changed artifacts, validation delta, relationship delta, statistics delta. Artifacts are matched by corpus-relative path (os.path.relpath(entry.path, directory)), so the two states may live anywhere on disk (a working tree and a materialized git revision, or two fixture directories). A rename reports as removed plus added.

Numbers come from the existing analyses exactly as in the oracle: validation counts from the portfolio summary (validated WITHOUT the ticketing provider), per-file statuses from the directory-validation path (WITH the provider) — the two are kept distinct on purpose.

Structs§

ArtifactChange
One artifact that differs between the base and head states.
RelationshipDelta
How relationship integrity moved between the states.
RelationshipIssueRef
One relationship-validation finding, keyed for cross-state set diffing — fields mirror RelationshipIssue with paths made corpus-relative so the same broken reference compares equal across a materialized base revision and the working tree.
RepoState
One fully analysed repository state, keyed by corpus-relative path.
RepositoryComparison
Everything that changed between a base and a head repository state.
StateArtifact
The per-path artifact join the comparison reads: index identity + directory-validation status (valid/invalid/skipped).
StateEntry
One corpus file in a state: its corpus-relative key, parsed product, raw bytes (the change detector), and artifact join.
StatsDelta
How repository-level artifact counts moved between the states.
ValidationDelta
How validation outcomes moved between the states.

Constants§

CHANGE_ADDED
CHANGE_MODIFIED
CHANGE_REMOVED

Functions§

compare_states
compare_states(base, head) — derive every delta between two states.
load_state
load_state(directory, label) — walk directory once and analyse it as one comparison side.