@oneharness/sdk 0.20.0 → 0.21.2

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.
@@ -995,10 +995,10 @@
995
995
  "show"
996
996
  ],
997
997
  "options": "history_lookup",
998
- "output": "history_records",
998
+ "output": "history_show_entries",
999
999
  "stdout": "json",
1000
1000
  "stdin": false,
1001
- "rust": "oneharness_core::io::history::read_session",
1001
+ "rust": "oneharness_core::io::history::read_session_display",
1002
1002
  "always": [
1003
1003
  "--compact",
1004
1004
  "--format",
@@ -1037,6 +1037,17 @@
1037
1037
  "kind": "switch",
1038
1038
  "unless": null
1039
1039
  },
1040
+ {
1041
+ "option": "window",
1042
+ "flag": "",
1043
+ "kind": "window",
1044
+ "unless": null,
1045
+ "window": {
1046
+ "days": "--days",
1047
+ "since": "--since",
1048
+ "allTime": "--all-time"
1049
+ }
1050
+ },
1040
1051
  {
1041
1052
  "option": "historyDir",
1042
1053
  "flag": "--history-dir",
@@ -1095,6 +1106,17 @@
1095
1106
  "kind": "switch",
1096
1107
  "unless": null
1097
1108
  },
1109
+ {
1110
+ "option": "window",
1111
+ "flag": "",
1112
+ "kind": "window",
1113
+ "unless": null,
1114
+ "window": {
1115
+ "days": "--days",
1116
+ "since": "--since",
1117
+ "allTime": "--all-time"
1118
+ }
1119
+ },
1098
1120
  {
1099
1121
  "option": "historyDir",
1100
1122
  "flag": "--history-dir",
@@ -1137,7 +1159,8 @@
1137
1159
  "option": "after",
1138
1160
  "flag": "--after",
1139
1161
  "kind": "value",
1140
- "unless": null
1162
+ "unless": "window",
1163
+ "unless_resolution": "refuse"
1141
1164
  },
1142
1165
  {
1143
1166
  "option": "labels",
@@ -1182,6 +1205,17 @@
1182
1205
  "kind": "switch",
1183
1206
  "unless": null
1184
1207
  },
1208
+ {
1209
+ "option": "window",
1210
+ "flag": "",
1211
+ "kind": "window",
1212
+ "unless": null,
1213
+ "window": {
1214
+ "days": "--days",
1215
+ "since": "--since",
1216
+ "allTime": "--all-time"
1217
+ }
1218
+ },
1185
1219
  {
1186
1220
  "option": "config",
1187
1221
  "flag": "--config",
@@ -1295,6 +1329,45 @@
1295
1329
  ],
1296
1330
  "uncovered": []
1297
1331
  },
