pub struct GapRecord {
pub intent: String,
pub source: String,
pub observed_at: String,
pub recorded_by: String,
pub observations: Vec<GapObservation>,
pub conditions: Vec<GapCondition>,
pub risks: Vec<String>,
pub work: Vec<GapWork>,
}Expand description
A gap record: the observations a worker made of the repository at one commit, the state of every criterion of the intent against them, the risks, and the work it suggests. One per intent, named by it.
use majordomus_cli::intent_review::GapRecord;
let g = GapRecord::from_metadata(".ai/repo/project/gaps/x.yaml", &serde_json::json!({
"intent": "x", "observed_at": "c3f20da", "recorded_by": "claude-code",
"conditions": [{"criterion": "a", "state": "unknown"}],
}));
assert_eq!(g.intent, "x");
assert_eq!(g.observed_at, "c3f20da");Fields§
§intent: StringThe intent it analyses; also the file name.
source: StringRepository-relative path.
observed_at: StringThe commit the observations were made on.
recorded_by: StringWho or what recorded it.
observations: Vec<GapObservation>The observations.
conditions: Vec<GapCondition>One per criterion.
risks: Vec<String>Risks, as prose.
work: Vec<GapWork>Suggested work.
Implementations§
Source§impl GapRecord
impl GapRecord
Sourcepub fn from_metadata(source: &str, meta: &Value) -> GapRecord
pub fn from_metadata(source: &str, meta: &Value) -> GapRecord
The record an object of kind gap carries.
use majordomus_cli::intent_review::{ConditionState, GapRecord};
let g = GapRecord::from_metadata(".ai/repo/project/gaps/x.yaml", &serde_json::json!({
"intent": "x", "observed_at": "abc",
"conditions": [{"criterion": "c", "state": "missing", "observations": ["o1"]}]
}));
assert_eq!(g.conditions[0].state, Some(ConditionState::Missing));Source§impl GapRecord
impl GapRecord
Sourcepub fn all(index: &Index) -> Vec<GapRecord>
pub fn all(index: &Index) -> Vec<GapRecord>
Every gap 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::GapRecord;
let gaps = GapRecord::all(index);
assert!(gaps.windows(2).all(|w| w[0].intent <= w[1].intent));Trait Implementations§
Source§impl<'de> Deserialize<'de> for GapRecord
impl<'de> Deserialize<'de> for GapRecord
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 GapRecord
Source§impl JsonSchema for GapRecord
impl JsonSchema for GapRecord
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 moreimpl StructuralPartialEq for GapRecord
Auto Trait Implementations§
impl Freeze for GapRecord
impl RefUnwindSafe for GapRecord
impl Send for GapRecord
impl Sync for GapRecord
impl Unpin for GapRecord
impl UnsafeUnpin for GapRecord
impl UnwindSafe for GapRecord
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.