Skip to main content

PackageContract

Struct PackageContract 

Source
pub struct PackageContract {
    pub input_schema: Value,
    pub output_schema: Value,
    pub workers: Vec<WorkerContract>,
    pub children: Vec<ChildContract>,
    pub signals: Vec<SignalContract>,
    pub additional_workflows: Vec<AdditionalWorkflowContract>,
    pub unscoped_activities: Vec<String>,
    pub workloop: Option<WorkloopContract>,
}
Expand description

The complete contract surface committed into a package’s .v4 identity.

Fields§

§input_schema: Value

Primary workflow input schema.

§output_schema: Value

Primary workflow output schema.

§workers: Vec<WorkerContract>

Queue-scoped activity declarations.

§children: Vec<ChildContract>

Declared child workflow callables.

§signals: Vec<SignalContract>

Declared signal payloads.

§additional_workflows: Vec<AdditionalWorkflowContract>

Additional workflow entry schemas in this package.

§unscoped_activities: Vec<String>

Activity names retained by legacy project manifests that cannot declare a queue or typed activity surface. They remain identity-bound but do not create a queue declaration.

§workloop: Option<WorkloopContract>

The workloop declaration surface, when the package’s entry document is a workloop. This is what the ENGINE reads at start time to arm the cadence, seed generation 1’s carries and evaluate tolerances, so it must travel with the deployed archive rather than only with the in-process compile output — a server restart must not forget what a deployed loop’s tolerances were.

IDENTITY-BOUND, and that is not a formality: a tolerance rewritten in storage changes WHEN a loop alarms, and a retention window rewritten in storage changes WHAT is destroyed. Both are executable authority, so two packages that differ in them must not be one version.

Implementations§

Source§

impl PackageContract

Source

pub fn unenforceable_schemas(&self) -> Vec<UnenforceableSchema>

Every declared schema in this contract that cannot be compiled into a validator, in declaration order.

This is the whole contract surface, not only the schemas today’s admission boundaries happen to read: a declaration is identity-bound, so a package that commits to a shape no validator can compile has promised something it can never be held to, whichever boundary reaches it first. An empty result means every declaration this package makes is one the engine can actually enforce.

A declaration that constrains nothing (declares_nothing) is not a failure — it says nothing on purpose, and admission skips it deliberately rather than by breaking.

Source

pub fn declared_signal(&self, signal_name: &str) -> Option<&SignalContract>

The declared signal record for signal_name, when this contract declares one.

Source

pub fn declared_signal_names(&self) -> Vec<&str>

Every declared signal name, in stable sorted order.

Used to tell a caller which names the package actually accepts when it named one the package does not declare.

Source

pub fn entry_input_schema(&self, workflow_type: &str) -> &Value

The declared input schema for the entry workflow_type.

A package archive can carry several workflow entries under one identity: the primary entry’s schema is PackageContract::input_schema and every additional entry carries its own in PackageContract::additional_workflows. An additional entry is matched by name first, so a synthesized child entry is never validated against the primary entry’s shape; any other name is the primary entry, which is the only other type a catalog can hold for this identity.

Source§

impl PackageContract

Source

pub fn canonical_bytes(&self) -> Vec<u8>

Returns the deterministic binary encoding committed by the current identity domain.

Declaration vectors and JSON object keys are sorted before encoding. JSON whitespace and source map insertion order therefore cannot affect package identity.

Source

pub fn legacy_v5_canonical_bytes(&self) -> Vec<u8>

The superseded .v5 encoding, exactly as every released cut from v0.19 through v0.24 computed it: no per-action agent byte, no workloop block.

🔴 VERIFICATION-ONLY MIGRATION SURFACE. This exists so the verifier in crate::hash can re-attest archives those releases minted — a store restarted under the current build must not strand its own recorded deployments. Nothing ever MINTS a .v5 identity again; calling this anywhere except a verifier is a defect.

Source§

impl PackageContract

Source

pub fn from_manifest(manifest: &Manifest) -> Self

Produces the most precise contract available from a legacy manifest.

This never invents a queue or schemas for bare activity names. Such names are committed as unscoped records and therefore cannot satisfy a structural queue-service check.

Trait Implementations§

Source§

impl Clone for PackageContract

Source§

fn clone(&self) -> PackageContract

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 PackageContract

Source§

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

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

impl Default for PackageContract

Source§

fn default() -> PackageContract

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for PackageContract

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 Eq for PackageContract

Source§

impl PartialEq for PackageContract

Source§

fn eq(&self, other: &PackageContract) -> 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 PackageContract

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 PackageContract

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> 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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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<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