feat: --set KEY=VALUE detector-config overrides (0.9.0)#60
Conversation
scan/explain gain --set KEY=VALUE (repeatable) to override any DetectConfig
field by name — point_threshold, dist_alpha, mv_alpha, struct_null_rate,
column_roles, etc. The settable keys + defaults are exactly describe's `config`
object. Implemented as a JSON round-trip over the serialized DetectConfig, so
every field is settable with zero per-field code.
Unknown key or type-mismatched value → hard error (exit 2). Overrides flow into
config_version (e.g. pt= changes), so a tuned run is as reproducible and
self-describing as a default one — tuning is never silent. Common knobs keep
their dedicated flags (--fdr/--cad-max-cv/--period/--cadence); --set is the
general escape hatch for the rest.
No envelope/PROTOCOL change. Gates: proptest + cargo-mutants 0-missed on main.rs
(77 caught/6 unviable), incl. a test exercising the string-field override branch.
Demo on the 127k parquet: --set point_threshold {2→38102, 3.5→32893, 10→18432}.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 21 minutes and 29 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (4)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What
scan/explaingain--set KEY=VALUE(repeatable) to override anyDetectConfigfield by name:The settable keys are exactly what
describe'sconfigobject reports. An unknown key, or a value that doesn't fit the field's type, is a hard error (exit 2).Why / design
Five of the config knobs already had dedicated flags (
--fdr,--cad-max-cv,--period,--cadence,--no-column-roles); the rest (point_threshold,dist_alpha,mv_alpha,struct_null_rate, themin_ns, …) were compile-time only.--setis the general escape hatch. Implemented as a JSON round-trip over the serializedDetectConfig, so every field is settable with zero per-field code, and value parsing follows each field's current JSON type.Overrides flow into
config_version(e.g.pt=3.5000→pt=2.0000), so a tuned run is exactly as reproducible and self-describing as a default one — tuning is never silent. No envelope/PROTOCOLchange.Demo (127k-row parquet)
--set point_threshold=→ point findings:2.0→ 38,102 ·3.5(default) → 32,893 ·10.0→ 18,432. Unknown key andpoint_min_n=4.5both exit 2.Gate
proptest+cargo-mutants0 missed onmain.rs(77 caught / 6 unviable) — including a test that exercises the string-field override branch (re-setting an already-setcadence_column). Goldens unaffected (they use defaults). CI green.🤖 Generated with Claude Code