pub struct CritiqueRecord {
pub intent: String,
pub source: String,
pub reviewed_at: String,
pub reviewed_by: String,
pub findings: Vec<CritiqueFinding>,
}Expand description
A critique record: the adversarial pass over one intent’s plan, at the commit it was reviewed at, with every finding and its resolution. One per intent, named by it.
use majordomus_cli::intent_review::CritiqueRecord;
let c = CritiqueRecord::from_metadata(".ai/repo/project/critiques/x.yaml", &serde_json::json!({
"intent": "x", "reviewed_at": "c3f20da", "reviewed_by": "another session",
}));
assert_eq!(c.intent, "x");
assert!(c.findings.is_empty());Fields§
§intent: StringThe intent whose plan it reviews; also the file name.
source: StringRepository-relative path.
reviewed_at: StringThe commit the plan was reviewed at.
reviewed_by: StringWho or what reviewed it.
findings: Vec<CritiqueFinding>The findings.
Implementations§
Source§impl CritiqueRecord
impl CritiqueRecord
Sourcepub fn all(index: &Index) -> Vec<CritiqueRecord>
pub fn all(index: &Index) -> Vec<CritiqueRecord>
Every critique record an index holds, in identity order, so the derivation does not depend on the order the files were read.
use majordomus_cli::index::Index;
use majordomus_cli::intent_review::CritiqueRecord;
let critiques = CritiqueRecord::all(index);
assert!(critiques.windows(2).all(|w| w[0].intent <= w[1].intent));Source§impl CritiqueRecord
impl CritiqueRecord
Sourcepub fn from_metadata(source: &str, meta: &Value) -> CritiqueRecord
pub fn from_metadata(source: &str, meta: &Value) -> CritiqueRecord
The record an object of kind critique carries.
use majordomus_cli::intent_review::{CritiqueRecord, ResolutionState};
let c = CritiqueRecord::from_metadata(".ai/repo/project/critiques/x.yaml", &serde_json::json!({
"intent": "x", "findings": [{"id": "f1", "class": "regression_risk",
"subject": "x#c", "blocking": true, "resolution": {"state": "open"}}]
}));
assert!(c.findings[0].blocking);
assert_eq!(c.findings[0].resolution, Some(ResolutionState::Open));Trait Implementations§
Source§impl Clone for CritiqueRecord
impl Clone for CritiqueRecord
Source§fn clone(&self) -> CritiqueRecord
fn clone(&self) -> CritiqueRecord
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CritiqueRecord
impl Debug for CritiqueRecord
Source§impl<'de> Deserialize<'de> for CritiqueRecord
impl<'de> Deserialize<'de> for CritiqueRecord
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for CritiqueRecord
Source§impl JsonSchema for CritiqueRecord
impl JsonSchema for CritiqueRecord
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for CritiqueRecord
impl PartialEq for CritiqueRecord
Source§fn eq(&self, other: &CritiqueRecord) -> bool
fn eq(&self, other: &CritiqueRecord) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for CritiqueRecord
impl Serialize for CritiqueRecord
impl StructuralPartialEq for CritiqueRecord
Auto Trait Implementations§
impl Freeze for CritiqueRecord
impl RefUnwindSafe for CritiqueRecord
impl Send for CritiqueRecord
impl Sync for CritiqueRecord
impl Unpin for CritiqueRecord
impl UnsafeUnpin for CritiqueRecord
impl UnwindSafe for CritiqueRecord
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.