pub struct Baseline {
pub schema_version: String,
pub pipeline_path: String,
pub pipeline_content_hash: String,
pub captured_at: DateTime<Utc>,
pub captured_by: String,
pub captured_with: CapturedWith,
pub baseline_findings: Vec<BaselineFinding>,
}Expand description
One baseline file = one pipeline. Keyed by pipeline_content_hash so
renames preserve state and merge conflicts only touch the affected file.
Fields§
§schema_version: String§pipeline_path: String§pipeline_content_hash: Stringsha256:<hex> of the pipeline file’s bytes at init time.
captured_at: DateTime<Utc>§captured_by: String§captured_with: CapturedWith§baseline_findings: Vec<BaselineFinding>Sorted by fingerprint ASC for stable git diffs.
Implementations§
Source§impl Baseline
impl Baseline
Sourcepub fn load(path: &Path) -> Result<Option<Self>, BaselineError>
pub fn load(path: &Path) -> Result<Option<Self>, BaselineError>
Load and parse a baseline from disk. Returns Ok(None) if path
does not exist (the OSS-friendly default — absent baseline is fine).
Sourcepub fn save(&self, path: &Path) -> Result<(), BaselineError>
pub fn save(&self, path: &Path) -> Result<(), BaselineError>
Write self to path as pretty JSON with stable key ordering and
fingerprint-sorted entries. Creates parent directories as needed.
Sourcepub fn from_findings(
pipeline_path: &str,
content: &str,
graph: &AuthorityGraph,
findings: &[Finding],
captured_by: &str,
taudit_version: &str,
rules_version: &str,
now: DateTime<Utc>,
) -> Self
pub fn from_findings( pipeline_path: &str, content: &str, graph: &AuthorityGraph, findings: &[Finding], captured_by: &str, taudit_version: &str, rules_version: &str, now: DateTime<Utc>, ) -> Self
Produce a fresh baseline from current_findings against graph.
Each entry is a plain pre-existing finding (no waiver fields set).
pipeline_path should be the pipeline’s filesystem path as the user
sees it; content is the raw bytes used to derive the content hash.
Sourcepub fn accept(
&mut self,
fingerprint: &str,
rule_id: &str,
severity: Severity,
reason: &str,
severity_override: Option<Severity>,
expires_at: Option<DateTime<Utc>>,
now: DateTime<Utc>,
) -> Result<&BaselineFinding, BaselineError>
pub fn accept( &mut self, fingerprint: &str, rule_id: &str, severity: Severity, reason: &str, severity_override: Option<Severity>, expires_at: Option<DateTime<Utc>>, now: DateTime<Utc>, ) -> Result<&BaselineFinding, BaselineError>
Append a single waiver entry. Validates reason length and the
critical-waiver constraints. Returns the inserted/updated entry.
If an entry with the same fingerprint already exists, it is replaced
(idempotent re-acceptance with a refreshed reason / expiry).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Baseline
impl<'de> Deserialize<'de> for Baseline
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Baseline
impl StructuralPartialEq for Baseline
Auto Trait Implementations§
impl Freeze for Baseline
impl RefUnwindSafe for Baseline
impl Send for Baseline
impl Sync for Baseline
impl Unpin for Baseline
impl UnsafeUnpin for Baseline
impl UnwindSafe for Baseline
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.