Code half of the benchmark (#19): scenario loading/validation, the episode
runner that sits an LLM in front of the benchmark MCP surface, and trajectory
recording. The data half — scenario YAMLs and their QRH-sourced ground truth —
lives in scenarios/.
pip install -e bindings/ # a320_sim (not on PyPI) pip install -e mcp/ # a320_mcp (START_STATES, create_server) pip install -e bench/
a320_bench/scenario.py— YAML loader: jsonschema shape validation againstscenarios/schema/scenario.schema.json, then live cross-checks of every control name, failure id and start state against the core catalogs (a bad reference fails at load time, not mid-episode).a320_bench/episode.py— the episode runner. In-process and privileged: it owns theSim(setup, world controls, failure injection, ground truth viaactive_failures()), while the agent talks to a benchmark-profile MCP server (noinject_failure/clear_failure, plusreport_done) over the SDK's memory transport. Records every turn and tool call to JSONL with the simulated clock around each call; ends onreport_done, budget exhaustion, two empty turns (one nudge), a provider error (partial trajectory kept), or a failed validity gate (invalid_scenario: the world never showed the ECAM the scenario promised, so there is nothing to score).a320_bench/recorder.py— JSONL trajectory writer/reader; the trajectory is self-contained (scenario embedded, tool surface, vendor pin, versions) so the #20 scorer never re-simulates.a320_bench/providers/— agent adapters;scriptedneeds no LLM and is what CI runs;litellm_adapter(pinned litellm,[providers]extra) is the canonical real-model path.a320_bench/serve.py—a320-bench serve --scenario X --result out.json: the same privileged setup + injection + validity gate, then the benchmark tool surface on stdio for an external MCP client that owns its own agent loop — above allclaude -pon a Claude subscription. The harness's verdict lands in--resulton shutdown. Demo/dev path: the trajectory is the client's transcript (--output-format stream-json), and the client's system prompt is a confound for model-vs-model baselines — those go througha320-bench run.a320_bench/scoring.py+a320_bench/cli_score.py—a320-bench score PATH... [--json] [--detail] [--include-errors]: turns recorded trajectories (files or run directories) into procedure-compliance ScoreCards. Pure and offline — no Sim, no network, no compiled binding — so a reviewer scores results withpip install -e bench/alone. The metric is a reported vector (coverage, order, end_state, safety, extraneous) plus a derived scalar for rankings; full spec indocs/fase5-metrica.md.
a320-bench score runs/ # human table + per (scenario,model) aggregates a320-bench score runs/ --json > scores.json # ScoreCards + aggregates for plots a320-bench score runs/elec-apu-gen-fault/one.jsonl --json --detail
The baselines and ablations of #20 are a loop over run (records) and score
(measures) — no bespoke code. The protocol (models, N per cell, ablation axes,
statistical power) is in docs/fase5-metrica.md;
here are the exact commands the matrix executes.
Keys live in the environment, never in a file or a trajectory (the adapter records the model and sampling, never the credential):
$env:ANTHROPIC_API_KEY = "..." # Claude via litellm $env:GEMINI_API_KEY = "AQ..." # Gemini via Vertex express (AQ.* keys)
One cell — a model against every scenario, N runs each, into a run tree:
$SCEN = Get-ChildItem scenarios -Recurse -Filter *.yaml | Where-Object { $_.Directory.Name -ne "schema" } foreach ($s in $SCEN) { a320-bench run --scenario $s.FullName ` --model anthropic/claude-opus-4-8 --runs 10 --out runs/baseline } # Gemini needs its Vertex express api_base passed through --sampling: foreach ($s in $SCEN) { a320-bench run --scenario $s.FullName --model gemini/gemini-2.5-flash --runs 10 ` --out runs/baseline ` --sampling '{"api_base": "https://aiplatform.googleapis.com/v1beta1/publishers/google"}' }
Score the whole tree — the table separates by (scenario, model), the JSON
feeds the plots:
a320-bench score runs/baseline # human table + aggregates a320-bench score runs/baseline --json > baseline.json
An ablation is the same loop with one lever changed (a scenario variant with a
different instructions_profile, a --sampling temperature, a tool-surface
profile) into a separate --out runs/ablation-<name>, scored the same way.
score needs no binding and no network, so the whole measurement half runs on
a reviewer's machine with pip install -e bench/ alone.
python -m pytest bench/tests -q # no LLM, no network
GPLv3 — drives the a320_sim extension, which links the vendored FlyByWire
crates and inherits their license.