Skip to main content

Crate code_moniker_check

Crate code_moniker_check 

Source
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.md for the format contract.
workspace

Structs§

CheckRequest
Executable check request over either a file, a project root, or a filtered set of project-relative files.
CheckRun
Structured result of a check request. It contains no terminal formatting or process exit policy.
CheckSummary
Serializable aggregate counters for renderers and machine consumers.
CompiledRuleSpec
CompiledRules
CompiledWorkspaceRules
Config
FailedRuleSummary
Per-rule failure count, sorted by severity and volume by CheckRun.
FileError
A per-file I/O or extraction failure, accumulated rather than aborting a project scan.
FileReport
One scanned file’s rule outcome: the suppression-filtered violations and, when report is requested, the per-rule observability counts.
FsCheckWorkspace
IndexedCheckWorkspace
MemoryCheckWorkspace
RuleCoverage
RulePathReport
RulePathStep
RuleReport
RuleSetRequest
Ruleset construction contract shared by CLI, MCP, views, and agent integrations.
ScopeKey
SourceReport
Rules and violations from evaluating one in-memory source.
UriExclusionMatcher
Violation
ViolationCounts
Count of suppression-filtered violations in a check result.
WorkspaceEvaluation
WorkspaceGroupResult
WorkspaceLinkageError
WorkspaceSymbolViolation

Enums§

CheckSkipReason
Empty-scan reason. Renderers use it to preserve silent text hooks while still allowing structured JSON for intentionally empty scans.
DefaultRulesSelection
How a consumer wants embedded default rules to participate in a ruleset.
RuleSeverity
RuleVerdict

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.
compile_workspace_rules
compiled_specs_with_config
evaluate_compiled
evaluate_workspace_rules
evaluate_workspace_rules_linked
evaluate_workspace_rules_linked_in
load_with_cli_default_rules
Load rule config with explicit CLI precedence for --default-rules. Some(on|off) wins over the user config flag; None lets the user config decide and defaults to enabled.
load_with_overrides
Load the embedded defaults and merge user_path on top if it exists. Missing user config is not an error — defaults stand alone.
rule_report_compiled