Skip to main content

Runtime

Struct Runtime 

Source
pub struct Runtime;
Expand description

The formation guru.

Organism’s runtime does exactly three things:

  1. Quick admission gate (is the intent even valid?)
  2. Run formations in Converge (each is a team of heterogeneous Suggestors)
  3. Pick the winner

Everything else — adversarial review, simulation, planning, policy checks — happens INSIDE the formation as Suggestors in the convergence loop.

Implementations§

Source§

impl Runtime

Source

pub fn new() -> Self

Source

pub fn admit_intent( &self, intent: &IntentPacket, actor: AdmissionActor, source: AdmissionSource, context: &mut ContextState, ) -> Result<AdmissionReceipt, IntentAdmissionError>

Run organism’s structural admission gate on an IntentPacket and stage it through Converge’s typed admission boundary.

This is the public Organism → Helms contract for getting work into the runtime. Callers compile their input (e.g. with axiom_truth::compile_intent for Truth-shaped sources) into an IntentPacket and pass it here.

Flow:

  1. Organism’s structural admission gate runs (cheap, deterministic).
  2. The intent is staged through converge_kernel::admission::admit_observation under ContextKey::Seeds. The kernel produces the AdmissionReceipt; promotion to a governed fact happens later through the engine’s normal gate.

Returns the AdmissionReceipt — proof the intent has been staged. The caller already holds the IntentPacket and can use it directly to drive resolution and planning.

§Errors

Returns IntentAdmissionError if the intent fails the admission gate, or fails Converge admission validation.

Source

pub fn select_formation<'cat>( &self, intent: &IntentPacket, catalog: &'cat FormationCatalog, capabilities: &[SuggestorCapability], ) -> Result<GuruSelection<'cat>, GuruError>

Pick a formation template for intent from catalog given the host’s available capabilities. The guru classifies the intent, queries the catalog by class-derived keywords, and post-filters by the host’s declared capability inventory. Returns the chosen primary plus up to two alternates and a SelectionTrace explaining the choice.

This is auto-mode’s front half — selection without execution. To run the chosen template, build a FormationCompileRequest keyed on selection.primary.id() and call [compile_and_run_formation].

§Errors

Returns GuruError if no template in catalog satisfies the classified problem under capabilities.

Source

pub fn compile_formation( &self, intent: &IntentPacket, request: &FormationCompileRequest, catalogs: &FormationCompilerCatalogs, ) -> Result<CompiledFormationPlan, PipelineError>

Admit an intent and compile the formation plan Organism would run.

This is the pure compiler boundary: descriptor catalogs produce an auditable formation plan without creating live suggestor instances.

Source

pub fn compile_and_instantiate_formation( &self, intent: &IntentPacket, request: &FormationCompileRequest, catalogs: &FormationCompilerCatalogs, executables: &ExecutableSuggestorCatalog, seeds: impl IntoIterator<Item = Seed>, ) -> Result<(CompiledFormationPlan, Formation), PipelineError>

Admit, compile, and instantiate a runnable formation from registered executable suggestor factories.

This keeps the boundary honest: a plan can run only when every compiled suggestor_id has a concrete factory in executables.

Source

pub async fn compile_and_run_formation( &self, intent: &IntentPacket, request: &FormationCompileRequest, catalogs: &FormationCompilerCatalogs, executables: &ExecutableSuggestorCatalog, seeds: impl IntoIterator<Item = Seed>, observer: Option<Arc<dyn ExperienceEventObserver>>, ) -> Result<FormationExecutionRecord, PipelineError>

Admit, compile, instantiate, and run one formation candidate.

This is the single-candidate execution path. Tournaments can build on top of this by running multiple compile requests and comparing returned FormationExecutionRecord values.

Source

pub fn compile_formation_from_catalog( &self, intent: &IntentPacket, request: &FormationCompileRequest, formation_templates: &FormationCatalog, catalog: &DiscoveryCatalog, providers: &ProviderDescriptorCatalog, advisory_order: Option<&[String]>, ) -> Result<CompiledFormationPlan, PipelineError>

Admit an intent and compile a formation plan from a DiscoveryCatalog. Catalog-aware parallel to Self::compile_formation.

Source

pub fn compile_and_instantiate_from_catalog( &self, intent: &IntentPacket, request: &FormationCompileRequest, formation_templates: &FormationCatalog, catalog: &DiscoveryCatalog, providers: &ProviderDescriptorCatalog, executables: &ExecutableSuggestorCatalog, seeds: impl IntoIterator<Item = Seed>, advisory_order: Option<&[String]>, ) -> Result<(CompiledFormationPlan, Formation), PipelineError>

Admit, compile from catalog, and instantiate a runnable formation. Catalog-aware parallel to Self::compile_and_instantiate_formation.

Source

pub async fn compile_k_and_run_tournament<F>( &self, intent: &IntentPacket, request: &FormationCompileRequest, formation_templates: &FormationCatalog, catalog: &DiscoveryCatalog, providers: &ProviderDescriptorCatalog, executables: &ExecutableSuggestorCatalog, seeds_fn: F, k: usize, ) -> Result<CatalogTournamentOutcome, PipelineError>

Source k candidate rosters from the catalog, instantiate each, and run a FormationTournament to pick the winner.

Each candidate covers the same formation template requirements but draws a different roster from the catalog (via swap-out diversity — see FormationCompiler::compile_k_candidates). The returned CatalogTournamentOutcome carries both the tournament result (winner + scores + priors) and each candidate’s CompiledFormationPlan (with its decisions trace) so the audit trail shows selection rationale AND score outcome side-by-side.

seeds_fn is called once per candidate to produce its seed inventory — formations consume their seeds when run, so each candidate needs its own fresh Vec<Seed>.

Source

pub async fn handle( &self, intent: IntentPacket, formations: Vec<Formation>, ) -> Result<OrganismResult, PipelineError>

Drive an intent through the pipeline.

The caller is responsible for assembling formations (teams of Suggestors). That’s the formation-guru logic — deciding which agents to include based on the intent’s characteristics, available capabilities, and learned priors.

Each formation may include any mix of:

  • LLM reasoning agents
  • Optimization solvers
  • Policy gates
  • Analytics/ML agents
  • Adversarial skeptics
  • Domain-specific pack agents

All participate through the same Suggestor trait. Same contract, same governance, same convergence loop.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Adaptor<()> for T

Source§

fn adapt(&self)

Adapt the type to be passed to a metric.
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<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> IntoComptime for T

Source§

fn comptime(self) -> Self

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> 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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: 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: 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> Same for T

Source§

type Output = T

Should always be Self
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
Source§

impl<T> PlanCallbackArgs for T

Source§

impl<T> PlanCallbackOut for T