Repository navigation
feat: add scalable enrichment benchmark path - #41
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a scalable, file-based Rust enrichment pipeline and updates the Python CLI wrapper to avoid loading large enriched payloads back into Python memory, plus scripts/docs to generate and benchmark large synthetic fixtures.
Changes:
- Implement two-pass streaming enrichment output in the Rust CLI (OID/CVE collection pass + streaming enrich/write pass).
- Update the Python
openvas-enrich-resultsCLI to pass Rust engine runs directly through to the Rust binary for large outputs. - Add synthetic fixture generation + a benchmark harness, and document the workflow while ignoring generated artifacts.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
rust/scan-enrichment/src/lib.rs |
Adds streaming JSON parsing/writing path (*_to_writer) and updates CLI to write without materializing the full enriched output. |
src/scan_examples/enrichment.py |
Builds reusable Rust CLI command lines and adds a passthrough runner; CLI now uses passthrough when Rust is selected. |
tests/test_enrichment_cli.py |
Adds parity coverage for wrapped {results: [...]} inputs and verifies CLI passthrough uses the Rust binary. |
scripts/generate_synthetic_results.py |
Generates deterministic large synthetic scan-results + vt-metadata fixtures for scale testing. |
scripts/benchmark_enrichment.py |
Benchmarks Python vs Rust enrichment and emits a JSON report including semantic parity checks. |
README.md |
Documents the large-input benchmark workflow and the new streaming behavior. |
.gitignore |
Ignores generated/ artifacts produced by the new scripts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
clawosiris
added a commit
that referenced
this pull request
May 16, 2026
## Summary - add rustdoc comments across the `scan-enrichment` crate - document the CLI arguments in `main.rs` - add targeted inline comments around the trickier streaming and metadata-merging code paths ## Notes This is documentation-only follow-up work after #41. No behavior changes intended. ## Verification - `cargo fmt --all` - `cargo test -p scan-enrichment` Co-authored-by: OpenClaw Bot <clawd@tycho.cp.llnvd.lan>
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
Benchmark
Using the generated 500k-result / 1000-IP VT-only fixture:
Also validated a 10k smoke benchmark path with ~5.32x Rust speedup.
Verification
uv run pytestuv run ruff check .cargo fmt --checkcargo test -p scan-enrichmentpython3 scripts/benchmark_enrichment.py --results generated/synthetic-scan-results-500k.json --vt-metadata generated/synthetic-vt-metadata.json --runs 1 --warmups 0Closes #28