1332
+ {
1333
+ "method": "historyReindex",
1334
+ "argv": [
1335
+ "history",
1336
+ "reindex"
1337
+ ],
1338
+ "options": "history_reindex_options",
1339
+ "output": "history_reindex_report",
1340
+ "stdout": "json",
1341
+ "stdin": false,
1342
+ "rust": "oneharness_core::io::history::reindex",
1343
+ "always": [
1344
+ "--compact",
1345
+ "--format",
1346
+ "json"
1347
+ ],
1348
+ "bindings": [
1349
+ {
1350
+ "option": "historyDir",
1351
+ "flag": "--history-dir",
1352
+ "kind": "value",
1353
+ "unless": null
1354
+ },
1355
+ {
1356
+ "option": "config",
1357
+ "flag": "--config",
1358
+ "kind": "repeated",
1359
+ "unless": "noConfig",
1360
+ "unless_resolution": "refuse"
1361
+ },
1362
+ {
1363
+ "option": "noConfig",
1364
+ "flag": "--no-config",
1365
+ "kind": "switch",
1366
+ "unless": null
1367
+ }
1368
+ ],
1369
+ "uncovered": []
1370
+ },
1298
1371
  {
1299
1372
  "method": "historyPointers",
1300
1373
  "argv": [
@@ -1525,7 +1598,7 @@
1525
1598
  "type": "string"
1526
1599
  },
1527
1600
  "name": {
1528
- "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.",
1601
+ "description": "Normalized tool name where knowable (e.g. `bash`, `Edit`); `null` when\nthe harness did not name the tool. A `tool_result` carries the name of\nthe `tool_call` it answers (matched by `tool_call_id`) when that call\nwas seen earlier in the same run, else `null`.",
1529
1602
  "type": [
1530
1603
  "string",
1531
1604
  "null"
@@ -1546,7 +1619,7 @@
1546
1619
  ]
1547
1620
  },
1548
1621
  "status": {
1549
- "description": "Terminal tool state, populated on history tool-call events.",
1622
+ "description": "Terminal tool state, populated on history tool-call events. On a\n`tool_result` it is the outcome the harness reported for the call:\n`failed` when the result is marked an error (a Claude Code / Qwen\n`is_error: true` block), else `completed`; `null` when the harness\nreports no error state for its results, and in a history record with\nno tool timing, which makes no tool-state claim on any event.",
1550
1623
  "anyOf": [
1551
1624
  {
1552
1625
  "$ref": "#/$defs/ToolCallStatus"
@@ -2606,7 +2679,7 @@
2606
2679
  "type": "string"
2607
2680
  },
2608
2681
  "name": {
2609
- "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.",
2682
+ "description": "Normalized tool name where knowable (e.g. `bash`, `Edit`); `null` when\nthe harness did not name the tool. A `tool_result` carries the name of\nthe `tool_call` it answers (matched by `tool_call_id`) when that call\nwas seen earlier in the same run, else `null`.",
2610
2683
  "type": [
2611
2684
  "string",
2612
2685
  "null"
@@ -2627,7 +2700,7 @@
2627
2700
  ]
2628
2701
  },
2629
2702
  "status": {
2630
- "description": "Terminal tool state, populated on history tool-call events.",
2703
+ "description": "Terminal tool state, populated on history tool-call events. On a\n`tool_result` it is the outcome the harness reported for the call:\n`failed` when the result is marked an error (a Claude Code / Qwen\n`is_error: true` block), else `completed`; `null` when the harness\nreports no error state for its results, and in a history record with\nno tool timing, which makes no tool-state claim on any event.",
2631
2704
  "anyOf": [
2632
2705
  {
2633
2706
  "$ref": "#/$defs/ToolCallStatus"
@@ -4138,6 +4211,17 @@
4138
4211
  "session": {
4139
4212
  "description": "A name may accompany `last: true` — it is what the caller would have\nlooked up otherwise — but `last` takes priority, so it never selects.\nIt is therefore unconstrained: an empty name is meaningless here rather\nthan invalid, so `{\"session\": \"\", \"last\": true}` stays accepted.",
4140
4213
  "type": "string"
4214
+ },
4215
+ "window": {
4216
+ "description": "Which dates of the index to read: the last `days` UTC days, from a\nUTC date on, or all time (every dated segment plus the legacy index an\nolder oneharness kept). Omitted, the last 7 UTC days.",
4217
+ "anyOf": [
4218
+ {
4219
+ "$ref": "#/$defs/HistoryWindow"
4220
+ },
4221
+ {
4222
+ "type": "null"
4223
+ }
4224
+ ]
4141
4225
  }
4142
4226
  },
4143
4227
  "additionalProperties": false,
@@ -4181,12 +4265,74 @@
4181
4265
  "description": "The oneharness-derived session name recorded by `run --history`. This is\nthe name that selects, so it must be non-empty.",
4182
4266
  "type": "string",
4183
4267
  "minLength": 1
4268
+ },
4269
+ "window": {
4270
+ "description": "Which dates of the index to read: the last `days` UTC days, from a\nUTC date on, or all time (every dated segment plus the legacy index an\nolder oneharness kept). Omitted, the last 7 UTC days.",
4271
+ "anyOf": [
4272
+ {
4273
+ "$ref": "#/$defs/HistoryWindow"
4274
+ },
4275
+ {
4276
+ "type": "null"
4277
+ }
4278
+ ]
4184
4279
  }
4185
4280
  },
4186
4281
  "additionalProperties": false,
4187
4282
  "required": [
4188
4283
  "session"
4189
4284
  ]
4285
+ },
4286
+ "HistoryWindow": {
4287
+ "description": "Which dates of the index a listing reads.\n\nIt is also the one value an SDK history lookup, listing or watch takes as\nits `window`, so \"from this date\" and \"from the beginning\" cannot both be\nstated. On the wire it is externally tagged in camelCase —\n`{\"recent\": {\"days\": 3}}`, `{\"since\": \"2026-01-05\"}`, or `\"allTime\"` — and\nrenders to the CLI's `--days`, `--since` or `--all-time`.",
4288
+ "oneOf": [
4289
+ {
4290
+ "description": "The last `days` UTC days, today included (`1` means today alone).",
4291
+ "type": "object",
4292
+ "properties": {
4293
+ "recent": {
4294
+ "type": "object",
4295
+ "properties": {
4296
+ "days": {
4297
+ "description": "How many UTC days, today included; at least one.",
4298
+ "type": "integer",
4299
+ "format": "uint32",
4300
+ "minimum": 1
4301
+ }
4302
+ },
4303
+ "additionalProperties": false,
4304
+ "required": [
4305
+ "days"
4306
+ ]
4307
+ }
4308
+ },
4309
+ "additionalProperties": false,
4310
+ "required": [
4311
+ "recent"
4312
+ ]
4313
+ },
4314
+ {
4315
+ "description": "Every date from this one on.",
4316
+ "type": "object",
4317
+ "properties": {
4318
+ "since": {
4319
+ "type": "string",
4320
+ "maxLength": 10,
4321
+ "minLength": 10,
4322
+ "pattern": "^(?:[1-9][0-9]{3}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12][0-9]|3[01])|(?:0[469]|11)-(?:0[1-9]|[12][0-9]|30)|02-(?:0[1-9]|1[0-9]|2[0-8]))|(?:[1-9][0-9](?:0[48]|[2468][048]|[13579][26])|(?:1[26]|2[048]|3[26]|4[048]|5[26]|6[048]|7[26]|8[048]|9[26])00)-02-29)$"
4323
+ }
4324
+ },
4325
+ "additionalProperties": false,
4326
+ "required": [
4327
+ "since"
4328
+ ]
4329
+ },
4330
+ {
4331
+ "description": "Every segment, plus the legacy index files an older core keeps.",
4332
+ "type": "string",
4333
+ "const": "allTime"
4334
+ }
4335
+ ]
4190
4336
  }
4191
4337
  }
4192
4338
  },
