Skip to content
Fallow home
All docs pages

Docs home

fallow audit

Find the options, verdicts, diff-risk rules, JSON fields and exit codes of fallow audit, the changed-code check with one verdict.

fallow audit runs a changed-code check: the analyses on the files that a change touches, with one verdict.

For the concepts and the workflow, read Changed code.

Synopsis

fallow audit [OPTIONS] [PATH]

fallow review is an alias of fallow audit --brief. It prints the review brief.

Options

ArgumentDescription
[PATH]Scope reported findings to this file or directory (default: whole project). The full project graph is still built; only reported items are narrowed

Scope

OptionDescription
--production-dead-codeRun dead-code analysis in production mode for this audit
--production-healthRun health analysis in production mode for this audit
--production-dupesRun duplication analysis in production mode for this audit
--only <ONLY>Run only these sub-analyses (comma-separated: dead-code, architecture, dupes, health), with the same values as bare fallow --only. Replaces the audit.deadCode, audit.health and audit.dupes selection.
--skip <SKIP>Skip these sub-analyses (comma-separated: dead-code, architecture, dupes, health), with the same values as bare fallow --skip, on top of the audit.* selection
--no-cssDisable styling analytics in audit
--css-deep, --no-css-deepEnable deep CSS analysis for audit explicitly: project-wide styling reachability, narrowed back to changed anchors. Deep CSS is on by default; use this to override audit.cssDeep = false
--stagedAudit the staged index instead of the working tree. The changed files are the staged changes against HEAD (git diff --cached), and the analysis reads every file from the index, so unstaged edits and untracked files do not affect the verdict.

Baselines

OptionDescription
--dead-code-baseline <DEAD_CODE_BASELINE>Compare dead-code issues against a saved baseline (produced by fallow dead-code --save-baseline)
--health-baseline <HEALTH_BASELINE>Compare health findings against a saved baseline (produced by fallow health --save-baseline)
--dupes-baseline <DUPES_BASELINE>Compare duplication clone groups against a saved baseline (produced by fallow dupes --save-baseline)

Coverage

OptionDefaultDescription
--max-crap <MAX_CRAP>Maximum CRAP score threshold (overrides config, default 30.0). Functions meeting or exceeding this score cause audit to fail.
--coverage <PATH>Path to Istanbul coverage data (coverage-final.json) or raw V8 coverage (a NODE_V8_COVERAGE directory or one V8 JSON file) for accurate per-function CRAP scores in the health sub-analysis. Also configurable via FALLOW_COVERAGE or health.coverage
--coverage-root <PATH>Absolute prefix to strip from coverage data paths before CRAP matching. Use when coverage was generated under a different checkout root in CI or Docker.
--runtime-coverage <PATH>Runtime coverage input. Accepts a V8 directory, a single V8 JSON file, or an Istanbul coverage map JSON.
--min-invocations-hot <MIN_INVOCATIONS_HOT>100Threshold for hot-path classification, passed to the runtime coverage add-on when --runtime-coverage is set
--mutation-report <FILE>Saved fallow mutation --format json report (for example .fallow/mutation/last-report.json). The review brief counts the surviving mutants on the added lines of each changed file in the mutation component of the focus score.

Gates

OptionDescription
--gate <GATE>Which findings affect the audit verdict. new-only (default): fail only on findings introduced by the current changeset. all: fail on every finding in changed files and skip base-snapshot attribution.
--worsened <WORSENED>How a worsened complexity finding affects the audit verdict. A worsened finding was already in the base snapshot, and a measured value is higher now. Values: warn, error, off.

Review

OptionDefaultDescription
--briefRender the deterministic review brief instead of the gating audit report. The brief answers "where do I look?" rather than "will CI block this?", runs the same analysis, and always exits 0 (the verdict is carried informationally).
--max-decisions <N>4Cap on the number of consequential structural decisions surfaced in the review brief's decision surface (the working-memory limit). Default 4; clamped to the range 3 to 5.
--walkthrough-guideEmit the walkthrough guide for an agent: the current digest (brief + decision surface), the review direction, the JSON schema the agent must return, and a deterministic graph-snapshot hash pinned into the digest. The digest is built from the graph only (PR prose is never folded in, so it is injection-resistant).
--walkthrough-file <PATH>Read the judgment JSON of an agent and check it against the current graph. Rejects any judgment whose signal_id fallow did not emit; refuses the whole payload as stale when the echoed graph-snapshot hash no longer matches (the tree moved); rejects an action outside block, address, consider, fyi (invalid-action).
--walkthroughRender the existing walkthrough guide as a staged terminal tour for a person (Stage 1 load-bearing / Stage 2 mechanical), or markdown with --format markdown. Implies the brief; always exits 0.
--mark-viewed <PATH>Record one or more changed files as viewed in the local walkthrough viewed-state ledger (.fallow/walkthrough-state.json), then render the tour. Files already viewed (and still current) collapse into the Cleared panel.
--show-clearedExpand the Cleared panel in the human/markdown walkthrough tour: list each de-prioritized and already-viewed file instead of the collapsed one-line summary. Only consulted on the --walkthrough path
--show-deprioritizedExpand the de-prioritized units in the review brief's weighted focus map ("show me what you de-prioritized"). The deprioritized escape-hatch list is always present in --format json regardless; this flag only re-expands the collapse-by-default human focus render.

