Skip to content

refactor(eval): split correlation.rs into module directory#54

Merged
mostafa merged 1 commit into
mainfrom
feat/modularize-correlation
Apr 30, 2026
Merged

refactor(eval): split correlation.rs into module directory#54
mostafa merged 1 commit into
mainfrom
feat/modularize-correlation

Conversation

@mostafa
Copy link
Copy Markdown
Member

@mostafa mostafa commented Apr 30, 2026

Summary

  • Split crates/rsigma-eval/src/correlation.rs (1781 lines) into a correlation/ module directory with focused submodules for types, keys, buffers, window state, compilation, and tests
  • No functionality changes: pure restructuring with identical test results (366+ tests pass, full workspace clippy clean)

Test plan

  • cargo fmt --all -- --check passes
  • cargo clippy --workspace --all-targets --all-features -- -D warnings passes (zero warnings)
  • cargo test -p rsigma-eval passes (366 unit tests + 47 integration/doc tests, 0 failures)

Modularize the 1781-line correlation.rs into focused submodules for
maintainability. No behavior changes; identical test results
(366 unit tests pass).

New structure:
  correlation/
    mod.rs       -- module wiring and public re-exports
    types.rs     -- compiled correlation types and conditions
    keys.rs      -- group key extraction
    buffers.rs   -- event buffers and references
    window.rs    -- window state and aggregation helpers
    compiler.rs  -- correlation rule compilation
    tests.rs     -- all unit tests
@mostafa mostafa merged commit a867c82 into main Apr 30, 2026
8 checks passed
@mostafa mostafa deleted the feat/modularize-correlation branch April 30, 2026 18:34
mostafa added a commit that referenced this pull request May 15, 2026
Both the ASCII diagram in README.md and the Mermaid diagram in
assets/architecture.mmd lagged the codebase by several releases. Update
them to reflect:

- Dynamic Sigma Pipelines (v0.10.0): new sources/ subsystem inside
  rsigma-runtime with SourceResolver, TemplateExpander, SourceCache,
  RefreshScheduler, extract languages (jq, JSONPath, CEL), and the
  flow back into the eval pipeline via ${source.*} template expansion.
- Matcher optimizer and eval prefilters (v0.11.0): Aho-Corasick and
  RegexSet batching plus CaseInsensitiveGroup inside compiler/, and
  the prefilter layers (RuleIndex, bloom trigram filter, cross-rule
  AC index via daachorse) inside engine/.
- DLQ as a sink target and broaden hot-reload to rules + pipelines.
- Builtin pipelines (ecs_windows, sysmon).
- Rename single-file module references (compiler.rs, engine.rs,
  correlation.rs) to the directory module style that landed in the
  v0.9.0 modularization PRs (#53, #54, #55).
- Add a legend explaining * = feature-gated and ** = requires the
  daachorse-index feature.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant