reeval-python 0.17.2__py3-none-any.whl → 0.19.0__py3-none-any.whl

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.
reeval_python/__init__.py CHANGED
@@ -1,7 +1,7 @@
1
1
  """Python eval authoring API for reeval (*.eval.py)."""
2
2
 
3
3
  from reeval_python.context import AttemptContext, SyncAttemptContext
4
- from reeval_python.declare import evaluate, evaluate_each, group, todo
4
+ from reeval_python.declare import evaluate, group, todo
5
5
  from reeval_python.environment import (
6
6
  DEFAULT_EGRESS_ALLOW,
7
7
  DockerSandbox,
@@ -10,15 +10,23 @@ from reeval_python.environment import (
10
10
  FakeJudge,
11
11
  Plugin,
12
12
  PluginBuild,
13
+ TartSandbox,
13
14
  define_environment,
14
15
  docker,
15
16
  fake_harness,
16
17
  fake_judge,
17
18
  plugin,
19
+ tart,
18
20
  )
19
21
  from reeval_python.errors import ReevalAssertionError, ReevalCallError
20
22
  from reeval_python.expect import Expectation, expect
21
- from reeval_python.options import BestOf, EvalOptions, JudgeDefaults, JudgeOptions
23
+ from reeval_python.options import (
24
+ BestOf,
25
+ CaseOptions,
26
+ EvalOptions,
27
+ JudgeDefaults,
28
+ JudgeOptions,
29
+ )
22
30
  from reeval_python.types import BackgroundHandle, Diff, ExecResult, FileChange, Turn, Verdict
23
31
 
24
32
  __all__ = [
@@ -29,6 +37,7 @@ __all__ = [
29
37
  "Diff",
30
38
  "DockerSandbox",
31
39
  "Environment",
40
+ "CaseOptions",
32
41
  "EvalOptions",
33
42
  "ExecResult",
34
43
  "Expectation",
@@ -42,16 +51,17 @@ __all__ = [
42
51
  "ReevalAssertionError",
43
52
  "ReevalCallError",
44
53
  "SyncAttemptContext",
54
+ "TartSandbox",
45
55
  "Turn",
46
56
  "Verdict",
47
57
  "define_environment",
48
58
  "docker",
49
59
  "evaluate",
50
- "evaluate_each",
51
60
  "expect",
52
61
  "fake_harness",
53
62
  "fake_judge",
54
63
  "group",
55
64
  "plugin",
65
+ "tart",
56
66
  "todo",
57
67
  ]
reeval_python/_wire.py CHANGED
@@ -158,6 +158,16 @@ class AttemptCallWriteFile(TypedDict):
158
158
  path: str
159
159
 
160
160
 
161
+ # `c.observe(name, value)`: records a fact about the attempt that never affects its outcome. A
162
+ # name observed again keeps the last value. Fails after the body's `done`.
163
+ class AttemptCallObserve(TypedDict):
164
+ # What the value is of, e.g. `installed`.
165
+ name: str
166
+ op: Literal["observe"]
167
+ # Any JSON, at most 4 KB once serialized.
168
+ value: JSONValue
169
+
170
+
161
171
  # Where the eval made the call, which the record names beside the check's outcome.
162
172
  class AttemptCallExpectAt(TypedDict):
163
173
  # The eval file: absolute, or relative to the project root.
@@ -232,7 +242,7 @@ class AttemptCallJudge(TypedDict):
232
242
 
233
243
  # One call an eval's body makes on its attempt. The sandbox and the agent session start on the
234
244
  # first call that needs them; there's no call to start them.
235
- AttemptCall: TypeAlias = "AttemptCallSend | AttemptCallExec | AttemptCallServe | AttemptCallKill | AttemptCallCapture | AttemptCallReadFile | AttemptCallWriteFile | AttemptCallExpect | AttemptCallRecord | AttemptCallJudge"
245
+ AttemptCall: TypeAlias = "AttemptCallSend | AttemptCallExec | AttemptCallServe | AttemptCallKill | AttemptCallCapture | AttemptCallReadFile | AttemptCallWriteFile | AttemptCallObserve | AttemptCallExpect | AttemptCallRecord | AttemptCallJudge"
236
246
 
237
247
 
238
248
  # The runner to reeval: the eval's body has finished. The attempt's checks and record follow.
@@ -313,6 +323,13 @@ class AttemptReplyWriteFile(TypedDict):
313
323
  op: Literal["writeFile"]
314
324
 
315
325
 
326
+ class AttemptReplyObserve(TypedDict):
327
+ # Pairs a reply with its request.
328
+ id: str
329
+ ok: Literal[True]
330
+ op: Literal["observe"]
331
+
332
+
316
333
  class AttemptReplyExpect(TypedDict):
317
334
  assertion: AssertionRecord
318
335
  # Pairs a reply with its request.
@@ -352,12 +369,12 @@ class AttemptReplyError(TypedDict):
352
369
  # Pairs a reply with its request.
353
370
  id: str
354
371
  ok: Literal[False]
355
- op: Literal["send", "exec", "readFile", "writeFile", "expect", "record", "judge", "serve", "kill", "capture"]
372
+ op: Literal["send", "exec", "readFile", "writeFile", "observe", "expect", "record", "judge", "serve", "kill", "capture"]
356
373
 
357
374
 
358
375
  # reeval's reply to a call: its result, or the error it threw. A failed matcher is a result (its
359
376
  # record says `fail`), not an error, unless the matcher couldn't run.
360
- AttemptReply: TypeAlias = "AttemptReplySend | AttemptReplyExec | AttemptReplyServe | AttemptReplyKill | AttemptReplyCapture | AttemptReplyReadFile | AttemptReplyWriteFile | AttemptReplyExpect | AttemptReplyRecord | AttemptReplyJudge | AttemptReplyExpect2 | AttemptReplyError"
377
+ AttemptReply: TypeAlias = "AttemptReplySend | AttemptReplyExec | AttemptReplyServe | AttemptReplyKill | AttemptReplyCapture | AttemptReplyReadFile | AttemptReplyWriteFile | AttemptReplyObserve | AttemptReplyExpect | AttemptReplyRecord | AttemptReplyJudge | AttemptReplyExpect2 | AttemptReplyError"
361
378
 
362
379
 
363
380
  # A call, numbered so its reply can find it.
@@ -388,6 +405,42 @@ class AttemptStart(TypedDict):
388
405
  type: Literal["start"]
389
406
 
390
407
 
408
+ # The host variable holding a Boat API key, made by `secret.fromEnv`.
409
+ BoatApiKey = TypedDict(
410
+ "BoatApiKey",
411
+ {
412
+ "from": "str",
413
+ "kind": "Literal[\"secret\"]",
414
+ },
415
+ )
416
+
417
+
418
+ # The host variable with the Boat API key, read on the host only.
419
+ BoatSandboxDescriptorApiKey = TypedDict(
420
+ "BoatSandboxDescriptorApiKey",
421
+ {
422
+ "from": "str",
423
+ "kind": "Literal[\"secret\"]",
424
+ },
425
+ )
426
+
427
+
428
+ # A boat.dev VM per attempt, made by `boat()` from `reeval/sandbox/boat`.
429
+ class BoatSandboxDescriptor(TypedDict):
430
+ # The host variable with the Boat API key, read on the host only.
431
+ apiKey: BoatSandboxDescriptorApiKey
432
+ # Cell id; defaults to `boat`, or `boat:<type>` with a `type`.
433
+ id: NotRequired[str]
434
+ kind: Literal["boat"]
435
+ # The most Boat sandboxes at once, across the run.
436
+ maxConcurrent: NotRequired[float]
437
+ # The start of every sandbox name reeval gives Boat, so a run's cleanup finds only its own:
438
+ # lowercase letters, digits and dashes.
439
+ prefix: str
440
+ # The machine size. Default `small`.
441
+ type: NotRequired[Literal["small", "default", "large", "xlarge"]]
442
+
443
+
391
444
  class CaptureConsoleItem(TypedDict):
392
445
  level: Literal["error", "warning", "info", "log", "debug"]
393
446
  source: str
@@ -491,9 +544,8 @@ class CaptureWindow(TypedDict):
491
544
 
492
545
 
493
546
  # A cell of an evaluation combines a harness, an environment (`-` when none is set), and that
494
- # environment's sandbox id. With `compare`, the control is `baseline` (or the cascaded
495
- # environment, or an empty `baseline`) and each variant is that environment on its own,
496
- # including its sandbox.
547
+ # environment's sandbox id. With `compare`, the control is `compare.control` and each variant is
548
+ # that environment on its own, including its sandbox.
497
549
  class Cell(TypedDict):
498
550
  # The environment's own name, also on a variant cell (`with-skill`, with no prefix).
499
551
  environment: str
@@ -502,6 +554,9 @@ class Cell(TypedDict):
502
554
  harness: str
503
555
  # The harness id, the environment name, and the sandbox id, joined with `/`.
504
556
  key: str
557
+ # `variant` on a compare's variant cell, else `control`: the compare's control, or any cell
558
+ # of an eval without `compare`, each environment of an `environments` grid included. A
559
+ # variant's lift is against the `control` cell on its harness and sandbox.
505
560
  role: CellRole
506
561
  # The sandbox id is `id` when set, or `fake` for the fake sandbox. A Docker sandbox starts
507
562
  # with the engine (`docker` by default). It adds `:` and the sanitized final component of
@@ -509,6 +564,8 @@ class Cell(TypedDict):
509
564
  # when that filename is `Dockerfile` and a parent is present). Non-empty `install` steps
510
565
  # append `+` and an eight-character hash.
511
566
  sandbox: str
567
+ # The environment's merged traits; unset when it has none. Not part of the key.
568
+ traits: NotRequired[dict[str, str | list[str]]]
512
569
  # The variant's name, for variant cells.
513
570
  variant: NotRequired[str]
514
571
 
@@ -612,10 +669,10 @@ class DeclarationTree(TypedDict):
612
669
  class DeclaredEval(TypedDict):
613
670
  # Names the eval's body to whoever runs it.
614
671
  body: str
615
- # Set on each case of a pooled `evaluate.each`: its template, index and the list's length.
672
+ # Set on each case of an eval with `cases`: its template, index and the list's length.
616
673
  family: NotRequired[DeclaredFamily]
617
674
  mode: DeclaredMode
618
- # The eval's name, as passed to `evaluate` (a case's, for `evaluate.each`).
675
+ # The eval's name, as passed to `evaluate` (a case's, for an eval with `cases`).
619
676
  name: str
620
677
  # The eval's own options, before the cascade.
621
678
  options: EvalOptionsData
@@ -623,13 +680,13 @@ class DeclaredEval(TypedDict):
623
680
  type: Literal["eval"]
624
681
 
625
682
 
626
- # Where a case of a pooled `evaluate.each` sits in its list.
683
+ # Where a case of an eval with `cases` sits in its list.
627
684
  class DeclaredFamily(TypedDict):
628
685
  # The case's index, from 0.
629
686
  case: int
630
687
  # How many cases the list has.
631
688
  cases: int
632
- # The name template passed to `evaluate.each`.
689
+ # The eval's own name, which each case's name extends.
633
690
  name: str
634
691
 
635
692
 
@@ -652,14 +709,14 @@ DeclaredMode: TypeAlias = "Literal[\"run\", \"skip\", \"only\"]"
652
709
  DeclaredNode: TypeAlias = "DeclaredEval | DeclaredGroup | DeclaredTodo"
653
710
 
654
711
 
655
- # An eval's own source, hashed by the SDK that declared it: sha256 (hex) of its body's source
656
- # text, and of an `evaluate.each` case's data as canonical JSON (object keys sorted, no
657
- # whitespace, non-ASCII characters as themselves).
712
+ # An eval's own source as the SDK that declared it reads it: sha256 (hex) of its body's source
713
+ # text, and a case's data as canonical JSON (object keys sorted, no whitespace, non-ASCII
714
+ # characters as themselves). reeval hashes the case itself, with its secrets masked.
658
715
  class DeclaredSource(TypedDict):
659
716
  # sha256 of the body function's source text.
660
717
  body: str
661
- # sha256 of the case's data; set on each case of an `evaluate.each`.
662
- case: NotRequired[str]
718
+ # The case's data as canonical JSON text; set on each case of an eval with `cases`.
719
+ caseJson: NotRequired[str]
663
720
 
664
721
 
665
722
  # `evaluate.todo` or `group.todo`.
@@ -771,17 +828,25 @@ class EnvironmentSpec(TypedDict):
771
828
  setup: NotRequired[list[SetupStep]]
772
829
  # Skills placed for the agent.
773
830
  skills: NotRequired[list[SkillSource]]
831
+ # Filter facts for `where`, such as `{ stack: 'next' }`: a key to a string or a list of
832
+ # strings. A child's key replaces its parent's value whole; keys it doesn't set are
833
+ # inherited. Recorded on the cell, and never written to the sandbox, the prompt or the
834
+ # judge.
835
+ traits: NotRequired[dict[str, str | list[str]]]
774
836
  # The code the workspace starts as, before `files`, `rules` and `setup`; a child's replaces
775
837
  # its parent's.
776
838
  workspace: NotRequired[GitWorkspace]
777
839
 
778
840
 
779
- # Environments to run side by side against `environment`, the control.
841
+ # Environments to run side by side; `control` is what each variant is measured against.
780
842
  class EvalOptionsDataCompareCompare(TypedDict):
781
- # Which cells decide pass/fail: `variants` (default), `all`, or `none` (report only).
782
- gate: NotRequired[Literal["all", "none", "variants"]]
843
+ # The environment each variant is measured against. Not layered under the variants, and it
844
+ # replaces any `environments` the eval inherits.
845
+ control: EnvironmentData
846
+ # Which cells decide pass/fail: `variants` (default), `all`, or `observe` (none of them).
847
+ gate: NotRequired[Literal["all", "observe", "variants"]]
783
848
  # Harnesses (ids or descriptors) to compare on; the others run the control only.
784
- harness: NotRequired[list[AntigravityHarnessDescriptor | ClaudeCodeHarnessDescriptor | CodexHarnessDescriptor | CursorHarnessDescriptor | FakeHarnessDescriptor | FxHarnessDescriptor | GooseHarnessDescriptor | GrokBuildHarnessDescriptor | OpenCodeHarnessDescriptor | PiHarnessDescriptor | str]]
849
+ harnesses: NotRequired[list[AntigravityHarnessDescriptor | ClaudeCodeHarnessDescriptor | CodexHarnessDescriptor | CursorHarnessDescriptor | FakeHarnessDescriptor | FxHarnessDescriptor | GooseHarnessDescriptor | GrokBuildHarnessDescriptor | OpenCodeHarnessDescriptor | PiHarnessDescriptor | str]]
785
850
  # Lift in points from -1 to 1; a variant cell below it fails.
786
851
  minLift: NotRequired[float]
787
852
  # Other environments, each planned and run as itself.
@@ -796,11 +861,11 @@ class EvalOptionsDataCompareGatePassRate(TypedDict):
796
861
  passRate: float
797
862
 
798
863
 
799
- class EvalOptionsDataCompareHarnessAdd(TypedDict):
864
+ class EvalOptionsDataCompareHarnessesAdd(TypedDict):
800
865
  add: AntigravityHarnessDescriptor | ClaudeCodeHarnessDescriptor | CodexHarnessDescriptor | CursorHarnessDescriptor | FakeHarnessDescriptor | FxHarnessDescriptor | GooseHarnessDescriptor | GrokBuildHarnessDescriptor | OpenCodeHarnessDescriptor | PiHarnessDescriptor | list[HarnessDescriptor]
801
866
 
802
867
 
803
- class EvalOptionsDataCompareHarnessOnly(TypedDict):
868
+ class EvalOptionsDataCompareHarnessesOnly(TypedDict):
804
869
  only: list[str] | str
805
870
 
806
871
 
@@ -812,19 +877,17 @@ class EvalOptionsDataCompare(TypedDict):
812
877
  # Screenshot defaults for `c.capture()`. Shallow-merged; `viewport` and `model` replace the
813
878
  # value.
814
879
  capture: NotRequired[CaptureOptions]
815
- # Environments to run side by side against `environment`, the control.
880
+ # Environments to run side by side; `control` is what each variant is measured against.
816
881
  compare: EvalOptionsDataCompareCompare
817
882
  # Where the sandbox may connect. Replaces the inherited policy: config, profile defaults,
818
883
  # the environment, then groups and the eval.
819
884
  egress: NotRequired[Literal["allow-all", "deny-all", "proxy"] | EvalOptionsDataCompareEgressAllow]
820
885
  # Variables and secrets for the sandbox, merged by name down the cascade.
821
886
  env: NotRequired[EnvVars]
822
- # The control: the compare has no `baseline`.
823
- environment: NotRequired[EnvironmentData]
824
887
  # How each cell's attempts decide its outcome; default `'all'`.
825
- gate: NotRequired[Literal["all"] | EvalOptionsDataCompareGatePassRate]
888
+ gate: NotRequired[Literal["all", "observe"] | EvalOptionsDataCompareGatePassRate]
826
889
  # Which agents run the eval; each harness is its own cell.
827
- harness: NotRequired[AntigravityHarnessDescriptor | ClaudeCodeHarnessDescriptor | CodexHarnessDescriptor | CursorHarnessDescriptor | FakeHarnessDescriptor | FxHarnessDescriptor | GooseHarnessDescriptor | GrokBuildHarnessDescriptor | OpenCodeHarnessDescriptor | PiHarnessDescriptor | list[HarnessDescriptor] | EvalOptionsDataCompareHarnessAdd | EvalOptionsDataCompareHarnessOnly]
890
+ harnesses: NotRequired[AntigravityHarnessDescriptor | ClaudeCodeHarnessDescriptor | CodexHarnessDescriptor | CursorHarnessDescriptor | FakeHarnessDescriptor | FxHarnessDescriptor | GooseHarnessDescriptor | GrokBuildHarnessDescriptor | OpenCodeHarnessDescriptor | PiHarnessDescriptor | list[HarnessDescriptor] | EvalOptionsDataCompareHarnessesAdd | EvalOptionsDataCompareHarnessesOnly]
828
891
  # Defaults for `c.judge()`, merged field by field down the cascade.
829
892
  judge: NotRequired[ConfigJudgeOptions]
830
893
  # Keys a profile's `limit` may not narrow for this group or eval.
@@ -843,11 +906,11 @@ class EvalOptionsDataCompare(TypedDict):
843
906
  # Attempts per cell: a number, or `{ bestOf: n }` (odd, 3 or more), which stops each cell
844
907
  # once a majority of its `n` attempts agree and gates it on that majority; not on a compared
845
908
  # eval. Unset at every level, a compare with variants runs 4 a side, the fewest whose lift
846
- # can reach a verdict, and anything else runs once, a pooled `evaluate.each` case included.
909
+ # can reach a verdict, and anything else runs once, a case of an eval with `cases` included.
847
910
  runs: NotRequired[float | EvalOptionsDataCompareRunsBestOf]
848
911
  # The default machine when the resolved environment omits `sandbox`. Cascades like
849
- # `harness`. Not an environment: it does not invent skills, files or a name.
850
- sandbox: NotRequired[DockerSandboxDescriptor | FakeSandboxDescriptor]
912
+ # `harnesses`. Not an environment: it does not invent skills, files or a name.
913
+ sandbox: NotRequired[BoatSandboxDescriptor | DockerSandboxDescriptor | FakeSandboxDescriptor | TartSandboxDescriptor]
851
914
  # When each attempt's workspace is copied into its directory in `.reeval/runs`: `true` after
852
915
  # the checks, `'turns'` after each `c.send` too, `false` never. Default `true`.
853
916
  snapshot: NotRequired[SnapshotOptions | Literal["turns"] | bool]
@@ -857,124 +920,50 @@ class EvalOptionsDataCompare(TypedDict):
857
920
  timeout: NotRequired[float | str]
858
921
 
859
922
 
860
- # Environments to run side by side; `baseline` is the control.
861
- class EvalOptionsDataCompare2Compare(TypedDict):
862
- # The control. Not layered under the variants. Without it, the control is the environment
863
- # the eval would otherwise run in (the cascaded `environment`), else an empty one named
864
- # `baseline`.
865
- baseline: EnvironmentData
866
- # Which cells decide pass/fail: `variants` (default), `all`, or `none` (report only).
867
- gate: NotRequired[Literal["all", "none", "variants"]]
868
- # Harnesses (ids or descriptors) to compare on; the others run the control only.
869
- harness: NotRequired[list[AntigravityHarnessDescriptor | ClaudeCodeHarnessDescriptor | CodexHarnessDescriptor | CursorHarnessDescriptor | FakeHarnessDescriptor | FxHarnessDescriptor | GooseHarnessDescriptor | GrokBuildHarnessDescriptor | OpenCodeHarnessDescriptor | PiHarnessDescriptor | str]]
870
- # Lift in points from -1 to 1; a variant cell below it fails.
871
- minLift: NotRequired[float]
872
- # Other environments, each planned and run as itself.
873
- variants: list[EnvironmentData]
874
-
875
-
876
- class EvalOptionsDataCompare2EgressAllow(TypedDict):
923
+ class EvalOptionsData2EgressAllow(TypedDict):
877
924
  allow: list[str]
878
925
 
879
926
 
880
- class EvalOptionsDataCompare2GatePassRate(TypedDict):
881
- passRate: float
882
-
883
-
884
- class EvalOptionsDataCompare2HarnessAdd(TypedDict):
885
- add: AntigravityHarnessDescriptor | ClaudeCodeHarnessDescriptor | CodexHarnessDescriptor | CursorHarnessDescriptor | FakeHarnessDescriptor | FxHarnessDescriptor | GooseHarnessDescriptor | GrokBuildHarnessDescriptor | OpenCodeHarnessDescriptor | PiHarnessDescriptor | list[HarnessDescriptor]
927
+ class EvalOptionsData2EnvironmentsAdd(TypedDict):
928
+ add: EnvironmentData | list[EnvironmentData]
886
929
 
887
930
 
888
- class EvalOptionsDataCompare2HarnessOnly(TypedDict):
931
+ class EvalOptionsData2EnvironmentsOnly(TypedDict):
889
932
  only: list[str] | str
890
933
 
891
934
 
892
- class EvalOptionsDataCompare2RunsBestOf(TypedDict):
893
- bestOf: float
894
-
895
-
896
- class EvalOptionsDataCompare2(TypedDict):
897
- # Screenshot defaults for `c.capture()`. Shallow-merged; `viewport` and `model` replace the
898
- # value.
899
- capture: NotRequired[CaptureOptions]
900
- # Environments to run side by side; `baseline` is the control.
901
- compare: EvalOptionsDataCompare2Compare
902
- # Where the sandbox may connect. Replaces the inherited policy: config, profile defaults,
903
- # the environment, then groups and the eval.
904
- egress: NotRequired[Literal["allow-all", "deny-all", "proxy"] | EvalOptionsDataCompare2EgressAllow]
905
- # Variables and secrets for the sandbox, merged by name down the cascade.
906
- env: NotRequired[EnvVars]
907
- # How each cell's attempts decide its outcome; default `'all'`.
908
- gate: NotRequired[Literal["all"] | EvalOptionsDataCompare2GatePassRate]
909
- # Which agents run the eval; each harness is its own cell.
910
- harness: NotRequired[AntigravityHarnessDescriptor | ClaudeCodeHarnessDescriptor | CodexHarnessDescriptor | CursorHarnessDescriptor | FakeHarnessDescriptor | FxHarnessDescriptor | GooseHarnessDescriptor | GrokBuildHarnessDescriptor | OpenCodeHarnessDescriptor | PiHarnessDescriptor | list[HarnessDescriptor] | EvalOptionsDataCompare2HarnessAdd | EvalOptionsDataCompare2HarnessOnly]
911
- # Defaults for `c.judge()`, merged field by field down the cascade.
912
- judge: NotRequired[ConfigJudgeOptions]
913
- # Keys a profile's `limit` may not narrow for this group or eval.
914
- pin: NotRequired[list[PinnableKey]]
915
- # The model every question that names none of its own is answered by, down the cascade.
916
- question: NotRequired[QuestionOptions]
917
- # What a language model is asked about the attempts, always a list; they never change pass,
918
- # fail or the exit code. A question with `across` picks between pairs of attempts once they
919
- # all end; one without is asked of each attempt as it ends. Replaces the inherited list, so
920
- # `[]` asks none.
921
- questions: NotRequired[list[Question]]
922
- # The eval's version, part of its fingerprint: bump it when a change the eval file doesn't
923
- # show (a helper, a fixture, data it reads) changes what it measures. A group's applies to
924
- # the evals inside it that set none.
925
- revision: NotRequired[float | str]
926
- # Attempts per cell: a number, or `{ bestOf: n }` (odd, 3 or more), which stops each cell
927
- # once a majority of its `n` attempts agree and gates it on that majority; not on a compared
928
- # eval. Unset at every level, a compare with variants runs 4 a side, the fewest whose lift
929
- # can reach a verdict, and anything else runs once, a pooled `evaluate.each` case included.
930
- runs: NotRequired[float | EvalOptionsDataCompare2RunsBestOf]
931
- # The default machine when the resolved environment omits `sandbox`. Cascades like
932
- # `harness`. Not an environment: it does not invent skills, files or a name.
933
- sandbox: NotRequired[DockerSandboxDescriptor | FakeSandboxDescriptor]
934
- # When each attempt's workspace is copied into its directory in `.reeval/runs`: `true` after
935
- # the checks, `'turns'` after each `c.send` too, `false` never. Default `true`.
936
- snapshot: NotRequired[SnapshotOptions | Literal["turns"] | bool]
937
- # Labels for `--tag` and profiles to select by; a group's are added to its evals'.
938
- tags: NotRequired[list[str]]
939
- # Per attempt.
940
- timeout: NotRequired[float | str]
941
-
942
-
943
- class EvalOptionsData3EgressAllow(TypedDict):
944
- allow: list[str]
945
-
946
-
947
- class EvalOptionsData3GatePassRate(TypedDict):
935
+ class EvalOptionsData2GatePassRate(TypedDict):
948
936
  passRate: float
949
937
 
950
938
 
951
- class EvalOptionsData3HarnessAdd(TypedDict):
939
+ class EvalOptionsData2HarnessesAdd(TypedDict):
952
940
  add: AntigravityHarnessDescriptor | ClaudeCodeHarnessDescriptor | CodexHarnessDescriptor | CursorHarnessDescriptor | FakeHarnessDescriptor | FxHarnessDescriptor | GooseHarnessDescriptor | GrokBuildHarnessDescriptor | OpenCodeHarnessDescriptor | PiHarnessDescriptor | list[HarnessDescriptor]
953
941
 
954
942
 
955
- class EvalOptionsData3HarnessOnly(TypedDict):
943
+ class EvalOptionsData2HarnessesOnly(TypedDict):
956
944
  only: list[str] | str
957
945
 
958
946
 
959
- class EvalOptionsData3RunsBestOf(TypedDict):
947
+ class EvalOptionsData2RunsBestOf(TypedDict):
960
948
  bestOf: float
961
949
 
962
950
 
963
- class EvalOptionsData3(TypedDict):
951
+ class EvalOptionsData2(TypedDict):
964
952
  # Screenshot defaults for `c.capture()`. Shallow-merged; `viewport` and `model` replace the
965
953
  # value.
966
954
  capture: NotRequired[CaptureOptions]
967
955
  # Where the sandbox may connect. Replaces the inherited policy: config, profile defaults,
968
956
  # the environment, then groups and the eval.
969
- egress: NotRequired[Literal["allow-all", "deny-all", "proxy"] | EvalOptionsData3EgressAllow]
957
+ egress: NotRequired[Literal["allow-all", "deny-all", "proxy"] | EvalOptionsData2EgressAllow]
970
958
  # Variables and secrets for the sandbox, merged by name down the cascade.
971
959
  env: NotRequired[EnvVars]
972
- # What this group or eval runs in, and the control of a compare without a `baseline`.
973
- environment: NotRequired[EnvironmentData]
960
+ # What this group or eval runs in: one environment, or a list, each its own cell beside each
961
+ # harness. `{ add }` and `{ only }` edit the inherited list.
962
+ environments: NotRequired[EnvironmentData | list[EnvironmentData] | EvalOptionsData2EnvironmentsAdd | EvalOptionsData2EnvironmentsOnly]
974
963
  # How each cell's attempts decide its outcome; default `'all'`.
975
- gate: NotRequired[Literal["all"] | EvalOptionsData3GatePassRate]
964
+ gate: NotRequired[Literal["all", "observe"] | EvalOptionsData2GatePassRate]
976
965
  # Which agents run the eval; each harness is its own cell.
977
- harness: NotRequired[AntigravityHarnessDescriptor | ClaudeCodeHarnessDescriptor | CodexHarnessDescriptor | CursorHarnessDescriptor | FakeHarnessDescriptor | FxHarnessDescriptor | GooseHarnessDescriptor | GrokBuildHarnessDescriptor | OpenCodeHarnessDescriptor | PiHarnessDescriptor | list[HarnessDescriptor] | EvalOptionsData3HarnessAdd | EvalOptionsData3HarnessOnly]
966
+ harnesses: NotRequired[AntigravityHarnessDescriptor | ClaudeCodeHarnessDescriptor | CodexHarnessDescriptor | CursorHarnessDescriptor | FakeHarnessDescriptor | FxHarnessDescriptor | GooseHarnessDescriptor | GrokBuildHarnessDescriptor | OpenCodeHarnessDescriptor | PiHarnessDescriptor | list[HarnessDescriptor] | EvalOptionsData2HarnessesAdd | EvalOptionsData2HarnessesOnly]
978
967
  # Defaults for `c.judge()`, merged field by field down the cascade.
979
968
  judge: NotRequired[ConfigJudgeOptions]
980
969
  # Keys a profile's `limit` may not narrow for this group or eval.
@@ -993,11 +982,11 @@ class EvalOptionsData3(TypedDict):
993
982
  # Attempts per cell: a number, or `{ bestOf: n }` (odd, 3 or more), which stops each cell
994
983
  # once a majority of its `n` attempts agree and gates it on that majority; not on a compared
995
984
  # eval. Unset at every level, a compare with variants runs 4 a side, the fewest whose lift
996
- # can reach a verdict, and anything else runs once, a pooled `evaluate.each` case included.
997
- runs: NotRequired[float | EvalOptionsData3RunsBestOf]
985
+ # can reach a verdict, and anything else runs once, a case of an eval with `cases` included.
986
+ runs: NotRequired[float | EvalOptionsData2RunsBestOf]
998
987
  # The default machine when the resolved environment omits `sandbox`. Cascades like
999
- # `harness`. Not an environment: it does not invent skills, files or a name.
1000
- sandbox: NotRequired[DockerSandboxDescriptor | FakeSandboxDescriptor]
988
+ # `harnesses`. Not an environment: it does not invent skills, files or a name.
989
+ sandbox: NotRequired[BoatSandboxDescriptor | DockerSandboxDescriptor | FakeSandboxDescriptor | TartSandboxDescriptor]
1001
990
  # When each attempt's workspace is copied into its directory in `.reeval/runs`: `true` after
1002
991
  # the checks, `'turns'` after each `c.send` too, `false` never. Default `true`.
1003
992
  snapshot: NotRequired[SnapshotOptions | Literal["turns"] | bool]
@@ -1010,7 +999,7 @@ class EvalOptionsData3(TypedDict):
1010
999
  # `EvalOptions` in their data forms, as JSON carries them: the harness as data, the judge's
1011
1000
  # model by name or a fake judge, and environments without `extend`. The same `environment` /
1012
1001
  # compare object split as `EvalOptions`.
1013
- EvalOptionsData: TypeAlias = "EvalOptionsDataCompare | EvalOptionsDataCompare2 | EvalOptionsData3"
1002
+ EvalOptionsData: TypeAlias = "EvalOptionsDataCompare | EvalOptionsData2"
1014
1003
 
1015
1004
 
1016
1005
  class ExecResult(TypedDict):
@@ -1026,6 +1015,15 @@ class FakeHarnessDescriptorToolsItem(TypedDict):
1026
1015
  tool: str
1027
1016
 
1028
1017
 
1018
+ # Tokens the fake agent reports for every turn, as `turn.usage`; without it, null.
1019
+ class FakeHarnessDescriptorUsage(TypedDict):
1020
+ cacheRead: float
1021
+ cacheWrite: float
1022
+ input: float
1023
+ output: float
1024
+ reasoning: float | None
1025
+
1026
+
1029
1027
  # Files and message used instead when the environment gives the agent a skill.
1030
1028
  class FakeHarnessDescriptorWithSkill(TypedDict):
1031
1029
  files: NotRequired[dict[str, str]]
@@ -1088,6 +1086,11 @@ class FakeHarnessDescriptor(TypedDict):
1088
1086
  # Tool calls the fake agent reports on every turn, before writing files. `ok` defaults to
1089
1087
  # true; null reports a call whose result never came.
1090
1088
  tools: NotRequired[list[FakeHarnessDescriptorToolsItem]]
1089
+ # Each turn's recorded agent time, exactly, whatever the wall clock says: a test can compare
1090
+ # agent time without scheduling jitter, which four runs a side can tell apart.
1091
+ turnMs: NotRequired[float]
1092
+ # Tokens the fake agent reports for every turn, as `turn.usage`; without it, null.
1093
+ usage: NotRequired[FakeHarnessDescriptorUsage]
1091
1094
  # Files and message used instead when the environment gives the agent a skill.
1092
1095
  withSkill: NotRequired[FakeHarnessDescriptorWithSkill]
1093
1096
 
@@ -1356,6 +1359,7 @@ class JudgeCallData(TypedDict):
1356
1359
  maxConcurrent: NotRequired[int]
1357
1360
  # `'provider/model'`, or a fake judge with a numeric score.
1358
1361
  model: NotRequired[str | FakeJudgeData]
1362
+ observations: NotRequired[bool | list[str]]
1359
1363
  # The turn `task`, `output`, `transcript` and `diff` read instead of the latest: an earlier
1360
1364
  # turn, or a value graded as the output.
1361
1365
  on: NotRequired[JudgeCallDataOnTurn | JudgeCallDataOnValue]
@@ -1518,7 +1522,7 @@ class PiHarnessDescriptor(TypedDict):
1518
1522
 
1519
1523
 
1520
1524
  # An option a profile's `limit` can narrow, and `pin` can protect.
1521
- PinnableKey: TypeAlias = "Literal[\"compare\", \"harness\", \"runs\"]"
1525
+ PinnableKey: TypeAlias = "Literal[\"compare\", \"harnesses\", \"runs\"]"
1522
1526
 
1523
1527
 
1524
1528
  class PluginMarketplace1(TypedDict):
@@ -1655,6 +1659,8 @@ class Question(TypedDict):
1655
1659
  files: NotRequired[bool]
1656
1660
  # `'provider/model'` that answers it, over the cascaded `question.model`.
1657
1661
  model: NotRequired[str]
1662
+ # `c.observe()` values, by name; a list shows only those names.
1663
+ observations: NotRequired[bool | list[str]]
1658
1664
  # The final message: the agent's own account of its work.
1659
1665
  output: NotRequired[bool]
1660
1666
  question: str
@@ -1675,7 +1681,7 @@ class QuestionOptions(TypedDict):
1675
1681
  model: NotRequired[str]
1676
1682
 
1677
1683
 
1678
- SandboxDescriptor: TypeAlias = "FakeSandboxDescriptor | DockerSandboxDescriptor"
1684
+ SandboxDescriptor: TypeAlias = "FakeSandboxDescriptor | DockerSandboxDescriptor | TartSandboxDescriptor | BoatSandboxDescriptor"
1679
1685
 
1680
1686
 
1681
1687
  # A host environment variable, redacted everywhere reeval writes and recorded by name only. Made
@@ -1801,6 +1807,37 @@ class SnapshotOptions(TypedDict):
1801
1807
  SubstituteIn: TypeAlias = "Literal[\"header\", \"query\", \"body\"]"
1802
1808
 
1803
1809
 
1810
+ # Reach the VM over SSH when its Tart Guest Agent doesn't answer `tart exec`: as `user` (`admin`
1811
+ # when unset), with `key`, a private key the image trusts, absolute or relative to the file it's
1812
+ # written in.
1813
+ class TartSandboxDescriptorSsh(TypedDict):
1814
+ key: str
1815
+ user: NotRequired[str]
1816
+
1817
+
1818
+ # A macOS VM on this Mac, cloned from `image` for each attempt by Tart, made by `tart()`.
1819
+ class TartSandboxDescriptor(TypedDict):
1820
+ # CPUs each clone gets; the image's when unset.
1821
+ cpus: NotRequired[int]
1822
+ # Cell id; defaults to `tart:<image>`, the image's last path segment.
1823
+ id: NotRequired[str]
1824
+ # The VM each attempt clones: an OCI image such as
1825
+ # `ghcr.io/cirruslabs/macos-sequoia-base:latest`, or a local VM's name. Tart must have it
1826
+ # before the run: `reeval image build` (or `tart pull`) pulls it, and `reeval run` refuses
1827
+ # one `tart list` doesn't show.
1828
+ image: str
1829
+ kind: Literal["tart"]
1830
+ # The most Tart VMs at once, across the run: 1 or 2, and 2 when unset, since macOS runs at
1831
+ # most two macOS VMs at a time.
1832
+ maxConcurrent: NotRequired[float]
1833
+ # Memory each clone gets: `'8g'`, `'4096m'`, or bytes; the image's when unset.
1834
+ memory: NotRequired[str | int]
1835
+ # Reach the VM over SSH when its Tart Guest Agent doesn't answer `tart exec`: as `user`
1836
+ # (`admin` when unset), with `key`, a private key the image trusts, absolute or relative to
1837
+ # the file it's written in.
1838
+ ssh: NotRequired[TartSandboxDescriptorSsh]
1839
+
1840
+
1804
1841
  # The tokens one turn used, as its harness reported them. `input` excludes cache reads and
1805
1842
  # writes (so the prompt was `input + cacheRead + cacheWrite`); `reasoning` is part of `output`.
1806
1843
  class TokenUsage(TypedDict):
@@ -1996,10 +2033,12 @@ WebEventType: TypeAlias = "Literal[\"web-search\", \"web-fetch\"]"
1996
2033
  # reeval's camelCase keys: the SDK takes each in snake_case too.
1997
2034
  CAMEL_KEYS: frozenset[str] = frozenset(
1998
2035
  {
2036
+ "apiKey",
1999
2037
  "atMs",
2000
2038
  "bestOf",
2001
2039
  "cacheRead",
2002
2040
  "cacheWrite",
2041
+ "caseJson",
2003
2042
  "costUsd",
2004
2043
  "delayMs",
2005
2044
  "durationMs",
@@ -2023,6 +2062,7 @@ CAMEL_KEYS: frozenset[str] = frozenset(
2023
2062
  "startTimeout",
2024
2063
  "startedAt",
2025
2064
  "toolCallId",
2065
+ "turnMs",
2026
2066
  "withSkill",
2027
2067
  }
2028
2068
  )
@@ -2040,6 +2080,7 @@ RECORD_FIELDS: frozenset[str] = frozenset(
2040
2080
  "providerOptions",
2041
2081
  "regions",
2042
2082
  "score",
2083
+ "traits",
2043
2084
  "untested",
2044
2085
  "value",
2045
2086
  "write",