The global options are in these groups: Project, Output, Scope, Baselines, Gates, Duplication, Type-aware, Performance.

fallow audit also accepts the global options, with these exceptions:

  • --baseline and --save-baseline exit with code 2. Use --dead-code-baseline, --health-baseline and --dupes-baseline, or the audit.deadCodeBaseline, audit.healthBaseline and audit.dupesBaseline config keys.
  • --fail-on-issues has no effect. The verdict sets the exit code.
  • --fail-on-stale-baseline never runs in an audit, because the audit cannot judge a whole-project baseline.
  • The badge format exits with code 2.

Option details

Base ref

Fallow takes the first base that it finds:

  1. --base or --changed-since
  2. the FALLOW_AUDIT_BASE environment variable
  3. the merge-base with the upstream of the branch, else with origin/HEAD, origin/main or origin/master
  4. the local main or master branch, when the repository has no origin remote

A base that git cannot resolve exits with code 2. --staged compares the staged files with HEAD and reads each file from the index (see Git hook behavior for pre-commit integration). It cannot go together with --base.

The detected base is a merge-base commit, not a branch name. So a feature branch compares with the commit where it forked, also when the local main is old. When the branch has no common ancestor with the remote branch, for example in a shallow clone, fallow uses the tip of the remote branch.

The detected base also gives the merge commits rule. --base and FALLOW_AUDIT_BASE give one base only.

Gate values

The --gate value is the audit gate. The Audit scope line of the output is another thing: the changed files and the base.

--gate valueEffect
new-onlyThe default. Fallow also analyzes the base, and only the findings that the change introduces count for the verdict. Each finding has introduced: true or false. An inherited finding has introduced: false in JSON, and it does not fail the verdict.
allEach finding in the changed files counts. Fallow does not analyze the base, so the run is faster.

The audit.gate config key sets the default.

Under each gate value, fail exits with code 1, and pass and warn exit with code 0 (Verdicts). Without --base, fallow takes the base from FALLOW_AUDIT_BASE or the merge base (Base ref).

Worsened complexity findings

Under new-only, a complexity finding that the base already has is worsened when its cyclomatic complexity, its cognitive complexity or its CRAP score grew, or when the function grew by 5 lines or more. --worsened, or the audit.worsened config key, sets the effect:

ValueEffect
warnThe default. The verdict is at least warn. The exit code stays 0.
errorA worsened finding counts as an introduced finding.
offOnly the growth of a metric that the finding already exceeds counts as worsened.

--worsened has no effect with --gate all.

The line count is the physical span of the function, so comments and blank lines count. The minimum of 5 lines keeps a short comment or a formatter rewrap from making a finding worsened. Fallow compares the CRAP score only when the base finding and the head finding both have a score. For example, a function that grows from 80 to 300 lines with the same complexity is worsened.

The growth of a metric that the finding already exceeds is worsened while the finding stays in its severity tier (moderate, high or critical). The finding is introduced in two cases:

  • The growth of an exceeded metric moves the finding to a higher severity tier.
  • The finding now exceeds a metric that the base finding did not exceed, and that metric grew.

The tiers are the fixed severity bands of fallow health, not your thresholds. The exceeded metrics and the tier of the base finding come from the base run. So a threshold change in the same change, for example in health.thresholdOverrides, does not make an old finding introduced.

The human, compact and markdown output have a Worse than base section. It lists each complexity finding with a grown value, with the base value and the head value. A compact record has this shape:

worse-than-base:src/parser.ts:45:parseExpression:attribution=worsened,line_count=80->300

Estimated CRAP

