Skip to main content

Module audit_brief

Module audit_brief 

Source
Expand description

fallow audit --brief (alias fallow review): deterministic, always-exit-0 rendering mode layered over the audit analysis. Public so the schema-emit binary can derive the ReviewBriefOutput envelope. fallow audit --brief (alias fallow review): a deterministic rendering mode layered over the existing audit analysis.

The brief answers “where do I look?” rather than “will CI block this?”. It is composition + rendering over the same crate::audit::AuditResult that drives fallow audit; it runs no new analysis and, critically, ALWAYS exits 0 so a reviewer or agent can read the orientation even when the underlying audit verdict is fail. The verdict is still computed and carried in the brief JSON informationally, but it never drives the exit code on this path.

The JSON envelope is independently versioned and tagged as kind: "audit-brief" so the brief shape evolves on its own cadence without bumping the main --format json contract.

Structs§

CoordinationGapFact
One coordination-gap entry: a changed file exports symbols consumed by a consumer_file that is NOT in the diff. Deduped per (changed, consumer) pair (firing-precision rule R2).
DiffTriage
Stage 0 of the brief: triage facts derived purely from the diff size.
GraphFacts
Stage 1 of the brief: graph-derived orientation facts.
ImpactClosureFacts
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.
PartitionFacts
Stage 2 of the brief: the partition + order. The changed files split into coherent BY-MODULE units (the only byte-identical-deterministic clustering definition straight from the graph), plus a dependency-sensible review ORDER over those units (definitions before consumers, mechanical/leaf units last, ties broken by the path sort). Stage 2 sits UNDER the decision surface as a drill-down; it is the backbone the directed-review loop hands the agent.
ReviewBriefSchemaVersion
Independently-versioned wire-version newtype for the brief envelope. Serializes as the integer REVIEW_BRIEF_SCHEMA_VERSION.
ReviewBriefSubtractSections
CLI-built audit subreports that are embedded in the audit brief envelope.
ReviewDeltas
Diff-aware deterministic deltas (6.A), framed new-vs-pre-existing against the audit base snapshot. Each entry is a brief summary/verdict line.
ReviewUnitFact
One review unit: a coherent by-module cluster of the changed set.

Enums§

ReviewEffort
Suggested reviewer effort, a pure function of RiskClass.
RiskClass
Coarse risk classification for a changeset, a pure function of the change size (file count plus, once threaded, net lines).

Functions§

build_brief_output
Assemble the structured ReviewBriefOutput for an audit result. Pure: no timestamps, no randomness, so two runs over the same tree serialize byte-identically.
build_review_deltas
Build the deltas from head sets vs a base set, sorted for determinism.
build_triage
Build the Stage 0 triage facts from the audit result.
classify_risk
Classify a changeset’s risk purely from its size. net_lines is consulted when present (it is None on the v1 file-level audit path).
derive_graph_facts
Derive the Stage 1 graph facts from the analysis results plus the impact closure.
print_brief_result
Print the brief and return an exit code that is ALWAYS SUCCESS.
print_decision_surface_result
Render the SEPARABLE decision-surface envelope (the decision_surface MCP tool’s output + fallow decision-surface). Emits ONLY the ranked, capped decisions with structured actions[], never the full brief. Always exit 0.
print_walkthrough_file_result
Ingest the agent’s judgment JSON from path and POST-VALIDATE it against the live graph: reject unanchored signal_ids (anti-hallucination), refuse the whole payload when the echoed graph-snapshot hash is stale (the tree moved). JSON renders the typed walkthrough-validation envelope (kind: "review-walkthrough-validation"). Always exit 0 (advisory).
print_walkthrough_guide_result
Render the agent-contract WALKTHROUGH GUIDE: the digest (brief + decision surface), the review direction, the JSON schema the agent returns, and the deterministic graph-snapshot pin. JSON renders the typed guide envelope (kind: "review-walkthrough-guide"). Every format emits the guide as JSON: the guide is an agent-facing contract, not a human walkthrough. Always exit 0.
print_walkthrough_human_result
Render the EXISTING walkthrough guide as a HUMAN terminal tour (or markdown with --format markdown). The guide data is built unchanged by crate::audit_walkthrough::build_guide_from_result; this only renders it.
review_effort_for
Map a RiskClass to the suggested reviewer effort.

Type Aliases§

ReviewBriefOutput