normalize-rules 0.3.2

Rule orchestration and CLI service for normalize (syntax + fact + native + SARIF engines)
Documentation
1
2
3
4
5
6
7
8
9
10
11
Rule orchestration crate for normalize. Owns all rule management logic extracted from the main normalize crate.

Key modules:
- `src/runner.rs` — unified rule runner: list, run (syntax+fact+native+SARIF), show, tags, enable/disable, add/update/remove. Contains `RuleKind`, `RulesRunConfig`, `SarifTool`, `RulesListReport` + `RuleEntry` (structured list output with `OutputFormatter`), `build_list_report()`, `run_rules_report()`, `apply_native_rules_config()`, `collect_fact_diagnostics()`, and diagnostic conversion helpers (`finding_to_issue`, `abi_diagnostic_to_issue`). `enable_disable`, `show_rule`, and `list_tags` return `String` (callers print); `ListFilters` holds only `type_filter`, `tag`, `enabled`, `disabled` (no rendering flags). `try_fact_rules_via_daemon()` routes fact-rule evaluation through the daemon socket (`RunRules` request) when it is running, serving results from the warm `ENGINE_CACHE`; falls back to cold eval when daemon is unavailable.
- `src/loader.rs` — `format_diagnostic` helper for rendering fact-rule diagnostics to text. Dylib rule pack discovery and loading have been removed; no dynamic library loading occurs.
- `src/cmd_rules.rs` — syntax rule CLI command handler (tree-sitter based, mirrors former `commands/analyze/rules_cmd.rs`).
- `src/service.rs` — `RulesService` with `#[cli(description = ...)]` proc-macro registration for server-less 0.4.0; feature-gated behind `cli`. Per-rule timing diagnostics use `eprintln!("[timings] rule-name: {:.1?}", elapsed)` (stderr always, no tracing subscriber needed). Advisory native rules include `dead-parameter` (scope-based unused parameter detection, default disabled) alongside `long-file`, `high-complexity`, `long-function`, and `stale-doc`.

`RulesRunConfig` packages the rule-related config fields (syntax rules, fact rules, SARIF tools, rule-tags) without depending on `normalize`'s `NormalizeConfig`. `load_rules_config()` in `service.rs` parses these fields directly from `.normalize/config.toml`.

Recent: per-rule config migrated to `[rules.rule."<id>"]` namespace (legacy layout still parsed with deprecation warning); syntax-rules walker uses gitignore-style `[walk] exclude` patterns (not filename-only); single-file target routes to daemon per-file fast path; mtime-based SARIF tool cache via `watch` globs; `normalize rules test` command with inline error annotations; parallel effective-files walk for native rules.