pub struct ImpactClosureFacts {
pub affected_count: usize,
pub affected_not_shown: Vec<String>,
pub affected_by_dir: Vec<AffectedDirectory>,
pub affected_by_dir_omitted: usize,
pub coordination_gap: Vec<CoordinationGapFact>,
}Expand description
Stage 3 of the brief: the impact closure. The transitive affected-but-not-in-diff set plus the coordination gap. The differentiator a diff tool fundamentally cannot do, because it has no graph.
Honest scope (ADR-001, syntactic): the coordination gap is an attention pointer at the exact inter-module failure mode, NOT a correctness proof.
Fields§
§affected_count: usizeThe FULL number of files transitively affected by the changeset
(reverse-deps + re-export chains) that are NOT in the diff. Computed
BEFORE affected_not_shown is capped to a
sample, so it is always the true magnitude of the blast radius.
affected_not_shown: Vec<String>A capped, path-sorted sample of the affected root-relative paths (at most
AFFECTED_SAMPLE_CAP), deduped. The full count lives in
affected_count and the distribution in
affected_by_dir; use this list to jump to
representative files, NEVER to enumerate the blast radius or to infer its
shape. Because it is a prefix of the sorted set, it clusters in whichever
directory sorts first. To reconstruct the full set, run
fallow check --impact-closure <path> once per changed file and union the
results: that flag seeds from a single file, so no single command
reproduces this changeset-wide union.
affected_by_dir: Vec<AffectedDirectory>The blast radius rolled up by parent directory: how the affected files
distribute, heaviest directory first, ties broken by directory path so the
order is deterministic. This is the SHAPE signal, and unlike
affected_not_shown its counts are exact for
every directory it lists. At most AFFECTED_DIR_CAP entries.
affected_by_dir_omitted: usizeHow many directories did not fit within AFFECTED_DIR_CAP and are
absent from affected_by_dir. They are the
lightest ones; their files are still counted in
affected_count. Zero when nothing was omitted.
Add this to affected_by_dir.len() for the true number of directories
the change reaches.
coordination_gap: Vec<CoordinationGapFact>Coordination gaps: a changed file exports a contract consumed by a module
absent from the diff. One entry per (changed file, consumer) pair. NOT a
subset of affected_not_shown: the gap
deliberately skips story and test consumers that the affected set counts.
Implementations§
Source§impl ImpactClosureFacts
impl ImpactClosureFacts
Sourcepub fn new(
affected: &[String],
coordination_gap: Vec<CoordinationGapFact>,
) -> Self
pub fn new( affected: &[String], coordination_gap: Vec<CoordinationGapFact>, ) -> Self
Build the facts from the full closure, capping the file sample and the directory rollup while preserving the exact total.
affected must arrive deduped and path-sorted (the engine closure
guarantees both); the sample is its prefix.