Expand description
The changed-code audit.
fallow audit, the MCP audit tool and crate::run_audit all run an
audit through run, so they give the same introduced and inherited split
and the same verdict. A surface supplies an AuditBackend: it runs the
three analyses (dead code, duplication, health) and creates the base
checkout. This module owns the rest:
- the base ref: explicit, then
FALLOW_AUDIT_BASE, then auto-detection (resolve_audit_base), - the check that lets the head run stand in for the base
(
can_reuse_current_as_base), - rename detection, and the base focus set of changed files plus pre-rename paths,
- the base snapshot: checkout, analysis root, focus remap, dependency scope, and keys,
- the rename remap of base keys, the degraded type-aware comparison, the clone-group demotion, the verdict, and the introduced flags on the head findings.
Structs§
- Audit
Analyses View - The analyses of one audit side. An analysis the surface did not run is
None. - Audit
Attribution Input - Inputs of
attribute. - Audit
Base - The base snapshot that attribution compares with.
- Audit
KeySnapshot - Attribution keys of one audit side (the base commit, or the head run when the base pass is skipped).
- Audit
Outcome - Attribution result of one audit run.
- Audit
Run - One completed audit run.
- Audit
RunInput - Inputs of one audit run.
- Base
Coverage Inputs - Istanbul coverage inputs of the base pass.
- Base
File Reader - A long-lived
git cat-file --batchchild process that reads the base version of changed files without onegit showfor each file. - Dead
Code View - The dead-code analysis of one audit side, as the audit reads it.
- Duplication
View - The duplication analysis of one audit side, as the audit reads it.
- Health
View - The health analysis of one audit side, as the audit reads it.
- Shared
Diff - An opt-in shared diff that the run already applied, with its source label.
Enums§
- Audit
Base Error - Why no audit base ref could be resolved.
- Audit
Base Origin - Where an audit base ref came from.
- Base
Read - Outcome of one batched base-file read. “The object does not exist at base”
and “the pipe or parse failed” stay apart, so a transient
git cat-filefailure never reads as an empty base file. - Dupe
Demotion Diff Source - Which diff decided the new-only duplication demotion, so output can name where a demotion came from (issue #2220).
Traits§
- Audit
Analyses - The analyses a surface ran for one audit side.
- Audit
Backend - How one surface runs the analyses of an audit.
- Base
Checkout - A checkout of the base commit.
Functions§
- attribute
- Compare head analyses with a base snapshot, decide the verdict, and set the introduced flags on the dead-code and health findings.
- base_
coverage_ inputs - Coverage inputs for the base-worktree pass.
- base_
focus_ files - The files the base pass covers: the changed files plus the pre-rename path of each rename, so base findings on moved files are in the base snapshot and the rename remap can move them onto their head paths.
- branching_
keys - Re-key absolute branching paths into the root-relative key space of the audit, so base and head entries join and the rename remap can move them.
- can_
reuse_ current_ as_ base - Whether the head run can stand in for the base snapshot.
- compare
- Classify every head finding once against the base snapshot.
- demote_
preexisting_ dupe_ introductions - Demote introduced clone groups that hold no added line of the run’s diff.
- outcome
- Attribution counts, verdict and summary of one comparison.
- parse_
audit_ base_ override - Parse a raw
FALLOW_AUDIT_BASEvalue: trimmed, andNonewhen it is empty or only whitespace. - remap_
focus_ files - Express
files(absolute paths underfrom_root) underto_root. - renamed_
files - Detect base..head renames for rename-aware attribution.
- resolve_
audit_ base - Resolve the base ref of an audit rooted at
root. - run
- Run one audit. Returns
Nonewhen the run has no changed files. - scope_
dependency_ findings - Keep a dependency-level finding only when its manifest is in
changed_files. - styling_
finding_ gates - Whether a styling finding escalates to
errorand so gates the verdict. - styling_
rule_ severity - The severity of the rule that owns a styling finding
code. Styling is verdict-neutral by default (rulewarn). - type_
aware_ attribution_ degrade_ reason - Why type-aware base and head attribution cannot be compared directly, or
Nonewhen the comparison is sound (fully syntactic runs included). - type_
aware_ degrade_ warning - The warning that an audit records when it degrades type-aware attribution
for
reason. - type_
aware_ gap_ signature - Sorted reasons and omissions of the semantic queries that did not complete.