Skip to content

Keep run meta on load, record scenario_pack in experiment runs, and handle a missing score in the README - #139

Open
avalyset wants to merge 3 commits into
SimulaMet:mainfrom
avalyset:fix/run-meta-followups
Open

avalyset wants to merge 3 commits into
SimulaMet:mainfrom
avalyset:fix/run-meta-followups

Conversation

@avalyset

@avalyset avalyset commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Three small follow-ups to the run metadata from #138, one commit each.

Keep each run's meta when loading repeated experiment results (simpleaudit/repeated_results.py)
RepeatedExperimentResults.save() writes every run's meta, but load() rebuilt each run as AuditResults(results), so after a round trip meta was {}. AuditResults.load() already passes meta=data.get("meta"), and the repeated loader now does the same.
New test TestSerialization::test_save_load_preserves_each_runs_meta fails on main and passes here.

Record the scenario pack in AuditExperiment runs' meta (simpleaudit/experiment.py)
AuditExperiment expands a pack name to its scenario list before calling run_async, and _run_meta records scenario_pack only when it gets a string. So AuditExperiment.run("safety") gave runs without scenario_pack, while ModelAuditor.run("safety") gave one. The experiment now records the pack name with the same isinstance check; a list of scenarios still records none.
New test TestAuditExperimentRepetitions::test_pack_name_is_recorded_in_each_runs_meta fails on main ([None, None] == ['safety', 'safety']) and passes here.

Show a missing score in the README results example (README.md)
AuditResults.score is None when nothing was graded, so the example printed Score: None/100. It now prints n/a (nothing graded), the same text summary() uses.

Testing: full suite in a fresh Python 3.13 venv with .[dev,tracing], run with pytest -p no:randomly -n 4. main (007eaf4) gave 1939 passed and 6 skipped; this branch gives 1941 passed and 6 skipped. The only per-test difference is the two new tests. ruff check --select E9,F821 . is clean.

AI disclosure: implemented with Claude Code.

RepeatedExperimentResults.save() writes every run's meta, but load()
rebuilt each run as AuditResults(results), so the judge, target and
auditor settings were gone after a round trip. AuditResults.load() already
passes meta=data.get("meta"); the repeated loader now does the same.
AuditExperiment expands a pack name to its scenario list before calling
ModelAuditor.run_async, and _run_meta only records scenario_pack when it
gets a string. Runs started with AuditExperiment.run("safety") therefore
had no scenario_pack, while ModelAuditor.run("safety") had one. The
experiment now records the pack name itself, with the same isinstance
check; a list of scenarios still records none.
AuditResults.score is None when nothing was graded, so the example
printed "Score: None/100". It now prints the same "n/a (nothing graded)"
that summary() prints in that case.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant