Run Lifecycle Branch Map¶
This document records the current benchbox run lifecycle and export branches before the
single-path refactor.
Canonical Runtime Today¶
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.
Branch Matrix (benchbox/cli/commands/run.py)¶
Branch |
Entry condition |
Runtime path |
Export path |
|---|---|---|---|
Dry run |
|
|
|
Direct non-interactive SQL/DataFrame |
|
|
Inline |
Data-only / load-only |
|
|
Separate inline |
Interactive |
fallback TTY-guided path |
|
Third inline export block ( |
Duplicate Export Logic Identified¶
run.py currently contains three non-dry-run export blocks with drift in:
format selection (
[\"json\"]vs config-driven),output filename/output_dir handling,
status output formatting.
These blocks are the target for unification in the refactor.
Metadata Wiring Gap — Resolved¶
Driver/runtime metadata enrichment previously existed in ExecutionEngine._enrich_driver_metadata(...)
and was wired only in benchbox/cli/execution_pipeline.py. With the pipeline module deleted
(benchbox/cli/execution_pipeline.py removed, ExecutionPipeline/ExecutionEngine no longer retained),
enrichment now runs on the canonical path via benchbox/core/run_service.py::execute_run → apply_driver_metadata(...) (see benchbox/core/results/driver_metadata.py), so all run modes inherit it.
Refactor Baseline Decisions¶
Canonical runtime path:
run.py->BenchmarkOrchestrator->execute_run->run_benchmark_lifecycle.ExecutionPipelinemust not remain a parallel behavior-bearing runtime path.Export policy must be centralized and called by all non-dry-run branches.
Metadata enrichment must run on the canonical path before result export.
Single-Path Architecture (Post-Refactor)¶
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(...).
Alpha Release Notes (Execution Refactor)¶
Removed legacy
quickbranch logic frombenchbox run.Removed legacy
no_regenerateoption wiring from run-command benchmark options.Unified non-dry-run execution through shared run-command helpers:
_execute_orchestrated_run(...)_export_orchestrated_result(...)
Deleted
benchbox/cli/execution_pipeline.py(ExecutionPipeline/ExecutionEngine) — it was superseded bybenchbox/core/run_service.py::execute_run+run_benchmark_lifecycle(...); enrichment and export are now on the canonical path (see Single-Path Architecture above).