pub struct ClosedSession {
pub session_id: String,
pub uri: String,
pub path: String,
pub created_at: String,
pub branch: String,
pub head: String,
pub outcome: String,
pub title: String,
}Expand description
One closed episode of the tracked, durable projection — the half of this subsystem that survives a clone.
It carries both a path and a uri because they answer different questions: the path
is where the record is in this checkout, and the majordomus://session/<identity>
identifier is what every other surface addresses the same record by, so a reader can
follow it to the object page without constructing one.
Everything but the identity, the identifier and the path is optional, because a record written by an older close carries fewer fields and is still a record.
use majordomus_cli::capability::builtin::lifecycle::ClosedSession;
use serde_json::json;
let s: ClosedSession = serde_json::from_value(json!({
"session_id": "s-0042",
"uri": "majordomus://session/2026-09-12-s-0042",
"path": ".ai/repo/project/sessions/2026-09-12-s-0042.md",
"created_at": "2026-09-12T15:44:00Z",
"branch": "master",
"head": "cd04012f1",
"outcome": "landed",
})).unwrap();
assert!(s.uri.starts_with("majordomus://session/"), "addressable as an object");
assert_eq!(s.outcome, "landed");
// an older record with less in it is still one, and says so by absence
let sparse: ClosedSession = serde_json::from_value(json!({
"session_id": "s-0001",
"uri": "majordomus://session/2026-08-01-s-0001",
"path": ".ai/repo/project/sessions/2026-08-01-s-0001.md",
})).unwrap();
assert!(sparse.outcome.is_empty() && sparse.title.is_empty());Fields§
§session_id: StringThe episode id.
uri: Stringmajordomus://session/<identity>, for the object page.
path: StringRepository-relative path.
created_at: StringWhen it closed, as recorded.
branch: StringThe branch it closed on.
head: StringThe commit it closed at.
outcome: StringThe typed outcome the close recorded.
title: StringIts title, when the record carries one.
Trait Implementations§
Source§impl Clone for ClosedSession
impl Clone for ClosedSession
Source§fn clone(&self) -> ClosedSession
fn clone(&self) -> ClosedSession
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 ClosedSession
impl Debug for ClosedSession
Source§impl<'de> Deserialize<'de> for ClosedSession
impl<'de> Deserialize<'de> for ClosedSession
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>,
impl Eq for ClosedSession
Source§impl JsonSchema for ClosedSession
impl JsonSchema for ClosedSession
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 PartialEq for ClosedSession
impl PartialEq for ClosedSession
Source§fn eq(&self, other: &ClosedSession) -> bool
fn eq(&self, other: &ClosedSession) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for ClosedSession
impl Serialize for ClosedSession
impl StructuralPartialEq for ClosedSession
Auto Trait Implementations§
impl Freeze for ClosedSession
impl RefUnwindSafe for ClosedSession
impl Send for ClosedSession
impl Sync for ClosedSession
impl Unpin for ClosedSession
impl UnsafeUnpin for ClosedSession
impl UnwindSafe for ClosedSession
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
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
key and return true if they are equal.