Repository navigation
feat: reproducible placeholder values with a fixed clock and seed - #95
Merged
Bbenchaya merged 1 commit intoNov 23, 2026
Merged
Conversation
scenario_metadata["stuntdouble"] accepts base_time to freeze timestamp
placeholders and seed to drive {{uuid}} and the random_* placeholders
from a private stream. Defaults are unchanged.
A stream is private to a tool and a run, identified by thread_id and an
optional invocation_id, so it advances across the wrapper's per-call
resolves and concurrent runs cannot consume each other's values. A
seeded scenario with no run identifier fails. reset_run_state() replays
a run.
Fixes intuit#62
atishay-kasliwal
requested review from
Bbenchaya,
ChiefArchitect and
sboorlagadda
as code owners
November 5, 2026 15:45
6 tasks done
6 tasks
This branch was successfully deployed
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.
What
Opt-in reproducible mock output.
scenario_metadata["stuntdouble"]acceptsbase_timeto freeze timestamp placeholders andseedto drive{{uuid}}and therandom_*placeholders from a private stream. Nothing changes unless a scenario sets them.Also adds
{{now_utc}}for a timezone-aware UTC default, andbase_time=andrng=onresolve_output. The new "Reproducible Outputs" section inmatchers-and-resolvers.mdcovers the rules below.Fixes #62
Run identity and lifetime
#62 asks for these to be defined, so here is the contract for review:
thread_id, narrowed by an optionalinvocation_idthread_idinvocation_idstarts freshregistry.reset_run_state(config)forgets one run, and with no config forgets allconfig=NoneStreams are per tool and per run, stored on the factory, because the wrapper resolves on every call.
scenario_idisn't part of the identity since concurrent runs can share it, andcheckpoint_nsisn't because LangGraph changes it on every tools step.Relation to #53 and #81
This doesn't require the #53 world-state work, as the issue says.
{{sequence}}counters are unchanged and out of scope, so #81 stays open. The run identity above is the part I'd like checked against #53, and if #81 or #53 settles on something else,_run_keyis the one place to change.#90 also edits
DataDrivenMockFactory.__call__, so whichever lands second has a small conflict inscenario_mocking.py.Tests
tests/test_reproducible_outputs.pyadds 44 test cases, including graph runs throughcreate_mockable_tool_wrapper: stream advance across tool calls, replay in a fresh run, concurrent runs sharing a registry, repeated threads, reset, parallel calls and a fixed clock across calls. Other tests confirm that unconfigured scenarios keep their current behaviour.Removing each key behaviour fails a test: the per-run stream, run isolation, per-tool streams, the missing-identifier error, protection for active runs, the registry lock and the private generator.
Locally, on Python 3.12, 3.13 and 3.14:
pytest tests/passes 578. On 3.14,tests-e2e/passes 15,ruff check,ruff format --checkandmypy srcpass, and coverage onscenario_mocking.pyis 100%. Merged with #93 and #94, 598 pass.