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.

Re-exports§

pub use confidence::Confidence;
pub use confidence::FeatureContribution;
pub use confidence::FeatureId;

Modules§

confidence
Confidence — Phase D audit-provenance payload.

Structs§

AppliedFix
A promoted FixProposal with runtime context.
Diagnostic
A single diagnostic emitted by a rule check.
EnginePromotionToken
Engine-only proof-of-construction token for AppliedFix::__engine_promote.
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/portion-mark-in-banner”).

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.

Constants§

CORRECTIONS_MAP_CITATION
Canonical citation string for diagnostics whose authority is the user’s [corrections] config entry (C001 and the engine’s pre-scanner text-scan path). C001 is not a CAPCO rule — no CAPCO passage governs user-defined typo replacements — so the citation is a config pointer rather than a §/page/line reference. Holding the string in one place prevents silent drift between the rule-pipeline emission site in marque-capco and the pre-scanner emission site in marque-engine; both paths produce the same audit-record shape.

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.