@oneharness/sdk 0.10.2 → 0.10.3

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.
@@ -14,7 +14,7 @@ export type HistoryStreamEnvelope = {
14
14
  [k: string]: unknown;
15
15
  } | ({
16
16
  error: string;
17
- schema_version?: "1.3" | "1.4" | "1.5" | "1.6" | undefined;
17
+ schema_version?: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | undefined;
18
18
  [k: string]: unknown;
19
19
  } & ({
20
20
  status?: "nonzero" | "timeout" | "cancelled" | "spawn-error" | "skipped" | undefined;
@@ -23,22 +23,30 @@ export type HistoryStreamEnvelope = {
23
23
  failure_kind: "tool_deferred";
24
24
  [k: string]: unknown;
25
25
  }))) & ({
26
+ work?: null | undefined;
27
+ [k: string]: unknown;
28
+ } | {
29
+ schema_version?: "1.7" | undefined;
30
+ status?: "nonzero" | "timeout" | "cancelled" | undefined;
31
+ work: "done" | "none";
32
+ [k: string]: unknown;
33
+ }) & ({
26
34
  status?: "ok" | "nonzero" | "timeout" | "spawn-error" | "skipped" | "planned" | undefined;
27
35
  [k: string]: unknown;
28
36
  } | {
29
- schema_version?: "1.4" | "1.5" | "1.6" | undefined;
37
+ schema_version?: "1.4" | "1.5" | "1.6" | "1.7" | undefined;
30
38
  [k: string]: unknown;
31
39
  }) & (({
32
40
  failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "tool_deferred" | "untrusted_directory" | "input_too_large" | null;
33
41
  [k: string]: unknown;
34
42
  } | {
35
- schema_version?: "1.5" | "1.6" | undefined;
43
+ schema_version?: "1.5" | "1.6" | "1.7" | undefined;
36
44
  [k: string]: unknown;
37
45
  }) & ({
38
46
  failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | null;
39
47
  [k: string]: unknown;
40
48
  } | {
41
- schema_version?: "1.6" | undefined;
49
+ schema_version?: "1.6" | "1.7" | undefined;
42
50
  [k: string]: unknown;
43
51
  })) & HistoryRecord;
44
52
  type: "record";
