kural audit
Run structural audits on a codebase snapshot and print categorized findings
Runs the 14 statistical checks against the current snapshot and prints findings grouped by category — outliers, merge candidates, containments, misplaced nodes, duplicates, vocabulary bleed, incoherent containers, weak identities, and incomplete docs.
Synopsis
kural audit [flags]audit reads the snapshot database in the current working directory. Generate it first with kural snapshot generate.
Flags
| Flag | Short | Type | Description |
|---|---|---|---|
--sensitivity <n> | -k | number | Standard deviations from mean to flag a value. Default 2.0. Higher values = stricter. |
--filter <list> | -f | string | Comma-separated audit categories to show (e.g. outliers,duplicates). Matches against section titles. |
--disable <list> | -d | string | Comma-separated audit names to skip entirely (e.g. incomplete-docs,vocabulary-bleed). |
--expand | -e | boolean | Show every finding per audit — disables the default truncation. |
--json | boolean | Emit machine-readable JSON instead of the formatted report. |
The sensitivity and disable defaults also come from .kural/config.json under the audits key — CLI flags override project config. See Configuration.
Examples
Run all audits at default sensitivity:
kural auditShow only outlier and misplaced findings, with every match expanded:
kural audit --filter outliers,misplaced --expandStricter threshold, skipping documentation checks:
kural audit -k 3.0 -d incomplete-docsEmit JSON for downstream tooling:
kural audit --json > audit.jsonWhen to use it
- After regenerating a snapshot, to see what structural issues the new state introduces.
- Before a refactor, to pick the highest-value target — outliers and duplicates surface move-or-merge candidates directly.
- In CI, via
--json— consume the report to fail builds on newly introduced findings.
Related
- Concept: Audits — what each of the 14 checks computes and why.
- Suppression: Kural Params —
@kuralResidual,@kuralBound, and@kuralHelpersuppress specific audits by design. - Companion:
kural score— aggregate health numbers that cross-validate with audit findings.