1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// @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. `property` is a structured ThLensProperty (see dev.idiolect.defs#lensProperty) so consumers can dispatch on the specific claim — a Theorem for proof checkers, a GeneratorSpec for PBT runners, a ConformanceStandard for conformance runners.
#![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 {
/// Structured grounding for the claim. Useful when the verifier is citing an external standard, a proof library, or a derived-from earlier verification.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub basis: Option<super::defs::Basis>,
/// 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>>,
/// 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>,
/// Structured statement of what the verification asserts, dispatched on the variant: RoundtripDomain for roundtrip-test, GeneratorSpec for property-test, Theorem for formal-proof, ConformanceStandard for conformance-test, StaticCheckerConfig for static-check, ConvergenceClaim for convergence-preserving. See dev.idiolect.theory.lens_property.
pub property: VerificationProperty,
/// 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";
}
/// VerificationProperty tagged union.
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(tag = "$type")]
pub enum VerificationProperty {
#[serde(rename = "dev.idiolect.defs#lpRoundtrip")]
LpRoundtrip(super::defs::LpRoundtrip),
#[serde(rename = "dev.idiolect.defs#lpGenerator")]
LpGenerator(super::defs::LpGenerator),
#[serde(rename = "dev.idiolect.defs#lpTheorem")]
LpTheorem(super::defs::LpTheorem),
#[serde(rename = "dev.idiolect.defs#lpConformance")]
LpConformance(super::defs::LpConformance),
#[serde(rename = "dev.idiolect.defs#lpChecker")]
LpChecker(super::defs::LpChecker),
#[serde(rename = "dev.idiolect.defs#lpConvergence")]
LpConvergence(super::defs::LpConvergence),
}
/// 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,
}