@@ -4219,9 +4365,73 @@
4219
4365
  "variant": {
4220
4366
  "description": "Narrow to one configured harness identity (`claude-code:work`).",
4221
4367
  "type": "string"
4368
+ },
4369
+ "window": {
4370
+ "description": "Which dates of the index to read: the last `days` UTC days, from a\nUTC date on, or all time (every dated segment plus the legacy index an\nolder oneharness kept). Omitted, the last 7 UTC days.",
4371
+ "anyOf": [
4372
+ {
4373
+ "$ref": "#/$defs/HistoryWindow"
4374
+ },
4375
+ {
4376
+ "type": "null"
4377
+ }
4378
+ ]
4222
4379
  }
4223
4380
  },
4224
- "additionalProperties": false
4381
+ "additionalProperties": false,
4382
+ "$defs": {
4383
+ "HistoryWindow": {
4384
+ "description": "Which dates of the index a listing reads.\n\nIt is also the one value an SDK history lookup, listing or watch takes as\nits `window`, so \"from this date\" and \"from the beginning\" cannot both be\nstated. On the wire it is externally tagged in camelCase —\n`{\"recent\": {\"days\": 3}}`, `{\"since\": \"2026-01-05\"}`, or `\"allTime\"` — and\nrenders to the CLI's `--days`, `--since` or `--all-time`.",
4385
+ "oneOf": [
4386
+ {
4387
+ "description": "The last `days` UTC days, today included (`1` means today alone).",
4388
+ "type": "object",
4389
+ "properties": {
4390
+ "recent": {
4391
+ "type": "object",
4392
+ "properties": {
4393
+ "days": {
4394
+ "description": "How many UTC days, today included; at least one.",
4395
+ "type": "integer",
4396
+ "format": "uint32",
4397
+ "minimum": 1
4398
+ }
4399
+ },
4400
+ "additionalProperties": false,
4401
+ "required": [
4402
+ "days"
4403
+ ]
4404
+ }
4405
+ },
4406
+ "additionalProperties": false,
4407
+ "required": [
4408
+ "recent"
4409
+ ]
4410
+ },
4411
+ {
4412
+ "description": "Every date from this one on.",
4413
+ "type": "object",
4414
+ "properties": {
4415
+ "since": {
4416
+ "type": "string",
4417
+ "maxLength": 10,
4418
+ "minLength": 10,
4419
+ "pattern": "^(?:[1-9][0-9]{3}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12][0-9]|3[01])|(?:0[469]|11)-(?:0[1-9]|[12][0-9]|30)|02-(?:0[1-9]|1[0-9]|2[0-8]))|(?:[1-9][0-9](?:0[48]|[2468][048]|[13579][26])|(?:1[26]|2[048]|3[26]|4[048]|5[26]|6[048]|7[26]|8[048]|9[26])00)-02-29)$"
4420
+ }
4421
+ },
4422
+ "additionalProperties": false,
4423
+ "required": [
4424
+ "since"
4425
+ ]
4426
+ },
4427
+ {
4428
+ "description": "Every segment, plus the legacy index files an older core keeps.",
4429
+ "type": "string",
4430
+ "const": "allTime"
4431
+ }
4432
+ ]
4433
+ }
4434
+ }
4225
4435
  },
