pub struct WaiverSet { /* private fields */ }Expand description
The loaded waiver set: gate-side matching + doctor-side lint.
Implementations§
Source§impl WaiverSet
impl WaiverSet
Sourcepub fn load(path: &Path) -> Result<Self, WaiverError>
pub fn load(path: &Path) -> Result<Self, WaiverError>
Loads the waiver file; a missing file is an empty set (waivers are optional), any other failure is loud.
§Errors
Returns WaiverError on unreadable or malformed content.
Sourcepub fn append(path: &Path, waiver: Waiver) -> Result<Waiver, WaiverError>
pub fn append(path: &Path, waiver: Waiver) -> Result<Waiver, WaiverError>
Appends one record to the waiver file (creating file and parent dir as needed) and returns the stored entry.
§Errors
Returns WaiverError on read, parse, or write failure.
pub fn entries(&self) -> &[Waiver]
Sourcepub fn suppresses(&self, rule: &str, file: &str, now: OffsetDateTime) -> bool
pub fn suppresses(&self, rule: &str, file: &str, now: OffsetDateTime) -> bool
True when an unexpired, unsuperseded waiver covers rule on file.
The protected-path rule is never waivable — the harness cannot be
negotiated with (integration doc §11). Matching normalizes
legacy-prefixed rule ids so a waiver granted pre-rename still
covers its rule (remediation pass 3, PART B2).
Sourcepub fn apply_now(&self, result: CheckResult) -> CheckResult
pub fn apply_now(&self, result: CheckResult) -> CheckResult
apply at the current instant — the gate’s call site.
Sourcepub fn apply(&self, result: CheckResult, now: OffsetDateTime) -> CheckResult
pub fn apply(&self, result: CheckResult, now: OffsetDateTime) -> CheckResult
Drops waived violations from a gate result, recomputing the decision.
Sourcepub fn active_now(&self) -> Vec<&Waiver>
pub fn active_now(&self) -> Vec<&Waiver>
active at the current instant — report/statusline call site.
Sourcepub fn active(&self, now: OffsetDateTime) -> Vec<&Waiver>
pub fn active(&self, now: OffsetDateTime) -> Vec<&Waiver>
Waivers currently in force: unexpired and unsuperseded.
Sourcepub fn lint(&self, now: OffsetDateTime) -> Vec<String>
pub fn lint(&self, now: OffsetDateTime) -> Vec<String>
Stale-entry lint findings for doctor (spec §15: “stale-entry lint”). Expired and superseded entries are stale; contradiction links are surfaced as informational pairs for the human to resolve.