@withgateway/sdk 0.3.3 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/dist/cli.js +2221 -962
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +2212 -953
- package/dist/cli.mjs.map +1 -1
- package/dist/files/index.js +81 -19
- package/dist/files/index.js.map +1 -1
- package/dist/files/index.mjs +79 -17
- package/dist/files/index.mjs.map +1 -1
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +124 -11
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +124 -11
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/{index-C3UzD0G3.d.mts → index-CDPQBsU5.d.mts} +19 -3
- package/dist/{index-C3UzD0G3.d.ts → index-CDPQBsU5.d.ts} +19 -3
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +903 -221
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +868 -212
- package/dist/index.mjs.map +1 -1
- package/dist/traces/index.js +78 -16
- package/dist/traces/index.js.map +1 -1
- package/dist/traces/index.mjs +76 -14
- package/dist/traces/index.mjs.map +1 -1
- package/dist/tracing/index.js +7 -1
- package/dist/tracing/index.js.map +1 -1
- package/dist/tracing/index.mjs +7 -1
- package/dist/tracing/index.mjs.map +1 -1
- package/dist/worlds/index.d.mts +692 -410
- package/dist/worlds/index.d.ts +692 -410
- package/dist/worlds/index.js +740 -197
- package/dist/worlds/index.js.map +1 -1
- package/dist/worlds/index.mjs +736 -193
- package/dist/worlds/index.mjs.map +1 -1
- package/package.json +1 -1
- package/runtime/gatewaysdk/environment/_materialize.py +5 -25
- package/runtime/gatewaysdk/environment/_world.py +58 -65
- package/runtime/gatewaysdk/environment/backing.py +20 -24
- package/runtime/gatewaysdk/environment/core.py +1 -16
- package/runtime/gatewaysdk/environment/legacy_sqlite.py +14 -27
- package/runtime/gatewaysdk/environment/schema/admission.py +174 -0
- package/runtime/gatewaysdk/environment/schema/api.py +174 -471
- package/runtime/gatewaysdk/environment/schema/assertions.py +458 -0
- package/runtime/gatewaysdk/environment/schema/batch.py +3 -3
- package/runtime/gatewaysdk/environment/schema/cache_layout.py +5 -0
- package/runtime/gatewaysdk/environment/schema/call_capture.py +309 -0
- package/runtime/gatewaysdk/environment/schema/call_log.py +230 -18
- package/runtime/gatewaysdk/environment/schema/call_redaction.py +201 -19
- package/runtime/gatewaysdk/environment/schema/cast.py +15 -35
- package/runtime/gatewaysdk/environment/schema/conform.py +6 -27
- package/runtime/gatewaysdk/environment/schema/connector.py +89 -152
- package/runtime/gatewaysdk/environment/schema/connectors/confluence/connector.toml +1 -12
- package/runtime/gatewaysdk/environment/schema/connectors/github/connector.toml +1 -0
- package/runtime/gatewaysdk/environment/schema/connectors/servicenow/connector.toml +2 -5
- package/runtime/gatewaysdk/environment/schema/cors.py +54 -0
- package/runtime/gatewaysdk/environment/schema/credentials.py +313 -8
- package/runtime/gatewaysdk/environment/schema/data.py +14 -13
- package/runtime/gatewaysdk/environment/schema/database/base.py +106 -165
- package/runtime/gatewaysdk/environment/schema/database/guard.py +43 -36
- package/runtime/gatewaysdk/environment/schema/database/reads.py +169 -0
- package/runtime/gatewaysdk/environment/schema/database/sqlite.py +57 -31
- package/runtime/gatewaysdk/environment/schema/declared_routes.py +210 -0
- package/runtime/gatewaysdk/environment/schema/door.py +899 -0
- package/runtime/gatewaysdk/environment/schema/envelope.py +86 -28
- package/runtime/gatewaysdk/environment/schema/grading.py +58 -86
- package/runtime/gatewaysdk/environment/schema/handler_errors.py +25 -4
- package/runtime/gatewaysdk/environment/schema/host.py +229 -1695
- package/runtime/gatewaysdk/environment/schema/host_control.py +144 -0
- package/runtime/gatewaysdk/environment/schema/host_handoff.py +370 -0
- package/runtime/gatewaysdk/environment/schema/host_loops.py +97 -0
- package/runtime/gatewaysdk/environment/schema/host_owners.py +121 -0
- package/runtime/gatewaysdk/environment/schema/host_proxy.py +111 -0
- package/runtime/gatewaysdk/environment/schema/host_requests.py +6 -0
- package/runtime/gatewaysdk/environment/schema/host_session.py +126 -0
- package/runtime/gatewaysdk/environment/schema/host_surfaces.py +79 -21
- package/runtime/gatewaysdk/environment/schema/host_transfers.py +127 -0
- package/runtime/gatewaysdk/environment/schema/host_versions.py +242 -0
- package/runtime/gatewaysdk/environment/schema/host_workers.py +577 -0
- package/runtime/gatewaysdk/environment/schema/journal.py +437 -0
- package/runtime/gatewaysdk/environment/schema/ledger_spill.py +828 -0
- package/runtime/gatewaysdk/environment/schema/local.py +31 -116
- package/runtime/gatewaysdk/environment/schema/platform.py +15 -17
- package/runtime/gatewaysdk/environment/schema/request_body.py +238 -0
- package/runtime/gatewaysdk/environment/schema/request_ledger.py +958 -0
- package/runtime/gatewaysdk/environment/schema/route_bindings.py +25 -3
- package/runtime/gatewaysdk/environment/schema/route_miss.py +54 -0
- package/runtime/gatewaysdk/environment/schema/runtime.py +129 -176
- package/runtime/gatewaysdk/environment/schema/session_files.py +133 -24
- package/runtime/gatewaysdk/environment/schema/session_move.py +275 -0
- package/runtime/gatewaysdk/environment/schema/skills/agents/connector-template-author.md +5 -1
- package/runtime/gatewaysdk/environment/schema/skills/benchmarks-getting-started/SKILL.md +8 -9
- package/runtime/gatewaysdk/environment/schema/skills/connector-schema-authoring/SKILL.md +31 -6
- package/runtime/gatewaysdk/environment/schema/skills/world-data-ingestion/ROWS.md +12 -8
- package/runtime/gatewaysdk/environment/schema/skills/world-data-ingestion/SKILL.md +13 -13
- package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/SKILL.md +23 -23
- package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/references/cli-mcp-map.md +11 -6
- package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/references/gotchas.md +35 -2
- package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/references/journal-checks.md +182 -0
- package/runtime/gatewaysdk/environment/schema/snapshot.py +149 -29
- package/runtime/gatewaysdk/environment/schema/spill_files.py +228 -0
- package/runtime/gatewaysdk/environment/schema/tasks.py +229 -323
- package/runtime/gatewaysdk/environment/schema/tools_world.py +84 -203
- package/runtime/gatewaysdk/environment/schema/validation.py +69 -1
- package/runtime/gatewaysdk/environment/schema/verbs.py +32 -36
- package/runtime/gatewaysdk/environment/schema/worker.py +6 -4
- package/runtime/gatewaysdk/environment/schema/workers.py +203 -39
- package/runtime/gatewaysdk/environment/schema/world_host.py +953 -0
- package/runtime/gatewaysdk/environment/schema/world_tests.py +9 -11
- package/runtime/gatewaysdk/environment/world.py +1 -1
- package/runtime/gatewaysdk/environment/world_session_contract.py +14 -0
- package/skills/agents/connector-template-author.md +5 -1
- package/skills/benchmarks-getting-started/SKILL.md +8 -9
- package/skills/connector-schema-authoring/SKILL.md +31 -6
- package/skills/connector-schema-authoring/connector-worlds.md +129 -7
- package/skills/world-data-ingestion/ROWS.md +12 -8
- package/skills/world-data-ingestion/SKILL.md +13 -13
- package/skills/worlds-getting-started/SKILL.md +23 -23
- package/skills/worlds-getting-started/references/cli-mcp-map.md +11 -6
- package/skills/worlds-getting-started/references/gotchas.md +35 -2
- package/skills/worlds-getting-started/references/journal-checks.md +182 -0
|
@@ -264,17 +264,18 @@ schema type, the same rule in the TypeScript CLI (`worldData/cast.ts`) and the P
|
|
|
264
264
|
|
|
265
265
|
| Field type | Cell | Value |
|
|
266
266
|
| --- | --- | --- |
|
|
267
|
-
| `integer` | `42`, `-7` | the number; `4.5` or `abc`
|
|
267
|
+
| `integer` | `42`, `-7` | the number; `4.5` or `abc` stays text, refused by the contract |
|
|
268
268
|
| `number` | `12.5`, `1e3`, `3` | the number (always a float) |
|
|
269
|
-
| `boolean` | `true`/`false`/`1`/`0`, any case | the boolean; `yes`
|
|
269
|
+
| `boolean` | `true`/`false`/`1`/`0`, any case | the boolean; `yes` stays text, refused by the contract |
|
|
270
270
|
| `array` / `object` | JSON text of that shape (quote it in the CSV: `"[""a"",""b""]"`) | the parsed value |
|
|
271
271
|
| `string` | anything | the text as given |
|
|
272
272
|
| `integer \| string` (union) | each member tried in order, `string` last | the first that fits |
|
|
273
|
-
| any, empty cell |
|
|
273
|
+
| any, empty cell | (nothing) | null when the type admits null; `""` for a required string; left out otherwise (a required one is then refused by the contract) |
|
|
274
274
|
|
|
275
|
-
A cell that fits none
|
|
276
|
-
|
|
277
|
-
|
|
275
|
+
A cell that fits none stays its text and the contract refuses the row as it refuses a JSON row
|
|
276
|
+
— `taxi_trip {"id":3}.fare: Expected number`, with the usual pointer — so a file reports every
|
|
277
|
+
bad row at once (`--report` writes them all) and nothing is written. A column the schema does
|
|
278
|
+
not name stays text and the gate refuses it as an unknown field. A CSV
|
|
278
279
|
on the drive (`drive:<path>`) is still refused: import it from the machine that holds it, or
|
|
279
280
|
through `worlds sandbox import` when it sits in a sandbox.
|
|
280
281
|
|
|
@@ -311,8 +312,11 @@ the package version keeps every snapshot (local, hosted, pinned), with no re-imp
|
|
|
311
312
|
that only adds to the domain (a new entity, a new field that is not required, another
|
|
312
313
|
`domain_version`) carries the rows: compile migrates the snapshots the tree holds and keeps the
|
|
313
314
|
pin with the stored domain's `lock` and `entities`, `sandbox check` says the commit migrates the
|
|
314
|
-
hosted snapshot, and `sandbox commit` migrates it
|
|
315
|
-
|
|
315
|
+
hosted snapshot, and `sandbox commit` migrates it as a job (a `migration` batch: the CLI follows it,
|
|
316
|
+
MCP answers `{batchId}` for `get_data_batch`) and re-pins the tree (a CLI push of such a change is
|
|
317
|
+
refused, naming the sandbox). Importing exactly the batch behind the served snapshot again (the
|
|
318
|
+
same chunks in the same order, with `redact` off) is a no-op: the batch lands on the same version
|
|
319
|
+
and names the one it repeats (`unchangedFrom`). Any other change to an entity, a field (its description
|
|
316
320
|
or title too), a key or a relationship refuses it, naming each change:
|
|
317
321
|
|
|
318
322
|
```text
|
|
@@ -53,10 +53,9 @@ A CSV/TSV is decided by its name and read as a stream (bounded memory at any siz
|
|
|
53
53
|
`--delimiter <char>` splits the cells (one character, `\t` for a tab; default `,`, tab for a
|
|
54
54
|
`.tsv`). The header row names the fields and **every cell is cast by the entity's schema
|
|
55
55
|
type**: `integer`/`number` parse as numbers, `boolean` takes true/false/1/0, `array`/`object`
|
|
56
|
-
parse as JSON, `string` stays text; an empty cell is null when the field admits null, left out
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
pinned by `tests/conformance/csv_cast.json`. Without `--entity` a CSV is refused.
|
|
56
|
+
parse as JSON, `string` stays text; an empty cell is null when the field admits null, `""` for a required string, left out otherwise. A cell that does not fit stays text and the contract refuses its row as it refuses a JSON row:
|
|
57
|
+
every bad row named by entity, key and field (`taxi_trip {"id":3}.fare: Expected number`), all counted, each in `--report`.
|
|
58
|
+
Same rule in both CLIs, pinned by `tests/conformance/csv_cast.json`. Without `--entity` a CSV is refused.
|
|
60
59
|
|
|
61
60
|
Rules:
|
|
62
61
|
|
|
@@ -156,10 +155,10 @@ JSONL chunks of `--chunk-bytes` (64 MiB default) or `--chunk-rows N`, uploads th
|
|
|
156
155
|
`--parallel 4` at a time straight to the bucket, and completes the batch; the platform
|
|
157
156
|
validates every row against the contract, applies the batch onto the world's data snapshot
|
|
158
157
|
and, with `--publish now` (default), cuts a data-only version (no image rebuild) on your open edit session
|
|
159
|
-
(`editSessionId`; only your credential reads it
|
|
158
|
+
(`editSessionId`; only your credential's unpinned reads see it, and `slug@main`, runs and tasks keep the sealed `main`, until `worlds edit close <slug>` or 60 idle minutes seal it). `--wait`
|
|
160
159
|
(default) polls to the end and prints the batch: `{batchId, state, rows, refusalCount,
|
|
161
160
|
refusals[:200], entityCounts, versionId?, batchDigest?}`. `--no-wait` prints `{batchId,
|
|
162
|
-
state}` and `gateway worlds data status <batchId
|
|
161
|
+
state}` and `gateway worlds data status <batchId> [--report <file>]` reads it later. Exit codes: 0 applied or
|
|
163
162
|
published, 2 refused (the report is written when `--report` is given: JSONL of refusal
|
|
164
163
|
records, at most 10,000 then `{"truncated": true, "total": N}`), 1 error.
|
|
165
164
|
|
|
@@ -285,7 +284,7 @@ what nests, what a write's `args` become, which call wins — in code you read t
|
|
|
285
284
|
write. The worked CRM example (nested contacts/deals exploded out of an account read, a
|
|
286
285
|
deal's nested account lifted, activity rows from `crm_log_activity` args keyed by the
|
|
287
286
|
observation id, a deletion turned into an event row, latest call wins) is on
|
|
288
|
-
|
|
287
|
+
https://docs.surfacearea.ai/worlds/data in both languages; the fixtures live in
|
|
289
288
|
`gatewaysdk/sdk/tests/environment/fixtures/crm/` (`records.jsonl`, `transform.py`,
|
|
290
289
|
`transform.ts`, `ingest.toml`, `rows.json`).
|
|
291
290
|
|
|
@@ -369,7 +368,7 @@ the console agent has `run_gateway_cli data ingest` on a sandboxed directory.
|
|
|
369
368
|
|
|
370
369
|
```bash
|
|
371
370
|
gateway worlds sandbox exec <id> 'curl -sSL https://example.test/trips.csv -o data/trips.csv' # or a script that writes rows
|
|
372
|
-
gateway worlds sandbox import <id> data/trips.csv --entity taxi_trip [--delimiter ...] [--mode append|replace] [--dry-run]
|
|
371
|
+
gateway worlds sandbox import <id> data/trips.csv --entity taxi_trip [--delimiter ...] [--mode append|replace] [--dry-run] [--report refusals.jsonl]
|
|
373
372
|
gateway worlds sandbox commit <id> -m "tools" # the SOURCE tree only; rows are not in a commit
|
|
374
373
|
```
|
|
375
374
|
|
|
@@ -378,8 +377,9 @@ sandbox (`POST /api/public/benchmark-containers/sandboxes/{id}/import`; the sand
|
|
|
378
377
|
chunks it to JSONL in a scratch dir the platform reads and removes) and streams it through the
|
|
379
378
|
same ledger as `data import <slug>`: contract, refusals with pointers, `--mode`, `--merge`,
|
|
380
379
|
`--redact`, `--per-chunk`, `-m`. Prints `{versionId, entityCounts, rowCount}`, or `{batchId,
|
|
381
|
-
state}` to poll with `data status`.
|
|
382
|
-
`
|
|
380
|
+
state}` to poll with `data status`. Refused rows exit 2: `{batchId, state: refused, refusalCount, refusals}` (all counted,
|
|
381
|
+
the first 200 inline); `--report` writes every refusal as JSONL, a `--per-chunk` import's and a polled batch's too. MCP:
|
|
382
|
+
`import_world_sandbox_data({ sandboxId, path, entity?, mode? })`. A new-world sandbox commits once first; `commit` never carries rows.
|
|
383
383
|
|
|
384
384
|
### 3. Verify on a live session
|
|
385
385
|
|
|
@@ -390,7 +390,7 @@ gateway worlds session open <slug> -t <scenario> --surface api # prints s
|
|
|
390
390
|
gateway worlds session seed <SESSION_ID> rows.json # kind:"seed" call, waits for the result
|
|
391
391
|
gateway worlds session seed <SESSION_ID> rows.json --redact refuse # same, refusing plaintext in a redacted field (apply hashes it first)
|
|
392
392
|
gateway worlds session seed <SESSION_ID> rows.json --mode replace # swap the named entities
|
|
393
|
-
curl -H "
|
|
393
|
+
curl -H "X-World-Session: $API_TOKEN" "$API_URL/<route>" # read it back (api.token from session open)
|
|
394
394
|
```
|
|
395
395
|
|
|
396
396
|
Prints `{sessionId, mode, result}`. MCP: `seed_world_session({ sessionId, rows, mode? })` waits
|
|
@@ -457,7 +457,7 @@ Sanitize before importing: hash or drop personal fields the world's `[redact]` p
|
|
|
457
457
|
| refused, kind `api` (or `harbor`), naming the file to edit | the world is a generated bundle or a task suite | edit the named source, `bench push` again |
|
|
458
458
|
| `version` missing from the result | a local directory was given | push with `gateway bench push <dir>` when ready |
|
|
459
459
|
| `... is over what a world's source tree carries as data (4 MiB / 100000 rows ...)`; `data/initial.json would be N MiB with these rows, over the 4 MiB publication reads a source file whole`; `exceed the inline cap ... without the bundled runtime` | a directory import above the tree cap; or no `python3`, so the rows travel whole (5,000 / 4 MiB) | `worlds sandbox import` from a sandbox, `data import <slug>` with keys (never keys into the sandbox); install python3 |
|
|
460
|
-
|
|
|
460
|
+
| `<entity> {"<key>":…}.<field>: Expected number` (integer, boolean, array, object) on a CSV row | a cell the field's schema type does not fit: it stays text and the contract refuses its row | fix the cell or the header; `--report` lists every row; nothing was written |
|
|
461
461
|
| exit 2, `state: refused` | the platform refused the batch; `--report` has every record | fix the rows named, `--resume` is not for this: run the import again |
|
|
462
462
|
| `nothing to resume` / `only an open or uploading batch resumes` | no incomplete manifest, or the batch already ran | run the import without `--resume` |
|
|
463
463
|
| `409 base_mismatch` from `/__world/seed` | the overlay named another snapshot digest than the pod is on | the runner posts the digest of the version's snapshot; a mismatch is a version mismatch, never reseed silently |
|
|
@@ -497,4 +497,4 @@ handler or route edit keeps the imported data while an entity, field or key edit
|
|
|
497
497
|
- `connector-schema-authoring`: the data model the rows are checked against.
|
|
498
498
|
- `documentation/features/world-data-ingestion.md`: what exists, the contract, code pointers.
|
|
499
499
|
- `documentation/features/connector-worlds.md`: captures, ingest, serving the vendor's API.
|
|
500
|
-
- Consumer page:
|
|
500
|
+
- Consumer page: https://docs.surfacearea.ai/worlds/data.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: worlds-getting-started
|
|
3
|
-
description: Starter guide for building worlds and environments on the platform, end to end, for an agent (Claude Code, Cursor, Codex). Use when starting a world from scratch, building a world or environment, mocking a vendor, importing a Swagger or OpenAPI spec into a world (schema init --from-openapi), choosing between a shipped template, a workspace connector, an OpenAPI document, a vendor API capture or a custom contract, provisioning worlds for tenants in one call (worlds create), publishing with bench push, opening a session, running and grading, or iterating with pull, fork, diff and edit sessions (worlds edit status/close/rollback: version control without PRs). Every CLI step names its MCP twin (list_connectors, publish_connector, create_world, init_world_from_connector, env_write_file, env_commit, import_world_data, run_evaluation and the rest) and where the result shows in the UI.
|
|
3
|
+
description: Starter guide for building worlds and environments on the platform, end to end, for an agent (Claude Code, Cursor, Codex). Use when starting a world from scratch, building a world or environment, mocking a vendor, importing a Swagger or OpenAPI spec into a world (schema init --from-openapi), choosing between a shipped template, a workspace connector, an OpenAPI document, a vendor API capture or a custom contract, provisioning worlds for tenants in one call (worlds create), publishing with bench push, opening a session, reading every request a world received (worlds requests), checks over those requests (journal checks on gateway_requests, calls, verify.py, SQL verifiers; task try before you save, task regrade of past runs), running and grading, or iterating with pull, fork, diff and edit sessions (worlds edit status/close/rollback: version control without PRs). Every CLI step names its MCP twin (list_connectors, publish_connector, create_world, init_world_from_connector, env_write_file, env_commit, import_world_data, run_evaluation and the rest) and where the result shows in the UI.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Worlds: getting started
|
|
@@ -17,7 +17,7 @@ The shortest correct path from nothing to a hosted world with data, a session, a
|
|
|
17
17
|
CLI first; the MCP twin sits under each step for an agent that talks to the platform over MCP instead of a shell.
|
|
18
18
|
Deeper references are linked by path, not repeated.
|
|
19
19
|
|
|
20
|
-
Vocabulary (from
|
|
20
|
+
Vocabulary (from https://docs.surfacearea.ai/glossary): **world** (the sealed replica), **scenario** (a task in
|
|
21
21
|
it), **rollout** (one attempt), **run** (a filed set of rollouts), **eval** (the grade), **gate** (the bar).
|
|
22
22
|
Identifiers keep the old words: `environment`, `container`, `task set`, `bench`.
|
|
23
23
|
|
|
@@ -220,8 +220,7 @@ gateway worlds connector publish ./x --slug x -m "first cut" # the template as
|
|
|
220
220
|
|
|
221
221
|
`bench push` makes the version sessions and runs address (`slug@version`). `connector publish` saves the contract
|
|
222
222
|
(never `data/`, `captures/`, `db/`) so anyone in the org can `schema init --connector workspace:x`. The world's
|
|
223
|
-
`tests/`, `tasks.json`, `verifiers/` and `openapi/` travel with the connector into every world initialized from it
|
|
224
|
-
(they used to be left behind, so the new world had no suite to run). Both, for a world you expect to rebuild.
|
|
223
|
+
`tests/`, `tasks.json`, `verifiers/` and `openapi/` travel with the connector into every world initialized from it. Both, for a world you expect to rebuild.
|
|
225
224
|
|
|
226
225
|
MCP: `publish_connector({ slug, files, message? })` is the template write path. `init_world_from_connector({ slug, name })`
|
|
227
226
|
makes the world under a PAT session; under an API key it returns the initialized files plus the publish steps
|
|
@@ -319,9 +318,10 @@ gateway worlds session open x --task-file task.json --surface api # the sessio
|
|
|
319
318
|
gateway worlds session status <SESSION_ID> # poll until ready
|
|
320
319
|
gateway worlds session seed <SESSION_ID> rows.json # rows into this session only
|
|
321
320
|
gateway worlds session state <SESSION_ID> # every entity's rows, the dump a grader reads
|
|
322
|
-
gateway worlds session reset <SESSION_ID> # back to the snapshot (+ the task's seed)
|
|
321
|
+
gateway worlds session reset <SESSION_ID> # back to the snapshot (+ the task's seed); `session restart <SESSION_ID> [--version <pin>]` does it on what its pin (x@ref; unpinned = newest you may read) points to NOW, same id, URLs + token, running or closed; a grade then reads only the requests after its session.restart ledger entry
|
|
323
322
|
gateway worlds session grade <SESSION_ID> [--timeout S] # {reward, rewards, raw}; exploratory → {reward: null, reason: "no grader"}
|
|
324
|
-
gateway worlds session export <SESSION_ID> --out calls.jsonl [--requests] # the platform's ledger; --requests
|
|
323
|
+
gateway worlds session export <SESSION_ID> --out calls.jsonl [--requests] # the platform's ledger; --requests adds the session's entries from the world's request ledger (kind "request": via, status, sizes; bodies by result.requestId), live or closed
|
|
324
|
+
gateway worlds requests x [--session <SESSION_ID>] [--via api|ui|tool] [--status 4xx] [--since 2026-10-05] [--json] # every request the world received (every session, version and door), newest first, kept for its life; reading records nothing; `requests show x <REQUEST_ID> [--out f]` adds headers + bodies, `session requests <SESSION_ID>` lists one session's (exit 3: its engine records no requests, only World Host sessions do)
|
|
325
325
|
gateway worlds data ingest x calls.jsonl --transform shape.py # the calls back in as rows, shaped by your code or --map ingest.toml (world-data-ingestion §2c)
|
|
326
326
|
gateway worlds session close <SESSION_ID> # a closed session reopens by id, same URLs + token, from its last checkpoint: gateway worlds session reopen <SESSION_ID>
|
|
327
327
|
```
|
|
@@ -344,7 +344,7 @@ verifiers) is refused `world_kind_retired`; one on an api bundle opens and lists
|
|
|
344
344
|
`instruction` is what the agent is told; `seed` (`{mode?, rows}`, the live-seed contract) is laid on the clone and re-applied by `reset`;
|
|
345
345
|
`grader` is `assertions` (`entity`, `where`, `exists|absent|count|all|any`, `field op value`; each check's `id` becomes a `rewards` key;
|
|
346
346
|
`entity: "calls"` reads the call log — `operation`, `args`, `selectors`, `status`, `rows`, `found`, and `via`: `ui` from the page's `api_path`,
|
|
347
|
-
`api` from the api origin, `tool` for a declared tool's call; a credential-named or secret-shaped field reads `[redacted]`; `rows`/`found` are null where the answer declares no rows, a request too large to keep names what it lacks in `withheld`, and a check grades whenever the calls it can read decide it, ungraded only where those could change the result), `{kind: "python", source, timeoutSeconds?}` (a `verify.py` body; it reads the state as JSON on stdin — `{"<entity>": {"<primary key>": row}, "calls": [...], "report": "<the agent's report>"}`, a verifier's entities as `<alias>.<entity>` — and prints ONE flat JSON object as the last line of stdout, `reward` plus a number from 0 to 1 per check — `true`/`false` read as 1/0, `null` or a string as ungraded, no `reward` leaves the task ungraded, and a nested object or array (a `rewards` map included), a number outside 0..1 or NaN/Infinity fails the grade by key and value; it must exit 0 within `timeoutSeconds`, default and most 30, or the grade fails with the reason) or `{kind: "rubric", rubric, criteria?, model?}`
|
|
347
|
+
`api` from the api origin, `tool` for a declared tool's call; a credential-named or secret-shaped field reads `[redacted]`; `rows`/`found` are null where the answer declares no rows, a request too large to keep names what it lacks in `withheld`, and a check grades whenever the calls it can read decide it, ungraded only where those could change the result; on a World Host session `calls` is read from the session's journal, every door and no bound, and `entity: "gateway_requests"` matches every request its world received — `operation`, `method`, `path`, `query.<k>`, `response.status`, `request.body.<path>`, `response.body.<path>`, with `before`/`after` to order them — failing closed, with the reason, where a journal missing requests cannot decide a check: `references/journal-checks.md`), `{kind: "python", source, timeoutSeconds?, readsJournal?, acceptsIncompleteJournal?}` (a `verify.py` body; it reads the state as JSON on stdin — `{"<entity>": {"<primary key>": row}, "calls": [...], "report": "<the agent's report>"}`, a verifier's entities as `<alias>.<entity>` — and prints ONE flat JSON object as the last line of stdout, `reward` plus a number from 0 to 1 per check — `true`/`false` read as 1/0, `null` or a string as ungraded, no `reward` leaves the task ungraded, and a nested object or array (a `rewards` map included), a number outside 0..1 or NaN/Infinity fails the grade by key and value; it must exit 0 within `timeoutSeconds`, default and most 30, or the grade fails with the reason) or `{kind: "rubric", rubric, criteria?, model?}`
|
|
348
348
|
(an LLM judge over end state + call log, graded on the platform: `grade` answers pending until
|
|
349
349
|
the worker finalizes it); `tools: [names]` narrows the operations the session may call to
|
|
350
350
|
exactly those (a name the world does not serve is a 400); `metadata` rides the session. At most one of
|
|
@@ -366,21 +366,20 @@ gateway worlds task update <TASK_ID> --spec task2.json # a changed spec is
|
|
|
366
366
|
gateway worlds session open x --task-id <TASK_ID> [--task-version 1] --surface api
|
|
367
367
|
gateway worlds session task save <SESSION_ID> --name acme-q3 # promote a session's inline task into a stored one
|
|
368
368
|
gateway worlds task delete <TASK_ID>
|
|
369
|
+
gateway worlds task try task.json --session <SESSION_ID> # a spec (or <TASK_ID>) graded on a stored World Host session, each check with the requests it matched; saves nothing
|
|
370
|
+
gateway worlds task regrade <TASK_ID> [--run <EVAL_ID>|--all-runs|--session <ID>] [--version N] # past runs graded again in place, no agent; default the latest run
|
|
369
371
|
```
|
|
370
372
|
|
|
371
|
-
SDK: `createTask / listTasks / getTask / updateTask / validateTask / deleteTask`,
|
|
372
|
-
`
|
|
373
|
-
`
|
|
374
|
-
(Python). MCP: `create_world_task`, `update_world_task`, `list_world_tasks`, `get_world_task`,
|
|
375
|
-
`validate_world_task`, `delete_world_task`, `save_world_session_task`. The world's Scenarios
|
|
376
|
-
tab lists the tasks pinned to it under a `world` kind chip.
|
|
373
|
+
SDK: `createTask / listTasks / getTask / updateTask / validateTask / deleteTask`, `openSession(slug, { task: { id, version? } })`, `session.saveTask(name)`, `new TaskGrades().try / regrade` (TS);
|
|
374
|
+
`create_task` … `delete_task`, `open_session(slug, {"id": …})`, `session.save_task(name)`, `TaskGrades().try_task / regrade` (Python). MCP: `create_world_task`, `update_world_task`, `list_world_tasks`, `get_world_task`,
|
|
375
|
+
`validate_world_task`, `delete_world_task`, `save_world_session_task`, `try_world_task`, `regrade_world_task`. The world's Scenarios tab lists the tasks pinned to it under a `world` kind chip.
|
|
377
376
|
|
|
378
377
|
**Stored tasks as a hosted eval.** A run config dispatches EITHER the bundle's scenarios
|
|
379
378
|
(`--tasks`) OR stored tasks (`--world-tasks`), never both:
|
|
380
379
|
|
|
381
380
|
```bash
|
|
382
381
|
gateway bench run-configs create --name nightly --models openai/gpt-5-mini --world-tasks <TASK_ID>,<OTHER_ID>@2
|
|
383
|
-
gateway bench dispatch <RUN_CONFIG_ID> # each stored task is a sample; rubric tasks are refused at dispatch
|
|
382
|
+
gateway bench dispatch <RUN_CONFIG_ID> # each stored task is a sample; rubric tasks and tasks whose checks read calls or requests are refused at dispatch
|
|
384
383
|
```
|
|
385
384
|
|
|
386
385
|
`<id>` runs the task's current version at dispatch time, `<id>@N` that version forever. SDK:
|
|
@@ -395,10 +394,10 @@ answers 503. That is a cold start, not a fault, until about twenty minutes have
|
|
|
395
394
|
`status` print `idleExpiresAt` (null once pinned) + `pinned`; `status` warns under 5 minutes. A call
|
|
396
395
|
body over 4mb is refused client-side: `{status: "error", code: "payload_too_large"}`, exit 2.
|
|
397
396
|
|
|
398
|
-
The world's API
|
|
399
|
-
the
|
|
397
|
+
The world's API mirrors the vendor's auth as `[auth]` declares it: the session's api token after an `Authorization` word the vendor takes, in its header, as its Basic user or password, its query key, a token the world's `[auth.login]` minted, or an
|
|
398
|
+
`[auth.downloads]` link; your own tooling sends it in `X-World-Session` (the SDKs' `apiHeaders`) or as a bearer, on every world. No auth for an eval: `session open --auth open` (or `mode = "open"` under `[auth]`) prints `api.auth: open` and a capability URL that needs no credential. `worlds serve` takes the `--api-key` pin (default `conform`) the vendor's ways alone (connector-worlds.md, "The door").
|
|
400
399
|
|
|
401
|
-
MCP: `seed_world_session`, `export_world_session`, `save_world_session_task`; open/call/close are CLI or REST only.
|
|
400
|
+
MCP: `seed_world_session`, `export_world_session`, `save_world_session_task`, `list_world_requests`, `get_world_request`; open/call/close are CLI or REST only.
|
|
402
401
|
Find what you opened: `gateway worlds session list` (every state; the live ones are `--state RUNNING` and `--state IDLE`) / `sandbox list`; `session pin <id>` stops the reaper.
|
|
403
402
|
|
|
404
403
|
## Test the world (not the agent)
|
|
@@ -433,7 +432,7 @@ gateway worlds call http://localhost:8080 slack.list_channels --args '{...}' --c
|
|
|
433
432
|
`GET /__session/{task,tools,state}`, `POST /__session/{call,grade,reset,seed,close}`; `--task` and
|
|
434
433
|
`--scenario` belong to `serve`. A directory target (`worlds call ./x <tool>`) opens and closes its
|
|
435
434
|
own session per call. A HOSTED session is not a served url (the World Host serves no `/__session/*`;
|
|
436
|
-
its `api.url` takes the session's
|
|
435
|
+
its `api.url` takes the session's token): act on it by id, `gateway worlds call <sessionId> <tool> --state --grade --close`.
|
|
437
436
|
|
|
438
437
|
## 7. Run and grade
|
|
439
438
|
|
|
@@ -463,18 +462,18 @@ MCP: `run_evaluation({ models | runConfigId, versionId?, numExamples?, rolloutsP
|
|
|
463
462
|
```bash
|
|
464
463
|
gateway bench pull x # reconstruct the head version's tree; `bench status ./x` = branch, base, local edits
|
|
465
464
|
gateway bench fork x --into x-experiment # a new container sharing content; `bench diff <base> <head>` per-file, `bench log x` versions
|
|
466
|
-
gateway worlds edit status x # your open EDIT SESSION: every push / sandbox commit / data import after the first version lands there; only
|
|
465
|
+
gateway worlds edit status x # your open EDIT SESSION: every push / sandbox commit / data import after the first version lands there; only your unpinned reads see it (no @ref: describe x, session open x, pull x, test x); x@main, version pins, runs and tasks get SEALED versions only
|
|
467
466
|
gateway worlds edit close x -m "why" # seal it: main moves to the session's tip for everyone; each version stays in `log`, `edit rollback` undoes the whole session (60 idle minutes seal it too). `edit list x` = history, `edit discard x` drops it unseen
|
|
468
467
|
gateway worlds edit rollback x <sessionId> # undo a sealed session (source + data together) as a new sealed session; --force when later sessions would go too
|
|
469
|
-
gateway worlds task edit close <task> -m "why" # a change across a TASK's worlds: seal them all in ONE step or none (`task edit status <task>` first: your unsealed worlds,
|
|
470
|
-
gateway worlds sandbox open x
|
|
468
|
+
gateway worlds task edit close <task> -m "why" # a change across a TASK's worlds: seal them all in ONE step or none (`task edit status <task>` first: your unsealed worlds, which every `task up` and run skips until sealed; `task edit rollback <task> --group <groupId>` undoes the group)
|
|
469
|
+
gateway worlds sandbox open x # no local checkout (no @ref: your open edit's tip, else main; x@main is the sealed main): write|exec|check|commit|close <id> edit the tree server-side; `bench sandbox` is the same set
|
|
471
470
|
gateway worlds sandbox exec <id> 'gateway worlds schema entity add . tickets --fields id:string,title:string -k id && gateway worlds schema compile . && gateway worlds data import . rows.json && gateway worlds schema check . && gateway worlds test .'
|
|
472
471
|
gateway worlds sandbox open --new y --from custom # a world that does not exist yet (no base); its first `commit` creates it — references/new-world-sandbox.md
|
|
473
472
|
gateway worlds sandbox import <id> data/trips.csv --entity trip # rows a sandbox made or curl'ed → the PLATFORM world, read by the platform; `commit` carries the source tree only
|
|
474
473
|
```
|
|
475
474
|
|
|
476
475
|
The sandbox carries the platform's `gateway` CLI and `sqlite3` on PATH: `exec` runs `worlds
|
|
477
|
-
schema|data|test|serve|call …` on the working copy with nothing on your machine; on a world whose data is a hosted snapshot, a tool, handler or
|
|
476
|
+
schema|data|test|serve|call …` on the working copy with nothing on your machine; on a world whose data is a hosted snapshot, `data show|sql`, `test` and `call` read its rows (laid beside the tree before each `exec`), a tool, handler, route, new entity or optional field compiles and keeps that data, any other domain edit is refused (`references/gotchas.md`). `open` prints
|
|
478
477
|
`cli: {version, digest}`, or `cli: null` plus the reason under `warnings`. Remote verbs (`push`, `run`,
|
|
479
478
|
`session open`) stop inside the sandbox by design: it holds no platform credential, and never write one
|
|
480
479
|
into its tree — `check`/`commit` hold back scratch, credential-shaped files (`.env`, `.gateway-env`, `*.env`,
|
|
@@ -489,6 +488,7 @@ MCP: `list_world_edits({ slug })`, `close_world_edit`, `discard_world_edit`, `ro
|
|
|
489
488
|
- `references/ui-map.md`: every route, per thing (connector page, world tabs, Worlds › Map, sessions, tests, stored tasks).
|
|
490
489
|
- `references/cli-mcp-map.md`: every CLI step with its MCP twin, the steps that have none, and how the platform (console) agent reaches the same surface (`run_gateway_cli`, `spawn_subagent`).
|
|
491
490
|
- `references/gotchas.md`: offline vs platform scaffolding, `bench push` vs `worlds create`, the World Host as the only engine, sharing, seeds, `max_tokens`, secret preflight, `secret set` upsert.
|
|
491
|
+
- `references/journal-checks.md`: checks over the requests a session's world received (declarative, `verify.py`, SQL), fail-closed reasons, `task try` and `task regrade`.
|
|
492
492
|
|
|
493
493
|
## Related
|
|
494
494
|
|
|
@@ -497,4 +497,4 @@ MCP: `list_world_edits({ slug })`, `close_world_edit`, `discard_world_edit`, `ro
|
|
|
497
497
|
- `documentation/features/connector-worlds.md` (`connector.toml`, capture, conform, serving), `workspace-connectors.md`
|
|
498
498
|
(the connector object, sharing, MCP surface), `world-schema.md` (the `gateway-world/1` contract and store API);
|
|
499
499
|
the first and last ship with the npm package (`gateway worlds skill connector-schema-authoring --install .`).
|
|
500
|
-
- Consumer pages: `
|
|
500
|
+
- Consumer pages (docs.surfacearea.ai): `worlds/getting-started`, `worlds/sessions`, `worlds/data`, `worlds/custom-connections`, `worlds/slack`.
|
|
@@ -21,13 +21,17 @@ Reference for `worlds-getting-started`: every CLI step and its MCP twin, then ho
|
|
|
21
21
|
| `worlds session open [-t\|--task-id\|--task-file]` (none: exploratory) / `status` / `call` / `close` / `list` / `pin` | none on the public MCP server — CLI or REST only (`/api/public/world-sessions[/{id}[/calls]]`; the open answers `idleExpiresAt` + `pinned`) |
|
|
22
22
|
| `worlds session seed` | `seed_world_session` |
|
|
23
23
|
| `worlds session export` | `export_world_session` |
|
|
24
|
+
| `worlds requests [list] <slug> [--session <id>] [--version <ref>] [--via api\|ui\|tool] [--operation <name>] [--status 200\|2xx\|4xx\|5xx] [--since <time>] [--until <time>] [--limit N] [--cursor <c>] [--json]` | `list_world_requests({ slug, sessionId?, versionId?, via?, operation?, status?, since?, until?, cursor?, limit? })` (`GET /api/public/worlds/{slug}/requests`): every request the world received, from every session, version and door (`via` api, ui, tool), newest first, a page of at most 200 with `nextCursor`; metadata only (method, path, query, status, rows, found, duration, each body's size and `truncated`). The world keeps them for its life under the project's retention setting, and reading records nothing in any session's ledger. `--since`/`--until` take an ISO 8601 date or time (no zone is UTC); a bad filter is exit 2 before any request. UI: the world's Requests view, the session page's activity feed |
|
|
25
|
+
| `worlds requests show <slug> <requestId> [--json] [--out <file>]` | `get_world_request({ slug, requestId })` (`GET /api/public/worlds/{slug}/requests/{requestId}`): the request's headers (credentials `[redacted]`) and the first 64 KB of each body as text (`null` for a body that is not text; `bodyBytes` is the full size, `truncated` says it was cut); `--out` writes the whole entry as JSON. MCP only: the console agent's `get_world_request` is a different tool (it polls a world build) |
|
|
26
|
+
| `worlds session requests <sessionId>` (the list's filters but `--session`/`--version`) | `list_world_requests({ slug, sessionId })` (the CLI reads `GET /api/public/world-sessions/{id}/requests`, the world's list for one session; both MCP tools call the platform's `WorldRequestLedger` directly). A session whose engine is not the World Host records no requests: the route answers 409 `requests_not_recorded`, the CLI prints its one line and exits 3, and `session export --requests` notes the same line on stderr and writes the call log. `worlds requests <slug> --session <id>` and `list_world_requests({ slug, sessionId })` answer such a session the same way: 409, exit 3, the tool's error naming the engine |
|
|
24
27
|
| `worlds session reopen <id>` | — (no MCP twin; `POST /api/public/world-sessions/{id}/reopen`: a closed session back under the same id, URLs and token from its last checkpoint, answering what `status` answers; 409 `session_not_closed` / `session_no_checkpoint` / `session_reopen_in_progress` / `session_version_unavailable`) |
|
|
28
|
+
| `worlds session restart <id> [--version <pin>]` | `restart_world_session` (`POST /api/public/world-sessions/{id}/restart` `{version?}`: a running or closed session's world started over on its pin's current version, or `version`, which becomes the pin, under the same id, URLs and token; base data plus the task's seed. The route and the CLI answer what `status` answers plus `restart: {previousVersionId, versionId, pin, boundarySeq, boundaryAt}`; the MCP tool answers the `restart` block with `sessionId`. A request the old world received has an `at` before `boundaryAt`, and a grade reads only those after it. 409 `session_not_restartable` / `session_version_unavailable` / `session_reopen_in_progress` / `no_open_door`; 503 when the new world did not open) |
|
|
25
29
|
| `worlds data calls pull` / `worlds data ingest [--transform\|--map]` | — (no MCP twin yet; `run_gateway_cli data ingest` on a sandboxed directory) |
|
|
26
30
|
| `files upload <local>... [--to]` | `request_file_upload` + `confirm_file_upload` (`upload_file` for ≤25 MB inline) |
|
|
27
31
|
| `files list [path]` / `files get <path>` / `files download\|cat <path>` | `list_files` / `get_file` (a presigned URL; the CLI streams it) |
|
|
28
32
|
| `files delete` / `files move` / `files mkdir` | `delete_file` / `move_file` / `create_folder` |
|
|
29
33
|
| `files fetch <url> --to <path> [--header "Name: value"]...` | `download_url_to_drive` (`POST /api/public/files/fetch`; the platform fetches, nothing passes through the caller's machine; a header value may name a project secret as `{{secret:NAME}}`, expanded on the platform and never returned; `--local` fetches from the caller's machine instead, without secrets) |
|
|
30
|
-
| `worlds sandbox import <id> <path-in-sandbox> [--entity] [--mode]` | `import_world_sandbox_data` (`POST /api/public/benchmark-containers/sandboxes/{id}/import`; the platform reads the file from the sandbox tree into the platform world — the sandbox never holds credentials; `commit` versions the source tree only) |
|
|
34
|
+
| `worlds sandbox import <id> <path-in-sandbox> [--entity] [--mode] [--report <file>]` | `import_world_sandbox_data` (`POST /api/public/benchmark-containers/sandboxes/{id}/import`; the platform reads the file from the sandbox tree into the platform world — the sandbox never holds credentials; `commit` versions the source tree only) |
|
|
31
35
|
| `files connectors list\|sync <id>` | `list_file_connectors` / `sync_file_connector` (`GET\|POST /api/public/files/connectors[/sync]`) |
|
|
32
36
|
| `traces list\|get\|export [--observations]` | `get_trace`, `get_observations` (`GET /api/public/traces[/{id}]`, `/observations`) |
|
|
33
37
|
| `traces sessions list\|get [--io]` | `get_session` (`GET /api/public/sessions[/{id}?includeIO=true]`) |
|
|
@@ -36,9 +40,9 @@ Reference for `worlds-getting-started`: every CLI step and its MCP twin, then ho
|
|
|
36
40
|
| `environment run` / `worlds run` | `run_evaluation` |
|
|
37
41
|
| `environment link-task-set` / `create-task` | `create_task_set`, `create_task`, `link_task_set` |
|
|
38
42
|
| `bench diff` / `propose` | `env_diff`, `env_propose` (proposals are the legacy PR-style door; edit sessions below are the version-control loop) |
|
|
39
|
-
| `worlds\|bench edit status\|list\|close\|discard\|rollback <slug>` | `list_world_edits({ slug, status?, limit? })`, `close_world_edit({ slug, sessionId?, force?, message? })`, `discard_world_edit`, `rollback_world_edit({ slug, sessionId, force?, message? })` (`GET /api/public/worlds/{slug}/edits`, `POST …/edits/close\|discard\|rollback`). After a world's first version every push, sandbox commit, data import, agent `env_commit` and UI save lands on the credential's open edit session — a private `edit/<id>` branch only that credential reads
|
|
40
|
-
| `worlds task edit status\|close\|rollback <task>` (task id, spec file with `worlds`, or `task up` manifest) | `get_task_edit({ task })`, `close_task_edit({ task, requireAll?, force?, message? })`, `rollback_task_edit({ task, groupId, force?, message? })` (`POST /api/public/world-task-edits/status\|close\|rollback`). The same edit sessions across every world a task names: `status` shows each world's unsealed edits (open and `parked` in conflict) and what closing would do (`fast-forward`, `rebase`, `conflict`) —
|
|
41
|
-
| `worlds\|bench sandbox open\|status\|read\|write\|exec\|check\|commit\|close` | `open_world_sandbox`, `get_world_sandbox`, `read_world_sandbox_file`, `write_world_sandbox_file` (base64), `exec_in_world_sandbox`, `check_world_sandbox`, `commit_world_sandbox`, `close_world_sandbox({ sandboxId, force? })` (`/api/public/benchmark-containers/sandboxes[/{id}[/file\|exec\|check\|commit]]`; `close` with uncommitted work is a 409 `sandbox_uncommitted` naming the paths, nothing closed, unless `force: true` / `--force`; a sandbox whose machine was replaced gets its tree back (latest snapshot, or the base) and the next verb answers 409 `sandbox_recreated` once — look at the tree, redo lost edits, retry; 503 `sandbox_restore_failed` means retry; 409 `sandbox_tree_missing` means the world root was deleted, so close and reopen; the source tree only — no data snapshot, nothing on the caller's disk; `commit` lands on the recorded base; `commit --rebase` sends `rebase: true` and replays onto a branch head that moved, a 409 naming each conflicting path). `open` reports `cli: {version, digest}` — the platform's own `gateway` CLI and a `sqlite3` are on PATH inside `exec`, so `gateway worlds schema entity add\|verifier add\|task add\|compile\|check .`, `gateway worlds data import\|show\|query\|sql .`, `gateway worlds test .`, `gateway worlds serve . --port 8080 & sleep 2; gateway worlds call http://localhost:8080 <tool> …` (one `exec`; a served world lives only as long as that command) and `sqlite3 db/state.sqlite "…"` run on the working copy; remote verbs (push, run, session open) stop in the sandbox by design — `check`/`commit` from your machine. `cli: null` + `warnings[]` means the image cannot host the runtime (python3 < 3.12 or node < 18); plain shell still runs |
|
|
43
|
+
| `worlds\|bench edit status\|list\|close\|discard\|rollback <slug>` | `list_world_edits({ slug, status?, limit? })`, `close_world_edit({ slug, sessionId?, force?, message? })`, `discard_world_edit`, `rollback_world_edit({ slug, sessionId, force?, message? })` (`GET /api/public/worlds/{slug}/edits`, `POST …/edits/close\|discard\|rollback`). After a world's first version every push, sandbox commit, data import, agent `env_commit` and UI save lands on the credential's open edit session — a private `edit/<id>` branch only that credential's unpinned reads see (no `@ref`, no version: `describe`, `pull`, `log`, `session open`, `sandbox open`, `test`); `slug@main`/`@latest`, an exact version pin, every run, task and stored pin resolve to sealed versions only (an unsealed version id answers only its own author); the write's JSON carries `editSessionId` + a hint. `close`, or 60 minutes without an edit, seals the session: the shared `main` moves to its tip (every version stays in `log`; the session is the rollback unit); a `main` that moved meanwhile is rebased when the paths differ, else the session parks as `conflict` (`close --force` takes its content). `rollback` restores source + data snapshot from before a sealed session as a new sealed session (`--force` when later sessions would be undone too). UI: world › History › Edit sessions |
|
|
44
|
+
| `worlds task edit status\|close\|rollback <task>` (task id, spec file with `worlds`, or `task up` manifest) | `get_task_edit({ task })`, `close_task_edit({ task, requireAll?, force?, message? })`, `rollback_task_edit({ task, groupId, force?, message? })` (`POST /api/public/world-task-edits/status\|close\|rollback`). The same edit sessions across every world a task names: `status` shows each world's unsealed edits (open and `parked` in conflict) and what closing would do (`fast-forward`, `rebase`, `conflict`) — every `task up`, run config and schedule, yours included, keeps the sealed `main` until the close; `close` seals every world in ONE transaction (a conflict, a missing world, a ref other than `main` or a parked session anywhere seals nothing, and the 409 names every world's problem; worlds with no edit are skipped unless `--require-all`), and the sessions share a `groupId`; `rollback --group` restores every world together to the `main` the group replaced, refused when anything reached a world's `main` after the group (a later session or a write outside sessions) unless `--force` |
|
|
45
|
+
| `worlds\|bench sandbox open\|status\|read\|write\|exec\|check\|commit\|close` | `open_world_sandbox`, `get_world_sandbox`, `read_world_sandbox_file`, `write_world_sandbox_file` (base64), `exec_in_world_sandbox`, `check_world_sandbox`, `commit_world_sandbox`, `close_world_sandbox({ sandboxId, force? })` (`/api/public/benchmark-containers/sandboxes[/{id}[/file\|exec\|check\|commit]]`; `close` with uncommitted work is a 409 `sandbox_uncommitted` naming the paths, nothing closed, unless `force: true` / `--force`; a sandbox whose machine was replaced gets its tree back (latest snapshot, or the base) and the next verb answers 409 `sandbox_recreated` once — look at the tree, redo lost edits, retry; 503 `sandbox_restore_failed` means retry; 503 `sandbox_unresponsive` / `sandbox_unavailable` / `sandbox_replacing` mean nothing changed: call again after `retryAfterSeconds` (a sandbox silent for 5 minutes is then replaced from its latest snapshot and answers 409 `sandbox_recreated`); 409 `sandbox_tree_missing` means the world root was deleted, so close and reopen; the source tree only — no data snapshot, nothing on the caller's disk; `commit` lands on the recorded base; `commit --rebase` sends `rebase: true` and replays onto a branch head that moved, a 409 naming each conflicting path). `open` reports `cli: {version, digest}` — the platform's own `gateway` CLI and a `sqlite3` are on PATH inside `exec`, so `gateway worlds schema entity add\|verifier add\|task add\|compile\|check .`, `gateway worlds data import\|show\|query\|sql .`, `gateway worlds test .`, `gateway worlds serve . --port 8080 & sleep 2; gateway worlds call http://localhost:8080 <tool> …` (one `exec`; a served world lives only as long as that command) and `sqlite3 db/state.sqlite "…"` run on the working copy; remote verbs (push, run, session open) stop in the sandbox by design — `check`/`commit` from your machine. `cli: null` + `warnings[]` means the image cannot host the runtime (python3 < 3.12 or node < 18); plain shell still runs |
|
|
42
46
|
| `worlds\|bench sandbox open --new <slug> --from custom\|<template>` | `open_world_sandbox({ new, from })` (same route, body `{new, from}`; a world that does not exist yet — `baseVersionId`/`containerId`/`baseContentHash` null, `branch: main`, `pendingSlug`; `custom` = the `schema init` scaffold, else a shipped template (`GET /api/public/worlds/templates`; unknown → 400 naming the list); taken slug → 409 `world_exists`, never renamed; `check_world_sandbox` runs the first commit's gate; the first `commit_world_sandbox` creates the world on `main` through the `worlds create --from <dir>` door, later commits land on the new base; the same staged CLI runs on the scaffold) |
|
|
43
47
|
| `worlds skill <name>` / `worlds connector skill` | `get_connector_authoring_skill`, `guide` |
|
|
44
48
|
| `worlds connector capture --remote` / poll + download | `start_connector_capture`, `get_connector_capture` (platform agent only) |
|
|
@@ -50,8 +54,9 @@ before it makes a request.
|
|
|
50
54
|
|
|
51
55
|
| Door | Limit | Over it |
|
|
52
56
|
|---|---|---|
|
|
53
|
-
| `sandbox write
|
|
54
|
-
| `
|
|
57
|
+
| `sandbox write` | 256 MB per file (past 4 MB the CLIs send it in parts, checked by size and SHA-256 before it lands); `--from <dir>` writes every file under it but `.git/`, `.gateway/` and scratch (`node_modules/`, `__pycache__/`, `*.pyc`, ...), and says what it skipped | refused before any request, naming the limit; generate bigger data in the sandbox (`sandbox exec`) and load it with `sandbox import` |
|
|
58
|
+
| `write_world_sandbox_file`, `env_write_file`, `propose_task_fix` | 256 KB per call | refused, naming the limit; a bigger file → `sandbox write`; rows → `worlds data import <slug> <file>`; the whole tree → `bench push` |
|
|
59
|
+
| `sandbox exec --timeout`, `exec_in_world_sandbox timeoutMs` | default 60 s, at most 600 s | refused, not clamped; a start gets the sandbox ready, then waits for the command until 40 s have passed in all, and a command not done by then answers `running` with an `execId` (the CLIs wait again by themselves; `exec_in_world_sandbox` takes `execId` to wait); a timeout returns what it printed; a start whose getting ready took over 45 s is a 409 `sandbox_exec_deferred` with nothing started, its `warnings` saying what getting ready found (the CLIs start again and print them; what getting ready did is kept, a snapshot lay that failed too, so the next start is quick); a job whose runner died is a 409 `sandbox_exec_lost`, and a runner the sandbox cannot prepare a 503 `sandbox_exec_start_failed` (nothing started) |
|
|
55
60
|
| Sandbox tree at `check`/`commit`, `bench push` unpacked | 128 MB of source, 2000 files | refused, naming the limit, before a byte is read; move data to `worlds data import`, delete scratch files or list them in `.gatewayignore` |
|
|
56
61
|
| Sandbox tree at `check`/`commit`: credential-shaped files (`.env`, `*.pem`, `id_rsa`, `credentials.json`…; `.env.example` stays), symlinks, sockets/devices | held back, never in the version | listed under `ignored`, each named in `warnings` (path only); use `bench secrets set` for a key the world needs |
|
|
57
62
|
| `worlds data query` / `data sql` / `data show` on a stored version | none beyond the version's own caps | the platform opens the version's tree and snapshot in a prepared directory it owns; no size travels through the request |
|
package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/references/gotchas.md
CHANGED
|
@@ -14,6 +14,9 @@ The things that bite once and never again, moved out of `SKILL.md` to keep it un
|
|
|
14
14
|
- The World Host is the engine for every world, `[dependencies]` included (it opens each linked
|
|
15
15
|
world beside the root); a session never falls back to a slower engine, and a deployment
|
|
16
16
|
without a host refuses the open by name.
|
|
17
|
+
- A `[dependencies]` pin never resolves to an open edit, yours included: `@main` is the sealed
|
|
18
|
+
`main`, and a hash, semver or version id must name a sealed version. Seal the linked world's
|
|
19
|
+
edit (`gateway worlds edit close <slug>`) before you push the world that links it.
|
|
17
20
|
- Sharing is publish + clone, never a live reference; later edits reach a clone only on re-clone.
|
|
18
21
|
- Never commit `captures/`; never merge a customer's world as an SDK template.
|
|
19
22
|
- A seed (scenario overlay or runner admin endpoint) is the whole state, not an increment.
|
|
@@ -21,7 +24,17 @@ The things that bite once and never again, moved out of `SKILL.md` to keep it un
|
|
|
21
24
|
- A platform request that never gets an answer fails in one line: the request, the host, the cause
|
|
22
25
|
(`connection refused`, `DNS lookup failed`, `timed out after 120s`) and the next step, exit 1. Each
|
|
23
26
|
request waits `GATEWAY_TIMEOUT_MS` (default 120000); polls (session ready, grades) are many short
|
|
24
|
-
requests, so a long wait is never cut by it
|
|
27
|
+
requests, so a long wait is never cut by it; a sandbox `exec` waits in 40 s requests until its
|
|
28
|
+
command ends, and other sandbox requests (and MCP tool calls through either proxy) wait 290 s,
|
|
29
|
+
under Node's 300 s fetch limit, on both twins. An edge answer that is not the platform's JSON (an
|
|
30
|
+
HTML 502/503/504 from a load balancer) is named, never printed.
|
|
31
|
+
- A version that holds dot or root files and was committed, by any door but a directory push, before
|
|
32
|
+
the platform hashed every stored file carries a content hash over its archive files only. Deleting
|
|
33
|
+
its only dot or root file (a `.gatewayignore`, say) and changing nothing else is refused, naming the
|
|
34
|
+
version and the files: commit the deletion with another change, or put the file back. An unchanged
|
|
35
|
+
tree on such a version commits the same files under the new hash, and `check` and `commit` say so,
|
|
36
|
+
unless those files are ones a sandbox never commits (scratch such as `__pycache__/`, or `.env`):
|
|
37
|
+
then an untouched sandbox is refused until it carries another change.
|
|
25
38
|
|
|
26
39
|
- A world that declares an environment secret (`environment_secret_name` in `release/manifest.json`, or `${NAME:?}` in a task's `docker-compose.yaml`) is refused at `session open`
|
|
27
40
|
with 400 `missing_env_secrets` naming `gateway bench secrets set --env <slug> --key <NAME>` before
|
|
@@ -34,7 +47,27 @@ The things that bite once and never again, moved out of `SKILL.md` to keep it un
|
|
|
34
47
|
file then `schema compile .` and `schema check .` pass and the commit keeps the snapshot, no
|
|
35
48
|
re-import, and `gateway bench fork <slug>` takes the data with it. Adding an entity or a field
|
|
36
49
|
that is not required (or another `domain_version`) carries the data too: `sandbox check` says
|
|
37
|
-
the commit migrates the snapshot, and `sandbox commit` migrates it and re-pins the tree
|
|
50
|
+
the commit migrates the snapshot, and `sandbox commit` migrates it as a job and re-pins the tree:
|
|
51
|
+
the CLI follows the batch (each phase on stderr, up to `--wait` seconds) and prints the new
|
|
52
|
+
version, or exits 1 naming the refusal (`storage`, `timeout`, `checkout_cap`, `refused`,
|
|
53
|
+
`base_moved`); MCP `commit_world_sandbox` answers `{batchId}` to poll with `get_data_batch` when the
|
|
54
|
+
job outlasts its wait. While the batch runs, `commit` and `import` are refused
|
|
55
|
+
(`sandbox_commit_pending`); once it lands a sandbox used in the last 15 minutes takes the version
|
|
56
|
+
at once when none of the files it rewrites changed since the commit, else its next `commit`,
|
|
57
|
+
`import` or `exec` takes it and says what it found (`commit` and `import` say it on a refusal
|
|
58
|
+
too; `close` takes it silently), and `sandbox check` shows it first without writing anything. A `sandbox import` stands the sandbox on the data version it published, so
|
|
59
|
+
the next commit needs no `--rebase`; when another door moved `main`, `sandbox check` says
|
|
60
|
+
`baseMoved` and `--rebase` carries the edit and the imported rows onto the tip. A `--rebase` whose
|
|
61
|
+
base sits on an edit session still open, still closing, or stopped in conflict is
|
|
62
|
+
refused (`rebase_unrelated`) naming the session and what to do: close an open one (`edit close
|
|
63
|
+
<slug> --session <id>`), wait for one that is closing, and land one in conflict over `main`
|
|
64
|
+
(`edit close <slug> --session <id> --force`) or drop it (`edit discard <slug> --session <id>`);
|
|
65
|
+
then `--rebase` again. `worlds push` from a pulled tree keeps the snapshot for the edits that cannot touch a row, and refuses a domain
|
|
66
|
+
change, naming the sandbox: make that one there. No file is
|
|
67
|
+
deleted by hand: compile drops the `db/state.*` the tree's own data files built, which the pin
|
|
68
|
+
replaces, and check never refuses them. In the sandbox `data show|sql`, `worlds test` and
|
|
69
|
+
`worlds call` read the hosted rows, which the platform lays beside the tree (never in it) before
|
|
70
|
+
each `exec`, after taking a batch that landed; `exec`'s warnings say when it could not.
|
|
38
71
|
Removing, retyping or requiring a field, or changing a key, a relationship or a description, is
|
|
39
72
|
refused, naming what changed: keep it as it was, or remove `db/snapshot.json` and import every
|
|
40
73
|
row again. `check` reports
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
# Journal checks: verifiers over the requests a session's world received
|
|
2
|
+
|
|
3
|
+
A World Host session records every request its world receives, through every door: the api origin,
|
|
4
|
+
the page's `api_path` (ui) and a declared tool's call. Before a grade the platform waits until the
|
|
5
|
+
host has stored every request it holds for the session (the flush barrier), reads them back and
|
|
6
|
+
hands the grader those requests with whether they are all of them. Three ways to check them, one
|
|
7
|
+
implementation underneath: a declarative check, a `verify.py`, a SQL verifier.
|
|
8
|
+
|
|
9
|
+
Only the World Host records requests. A stored task whose checks read them is refused at validation
|
|
10
|
+
and at dispatch on any other engine, a run config included (`checks on the session's journal
|
|
11
|
+
(gateway_requests, calls, a python grader that reads it) need the World Host`). A local `worlds serve`
|
|
12
|
+
session reads `calls` from its own call log; there and in `benchmarks dry-run` the rest fails closed
|
|
13
|
+
as `not recorded`, whatever the grader accepts.
|
|
14
|
+
|
|
15
|
+
## What a grader reads
|
|
16
|
+
|
|
17
|
+
`gateway_requests`, one row per request, oldest first:
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{ "seq": 2, "id": "0a1b…", "at": "2026-10-05T12:00:01.000Z", "durationMs": 12.5,
|
|
21
|
+
"via": "api", "operation": "create_record", "method": "POST", "path": "/records",
|
|
22
|
+
"query": { "dry_run": "false" }, "rows": 1, "found": true,
|
|
23
|
+
"request": { "headers": { "content-type": "application/json" }, "body": { "name": "Acme" },
|
|
24
|
+
"bodyBytes": 16, "truncated": false, "contentType": "application/json" },
|
|
25
|
+
"response": { "status": 201, "body": { "id": "rec_1" }, "bodyBytes": 15, "truncated": false,
|
|
26
|
+
"contentType": "application/json" } }
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
- `via` is `api`, `ui` or `tool`; a tool call has no `method` or `path`.
|
|
30
|
+
- A JSON body reads as JSON, any other as text. Bodies are what the ledger stored: redacted when
|
|
31
|
+
captured, the first 64 KB (`truncated: true` past that). A request past the grade's budget (2,000
|
|
32
|
+
bodies, 8 MiB) carries `withheld: ["request.headers", "request.body", "response.body"]`.
|
|
33
|
+
- `gateway_journal` is the summary: `{ "complete": true, "reason": null, "requests": 4, "withheld": 0 }`.
|
|
34
|
+
`complete` is false when the host shed bodies or lost requests, did not answer the barrier, the
|
|
35
|
+
platform refused some, the session was reopened from a checkpoint or recovered after its worker or
|
|
36
|
+
host stopped, fewer requests remain than a past grade read, or the session holds more than 20,000;
|
|
37
|
+
`reason` says which. `withheld` counts the requests whose bodies the grade's budget left out.
|
|
38
|
+
- What a session's world was asked, to write a check against: `gateway worlds session requests
|
|
39
|
+
<SESSION_ID> --json` (MCP `list_world_requests`), or the `asked:` lines `task try` prints.
|
|
40
|
+
|
|
41
|
+
## 1. Declarative checks (`assertions`)
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
{ "kind": "assertions", "checks": [
|
|
45
|
+
{ "id": "created", "entity": "gateway_requests",
|
|
46
|
+
"where": { "operation": "create_record", "response.status": 201 } },
|
|
47
|
+
{ "id": "no_deletes", "entity": "gateway_requests", "where": { "method": "DELETE" }, "assert": "absent" },
|
|
48
|
+
{ "id": "one_create", "entity": "gateway_requests", "where": { "operation": "create_record" },
|
|
49
|
+
"assert": "count", "count": { "eq": 1 } },
|
|
50
|
+
{ "id": "looked_first", "entity": "gateway_requests", "where": { "operation": "get_record" },
|
|
51
|
+
"before": { "operation": "update_record" } },
|
|
52
|
+
{ "id": "named_acme", "entity": "gateway_requests", "where": { "operation": "create_record" },
|
|
53
|
+
"assert": "all", "field": "request.body.name", "value": "Acme" }
|
|
54
|
+
] }
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
- `where`, `field`, `before` and `after` name `seq`, `id`, `at`, `durationMs`, `via`, `operation`,
|
|
58
|
+
`method`, `path`, `rows`, `found`, `request.body`, `request.bodyBytes`, `request.truncated`,
|
|
59
|
+
`request.contentType`, `response.status`, `response.body`, `response.bodyBytes`,
|
|
60
|
+
`response.truncated`, `response.contentType`, or a path under `query.`, `request.headers.`,
|
|
61
|
+
`request.body.`, `response.body.`. Anything else is refused with the field it meant:
|
|
62
|
+
`gateway_requests has no field response.stauts; did you mean response.status?`.
|
|
63
|
+
- `before: {…}` keeps the requests before the first one it matches (all of them when none does);
|
|
64
|
+
`after: {…}` keeps the requests after the first one it matches (none when none does). They go on
|
|
65
|
+
`gateway_requests` and `calls` checks only.
|
|
66
|
+
- `entity: "calls"` on a World Host session is the call log's view of the same requests: every
|
|
67
|
+
door, tool calls included, with no bound (`operation`, `args`, `query`, `body`, `selectors`,
|
|
68
|
+
`via`, `status`, `rows`, `found`). A request no route took and a tool call the door refused stay
|
|
69
|
+
in `gateway_requests` only.
|
|
70
|
+
|
|
71
|
+
## 2. A `verify.py` that reads the journal
|
|
72
|
+
|
|
73
|
+
```json
|
|
74
|
+
{ "kind": "python", "readsJournal": true, "source": "<verify.py below>" }
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
```python
|
|
78
|
+
import json, sys
|
|
79
|
+
|
|
80
|
+
state = json.load(sys.stdin)
|
|
81
|
+
creates = [r for r in state["gateway_requests"]
|
|
82
|
+
if r["operation"] == "create_record" and r["response"]["status"] == 201]
|
|
83
|
+
print(json.dumps({"reward": 1 if len(creates) == 1 else 0, "one_create": len(creates) == 1}))
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Only a grader that declares `readsJournal: true` gets `gateway_requests` and `gateway_journal` on
|
|
87
|
+
stdin, beside the rows, `calls` and `report`. On an incomplete journal, or one whose bodies were
|
|
88
|
+
withheld, it scores 0 with the reason unless it also declares `acceptsIncompleteJournal: true`; then
|
|
89
|
+
it runs and reads `state["gateway_journal"]` itself (a body cut at 64 KB says `truncated: true`).
|
|
90
|
+
With no journal recorded at all it scores 0 either way.
|
|
91
|
+
|
|
92
|
+
## 3. A SQL verifier (`verifiers/<name>.sql`, a `[[tasks]]` world)
|
|
93
|
+
|
|
94
|
+
```sql
|
|
95
|
+
SELECT CASE WHEN COUNT(*) = 0 THEN 1.0 ELSE 0.0 END
|
|
96
|
+
FROM gateway_requests WHERE method = 'DELETE';
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
```sql
|
|
100
|
+
SELECT CASE WHEN COUNT(*) = 1 THEN 1.0 ELSE 0.0 END
|
|
101
|
+
FROM gateway_requests
|
|
102
|
+
WHERE operation = 'create_record' AND status = 201
|
|
103
|
+
AND json_extract(request_body, '$.name') = 'Acme';
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
`gateway_requests` columns: `seq, id, at, duration_ms, via, operation, method, path, query, status,
|
|
107
|
+
rows, found, request_headers, request_body, request_body_bytes, request_truncated,
|
|
108
|
+
request_content_type, response_body, response_body_bytes, response_truncated,
|
|
109
|
+
response_content_type, withheld` (query, headers and bodies are the stored text: read them with
|
|
110
|
+
`json_extract`). `gateway_journal(complete, reason, requests, withheld)`. A verifier that reads
|
|
111
|
+
either on an incomplete journal, or reads a body column while a body was withheld or cut at 64 KB,
|
|
112
|
+
scores 0, and the grade names why under `reasons`, unless `gateway-env.toml` lets it (a read counts
|
|
113
|
+
however the statement reaches the table, joins included):
|
|
114
|
+
|
|
115
|
+
```toml
|
|
116
|
+
[verifiers.created_at_least_once]
|
|
117
|
+
accepts_incomplete_journal = true
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Let only a check that a missing request can only make fail accept an incomplete journal: `COUNT(*) >
|
|
121
|
+
0`, not `= 0` or `= 1`, which pass on a journal that lost a request they count. No flag grades a
|
|
122
|
+
journal never recorded, nor a linked world's verifier that reads one: the session's journal is the
|
|
123
|
+
root world's.
|
|
124
|
+
|
|
125
|
+
An entity may not be named `gateway_…` (the compiler refuses it), so the names never collide.
|
|
126
|
+
|
|
127
|
+
## Fail closed
|
|
128
|
+
|
|
129
|
+
A check the stored requests do not decide fails and says why:
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
FAIL no_deletes — journal incomplete (the World Host lost 2 requests): the 4 requests it holds do not decide this check
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
A check they do decide still grades: `created` passes on an incomplete journal that holds the
|
|
136
|
+
request. Every World Host grade but a rubric's takes the barrier and records how complete the
|
|
137
|
+
journal was, so a later `try` or `regrade` of the session knows. A `calls` check on `args`, `body`
|
|
138
|
+
or `selectors` has the bodies fetched for it; one on `operation` or `status` alone does not need
|
|
139
|
+
them.
|
|
140
|
+
|
|
141
|
+
## Try, save, regrade
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
gateway worlds task try task.json --session <SESSION_ID> # a spec not saved yet; files nothing
|
|
145
|
+
gateway worlds task try <TASK_ID> --session <SESSION_ID> --version 3 --json
|
|
146
|
+
gateway worlds task update <TASK_ID> --spec task.json # save: the next version
|
|
147
|
+
gateway worlds task validate <TASK_ID>
|
|
148
|
+
gateway worlds task regrade <TASK_ID> # the task's latest run, whole, by the current version
|
|
149
|
+
gateway worlds task regrade <TASK_ID> --run <EVALUATION_ID> --version 3
|
|
150
|
+
gateway worlds task regrade <TASK_ID> --all-runs --limit 20
|
|
151
|
+
gateway worlds task regrade <TASK_ID> --session <SESSION_ID> # one rollout; its run then shows the versions it mixes
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
try the spec on session ses_01: graded live
|
|
156
|
+
journal: 4 requests, incomplete (the World Host lost 2 requests)
|
|
157
|
+
PASS created — matched #2 api POST create_record 201 (+1 more)
|
|
158
|
+
FAIL no_deletes — journal incomplete (the World Host lost 2 requests): the 4 requests it holds do not decide this check
|
|
159
|
+
reward 0.5
|
|
160
|
+
asked:
|
|
161
|
+
1x api GET list_records 200 /records
|
|
162
|
+
2x api POST create_record 201 /records
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
`try` grades a live session in place, and a closed one on an ephemeral copy restored from the
|
|
166
|
+
checkpoint its last grade took, over the requests that grade read. A session no grade checkpointed
|
|
167
|
+
refuses checks over rows; checks over `gateway_requests` and `calls` still run. A check on an entity
|
|
168
|
+
the session's world does not define is refused, as an open refuses it.
|
|
169
|
+
|
|
170
|
+
`regrade` grades each rollout's session the way `try` does and replaces the rollout's grade in
|
|
171
|
+
place: the grade it held moves to `info.grades`, `info.verifierVersion` names the version that
|
|
172
|
+
graded it, and the run's metrics and label (`verifier v3`, or `verifiers v2, v3` for a mixed run)
|
|
173
|
+
follow. A release gate reads the new rewards on its next read. Exit 1 when nothing was regraded, a
|
|
174
|
+
rollout kept its grade (already graded by that version, so a rerun adds no history; no checkpoint
|
|
175
|
+
for a check over rows) or a rollout was regraded to no score (`--json` holds its reasons). A run or
|
|
176
|
+
session that is not the task's is refused. A task over several worlds is not regraded, and `try` on
|
|
177
|
+
one of its sessions grades that world's own grader, not the cross-world verifiers.
|
|
178
|
+
|
|
179
|
+
| CLI | MCP | REST | SDK |
|
|
180
|
+
| --- | --- | --- | --- |
|
|
181
|
+
| `worlds task try` | `try_world_task({ sessionId, taskId \| spec, version? })` (MEMBER and above: it runs your verify.py) | `POST /api/public/world-tasks/try` | `new TaskGrades(opts).try(sessionId, target)` / `TaskGrades().try_task(session_id, task_id=… \| spec=…)` |
|
|
182
|
+
| `worlds task regrade` | `regrade_world_task({ taskId, version?, runs?, allRuns?, sessions?, limit? })` | `POST /api/public/world-tasks/{taskId}/regrade` | `.regrade(taskId, scope)` / `.regrade(task_id, …)` |
|