idiolect-records 0.1.0

Rust record types mirroring the dev.idiolect.* Lexicon family.
Documentation
// @generated by idiolect-codegen. do not edit.
// source: dev.idiolect.verification

//! A signed assertion of a formal property of a lens. Verifications are the formal-channel primitive: they coexist with the emergent channel (encounters, corrections, observations) and neither gates the other.

#![allow(
    missing_docs,
    clippy::doc_markdown,
    clippy::struct_excessive_bools,
    clippy::derive_partial_eq_without_eq
)]
use serde::{Deserialize, Serialize};

/// A verifier asserts that a lens has a named property, established by a named method, with dependencies and an input space the assertion covers.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Verification {
    /// For result=falsified: optional reference to a minimal counterexample.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub counterexample: Option<String>,
    /// Other verifications this one depends on (e.g. a proof assuming a lemma).
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub dependencies: Option<Vec<String>>,
    /// Description of the input space covered: for property-tests, the generator; for formal-proofs, the domain over which the theorem is stated; for conformance-tests, the standard name and version.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub input_space: Option<String>,
    /// Fixed taxonomy at the Lexicon level. Each kind has its own trust semantics.
    pub kind: VerificationKind,
    /// The lens whose property is being asserted.
    pub lens: super::defs::LensRef,
    pub occurred_at: String,
    /// For kind=formal-proof: reference to the checkable proof artifact (e.g. Coq/Lean/Agda term). Orchestrators that have the checker may mechanically verify; others take the assertion on trust.
    #[serde(default, skip_serializing_if = "Option::is_none")]
    pub proof_artifact: Option<String>,
    /// Assertion outcome. Falsified verifications are first-class records; they are how the community learns a lens is wrong.
    pub result: VerificationResult,
    /// Tool and version used to establish the verification.
    pub tool: super::defs::Tool,
    /// DID of the party asserting the verification.
    pub verifier: String,
}

impl crate::Record for Verification {
    const NSID: &'static str = "dev.idiolect.verification";
}

/// VerificationKind.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub enum VerificationKind {
    RoundtripTest,
    PropertyTest,
    FormalProof,
    ConformanceTest,
    StaticCheck,
    ConvergencePreserving,
}

/// VerificationResult.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub enum VerificationResult {
    Holds,
    Falsified,
    Inconclusive,
}