feat(cli): add reproducible task-fixture replay for deterministic unattended-run evaluation (#224)#225
Merged
Conversation
…ttended-run evaluation (#224) Before/after evaluation of a model or configuration change was noisy because there was no shared, repeatable definition of the task being measured: re-running an ad hoc prompt is not reproducible. Add a versioned task-fixture format (bounded prompt + deterministic provider/tool script) and an opt-in --replay-fixture mode that drives one unattended run from the fixture via a deterministic in-process provider, so the same fixture always yields the same tool-call sequence, rounds, and token totals and feeds reproducible inputs to the run summary (#40) and scorecard (#44). Fixture loading fails closed and rejects raw-credential fields; the replay never touches the network provider.
Owner
Author
E2E verification
|
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.
Summary
Adds a versioned task-fixture format and an opt-in (
--replay-fixture) deterministic replay mode for unattended (-p) runs, decomposed from roadmap #38 (observable autonomous execution).Before/after evaluation of a model or configuration change was noisy because there was no shared, repeatable definition of the task being measured — re-running an ad hoc prompt is not reproducible. A fixture declares a bounded prompt plus a deterministic provider/tool script; replaying it drives one unattended run whose run-summary (#40) fields are reproducible, so scorecards (#44) compare like-for-like inputs.
Design
src/task-fixture.ts: a schema-validated fixture format (prompt+scriptof text/tool-call steps), fail-closed parsing that rejects raw-credential fields, andfixtureStreamProvider— a deterministic in-process provider that replays the script one step per round (fixed usage; a terminal empty-text response when the script is exhausted so the run terminates).src/provider.ts: aStreamProvidertype (the networkstreamChatis the default implementation).src/agent.ts: an optionalstreamProviderseam onAgentOptions;runAgentuses it instead ofstreamChatwhen present.src/index.ts: opt-in--replay-fixture <file>wired into both headless paths — loads the fixture (fail closed, exit 2), runs from the fixture's prompt, and injects the deterministic provider.The replay never touches the network provider; the fixture format has no raw-credential fields and loading fails closed.
Testing
tests/unit/task-fixture.test.ts(15 tests): schema validation, version negotiation, fail-closed on malformed/credential fields, file reading, deterministic replay sequencing, cross-replay determinism, and script-exhaustion termination.tests/integration/task-fixture.test.ts(4 tests): two CLI replays of one fixture produce byte-identical deterministic summary fields with zero network chat calls, the scripted tool call is reflected, and malformed/credential/missing fixtures exit 2.Gates: typecheck, build, unit (1623), integration (442 + desktop), smoke (51) all pass.
Closes #224