runner: run package — executor, leg.json sentinels, and resume - #23
Conversation
|
There was a problem hiding this comment.
🟡 Not ready to approve
There are correctness issues in command environment overriding and error reporting paths (flock failure handling and EnsureSrc clone decision) that should be fixed before merging.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Pull request overview
Adds a new runner/internal/run package that executes a plan.Plan sequentially, supports resume behavior via per-leg leg.json sentinels, and includes supporting utilities for dataset preparation, logging, and exclusive campaign locking.
Changes:
- Implemented a sequential plan executor (
Execute) with keep-going / fail-fast semantics, per-leg sentinel writing, and aRunStephelper for epilogue steps. - Added resume classification (
classifyLegDir) that trustsleg.jsonfirst and falls back to bash-erainvocation.json+driver.csv. - Added operational helpers: dataset materialization with atomic
.partialrename, unified campaign logging, BENCH_ROOT flock locking, and build-clone convergence + ref resolution.
File summaries
| File | Description |
|---|---|
| runner/internal/run/doc.go | Package documentation for the new executor/resume module. |
| runner/internal/run/run.go | Core executor, leg sentinel writing, command runner, and helper utilities. |
| runner/internal/run/run_test.go | Comprehensive tests for executor semantics, sentinel contract, resume, lock, and logging. |
| runner/internal/run/resume.go | Resume decision logic for classifying leg output directories. |
| runner/internal/run/log.go | Campaign log utilities and note formatting. |
| runner/internal/run/lock.go | Exclusive non-blocking BENCH_ROOT lock via flock. |
| runner/internal/run/dataset.go | Dataset preparation with .partial staging and atomic rename. |
| runner/internal/run/dataset_test.go | Tests for dataset preparation choreography and wipe behavior. |
| runner/internal/run/source.go | Persistent build-clone convergence and ref resolution helpers. |
| runner/internal/run/source_test.go | Tests for clone convergence behavior, cache retention, and ref resolution. |
Review details
- Files reviewed: 10/10 changed files
- Comments generated: 3
- Review effort level: Lite
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
556f57d to
d014a9e
Compare
d014a9e to
caf8410
Compare
60be19a to
85516f4
Compare
|
@claude[agent] review |
Sequential executor over the plan: leg.json completion sentinels in every timed --out dir, --resume that trusts them, keep-going semantics, dataset preparation, and the persistent stellar-rpc source/build clone.
85516f4 to
ce68c9c
Compare
Reviewed the current state at 85516f4. The three prior Copilot concerns are all resolved in the code:
|
This PR adds the
runpackage: the executor that walks a plan.Executeruns the steps in order and always sequentially, because two benchmarks that share a machine measure the sharing. It returns one result per step — ok, failed, skipped, or resumed — and it writes a completion sentinel into every timed leg.What is in this PR
run.go— the walk, the step dispatch, andleg.json. The runner writes the sentinel into each timed--outdir, on success and on failure.invocation.jsoncannot do this job: the measured process writes it, so a killed process leaves none.resume.go—classifyLegDirreads a leg's--outdir and returns absent, partial, failed-earlier, or complete. Only complete is skipped. Every other state is wiped and re-run. A bundle with noleg.jsonfalls back toinvocation.jsonplusdriver.csv.FailFaststops the walk instead.lock.go— an exclusive non-blocking flock on<BENCH_ROOT>/.campaign.lockrefuses a second campaign at once.log.go—Notefprints== [HH:MM:SS] msg, andOpenCampaignLogappends, so every session lands in onecampaign.log.dataset.go—prepareDatasetmaterializes into<root>.partialand renames onto<root>once whole. It handles packs-local, packs-gs, bsb-s3, and fixture.source.go—EnsureSrckeeps the build clone at$BENCH_ROOT/srcand treats stellar-rpc as a black box: clone once, repoint origin, fetch, hard reset, thenclean -qfd. No-x, so build caches survive.Review focus
resume.go: schema version, leg id, and a presentexit_code.ExitCodeis a pointer, so an absent field does not read as exit 0.Executeskips the tarball and publish steps. The wiring runs them after the final provenance writes.runLegcreates the--outdir itself, so the sentinel lands even when the binary dies at once. A leg whose sentinel cannot be written is failed.Verification
CI runs the same gate as
.github/workflows/runner-go.yml.Stack: part 4 of 8 · base
runner-03-plan· replaces a slice of #16