pub struct ActionContract {
pub name: String,
pub input_schema: Value,
pub output_schema: Value,
pub node: Option<String>,
pub timeout: Option<Duration>,
pub retry: Option<RetryContract>,
pub advisory: bool,
pub agent: bool,
pub body: Option<ActionBodyContract>,
}Expand description
One typed activity declaration.
Fields§
§name: StringActivity type.
input_schema: ValueObject schema over the activity parameters.
output_schema: ValueActivity result schema.
node: Option<String>Declared node selector.
timeout: Option<Duration>Declared schedule-to-close timeout.
retry: Option<RetryContract>Declaration-owned retry envelope.
advisory: boolWhether the declaration classes this activity as ADVISORY: a side channel whose failure warns on the run and never faults the calling step (RUNTIME-OPERATIONS.md R5). Identity-bound — flipping it changes what the package promises a caller.
agent: boolWhether the declaration classes this activity as an AGENT seam: its one
String parameter carries a prompt and its String result carries the
reply, so a worker hands the call to an agent harness rather than to a
typed handler. The checker enforces that shape, so a worker reading this
flag may rely on it.
Identity-bound for the same reason advisory is — an action that
becomes an agent seam promises a caller something different — and
skipped when false, so a document with no agent action hashes exactly as
it did before the marker existed.
body: Option<ActionBodyContract>The declarative body the action carries, when it declares one.
None is a requirement on an out-of-band worker: the action’s name
and schemas are the whole promise, and something must connect to
serve it. Some means the package itself says what the action DOES,
so the host can execute it with no worker connected.
Identity-bound deliberately: the body is executable authority, and an authority that did not participate in the package hash could be rewritten in storage without changing what the deployment claims to be. A body edit is a new package, always.
Implementations§
Source§impl ActionContract
impl ActionContract
Sourcepub fn worker_owed(&self) -> bool
pub fn worker_owed(&self) -> bool
Whether serving this action is a WORKER’s job.
true when the action carries no declared body: the declaration is a
requirement on an out-of-band worker, and nothing runs until one
connects and advertises the action. false when the action carries a
declared body: the package itself says what the action does, the host
executes it, and no worker is needed or admitted for it.
This is the one place the body-exemption rule lives. Every surface
that splits a queue’s actions into worker-owed and server-run —
admission diffs, availability, scaffolding, codegen — must call this
rather than restate body.is_none().
Trait Implementations§
Source§impl Clone for ActionContract
impl Clone for ActionContract
Source§fn clone(&self) -> ActionContract
fn clone(&self) -> ActionContract
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 ActionContract
impl Debug for ActionContract
Source§impl<'de> Deserialize<'de> for ActionContract
impl<'de> Deserialize<'de> for ActionContract
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 ActionContract
Source§impl PartialEq for ActionContract
impl PartialEq for ActionContract
Source§impl Serialize for ActionContract
impl Serialize for ActionContract
impl StructuralPartialEq for ActionContract
Auto Trait Implementations§
impl Freeze for ActionContract
impl RefUnwindSafe for ActionContract
impl Send for ActionContract
impl Sync for ActionContract
impl Unpin for ActionContract
impl UnsafeUnpin for ActionContract
impl UnwindSafe for ActionContract
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§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.