Expand description
Rules engine for code-moniker. Owns the rule DSL, rule configuration and
profiles, evaluation over the symbol graph, suppression, and the file/project
scan pipeline. Produces structured FileReport/FileError values; it
does not render output or own process exit codes — that is the CLI’s job.
Modules§
- scenario
- Executable check scenarios: a Markdown document describing a file layout,
an inline rules overlay, and the violations the layout is expected to
produce. One document feeds an in-memory workspace the scan pipeline can run
against; see
docs/check-scenarios.mdfor the format contract. - workspace
Structs§
- Check
Request - Executable check request over either a file, a project root, or a filtered set of project-relative files.
- Check
Run - Structured result of a check request. It contains no terminal formatting or process exit policy.
- Check
Summary - Serializable aggregate counters for renderers and machine consumers.
- Compiled
Rule Spec - Compiled
Rules - Config
- Failed
Rule Summary - Per-rule failure count, sorted by severity and volume by
CheckRun. - File
Error - A per-file I/O or extraction failure, accumulated rather than aborting a project scan.
- File
Report - One scanned file’s rule outcome: the suppression-filtered violations and,
when
reportis requested, the per-rule observability counts. - FsCheck
Workspace - Memory
Check Workspace - Rule
Report - Rule
SetRequest - Ruleset construction contract shared by CLI, MCP, views, and harnesses.
- Source
Report - Rules and violations from evaluating one in-memory source.
- UriExclusion
Matcher - Violation
- Violation
Counts - Count of suppression-filtered violations in a check result.
Enums§
- Check
Skip Reason - Empty-scan reason. Renderers use it to preserve silent text hooks while still allowing structured JSON for intentionally empty scans.
- Default
Rules Selection - How a consumer wants embedded default rules to participate in a ruleset.
- Rule
Severity
Functions§
- apply_
suppressions - Strip violations suppressed by
// code-moniker: ignore(or#/--) directives in comment-defs of the graph. - check_
graph_ with_ config - check_
one_ file - check_
project - Project-mode scan. Per-file I/O errors are accumulated in
Vec<FileError>rather than aborting the scan. Rules are compiled once per language and shared across the parallel pool. - check_
project_ files - check_
project_ files_ workspace - check_
project_ workspace - check_
source_ with_ config - compile_
rules - Build the compiled rule set for a single
lang. Parses every rule expression, resolves aliases. Call once per language and reuse across many files of that language — the eval pipeline is shaped so the heavy work happens here, not per-file. - compiled_
specs_ with_ config - evaluate_
compiled - load_
with_ cli_ default_ rules - Load rule config with explicit CLI precedence for
--default-rules.Some(on|off)wins over the user config flag;Nonelets the user config decide and defaults to enabled. - load_
with_ overrides - Load the embedded defaults and merge
user_pathon top if it exists. Missing user config is not an error — defaults stand alone. - rule_
report_ compiled