Repository navigation
Allow fixtures to start at a later now= instead of refusing it - #36
Merged
Merged
Conversation
An eval can now start one fixture at a later time ("3 days later, the SLA
has breached") instead of freezing a separate fixture per instant.
- world.instance(fixture, now=...) and reset(fixture=..., now=...) accept
`now`; it replaces the fixture's frozen clock as the start instant.
- A `now` earlier than the fixture's own `now` is refused before anything
is copied, with an error naming both instants: the fixture's rows are
dated by its clock, so an earlier start would give rows created in the
future. The fixture's own instant is accepted.
- Docstrings, the reset schema's `now` description and `seahaven mcp --now`
help updated.
- Docs: new "Starting a fixture later" section in clock.md with a runnable
example; serving_and_openenv.md, concepts.md, db_schema_and_fixtures.md,
reference/cli.md and reference/api.md updated.
- Tests: the two refusal tests are replaced by tests for a later `now`
(through world.instance and reset) and for an earlier one being refused.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01J18y3rhPWRqMxZtUmBeeh6
Resolve the conflict on the reset schema's `now` description: keep main's example instant and its choice to leave the fixture caveat to the error, and say the clock applies to any instance, since `now` now works with a fixture. The UI mock's copy of the description is updated to match. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J18y3rhPWRqMxZtUmBeeh6
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
This change allows instances of fixtures to start at a later clock time by passing
now=toworld.instance(), while refusing anynow=that is earlier than the fixture's own clock. Previously,now=was rejected entirely for fixtures.Key Changes
Clock initialization logic: Reordered the clock creation to check
now=parameter first before falling back to the fixture'snow, allowing explicitnow=to override the fixture's default start time.Validation: Replaced the blanket rejection of
now=with fixtures with a new_check_not_before_fixture()function that validates the requestednow=is not earlier than the fixture's own clock. This prevents instances from starting with rows that appear to be created in the future.Error messaging: When a
now=earlier than the fixture is provided, the error message now clearly names both the requested time and the fixture's time, helping users understand the constraint.Documentation updates: Updated all user-facing documentation (API docs, CLI help, OpenEnv descriptions, and concept guides) to reflect that:
now=can be used with fixtures to start laternow=must not be earlier than the fixture's ownnowImplementation Details
_clock_from()helper to normalize both string ISO-8601 and datetime objects for comparison.https://claude.ai/code/session_01J18y3rhPWRqMxZtUmBeeh6