4226
4436
  "history_watch_options": {
4227
4437
  "$schema": "https://json-schema.org/draft/2020-12/schema",
@@ -4276,6 +4486,17 @@
4276
4486
  "variant": {
4277
4487
  "description": "Narrow to one configured harness identity (`claude-code:work`).",
4278
4488
  "type": "string"
4489
+ },
4490
+ "window": {
4491
+ "description": "Where the watch starts when no `after` cursor is given: the beginning\nof the last `days` UTC days, of a UTC date, or of all time (the legacy\nindex an older oneharness kept included). Omitted, the current UTC\nday. Refused beside `after`, the other answer to where a watch begins.",
4492
+ "anyOf": [
4493
+ {
4494
+ "$ref": "#/$defs/HistoryWindow"
4495
+ },
4496
+ {
4497
+ "type": "null"
4498
+ }
4499
+ ]
4279
4500
  }
4280
4501
  },
4281
4502
  "additionalProperties": false,
@@ -4298,6 +4519,57 @@
4298
4519
  },
4299
4520
  "pattern": "^[A-Za-z0-9]"
4300
4521
  }
4522
+ },
4523
+ "HistoryWindow": {
4524
+ "description": "Which dates of the index a listing reads.\n\nIt is also the one value an SDK history lookup, listing or watch takes as\nits `window`, so \"from this date\" and \"from the beginning\" cannot both be\nstated. On the wire it is externally tagged in camelCase —\n`{\"recent\": {\"days\": 3}}`, `{\"since\": \"2026-01-05\"}`, or `\"allTime\"` — and\nrenders to the CLI's `--days`, `--since` or `--all-time`.",
4525
+ "oneOf": [
4526
+ {
4527
+ "description": "The last `days` UTC days, today included (`1` means today alone).",
4528
+ "type": "object",
4529
+ "properties": {
4530
+ "recent": {
4531
+ "type": "object",
4532
+ "properties": {
4533
+ "days": {
4534
+ "description": "How many UTC days, today included; at least one.",
4535
+ "type": "integer",
4536
+ "format": "uint32",
4537
+ "minimum": 1
4538
+ }
4539
+ },
4540
+ "additionalProperties": false,
4541
+ "required": [
4542
+ "days"
4543
+ ]
4544
+ }
4545
+ },
4546
+ "additionalProperties": false,
4547
+ "required": [
4548
+ "recent"
4549
+ ]
4550
+ },
4551
+ {
4552
+ "description": "Every date from this one on.",
4553
+ "type": "object",
4554
+ "properties": {
4555
+ "since": {
4556
+ "type": "string",
4557
+ "maxLength": 10,
4558
+ "minLength": 10,
4559
+ "pattern": "^(?:[1-9][0-9]{3}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12][0-9]|3[01])|(?:0[469]|11)-(?:0[1-9]|[12][0-9]|30)|02-(?:0[1-9]|1[0-9]|2[0-8]))|(?:[1-9][0-9](?:0[48]|[2468][048]|[13579][26])|(?:1[26]|2[048]|3[26]|4[048]|5[26]|6[048]|7[26]|8[048]|9[26])00)-02-29)$"
4560
+ }
4561
+ },
4562
+ "additionalProperties": false,
4563
+ "required": [
4564
+ "since"
4565
+ ]
4566
+ },
4567
+ {
4568
+ "description": "Every segment, plus the legacy index files an older core keeps.",
4569
+ "type": "string",
4570
+ "const": "allTime"
4571
+ }
4572
+ ]
4301
4573
  }
