Run Lifecycle Branch Map
This document maps the benchbox run lifecycle and its export path.
Canonical runtime
For real benchmark execution, benchbox/cli/commands/run.py delegates to:
BenchmarkOrchestrator.execute_benchmark(...)inbenchbox/cli/orchestrator.pyexecute_run(...)inbenchbox/core/run_service.pyrun_benchmark_lifecycle(...)inbenchbox/core/runner/runner.py
The CLI path is therefore run.py -> BenchmarkOrchestrator -> execute_run
-> run_benchmark_lifecycle. The MCP sync and durable-job surfaces converge on
the same core primitive through _execute_mcp_run_via_core(...) in
benchbox/mcp/tools/benchmark.py and its durable caller in benchbox/mcp/jobs.py.
Run branches (benchbox/cli/commands/run.py)
| Branch | Entry condition | Runtime path | Export path |
|---|---|---|---|
| Dry run | --dry-run given (_run_dry_run) | DryRunExecutor.execute_dry_run(...) | DryRunExecutor.save_dry_run_results(...) |
| Direct non-interactive SQL/DataFrame | platform and benchmark provided, not data-only or load-only | _execute_orchestrated_run(...) | _export_orchestrated_result(...) |
| Data-only / load-only | test_execution_type is data_only or load_only | _execute_orchestrated_run(...) (phase-limited) | _export_orchestrated_result(...) |
| Interactive | fallback TTY-guided path | _execute_orchestrated_run(...) | _export_orchestrated_result(...) |
Driver and runtime metadata are applied on the canonical path by
benchbox/core/run_service.py::execute_run through apply_driver_metadata(...)
(benchbox/core/results/driver_metadata.py), so every run mode inherits them.
Single-path architecture
Runtime path
benchbox/cli/commands/run.pybuilds validated CLI config and execution context._execute_orchestrated_run(...)executes throughBenchmarkOrchestrator.BenchmarkOrchestrator.execute_benchmark(...)delegates toexecute_run(...).execute_run(...)invokesrun_benchmark_lifecycle(...)and applies driver metadata._export_orchestrated_result(...)performs export with directory-manager naming.
Extension points
- Add lifecycle behavior in
benchbox/core/runner/runner.py, not in CLI branch-specific code. - Add result metadata wiring in
benchbox/core/results/driver_metadata.pyso all run modes inherit it. - Add export behavior in
benchbox/cli/commands/run.pyhelper_export_orchestrated_result(...).