daemonic_error 0.1.0

Errors that compose, predict, and leave receipts - Compose: algebraic combination (in active development) - Predict: Glass/Severity - Receipts: audit trail, position, checksum - Reflection: Runtime Reflection through TopologySegment (in active development)
use crate::DaemonicError;
use super::Glass;
/// Total information loss. Nothing came through.
/// The glass absorbed everything.
/// May carry debris — fragments that can be inspected
/// but not used as values.
pub trait GlassShattered<GLASS: Glass<GLASS>>: Glass<!> + for<'error> DaemonicError<'error> {
	/// What can be inferred from the debris?
	fn debris_description(&self) -> &impl Glass<str>;

	/// DaemonicError diagnostic, if available.
	/// This is where the error trait lives as a payload
	/// inside dark glass states.
	fn diagnostic(&self) -> Option<&dyn DaemonicError>;

	/// Can anything be reconstructed from context?
	fn is_reconstructible(&self) -> impl Glass<bool> {
		false
	}
}
/// Annotation on a Shattered observation.
/// "Everything's gone, but here's what we saw before it went dark."
pub trait ShatteredAnnotation<GLASS: Glass<GLASS>>: Glass<!> + GlassShattered<GLASS> {
	fn annotation(&self) -> &impl Glass<str>;

	/// Last known state before shattering.
	fn last_known(&self) -> Option<&str> { None }

	/// Was this expected? (eg: intentional teardown vs crash)
	fn expected(&self) -> impl Glass<bool> { false }
}