Skip to main content

Module review_deltas

Module review_deltas 

Source
Expand description

Diff-aware deterministic deltas for the review brief (6.A).

Three exports-aware / graph-structural deltas, framed new-vs-pre-existing against the audit base snapshot:

  1. boundary-violation-introduced: a cross-zone edge present at head but not at base. R2 (first-edge-only): keyed on the (from_zone, to_zone) PAIR, so the first import that establishes a zone pair fires once; subsequent imports across the same already-established pair do not refire.
  2. circular-dependency-introduced: a cycle (canonical, rotation-independent file set) present at head but not at base.
  3. public-API-surface delta: EXPORTS-AWARE. The set of public-export keys (<rel_path>::<name>) reachable through package.json exports + re-export reachability, head-minus-base. A symbol re-exported only through an internal barrel NOT in exports is in neither set, so it yields ZERO public-API delta; one reachable through an exports path yields exactly one (the Aisha repro). R4 (attribute to the exports-mapped copy only) is encoded by which modules land in the public-API entry-point set (fallow_engine::project_analysis::public_api_package_entry_points).

Relocation-awareness (R3) falls out of the set-difference: a moved file that preserves its zone pair / public-export key / cycle membership produces no head-minus-base delta, because the key is path-canonical for cycles and zone-pair / (rel_path, name) for the others, and base already contained it.

R1 (batch-consolidate public-API to ONE decision per change) is honored at the summary line: the brief renders a single “public API surface widened by N” decision, never one-per-symbol, while still carrying the added keys as evidence.

Functions§

boundary_edge_key
The cross-zone edge key for R2 first-edge-only framing: one key per distinct (from_zone, to_zone) pair, NOT per import statement. A second import across an already-established pair shares this key, so it never re-fires the delta.
boundary_edge_keys
Build the deduped set of cross-zone edge keys for a results’ boundary violations (R2: one per zone pair).
cycle_key
Canonical (rotation-independent) cycle key: the sorted root-relative file set.
cycle_keys
Build the deduped set of canonical cycle keys.
introduced_keys
Compute the head-minus-base delta key set, sorted for deterministic output.
public_export_keys_for
Compute the exports-aware public-export key set from a retained graph + the project config and package metadata. Wires fallow_engine::project_analysis::public_api_package_entry_points (the R4 exports-aware entry set) into the retained graph’s public export key query.