Milestone 3 of 8
Execute and save one complete run
Write one isolated run, read every required artifact back, and record completion only after all checks succeed.
Now cross the execution boundary once. A completed run is a directory whose files agree with one another, not merely a successful function call.
Goal
Execute one validated configuration, save every required artifact in an
isolated directory, read the artifacts back, and record completed only after
all read-backs succeed.
Inputs
Use one valid configuration from the validated plan, the read-only
data/readings.csv and data/dataset_manifest.json, and the supplied
src/experiment.py. The run directory is runs/<run_name>/.
The required files are config.json, result.json, values.csv,
figure.png, and run_status.json. The status file is the final artifact for a
successful run. Keep the source identity and relevant runtime versions in the
evidence that the root manifest will later collect.
Deliverables
Implement the first execution path in src/runner.py and connect it from
src/main.py. It must:
- create one safe, unused run directory;
- save the exact configuration and source identity;
- call the supplied computation once;
- write the named summaries and plot values;
- generate the figure from the saved or returned values; and
- read each artifact back before writing
run_status.jsonascompleted.
If any required write or read-back fails, surface the failure and do not claim that the run completed. An existing directory must cause a clear refusal, never a silent overwrite.
Checks
Run a tiny deterministic case and check every filename, JSON field, CSV header,
row count, and figure existence. Compare config.json with the validated
input, result.json with the function result, and values.csv with the
values used to create figure.png.
Check that the source readings and configuration are unchanged, that the runner calls the supplied interface with the expected arguments, and that the status is absent or non-completed when a deliberate read-back failure occurs. Run the same configuration in a new run name and record why the run identity, rather than an overwrite, keeps the evidence separate.
Workspace
Put execution and artifact writing in src/runner.py; keep orchestration and
the command entry point in src/main.py. Do not put run-specific files in the
source or data directories. Keep report.md updated with one artifact trace.
Hints
HintComplete means all files agree
HintProtect an existing run
Review
Open the run directory and trace the configuration into the result and values
file. Explain why a successful call to run_experiment is not enough to mark
the run complete if the figure or read-back failed.
How to check your work
Checks compare the runner and its artifacts with the supplied fixture. The supplied fixture shows one safe write order; other implementations are valid when they preserve the same boundary.