pub struct SessionInfo {
pub session: String,
pub client: String,
pub worker: Option<String>,
pub intent: Option<String>,
pub task: Option<String>,
pub issue: Option<String>,
pub milestone: Option<String>,
pub checkout: Option<String>,
pub branch: Option<String>,
pub head: Option<String>,
pub dirty: Option<bool>,
pub context: Option<String>,
}Expand description
What a session tells the mesh about itself. Every field is a public fact about work in progress; none is a path on the author’s disk, a secret or a credential.
Almost everything here is optional, and that is the design: a session says what it knows, and a field it leaves out is omitted rather than carried empty, so a reader can tell “no task” from “a task called nothing”. Opening the same session id again replaces this record, which is how a session that learns its branch later tells the mesh.
use majordomus_cli::mesh::journal::SessionInfo;
let mut info = SessionInfo::named("s1", "claude-code");
assert_eq!(info.task, None);
assert!(serde_json::to_value(&info).unwrap().get("task").is_none(), "unsaid, not empty");
info.branch = Some("feature/mesh-cooperation".into());
assert_eq!(serde_json::to_value(&info).unwrap()["branch"], "feature/mesh-cooperation");Fields§
§session: StringThe session’s id within its stream.
client: StringThe client: claude-code, codex, cli, …
worker: Option<String>The worker’s own name for itself, when it gave one.
intent: Option<String>What the session says it is doing.
task: Option<String>The task id (t-...) the session works under.
issue: Option<String>The issue (I0001, #184) the work belongs to.
milestone: Option<String>The milestone the work belongs to.
checkout: Option<String>The checkout id (a digest, never a path).
branch: Option<String>The branch checked out.
head: Option<String>The commit checked out.
dirty: Option<bool>Whether the working tree had uncommitted changes when this was said.
context: Option<String>The context revision the session works from (a digest the context compiler names).
Implementations§
Source§impl SessionInfo
impl SessionInfo
Sourcepub fn named(session: &str, client: &str) -> Self
pub fn named(session: &str, client: &str) -> Self
A session with only an id and a client: what a test or an example needs. The two arguments are the two facts a session cannot be without — something to refer to it by, and what kind of worker it is — and everything else is filled in afterwards by whoever knows it.
use majordomus_cli::mesh::journal::SessionInfo;
let info = SessionInfo::named("s1", "codex");
assert_eq!((info.session.as_str(), info.client.as_str()), ("s1", "codex"));
assert_eq!(info.worker, None, "the rest is the session's to say later");Trait Implementations§
Source§impl Clone for SessionInfo
impl Clone for SessionInfo
Source§fn clone(&self) -> SessionInfo
fn clone(&self) -> SessionInfo
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 SessionInfo
impl Debug for SessionInfo
Source§impl Default for SessionInfo
impl Default for SessionInfo
Source§fn default() -> SessionInfo
fn default() -> SessionInfo
Source§impl<'de> Deserialize<'de> for SessionInfo
impl<'de> Deserialize<'de> for SessionInfo
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 SessionInfo
Source§impl JsonSchema for SessionInfo
impl JsonSchema for SessionInfo
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 SessionInfo
impl PartialEq for SessionInfo
Source§fn eq(&self, other: &SessionInfo) -> bool
fn eq(&self, other: &SessionInfo) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for SessionInfo
impl Serialize for SessionInfo
impl StructuralPartialEq for SessionInfo
Auto Trait Implementations§
impl Freeze for SessionInfo
impl RefUnwindSafe for SessionInfo
impl Send for SessionInfo
impl Sync for SessionInfo
impl Unpin for SessionInfo
impl UnsafeUnpin for SessionInfo
impl UnwindSafe for SessionInfo
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.