You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 01b74ff
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: src/seahaven/docs/db_schema_and_fixtures.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -153,7 +153,7 @@ world_version: 1.0.0
153
153
| `id` | the fixture's name, and the directory it sits in |
154
154
| `world`, `world_version` | the world it was frozen from |
155
155
| `schema_hash` | the schema it conforms to |
156
-
| `now` | the instance's clock reading when it was frozen, and where the clock of every instance of this fixture starts |
156
+
| `now` | the instance's clock reading when it was frozen, and where the clock of every instance of this fixture starts unless it is given a later `now=` |
157
157
| `parent_id` | the fixture it was forked from, or `null` |
158
158
| `file_sha256` | the checksum of `state.sqlite`, verified before the first copy |
159
159
| `created_at` | real wall-clock time, and one of only two wall-clock reads a world makes outside the `wall` clock mode |
Copy file name to clipboardExpand all lines: src/seahaven/docs/reference/api.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -130,7 +130,7 @@ a NUL, an accent, a non-Latin script. A **fixture id** follows the same rule, an
130
130
|`world.add_world(other, *, name=None, store=None, tool_prefix=None, tool_allow_list=None, tool_block_list=None, startup=None)`| add another world: its tools join this world's surface, its store becomes a node of every instance. Call it; there is nothing to decorate |
131
131
|`world.state_format(name)`| register a state format of this world's own, as a decorator. The name is `<family>/<major>` and may not begin with `seahaven.`|
132
132
|`world.resolve_state_format(name)`| the formatter a name answers to: a built-in, or one this world registered. Asked of the root of an instance and of nothing else |
133
-
|`world.instance(fixture=None, *, seed=None, now=None, clock_mode=None, state_format=None, control_tools=False, startup=None)`| make an instance; a context manager. `now` is where a blank instance's clock starts. `clock_mode` is how the clock moves, `None` for `world.default_clock_mode`. `state_format` answers in another of this world's formats, in place of the pin. `control_tools=True` makes the framework's own control tool callable on the instance. `startup` is the world's own keywords, passed to the startup hooks that name them |
133
+
|`world.instance(fixture=None, *, seed=None, now=None, clock_mode=None, state_format=None, control_tools=False, startup=None)`| make an instance; a context manager. `now` is where the clock starts, no earlier than the fixture's `now`. `clock_mode` is how the clock moves, `None` for `world.default_clock_mode`. `state_format` answers in another of this world's formats, in place of the pin. `control_tools=True` makes the framework's own control tool callable on the instance. `startup` is the world's own keywords, passed to the startup hooks that name them |
134
134
|`world.fixtures()`| every fixture in the fixtures directory, as a list sorted by id. A world with no fixtures directory has none, which is not an error |
135
135
|`copy.copy(world)`| this world with the same registrations and its own instances: set `fixtures_dir` on the copy to freeze somewhere else without moving the imported world's |
136
136
|`world.tools`| the registry, in registration order. Read-only, and this world's **own** tools: the composite surface an agent sees is `inst.tools()`, or `world.composition().tools`|
Copy file name to clipboardExpand all lines: src/seahaven/docs/reference/cli.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -204,7 +204,7 @@ command says so and exits 1.
204
204
|---|---|---|---|
205
205
|`--fixture NAME`|`SEAHAVEN_FIXTURE`| a blank instance | the fixture the instance starts from |
206
206
|`--seed N`|`SEAHAVEN_SEED`| a random seed, written to stderr | the caller seed, an integer; the framework refuses a negative one, and one that does not fit in 8 bytes |
207
-
|`--now ISO`|`SEAHAVEN_NOW`| wall time at creation | the clock a blank instance starts at; the framework refuses it together with a fixture |
207
+
|`--now ISO`|`SEAHAVEN_NOW`|the fixture's `now`, or wall time at creation for a blank instance | where the instance's clock starts; with a fixture, the framework refuses an instant earlier than the fixture's `now`|
208
208
|`--clock-mode MODE`|`SEAHAVEN_CLOCK_MODE`| the world's default | how the instance's clock moves: `fixed`, `tick`, `running` or `wall`|
209
209
|`--reset-options JSON`|`SEAHAVEN_RESET_OPTIONS`| none | a JSON object of the keyword arguments `world.instance()` is called with; not allowed with `--fixture`, `--seed`, `--now` or `--clock-mode`|
210
210
|`--world module:attr`| -- | the convention | which world to serve |
Copy file name to clipboardExpand all lines: src/seahaven/docs/serving_and_openenv.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -116,8 +116,8 @@ A WebSocket connection is one session, and one session holds one instance.
116
116
117
117
-**`reset(fixture=..., seed=..., startup=...)`** creates the instance. `reset()` with no fixture
118
118
creates a blank instance from the schema, whose clock starts at wall time unless `now=` says
119
-
otherwise. Passing `now=` together with a fixture is refused, because the fixture carries its own
120
-
start instant.
119
+
otherwise. An instance of a fixture starts at the fixture's `now`, and `now=` can move that start
120
+
later ([clock.md](clock.md#starting-a-fixture-later)).
121
121
Everything is passed straight to `world.instance(...)`, so the rules are the ones you already know
122
122
from running in process.
123
123
-**A second `reset`** destroys the current instance before making the new one, so a session never
@@ -132,7 +132,7 @@ A WebSocket connection is one session, and one session holds one instance.
132
132
|---|---|
133
133
|`fixture=`| the frozen starting state to copy. Omit it for a blank instance, built from the world's schema |
134
134
|`seed=`| the seed behind `ctx.ids`, and behind SQL's `random()` and `randomblob()`|
135
-
|`now=`| where the clock starts, for a blank instance only. A fixture carries its own, and `now=` with one is refused|
135
+
|`now=`| where the clock starts. Omit it for the fixture's `now`, or for wall time on a blank instance. With a fixture, it must not be earlier than the fixture's `now`|
136
136
|`clock_mode=`| how the clock moves: `fixed`, `tick`, `running` or `wall`. Omit it for the world's default ([clock.md](clock.md)) |
137
137
|`episode_id=`| your own id for the episode, echoed back on `state` so a trajectory ties to your run |
138
138
|`state_format=`| the format the `state` message answers in, in place of the world's pin ([state.md](state.md)) |
0 commit comments