Skip to content

feat(pipeline): add dynamic source detection and parsing#86

Merged
mostafa merged 2 commits intomainfrom
feat/dynamic-pipelines
May 6, 2026
Merged

feat(pipeline): add dynamic source detection and parsing#86
mostafa merged 2 commits intomainfrom
feat/dynamic-pipelines

Conversation

@mostafa
Copy link
Copy Markdown
Member

@mostafa mostafa commented May 6, 2026

Summary

  • Introduce dynamic Sigma pipeline support (Phase 1: detection and parsing only, no runtime behavior change)
  • Pipelines can now declare external data sources (http, command, file, nats) in a sources section and reference them anywhere via ${source.<id>} template expressions or include directives
  • Parser cross-validates that every template reference names a declared source, and surfaces CLI/daemon warnings when dynamic pipelines are loaded

What this adds

  • New module pipeline/sources.rs with types: DynamicSource, SourceType, RefreshPolicy (Once/Interval/Watch/Push/OnDemand), ErrorPolicy, DataFormat, SourceRef, RefLocation, SourceStatus
  • Pipeline struct gains sources and source_refs fields with is_dynamic() and dynamic_references() accessors
  • Parser handles the sources section, scans all string values for ${source.*} templates, detects include directives, and validates references
  • PipelineState tracks per-source resolution status (pending/resolved/failed) for future use
  • CLI/daemon emit structured warnings when dynamic pipelines are detected but source resolution is not yet supported
  • Transformation::Include variant added as a no-op placeholder for unresolved include directives
  • 28 new unit tests covering all source types, refresh policies, template detection, cross-validation, defaults, and error cases

What this does NOT do

Source resolution (actually fetching data from HTTP/commands/files/NATS and expanding templates) is a follow-up. This PR lays the data model and parser infrastructure so rsigma can recognize, validate, and report on dynamic pipelines without changing any runtime evaluation behavior.

Test plan

  • All 28 new pipeline tests pass
  • Full workspace test suite passes (1000+ tests, zero failures)
  • cargo clippy --workspace --all-targets --all-features -- -D warnings clean
  • cargo fmt --all -- --check clean
  • Existing static pipeline tests unaffected

mostafa added 2 commits May 6, 2026 19:46
Introduce Phase 1 of dynamic Sigma pipelines: the ability for pipeline
YAML to declare external data sources and reference them via ${source.*}
template expressions. This commit adds the data model, parser, cross-
validation, state tracking, and CLI/daemon warnings. No runtime behavior
change; source resolution will come in a follow-up.

New types: DynamicSource, SourceType (Http/Command/File/Nats),
RefreshPolicy, ErrorPolicy, DataFormat, SourceRef, RefLocation,
SourceStatus.

Pipeline struct gains `sources` and `source_refs` fields with
`is_dynamic()` and `dynamic_references()` accessors.

Parser handles the `sources` section, scans all string values for
${source.*} templates, detects `include` directives, and cross-validates
that every reference names a declared source.

PipelineState tracks per-source resolution status for future use.

CLI and daemon emit warnings when dynamic pipelines are loaded but
source resolution is not yet supported.

Includes 28 new unit tests covering all source types, refresh policies,
template detection, cross-validation, and error cases.
@mostafa mostafa merged commit b51eef7 into main May 6, 2026
12 checks passed
@mostafa mostafa deleted the feat/dynamic-pipelines branch May 6, 2026 17:58
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