Skip to main content

ObservedAssignment

Struct ObservedAssignment 

Source
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: String

The Run whose seat was taken.

§slot: String

Which 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: bool

true 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: bool

true 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: u64

Unix 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

Source

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

Source§

fn clone(&self) -> ObservedAssignment

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ObservedAssignment

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ObservedAssignment

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for ObservedAssignment

Source§

fn eq(&self, other: &ObservedAssignment) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ObservedAssignment

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ObservedAssignment

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> MaybeSend for T

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more