Skip to main content

RevisionHostOptions

Struct RevisionHostOptions 

Source
#[non_exhaustive]
pub struct RevisionHostOptions { /* private fields */ }
Expand description

What the embedding HOST decides for one revision, beyond its pinned packs. Default is exactly TenantRuntime::load_revision’s behaviour. Non-exhaustive so a later host seam is an additive field, not a breaking change: construct with RevisionHostOptions::default() plus the with_* setters.

Implementations§

Source§

impl RevisionHostOptions

Source

pub fn with_billing_meter( self, meter: Arc<dyn BillingMeter>, ) -> RevisionHostOptions

Record this unit’s agentic-worker LLM usage through meter as well — see TenantRuntime::load_revision_with for how it combines with the env-configured cloud-commerce sink.

Source

pub fn with_run_outcome_sink( self, sink: Arc<dyn RunOutcomeSink>, ) -> RevisionHostOptions

Report one crate::run_outcome::RunOutcome per flow turn of this unit through sink — the deployed run audit. greentic-start installs a crate::run_outcome::HttpRunOutcomeSink built from the same staged metering block as the billing meter. Without one, flow execution and the persisted resume state are unchanged.

Source

pub fn with_approval_inbox( self, target: ApprovalInboxTarget, ) -> RevisionHostOptions

File this unit’s human approvals with the admin’s HTTP approval inbox and poll for the decisions, instead of needing a NATS broker — the HTTP approval rail (greentic-designer docs/superpowers/specs/2026-09-29-approval-rail-http-design.md). greentic-start builds the target from the same staged metering block as the run-outcome sink.

Serves ONLY approval.call: it goes into the engine’s own approval slot, so sorla.call still fails with sorla_route_missing on a lane with no broker. When GREENTIC_EVENTS_NATS_URL also connects, NATS wins and the inbox is not installed. A target that fails validation (blank field, cleartext URL off loopback) is logged and skipped; the runtime loads either way, and an approval that needs a human then fails at the node as it did before. Validate early with crate::runner::approval_http::HttpApprovalDispatcher::new.

Source

pub fn with_user_ledger(self, target: UserLedgerTarget) -> RevisionHostOptions

Read and append this unit’s user ledger (shared context, Phase C) at the admin’s ledger door. greentic-start builds the target from the same staged metering block as the approval inbox: base_url is the worker-usage endpoint with its last segment swapped for ledger, token the unit’s metering token, tenant_slug the block’s slug. The runner never reads that block itself.

Nothing happens unless a pack also names an agent in assets/user-ledger.json, and only a turn whose caller the provider verified, outside any tool call, touches the ledger. That sidecar alone decides read versus read_write for the pack’s own agents: there is no host-side ceiling on the mode. The gates are the door token’s ledger purpose (the admin refuses a token without it), the GREENTIC_AW_USER_LEDGER kill switch, the tenant match between the runtime and the turn, and a provider-verified subject. A target that fails validation (blank field, cleartext URL off loopback, userinfo in the URL) is one warning and the runtime loads without the ledger; validate early with greentic_aw_runtime::user_ledger::HttpUserLedger::new. The admin refuses a token without the ledger purpose, and the client then stops asking for a while. GREENTIC_AW_USER_LEDGER=0 turns it off.

Source

pub fn with_artifact_reader( self, reader: Arc<dyn ArtifactReader>, ) -> RevisionHostOptions

Open this unit’s message attachments through reader (contract C3 get on the admin artifacts door). greentic-start builds it from the same staged metering block as the other door targets, with the door base sibling_door(endpoint, "artifacts") and the unit’s metering token: the token is this unit’s, so the door reads only this unit’s tenant.

Per REVISION rather than a HostBuilder setting for the same reason as the billing meter: one greentic-start process serves every unit, and each unit has its own token. Without one the unit has NO reader: the GREENTIC_ARTIFACT_* env variables are never read on this path, even when a HostBuilder opted in to the env fallback (they would hand every unit of the process one token). Each attachment is then a fixed notice to the agent and the turn still runs. Only the multi-provider backend (greentic-llm-backend) reads attachments.

Source

pub fn with_ext_artifact_port( self, port: Arc<dyn ArtifactPort>, ) -> RevisionHostOptions

Store the files this unit’s extensions create (host.artifact.put, contract C3 put) through port. greentic-start builds it per unit, over that unit’s own door and token, like Self::with_artifact_reader.

Per REVISION for the same reason: one process serves every unit, each with its own token. Without one the unit has NO port: the GREENTIC_ARTIFACT_* env variables are never read on this path, and an extension’s put answers unsupported.

Trait Implementations§

Source§

impl Clone for RevisionHostOptions

Source§

fn clone(&self) -> RevisionHostOptions

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 RevisionHostOptions

Source§

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

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

impl Default for RevisionHostOptions

Source§

fn default() -> RevisionHostOptions

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

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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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> 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> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self> ⓘ

Attaches the current Context to this type, returning a WithContext wrapper. Read more
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> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Pointee for T

Source§

type Pointer = u32

Source§

fn debug( pointer: <T as Pointee>::Pointer, f: &mut Formatter<'_>, ) -> Result<(), Error>

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