Without coverage data, fallow estimates the CRAP score from static test reachability. The estimate does not measure the change. Under new-only:

  • A finding that exceeds only the CRAP threshold with an estimated score has effective_severity: "warn". It stays in the report, makes the verdict at least warn, and does not fail the audit. SARIF reports it at level warning.
  • A finding that also exceeds the cyclomatic or the cognitive threshold keeps the severity of its complexity-* rule.
  • An estimated CRAP score never makes a matched finding introduced. When the score grows, the finding is worsened.

A measured score can fail the audit. It comes from --coverage, health.coverage, FALLOW_COVERAGE or runtime coverage. --gate all does not use this rule.

Clone groups

The introduced-clone-group key in rules sets the effect of a clone group on the verdict:

SeverityEffect
warnThe default. The verdict is at least warn. The exit code stays 0.
errorThe clone group fails the audit with exit code 1.
offThe clone group stays in the report, and does not change the verdict.

Under new-only, only a clone group that the change introduces counts. Under all, each clone group in the changed files counts. Fallow also accepts the plural key introduced-clone-groups.

With overrides, fallow resolves the rule for the file of each instance, and the most severe result applies. So an override cannot exempt a clone group that has an instance outside the override. To keep generated code out, use duplicates.ignore or ignorePatterns.

The rule does not change duplicates.threshold. The threshold reads the same clone groups, and it can fail the audit also when the rule is off.

Quiet report

With --quiet, the human, compact and markdown reports show only what the change must act on. FALLOW_QUIET=1 gives the same report. --ci also sets quiet, but its default format is SARIF.

The quiet report keepsThe quiet report drops
Introduced and worsened findingsInherited findings that the change did not make worse
Diff-risk findingsThe health score, the vital signs, the file scores, the hotspots, the targets, the trend and the CSS analytics
Config errors, analysis failures and warnings about an incomplete analysisThe stale and active records of health.thresholdOverrides
The insufficient and no_match records of health.thresholdOverrides

When nothing is left, the human and markdown reports print No introduced or worsened findings., and the compact report is empty. Under --gate all, each finding counts, so the quiet report keeps all findings. The verdict, the exit code and the other formats use the complete result.

How new-only matches findings

Under new-only, fallow runs the analyses on the head and on the base, and compares the keys of the findings. A key holds no line, so a line shift above a finding keeps it inherited.

  • Dead code. The key is the rule, the root-relative path and the names, the same input as the finding_id. The keys compare by count, so a second finding with the key of an inherited finding is introduced. An unlisted dependency has the package name as its key, so a new import of a package that the base already reports stays inherited.
  • Complexity. A finding matches its base finding by the root-relative path and the function name. The line and the exceeded metric do not affect the match, and a renamed file keeps its match. When a file has two or more functions of one name, each base finding matches at most one head finding. Findings with the same values and the same line count match first, then findings with the same values, then the others in line order.
  • Clone groups. The key holds the files, the token count, the line count and a hash of the text.

A change that moves code to another file gives it a new path. Fallow then looks for the base finding in the other changed or deleted files:

  • A moved function takes a base finding of the same name from another changed or deleted file. Findings with the same values match first. Then one remaining head finding and one remaining base finding of a deleted file match, and a moved function that grew is worsened. When two or more functions of one name moved and changed, they stay introduced.
  • A moved unused symbol (an export, a type, an enum member, a class member and the like) is inherited when the base reports the same rule and symbol in another changed or deleted file, and the change adds a line with the symbol to the new file. Each base finding matches one head finding, so a copy of moved code is introduced. A dependency finding or a suppression finding never moves.
  • A moved clone group is inherited when the base has a group with the same token count, line count and text, in files that the change touched or deleted. A clone group whose text changed in the move stays introduced.

A base finding in a file that the change did not touch never matches. A function in such a file still exists, so a new function of the same name in another file is new.

A merge of the default branch brings in code that the default branch already has. When fallow detects the base, it also analyzes these commits: MERGE_HEAD of a merge in progress, and the merge base with the remote default branch after a merge commit. A finding that one of these commits has is inherited. So the gate does not block a merge commit or the push after it. Code from a merged branch that the default branch does not hold stays introduced.

Classes that the base cannot prove

The base checkout holds committed files only. A file that git ignores, for example a workspace member that CI clones into the repository, is not in it. The base run then cannot prove some dead-code classes, and skips them. This applies to unused catalog entries while a workspace pattern points to a directory that does not exist.

The head run can see these files and reports the class. Under new-only, each finding of such a class is inherited, also a really new one. The human output counts these findings in the line audit gate excluded N inherited findings. To gate each finding of the class, use --gate all.

Complexity findings in test files

