use converge_pack::{ExecutionIdentity, ProvenanceSource};
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct Prism;
impl ProvenanceSource for Prism {
fn as_str(&self) -> &'static str {
"prism"
}
}
pub const PRISM_PROVENANCE: Prism = Prism;
#[must_use]
pub fn prism_execution_identity() -> ExecutionIdentity {
ExecutionIdentity::unspecified(env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION"))
}
#[cfg(test)]
mod tests {
use super::*;
use converge_pack::ContextKey;
#[test]
fn provenance_string_is_stable() {
assert_eq!(PRISM_PROVENANCE.as_str(), "prism");
}
#[test]
fn proposed_fact_uses_canonical_source_string() {
let fact = PRISM_PROVENANCE.proposed_fact(
ContextKey::Diagnostic,
"diagnostic",
converge_pack::TextPayload::new("content"),
);
assert_eq!(fact.provenance(), "prism");
}
}