pub struct Episodes {
pub present: bool,
pub store: String,
pub worktree: String,
pub current: String,
pub episodes: Vec<Episode>,
pub findings: Vec<String>,
}Expand description
Every open episode of this checkout’s store — the answer continuity.state cannot give,
because it reads the pointer and this reads the store.
current is the one episode the pointer resolves to, and it is one row of episodes
rather than a separate thing: the whole correction this type carries is that the pointed-at
episode is a member of the set and not the set. On the day this was written the store
held five open episodes in one checkout and every surface could name one of them.
present: false is a fresh clone, which is not a fault — nobody has opened an episode
here yet — and is reported as itself rather than as an error.
use majordomus_cli::capability::builtin::lifecycle::Episodes;
use serde_json::json;
// a clone in which no episode has ever been opened: absence, answered as absence
let fresh: Episodes = serde_json::from_value(json!({
"present": false,
"store": ".ai/local/state/sessions-open",
"worktree": "example/a-fresh-clone",
})).unwrap();
assert!(!fresh.present);
assert!(fresh.episodes.is_empty() && fresh.current.is_empty());
assert!(fresh.findings.is_empty(), "nothing to warn about; it is simply new");
// and a store with work in it: `current` names one of the rows, never a sixth thing
let busy: Episodes = serde_json::from_value(json!({
"present": true,
"store": ".ai/local/state/sessions-open",
"worktree": "example/wt",
"current": "s-0002",
"episodes": [
{"session_id": "s-0001", "path": "a.yaml", "standing": "open",
"events": 3, "note": "this worktree, not pointed at"},
{"session_id": "s-0002", "path": "b.yaml", "standing": "current",
"events": 9, "note": "the pointer resolves to it"},
],
})).unwrap();
assert_eq!(busy.episodes.len(), 2, "the pointer is blind to the first of these");
assert!(busy.episodes.iter().any(|e| e.session_id == busy.current));Fields§
§present: boolWhether the open-episode store exists. False in a fresh clone, which is not a fault.
store: StringThe store, repository-relative.
worktree: StringThis worktree, absolute. Every standing above is decided against it.
current: StringThe episode id the pointer resolves to, when it resolves to one.
episodes: Vec<Episode>Every open episode, newest first by recorded start.
findings: Vec<String>What a reader should know before trusting the above: a file that does not parse, a pointer that resolves to nothing. Empty is the good case.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Episodes
impl<'de> Deserialize<'de> for Episodes
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 Episodes
Source§impl JsonSchema for Episodes
impl JsonSchema for Episodes
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 moreimpl StructuralPartialEq for Episodes
Auto Trait Implementations§
impl Freeze for Episodes
impl RefUnwindSafe for Episodes
impl Send for Episodes
impl Sync for Episodes
impl Unpin for Episodes
impl UnsafeUnpin for Episodes
impl UnwindSafe for Episodes
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.