A complexity finding in a test file never fails the audit, under each gate. A long it(...) callback often exceeds the cognitive threshold, and the gate is for production code. Test files are, for example, spec files (*.test.*, *.spec.*, *.e2e.*), files below a test directory (__tests__/, test/, tests/, e2e/), and mocks and fixtures (__mocks__/, fixtures/, *.fixture.*).

The finding stays in the report with its attribution. In JSON, it has effective_severity: "warn" and gate_exemption: "test-file". It makes the verdict at least warn. The human, compact and markdown output list it under Test files, not gated. A compact record has this shape:

gate-exemption:src/__tests__/build.spec.ts:34:it("builds the bundle"):test-file

fallow health reports these findings at the severity of their rule.

Docs-only fast path

Under new-only, fallow does not analyze the base when no changed file can change a finding. Each changed file must be one of these:

  • a document: .md, .markdown, .txt, .rst or .adoc
  • a .ts, .tsx, .js, .jsx, .mjs, .mts, .cjs or .cts file with the same tokens as at the base, for example after a change of comments or whitespace

The head findings then stand for the base, and each finding is inherited. A source file that holds fallow-ignore, a JSDoc visibility tag such as @public or @internal, @expected-unused or import( does not qualify, because a comment change there can change a finding. With health.maxFileLines, a source file must also keep its line count.

No option turns the fast path on or off. To see if it ran, pass --performance: the JSON output then has base_snapshot_skipped, and the human output prints base_snapshot_skipped: true on stderr.

New-only duplication demotion

Under new-only, fallow demotes an introduced clone group to inherited when no instance overlaps an added line of the diff. This happens when a change removes duplication elsewhere, and a clone group that stays gets a new key. The change wrote no duplicated line, so the group does not fail the gate. The stderr note names the demotion and the diff that decided it:

audit gate excluded 3 inherited findings (run with --gate all to enforce)
  of which 1 clone group was reclassified as pre-existing: no duplicated line was added by this change (diff source: merge-base worktree diff vs main)

With --explain, the duplication section adds one line for each demoted group, with its dup: handle, its instances and the rule. In JSON, a demoted group has demotion_reason (no-added-lines), and attribution.duplication_demoted counts the demoted groups.

A diff from --diff-file, --diff-stdin or FALLOW_DIFF_FILE wins over the merge-base diff. A diff with a narrower base, for example of the last commit only, can demote duplication that the branch added. Compute a diff from the same base as the audit. Without a diff, fallow skips this rule, and each introduced clone group counts.

Baselines in an audit

An audit loads the baselines that you pass, but it does not judge them. It analyzes only the changed files, so a whole-project baseline matches less of the run. Each loaded baseline has a baseline_staleness object:

SectionObjectscope_reasons
Dead codedead_code.baseline_stalenesschanged-since
Duplicationduplication.baseline_stalenesschanged-files
Complexitycomplexity.summary.baseline_stalenesschanged-files

Each object has change_scoped: true and gate_trips: false, except for a file of another kind. gate_outcomes["stale-baseline"] is {"status": "skipped", "enforced": false}, with one entry for each run. --fail-on-stale-baseline never runs in an audit, and prints a note that names the commands that run it. To judge a baseline, run fallow dead-code, fallow dupes or fallow health on the whole project.

The audit checks the kind of each baseline. A baseline of another command suppresses nothing. For each such file, fallow prints a note on stderr that names the command that saved it, the path and the option to correct, for example --dead-code-baseline. That section then has unrecognised_format: true, saved_by and gate_trips: true. --fail-on-baseline-growth runs in an audit: it compares each baseline file with the same file at the base ref (Baseline growth gate).

Output

Audit scope: 3 changed files vs main (a5ee3ae..HEAD)

โ”€โ”€ Dead Code โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

โ”€โ”€ Unused Code โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

โ— Unused exports (1)
  src/services/cart-report.ts
    :25 cartTotalCents
  Exported symbols with no known consumers
  https://fallow.tools/docs/explanations/dead-code/#unused-exports

โœ— 1 export (0.10s)

โ”€โ”€ Duplication โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
note: skipped 1 file matching default duplicates ignores
  (--explain-skipped for the list)
note: module wiring excluded from clones
  (duplicates.ignoreImports: false to include it)

โ— Duplicates (1 clone group)

     17 lines  3 instances  spread 2  dup:f42424e8
    src/reports/export.ts:3-19
    src/services/cart-report.ts:7-23
    src/utils/summary.ts:7-23

  Duplicate code blocks
  https://fallow.tools/docs/explanations/duplication/#clone-groups

โš  51 lines (23.0%) duplicated across 3 files (0.01s)

โ”€โ”€ Complexity โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€

โ–  Metrics: 122 LOC ยท dead files 0.0% ยท dead exports 16.7% ยท avg cyclomatic 5.3 ยท p90 cyclomatic 23 ยท maintainability 84.1 (moderate) ยท 1 unused dep
  Cyclomatic units: functions 8, module scopes 0, templates 0

โ— High complexity functions (2)
  No coverage file found, so CRAP scores are a static estimate. Pass `--coverage <coverage-final.json>` for measured scores, or raise `health.maxCrap`.
  src/services/customers.ts
    :10 classifyCustomer CRITICAL
          23 ! cyclomatic   32 ! cognitive   39 lines
         552.0 ! CRAP
  src/services/cart-report.ts
    :27 discountFor CRITICAL
          12   cyclomatic   30 ! cognitive   22 lines
         156.0 ! CRAP
  Functions exceeding cyclomatic, cognitive, or CRAP thresholds; ! marks the
  dimension that breached
  https://fallow.tools/docs/explanations/health/#complexity-metrics

โœ— 2 above threshold ยท 8 analyzed (0.00s)
โœ— dead code: 1 issue ยท complexity: 2 findings ยท duplication: 1 clone group ยท 3 changed files (0.26s)
  audit gate excluded 1 inherited finding (run with --gate all to enforce)
  • The first line gives the number of changed files and the base.
  • Each analysis has a section with the findings in the changed files, in the format of its own command.
  • When the change has a diff-risk finding, a Diff risk section lists it.
  • The last line gives the verdict (โœ“ pass, โš  warn, โœ— fail) and the counts.

Verdicts

VerdictExit codeWhen
pass0No finding counts for the gate.
warn0Each finding that counts has warn severity.
fail1A finding that counts has error severity.

The parse error gate and --fail-on-baseline-growth can also exit with code 1. They are not part of verdict: read gate_outcomes.

JSON output

With --format json, the output starts like this. The example leaves out the lists of findings and some counts:

{
  "kind": "audit",
  "schema_version": 14,
  "version": "3.51.0",
  "command": "audit",
  "verdict": "warn",
  "changed_files_count": 2,
  "base_ref": "main",
  "base_description": "local main",
  "head_sha": "87067c4",
  "summary": {
    "dead_code_issues": 0,
    "dead_code_has_errors": false,
    "complexity_findings": 0,
    "max_cyclomatic": null,
    "duplication_clone_groups": 1
  },
  "attribution": {
    "gate": "new-only",
    "worsened": "warn",
    "duplication_introduced": 1,
    "duplication_inherited": 0
  },
  "dead_code": {
    "schema_version": 11,
    "total_issues": 0
  }
}

The audit output and the dead_code object each have their own schema_version. The output has these top-level fields:

FieldContent
kind"audit". The review brief gives "audit-brief".
schema_version, version, elapsed_msThe version of this output format, the fallow version and the run time.
verdictpass, warn or fail. Use this field, or the exit code, to gate CI.
command"audit".
changed_files_count, base_ref, base_description, head_shaThe changed files, the base, how fallow found the base (for example local main), and the commit of the run.
base_snapshot_skippedOnly with --performance. true when the docs-only fast path ran: the head findings stood for the base, and each finding is inherited.
summaryThe counts of all findings in the changed files, at each severity: dead_code_issues, dead_code_has_errors, complexity_findings, max_cyclomatic, duplication_clone_groups. dead_code_skipped, complexity_skipped and duplication_skipped are true when --only or --skip left out an analysis.
attributiongate, worsened, and the counts <analysis>_introduced and <analysis>_inherited for dead_code, complexity, duplication and styling. Also complexity_worsened, duplication_demoted and diff_risk_introduced. Under gate: all, the introduced and inherited counts are 0.
gate_outcomesThe audit-verdict gate, and each other gate of the run.
dead_code, duplication, complexityThe results of fallow dead-code, fallow dupes and fallow health for the changed files. Each finding has introduced. A complexity finding has attribution (introduced, worsened or inherited) and worsened_metrics.
diff_riskAn object with a findings array. Each finding has rule, kind, path, line, message, evidence, severity, introduced, actions, and related when it applies. Absent when the change has no diff-risk finding.
next_stepsCommands to run next.
_metaMetadata of the run, for example telemetry.analysis_run_id.

The summary and attribution counts do not use the severity. Gate on verdict. The JSON output reference has each field.

Some fields of the findings are only in an audit:

FieldContent
complexity.findings[].worsened_metricsOne entry for each value that grew against the matched base finding: metric (cyclomatic, cognitive, crap or line_count), base and head. Absent when no value grew.
complexity.findings[].effective_severity, gate_exemptioneffective_severity: "warn" for an estimated CRAP score or a test file. gate_exemption is test-file for a test file.
duplication.clone_groups[].demotion_reasonOnly on a demoted clone group, for example no-added-lines. The set is open.
attribution.complexity_worsenedThe worsened complexity findings. complexity_inherited also counts them.
attribution.duplication_demotedThe demoted clone groups. duplication_inherited also counts them.
attribution.diff_risk_introducedThe diff-risk findings. Unlike the other counts, it counts under each gate.

Review comments

In the review-github and review-gitlab formats, the comment of a finding names its attribution after the severity: introduced, worsened or inherited. When the gate does not count the finding, the label gives the cause, for example **error** (inherited, not gated: `--gate new-only`). The other causes are --worsened warn, --worsened off and test file. Under --gate all, the label has only the severity.

The comment of an inherited complexity finding also names each exceeded metric with its base and head values, for example (inherited from the base: cyclomatic 23 -> 19, cognitive 22 -> 18). The codeclimate output has the same text. The JSON output does not keep the base values, so fallow report --from on a saved audit shows the comment without them.

Diff-risk rules

A diff-risk rule reports a fact about the change itself. Fallow compares the base text and the head text of each changed file, so each finding is introduced. Only fallow audit and the MCP audit tool run these rules. A finding has only suppression actions. Set the severity of each rule in rules.

weakened-tests

weakened-tests, default warn: the change makes the tests weaker. The kind field is skip-only, removed-tests, assertion-drop, coverage-threshold, rule-severity or ignore-pattern.

added-suppression

added-suppression, default warn: the change adds a lint, type-check, coverage or fallow suppression comment.

A finding for a fallow-ignore comment has a suppression object with kinds, reason and security_without_reason. Write the reason after --, for example // fallow-ignore-next-line security-sink -- the HTML is a constant template. When the comment hides security-sink or security-client-server-leak without a reason, security_without_reason is true:

"suppression": {
  "kinds": ["security-sink"],
  "reason": null,
  "security_without_reason": true
}

This signal does not change the severity, the verdict or the exit code. To find old security suppressions without a reason, run fallow suppressions --format json.

test-only-branch

test-only-branch, default warn: the change adds a check for the test environment in source code.

diverged-clone-sibling

diverged-clone-sibling, default off: the change edits one instance of a clone group, and the other instances stay the same. related lists the other instances.

added-dependency

added-dependency, default off: the change adds a dependency to a package.json. A package.json cannot hold a comment, so use an overrides entry to turn the rule off for a path.

Diff-risk findings in each format

FormatDiff-risk findings
humanA Diff risk section with one line for each finding.
compactOne record for each finding: <rule>:<path>:<line>:<evidence>,severity=<severity>, with ,kind=<kind> for weakened-tests. The line is 0 for a finding about a whole file.
markdownA Fallow: N diff-risk findings table with the location, the rule, the severity and the evidence.
jsonThe diff_risk object.
sarifA run with the automationDetails.id fallow/audit/diff-risk/, and the rule ids fallow/<rule>.
codeclimateIssues with the check name fallow/<rule>.
github-annotationsOne annotation for each finding: ::error or ::warning.

For example, a change that adds a @ts-ignore comment gives this compact record:

added-suppression:src/services/customers.ts:1:@ts-ignore,severity=warn

Review brief

--brief, or fallow review, prints the review brief: the same analysis, sorted by where a reviewer must look. The brief always exits with code 0. It has the kind "audit-brief", and these fields next to the audit fields:

FieldContent
decisionsThe structural decisions of the change, at most --max-decisions. fallow decision-surface describes each field.
focusThe changed units in review_here and deprioritized. Each unit has file, label, a score (a sum of named components and a total) and a reason. An absent component is zero.
branchingThe total branching of the change against the number of functions that hold it. Absent when fallow did not analyze the base.
triageThe size class of the change.
deltasWhat the change adds, for example dependency_added and dependency_major_bumped.
weakeningThe guardrails that the change makes weaker: kind (test-weakened, threshold-lowered, suppression-added, security-check-removed), file and evidence.
impact_closureThe files outside the diff that the change reaches: affected_count, a sample, affected_by_dir, coordination_gap, search_gap and co_change_gap.
partitionindependent_slices when the change splits into two or more parts that do not import each other.
test_reachFor each changed value export, how tests reach it: direct, transitive, mocked-only, none, none-file or framework. The set is open.
ownership, routingThe CODEOWNERS groups that the change reaches. Present only with a CODEOWNERS file.
graph_factsThe facts from the module graph that the brief uses.

The focus score components are fan_io, risk_zone, change_shape, churn, worsened, test_reach, mutation (with --mutation-report), runtime (with --runtime-coverage) and security_taint.

Focus score

ComponentSourcePresent when
fan_ioThe importers and the imports of the file.Always.
risk_zoneA new edge across zones, a wider public API, or a security taint path.Always.
change_shapeA new or wider export, or a changed contract that files outside the diff use.Always.
churnThe commits that changed the file in the last 12 months, weighted by age with a half-life of 90 days, in 3 bands.A git history exists, the clone is not shallow, and the file is not a test file.
worsenedThe changed functions whose complexity grew against the base.A base exists.
test_reachThe changed exports that no test runs for real: mocked-only, none or none-file.The project has tests.
mutationThe surviving mutants on the added lines. A file that changed after the mutation run adds nothing.--mutation-report is set.
runtimeThe invocations of a hot path.--runtime-coverage is set.
security_taintA security path from a source to a sink touches the file.A security pass feeds the brief.

Each component has a cap, so one signal cannot hide the others. The components only add, so you can see which component moved a file up. The reason names each present component, for example fan-in (1 importer), 1 changed export with no real test run. A unit with a total of 3 or more is review-here.

Without --mutation-report, fallow does not measure mutants, so an absent mutation component does not mean that each mutant was killed. The focus score does not change triage.risk_class, which depends only on the size of the change.

Weakening

The test-weakened, threshold-lowered and suppression-added entries come from the diff-risk findings of the same run. So they follow the rule severities and the suppressions: when you turn off weakened-tests or added-suppression, the brief drops the signal. The rule-severity and ignore-pattern kinds use the stricter of the old and the new weakened-tests severity.

security-check-removed comes from the brief only. It reports a security scan step that the change removes from a CI file. It also reports a security sink that the change replaces with a sink of the same class in the same source file, for example new Function sink replaced by vm.runInNewContext. A rule that flags one sink does not flag the other, so the swap silences the rule and keeps the risk. The classes are:

  • code execution: eval, new Function, vm.runIn*, vm.compileFunction and new vm.Script
  • HTML: innerHTML, outerHTML, srcdoc, insertAdjacentHTML, setHTMLUnsafe, createContextualFragment, document.write and dangerouslySetInnerHTML

A sink that moves into an object key under a JSX spread, into a computed member such as globalThis['eval'], or into an alias also reports. A sink that only moves in the file, or that goes away, does not report. Test files do not take part. The evidence text is free text: do not parse it.

Impact closure

impact_closure gives the reach of the change as a number, a sample and a distribution:

  • affected_count: the exact number of files outside the diff that the change reaches.
  • affected_not_shown: at most 10 of those files, in path order. It is the start of the sorted list, so it shows the first directory only. Do not read the shape of the reach from it.
  • affected_by_dir: { dir, count } rows, the largest count first, at most 25 rows. affected_by_dir_omitted counts the other directories.
  • coordination_gap: has no cap. It leaves out the story and test files that affected_count counts.
  • search_gap: the files outside the diff that use a changed export, and that a text search for the export name does not find (missed) or finds under another name (renamed). Each export has at most 10 consumers. A barrel file or another file that only exports the name again is never a gap. The fields of a consumer are the same as in a trace.
  • co_change_gap: the changed files that often changed together with a file outside the diff, with no import between them. Each entry has changed_file, partner_file, shared_revisions, degree (0 to 1) and note. At most 10 entries, the highest degree first. co_change_gap_count gives the full number. It is history evidence only, and never gates.

Partition and ownership

partition.independent_slices is present only with two or more slices. A slice is a set of module directories that import each other. Two slices mean that you can review and merge the parts apart. The field never asks you to split the change.

ownership reads the CODEOWNERS file only (the codeowners config path, else the standard places), so it needs no git history. Each file belongs to its primary owner: the first owner of the last rule that matches.

  • group_count: the owner groups of the changed files and of the impact closure. (unowned) counts as one group.
  • transitive_only_count: the groups that own no changed file, and that the change reaches only through the impact closure.
  • unowned_direct_count: the changed files that no rule owns.
  • groups: at most 10 { owner, direct_count, affected_count } rows, sorted by direct_count, then affected_count, then owner. groups_omitted counts the other groups.
  • slices: present with partition.independent_slices, in the same order. Each entry is { module_dirs, owners, separable }. separable is true when the slice has one owner.

A configured codeowners path that fallow cannot read prints a warning.

Test reach

test_reach covers each value export whose declaration overlaps an added line. Type-only exports, re-exports and exports of test files do not count. Fallow reads the reach from the module graph, so it needs no coverage run.

reachMeaning
directA test file uses the export.
transitiveTests reach the export only through other modules.
mocked-onlyOnly tests that replace a module on the import path with a closed vi.mock or jest.mock factory use the export. The real code does not run in those tests.
noneTests load the file, but no module that tests reach uses the export.
none-fileNo test loads the file.
frameworkA framework reads the export as config with a literal value, for example the Next.js revalidate option.
  • status: measured, or no-tests when the project has no test files. Then each export counts as none-file, and exports is empty.
  • masking: active when a test uses a closed mock factory, no-mocks when no test does, and capped above 1024 distinct mock sets. With capped, a mocked module counts as reached.
  • total and counts: the number of changed value exports, and the number for each reach value.
  • exports: at most 25 rows that need attention, in the order mocked-only, none, none-file, transitive. Each row has file, export_name, line, reach and change (new or modified). A mocked-only row also has tests, tests_total, test_changed and mocked_targets. exports_omitted counts the other rows.
  • e2e_runner: true when the project uses Playwright or Cypress. End-to-end tests do not import source files, so the reach values do not count them.

Read an unknown reach value as "needs attention". A change inside a helper that is not exported does not count for the exports that call it. An automock without a factory (vi.mock('./x')) counts as reach. A file that only a setup file or an import type reaches gets none-file.

Walkthrough contract

--walkthrough-guide --format json prints a guide for a reviewing agent, with the kind "review-walkthrough-guide". It has digest, direction, change_anchors, graph_snapshot_hash, agent_schema and injection_note. The agent returns a JSON file with the echoed graph_snapshot_hash and a judgments array. Each judgment cites a signal_id or a change_anchor from the guide, and has framing, an optional concern and an optional action (block, address, consider or fyi).

--walkthrough-file <PATH> checks the judgments against the current module graph:

OutcomeCondition
acceptedThe signal_id or the change_anchor is one that fallow gave, and the graph did not change. anchor_kind is signal or change.
rejected, unanchored-signal-idFallow did not give the signal_id.
rejected, unknown-change-anchorFallow did not give the change_anchor.
rejected, invalid-actionThe action is not in the list. invalid_value holds the value.
rejected, stale-snapshotThe graph_snapshot_hash does not match the current graph. Get a new guide.

Keep the guide and the judgment file outside the project, for example in the temp directory. A new file in the project changes the graph hash, and fallow then refuses the judgment as stale-snapshot.

Fallow builds the digest from the module graph only, and never adds the text of a pull request. So text in the change cannot steer the guide. An accepted judgment has the text of the agent in agent_framing, with deterministic: false. The framing and the action never gate.

FieldContent
direction.units[].test_adjacencynone: no test file imports the unit. untouched: a test imports the unit, and the diff changes no such test. changed: the diff also changes a test that imports the unit. A mock, a fixture or a snapshot does not count as a test. Absent for a test file.
agent_schema.action_vocabularyThe values of action: block and address (the author must act), consider (optional) and fyi (no action).
agent_schema.concern_vocabularyThe suggested values of concern: abstraction, coupling, data-model, error-handling, control-flow, performance, dependencies, api-ergonomics, compatibility, state-ownership, extensibility, testability and trust-boundary. Other text is accepted.
change_anchorsOne chg: id for each changed hunk, from the path and the added text, without line numbers. An edit above the hunk or a change of whitespace keeps the id. After a rename, previous_change_anchor holds the id under the old path.

A change_anchor proves only that the region changed, so it is a weaker anchor than a signal_id. An accepted judgment repeats the concern and the action of the agent.

Exit codes

CodeMeaning
0The verdict is pass or warn. The review brief always exits with 0.
1The verdict is fail, or another gate of the run failed.
2Invalid input, for example a base ref that git cannot resolve, or --baseline. Also a snapshot directory that is not private to the user, see The base checkout.
3 to 6With --runtime-coverage: the license or the runtime coverage step failed.

Exit codes has the meaning of each code.

Examples

# Check the current branch against its merge-base
fallow audit

# Check the change against main, as JSON for CI
fallow audit --base main --format json --quiet

# Check only the staged files before a commit
fallow audit --staged

# Fail also on the findings that the change did not introduce
fallow audit --gate all

# Check only duplication and health
fallow audit --skip dead-code

# Hide the findings in saved baselines
fallow audit --dead-code-baseline fallow-baselines/dead-code.json --health-baseline fallow-baselines/health.json

# Show the review brief
fallow review --base main