Experiment Tracking
In Academic Harness:
experiment_logkeeps state under.dsh/experiments/<slug>/— a write-once definition plus append-only runs and links. The tool records logged values; it makes no scientific claim.
Use experiment_log for exploratory batches (sweeps, simulations, pilots).
Use analysis_run when there is one pre-registered question with a frozen
plan — the two complement each other; link an experiment run to the analysis
run that confirms it.
Workflow
Start with metric directions.
experiment_log action=start slug=lr-sweep question="Which learning rate wins?" experiment={"metrics":[{"name":"accuracy","direction":"higher"},{"name":"loss","direction":"lower"}]}The definition is write-once (
resume: trueto continue it). Directions declared here are what makebestmeaningful later.For a staged comparison, declare the benchmark and protocol with it:
experiment_log action=start slug=bench question="Does the mechanism beat the reference?" experiment={"metrics":[{"name":"accuracy","direction":"higher"},{"name":"latency","direction":"lower"}], "benchmark":{"datasets":["D1","D2"],"splits":["val","test"], "baseline_arm":"baseline","task_rules":["fixed split","no test leakage"]}, "protocol":{"eval_script":"eval.py","metric_params":{"threshold":0.5}}}Log every run as it finishes — params, metrics, artifact paths (hashed, workspace-confined), seed, and
parentfor follow-ups. A rerun is a new run; nothing is deduplicated, because "same params, different result" is exactly the signal you want to keep. Omit missing metrics rather than zero-filling them.For a staged experiment, log the baseline first:
experiment_log action=log slug=bench role=baseline baseline_ref=reproduced stage=full comparison_identity={"dataset":{"id":"D1","version_or_hash":"v1"},"split":{"id":"test","version_or_hash":"v1"},"baseline_cohort_id":"reference-v1","metric_definitions":{"accuracy":{"unit":"fraction","implementation":"accuracy-v1","parameters":{}},"latency":{"unit":"ms","implementation":"timer-v1","parameters":{}}}} metrics={"accuracy":0.80,"latency":100} experiment_log action=log slug=bench role=variant baseline_ref=reproduced stage=full baseline_run_id=x0001 comparison_identity={"dataset":{"id":"D1","version_or_hash":"v1"},"split":{"id":"test","version_or_hash":"v1"},"baseline_cohort_id":"reference-v1","metric_definitions":{"accuracy":{"unit":"fraction","implementation":"accuracy-v1","parameters":{}},"latency":{"unit":"ms","implementation":"timer-v1","parameters":{}}}} metrics={"accuracy":0.85,"latency":90}The baseline captures
protocol_digest; every variant must name its explicitbaseline_run_idwith the same reference, stage, and sampling. A changedeval_scriptormetric_paramsis stored asspec_driftagainst that baseline. Never paper over drift by editing the baseline; log the changed protocol as its own run and report it.Compare and select.
experiment_log action=compare slug=bench experiment_log action=compare slug=bench scope_id=<scope-id-from-compare> field=lr experiment_log action=best slug=bench scope_id=<scope-id-from-compare> metric=accuracy experiment_log action=best slug=bench scope_id=<scope-id-from-compare> dominance=truebestrequires a declared metric and explicit scope; its declared direction cannot be overridden. A scope is a user declaration, not verification. Runs without identities remain visible but are not ranked. Ties are listed, not silently broken.dominance: truereturns the Pareto front over declared metrics; a run missing a metric is incomplete and not ranked. Never report "the best model" without saying which metric and direction chose it, and do not present the front as a scientific result.Summarize repeated runs. Log the candidate label in
params.methodand the actual seed on every run. Use, for example:experiment_log action=replicates slug=bench scope_id=<scope-id-from-compare> metric=accuracy candidate_field=method candidates=["base","variant"] baseline_candidate=base replicate_unit="one independent training run" expected_seeds=[1,2,3] selection_history=unknownIf the intended seeds are unknown, omit
expected_seedsand passcoverage_unknown=true. Duplicate seeds, missing values, failed or incompatible runs, and unexpected seeds are visible and not silently averaged. Pairing requires the variant's explicit baseline run ID and the same seed; equal seed numbers alone are insufficient. The grouping, unit, and selection history are user declarations. Mean and sample SD are descriptive; do not infer significance, confidence intervals, or a winner.Record the human verdict.
action=verdict run_id=x0007 verdict=engineer reason="try a wider slice" engineering_round=2 budget={"max_rounds":2,"used":2}. Engineer is not terminal: an exhausted budget is force-bad, with both the request and the forced outcome stored. The verdict is an advisory human decision, not a model output.Link, don't duplicate.
action=link run_id=x0007 target_kind=analysis_run target_id=run-…connects a promising configuration to the pre-registered confirmation run, a notebook entry, or a paper. The link is live: if the linkedanalysis_runfails its frozen task rules (analysis_run action=compliance), this experiment run is excluded frombest,dominance, and grouping; the exports keep the row with an exclusion marker, so they remain an audit trail. It stays visible with anexcludedrecord naming the analysis run and the violated rule ids — discard the solution, do not "refine" it, and a recorded violation is sticky.Read the branch history. When a run needs context — what it came from, what was tried beside it, or why it stopped — use the read-only branch view:
experiment_log action=branches slug=bench experiment_log action=branches slug=bench format=json experiment_log action=branches slug=bench format=mermaid write=trueIt follows recorded
parentIDs and resolves links against the analysis, notebook, and review ledgers. Readstatusas evidence-only:failedmeans a linked analysis run recorded a non-zero exit or timeout,prunedmeans a human verdict saidbad, andnot_recorded/unknownmean the ledger does not know. A run without metrics is not failed.paperlinks arenot_checkedandscientific_resultlinks areunknownby design. Missing, self, or cyclic parents and duplicate links are reported inanomalies, not repaired. Text and JSON are read-only; onlyformat=mermaid write=truewritesexports/branches.mmd.Export.
export format=csv|json|markdownfor reports;format=mlflowfor an MLflow-compatible JSON (interop, not an MLflow backend).
Rules
- Log the params that actually ran, including the seed — a run without a seed is unreproducible by construction.
- Do not edit runs.jsonl by hand; a wrong entry is corrected by logging a new run or an analysis note, and the original stays. The branch view reports missing, self, or cyclic parents and duplicate links as anomalies; it never repairs them, and neither should you.
- Do not present compare/best output or a verdict as a result; findings go
through
analysis_run,scientific_result, or the manuscript with their own verification. The Pareto front and the verdict are advisory records. - Never add a compliance-excluded run back into a selection by hand; fix the violation or report the exclusion.
- Data-leakage checks belong to
data_profile, not here.