Skip to main content

Pack

Trait Pack 

Source
pub trait Pack: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn version(&self) -> &'static str;
    fn validate_inputs(&self, inputs: &Value) -> Result<(), GateError>;
    fn invariants(&self) -> &[InvariantDef];
    fn solve(&self, spec: &ProblemSpec) -> Result<PackSolveResult, GateError>;
    fn check_invariants(
        &self,
        plan: &ProposedPlan,
    ) -> Result<Vec<InvariantResult>, GateError>;
    fn evaluate_gate(
        &self,
        plan: &ProposedPlan,
        invariant_results: &[InvariantResult],
    ) -> PromotionGate;
}
Expand description

A domain pack for the solver gate

Packs define the contract for a specific optimization domain, including input validation, solving, invariant checking, and gate evaluation.

Required Methods§

Source

fn name(&self) -> &'static str

Pack name (e.g., “meeting-scheduler”)

Source

fn version(&self) -> &'static str

Pack version

Source

fn validate_inputs(&self, inputs: &Value) -> Result<(), GateError>

Validate and deserialize the input payload

Source

fn invariants(&self) -> &[InvariantDef]

Get invariant definitions for this pack

Source

fn solve(&self, spec: &ProblemSpec) -> Result<PackSolveResult, GateError>

Solve the problem and return a proposed plan

Source

fn check_invariants( &self, plan: &ProposedPlan, ) -> Result<Vec<InvariantResult>, GateError>

Check invariants against a proposed plan

Source

fn evaluate_gate( &self, plan: &ProposedPlan, invariant_results: &[InvariantResult], ) -> PromotionGate

Evaluate promotion gate based on plan and invariant results

Implementors§