@oneharness/sdk 0.4.6 → 0.5.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.
@@ -1827,6 +1827,938 @@
1827
1827
  }
1828
1828
  }
1829
1829
  },
1830
+ "history_line": {
1831
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
1832
+ "title": "HistoryLine",
1833
+ "description": "One event-sourced history JSONL line.",
1834
+ "oneOf": [
1835
+ {
1836
+ "allOf": [
1837
+ {
1838
+ "description": "One normalized action observed during a run.",
1839
+ "type": "object",
1840
+ "properties": {
1841
+ "event": {
1842
+ "oneOf": [
1843
+ {
1844
+ "allOf": [
1845
+ {
1846
+ "$ref": "#/$defs/ActionEvent"
1847
+ },
1848
+ {
1849
+ "type": "object",
1850
+ "properties": {
1851
+ "duration_ms": {
1852
+ "type": "integer",
1853
+ "minimum": 0
1854
+ },
1855
+ "finished_at": {
1856
+ "type": "string"
1857
+ },
1858
+ "kind": {
1859
+ "type": "string",
1860
+ "const": "tool_call"
1861
+ },
1862
+ "started_at": {
1863
+ "type": "string"
1864
+ },
1865
+ "status": {
1866
+ "type": "string",
1867
+ "const": "completed"
1868
+ },
1869
+ "tool_call_id": {
1870
+ "type": "string",
1871
+ "minLength": 1
1872
+ }
1873
+ },
1874
+ "required": [
1875
+ "kind",
1876
+ "tool_call_id",
1877
+ "started_at",
1878
+ "status",
1879
+ "finished_at",
1880
+ "duration_ms"
1881
+ ]
1882
+ }
1883
+ ]
1884
+ },
1885
+ {
1886
+ "allOf": [
1887
+ {
1888
+ "$ref": "#/$defs/ActionEvent"
1889
+ },
1890
+ {
1891
+ "type": "object",
1892
+ "properties": {
1893
+ "duration_ms": {
1894
+ "type": "integer",
1895
+ "minimum": 0
1896
+ },
1897
+ "finished_at": {
1898
+ "type": "string"
1899
+ },
1900
+ "kind": {
1901
+ "type": "string",
1902
+ "const": "tool_call"
1903
+ },
1904
+ "started_at": {
1905
+ "type": "string"
1906
+ },
1907
+ "status": {
1908
+ "type": "string",
1909
+ "const": "failed"
1910
+ },
1911
+ "tool_call_id": {
1912
+ "type": "string",
1913
+ "minLength": 1
1914
+ }
1915
+ },
1916
+ "required": [
1917
+ "kind",
1918
+ "tool_call_id",
1919
+ "started_at",
1920
+ "status",
1921
+ "finished_at",
1922
+ "duration_ms"
1923
+ ]
1924
+ }
1925
+ ]
1926
+ },
1927
+ {
1928
+ "allOf": [
1929
+ {
1930
+ "$ref": "#/$defs/ActionEvent"
1931
+ },
1932
+ {
1933
+ "type": "object",
1934
+ "properties": {
1935
+ "kind": {
1936
+ "type": "string",
1937
+ "const": "tool_call"
1938
+ },
1939
+ "started_at": {
1940
+ "type": "string"
1941
+ },
1942
+ "status": {
1943
+ "type": "string",
1944
+ "const": "timeout"
1945
+ },
1946
+ "tool_call_id": {
1947
+ "type": "string",
1948
+ "minLength": 1
1949
+ }
1950
+ },
1951
+ "required": [
1952
+ "kind",
1953
+ "tool_call_id",
1954
+ "started_at",
1955
+ "status"
1956
+ ]
1957
+ }
1958
+ ]
1959
+ },
1960
+ {
1961
+ "allOf": [
1962
+ {
1963
+ "$ref": "#/$defs/ActionEvent"
1964
+ },
1965
+ {
1966
+ "type": "object",
1967
+ "properties": {
1968
+ "kind": {
1969
+ "type": "string",
1970
+ "const": "tool_call"
1971
+ },
1972
+ "started_at": {
1973
+ "type": "string"
1974
+ },
1975
+ "status": {
1976
+ "type": "string",
1977
+ "const": "interrupted"
1978
+ },
1979
+ "tool_call_id": {
1980
+ "type": "string",
1981
+ "minLength": 1
1982
+ }
1983
+ },
1984
+ "required": [
1985
+ "kind",
1986
+ "tool_call_id",
1987
+ "started_at",
1988
+ "status"
1989
+ ]
1990
+ }
1991
+ ]
1992
+ },
1993
+ {
1994
+ "allOf": [
1995
+ {
1996
+ "$ref": "#/$defs/ActionEvent"
1997
+ },
1998
+ {
1999
+ "type": "object",
2000
+ "properties": {
2001
+ "kind": {
2002
+ "type": "string",
2003
+ "not": {
2004
+ "pattern": "^tool_call$"
2005
+ }
2006
+ }
2007
+ }
2008
+ }
2009
+ ]
2010
+ }
2011
+ ]
2012
+ },
2013
+ "harness": {
2014
+ "type": "string"
2015
+ },
2016
+ "run_id": {
2017
+ "type": "string",
2018
+ "maxLength": 36,
2019
+ "minLength": 36,
2020
+ "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
2021
+ },
2022
+ "schema_version": {
2023
+ "type": "string",
2024
+ "const": "1.0"
2025
+ },
2026
+ "type": {
2027
+ "type": "string",
2028
+ "const": "event"
2029
+ }
2030
+ },
2031
+ "required": [
2032
+ "schema_version",
2033
+ "run_id",
2034
+ "harness",
2035
+ "event",
2036
+ "type"
2037
+ ]
2038
+ }
2039
+ ]
2040
+ },
2041
+ {
2042
+ "allOf": [
2043
+ {
2044
+ "oneOf": [
2045
+ {
2046
+ "allOf": [
2047
+ {
2048
+ "description": "The terminal summary for one harness run.",
2049
+ "type": "object",
2050
+ "properties": {
2051
+ "duration_ms": {
2052
+ "type": "integer",
2053
+ "minimum": 0
2054
+ },
2055
+ "exit_code": {
2056
+ "type": [
2057
+ "integer",
2058
+ "null"
2059
+ ],
2060
+ "format": "int32"
2061
+ },
2062
+ "failure_kind": {
2063
+ "anyOf": [
2064
+ {
2065
+ "$ref": "#/$defs/FailureKind"
2066
+ },
2067
+ {
2068
+ "type": "null"
2069
+ }
2070
+ ]
2071
+ },
2072
+ "finished_at": {
2073
+ "type": "string"
2074
+ },
2075
+ "harness": {
2076
+ "type": "string"
2077
+ },
2078
+ "history_id": {
2079
+ "type": "string",
2080
+ "maxLength": 36,
2081
+ "minLength": 36,
2082
+ "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
2083
+ },
2084
+ "labels": {
2085
+ "$ref": "#/$defs/HistoryLabels"
2086
+ },
2087
+ "model": {
2088
+ "type": [
2089
+ "string",
2090
+ "null"
2091
+ ]
2092
+ },
2093
+ "model_ms": {
2094
+ "type": "integer",
2095
+ "minimum": 0
2096
+ },
2097
+ "name": {
2098
+ "type": "string"
2099
+ },
2100
+ "permission_mode": {
2101
+ "$ref": "#/$defs/PermissionMode"
2102
+ },
2103
+ "project": {
2104
+ "type": "string"
2105
+ },
2106
+ "prompt": {
2107
+ "type": "string"
2108
+ },
2109
+ "schema_version": {
2110
+ "type": "string",
2111
+ "const": "1.0"
2112
+ },
2113
+ "session": {
2114
+ "type": "string"
2115
+ },
2116
+ "session_id": {
2117
+ "type": [
2118
+ "string",
2119
+ "null"
2120
+ ]
2121
+ },
2122
+ "started_at": {
2123
+ "type": "string",
2124
+ "minLength": 1
2125
+ },
2126
+ "status": {
2127
+ "type": "string",
2128
+ "enum": [
2129
+ "ok",
2130
+ "nonzero"
2131
+ ]
2132
+ },
2133
+ "text": {
2134
+ "type": [
2135
+ "string",
2136
+ "null"
2137
+ ]
2138
+ },
2139
+ "text_source": {
2140
+ "type": [
2141
+ "string",
2142
+ "null"
2143
+ ]
2144
+ },
2145
+ "time_to_first_token_ms": {
2146
+ "type": [
2147
+ "integer",
2148
+ "null"
2149
+ ],
2150
+ "format": "uint128",
2151
+ "minimum": 0
2152
+ },
2153
+ "timestamp": {
2154
+ "type": "string"
2155
+ },
2156
+ "tool_ms": {
2157
+ "type": "integer",
2158
+ "minimum": 0
2159
+ },
2160
+ "type": {
2161
+ "type": "string",
2162
+ "const": "run"
2163
+ },
2164
+ "usage": {
2165
+ "$ref": "#/$defs/Usage"
2166
+ }
2167
+ },
2168
+ "required": [
2169
+ "schema_version",
2170
+ "history_id",
2171
+ "session",
2172
+ "name",
2173
+ "project",
2174
+ "timestamp",
2175
+ "harness",
2176
+ "model",
2177
+ "prompt",
2178
+ "permission_mode",
2179
+ "status",
2180
+ "exit_code",
2181
+ "duration_ms",
2182
+ "finished_at",
2183
+ "text",
2184
+ "text_source",
2185
+ "usage",
2186
+ "session_id",
2187
+ "failure_kind",
2188
+ "type",
2189
+ "started_at",
2190
+ "model_ms",
2191
+ "tool_ms"
2192
+ ]
2193
+ }
2194
+ ]
2195
+ },
2196
+ {
2197
+ "allOf": [
2198
+ {
2199
+ "description": "The terminal summary for one harness run.",
2200
+ "type": "object",
2201
+ "properties": {
2202
+ "duration_ms": {
2203
+ "type": "integer",
2204
+ "minimum": 0
2205
+ },
2206
+ "exit_code": {
2207
+ "type": [
2208
+ "integer",
2209
+ "null"
2210
+ ],
2211
+ "format": "int32"
2212
+ },
2213
+ "failure_kind": {
2214
+ "anyOf": [
2215
+ {
2216
+ "$ref": "#/$defs/FailureKind"
2217
+ },
2218
+ {
2219
+ "type": "null"
2220
+ }
2221
+ ]
2222
+ },
2223
+ "finished_at": {
2224
+ "type": [
2225
+ "string",
2226
+ "null"
2227
+ ]
2228
+ },
2229
+ "harness": {
2230
+ "type": "string"
2231
+ },
2232
+ "history_id": {
2233
+ "type": "string",
2234
+ "maxLength": 36,
2235
+ "minLength": 36,
2236
+ "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
2237
+ },
2238
+ "labels": {
2239
+ "$ref": "#/$defs/HistoryLabels"
2240
+ },
2241
+ "model": {
2242
+ "type": [
2243
+ "string",
2244
+ "null"
2245
+ ]
2246
+ },
2247
+ "model_ms": {
2248
+ "type": "integer",
2249
+ "minimum": 0
2250
+ },
2251
+ "name": {
2252
+ "type": "string"
2253
+ },
2254
+ "permission_mode": {
2255
+ "$ref": "#/$defs/PermissionMode"
2256
+ },
2257
+ "project": {
2258
+ "type": "string"
2259
+ },
2260
+ "prompt": {
2261
+ "type": "string"
2262
+ },
2263
+ "schema_version": {
2264
+ "type": "string",
2265
+ "const": "1.0"
2266
+ },
2267
+ "session": {
2268
+ "type": "string"
2269
+ },
2270
+ "session_id": {
2271
+ "type": [
2272
+ "string",
2273
+ "null"
2274
+ ]
2275
+ },
2276
+ "started_at": {
2277
+ "type": "string",
2278
+ "minLength": 1
2279
+ },
2280
+ "status": {
2281
+ "type": "string",
2282
+ "enum": [
2283
+ "timeout",
2284
+ "spawn_error",
2285
+ "skipped",
2286
+ "planned"
2287
+ ]
2288
+ },
2289
+ "text": {
2290
+ "type": [
2291
+ "string",
2292
+ "null"
2293
+ ]
2294
+ },
2295
+ "text_source": {
2296
+ "type": [
2297
+ "string",
2298
+ "null"
2299
+ ]
2300
+ },
2301
+ "time_to_first_token_ms": {
2302
+ "type": [
2303
+ "integer",
2304
+ "null"
2305
+ ],
2306
+ "format": "uint128",
2307
+ "minimum": 0
2308
+ },
2309
+ "timestamp": {
2310
+ "type": "string"
2311
+ },
2312
+ "tool_ms": {
2313
+ "type": "integer",
2314
+ "minimum": 0
2315
+ },
2316
+ "type": {
2317
+ "type": "string",
2318
+ "const": "run"
2319
+ },
2320
+ "usage": {
2321
+ "$ref": "#/$defs/Usage"
2322
+ }
2323
+ },
2324
+ "required": [
2325
+ "schema_version",
2326
+ "history_id",
2327
+ "session",
2328
+ "name",
2329
+ "project",
2330
+ "timestamp",
2331
+ "harness",
2332
+ "model",
2333
+ "prompt",
2334
+ "permission_mode",
2335
+ "status",
2336
+ "exit_code",
2337
+ "duration_ms",
2338
+ "finished_at",
2339
+ "text",
2340
+ "text_source",
2341
+ "usage",
2342
+ "session_id",
2343
+ "failure_kind",
2344
+ "type",
2345
+ "started_at",
2346
+ "model_ms",
2347
+ "tool_ms"
2348
+ ]
2349
+ }
2350
+ ]
2351
+ },
2352
+ {
2353
+ "allOf": [
2354
+ {
2355
+ "description": "The terminal summary for one harness run.",
2356
+ "type": "object",
2357
+ "properties": {
2358
+ "duration_ms": {
2359
+ "type": [
2360
+ "integer",
2361
+ "null"
2362
+ ],
2363
+ "format": "uint128",
2364
+ "minimum": 0
2365
+ },
2366
+ "exit_code": {
2367
+ "type": [
2368
+ "integer",
2369
+ "null"
2370
+ ],
2371
+ "format": "int32"
2372
+ },
2373
+ "failure_kind": {
2374
+ "anyOf": [
2375
+ {
2376
+ "$ref": "#/$defs/FailureKind"
2377
+ },
2378
+ {
2379
+ "type": "null"
2380
+ }
2381
+ ]
2382
+ },
2383
+ "finished_at": {
2384
+ "type": "null"
2385
+ },
2386
+ "harness": {
2387
+ "type": "string"
2388
+ },
2389
+ "history_id": {
2390
+ "type": "string",
2391
+ "maxLength": 36,
2392
+ "minLength": 36,
2393
+ "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
2394
+ },
2395
+ "labels": {
2396
+ "$ref": "#/$defs/HistoryLabels"
2397
+ },
2398
+ "model": {
2399
+ "type": [
2400
+ "string",
2401
+ "null"
2402
+ ]
2403
+ },
2404
+ "model_ms": false,
2405
+ "name": {
2406
+ "type": "string"
2407
+ },
2408
+ "permission_mode": {
2409
+ "$ref": "#/$defs/PermissionMode"
2410
+ },
2411
+ "project": {
2412
+ "type": "string"
2413
+ },
2414
+ "prompt": {
2415
+ "type": "string"
2416
+ },
2417
+ "schema_version": {
2418
+ "type": "string",
2419
+ "const": "1.0"
2420
+ },
2421
+ "session": {
2422
+ "type": "string"
2423
+ },
2424
+ "session_id": {
2425
+ "type": [
2426
+ "string",
2427
+ "null"
2428
+ ]
2429
+ },
2430
+ "started_at": false,
2431
+ "status": {
2432
+ "$ref": "#/$defs/Status"
2433
+ },
2434
+ "text": {
2435
+ "type": [
2436
+ "string",
2437
+ "null"
2438
+ ]
2439
+ },
2440
+ "text_source": {
2441
+ "type": [
2442
+ "string",
2443
+ "null"
2444
+ ]
2445
+ },
2446
+ "time_to_first_token_ms": false,
2447
+ "timestamp": {
2448
+ "type": "string"
2449
+ },
2450
+ "tool_ms": false,
2451
+ "type": {
2452
+ "type": "string",
2453
+ "const": "run"
2454
+ },
2455
+ "usage": {
2456
+ "$ref": "#/$defs/Usage"
2457
+ }
2458
+ },
2459
+ "required": [
2460
+ "schema_version",
2461
+ "history_id",
2462
+ "session",
2463
+ "name",
2464
+ "project",
2465
+ "timestamp",
2466
+ "harness",
2467
+ "model",
2468
+ "prompt",
2469
+ "permission_mode",
2470
+ "status",
2471
+ "exit_code",
2472
+ "duration_ms",
2473
+ "finished_at",
2474
+ "text",
2475
+ "text_source",
2476
+ "usage",
2477
+ "session_id",
2478
+ "failure_kind",
2479
+ "type"
2480
+ ]
2481
+ }
2482
+ ]
2483
+ }
2484
+ ]
2485
+ }
2486
+ ]
2487
+ }
2488
+ ],
2489
+ "$defs": {
2490
+ "ActionEvent": {
2491
+ "description": "One normalized action a harness took, harness-agnostic so a single consumer\nassertion works across harnesses. Every field is always serialized (null when\nabsent) so the shape is stable, mirroring the `usage` contract.",
2492
+ "type": "object",
2493
+ "properties": {
2494
+ "duration_ms": {
2495
+ "description": "Monotonic elapsed tool time. `None` means no terminal boundary was seen.",
2496
+ "type": [
2497
+ "integer",
2498
+ "null"
2499
+ ],
2500
+ "format": "uint128",
2501
+ "minimum": 0
2502
+ },
2503
+ "finished_at": {
2504
+ "type": [
2505
+ "string",
2506
+ "null"
2507
+ ]
2508
+ },
2509
+ "index": {
2510
+ "description": "Position of this event within the run, so \"≤ N tool calls\" and \"did X\nbefore Y\" are expressible from a stable ordering (also array order).",
2511
+ "type": "integer",
2512
+ "format": "uint",
2513
+ "minimum": 0
2514
+ },
2515
+ "input": {
2516
+ "description": "Structured, tool-shaped arguments (the command string, the file path),\nso a consumer asserts on specific args without re-parsing; `null` when the\nevent carries none (e.g. a `tool_result`)."
2517
+ },
2518
+ "kind": {
2519
+ "description": "The kind of event: `tool_call` (the model invoked a tool) or\n`tool_result` (the observation returned to the model). Left open for\nfuture kinds rather than an enum, so a new shape never breaks the field.",
2520
+ "type": "string"
2521
+ },
2522
+ "name": {
2523
+ "description": "Normalized tool name where knowable (e.g. `bash`, `Edit`); `null` for a\n`tool_result`, or when the harness did not name the tool.",
2524
+ "type": [
2525
+ "string",
2526
+ "null"
2527
+ ]
2528
+ },
2529
+ "output": {
2530
+ "description": "The result/observation text, when the trace exposes it; `null` otherwise.",
2531
+ "type": [
2532
+ "string",
2533
+ "null"
2534
+ ]
2535
+ },
2536
+ "started_at": {
2537
+ "description": "UTC interval bounds for tool execution, populated on history records.",
2538
+ "type": [
2539
+ "string",
2540
+ "null"
2541
+ ]
2542
+ },
2543
+ "status": {
2544
+ "description": "Terminal tool state, populated on history tool-call events.",
2545
+ "anyOf": [
2546
+ {
2547
+ "$ref": "#/$defs/ToolCallStatus"
2548
+ },
2549
+ {
2550
+ "type": "null"
2551
+ }
2552
+ ]
2553
+ },
2554
+ "tool_call_id": {
2555
+ "description": "Stable call identity within the session. Present on tool calls and their\nmatching results when the provider exposes an identity; history fills a\ndeterministic run-local identity for providers that do not.",
2556
+ "type": [
2557
+ "string",
2558
+ "null"
2559
+ ]
2560
+ }
2561
+ },
2562
+ "required": [
2563
+ "kind",
2564
+ "name",
2565
+ "input",
2566
+ "output",
2567
+ "index",
2568
+ "tool_call_id",
2569
+ "started_at",
2570
+ "finished_at",
2571
+ "duration_ms",
2572
+ "status"
2573
+ ]
2574
+ },
2575
+ "FailureKind": {
2576
+ "description": "The normalized, closed set of failure reasons oneharness can classify from a\nharness's output. It is the single source for the `failure_kind` contract\nvalue: serialized as the snake_case token a consumer reads in the report\n(`auth`, `rate_limit`, `model_not_found`, `quota`, `tool_deferred`), so the\nwire shape is unchanged — modeling it as an enum keeps a misspelled or\ninvalid kind unrepresentable and gives every producer/consumer (classifier,\n`is_failure`, the fallback fall-through rule, the report, history) one\ndefinition to share instead of scattered string literals.",
2577
+ "oneOf": [
2578
+ {
2579
+ "description": "Authentication / authorization rejected the request (401/403, missing or\ninvalid credentials).",
2580
+ "type": "string",
2581
+ "const": "auth"
2582
+ },
2583
+ {
2584
+ "description": "Rate limited (429, too many requests) — a transient condition of an\notherwise working, authenticated harness.",
2585
+ "type": "string",
2586
+ "const": "rate_limit"
2587
+ },
2588
+ {
2589
+ "description": "The requested model was not found / is invalid — a configuration mistake.",
2590
+ "type": "string",
2591
+ "const": "model_not_found"
2592
+ },
2593
+ {
2594
+ "description": "Out of quota / credits, or a billing problem — a provisioning failure.",
2595
+ "type": "string",
2596
+ "const": "quota"
2597
+ },
2598
+ {
2599
+ "description": "The harness deferred a builtin tool call instead of executing it, so a\nclean-exit run did no useful work (Claude Code bridge deployments; issue\n#1114). The only kind that can appear on a `status: ok` run.",
2600
+ "type": "string",
2601
+ "const": "tool_deferred"
2602
+ }
2603
+ ]
2604
+ },
2605
+ "HistoryLabels": {
2606
+ "type": "object",
2607
+ "additionalProperties": {
2608
+ "type": "string",
2609
+ "maxLength": 256,
2610
+ "minLength": 1,
2611
+ "not": {
2612
+ "pattern": "[\\u0000-\\u001f\\u007f-\\u009f]"
2613
+ }
2614
+ },
2615
+ "propertyNames": {
2616
+ "type": "string",
2617
+ "maxLength": 64,
2618
+ "not": {
2619
+ "pattern": "[^A-Za-z0-9._-]"
2620
+ },
2621
+ "pattern": "^[A-Za-z0-9]"
2622
+ }
2623
+ },
2624
+ "PermissionMode": {
2625
+ "description": "The unified approval mode, from least to most autonomy. A harness may not\nsupport every value (see [`crate::domain::harness::HarnessSpec::mode`]); the\ncommand layer refuses an unsupported one before spawning, never silently\ndowngrading it.",
2626
+ "oneOf": [
2627
+ {
2628
+ "description": "No mutations — the agent may read but not edit files or run commands —\n*without* the plan workflow: it just does whatever read-only work the task\nallows. Mapped to each harness's strongest per-run no-mutation enforcement\n(Codex's read-only sandbox, Claude's deny rules, Copilot's `--deny-tool`,\nCursor's `ask` mode). The enforced counterpart to [`Self::Plan`].",
2629
+ "type": "string",
2630
+ "const": "read-only"
2631
+ },
2632
+ {
2633
+ "description": "Read and propose only — like [`Self::ReadOnly`], but additionally engages\nthe harness's *plan* workflow: research the task and write a plan rather\nthan act. Supported only where a native plan mode exists (Claude/Qwen/\nCursor/Copilot, OpenCode's `plan` agent); harnesses with no plan workflow\n(Codex, Goose, Crush) reject it — use [`Self::ReadOnly`] for those.",
2634
+ "type": "string",
2635
+ "const": "plan"
2636
+ },
2637
+ {
2638
+ "description": "The harness's normal ask flow, mapped to its cleanest *non-interactive*\nvariant so a headless run never blocks waiting for input (Claude's\n`dontAsk` deny-and-continue, Goose's fail-closed `approve`, Copilot's\nauto-deny). Where no such variant exists the harness's [`ModeHeadless`]\nis [`ModeHeadless::Hangs`].",
2639
+ "type": "string",
2640
+ "const": "default"
2641
+ },
2642
+ {
2643
+ "description": "Auto-approve file edits, still gate shell/commands. (Claude's\n`acceptEdits`, Qwen's `auto-edit`.)",
2644
+ "type": "string",
2645
+ "const": "edit"
2646
+ },
2647
+ {
2648
+ "description": "Auto-approve operations the harness deems safe (a classifier), gate the\nrisky ones. (Claude's `auto`, Qwen's `auto`, Goose's `smart_approve`.)",
2649
+ "type": "string",
2650
+ "const": "auto"
2651
+ },
2652
+ {
2653
+ "description": "Approve everything — no prompts, no gating. The headless default, because\nan unattended agent otherwise hangs on the first approval. Every harness\nsupports it. (Claude's `bypassPermissions`, Codex's\n`--dangerously-bypass-approvals-and-sandbox`, Qwen/Crush `--yolo`, …)",
2654
+ "type": "string",
2655
+ "const": "bypass"
2656
+ }
2657
+ ]
2658
+ },
2659
+ "Status": {
2660
+ "description": "The outcome of attempting to run one harness.",
2661
+ "oneOf": [
2662
+ {
2663
+ "description": "Spawned and exited 0.",
2664
+ "type": "string",
2665
+ "const": "ok"
2666
+ },
2667
+ {
2668
+ "description": "Spawned and exited non-zero.",
2669
+ "type": "string",
2670
+ "const": "nonzero"
2671
+ },
2672
+ {
2673
+ "description": "Killed after exceeding the per-harness timeout.",
2674
+ "type": "string",
2675
+ "const": "timeout"
2676
+ },
2677
+ {
2678
+ "description": "The binary was resolved but could not be executed.",
2679
+ "type": "string",
2680
+ "const": "spawn-error"
2681
+ },
2682
+ {
2683
+ "description": "The binary was not found, so the harness was not run.",
2684
+ "type": "string",
2685
+ "const": "skipped"
2686
+ },
2687
+ {
2688
+ "description": "`--print-command`: the command was built but not executed.",
2689
+ "type": "string",
2690
+ "const": "planned"
2691
+ }
2692
+ ]
2693
+ },
2694
+ "ToolCallStatus": {
2695
+ "type": "string",
2696
+ "enum": [
2697
+ "completed",
2698
+ "failed",
2699
+ "timeout",
2700
+ "interrupted"
2701
+ ]
2702
+ },
2703
+ "Usage": {
2704
+ "description": "Normalized token/cost accounting. Every field is best-effort and independently\nnullable: a harness may report tokens but not dollar cost (cost is commonly\nabsent on subscription auth), or report nothing at all (plain-text harnesses).",
2705
+ "type": "object",
2706
+ "properties": {
2707
+ "cache_read_tokens": {
2708
+ "description": "Prompt tokens served from the provider's prompt cache (a cheap read of a\npreviously-written prefix), when the harness reports them. `None` when the\nharness does not surface cache counts — never `0` as a guess.",
2709
+ "type": [
2710
+ "integer",
2711
+ "null"
2712
+ ],
2713
+ "format": "uint64",
2714
+ "minimum": 0
2715
+ },
2716
+ "cache_write_tokens": {
2717
+ "description": "Prompt tokens written to the provider's prompt cache (a.k.a. cache\ncreation), when the harness reports them. `None` when not surfaced.",
2718
+ "type": [
2719
+ "integer",
2720
+ "null"
2721
+ ],
2722
+ "format": "uint64",
2723
+ "minimum": 0
2724
+ },
2725
+ "cost_usd": {
2726
+ "description": "Total cost in USD, when the harness reports it (often absent on\nsubscription auth, where there is no per-call dollar figure).",
2727
+ "type": [
2728
+ "number",
2729
+ "null"
2730
+ ],
2731
+ "format": "double"
2732
+ },
2733
+ "input_tokens": {
2734
+ "description": "Prompt/input tokens billed, when the harness reports them.",
2735
+ "type": [
2736
+ "integer",
2737
+ "null"
2738
+ ],
2739
+ "format": "uint64",
2740
+ "minimum": 0
2741
+ },
2742
+ "output_tokens": {
2743
+ "description": "Completion/output tokens billed, when the harness reports them.",
2744
+ "type": [
2745
+ "integer",
2746
+ "null"
2747
+ ],
2748
+ "format": "uint64",
2749
+ "minimum": 0
2750
+ }
2751
+ },
2752
+ "required": [
2753
+ "input_tokens",
2754
+ "output_tokens",
2755
+ "cache_read_tokens",
2756
+ "cache_write_tokens",
2757
+ "cost_usd"
2758
+ ]
2759
+ }
2760
+ }
2761
+ },
1830
2762
  "history_record": {
1831
2763
  "$schema": "https://json-schema.org/draft/2020-12/schema",
1832
2764
  "title": "HistoryRecord",
@@ -2084,7 +3016,7 @@
2084
3016
  },
