use serde::{Deserialize, Serialize};
use sail_ledger::{
CheckRecord, Establishment, FunctionRecord, ObligationRecord, Outcome, Source, SourceSummary,
Verdict,
};
pub const SCHEMA_VERSION: u32 = 2;
pub const JSON_SCHEMA: &str = include_str!("../schema/verify-output-v2.json");
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Report {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub portfolio: Option<PortfolioReport>,
pub schema_version: u32,
pub sail_version: String,
pub mode: String,
pub command: Vec<String>,
pub exit_code: Option<i32>,
pub solver: Option<SolverInfo>,
pub cache: CacheInfo,
pub attribution: AttributionInfo,
pub crates: Vec<CrateReport>,
pub diagnostics: Vec<Diagnostic>,
pub summary: Summary,
pub error: Option<ErrorInfo>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub engine: Option<EngineProvenance>,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct EngineProvenance {
pub name: String,
pub manifest_sha256: String,
pub established_by: EngineEstablishment,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub enum EngineEstablishment {
Engine,
StockFallback,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub struct SolverConfiguration {
pub seed: u32,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct PortfolioAttempt {
pub configuration: SolverConfiguration,
pub verified: bool,
pub exit_code: Option<i32>,
pub wall_ms: f64,
pub error: Option<String>,
pub report: Option<Box<Report>>,
pub stderr: String,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct PortfolioReport {
pub seeds: Vec<u32>,
pub winner_seed: Option<u32>,
pub attempts: Vec<PortfolioAttempt>,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct SolverInfo {
pub name: String,
pub version: Option<String>,
pub path: Option<String>,
pub sha256: Option<String>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub struct CacheInfo {
pub daemon: bool,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub enum AttributionStatus {
Complete,
Partial,
Unavailable,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct AttributionInfo {
pub status: AttributionStatus,
pub notes: Vec<String>,
pub unmatched_sessions: u64,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CrateReport {
pub name: Option<String>,
pub verus: VerusResults,
pub functions: Vec<FunctionReport>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub struct VerusResults {
pub verified: Option<u64>,
pub errors: Option<u64>,
pub success: Option<bool>,
pub encountered_vir_error: Option<bool>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub enum VerdictName {
Verified,
Failed,
Unknown,
Provisional,
}
impl From<Verdict> for VerdictName {
fn from(v: Verdict) -> Self {
match v {
Verdict::Verified => Self::Verified,
Verdict::Failed => Self::Failed,
Verdict::Unknown => Self::Unknown,
Verdict::Provisional => Self::Provisional,
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum EstablishmentName {
Provisional,
Confirmed,
}
impl From<Establishment> for EstablishmentName {
fn from(t: Establishment) -> Self {
match t {
Establishment::Provisional => Self::Provisional,
Establishment::Confirmed => Self::Confirmed,
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum EvidenceTierName {
Sampled,
Bounded,
SmtVerified,
CertificateChecked,
KernelChecked,
}
impl EvidenceTierName {
#[must_use]
pub fn for_smt(verdict: VerdictName, establishment: EstablishmentName) -> Option<Self> {
match (verdict, establishment) {
(VerdictName::Verified | VerdictName::Failed, EstablishmentName::Confirmed) => {
Some(Self::SmtVerified)
}
_ => None,
}
}
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct FunctionReport {
pub function: String,
pub module: String,
pub fn_mode: Option<String>,
pub verdict: VerdictName,
pub establishment: EstablishmentName,
pub evidence_tier: Option<EvidenceTierName>,
pub unstable: bool,
pub verus_success: Option<bool>,
pub provenance: ProvenanceReport,
pub timing: Timing,
pub fragility: Option<Fragility>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub health: Option<crate::health::FunctionHealth>,
pub obligations: Option<Vec<ObligationReport>>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub enum SourceSummaryName {
Fresh,
Cache,
Mixed,
Unrecorded,
}
impl From<SourceSummary> for SourceSummaryName {
fn from(s: SourceSummary) -> Self {
match s {
SourceSummary::Fresh => Self::Fresh,
SourceSummary::Cache => Self::Cache,
SourceSummary::Mixed => Self::Mixed,
SourceSummary::Unrecorded => Self::Unrecorded,
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct ProvenanceReport {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub configuration: Option<SolverConfiguration>,
pub mode: String,
pub source: SourceSummaryName,
pub checks_solved: u64,
pub checks_served: u64,
pub checks_unrecorded: u64,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub engine: Option<EngineProvenance>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub struct Timing {
pub smt_micros: Option<u64>,
pub rlimit: Option<u64>,
}
#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)]
pub struct Fragility {
pub score: f64,
pub runs: u32,
pub proved: u32,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub enum OutcomeName {
Proved,
Failed,
Unknown,
}
impl From<Outcome> for OutcomeName {
fn from(o: Outcome) -> Self {
match o {
Outcome::Proved => Self::Proved,
Outcome::Failed => Self::Failed,
Outcome::Unknown => Self::Unknown,
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct ObligationReport {
pub id: String,
pub kind: String,
pub ordinal: u32,
pub spinoff: Option<SpinoffInfo>,
pub advisory: bool,
pub span: Option<SourceSpan>,
pub outcome: OutcomeName,
pub unstable: bool,
pub checks: Vec<CheckReport>,
pub counterexample: Option<Counterexample>,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct SpinoffInfo {
pub index: u32,
pub reason: Option<String>,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct SourceSpan {
pub text: String,
pub file: Option<String>,
pub line: Option<u64>,
pub column: Option<u64>,
pub end_line: Option<u64>,
pub end_column: Option<u64>,
}
impl SourceSpan {
#[must_use]
pub fn parse(text: &str) -> Self {
let mut span = Self {
text: text.to_owned(),
file: None,
line: None,
column: None,
end_line: None,
end_column: None,
};
let body = text.rsplit_once(" (#").map_or(text, |(b, _)| b);
let Some((start, end)) = body.rsplit_once(": ") else {
return span;
};
let mut s = start.rsplitn(3, ':');
let (Some(col), Some(line), Some(file)) = (s.next(), s.next(), s.next()) else {
return span;
};
let mut e = end.splitn(2, ':');
span.file = Some(file.to_owned());
span.line = line.parse().ok();
span.column = col.parse().ok();
span.end_line = e.next().and_then(|v| v.parse().ok());
span.end_column = e.next().and_then(|v| v.parse().ok());
span
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub enum AnswerName {
Sat,
Unsat,
Unknown,
}
impl From<sail_ledger::Answer> for AnswerName {
fn from(a: sail_ledger::Answer) -> Self {
match a {
sail_ledger::Answer::Sat => Self::Sat,
sail_ledger::Answer::Unsat => Self::Unsat,
sail_ledger::Answer::Unknown => Self::Unknown,
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub enum SourceName {
Solved,
Cache,
}
impl From<Source> for SourceName {
fn from(s: Source) -> Self {
match s {
Source::Solved => Self::Solved,
Source::Cache => Self::Cache,
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct CheckReport {
pub answer: Option<AnswerName>,
pub rlimit_limit: Option<u64>,
pub rlimit_used: Option<u64>,
pub reason_unknown: Option<String>,
pub source: Option<SourceName>,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct Counterexample {
pub check: u32,
pub model: String,
pub assignments: Vec<Assignment>,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct Assignment {
pub name: String,
pub sort: String,
pub value: String,
pub itf: ItfValue,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ItfValue {
Bool(bool),
BigInt {
#[serde(rename = "#bigint")]
bigint: String,
},
Unserializable {
#[serde(rename = "#unserializable")]
unserializable: String,
},
}
impl ItfValue {
#[must_use]
pub fn render(sort: &str, value: &str) -> Self {
let v = value.trim();
let sort = sort.trim();
let read = match sort {
"Bool" => match v {
"true" => Some(Self::Bool(true)),
"false" => Some(Self::Bool(false)),
_ => None,
},
"Int" => smt_int(v).map(|bigint| Self::BigInt { bigint }),
_ if sort.starts_with("(_ BitVec ") => smt_bit_vector(v).map(|n| Self::BigInt {
bigint: n.to_string(),
}),
_ => None,
};
read.unwrap_or_else(|| Self::Unserializable {
unserializable: value.to_owned(),
})
}
}
fn smt_int(v: &str) -> Option<String> {
let numeral = |s: &str| !s.is_empty() && s.bytes().all(|b| b.is_ascii_digit());
if numeral(v) {
return Some(v.to_owned());
}
let inner = v.strip_prefix('(')?.strip_suffix(')')?.trim();
let digits = inner.strip_prefix('-')?.trim();
if !numeral(digits) {
return None;
}
Some(if digits.bytes().all(|b| b == b'0') {
"0".to_owned()
} else {
format!("-{digits}")
})
}
fn smt_bit_vector(v: &str) -> Option<u128> {
let (digits, radix) = if let Some(d) = v.strip_prefix("#x") {
(d, 16)
} else {
(v.strip_prefix("#b")?, 2)
};
if digits.is_empty() || !digits.bytes().all(|b| b.is_ascii_hexdigit()) {
return None;
}
u128::from_str_radix(digits, radix).ok()
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct DiagnosticSpan {
pub file: String,
pub line: u64,
pub column: u64,
pub primary: bool,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct Diagnostic {
pub level: String,
pub code: Option<String>,
pub message: String,
pub spans: Vec<DiagnosticSpan>,
pub rendered: String,
}
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Serialize, Deserialize)]
pub struct Summary {
pub functions: u64,
pub verified: u64,
pub failed: u64,
pub unknown: u64,
pub provisional: u64,
pub unstable: u64,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct ErrorInfo {
pub code: String,
pub message: String,
}
fn check_report(c: &CheckRecord) -> CheckReport {
CheckReport {
answer: c.answer.map(AnswerName::from),
rlimit_limit: c.effort.limit,
rlimit_used: c.effort.used,
reason_unknown: c.effort.reason.clone(),
source: c.source.map(SourceName::from),
}
}
impl From<&ObligationRecord> for ObligationReport {
fn from(o: &ObligationRecord) -> Self {
let counterexample = o.checks.iter().enumerate().find_map(|(i, c)| {
let model = c.model.as_ref()?;
Some(Counterexample {
check: u32::try_from(i).unwrap_or(u32::MAX),
model: model.text.clone(),
assignments: model
.assignments
.iter()
.map(|a| Assignment {
name: a.name.clone(),
sort: a.sort.clone(),
value: a.value.clone(),
itf: ItfValue::render(&a.sort, &a.value),
})
.collect(),
})
});
Self {
id: o.id.to_string(),
kind: o.id.kind.0.clone(),
ordinal: o.id.ordinal,
spinoff: o.id.spinoff.map(|index| SpinoffInfo {
index,
reason: o.spinoff_reason.clone(),
}),
advisory: !o.id.kind.verdict_bearing(),
span: o.span.as_deref().map(SourceSpan::parse),
outcome: o.outcome().into(),
unstable: o.unstable(),
checks: o.checks.iter().map(check_report).collect(),
counterexample,
}
}
}
impl From<&FunctionRecord> for FunctionReport {
fn from(f: &FunctionRecord) -> Self {
let sources = f.sources();
let verdict = VerdictName::from(f.verdict());
let establishment = EstablishmentName::from(f.establishment);
let obligations: Option<Vec<_>> = f
.obligations
.as_ref()
.map(|obligations| obligations.iter().map(ObligationReport::from).collect());
let health = crate::health::FunctionHealth::from_obligations(obligations.as_deref());
Self {
function: f.function.clone(),
module: f.module.clone(),
fn_mode: f.fn_mode.clone(),
verdict,
establishment,
evidence_tier: EvidenceTierName::for_smt(verdict, establishment),
unstable: f.unstable(),
verus_success: f.verus_success,
provenance: ProvenanceReport {
configuration: None,
mode: f.mode.name().to_owned(),
source: sources.summary().into(),
checks_solved: sources.solved,
checks_served: sources.served,
checks_unrecorded: sources.unrecorded,
engine: None,
},
timing: Timing {
smt_micros: f.smt_micros,
rlimit: f.rlimit,
},
fragility: None,
health: Some(health),
obligations,
}
}
}
impl Summary {
#[must_use]
pub fn of(crates: &[CrateReport]) -> Self {
let mut s = Self::default();
for f in crates.iter().flat_map(|c| &c.functions) {
s.functions += 1;
match f.verdict {
VerdictName::Verified => s.verified += 1,
VerdictName::Failed => s.failed += 1,
VerdictName::Unknown => s.unknown += 1,
VerdictName::Provisional => s.provisional += 1,
}
s.unstable += u64::from(f.unstable);
}
s
}
}
impl CrateReport {
#[must_use]
pub fn unknown_passed_by_verus_totals(&self) -> u64 {
if self.verus_totals_clear_unknown() {
self.count(VerdictName::Unknown)
} else {
0
}
}
#[must_use]
pub fn verus_totals_clear_unknown(&self) -> bool {
let failed = self.count(VerdictName::Failed);
failed > 0
&& self.verus.errors == Some(failed)
&& self.verus.verified.is_some()
&& self.verus.encountered_vir_error != Some(true)
}
fn count(&self, verdict: VerdictName) -> u64 {
let n = self
.functions
.iter()
.filter(|f| f.verdict == verdict)
.count();
u64::try_from(n).unwrap_or(u64::MAX)
}
}
impl Report {
#[must_use]
pub fn invariant_violations(&self) -> Vec<String> {
let mut out = Vec::new();
if self.schema_version != SCHEMA_VERSION {
out.push(format!("schema_version is {}", self.schema_version));
}
let mut ids = std::collections::BTreeSet::new();
for f in self.crates.iter().flat_map(|c| &c.functions) {
if f.verdict == VerdictName::Verified && f.establishment != EstablishmentName::Confirmed
{
out.push(format!("{}: verified but not confirmed", f.function));
}
if (f.establishment == EstablishmentName::Provisional)
!= (f.verdict == VerdictName::Provisional)
{
out.push(format!(
"{}: establishment and verdict disagree",
f.function
));
}
let settled = matches!(f.verdict, VerdictName::Verified | VerdictName::Failed);
if settled != f.evidence_tier.is_some() {
out.push(format!(
"{}: evidence tier and verdict disagree",
f.function
));
}
let p = &f.provenance;
let counted = (p.checks_solved, p.checks_served, p.checks_unrecorded);
let expected = match p.source {
SourceSummaryName::Fresh => counted.0 > 0 && counted.1 == 0 && counted.2 == 0,
SourceSummaryName::Cache => counted.0 == 0 && counted.1 > 0 && counted.2 == 0,
SourceSummaryName::Mixed => counted.0 > 0 && counted.1 > 0 && counted.2 == 0,
SourceSummaryName::Unrecorded => counted.2 > 0 || counted == (0, 0, 0),
};
if !expected {
out.push(format!(
"{}: provenance counts disagree with source",
f.function
));
}
for o in f.obligations.iter().flatten() {
if !ids.insert(o.id.clone()) {
out.push(format!("duplicate obligation id {}", o.id));
}
if !o.id.starts_with(&format!("{}#", f.function)) {
out.push(format!("obligation {} is not {}'s", o.id, f.function));
}
}
}
if self.summary != Summary::of(&self.crates) {
out.push("summary does not match the functions".to_owned());
}
out
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn spans_parse() {
let s = SourceSpan::parse("src/lib.rs:46:1: 46:26 (#0)");
assert_eq!(s.file.as_deref(), Some("src/lib.rs"));
assert_eq!(
(s.line, s.column, s.end_line, s.end_column),
(Some(46), Some(1), Some(46), Some(26))
);
let s = SourceSpan::parse("garbage");
assert_eq!((s.file, s.line), (None, None));
assert_eq!(s.text, "garbage");
}
#[test]
fn the_example_document_is_valid_v2_with_rendered_itf_values() {
let text =
include_str!("../resources/crates/sail-cli/tests/fixtures/attr/report.golden.json");
let golden: Report =
serde_json::from_str(text).unwrap_or_else(|e| unreachable!("fixture: {e}"));
let schema: serde_json::Value = serde_json::from_str(JSON_SCHEMA).unwrap_or_default();
let value: serde_json::Value = serde_json::from_str(text).unwrap_or_default();
assert_eq!(
crate::schema::validate(&schema, &value),
Vec::<String>::new()
);
assert_eq!(golden.invariant_violations(), Vec::<String>::new());
let mut rendered = 0;
for o in golden
.crates
.iter()
.flat_map(|c| &c.functions)
.flat_map(|f| f.obligations.iter().flatten())
{
for a in o.counterexample.iter().flat_map(|c| &c.assignments) {
assert_eq!(a.itf, ItfValue::render(&a.sort, &a.value), "{}", a.name);
assert!(
o.counterexample
.as_ref()
.is_some_and(|c| c.model.contains(&a.value)),
"{}",
a.name
);
rendered += usize::from(!matches!(a.itf, ItfValue::Unserializable { .. }));
}
}
assert!(rendered > 0);
}
#[test]
fn engine_provenance_is_additive_and_matches_the_schemas() {
let stock: Report = serde_json::from_str(include_str!(
"../resources/crates/sail-cli/tests/fixtures/attr/report.golden.json"
))
.unwrap_or_else(|e| unreachable!("fixture: {e}"));
let stock_text = serde_json::to_string(&stock).unwrap_or_default();
assert!(!stock_text.contains("\"engine\""));
let engine = EngineProvenance {
name: "interactive".to_owned(),
manifest_sha256: "ab".repeat(32),
established_by: EngineEstablishment::StockFallback,
};
let mut r = stock.clone();
r.engine = Some(engine.clone());
for f in r.crates.iter_mut().flat_map(|c| &mut c.functions) {
f.provenance.engine = Some(engine.clone());
}
let schema = serde_json::from_str(JSON_SCHEMA).unwrap_or_default();
let value = serde_json::to_value(&r).unwrap_or_default();
assert_eq!(
crate::schema::validate(&schema, &value),
Vec::<String>::new()
);
assert_eq!(value["engine"]["established_by"], "stock-fallback");
let mut wrong = value.clone();
wrong["engine"]["established_by"] = serde_json::json!("default");
assert_ne!(
crate::schema::validate(&schema, &wrong),
Vec::<String>::new()
);
let mut wrong = value;
if let Some(engine) = wrong["engine"].as_object_mut() {
engine.remove("manifest_sha256");
}
assert_ne!(
crate::schema::validate(&schema, &wrong),
Vec::<String>::new()
);
let project: serde_json::Value =
serde_json::from_str(include_str!("../schema/project-result-v2.json"))
.unwrap_or_default();
let identity = crate::project::EngineIdentity {
name: "interactive".to_owned(),
manifest_sha256: "cd".repeat(32),
};
let identity = serde_json::to_value(identity).unwrap_or_default();
assert_eq!(
crate::schema::validate(&project["properties"]["engine"], &identity),
Vec::<String>::new()
);
let mut extra = identity;
extra["established_by"] = serde_json::json!("engine");
assert_ne!(
crate::schema::validate(&project["properties"]["engine"], &extra),
Vec::<String>::new()
);
}
#[test]
fn verus_totals_clear_unknown_functions_only_when_every_error_is_accounted_for() {
let golden: Report = serde_json::from_str(include_str!(
"../resources/crates/sail-cli/tests/fixtures/attr/report.golden.json"
))
.unwrap_or_else(|e| unreachable!("fixture: {e}"));
let mut krate = golden.crates[0].clone();
assert_eq!(krate.verus.errors, Some(2));
assert_eq!(krate.unknown_passed_by_verus_totals(), 0);
for f in &mut krate.functions {
if f.verdict == VerdictName::Verified {
f.verdict = VerdictName::Unknown;
}
}
assert_eq!(krate.unknown_passed_by_verus_totals(), 6);
krate.verus.errors = Some(3);
assert_eq!(krate.unknown_passed_by_verus_totals(), 0);
krate.verus.errors = Some(2);
krate.verus.encountered_vir_error = Some(true);
assert_eq!(krate.unknown_passed_by_verus_totals(), 0);
krate.verus.encountered_vir_error = Some(false);
krate.verus.verified = None;
assert_eq!(krate.unknown_passed_by_verus_totals(), 0);
krate.verus.verified = Some(9);
for f in &mut krate.functions {
f.verdict = VerdictName::Unknown;
}
krate.verus.errors = Some(0);
assert_eq!(krate.unknown_passed_by_verus_totals(), 0);
}
#[test]
fn portfolio_evidence_matches_the_schema() {
let mut r: Report = serde_json::from_str(include_str!(
"../resources/crates/sail-cli/tests/fixtures/attr/report.golden.json"
))
.unwrap_or_else(|e| unreachable!("fixture: {e}"));
let attempt = PortfolioAttempt {
configuration: SolverConfiguration { seed: 4 },
verified: false,
exit_code: Some(1),
wall_ms: 1.0,
error: None,
report: Some(Box::new(r.clone())),
stderr: "original diagnostics".to_owned(),
};
r.mode = "accept-first-proof".to_owned();
r.portfolio = Some(PortfolioReport {
seeds: vec![0, 4],
winner_seed: None,
attempts: vec![attempt],
});
let schema = serde_json::from_str(JSON_SCHEMA).unwrap_or_default();
let value = serde_json::to_value(r).unwrap_or_default();
assert!(
crate::schema::validate(&schema, &value).is_empty(),
"{:?}",
crate::schema::validate(&schema, &value)
);
}
}