Skip to content

Allow fixtures to start at a later now= instead of refusing it - #36

Merged
scosman merged 2 commits into
mainfrom
claude/lucid-lovelace-wgcgml
Sep 23, 2026
Merged

scosman merged 2 commits into
mainfrom
claude/lucid-lovelace-wgcgml

Conversation

@scosman

@scosman scosman commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Summary

This change allows instances of fixtures to start at a later clock time by passing now= to world.instance(), while refusing any now= 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's now, allowing explicit now= 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 requested now= 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 later
    • The constraint is that now= must not be earlier than the fixture's own now
    • This enables use cases like evaluating a fixture at different points in time (e.g., three days after the fixture was frozen)

Implementation Details

  • The clock is created before the database is built, ensuring that schema-seeded reference rows are also timestamped from the instance's actual start time.
  • The validation uses the same _clock_from() helper to normalize both string ISO-8601 and datetime objects for comparison.
  • Tests verify both the happy path (starting a fixture at a later time) and the error case (attempting to start earlier than the fixture).

https://claude.ai/code/session_01J18y3rhPWRqMxZtUmBeeh6

scosman and others added 2 commits September 23, 2026 15:47
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
@scosman
scosman merged commit 01b74ff into main Sep 23, 2026
3 checks passed
@scosman
scosman deleted the claude/lucid-lovelace-wgcgml branch September 23, 2026 16:02
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