Skip to main content

Crate marque_rules

Crate marque_rules 

Source
Expand description

marque-rules — trait definitions for the marque rule system.

This crate defines the contract every rule crate must satisfy. It has no rule implementations — those live in marque-capco and future crates. The engine depends only on this crate, enabling rule crates to be swapped.

§Type split: FixProposal vs AppliedFix

FixProposal is pure data emitted by rules — deterministic, timestamp-free, classifier-free. AppliedFix wraps a proposal with runtime context (timestamp, classifier id, dry-run flag) and is constructed only by Engine::fix. This makes “suggested vs applied” a type-system invariant.

Structs§

AppliedFix
A promoted FixProposal with runtime context.
Diagnostic
A single diagnostic emitted by a rule check.
FixProposal
A proposed fix for a diagnostic violation.
RuleContext
Document position context passed to rules alongside parsed markings.
RuleId
Unique rule identifier string (e.g., “E001”, “capco/banner-abbreviation”).

Enums§

DocumentPosition
Coarse position within the document (for banner detection heuristics).
FixSource
Provenance of a fix proposal — where the fix recommendation originated.
MarkingType
Classification marking candidate type, determined by scanner heuristics.
Severity
Rule severity level. Configurable per rule in .marque.toml.
Zone
Document zone — where in the document structure a marking appears.

Traits§

Rule
The core trait every rule implementation must satisfy.
RuleSet
A collection of rules provided by a rule crate. Returned by the rule crate’s entry point function.