pub struct Stranded {
pub session_id: String,
pub path: String,
pub reason: String,
pub remedy: String,
}Expand description
An open episode that cannot close itself, and what to do about it.
The remedy here is the mechanical one — remove the file — because it is correct in every
checkout and needs nothing that is not already installed. lib/recover.sh on
feature/session-store-recovery is the same three degradations seen from the writing
side: it classifies each candidate by reading it, prints the evidence before acting, and
closes a stranded episode into a real record rather than deleting it. When that lands,
the remedy a finding carries should become majordomus recover episodes and the two
detections should become one — a reader and a writer that each decide for themselves
what “stranded” means are two definitions, and this repository has been bitten by that
shape often enough to name it.
use majordomus_cli::capability::builtin::lifecycle::Stranded;
use serde_json::json;
let s: Stranded = serde_json::from_value(json!({
"session_id": "s-0007",
"path": ".ai/local/state/sessions-open/claude-7.yaml",
"reason": "the worktree it opened in is gone from disk",
"remedy": "rm .ai/local/state/sessions-open/claude-7.yaml",
})).unwrap();
// the reason is about the world and the remedy is a command: a finding with no
// remedy is a complaint, so both are required fields rather than optional ones
assert!(!s.reason.is_empty() && !s.remedy.is_empty());
assert!(s.remedy.contains(&s.path), "the remedy acts on the file it names");Fields§
§session_id: StringThe episode id.
path: StringThe open record, repository-relative.
reason: StringWhy it is stranded.
remedy: StringThe command that clears it. A finding with no remedy is a complaint.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Stranded
impl<'de> Deserialize<'de> for Stranded
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 Stranded
Source§impl JsonSchema for Stranded
impl JsonSchema for Stranded
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 Stranded
Auto Trait Implementations§
impl Freeze for Stranded
impl RefUnwindSafe for Stranded
impl Send for Stranded
impl Sync for Stranded
impl Unpin for Stranded
impl UnsafeUnpin for Stranded
impl UnwindSafe for Stranded
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.