pub struct Stray {
pub path: String,
pub kind: StrayKind,
pub verdict: StrayVerdict,
pub age_seconds: Option<u64>,
pub session_id: String,
pub published_at: String,
pub target: String,
pub removable: bool,
pub removed: bool,
}Expand description
One stray file, its verdict, and the evidence that produced it.
Every field that decided something is carried, because the rule this command is shaped around requires the value that decided a verdict to be visible before the verdict acts: a surface that printed “orphan” without the age, the episode and the file that already holds it would be asking to be trusted rather than read.
use majordomus_cli::capability::builtin::recover::{Stray, StrayKind, StrayVerdict};
use serde_json::json;
let s: Stray = serde_json::from_value(json!({
"path": ".ai/repo/sessions/.tmp.a1b2c3",
"kind": "publish_temp",
"verdict": "orphan",
"age_seconds": 90_000,
"session_id": "s-0007",
"published_at": ".ai/repo/sessions/2026-09-11--s-0007.md",
"removable": true,
"removed": false,
})).unwrap();
assert_eq!(s.verdict, StrayVerdict::Orphan);
assert_eq!(s.kind, StrayKind::PublishTemp);
// removable and removed are different facts: a check run reports the first and never
// the second, which is what makes `--check` readable as a plan rather than a report.
assert!(s.removable && !s.removed);
// and an unmeasurable one carries no age at all, rather than a zero that would read as
// "brand new" to anything that compared it with a threshold
let u: Stray = serde_json::from_value(json!({
"path": ".mj-stage.xyz", "kind": "staging_dir", "verdict": "unmeasurable",
"removable": false, "removed": false,
})).unwrap();
assert!(u.age_seconds.is_none());Fields§
§path: StringThe path, repository-relative. Never the absolute one: a finding that names a disk is
a finding nobody else can act on (project.no-machine-paths).
kind: StrayKindWhich of the three shapes this is.
verdict: StrayVerdictWhat reading it decided.
age_seconds: Option<u64>How old it is, in seconds. Absent when the platform could not say, which is the
Unmeasurable verdict and never a zero.
session_id: StringThe episode this publish temp carries, when it carries one.
published_at: StringThe record that already holds that episode, when one does. Its presence is what turns
an Incomplete publish temp into an Orphan.
target: StringThe file a rename temp was going to become. Its presence is what turns an
Incomplete rename temp into an Orphan.
removable: boolWhether this call would remove it. Decided by the verdict and by
remove_stray’s own pattern guard, never by the caller.
removed: boolWhether this call did remove it. Always false on a check.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Stray
impl<'de> Deserialize<'de> for Stray
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 Stray
Source§impl JsonSchema for Stray
impl JsonSchema for Stray
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 Stray
Strays are shown in path order, which is the only order that is a property of the store
rather than of the walk that found it: read_dir yields what the filesystem feels like
yielding, and two runs over one store must answer identically.
impl Ordered for Stray
Strays are shown in path order, which is the only order that is a property of the store
rather than of the walk that found it: read_dir yields what the filesystem feels like
yielding, and two runs over one store must answer identically.
impl StructuralPartialEq for Stray
Auto Trait Implementations§
impl Freeze for Stray
impl RefUnwindSafe for Stray
impl Send for Stray
impl Sync for Stray
impl Unpin for Stray
impl UnsafeUnpin for Stray
impl UnwindSafe for Stray
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.