@@ -143,7 +151,7 @@ export type HistoryRecord = {
143
151
  * run's single prompt).
144
152
  */
145
153
  prompt: string;
146
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6";
154
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7";
147
155
  /**
148
156
  * The oneharness session id this run belongs to (the history file's stem).
149
157
  */
@@ -170,6 +178,22 @@ export type HistoryRecord = {
170
178
  tool_ms: number;
171
179
  usage: Usage;
172
180
  variant?: string | null | undefined;
181
+ /**
182
+ * What a run that failed with **nothing to classify** has to show for
183
+ * itself: [`RunWork::Done`] where the harness recorded a tool call or billed
184
+ * usage, [`RunWork::None`] where nothing says it got that far. Copied from
185
+ * [`RunResult::work`] — one value with one source, like every signal here —
186
+ * and omitted on the wire on every other run, since a success raises the
187
+ * question and a classified failure has already answered it.
188
+ *
189
+ * This is the field that tells apart, for a reader of the record, the two
190
+ * things an unexplained failure can be: a candidate that never got started,
191
+ * and one that ran the task and lost. Without it both are a `nonzero` line with a
192
+ * null `failure_kind` and empty accounting, and a chain that stopped at the
193
+ * first reads exactly like a chain that stopped at the second. Gated to
194
+ * [`FIRST_WORK_EVIDENCE_SCHEMA_VERSION`].
195
+ */
196
+ work?: RunWork | null | undefined;
173
197
  [k: string]: unknown;
174
198
  } | {
175
199
  duration_ms: number;
@@ -296,6 +320,22 @@ export type HistoryRecord = {
296
320
  tool_ms: number;
297
321
  usage: Usage1;
298
322
  variant?: string | null | undefined;
323
+ /**
324
+ * What a run that failed with **nothing to classify** has to show for
325
+ * itself: [`RunWork::Done`] where the harness recorded a tool call or billed
326
+ * usage, [`RunWork::None`] where nothing says it got that far. Copied from
327
+ * [`RunResult::work`] — one value with one source, like every signal here —
328
+ * and omitted on the wire on every other run, since a success raises the
329
+ * question and a classified failure has already answered it.
330
+ *
331
+ * This is the field that tells apart, for a reader of the record, the two
332
+ * things an unexplained failure can be: a candidate that never got started,
333
+ * and one that ran the task and lost. Without it both are a `nonzero` line with a
334
+ * null `failure_kind` and empty accounting, and a chain that stopped at the
335
+ * first reads exactly like a chain that stopped at the second. Gated to
336
+ * [`FIRST_WORK_EVIDENCE_SCHEMA_VERSION`].
337
+ */
338
+ work?: RunWork | null | undefined;
299
339
  [k: string]: unknown;
300
340
  } | {
301
341
  duration_ms: number | null;
@@ -373,7 +413,7 @@ export type HistoryRecord = {
373
413
  * run's single prompt).
374
414
  */
375
415
  prompt: string;
376
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6";
416
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7";
377
417
  /**
378
418
  * The oneharness session id this run belongs to (the history file's stem).
379
419
  */
@@ -400,6 +440,22 @@ export type HistoryRecord = {
400
440
  tool_ms?: never | undefined;
401
441
  usage: Usage2;
402
442
  variant?: string | null | undefined;
443
+ /**
444
+ * What a run that failed with **nothing to classify** has to show for
445
+ * itself: [`RunWork::Done`] where the harness recorded a tool call or billed
446
+ * usage, [`RunWork::None`] where nothing says it got that far. Copied from
447
+ * [`RunResult::work`] — one value with one source, like every signal here —
448
+ * and omitted on the wire on every other run, since a success raises the
449
+ * question and a classified failure has already answered it.
450
+ *
451
+ * This is the field that tells apart, for a reader of the record, the two
452
+ * things an unexplained failure can be: a candidate that never got started,
453
+ * and one that ran the task and lost. Without it both are a `nonzero` line with a
454
+ * null `failure_kind` and empty accounting, and a chain that stopped at the
455
+ * first reads exactly like a chain that stopped at the second. Gated to
456
+ * [`FIRST_WORK_EVIDENCE_SCHEMA_VERSION`].
457
+ */
458
+ work?: RunWork | null | undefined;
403
459
  [k: string]: unknown;
404
460
  } | {
405
461
  duration_ms: number;
@@ -465,7 +521,7 @@ export type HistoryRecord = {
465
521
  * run's single prompt).
466
522
  */
467
523
  prompt: string;
468
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6";
524
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7";
469
525
  /**
470
526
  * The oneharness session id this run belongs to (the history file's stem).
471
527
  */
@@ -492,6 +548,22 @@ export type HistoryRecord = {
492
548
  tool_ms?: never | undefined;
493
549
  usage: Usage3;
494
550
  variant?: string | null | undefined;
551
+ /**
552
+ * What a run that failed with **nothing to classify** has to show for
553
+ * itself: [`RunWork::Done`] where the harness recorded a tool call or billed
554
+ * usage, [`RunWork::None`] where nothing says it got that far. Copied from
555
+ * [`RunResult::work`] — one value with one source, like every signal here —
556
+ * and omitted on the wire on every other run, since a success raises the
557
+ * question and a classified failure has already answered it.
558
+ *
559
+ * This is the field that tells apart, for a reader of the record, the two
560
+ * things an unexplained failure can be: a candidate that never got started,
561
+ * and one that ran the task and lost. Without it both are a `nonzero` line with a
562
+ * null `failure_kind` and empty accounting, and a chain that stopped at the
563
+ * first reads exactly like a chain that stopped at the second. Gated to
564
+ * [`FIRST_WORK_EVIDENCE_SCHEMA_VERSION`].
565
+ */
566
+ work?: RunWork | null | undefined;
495
567
  [k: string]: unknown;
496
568
  } | {
497
569
  duration_ms: number | null;
@@ -557,7 +629,7 @@ export type HistoryRecord = {
557
629
  * run's single prompt).
558
630
  */
559
631
  prompt: string;
560
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6";
632
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7";
561
633
  /**
562
634
  * The oneharness session id this run belongs to (the history file's stem).
563
635
  */
@@ -584,6 +656,22 @@ export type HistoryRecord = {
584
656
  tool_ms?: never | undefined;
585
657
  usage: Usage4;
586
658
  variant?: string | null | undefined;
659
+ /**
660
+ * What a run that failed with **nothing to classify** has to show for
661
+ * itself: [`RunWork::Done`] where the harness recorded a tool call or billed
662
+ * usage, [`RunWork::None`] where nothing says it got that far. Copied from
663
+ * [`RunResult::work`] — one value with one source, like every signal here —
664
+ * and omitted on the wire on every other run, since a success raises the
665
+ * question and a classified failure has already answered it.
666
+ *
667
+ * This is the field that tells apart, for a reader of the record, the two
668
+ * things an unexplained failure can be: a candidate that never got started,
669
+ * and one that ran the task and lost. Without it both are a `nonzero` line with a
670
+ * null `failure_kind` and empty accounting, and a chain that stopped at the
671
+ * first reads exactly like a chain that stopped at the second. Gated to
672
+ * [`FIRST_WORK_EVIDENCE_SCHEMA_VERSION`].
673
+ */
674
+ work?: RunWork | null | undefined;
587
675
  [k: string]: unknown;
588
676
  } | {
589
677
  duration_ms: number;
@@ -649,7 +737,7 @@ export type HistoryRecord = {
649
737
  * run's single prompt).
650
738
  */
651
739
  prompt: string;
652
- schema_version: "1.3" | "1.4" | "1.5" | "1.6";
740
+ schema_version: "1.3" | "1.4" | "1.5" | "1.6" | "1.7";
653
741
  /**
654
742
  * The oneharness session id this run belongs to (the history file's stem).
655
743
  */
@@ -676,6 +764,22 @@ export type HistoryRecord = {
676
764
  tool_ms?: never | undefined;
677
765
  usage: Usage5;
678
766
  variant?: string | null | undefined;
767
+ /**
768
+ * What a run that failed with **nothing to classify** has to show for
769
+ * itself: [`RunWork::Done`] where the harness recorded a tool call or billed
770
+ * usage, [`RunWork::None`] where nothing says it got that far. Copied from
771
+ * [`RunResult::work`] — one value with one source, like every signal here —
772
+ * and omitted on the wire on every other run, since a success raises the
773
+ * question and a classified failure has already answered it.
774
+ *
775
+ * This is the field that tells apart, for a reader of the record, the two
776
+ * things an unexplained failure can be: a candidate that never got started,
777
+ * and one that ran the task and lost. Without it both are a `nonzero` line with a
778
+ * null `failure_kind` and empty accounting, and a chain that stopped at the
779
+ * first reads exactly like a chain that stopped at the second. Gated to
780
+ * [`FIRST_WORK_EVIDENCE_SCHEMA_VERSION`].
781
+ */
782
+ work?: RunWork | null | undefined;
679
783
  [k: string]: unknown;
680
784
  } | {
681
785
  duration_ms: number | null;
@@ -771,6 +875,22 @@ export type HistoryRecord = {
771
875
  tool_ms?: never | undefined;
772
876
  usage: Usage6;
773
877
  variant?: string | null | undefined;
878
+ /**
879
+ * What a run that failed with **nothing to classify** has to show for
880
+ * itself: [`RunWork::Done`] where the harness recorded a tool call or billed
881
+ * usage, [`RunWork::None`] where nothing says it got that far. Copied from
882
+ * [`RunResult::work`] — one value with one source, like every signal here —
883
+ * and omitted on the wire on every other run, since a success raises the
884
+ * question and a classified failure has already answered it.
885
+ *
886
+ * This is the field that tells apart, for a reader of the record, the two
887
+ * things an unexplained failure can be: a candidate that never got started,
888
+ * and one that ran the task and lost. Without it both are a `nonzero` line with a
889
+ * null `failure_kind` and empty accounting, and a chain that stopped at the
890
+ * first reads exactly like a chain that stopped at the second. Gated to
891
+ * [`FIRST_WORK_EVIDENCE_SCHEMA_VERSION`].
892
+ */
893
+ work?: RunWork | null | undefined;
774
894
  [k: string]: unknown;
775
895
  } | {
776
896
  duration_ms: number | null;
@@ -878,6 +998,22 @@ export type HistoryRecord = {
878
998
  tool_ms?: never | undefined;
879
999
  usage: Usage7;
880
1000
  variant?: string | null | undefined;
1001
+ /**
1002
+ * What a run that failed with **nothing to classify** has to show for
1003
+ * itself: [`RunWork::Done`] where the harness recorded a tool call or billed
1004
+ * usage, [`RunWork::None`] where nothing says it got that far. Copied from
1005
+ * [`RunResult::work`] — one value with one source, like every signal here —
1006
+ * and omitted on the wire on every other run, since a success raises the
1007
+ * question and a classified failure has already answered it.
1008
+ *
1009
+ * This is the field that tells apart, for a reader of the record, the two
1010
+ * things an unexplained failure can be: a candidate that never got started,
1011
+ * and one that ran the task and lost. Without it both are a `nonzero` line with a
1012
+ * null `failure_kind` and empty accounting, and a chain that stopped at the
1013
+ * first reads exactly like a chain that stopped at the second. Gated to
1014
+ * [`FIRST_WORK_EVIDENCE_SCHEMA_VERSION`].
1015
+ */
1016
+ work?: RunWork | null | undefined;
881
1017
  [k: string]: unknown;
882
1018
  } | {
883
1019
  duration_ms: number | null;
@@ -983,6 +1119,22 @@ export type HistoryRecord = {
983
1119
  tool_ms?: number | null | undefined;
984
1120
  usage: Usage8;
985
1121
  variant?: string | null | undefined;
1122
+ /**
1123
+ * What a run that failed with **nothing to classify** has to show for
1124
+ * itself: [`RunWork::Done`] where the harness recorded a tool call or billed
1125
+ * usage, [`RunWork::None`] where nothing says it got that far. Copied from
1126
+ * [`RunResult::work`] — one value with one source, like every signal here —
1127
+ * and omitted on the wire on every other run, since a success raises the
1128
+ * question and a classified failure has already answered it.
1129
+ *
1130
+ * This is the field that tells apart, for a reader of the record, the two
1131
+ * things an unexplained failure can be: a candidate that never got started,
1132
+ * and one that ran the task and lost. Without it both are a `nonzero` line with a
1133
+ * null `failure_kind` and empty accounting, and a chain that stopped at the
1134
+ * first reads exactly like a chain that stopped at the second. Gated to
1135
+ * [`FIRST_WORK_EVIDENCE_SCHEMA_VERSION`].
1136
+ */
1137
+ work?: RunWork | null | undefined;
986
1138
  [k: string]: unknown;
987
1139
  };
988
1140
  export type ToolCallStatus = "completed" | "failed" | "timeout" | "interrupted";
@@ -1006,12 +1158,32 @@ export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" |
1006
1158
  * The outcome of attempting to run one harness.
1007
1159
  */
1008
1160
  export type Status = "ok" | "nonzero" | "timeout" | "cancelled" | "spawn-error" | "skipped" | "planned";
1161
+ /**
1162
+ * Whether a candidate's normalized result carries **evidence it did the task's
1163
+ * work** — the first thing [`startup_failure_reason`] consults.
1164
+ *
1165
+ * Two independent witnesses, either of which is decisive:
1166
+ *
1167
+ * - **Tool events.** A recorded tool call is the harness acting on the task.
1168
+ * - **Usage accounting.** [`Usage::reports_billed_work`][billed] — the same definition
1169
+ * `signals::record_reports_work` classifies a raw harness record with, so the
1170
+ * two readings of "billed" are one contract with one implementation.
1171
+ *
1172
+ * It is also a **published reading**, not only an internal one: a run that
1173
+ * failed with nothing to classify carries it as [`RunResult::work`] and in its
1174
+ * history record, because there the question "did this candidate do anything?"
1175
+ * is the only one left. One type for both, so the value a reader sees is the
1176
+ * same value the fall-through verdict consulted.
1177
+ *
1178
+ * [billed]: crate::domain::signals::Usage::reports_billed_work
1179
+ */
1180
+ export type RunWork = "done" | "none";
1009
1181
  export type HistoryEventLine = {
1010
1182
  event: ActionEvent;
1011
1183
  harness: string;
1012
1184
  harness_id?: string | null | undefined;
1013
1185
  run_id: string;
1014
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6";
1186
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7";
1015
1187
  variant?: string | null | undefined;
1016
1188
  [k: string]: unknown;
1017
1189
  } | {
@@ -8,7 +8,7 @@ export type HistoryRecord = ({
8
8
  [k: string]: unknown;
9
9
  } | ({
10
10
  error: string;
11
- schema_version?: "1.3" | "1.4" | "1.5" | "1.6" | undefined;
11
+ schema_version?: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | undefined;
12
12
  [k: string]: unknown;
13
13
  } & ({
14
14
  status?: "nonzero" | "timeout" | "cancelled" | "spawn-error" | "skipped" | undefined;
@@ -17,22 +17,30 @@ export type HistoryRecord = ({
17
17
  failure_kind: "tool_deferred";
18
18
  [k: string]: unknown;
19
19
  }))) & ({
20
+ work?: null | undefined;
21
+ [k: string]: unknown;
22
+ } | {
23
+ schema_version?: "1.7" | undefined;
24
+ status?: "nonzero" | "timeout" | "cancelled" | undefined;
25
+ work: "done" | "none";
26
+ [k: string]: unknown;
27
+ }) & ({
20
28
  status?: "ok" | "nonzero" | "timeout" | "spawn-error" | "skipped" | "planned" | undefined;
21
29
  [k: string]: unknown;
22
30
  } | {
23
- schema_version?: "1.4" | "1.5" | "1.6" | undefined;
31
+ schema_version?: "1.4" | "1.5" | "1.6" | "1.7" | undefined;
24
32
  [k: string]: unknown;
25
33
  }) & (({
26
34
  failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "tool_deferred" | "untrusted_directory" | "input_too_large" | null;
27
35
  [k: string]: unknown;
28
36
  } | {
29
- schema_version?: "1.5" | "1.6" | undefined;
37
+ schema_version?: "1.5" | "1.6" | "1.7" | undefined;
30
38
  [k: string]: unknown;
31
39
  }) & ({
32
40
  failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | null;
33
41
  [k: string]: unknown;
34
42
  } | {
35
- schema_version?: "1.6" | undefined;
43
+ schema_version?: "1.6" | "1.7" | undefined;
36
44
  [k: string]: unknown;
37
45
  })) & ({
38
46
  duration_ms: number;
@@ -129,7 +137,7 @@ export type HistoryRecord = ({
129
137
  * run's single prompt).
130
138
  */
131
139
  prompt: string;
132
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6";
140
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7";
133
141
  /**
134
142
  * The oneharness session id this run belongs to (the history file's stem).
135
143
  */
@@ -156,6 +164,22 @@ export type HistoryRecord = ({
156
164
  tool_ms: number;
157
165
  usage: Usage;
158
166
  variant?: string | null | undefined;
167
+ /**
168
+ * What a run that failed with **nothing to classify** has to show for
169
+ * itself: [`RunWork::Done`] where the harness recorded a tool call or billed
170
+ * usage, [`RunWork::None`] where nothing says it got that far. Copied from
171
+ * [`RunResult::work`] — one value with one source, like every signal here —
172
+ * and omitted on the wire on every other run, since a success raises the
173
+ * question and a classified failure has already answered it.
174
+ *
175
+ * This is the field that tells apart, for a reader of the record, the two
176
+ * things an unexplained failure can be: a candidate that never got started,
177
+ * and one that ran the task and lost. Without it both are a `nonzero` line with a
178
+ * null `failure_kind` and empty accounting, and a chain that stopped at the
179
+ * first reads exactly like a chain that stopped at the second. Gated to
180
+ * [`FIRST_WORK_EVIDENCE_SCHEMA_VERSION`].
181
+ */
182
+ work?: RunWork | null | undefined;
159
183
  [k: string]: unknown;
160
184
  } | {
161
185
  duration_ms: number;
@@ -282,6 +306,22 @@ export type HistoryRecord = ({
282
306
  tool_ms: number;
283
307
  usage: Usage1;
284
308
  variant?: string | null | undefined;
309
+ /**
310
+ * What a run that failed with **nothing to classify** has to show for
311
+ * itself: [`RunWork::Done`] where the harness recorded a tool call or billed
312
+ * usage, [`RunWork::None`] where nothing says it got that far. Copied from
313
+ * [`RunResult::work`] — one value with one source, like every signal here —
314
+ * and omitted on the wire on every other run, since a success raises the
315
+ * question and a classified failure has already answered it.
316
+ *
317
+ * This is the field that tells apart, for a reader of the record, the two
318
+ * things an unexplained failure can be: a candidate that never got started,
319
+ * and one that ran the task and lost. Without it both are a `nonzero` line with a
320
+ * null `failure_kind` and empty accounting, and a chain that stopped at the
321
+ * first reads exactly like a chain that stopped at the second. Gated to
322
+ * [`FIRST_WORK_EVIDENCE_SCHEMA_VERSION`].
323
+ */
324
+ work?: RunWork | null | undefined;
285
325
  [k: string]: unknown;
286
326
  } | {
287
327
  duration_ms: number | null;
@@ -359,7 +399,7 @@ export type HistoryRecord = ({
359
399
  * run's single prompt).
360
400
  */
361
401
  prompt: string;
362
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6";
402
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7";
363
403
  /**
364
404
  * The oneharness session id this run belongs to (the history file's stem).
365
405
  */
@@ -386,6 +426,22 @@ export type HistoryRecord = ({
386
426
  tool_ms?: never | undefined;
387
427
  usage: Usage2;
388
428
  variant?: string | null | undefined;
429
+ /**
430
+ * What a run that failed with **nothing to classify** has to show for
431
+ * itself: [`RunWork::Done`] where the harness recorded a tool call or billed
432
+ * usage, [`RunWork::None`] where nothing says it got that far. Copied from
433
+ * [`RunResult::work`] — one value with one source, like every signal here —
434
+ * and omitted on the wire on every other run, since a success raises the
435
+ * question and a classified failure has already answered it.
436
+ *
437
+ * This is the field that tells apart, for a reader of the record, the two
438
+ * things an unexplained failure can be: a candidate that never got started,
439
+ * and one that ran the task and lost. Without it both are a `nonzero` line with a
440
+ * null `failure_kind` and empty accounting, and a chain that stopped at the
441
+ * first reads exactly like a chain that stopped at the second. Gated to
442
+ * [`FIRST_WORK_EVIDENCE_SCHEMA_VERSION`].
443
+ */
444
+ work?: RunWork | null | undefined;
389
445
  [k: string]: unknown;
390
446
  } | {
391
447
  duration_ms: number;
@@ -451,7 +507,7 @@ export type HistoryRecord = ({
451
507
  * run's single prompt).
452
508
  */
453
509
  prompt: string;
454
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6";
510
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7";
455
511
  /**
456
512
  * The oneharness session id this run belongs to (the history file's stem).
457
513
  */
@@ -478,6 +534,22 @@ export type HistoryRecord = ({
478
534
  tool_ms?: never | undefined;
479
535
  usage: Usage3;
480
536
  variant?: string | null | undefined;
537
+ /**
538
+ * What a run that failed with **nothing to classify** has to show for
539
+ * itself: [`RunWork::Done`] where the harness recorded a tool call or billed
540
+ * usage, [`RunWork::None`] where nothing says it got that far. Copied from
541
+ * [`RunResult::work`] — one value with one source, like every signal here —
542
+ * and omitted on the wire on every other run, since a success raises the
543
+ * question and a classified failure has already answered it.
544
+ *
545
+ * This is the field that tells apart, for a reader of the record, the two
546
+ * things an unexplained failure can be: a candidate that never got started,
547
+ * and one that ran the task and lost. Without it both are a `nonzero` line with a
548
+ * null `failure_kind` and empty accounting, and a chain that stopped at the
549
+ * first reads exactly like a chain that stopped at the second. Gated to
550
+ * [`FIRST_WORK_EVIDENCE_SCHEMA_VERSION`].
551
+ */
552
+ work?: RunWork | null | undefined;
481
553
  [k: string]: unknown;
482
554
  } | {
483
555
  duration_ms: number | null;
@@ -543,7 +615,7 @@ export type HistoryRecord = ({
543
615
  * run's single prompt).
544
616
  */
545
617
  prompt: string;
546
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6";
618
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7";
547
619
  /**
548
620
  * The oneharness session id this run belongs to (the history file's stem).
549
621
  */
@@ -570,6 +642,22 @@ export type HistoryRecord = ({
570
642
  tool_ms?: never | undefined;
571
643
  usage: Usage4;
572
644
  variant?: string | null | undefined;
645
+ /**
646
+ * What a run that failed with **nothing to classify** has to show for
647
+ * itself: [`RunWork::Done`] where the harness recorded a tool call or billed
648
+ * usage, [`RunWork::None`] where nothing says it got that far. Copied from
649
+ * [`RunResult::work`] — one value with one source, like every signal here —
650
+ * and omitted on the wire on every other run, since a success raises the
651
+ * question and a classified failure has already answered it.
652
+ *
653
+ * This is the field that tells apart, for a reader of the record, the two
654
+ * things an unexplained failure can be: a candidate that never got started,
655
+ * and one that ran the task and lost. Without it both are a `nonzero` line with a
656
+ * null `failure_kind` and empty accounting, and a chain that stopped at the
657
+ * first reads exactly like a chain that stopped at the second. Gated to
658
+ * [`FIRST_WORK_EVIDENCE_SCHEMA_VERSION`].
659
+ */
660
+ work?: RunWork | null | undefined;
573
661
  [k: string]: unknown;
574
662
  } | {
575
663
  duration_ms: number;
@@ -635,7 +723,7 @@ export type HistoryRecord = ({
635
723
  * run's single prompt).
636
724
  */
637
725
  prompt: string;
638
- schema_version: "1.3" | "1.4" | "1.5" | "1.6";
726
+ schema_version: "1.3" | "1.4" | "1.5" | "1.6" | "1.7";
639
727
  /**
640
728
  * The oneharness session id this run belongs to (the history file's stem).
641
729
  */
@@ -662,6 +750,22 @@ export type HistoryRecord = ({
662
750
  tool_ms?: never | undefined;
663
751
  usage: Usage5;
664
752
  variant?: string | null | undefined;
753
+ /**
754
+ * What a run that failed with **nothing to classify** has to show for
755
+ * itself: [`RunWork::Done`] where the harness recorded a tool call or billed
756
+ * usage, [`RunWork::None`] where nothing says it got that far. Copied from
757
+ * [`RunResult::work`] — one value with one source, like every signal here —
758
+ * and omitted on the wire on every other run, since a success raises the
759
+ * question and a classified failure has already answered it.
760
+ *
761
+ * This is the field that tells apart, for a reader of the record, the two
762
+ * things an unexplained failure can be: a candidate that never got started,
763
+ * and one that ran the task and lost. Without it both are a `nonzero` line with a
764
+ * null `failure_kind` and empty accounting, and a chain that stopped at the
765
+ * first reads exactly like a chain that stopped at the second. Gated to
766
+ * [`FIRST_WORK_EVIDENCE_SCHEMA_VERSION`].
767
+ */
768
+ work?: RunWork | null | undefined;
665
769
  [k: string]: unknown;
666
770
  } | {
667
771
  duration_ms: number | null;
@@ -757,6 +861,22 @@ export type HistoryRecord = ({
757
861
  tool_ms?: never | undefined;
758
862
  usage: Usage6;
759
863
  variant?: string | null | undefined;
864
+ /**
865
+ * What a run that failed with **nothing to classify** has to show for
866
+ * itself: [`RunWork::Done`] where the harness recorded a tool call or billed
867
+ * usage, [`RunWork::None`] where nothing says it got that far. Copied from
868
+ * [`RunResult::work`] — one value with one source, like every signal here —
869
+ * and omitted on the wire on every other run, since a success raises the
870
+ * question and a classified failure has already answered it.
871
+ *
872
+ * This is the field that tells apart, for a reader of the record, the two
873
+ * things an unexplained failure can be: a candidate that never got started,
874
+ * and one that ran the task and lost. Without it both are a `nonzero` line with a
875
+ * null `failure_kind` and empty accounting, and a chain that stopped at the
876
+ * first reads exactly like a chain that stopped at the second. Gated to
877
+ * [`FIRST_WORK_EVIDENCE_SCHEMA_VERSION`].
878
+ */
879
+ work?: RunWork | null | undefined;
760
880
  [k: string]: unknown;
761
881
  } | {
762
882
  duration_ms: number | null;
@@ -864,6 +984,22 @@ export type HistoryRecord = ({
864
984
  tool_ms?: never | undefined;
865
985
  usage: Usage7;
866
986
  variant?: string | null | undefined;
987
+ /**
988
+ * What a run that failed with **nothing to classify** has to show for
989
+ * itself: [`RunWork::Done`] where the harness recorded a tool call or billed
990
+ * usage, [`RunWork::None`] where nothing says it got that far. Copied from
991
+ * [`RunResult::work`] — one value with one source, like every signal here —
992
+ * and omitted on the wire on every other run, since a success raises the
993
+ * question and a classified failure has already answered it.
994
+ *
995
+ * This is the field that tells apart, for a reader of the record, the two
996
+ * things an unexplained failure can be: a candidate that never got started,
997
+ * and one that ran the task and lost. Without it both are a `nonzero` line with a
998
+ * null `failure_kind` and empty accounting, and a chain that stopped at the
999
+ * first reads exactly like a chain that stopped at the second. Gated to
1000
+ * [`FIRST_WORK_EVIDENCE_SCHEMA_VERSION`].
1001
+ */
1002
+ work?: RunWork | null | undefined;
867
1003
  [k: string]: unknown;
868
1004
  } | {
869
1005
  duration_ms: number | null;
@@ -969,6 +1105,22 @@ export type HistoryRecord = ({
969
1105
  tool_ms?: number | null | undefined;
970
1106
  usage: Usage8;
971
1107
  variant?: string | null | undefined;
1108
+ /**
1109
+ * What a run that failed with **nothing to classify** has to show for
1110
+ * itself: [`RunWork::Done`] where the harness recorded a tool call or billed
1111
+ * usage, [`RunWork::None`] where nothing says it got that far. Copied from
1112
+ * [`RunResult::work`] — one value with one source, like every signal here —
1113
+ * and omitted on the wire on every other run, since a success raises the
1114
+ * question and a classified failure has already answered it.
1115
+ *
1116
+ * This is the field that tells apart, for a reader of the record, the two
1117
+ * things an unexplained failure can be: a candidate that never got started,
1118
+ * and one that ran the task and lost. Without it both are a `nonzero` line with a
1119
+ * null `failure_kind` and empty accounting, and a chain that stopped at the
1120
+ * first reads exactly like a chain that stopped at the second. Gated to
1121
+ * [`FIRST_WORK_EVIDENCE_SCHEMA_VERSION`].
1122
+ */
1123
+ work?: RunWork | null | undefined;
972
1124
  [k: string]: unknown;
973
1125
  });
974
1126
  export type ToolCallStatus = "completed" | "failed" | "timeout" | "interrupted";
@@ -992,6 +1144,26 @@ export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" |
992
1144
  * The outcome of attempting to run one harness.
993
1145
  */
994
1146
  export type Status = "ok" | "nonzero" | "timeout" | "cancelled" | "spawn-error" | "skipped" | "planned";
1147
+ /**
1148
+ * Whether a candidate's normalized result carries **evidence it did the task's
1149
+ * work** — the first thing [`startup_failure_reason`] consults.
1150
+ *
1151
+ * Two independent witnesses, either of which is decisive:
1152
+ *
1153
+ * - **Tool events.** A recorded tool call is the harness acting on the task.
1154
+ * - **Usage accounting.** [`Usage::reports_billed_work`][billed] — the same definition
1155
+ * `signals::record_reports_work` classifies a raw harness record with, so the
1156
+ * two readings of "billed" are one contract with one implementation.
1157
+ *
1158
+ * It is also a **published reading**, not only an internal one: a run that
1159
+ * failed with nothing to classify carries it as [`RunResult::work`] and in its
1160
+ * history record, because there the question "did this candidate do anything?"
1161
+ * is the only one left. One type for both, so the value a reader sees is the
1162
+ * same value the fall-through verdict consulted.
1163
+ *
1164
+ * [billed]: crate::domain::signals::Usage::reports_billed_work
1165
+ */
1166
+ export type RunWork = "done" | "none";
995
1167
  /**
996
1168
  * One normalized action a harness took, harness-agnostic so a single consumer
997
1169
  * assertion works across harnesses. Every field is always serialized (null when