Skip to main content

build_preflight_result

Function build_preflight_result 

Source
pub async fn build_preflight_result(
    apcore_executor: &Executor,
    module_def: &ModuleDescriptor,
    input: &Value,
) -> Value
Expand description

Build a preflight result for module_def against input.

Calls system.validate via the apcore executor when available; on failure (module not registered, internal error) constructs a synthetic preflight JSON shape with the same { checks: [...], valid, requires_approval } schema so callers can format and exit uniformly.

Used by both dispatch_validate (the standalone validate subcommand) and the --dry-run branch of dispatch_module in cli.rs (D9-004 — was previously two parallel implementations). Caller is responsible for running validate_module_id and get_module_descriptor lookups before calling this — the returned preflight assumes the module exists and the id has the right shape.