Skip to content

Rulvar API reference


Rulvar API reference / @rulvar/core / PreflightInput

Interface: PreflightInput

Defined in: packages/core/src/engine/preflight.ts:309

The full input: engine surface, run surface, and the declared wave.

Properties

PropertyTypeDescriptionDefined in
engine?Partial<Pick<CreateEngineOptions, | "adapters" | "defaults" | "budgetDefaults" | "concurrency" | "quota" | "pricing">>The same object createEngine would receive (adapters used for pure caps() only).packages/core/src/engine/preflight.ts:311
finishValidation?{ contract?: FinishContract; draftPolicy?: | { minWords?: number; requireSections?: string[]; } | "contract"; estRepairCostUsd?: number; maxRepairs?: number; repairTurnReserve?: number; selfTest?: FinishSelfTestFixtures; validators: FinishValidator[]; }The opt in finish validation self test (the v1.71 experiment review, P1.1). Programmatic only: validator functions cannot ride a JSON config file, so the CLI never carries this. When present, preflight runs the SAME golden self test orchestrate runs at construction and reports every drift as an error finding instead of throwing, so a planner surfaces it next to the quota and budget findings: 'output-contract-validator-mismatch' for containment and accept-side drift, 'output-contract-validator-weakened' (cycle 74) when a configured validator fails the contract's per validator reject golden, the same-name weakened replacement.packages/core/src/engine/preflight.ts:342
finishValidation.contract?FinishContract-packages/core/src/engine/preflight.ts:344
finishValidation.draftPolicy?| { minWords?: number; requireSections?: string[]; } | "contract"Mirrors FinishValidationSpec.draftPolicy (the fifth experiment, cycle 75): declaring it lets the estimator compare the draft gate's word floor against the contract's own word minimum. The experiment gated drafts at 3200 words under a 4500 word contract, so the gate admitted a draft the final validators had to reject and the synthesis started from an underlength base; the draft-gate-below-contract warning names exactly that shape. The sentinel 'contract' (RV808a) gates the draft by the full validator set, so the below-contract shape cannot exist and the warning never fires.packages/core/src/engine/preflight.ts:384
finishValidation.estRepairCostUsd?numberMirrors FinishValidationSpec.estRepairCostUsd (RV4001): the declared price of the one mechanical repair turn the finish contract can grant (RV3802 holds exactly this figure live). The acceptanceReserve block folds it into the required tail, the same term the RV3907 runtime gate sums, so a declared repair price is judged before the run and enforced inside it by the SAME arithmetic.packages/core/src/engine/preflight.ts:399
finishValidation.maxRepairs?numberMirrors FinishValidationSpec.maxRepairs (default DEFAULT_FINISH_MAX_REPAIRS): with zero, the first rejection is final and there is no repair exchange to fund, so the repair-reserve-unfunded warning stays silent. It also SIZES the mandatory synthesis tail (RV2504): every granted repair can write to the output allowance, so the tail synthesis-reserve-below-cap-composition prices is one composition plus this many turns, whatever the turn reserve says. Since RV3602 the bound belongs to one composition invocation, so this tail is the price of EACH invocation: the armed claim repair round (RV3307) runs a second invocation with its own full bound, and the working room finding already prices that round at the declared synthesis reserve, the host's own estimate of exactly this tail.packages/core/src/engine/preflight.ts:371
finishValidation.repairTurnReserve?numberMirrors FinishValidationSpec.repairTurnReserve: folds the declared repair headroom into the projected turns of the invocation the validators bind (the synthesis invocation when orchestrator.synthesis is declared, the coordination loop otherwise), so the run ceiling prices the repair exchange the runtime would actually grant.packages/core/src/engine/preflight.ts:354
finishValidation.selfTest?FinishSelfTestFixtures-packages/core/src/engine/preflight.ts:345
finishValidation.validatorsFinishValidator[]-packages/core/src/engine/preflight.ts:343
orchestrator?PreflightOrchestratorSpecPresent when the run is a dynamic orchestration.packages/core/src/engine/preflight.ts:320
quotaRules?readonly QuotaRule[]The quota rule set behind the configured limiter, when the host uses a rule-driven implementation (memoryQuotaLimiter, SqliteQuotaLimiter): the SPI hides rules behind reserve(), so the demand comparison needs them declared here.packages/core/src/engine/preflight.ts:329
run?Pick<RunOptions, "budgetUsd" | "limits" | "maxInFlightExposureUsd">The RunOptions slice: the ceiling, run-level limits, and the RV711 exposure cap.packages/core/src/engine/preflight.ts:318
spawns?PreflightSpawnSpec[]The declared first spawn wave, in admission order.packages/core/src/engine/preflight.ts:322