pub struct EvidenceReportInput {
pub state: Option<ProofState>,
pub status: Option<String>,
pub findings_only: bool,
pub presented: Option<String>,
pub presented_tree: Option<TreeState>,
}Expand description
Which part of the matrix to answer for, and at which revision.
Every filter narrows, and they compose; saying nothing asks for the whole matrix at the working tree. A key nothing recognises is refused rather than dropped, because a misspelled filter that read as “no filter” would answer a question nobody asked and look like a clean one.
use majordomus_cli::capability::builtin::evidence::EvidenceReportInput;
use majordomus_cli::evidence::{ProofState, TreeState};
let all: EvidenceReportInput = serde_json::from_str("{}").unwrap();
assert!(all.state.is_none() && all.status.is_none() && !all.findings_only);
assert!(all.presented.is_none(), "the working tree unless a commit is named");
let narrowed: EvidenceReportInput =
serde_json::from_str(r#"{"state": "stale", "findings_only": true}"#).unwrap();
assert_eq!(narrowed.state, Some(ProofState::Stale));
assert!(narrowed.findings_only);
let at: EvidenceReportInput =
serde_json::from_str(r#"{"presented": "HEAD", "presented_tree": "dirty"}"#).unwrap();
assert_eq!(at.presented.as_deref(), Some("HEAD"));
assert_eq!(at.presented_tree, Some(TreeState::Dirty));
assert!(serde_json::from_str::<EvidenceReportInput>(r#"{"states": "stale"}"#).is_err());Fields§
§state: Option<ProofState>Only claims in this proof state (proven, inputs_unchanged, stale, failing,
not_run, unrunnable, no_test). Absent: every claim.
status: Option<String>Only claims declaring this status (guaranteed, advisory, planned, rejected).
Absent: every claim.
findings_only: boolOnly the claims whose declared status the evidence does not support, with the findings. The tallies still count the whole matrix, so a filtered answer never misreports how much of it was examined.
presented: Option<String>Judge at this revision, as committed, rather than at the working tree: HEAD, or
any name of the checked-out commit. It must be the checked-out commit; the ledger is
read as that commit holds it, and a run the working ledger holds that the commit’s
does not can only withhold proven. Absent: the working tree.
presented_tree: Option<TreeState>What the caller knows about the presented commit’s tree (clean, dirty,
unknown). It can only weaken the measured state, never assert a clean tree over a
dirty checkout, and it means nothing without presented.
Trait Implementations§
Source§impl BenchmarkCases for EvidenceReportInput
impl BenchmarkCases for EvidenceReportInput
Source§fn benchmark_cases(_: &CaseContext<'_>) -> Vec<NamedCase<Self>>
fn benchmark_cases(_: &CaseContext<'_>) -> Vec<NamedCase<Self>>
The whole matrix and the findings, at the working tree. No case fills presented:
the benchmark repository is not a git repository, so every revision it could name is
refused, and such a case would time the refusal and be counted as coverage of the
judgement it never reached.
Source§fn benchmark_cases_json(ctx: &CaseContext<'_>) -> Vec<NamedCase<Value>>
fn benchmark_cases_json(ctx: &CaseContext<'_>) -> Vec<NamedCase<Value>>
Source§impl Clone for EvidenceReportInput
impl Clone for EvidenceReportInput
Source§fn clone(&self) -> EvidenceReportInput
fn clone(&self) -> EvidenceReportInput
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EvidenceReportInput
impl Debug for EvidenceReportInput
Source§impl Default for EvidenceReportInput
impl Default for EvidenceReportInput
Source§fn default() -> EvidenceReportInput
fn default() -> EvidenceReportInput
Source§impl<'de> Deserialize<'de> for EvidenceReportInput
impl<'de> Deserialize<'de> for EvidenceReportInput
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for EvidenceReportInput
impl JsonSchema for EvidenceReportInput
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more