Ticket 089: Preflight Report Command¶
Status¶
Planned.
Goal¶
Add a preflight CLI command that runs the full pre-departure validation
sequence — deterministic estimate, scenario policy check, and Monte Carlo risk
envelope — in a single invocation, producing a combined operator-ready report.
This is the primary user-facing workflow for a BVLOS operator preparing a
mission: today they must run three separate commands and manually synthesise
the results.
Why This Matters¶
A first-time contributor or operator arriving at the repo sees three separate
commands: estimate, scenario, and sample. None of them alone answers the
question "is this mission ready to fly?". The operator has to:
bvlos-sim estimate mission.yaml vehicle.yaml --format checklist— static GO/NO-GObvlos-sim scenario scenario.yaml --format summary— lost-link policy checkbvlos-sim sample uncertainty.yaml --format summary— Monte Carlo reserve envelope
The preflight command collapses this into one invocation and one report that
is directly usable as a pre-departure briefing document.
Scope¶
CLI¶
bvlos-sim preflight mission.yaml vehicle.yaml scenario.yaml uncertainty.yaml \
--format markdown \
--output preflight_brief.md
All four inputs are positional. Scenario and uncertainty files are optional; when omitted only the deterministic estimate section is included.
Supported --format values: markdown, json, summary.
--format summary produces a compact multi-line status block:
Estimate: GO reserve 281.6 % flight 2m 49s
Scenario: PASSED 5/5 policy DIVERT
Risk: feasible 100% reserve p5 823.9 Wh p50 858.2 Wh n=200
Markdown report sections¶
- Mission Summary — mission_id, vehicle_id, planned_home, departure time stamp
- Deterministic Estimate — checklist table (energy, geofence, LZ, resource, link)
- Contingency Scenario — scenario summary: events fired, policy action, assertion results
- Stochastic Risk — p5/p50/p95 reserve, feasibility rate, failed and spatial-infeasible counts
- Advisory Warnings — deduplicated warnings across all three runs
- Go/No-Go Decision — overall
Status: GOorStatus: NO-GOwith reason
The overall Status: GO requires:
- estimate: FEASIBLE (all feasibility checks pass)
- scenario: PASSED (all assertions pass, or no scenario provided)
- stochastic: feasibility_rate ≥ configured threshold (default 95%)
JSON envelope¶
A new versioned schema preflight-report.v1 embedding the three component
envelopes plus the overall go/no-go decision and merged warnings.
--validate-only¶
Validates all four input files against their schemas without running the estimator.
When implemented, --validate-only --validate-format json should emit the
preflight-validation.v1 envelope from Ticket 107 (schemas/preflight_validation.py)
rather than a bespoke format, so there is exactly one machine-readable preflight path.
Composition¶
- Reuses
try_estimate_mission_distance_time,run_scenario, andrun_monte_carlodirectly — no new execution paths. - Checklist rendering from
adapters/checklist_markdown.pyis reused for the estimate section. - Scenario and uncertainty envelopes are embedded verbatim in the JSON output.
--format geojsonand--format kmlare out of scope; useestimate --format geojsonseparately.- Exit codes follow the strictest of the three components: any NO-GO condition exits 10.
Acceptance Criteria¶
bvlos-sim preflight mission.yaml vehicle.yaml --format summaryruns without scenario/uncertainty and reports the estimate-only status.bvlos-sim preflight mission.yaml vehicle.yaml scenario.yaml uncertainty.yaml --format markdownproduces a Markdown report covering all four sections.bvlos-sim preflight ... --format jsonemits a validpreflight-report.v1JSON envelope.bvlos-sim preflight ... --validate-onlyvalidates all supplied files and exits 0/11.- All existing tests continue to pass; new command adds ≥ 10 tests covering each format and the GO/NO-GO logic.