Skip to main content

Module rules_ops

Module rules_ops 

Source
Expand description

Rules command orchestration, above the endpoint wrappers in rules.

The -cli crate resolves context, applies the guard, and renders; this module does the work between them so a future MCP server can call the same functions and serialize the same structs.

Structs§

PreviewReport
The report a preview renders.
RuleListReport
The report list renders: every matching rule, in server order.
RuleValidation
One rule’s validation entry.
SetEnabledOutcome
The report an enable/disable apply renders. Field order is the serialized JSON key order and is contractual: the root Cargo.toml enables serde_json’s preserve_order.
ValidateReport
The report validate renders.

Functions§

apply_delete
Continue after per-rule failures so the result records every deletion and every rule that remains.
apply_import
Upload the NDJSON plan_import prepared.
apply_set_enabled
export_rules
Fetch, canonicalize, and sort selected rules by rule ID. Exports from an unchanged stack are byte-identical for version-control review. Scoped by source; the all default lives on the clap flag (spec 5.5).
get_one
Resolve a selector and fetch the rule, canonicalized so output is stable.
list
plan_delete
plan_import
Compute the import preview and the NDJSON to upload.
plan_set_enabled
preview_rule
Preview a rule. An existing file path wins; otherwise the source is a rule ID or name from the stack. This supports unpushed local rules.
validate
Parse and validate a local file without contacting a server.