karanjahpn
Thread real TraceProvenance through lifecycle events; add CanonicalBalance scaffolding; fix then_owned compile bug; merge pre_states+generation+balance verification
2e298fd Download runtime/builder/src/lifecycle/diagnostics.rs from Sahek/kaysentinel: direct link, hf CLI and curl.
- Browser
- Download file 1.26 kB
-
https://huggingface.co/Sahek/kaysentinel/resolve/main/runtime/builder/src/lifecycle/diagnostics.rs
- Command line
-
hf download hf://Sahek/kaysentinel/runtime/builder/src/lifecycle/diagnostics.rs
-
curl -L -o diagnostics.rs https://huggingface.co/Sahek/kaysentinel/resolve/main/runtime/builder/src/lifecycle/diagnostics.rs
1.26 kB
| use crate::ir::timeline::TraceProvenance; | |
| use crate::lifecycle::keys::GenerationKey; | |
| pub enum Severity { | |
| Error, | |
| Warning, | |
| } | |
| pub enum LifecycleViolation { | |
| /// A creation was observed on an address while a prior generation was still open. | |
| Collision { address: [u8; 20], generation_id: u32 }, | |
| DuplicateKey(GenerationKey), | |
| IntegrityBreach(GenerationKey), | |
| IntervalInvalid(GenerationKey), | |
| OverlapDetected([u8; 20]), | |
| OrderingBreach, | |
| } | |
| pub struct Diagnostic { | |
| pub severity: Severity, | |
| pub location: TraceProvenance, | |
| pub violation: LifecycleViolation, | |
| pub explanation: String, | |
| } | |
| pub struct InvariantReport { | |
| pub keys_unique: bool, | |
| pub referential_integrity: bool, | |
| pub deterministic_order: bool, | |
| pub intervals_valid: bool, | |
| } | |
| pub struct PassOutput<T> { | |
| pub value: T, | |
| pub diagnostics: Vec<Diagnostic>, | |
| pub invariant_report: InvariantReport, | |
| } | |
| impl<T> PassOutput<T> { | |
| pub fn is_valid(&self) -> bool { | |
| !self.diagnostics.iter().any(|d| d.severity == Severity::Error) | |
| } | |
| } | |