pub struct Completion {
pub present: bool,
pub task: Option<ActiveTask>,
pub model: String,
pub plan: GatePlan,
pub finishable: bool,
pub blocking: Vec<String>,
pub unverified: Vec<String>,
pub tallies: BTreeMap<String, usize>,
pub gates: Vec<Gate>,
pub obligations: Vec<ImpliedObligation>,
pub questions: Vec<DoneQuestion>,
pub findings: Vec<String>,
}Expand description
use majordomus_cli::gates::Completion;
// the document every surface reads, as `gates.completion` answers with it. The property
// that matters is the one asserted here: a gate that never reported leaves the task
// finishable and *unverified*, which is a different thing from a task that passed.
let c: Completion = serde_json::from_value(serde_json::json!({
"present": true,
"model": ".ai/repo/ci/gates.yaml",
"plan": { "mode": "affected", "reason": "1 path in 1 class", "changed": ["docs/CLI.md"],
"classes": [], "unclassified": [], "selected": {}, "excluded": {} },
"finishable": true,
"unverified": ["reference-check"],
"tallies": { "queued": 1 },
"gates": [],
"obligations": [],
"questions": []
}))
.unwrap();
assert!(c.finishable, "absence of a verdict does not refuse");
assert_eq!(c.unverified, ["reference-check"], "and it is never silently accepted");
assert!(c.blocking.is_empty());Whether the active task may be called finished, and everything the answer rests on.
finishable is the field a caller acts on and the one thing no surface may recompute:
the shell tool’s check and finish read it, the HTTP API serves it, the Cockpit
renders it, and all of them are reading this one execution.
Fields§
§present: boolTrue when a task record was found in this checkout.
task: Option<ActiveTask>The task, as its record declares it.
model: StringThe CI model this was judged against.
plan: GatePlanAffected or full, and why.
finishable: boolFalse when a required gate is known to be failing, stale, or blocked by one that is.
Absence of a verdict does not make this false — it makes unverified non-empty.
blocking: Vec<String>The required gates whose status refuses completion.
unverified: Vec<String>The required gates that have never reported, or cannot be judged here. A task finished over these is finished unverified, and the record says so.
tallies: BTreeMap<String, usize>How many gates stand in each status, by word.
gates: Vec<Gate>Every gate of the model, what refuses first.
obligations: Vec<ImpliedObligation>Which obligations the change set implies, and whether the task promised them. The
judgement of a declared one is obligations.closure’s, not this module’s.
questions: Vec<DoneQuestion>The done invariant: the questions a task must answer before anybody may call it
finished, each with the source that answered it and the evidence it read. Composed
from the obligation closure, the gates, the change set, the repository’s convergence
and the closing readings; a question nothing here reaches is unknown and names the
command that would answer it.
findings: Vec<String>What could not be established, each as one line. Never empty when something was skipped: a gap is reported rather than left to be inferred.
Trait Implementations§
Source§impl Clone for Completion
impl Clone for Completion
Source§fn clone(&self) -> Completion
fn clone(&self) -> Completion
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 Completion
impl Debug for Completion
Source§impl<'de> Deserialize<'de> for Completion
impl<'de> Deserialize<'de> for Completion
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 Completion
impl JsonSchema for Completion
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