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§
- Artifact
Change - One artifact that differs between the base and head states.
- Relationship
Delta - How relationship integrity moved between the states.
- Relationship
Issue Ref - One relationship-validation finding, keyed for cross-state set diffing —
fields mirror
RelationshipIssuewith paths made corpus-relative so the same broken reference compares equal across a materialized base revision and the working tree. - Repo
State - One fully analysed repository state, keyed by corpus-relative path.
- Repository
Comparison - Everything that changed between a base and a head repository state.
- State
Artifact - The per-path artifact join the comparison reads: index identity +
directory-validation status (
valid/invalid/skipped). - State
Entry - One corpus file in a state: its corpus-relative key, parsed product, raw bytes (the change detector), and artifact join.
- Stats
Delta - How repository-level artifact counts moved between the states.
- Validation
Delta - How validation outcomes moved between the states.
Constants§
Functions§
- compare_
states compare_states(base, head)— derive every delta between two states.- load_
state load_state(directory, label)— walkdirectoryonce and analyse it as one comparison side.