pub struct ReasoningRecord {
pub schema: String,
pub version: u32,
pub id: String,
pub task: String,
pub recorded_at: String,
pub head: Option<String>,
pub redacted: Vec<String>,
pub body: ReasoningBody,
}Expand description
A stored record: a body with the envelope only the writer stamps.
The envelope carries the schema and version, a unique id, the task, the time it was recorded, the commit the checkout was on and the secret shapes redacted from its text. One record is one JSON file in the store; the store reads back only records whose schema and version match.
use majordomus_cli::reasoning::record::*;
let record = ReasoningRecord {
schema: RECORD_SCHEMA.into(),
version: RECORD_VERSION,
id: "attempt-20261001T000000Z-abcdef".into(),
task: "untasked".into(),
recorded_at: "2026-10-01T00:00:00Z".into(),
head: None,
redacted: vec![],
body: ReasoningBody::Attempt(AttemptInput {
assessment: None,
attempt: "inline the call".into(),
observed_failure: "the test still fails".into(),
assumption_invalidated: None,
evidence: vec![],
updated_hypothesis: None,
}),
};
let text = serde_json::to_string(&record).unwrap();
assert!(!text.contains("\"head\""), "an absent head is not written");
let back: ReasoningRecord = serde_json::from_str(&text).unwrap();
assert_eq!(back.id, record.id);
assert_eq!(back.body.kind(), "attempt");Fields§
§schema: String§version: u32§id: String<kind>-<yyyymmddThhmmssZ>-<hex>, unique in the store.
task: StringThe task it was recorded under, or untasked.
recorded_at: StringWhen it was recorded, RFC 3339; stamped by the writer, never supplied.
head: Option<String>The commit the checkout was on.
redacted: Vec<String>Secret shapes the writer removed from the text, by shape name.
body: ReasoningBodyThe record.
Trait Implementations§
Source§impl Clone for ReasoningRecord
impl Clone for ReasoningRecord
Source§fn clone(&self) -> ReasoningRecord
fn clone(&self) -> ReasoningRecord
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 ReasoningRecord
impl Debug for ReasoningRecord
Source§impl<'de> Deserialize<'de> for ReasoningRecord
impl<'de> Deserialize<'de> for ReasoningRecord
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 ReasoningRecord
impl JsonSchema for ReasoningRecord
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 moreSource§impl Ordered for ReasoningRecord
Records are in the order they were written: by their millisecond stamp, then by id.
The stamps are fixed-width, so the label orders as time does.
impl Ordered for ReasoningRecord
Records are in the order they were written: by their millisecond stamp, then by id. The stamps are fixed-width, so the label orders as time does.