4302
4574
  }
4303
4575
  },
@@ -5991,7 +6263,7 @@
5991
6263
  "type": "string"
5992
6264
  },
5993
6265
  "name": {
5994
- "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.",
6266
+ "description": "Normalized tool name where knowable (e.g. `bash`, `Edit`); `null` when\nthe harness did not name the tool. A `tool_result` carries the name of\nthe `tool_call` it answers (matched by `tool_call_id`) when that call\nwas seen earlier in the same run, else `null`.",
5995
6267
  "type": [
5996
6268
  "string",
5997
6269
  "null"
@@ -6012,7 +6284,7 @@
6012
6284
  ]
6013
6285
  },
6014
6286
  "status": {
6015
- "description": "Terminal tool state, populated on history tool-call events.",
6287
+ "description": "Terminal tool state, populated on history tool-call events. On a\n`tool_result` it is the outcome the harness reported for the call:\n`failed` when the result is marked an error (a Claude Code / Qwen\n`is_error: true` block), else `completed`; `null` when the harness\nreports no error state for its results, and in a history record with\nno tool timing, which makes no tool-state claim on any event.",
6016
6288
  "anyOf": [
6017
6289
  {
6018
6290
  "$ref": "#/$defs/ToolCallStatus"
@@ -9031,7 +9303,7 @@
9031
9303
  "type": "string"
9032
9304
  },
9033
9305
  "name": {
9034
- "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.",
9306
+ "description": "Normalized tool name where knowable (e.g. `bash`, `Edit`); `null` when\nthe harness did not name the tool. A `tool_result` carries the name of\nthe `tool_call` it answers (matched by `tool_call_id`) when that call\nwas seen earlier in the same run, else `null`.",
9035
9307
  "type": [
9036
9308
  "string",
9037
9309
  "null"
@@ -9052,7 +9324,7 @@
9052
9324
  ]
9053
9325
  },
9054
9326
  "status": {
9055
- "description": "Terminal tool state, populated on history tool-call events.",
9327
+ "description": "Terminal tool state, populated on history tool-call events. On a\n`tool_result` it is the outcome the harness reported for the call:\n`failed` when the result is marked an error (a Claude Code / Qwen\n`is_error: true` block), else `completed`; `null` when the harness\nreports no error state for its results, and in a history record with\nno tool timing, which makes no tool-state claim on any event.",
9056
9328
  "anyOf": [
9057
9329
  {
9058
9330
  "$ref": "#/$defs/ToolCallStatus"
@@ -9415,7 +9687,7 @@
9415
9687
  "type": "string"
9416
9688
  },
9417
9689
  "name": {
9418
- "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.",
9690
+ "description": "Normalized tool name where knowable (e.g. `bash`, `Edit`); `null` when\nthe harness did not name the tool. A `tool_result` carries the name of\nthe `tool_call` it answers (matched by `tool_call_id`) when that call\nwas seen earlier in the same run, else `null`.",
9419
9691
  "type": [
9420
9692
  "string",
9421
9693
  "null"
@@ -9436,7 +9708,7 @@
9436
9708
  ]
9437
9709
  },
9438
9710
  "status": {
9439
- "description": "Terminal tool state, populated on history tool-call events.",
9711
+ "description": "Terminal tool state, populated on history tool-call events. On a\n`tool_result` it is the outcome the harness reported for the call:\n`failed` when the result is marked an error (a Claude Code / Qwen\n`is_error: true` block), else `completed`; `null` when the harness\nreports no error state for its results, and in a history record with\nno tool timing, which makes no tool-state claim on any event.",
9440
9712
  "anyOf": [
9441
9713
  {
9442
9714
  "$ref": "#/$defs/ToolCallStatus"
@@ -12556,12 +12828,12 @@
12556
12828
  }
12557
12829
  }
12558
12830
  },
12559
- "history_records": {
12831
+ "history_show_entries": {
12560
12832
  "$schema": "https://json-schema.org/draft/2020-12/schema",
12561
- "title": "Array_of_HistoryRecord",
12833
+ "title": "Array_of_HistoryShowEntry",
12562
12834
  "type": "array",
12563
12835
  "items": {
12564
- "$ref": "#/$defs/HistoryRecord"
12836
+ "$ref": "#/$defs/HistoryShowEntry"
12565
12837
  },
12566
12838
  "$defs": {
12567
12839
  "ActionEvent": {
@@ -12597,7 +12869,7 @@
12597
12869
  "type": "string"
12598
12870
  },
12599
12871
  "name": {
12600
- "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.",
12872
+ "description": "Normalized tool name where knowable (e.g. `bash`, `Edit`); `null` when\nthe harness did not name the tool. A `tool_result` carries the name of\nthe `tool_call` it answers (matched by `tool_call_id`) when that call\nwas seen earlier in the same run, else `null`.",
12601
12873
  "type": [
12602
12874
  "string",
12603
12875
  "null"
@@ -12618,7 +12890,7 @@
12618
12890
  ]
12619
12891
  },
12620
12892
  "status": {
12621
- "description": "Terminal tool state, populated on history tool-call events.",
12893
+ "description": "Terminal tool state, populated on history tool-call events. On a\n`tool_result` it is the outcome the harness reported for the call:\n`failed` when the result is marked an error (a Claude Code / Qwen\n`is_error: true` block), else `completed`; `null` when the harness\nreports no error state for its results, and in a history record with\nno tool timing, which makes no tool-state claim on any event.",
12622
12894
  "anyOf": [
12623
12895
  {
12624
12896
  "$ref": "#/$defs/ToolCallStatus"
@@ -15429,6 +15701,61 @@
15429
15701
  }
15430
15702
  ]
15431
15703
  },
15704
+ "HistoryShowEntry": {
15705
+ "description": "One entry of `history show`'s answer: a finished run's record, or a run still\nin flight.",
15706
+ "anyOf": [
15707
+ {
15708
+ "description": "A run whose closing record has landed.",
15709
+ "$ref": "#/$defs/HistoryRecord"
15710
+ },
15711
+ {
15712
+ "description": "A run that has published events but no closing record yet.",
15713
+ "$ref": "#/$defs/IncompleteHistoryRun"
15714
+ }
15715
+ ]
15716
+ },
15717
+ "IncompleteHistoryRun": {
15718
+ "description": "A run `history show` reads before its closing record has landed: the events\nits event lines have published so far, under the run they belong to. It is a\ndisplay entry, never a store line: once the run's closing record lands the\nsame run is shown as a [`HistoryRecord`] instead. It exists only because an\nevent line was read, so it always carries at least one event.",
15719
+ "type": "object",
15720
+ "properties": {
15721
+ "events": {
15722
+ "description": "The events published so far, in `index` order; never empty.",
15723
+ "type": "array",
15724
+ "items": {
15725
+ "$ref": "#/$defs/ActionEvent"
15726
+ },
15727
+ "minItems": 1
15728
+ },
15729
+ "harness": {
15730
+ "description": "The harness the event lines name.",
15731
+ "type": "string"
15732
+ },
15733
+ "run_id": {
15734
+ "description": "The id the run's closing record will carry as its `history_id`.",
15735
+ "type": "string",
15736
+ "maxLength": 36,
15737
+ "minLength": 36,
15738
+ "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}$"
15739
+ },
15740
+ "type": {
15741
+ "description": "Always `incomplete`: what tells this entry apart from a record.",
15742
+ "$ref": "#/$defs/IncompleteRunType"
15743
+ }
15744
+ },
15745
+ "required": [
15746
+ "type",
15747
+ "run_id",
15748
+ "harness",
15749
+ "events"
15750
+ ]
15751
+ },
15752
+ "IncompleteRunType": {
15753
+ "description": "The discriminator of an [`IncompleteHistoryRun`].",
15754
+ "type": "string",
15755
+ "enum": [
15756
+ "incomplete"
15757
+ ]
15758
+ },
15432
15759
  "PermissionMode": {
15433
15760
  "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.",
15434
15761
  "oneOf": [
@@ -18003,6 +18330,113 @@
18003
18330
  }
18004
18331
  }
18005
18332
  },
18333
+ "history_reindex_options": {
18334
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
18335
+ "title": "HistoryReindexOptions",
18336
+ "description": "Options accepted by the language SDKs' `historyReindex()`.",
18337
+ "type": "object",
18338
+ "properties": {
18339
+ "config": {
18340
+ "description": "Load configuration from exactly these files, in order, skipping\nuser/project discovery; each later file overrides the earlier ones.",
18341
+ "type": "array",
18342
+ "items": {
18343
+ "type": "string"
18344
+ }
18345
+ },
18346
+ "historyDir": {
18347
+ "type": "string"
18348
+ },
18349
+ "noConfig": {
18350
+ "description": "Ignore every configuration file and `ONEHARNESS_*` override. `true`\nbeside a non-empty `config` is refused before anything runs.",
18351
+ "type": "boolean"
18352
+ }
18353
+ },
18354
+ "additionalProperties": false
18355
+ },
18356
+ "history_reindex_report": {
18357
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
18358
+ "title": "HistoryReindexReport",
18359
+ "description": "The `oneharness history reindex` output contract.",
18360
+ "type": "object",
18361
+ "properties": {
18362
+ "entries_added": {
18363
+ "description": "The sum of `segments[].added`.",
18364
+ "type": "integer",
18365
+ "format": "uint",
18366
+ "minimum": 0
18367
+ },
18368
+ "files_read": {
18369
+ "description": "How many session files were read.",
18370
+ "type": "integer",
18371
+ "format": "uint",
18372
+ "minimum": 0
18373
+ },
18374
+ "segments": {
18375
+ "description": "One row per segment this run appended to, in file-name order; a\nsegment that already held every entry is not listed.",
18376
+ "type": "array",
18377
+ "items": {
18378
+ "$ref": "#/$defs/SegmentReindexSummary"
18379
+ }
18380
+ },
18381
+ "unreadable": {
18382
+ "description": "Every session file (or project directory) that could not be read,\nwith why. The rest are indexed regardless.",
18383
+ "type": "array",
18384
+ "items": {
18385
+ "$ref": "#/$defs/UnreadableSessionFile"
18386
+ }
18387
+ }
18388
+ },
18389
+ "required": [
18390
+ "segments",
18391
+ "entries_added",
18392
+ "files_read",
18393
+ "unreadable"
18394
+ ],
18395
+ "$defs": {
18396
+ "SegmentReindexSummary": {
18397
+ "description": "What [`reindex`] appended to one segment.",
18398
+ "type": "object",
18399
+ "properties": {
18400
+ "added": {
18401
+ "description": "How many entries this run appended to it.",
18402
+ "type": "integer",
18403
+ "format": "uint",
18404
+ "minimum": 0
18405
+ },
18406
+ "path": {
18407
+ "description": "The segment's path, as a display string.",
18408
+ "type": "string"
18409
+ },
18410
+ "segment": {
18411
+ "description": "The segment's file name (`runs-YYYY-MM-DD.ndjson` or\n`events-YYYY-MM-DD.ndjson`).",
18412
+ "type": "string"
18413
+ }
18414
+ },
18415
+ "required": [
18416
+ "segment",
18417
+ "path",
18418
+ "added"
18419
+ ]
18420
+ },
18421
+ "UnreadableSessionFile": {
18422
+ "description": "A session file [`reindex`] could not read.",
18423
+ "type": "object",
18424
+ "properties": {
18425
+ "error": {
18426
+ "description": "Why it could not be read, as the operating system said it.",
18427
+ "type": "string"
18428
+ },
18429
+ "path": {
18430
+ "type": "string"
18431
+ }
18432
+ },
18433
+ "required": [
18434
+ "path",
18435
+ "error"
18436
+ ]
18437
+ }
18438
+ }
18439
+ },
18006
18440
  "history_pointers_options": {
18007
18441
  "$schema": "https://json-schema.org/draft/2020-12/schema",
18008
18442
  "title": "HistoryPointersOptions",