pub struct ObservedAssignment {
pub run_id: String,
pub slot: String,
pub goal: Option<String>,
pub project_root: Option<String>,
pub work_dir: Option<String>,
pub task_metadata: Option<Value>,
pub task_metadata_omitted: bool,
pub text_truncated: bool,
pub at_secs: u64,
}Expand description
One Assign as the assigned Operator session observed it — the
per-entry shape of the 記名’s observed part (model §4.2’s second row:
担当した Run と goal / project_root / work_dir / task_metadata /
最終活動時刻).
§Every field is what the server could actually read
The three path-ish fields come from the Task row’s task_input_spec
(the persisted TaskInputSpec the launch was given, which is also what
TaskInputMiddleware is later built from), and goal from the same
row. A launch that carried no Task-level input leaves all three None,
and nothing is substituted for them: an invented project_root would
be read as a fact about where the work is happening.
Fields§
§run_id: StringThe Run whose seat was taken.
slot: StringWhich Blueprint-declared Operator seat (Run.current’s key).
goal: Option<String>The owning Task’s human-facing goal, when the Task row could be
read. None = the read failed; it is not a claim that the Task has
no goal (the field is not optional on the Task row).
Cut to OBSERVED_TEXT_MAX_BYTES — see Self::text_truncated.
project_root: Option<String>Task-level project root, from the launch’s TaskInputSpec. Cut to
OBSERVED_TEXT_MAX_BYTES — see Self::text_truncated.
work_dir: Option<String>Task-level working directory, from the same spec. Cut to
OBSERVED_TEXT_MAX_BYTES — see Self::text_truncated.
task_metadata: Option<Value>Task-level metadata bag, from the same spec. Dropped when it
serializes above TASK_METADATA_MAX_BYTES — see
Self::task_metadata_omitted.
task_metadata_omitted: booltrue when Self::task_metadata was present but too large to
carry, so a reader does not read the null as “the launch supplied
none”.
text_truncated: booltrue when at least one of Self::goal / Self::project_root /
Self::work_dir was longer than OBSERVED_TEXT_MAX_BYTES and
was cut to fit.
One flag for the three because it answers the one question a cut
raises — “is what I am reading the whole value?” — and the cut
values name themselves: each ends in …. A flag per field would
only restate that.
Additive with #[serde(default)]: rows written before the ceiling
existed decode as false, which is what they were — nothing had
been cut.
at_secs: u64Unix epoch seconds of the Assign this entry records — the session’s
last activity when this is its newest entry
(OperatorSessionRecord::last_activity_secs).
Implementations§
Source§impl ObservedAssignment
impl ObservedAssignment
Sourcepub fn new(
run_id: String,
slot: String,
goal: Option<String>,
project_root: Option<String>,
work_dir: Option<String>,
task_metadata: Option<Value>,
at_secs: u64,
) -> Self
pub fn new( run_id: String, slot: String, goal: Option<String>, project_root: Option<String>, work_dir: Option<String>, task_metadata: Option<Value>, at_secs: u64, ) -> Self
Build an entry, applying the TASK_METADATA_MAX_BYTES bound to
task_metadata and the OBSERVED_TEXT_MAX_BYTES bound to each of
the three caller-supplied strings.
This is the only constructor callers use, which is what makes the bounds a property of the type rather than a rule a call site has to remember: every entry that reaches the ring came through here.
A metadata value that will not even serialize is treated as an oversized one (dropped, flagged) rather than as absent — the failure is about carrying it, not about having it.
Trait Implementations§
Source§impl Clone for ObservedAssignment
impl Clone for ObservedAssignment
Source§fn clone(&self) -> ObservedAssignment
fn clone(&self) -> ObservedAssignment
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 ObservedAssignment
impl Debug for ObservedAssignment
Source§impl<'de> Deserialize<'de> for ObservedAssignment
impl<'de> Deserialize<'de> for ObservedAssignment
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>,
Source§impl PartialEq for ObservedAssignment
impl PartialEq for ObservedAssignment
Source§impl Serialize for ObservedAssignment
impl Serialize for ObservedAssignment
impl StructuralPartialEq for ObservedAssignment
Auto Trait Implementations§
impl Freeze for ObservedAssignment
impl RefUnwindSafe for ObservedAssignment
impl Send for ObservedAssignment
impl Sync for ObservedAssignment
impl Unpin for ObservedAssignment
impl UnsafeUnpin for ObservedAssignment
impl UnwindSafe for ObservedAssignment
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<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