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§
- Preview
Report - The report a preview renders.
- Rule
List Report - The report
listrenders: every matching rule, in server order. - Rule
Validation - One rule’s validation entry.
- SetEnabled
Outcome - The report an
enable/disableapply renders. Field order is the serialized JSON key order and is contractual: the rootCargo.tomlenablesserde_json’spreserve_order. - Validate
Report - The report
validaterenders.
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_importprepared. - 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; thealldefault 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.