pub struct Subtask {
pub id: String,
pub instruction: String,
pub deps: Vec<String>,
pub parallel_ok: bool,
pub context: Vec<String>,
pub verify: Option<String>,
pub status: SubtaskStatus,
pub result: Option<String>,
pub parent: Option<String>,
pub caveat_policy: CaveatPolicy,
}Expand description
One unit of work in a Plan — the serialized form of a single scheduler
dispatch. A fragment-valid [[subtask]] table is exactly this.
Fields§
§id: StringStable identifier, referenced by other subtasks’ Subtask::deps.
instruction: StringWhat the child agent is asked to do.
deps: Vec<String>Ids of subtasks that must complete before this one may start.
parallel_ok: boolMay this subtask run concurrently with its ready siblings?
context: Vec<String>The leaf’s FILE SCOPE — its write lane (#812), not reading material.
At dispatch this is forwarded as args["scope"] and intersected into
the effective writable set (worktree ∩ fs_write ∩ scope): a meet-only
convenience fence that can only narrow, never widen. Empty = unfenced
(pre-#812 behavior). Matching is exact-file or directory-prefix, with
./ and trailing-/ normalized; degenerate entries ("", ".")
fail open. Populated by the harness’s own def-site grounding, with
model-declared files appended as untrusted augmentation.
verify: Option<String>Optional verify command whose enforced result gates the subtask (#332 S1). Absent = no per-subtask gate.
status: SubtaskStatusExecution status — makes the plan file a resumable run-log.
result: Option<String>Where the child’s output lands on completion (aggregation destination).
None until the subtask has run.
parent: Option<String>The id of the subtask this one decomposes — None for a root. This is how
a flat [[subtask]] list expresses a task→sub-task tree (exactly as
Subtask::deps expresses a DAG via id-pointers, not nesting). A subtask
that no other subtask names as its parent is a leaf — the unit that
dispatches/executes (a leaf is a CrewTask); a subtask that is named
is a branch (a grouping / aggregation node). Kept flat on purpose: a
nested Vec<Subtask> would break the fragment handoff (one leaf slice =
one dispatch). None is also fine in a fragment whose parent lives outside
the slice (the pointer is soft, like a cross-fragment dep).
caveat_policy: CaveatPolicyThe authority this subtask declares it needs. Default-deny: an
omitted policy denies every capability axis (see CaveatPolicy).
Serialized last so every scalar field precedes this sub-table — TOML
requires values before tables within a [[subtask]] entry.
Implementations§
Source§impl Subtask
impl Subtask
Sourcepub fn to_crew_task(&self, parent: &Caveats) -> CrewTask
pub fn to_crew_task(&self, parent: &Caveats) -> CrewTask
Project this subtask into the CrewTask the active topology’s
CrewRunner dispatches — the same projection for /mode single|crew|mesh|remote, so a plan authored once lifts across runners
unchanged. caveats = parent.meet(self.caveat_policy.to_caveats()): the
plan requests, the parent grants, meet enforces ⊑ (attenuation
only). Intended for a leaf (see Plan::leaves); a branch is a
grouping node, not a dispatch unit.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Subtask
impl<'de> Deserialize<'de> for Subtask
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 Subtask
impl StructuralPartialEq for Subtask
Auto Trait Implementations§
impl Freeze for Subtask
impl RefUnwindSafe for Subtask
impl Send for Subtask
impl Sync for Subtask
impl Unpin for Subtask
impl UnsafeUnpin for Subtask
impl UnwindSafe for Subtask
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>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more