@oneharness/sdk 0.12.1 → 0.13.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.
@@ -158,6 +158,11 @@ export declare const CAPABILITIES: {
158
158
  readonly flag: "--schema-max-retries";
159
159
  readonly kind: "value";
160
160
  readonly unless: null;
161
+ }, {
162
+ readonly option: "serverOverloadedMaxRetries";
163
+ readonly flag: "--server-overloaded-max-retries";
164
+ readonly kind: "value";
165
+ readonly unless: null;
161
166
  }, {
162
167
  readonly option: "outputDir";
163
168
  readonly flag: "--output-dir";
@@ -393,6 +398,11 @@ export declare const CAPABILITIES: {
393
398
  readonly flag: "--schema-max-retries";
394
399
  readonly kind: "value";
395
400
  readonly unless: null;
401
+ }, {
402
+ readonly option: "serverOverloadedMaxRetries";
403
+ readonly flag: "--server-overloaded-max-retries";
404
+ readonly kind: "value";
405
+ readonly unless: null;
396
406
  }, {
397
407
  readonly option: "outputDir";
398
408
  readonly flag: "--output-dir";
@@ -143,6 +143,12 @@ export const CAPABILITIES = {
143
143
  kind: "value",
144
144
  unless: null,
145
145
  },
146
+ {
147
+ option: "serverOverloadedMaxRetries",
148
+ flag: "--server-overloaded-max-retries",
149
+ kind: "value",
150
+ unless: null,
151
+ },
146
152
  {
147
153
  option: "outputDir",
148
154
  flag: "--output-dir",
@@ -425,6 +431,12 @@ export const CAPABILITIES = {
425
431
  kind: "value",
426
432
  unless: null,
427
433
  },
434
+ {
435
+ option: "serverOverloadedMaxRetries",
436
+ flag: "--server-overloaded-max-retries",
437
+ kind: "value",
438
+ unless: null,
439
+ },
428
440
  {
429
441
  option: "outputDir",
430
442
  flag: "--output-dir",
@@ -68,6 +68,7 @@ export interface ConfigReport {
68
68
  schema_file: Field3;
69
69
  schema_max_retries: Field7;
70
70
  schema_version: string;
71
+ server_overloaded_max_retries: Field7;
71
72
  stream: Field1;
72
73
  system: Field3;
73
74
  timeout: Field5;
@@ -57,7 +57,7 @@ export type ControlVerb = "interrupt";
57
57
  * new variant is a report `schema_version` bump like any other enum value, since
58
58
  * a consumer matching exhaustively learns of it only from the version.
59
59
  */
60
- export type FallThroughReason = "not-installed" | "spawn-error" | "auth" | "quota" | "session-not-found" | "untrusted-directory" | "input-too-large" | "model-mismatch" | "model-not-found" | "rate-limit";
60
+ export type FallThroughReason = "not-installed" | "spawn-error" | "auth" | "quota" | "session-not-found" | "untrusted-directory" | "input-too-large" | "model-mismatch" | "model-not-found" | "rate-limit" | "server-overloaded";
61
61
  export type ToolCallStatus = "completed" | "failed" | "timeout" | "interrupted";
62
62
  /**
63
63
  * How a normalized tool interval was obtained.
@@ -68,13 +68,13 @@ export type TimingSource = "provider_measured" | "stdout_observed";
68
68
  * harness's output. It is the single source for the `failure_kind` contract
69
69
  * value: serialized as the snake_case token a consumer reads in the report
70
70
  * (`auth`, `rate_limit`, `model_not_found`, `quota`, `session_not_found`,
71
- * `tool_deferred`), so the wire shape is unchanged — modeling it as an enum
71
+ * `tool_deferred`, `server_overloaded`), so the wire shape is unchanged — modeling it as an enum
72
72
  * keeps a misspelled or invalid kind unrepresentable and gives every
73
73
  * producer/consumer (classifier, `is_failure`, the fallback fall-through rule,
74
74
  * the report, history) one definition to share instead of scattered string
75
75
  * literals.
76
76
  */
77
- export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch";
77
+ export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | "server_overloaded";
78
78
  /**
79
79
  * How a harness emits its result, which decides how `text` is extracted.
80
80
  *
@@ -127,8 +127,9 @@ export type ExecutionTelemetry = {
127
127
  *
128
128
  * - **Tool events.** A recorded tool call is the harness acting on the task.
129
129
  * - **Usage accounting.** [`Usage::reports_billed_work`][billed] — the same definition
130
- * `signals::record_reports_work` classifies a raw harness record with, so the
131
- * two readings of "billed" are one contract with one implementation.
130
+ * `signals::record_work_evidence` reads a raw harness record with, and it answers
131
+ * in this same type, so the two readings of "billed" are one contract with one
132
+ * implementation.
132
133
  *
133
134
  * It is also a **published reading**, not only an internal one: a run that
134
135
  * failed with nothing to classify carries it as [`RunResult::work`] and in its
@@ -420,11 +421,11 @@ export interface RunResult {
420
421
  * `status`, which records oneharness's relationship to the process. Two
421
422
  * families: coarse reasons for a non-zero run (`auth`, `rate_limit`,
422
423
  * `model_not_found`, `quota`, `session_not_found`, `untrusted_directory`,
423
- * `input_too_large`, `model_mismatch`), and `tool_deferred` — a run that exited
424
- * *cleanly* but only deferred a builtin tool call instead of executing it
425
- * (Claude Code bridge/managed deployments), so it did no useful work. The
426
- * deferred case is the only `failure_kind` that can appear on a `status: ok`
427
- * run, and it also marks the run as failed for exit-code purposes.
424
+ * `input_too_large`, `model_mismatch`, `server_overloaded`), and
425
+ * `tool_deferred` — a run that only deferred a builtin tool call instead of
426
+ * executing it (Claude Code bridge/managed deployments), so it did no useful
427
+ * work. Both `tool_deferred` and `server_overloaded` can accompany a clean
428
+ * transport exit; either still marks the run as failed for exit-code purposes.
428
429
  * Serialized as its snake_case token (see [`FailureKind`]).
429
430
  */
430
431
  failure_kind: FailureKind | null;
@@ -6,7 +6,7 @@ export type HistoryLine = ({
6
6
  harness: string;
7
7
  harness_id?: string | null | undefined;
8
8
  run_id: string;
9
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
9
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
10
10
  type: "event";
11
11
  variant?: string | null | undefined;
12
12
  [k: string]: unknown;
@@ -27,7 +27,7 @@ export type HistoryLine = ({
27
27
  [k: string]: unknown;
28
28
  } | ({
29
29
  error: string;
30
- schema_version?: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | undefined;
30
+ schema_version?: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | undefined;
31
31
  [k: string]: unknown;
32
32
  } & ({
33
33
  status?: "nonzero" | "timeout" | "cancelled" | "spawn-error" | "skipped" | undefined;
@@ -39,7 +39,7 @@ export type HistoryLine = ({
39
39
  work?: null | undefined;
40
40
  [k: string]: unknown;
41
41
  } | {
42
- schema_version?: "1.7" | "1.8" | undefined;
42
+ schema_version?: "1.7" | "1.8" | "1.9" | undefined;
43
43
  status?: "nonzero" | "timeout" | "cancelled" | undefined;
44
44
  work: "done" | "none";
45
45
  [k: string]: unknown;
@@ -48,31 +48,37 @@ export type HistoryLine = ({
48
48
  [k: string]: unknown;
49
49
  } | {
50
50
  observed_model: string;
51
- schema_version?: "1.8" | undefined;
51
+ schema_version?: "1.8" | "1.9" | undefined;
52
52
  [k: string]: unknown;
53
53
  }) & ({
54
54
  status?: "ok" | "nonzero" | "timeout" | "spawn-error" | "skipped" | "planned" | undefined;
55
55
  [k: string]: unknown;
56
56
  } | {
57
- schema_version?: "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | undefined;
57
+ schema_version?: "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | undefined;
58
58
  [k: string]: unknown;
59
59
  }) & (({
60
- failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | null;
60
+ failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | "server_overloaded" | null;
61
61
  [k: string]: unknown;
62
62
  } | {
63
- schema_version?: "1.5" | "1.6" | "1.7" | "1.8" | undefined;
63
+ schema_version?: "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | undefined;
64
64
  [k: string]: unknown;
65
65
  }) & ({
66
- failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "model_mismatch" | null;
66
+ failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "model_mismatch" | "server_overloaded" | null;
67
67
  [k: string]: unknown;
68
68
  } | {
69
- schema_version?: "1.6" | "1.7" | "1.8" | undefined;
69
+ schema_version?: "1.6" | "1.7" | "1.8" | "1.9" | undefined;
70
70
  [k: string]: unknown;
71
71
  }) & ({
72
- failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | null;
72
+ failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "server_overloaded" | null;
73
73
  [k: string]: unknown;
74
74
  } | {
75
- schema_version?: "1.8" | undefined;
75
+ schema_version?: "1.8" | "1.9" | undefined;
76
+ [k: string]: unknown;
77
+ }) & ({
78
+ failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | null;
79
+ [k: string]: unknown;
80
+ } | {
81
+ schema_version?: "1.9" | undefined;
76
82
  [k: string]: unknown;
77
83
  })) & ({
78
84
  duration_ms: number;
@@ -100,7 +106,7 @@ export type HistoryLine = ({
100
106
  permission_mode: PermissionMode;
101
107
  project: string;
102
108
  prompt: string;
103
- schema_version: "1.0" | "1.1" | "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
109
+ schema_version: "1.0" | "1.1" | "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
104
110
  session: string;
105
111
  session_id: string | null;
106
112
  started_at: string;
@@ -145,7 +151,7 @@ export type HistoryLine = ({
145
151
  permission_mode: PermissionMode;
146
152
  project: string;
147
153
  prompt: string;
148
- schema_version: "1.0" | "1.1" | "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
154
+ schema_version: "1.0" | "1.1" | "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
149
155
  session: string;
150
156
  session_id: string | null;
151
157
  started_at: string;
@@ -190,7 +196,7 @@ export type HistoryLine = ({
190
196
  permission_mode: PermissionMode;
191
197
  project: string;
192
198
  prompt: string;
193
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
199
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
194
200
  session: string;
195
201
  session_id: string | null;
196
202
  started_at?: never | undefined;
@@ -235,7 +241,7 @@ export type HistoryLine = ({
235
241
  permission_mode: PermissionMode;
236
242
  project: string;
237
243
  prompt: string;
238
- schema_version: "1.0" | "1.1" | "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
244
+ schema_version: "1.0" | "1.1" | "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
239
245
  session: string;
240
246
  session_id: string | null;
241
247
  started_at?: never | undefined;
@@ -280,7 +286,7 @@ export type HistoryLine = ({
280
286
  permission_mode: PermissionMode;
281
287
  project: string;
282
288
  prompt: string;
283
- schema_version: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
289
+ schema_version: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
284
290
  session: string;
285
291
  session_id: string | null;
286
292
  started_at: string;
@@ -325,7 +331,7 @@ export type HistoryLine = ({
325
331
  permission_mode: PermissionMode;
326
332
  project: string;
327
333
  prompt: string;
328
- schema_version: "1.0" | "1.1" | "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
334
+ schema_version: "1.0" | "1.1" | "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
329
335
  session: string;
330
336
  session_id: string | null;
331
337
  started_at?: never | undefined;
@@ -355,13 +361,13 @@ export type TimingSource = "provider_measured" | "stdout_observed";
355
361
  * harness's output. It is the single source for the `failure_kind` contract
356
362
  * value: serialized as the snake_case token a consumer reads in the report
357
363
  * (`auth`, `rate_limit`, `model_not_found`, `quota`, `session_not_found`,
358
- * `tool_deferred`), so the wire shape is unchanged — modeling it as an enum
364
+ * `tool_deferred`, `server_overloaded`), so the wire shape is unchanged — modeling it as an enum
359
365
  * keeps a misspelled or invalid kind unrepresentable and gives every
360
366
  * producer/consumer (classifier, `is_failure`, the fallback fall-through rule,
361
367
  * the report, history) one definition to share instead of scattered string
362
368
  * literals.
363
369
  */
364
- export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch";
370
+ export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | "server_overloaded";
365
371
  /**
366
372
  * The unified approval mode, from least to most autonomy. A harness may not
367
373
  * support every value (see [`crate::domain::harness::HarnessSpec::mode`]); the
@@ -377,8 +383,9 @@ export type PermissionMode = "read-only" | "plan" | "default" | "edit" | "auto"
377
383
  *
378
384
  * - **Tool events.** A recorded tool call is the harness acting on the task.
379
385
  * - **Usage accounting.** [`Usage::reports_billed_work`][billed] — the same definition
380
- * `signals::record_reports_work` classifies a raw harness record with, so the
381
- * two readings of "billed" are one contract with one implementation.
386
+ * `signals::record_work_evidence` reads a raw harness record with, and it answers
387
+ * in this same type, so the two readings of "billed" are one contract with one
388
+ * implementation.
382
389
  *
383
390
  * It is also a **published reading**, not only an internal one: a run that
384
391
  * failed with nothing to classify carries it as [`RunResult::work`] and in its
@@ -112,7 +112,7 @@ export type HistoryRecord = {
112
112
  * run's single prompt).
113
113
  */
114
114
  prompt: string;
115
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
115
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
116
116
  /**
117
117
  * The oneharness session id this run belongs to (the history file's stem).
118
118
  */
@@ -412,7 +412,7 @@ export type HistoryRecord = {
412
412
  * run's single prompt).
413
413
  */
414
414
  prompt: string;
415
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
415
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
416
416
  /**
417
417
  * The oneharness session id this run belongs to (the history file's stem).
418
418
  */
@@ -539,7 +539,7 @@ export type HistoryRecord = {
539
539
  * run's single prompt).
540
540
  */
541
541
  prompt: string;
542
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
542
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
543
543
  /**
544
544
  * The oneharness session id this run belongs to (the history file's stem).
545
545
  */
@@ -666,7 +666,7 @@ export type HistoryRecord = {
666
666
  * run's single prompt).
667
667
  */
668
668
  prompt: string;
669
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
669
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
670
670
  /**
671
671
  * The oneharness session id this run belongs to (the history file's stem).
672
672
  */
@@ -793,7 +793,7 @@ export type HistoryRecord = {
793
793
  * run's single prompt).
794
794
  */
795
795
  prompt: string;
796
- schema_version: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
796
+ schema_version: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
797
797
  /**
798
798
  * The oneharness session id this run belongs to (the history file's stem).
799
799
  */
@@ -1260,13 +1260,13 @@ export type TimingSource = "provider_measured" | "stdout_observed";
1260
1260
  * harness's output. It is the single source for the `failure_kind` contract
1261
1261
  * value: serialized as the snake_case token a consumer reads in the report
1262
1262
  * (`auth`, `rate_limit`, `model_not_found`, `quota`, `session_not_found`,
1263
- * `tool_deferred`), so the wire shape is unchanged — modeling it as an enum
1263
+ * `tool_deferred`, `server_overloaded`), so the wire shape is unchanged — modeling it as an enum
1264
1264
  * keeps a misspelled or invalid kind unrepresentable and gives every
1265
1265
  * producer/consumer (classifier, `is_failure`, the fallback fall-through rule,
1266
1266
  * the report, history) one definition to share instead of scattered string
1267
1267
  * literals.
1268
1268
  */
1269
- export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch";
1269
+ export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | "server_overloaded";
1270
1270
  /**
1271
1271
  * The outcome of attempting to run one harness.
1272
1272
  */
@@ -1279,8 +1279,9 @@ export type Status = "ok" | "nonzero" | "timeout" | "cancelled" | "spawn-error"
1279
1279
  *
1280
1280
  * - **Tool events.** A recorded tool call is the harness acting on the task.
1281
1281
  * - **Usage accounting.** [`Usage::reports_billed_work`][billed] — the same definition
1282
- * `signals::record_reports_work` classifies a raw harness record with, so the
1283
- * two readings of "billed" are one contract with one implementation.
1282
+ * `signals::record_work_evidence` reads a raw harness record with, and it answers
1283
+ * in this same type, so the two readings of "billed" are one contract with one
1284
+ * implementation.
1284
1285
  *
1285
1286
  * It is also a **published reading**, not only an internal one: a run that
1286
1287
  * failed with nothing to classify carries it as [`RunResult::work`] and in its
@@ -1296,7 +1297,7 @@ export type HistoryRecords = (({
1296
1297
  [k: string]: unknown;
1297
1298
  } | ({
1298
1299
  error: string;
1299
- schema_version?: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | undefined;
1300
+ schema_version?: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | undefined;
1300
1301
  [k: string]: unknown;
1301
1302
  } & ({
1302
1303
  status?: "nonzero" | "timeout" | "cancelled" | "spawn-error" | "skipped" | undefined;
@@ -1308,7 +1309,7 @@ export type HistoryRecords = (({
1308
1309
  work?: null | undefined;
1309
1310
  [k: string]: unknown;
1310
1311
  } | {
1311
- schema_version?: "1.7" | "1.8" | undefined;
1312
+ schema_version?: "1.7" | "1.8" | "1.9" | undefined;
1312
1313
  status?: "nonzero" | "timeout" | "cancelled" | undefined;
1313
1314
  work: "done" | "none";
1314
1315
  [k: string]: unknown;
@@ -1317,31 +1318,37 @@ export type HistoryRecords = (({
1317
1318
  [k: string]: unknown;
1318
1319
  } | {
1319
1320
  observed_model: string;
1320
- schema_version?: "1.8" | undefined;
1321
+ schema_version?: "1.8" | "1.9" | undefined;
1321
1322
  [k: string]: unknown;
1322
1323
  }) & ({
1323
1324
  status?: "ok" | "nonzero" | "timeout" | "spawn-error" | "skipped" | "planned" | undefined;
1324
1325
  [k: string]: unknown;
1325
1326
  } | {
1326
- schema_version?: "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | undefined;
1327
+ schema_version?: "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | undefined;
1327
1328
  [k: string]: unknown;
1328
1329
  }) & (({
1329
- failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | null;
1330
+ failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | "server_overloaded" | null;
1330
1331
  [k: string]: unknown;
1331
1332
  } | {
1332
- schema_version?: "1.5" | "1.6" | "1.7" | "1.8" | undefined;
1333
+ schema_version?: "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | undefined;
1333
1334
  [k: string]: unknown;
1334
1335
  }) & ({
1335
- failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "model_mismatch" | null;
1336
+ failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "model_mismatch" | "server_overloaded" | null;
1336
1337
  [k: string]: unknown;
1337
1338
  } | {
1338
- schema_version?: "1.6" | "1.7" | "1.8" | undefined;
1339
+ schema_version?: "1.6" | "1.7" | "1.8" | "1.9" | undefined;
1339
1340
  [k: string]: unknown;
1340
1341
  }) & ({
1341
- failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | null;
1342
+ failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "server_overloaded" | null;
1342
1343
  [k: string]: unknown;
1343
1344
  } | {
1344
- schema_version?: "1.8" | undefined;
1345
+ schema_version?: "1.8" | "1.9" | undefined;
1346
+ [k: string]: unknown;
1347
+ }) & ({
1348
+ failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | null;
1349
+ [k: string]: unknown;
1350
+ } | {
1351
+ schema_version?: "1.9" | undefined;
1345
1352
  [k: string]: unknown;
1346
1353
  })) & HistoryRecord)[];
1347
1354
  /**
@@ -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" | "1.7" | "1.8" | undefined;
17
+ schema_version?: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | undefined;
18
18
  [k: string]: unknown;
19
19
  } & ({
20
20
  status?: "nonzero" | "timeout" | "cancelled" | "spawn-error" | "skipped" | undefined;
@@ -26,7 +26,7 @@ export type HistoryStreamEnvelope = {
26
26
  work?: null | undefined;
27
27
  [k: string]: unknown;
28
28
  } | {
29
- schema_version?: "1.7" | "1.8" | undefined;
29
+ schema_version?: "1.7" | "1.8" | "1.9" | undefined;
30
30
  status?: "nonzero" | "timeout" | "cancelled" | undefined;
31
31
  work: "done" | "none";
32
32
  [k: string]: unknown;
@@ -35,31 +35,37 @@ export type HistoryStreamEnvelope = {
35
35
  [k: string]: unknown;
36
36
  } | {
37
37
  observed_model: string;
38
- schema_version?: "1.8" | undefined;
38
+ schema_version?: "1.8" | "1.9" | undefined;
39
39
  [k: string]: unknown;
40
40
  }) & ({
41
41
  status?: "ok" | "nonzero" | "timeout" | "spawn-error" | "skipped" | "planned" | undefined;
42
42
  [k: string]: unknown;
43
43
  } | {
44
- schema_version?: "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | undefined;
44
+ schema_version?: "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | undefined;
45
45
  [k: string]: unknown;
46
46
  }) & (({
47
- failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | null;
47
+ failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | "server_overloaded" | null;
48
48
  [k: string]: unknown;
49
49
  } | {
50
- schema_version?: "1.5" | "1.6" | "1.7" | "1.8" | undefined;
50
+ schema_version?: "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | undefined;
51
51
  [k: string]: unknown;
52
52
  }) & ({
53
- failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "model_mismatch" | null;
53
+ failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "model_mismatch" | "server_overloaded" | null;
54
54
  [k: string]: unknown;
55
55
  } | {
56
- schema_version?: "1.6" | "1.7" | "1.8" | undefined;
56
+ schema_version?: "1.6" | "1.7" | "1.8" | "1.9" | undefined;
57
57
  [k: string]: unknown;
58
58
  }) & ({
59
- failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | null;
59
+ failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "server_overloaded" | null;
60
60
  [k: string]: unknown;
61
61
  } | {
62
- schema_version?: "1.8" | undefined;
62
+ schema_version?: "1.8" | "1.9" | undefined;
63
+ [k: string]: unknown;
64
+ }) & ({
65
+ failure_kind?: "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | null;
66
+ [k: string]: unknown;
67
+ } | {
68
+ schema_version?: "1.9" | undefined;
63
69
  [k: string]: unknown;
64
70
  })) & HistoryRecord;
65
71
  type: "record";
@@ -183,7 +189,7 @@ export type HistoryRecord = {
183
189
  * run's single prompt).
184
190
  */
185
191
  prompt: string;
186
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
192
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
187
193
  /**
188
194
  * The oneharness session id this run belongs to (the history file's stem).
189
195
  */
@@ -483,7 +489,7 @@ export type HistoryRecord = {
483
489
  * run's single prompt).
484
490
  */
485
491
  prompt: string;
486
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
492
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
487
493
  /**
488
494
  * The oneharness session id this run belongs to (the history file's stem).
489
495
  */
@@ -610,7 +616,7 @@ export type HistoryRecord = {
610
616
  * run's single prompt).
611
617
  */
612
618
  prompt: string;
613
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
619
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
614
620
  /**
615
621
  * The oneharness session id this run belongs to (the history file's stem).
616
622
  */
@@ -737,7 +743,7 @@ export type HistoryRecord = {
737
743
  * run's single prompt).
738
744
  */
739
745
  prompt: string;
740
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
746
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
741
747
  /**
742
748
  * The oneharness session id this run belongs to (the history file's stem).
743
749
  */
@@ -864,7 +870,7 @@ export type HistoryRecord = {
864
870
  * run's single prompt).
865
871
  */
866
872
  prompt: string;
867
- schema_version: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
873
+ schema_version: "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
868
874
  /**
869
875
  * The oneharness session id this run belongs to (the history file's stem).
870
876
  */
@@ -1331,13 +1337,13 @@ export type TimingSource = "provider_measured" | "stdout_observed";
1331
1337
  * harness's output. It is the single source for the `failure_kind` contract
1332
1338
  * value: serialized as the snake_case token a consumer reads in the report
1333
1339
  * (`auth`, `rate_limit`, `model_not_found`, `quota`, `session_not_found`,
1334
- * `tool_deferred`), so the wire shape is unchanged — modeling it as an enum
1340
+ * `tool_deferred`, `server_overloaded`), so the wire shape is unchanged — modeling it as an enum
1335
1341
  * keeps a misspelled or invalid kind unrepresentable and gives every
1336
1342
  * producer/consumer (classifier, `is_failure`, the fallback fall-through rule,
1337
1343
  * the report, history) one definition to share instead of scattered string
1338
1344
  * literals.
1339
1345
  */
1340
- export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch";
1346
+ export type FailureKind = "auth" | "rate_limit" | "model_not_found" | "quota" | "session_not_found" | "tool_deferred" | "untrusted_directory" | "input_too_large" | "model_mismatch" | "server_overloaded";
1341
1347
  /**
1342
1348
  * The outcome of attempting to run one harness.
1343
1349
  */
@@ -1350,8 +1356,9 @@ export type Status = "ok" | "nonzero" | "timeout" | "cancelled" | "spawn-error"
1350
1356
  *
1351
1357
  * - **Tool events.** A recorded tool call is the harness acting on the task.
1352
1358
  * - **Usage accounting.** [`Usage::reports_billed_work`][billed] — the same definition
1353
- * `signals::record_reports_work` classifies a raw harness record with, so the
1354
- * two readings of "billed" are one contract with one implementation.
1359
+ * `signals::record_work_evidence` reads a raw harness record with, and it answers
1360
+ * in this same type, so the two readings of "billed" are one contract with one
1361
+ * implementation.
1355
1362
  *
1356
1363
  * It is also a **published reading**, not only an internal one: a run that
1357
1364
  * failed with nothing to classify carries it as [`RunResult::work`] and in its
@@ -1367,7 +1374,7 @@ export type HistoryEventLine = {
1367
1374
  harness: string;
1368
1375
  harness_id?: string | null | undefined;
1369
1376
  run_id: string;
1370
- schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8";
1377
+ schema_version: "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9";
1371
1378
  variant?: string | null | undefined;
1372
1379
  [k: string]: unknown;
1373
1380
  } | {