2085
3017
  "schema_version": {
2086
3018
  "type": "string",
2087
- "const": "0.3"
3019
+ "const": "1.0"
2088
3020
  },
2089
3021
  "session": {
2090
3022
  "description": "The oneharness session id this run belongs to (the history file's stem).",
@@ -2295,7 +3227,7 @@
2295
3227
  },
2296
3228
  "schema_version": {
2297
3229
  "type": "string",
2298
- "const": "0.3"
3230
+ "const": "1.0"
2299
3231
  },
2300
3232
  "session": {
2301
3233
  "description": "The oneharness session id this run belongs to (the history file's stem).",
@@ -3255,7 +4187,7 @@
3255
4187
  },
3256
4188
  "schema_version": {
3257
4189
  "type": "string",
3258
- "const": "0.3"
4190
+ "const": "1.0"
3259
4191
  },
3260
4192
  "session": {
3261
4193
  "description": "The oneharness session id this run belongs to (the history file's stem).",
@@ -3466,7 +4398,7 @@
3466
4398
  },
3467
4399
  "schema_version": {
3468
4400
  "type": "string",
3469
- "const": "0.3"
4401
+ "const": "1.0"
3470
4402
  },
3471
4403
  "session": {
3472
4404
  "description": "The oneharness session id this run belongs to (the history file's stem).",
@@ -4276,7 +5208,7 @@
4276
5208
  },
4277
5209
  "schema_version": {
4278
5210
  "type": "string",
4279
- "const": "0.3"
5211
+ "const": "1.0"
4280
5212
  },
4281
5213
  "session": {
4282
5214
  "description": "The oneharness session id this run belongs to (the history file's stem).",
@@ -4487,7 +5419,7 @@
4487
5419
  },
4488
5420
  "schema_version": {
4489
5421
  "type": "string",
4490
- "const": "0.3"
5422
+ "const": "1.0"
4491
5423
  },
4492
5424
  "session": {
4493
5425
  "description": "The oneharness session id this run belongs to (the history file's stem).",