feat(store): add per-run keying and config-drift guard to EvaluationDataStore (#347) - #390
Open
lifelmy wants to merge 2 commits into
Open
feat(store): add per-run keying and config-drift guard to EvaluationDataStore (#347)#390lifelmy wants to merge 2 commits into
lifelmy wants to merge 2 commits into
Conversation
lifelmy
requested a deployment
to
manual-approval
September 1, 2026 02:43 — with
GitHub Actions
Waiting
lifelmy
requested a deployment
to
manual-approval
September 1, 2026 02:43 — with
GitHub Actions
Waiting
lifelmy
marked this pull request as ready for review
September 3, 2026 09:27
lifelmy
requested a deployment
to
manual-approval
September 3, 2026 09:30 — with
GitHub Actions
Waiting
lifelmy
requested a deployment
to
manual-approval
September 11, 2026 10:15 — with
GitHub Actions
Waiting
lifelmy
requested a deployment
to
manual-approval
September 11, 2026 10:15 — with
GitHub Actions
Waiting
Author
|
Task A follow-up: the repository-wide pre-commit test run exposed one stale CLI assertion that still expected the legacy flat c1.json layout. I updated it to assert the new per-run path c1/run_0.json and pushed ae283b3. Verification: focused store/experiment/CLI tests -> 132 passed; pre-commit format, lint, and full unit-test hooks passed; git diff --check passed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Extends the result-store layer so a case can be evaluated N times with every run kept, and guards against silently mixing results from different experiment configs. This is the store-layer foundation the issue describes as "additive and backward compatible" and the producer side of the multi-run history that #186's trend analyzer consumes.
EvaluationDataStoreprotocol —load/savegain a defaultedrun_index: int = 0, and a newcompleted_run_count(case_name) -> intreports how many consecutive runs a case already has.run_index=0preserves the exact single-run behavior, so existing callers need no change.LocalFileTaskResultStore—results/<case>/run_0.json,run_1.json, ...).completed_run_countcounts consecutive runs from 0 and stops at the first gap, so it returns the next index to write when topping up to N.{case_name}.jsonfrom the old single-run layout is read as that case's run 0, so existing stores keep working with no migration step.config_hash(plusoverwrite) is recorded in a_manifest.json. Reopening with a different hash raisesConfigDriftErrorrather than appending incompatible results;overwrite=Truediscards prior results/manifest and starts fresh. Passing no hash skips the guard entirely.Scope note (deliberate): this PR stops at the store contract + local implementation, which is self-contained and backward compatible. The
num_runsresume loop insiderun_evaluations_asyncand the--num-runs/--overwriteCLI flags from the proposal are intentionally left for a focused follow-up so this change stays small and easy to review — happy to send that next if maintainers prefer it here. The proposedEvaluationDataStoreshape (defaultedrun_index+completed_run_count) is exactly what that runner change will build on.Related Issues
Addresses #347 (store-layer portion). Complements #186 (trend analysis consumes multi-run history).
Type of Change
New feature
Testing
hatch test tests/strands_evals/test_local_file_task_result_store.py-> 14 passed (per-run keying, legacy-flat migration, config-drift raise/overwrite/no-guard).hatch test tests/strands_evals/test_local_file_task_result_store.py tests/strands_evals/test_experiment.py-> 131 passed (updated the in-memoryDictEvaluationDataStoretest double to the new protocol; existing store/experiment behavior unchanged).hatch fmt --formatter --check-> 360 files already formatted;hatch fmt --linter-> all checks passed;mypy -p srcvia hatch-static-analysis env -> Success, no issues in 235 source files.Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.