feat(pipeline): add dynamic source detection and parsing#86
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
http,command,file,nats) in asourcessection and reference them anywhere via${source.<id>}template expressions orincludedirectivesWhat this adds
pipeline/sources.rswith types:DynamicSource,SourceType,RefreshPolicy(Once/Interval/Watch/Push/OnDemand),ErrorPolicy,DataFormat,SourceRef,RefLocation,SourceStatussourcesandsource_refsfields withis_dynamic()anddynamic_references()accessorssourcessection, scans all string values for${source.*}templates, detectsincludedirectives, and validates referencesTransformation::Includevariant added as a no-op placeholder for unresolved include directivesWhat 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
cargo clippy --workspace --all-targets --all-features -- -D warningscleancargo fmt --all -- --checkclean