@claudexor/schema 3.0.4 → 3.1.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.
Files changed (133) hide show
  1. package/dist/agent-capabilities.d.ts +37 -0
  2. package/dist/agent-capabilities.d.ts.map +1 -1
  3. package/dist/agent-capabilities.js +14 -0
  4. package/dist/agent-capabilities.js.map +1 -1
  5. package/dist/apply-eligibility.d.ts +384 -18
  6. package/dist/apply-eligibility.d.ts.map +1 -1
  7. package/dist/apply-eligibility.js +20 -1
  8. package/dist/apply-eligibility.js.map +1 -1
  9. package/dist/budget.d.ts +75 -0
  10. package/dist/budget.d.ts.map +1 -1
  11. package/dist/budget.js +46 -0
  12. package/dist/budget.js.map +1 -1
  13. package/dist/config.d.ts +41 -41
  14. package/dist/control-operation-responses.d.ts +287 -65
  15. package/dist/control-operation-responses.d.ts.map +1 -1
  16. package/dist/control-operation-responses.js +33 -3
  17. package/dist/control-operation-responses.js.map +1 -1
  18. package/dist/control-run-detail.d.ts +600 -150
  19. package/dist/control-run-detail.d.ts.map +1 -1
  20. package/dist/control-run-detail.js +28 -2
  21. package/dist/control-run-detail.js.map +1 -1
  22. package/dist/control-run-retry.d.ts +1 -1
  23. package/dist/control-run-scope.d.ts +1 -1
  24. package/dist/control-thread-apply.d.ts +10 -0
  25. package/dist/control-thread-apply.d.ts.map +1 -1
  26. package/dist/control.d.ts +664 -156
  27. package/dist/control.d.ts.map +1 -1
  28. package/dist/control.js +76 -2
  29. package/dist/control.js.map +1 -1
  30. package/dist/decision.d.ts +205 -9
  31. package/dist/decision.d.ts.map +1 -1
  32. package/dist/decision.js +69 -1
  33. package/dist/decision.js.map +1 -1
  34. package/dist/deep-scan.d.ts +27 -0
  35. package/dist/deep-scan.d.ts.map +1 -0
  36. package/dist/deep-scan.js +27 -0
  37. package/dist/deep-scan.js.map +1 -0
  38. package/dist/delivery.d.ts +13 -0
  39. package/dist/delivery.d.ts.map +1 -1
  40. package/dist/delivery.js +15 -0
  41. package/dist/delivery.js.map +1 -1
  42. package/dist/events.d.ts +59 -4
  43. package/dist/events.d.ts.map +1 -1
  44. package/dist/events.js +85 -0
  45. package/dist/events.js.map +1 -1
  46. package/dist/harness.d.ts +111 -3
  47. package/dist/harness.d.ts.map +1 -1
  48. package/dist/harness.js +77 -1
  49. package/dist/harness.js.map +1 -1
  50. package/dist/index.d.ts +3 -0
  51. package/dist/index.d.ts.map +1 -1
  52. package/dist/index.js +3 -0
  53. package/dist/index.js.map +1 -1
  54. package/dist/operation.d.ts +193 -10
  55. package/dist/operation.d.ts.map +1 -1
  56. package/dist/operation.js +45 -0
  57. package/dist/operation.js.map +1 -1
  58. package/dist/output-schema-dialect.d.ts +22 -0
  59. package/dist/output-schema-dialect.d.ts.map +1 -0
  60. package/dist/output-schema-dialect.js +37 -0
  61. package/dist/output-schema-dialect.js.map +1 -0
  62. package/dist/output-schema.d.ts +26 -2
  63. package/dist/output-schema.d.ts.map +1 -1
  64. package/dist/output-schema.js +313 -16
  65. package/dist/output-schema.js.map +1 -1
  66. package/dist/plan.d.ts +2 -2
  67. package/dist/problem.d.ts +3 -3
  68. package/dist/project.d.ts +47 -12
  69. package/dist/project.d.ts.map +1 -1
  70. package/dist/project.js +32 -0
  71. package/dist/project.js.map +1 -1
  72. package/dist/readiness.d.ts +14 -0
  73. package/dist/readiness.d.ts.map +1 -1
  74. package/dist/recovery.d.ts +14 -14
  75. package/dist/review.d.ts +7 -7
  76. package/dist/route.d.ts +2 -2
  77. package/dist/setup.d.ts +288 -94
  78. package/dist/setup.d.ts.map +1 -1
  79. package/dist/setup.js +90 -6
  80. package/dist/setup.js.map +1 -1
  81. package/dist/status-projection.d.ts +79 -4
  82. package/dist/status-projection.d.ts.map +1 -1
  83. package/dist/status-projection.js +161 -4
  84. package/dist/status-projection.js.map +1 -1
  85. package/dist/task.d.ts +14 -0
  86. package/dist/task.d.ts.map +1 -1
  87. package/dist/task.js +9 -0
  88. package/dist/task.js.map +1 -1
  89. package/dist/telemetry.d.ts +779 -16
  90. package/dist/telemetry.d.ts.map +1 -1
  91. package/dist/telemetry.js +177 -4
  92. package/dist/telemetry.js.map +1 -1
  93. package/dist/tool-ref.d.ts +14 -0
  94. package/dist/tool-ref.d.ts.map +1 -1
  95. package/dist/tool-ref.js +15 -0
  96. package/dist/tool-ref.js.map +1 -1
  97. package/dist/work-report.d.ts +131 -0
  98. package/dist/work-report.d.ts.map +1 -0
  99. package/dist/work-report.js +124 -0
  100. package/dist/work-report.js.map +1 -0
  101. package/dist/workspace.d.ts +2 -2
  102. package/generated/AgentCapabilityCatalog.schema.json +35 -0
  103. package/generated/ControlApplyCheckResponse.schema.json +5 -0
  104. package/generated/ControlDeliveryResponse.schema.json +14 -0
  105. package/generated/ControlHarnessListResponse.schema.json +19 -0
  106. package/generated/ControlOperationCatalog.schema.json +74 -0
  107. package/generated/ControlOperationDescriptor.schema.json +74 -0
  108. package/generated/ControlOperationParameter.schema.json +75 -0
  109. package/generated/ControlProjectRemoveReceipt.schema.json +58 -0
  110. package/generated/ControlRunAgainDraft.schema.json +11 -0
  111. package/generated/ControlRunDetail.schema.json +403 -9
  112. package/generated/ControlRunListResponse.schema.json +229 -3
  113. package/generated/ControlRunStartRequest.schema.json +11 -0
  114. package/generated/ControlRunSummary.schema.json +215 -2
  115. package/generated/ControlSetupJobCreateRequest.schema.json +2 -1
  116. package/generated/ControlSetupJobEvent.schema.json +28 -0
  117. package/generated/ControlSetupJobSnapshot.schema.json +28 -0
  118. package/generated/ControlThreadApplyResponse.schema.json +14 -0
  119. package/generated/ControlThreadDetail.schema.json +94 -1
  120. package/generated/ControlThreadTurnRequest.schema.json +11 -0
  121. package/generated/DecisionRecord.schema.json +178 -2
  122. package/generated/HarnessEvent.schema.json +79 -1
  123. package/generated/HarnessManifest.schema.json +19 -0
  124. package/generated/HarnessStatusDto.schema.json +19 -0
  125. package/generated/McpRunHandleResult.schema.json +286 -1
  126. package/generated/McpRunToolResult.schema.json +171 -1
  127. package/generated/RoutePoolDegradedPayload.schema.json +79 -0
  128. package/generated/RunEvent.schema.json +7 -1
  129. package/generated/RunFailure.schema.json +23 -1
  130. package/generated/RunTelemetry.schema.json +376 -1
  131. package/generated/StructuredOutputConformance.schema.json +83 -0
  132. package/generated/TaskContract.schema.json +16 -0
  133. package/package.json +2 -2
package/dist/control.d.ts CHANGED
@@ -48,8 +48,8 @@ export declare const ControlRunStartRequest: z.ZodObject<{
48
48
  context: z.ZodDefault<z.ZodEnum<["auto"]>>;
49
49
  }, "strict", z.ZodTypeAny, {
50
50
  kind: "project";
51
- root: string;
52
51
  context: "auto";
52
+ root: string;
53
53
  }, {
54
54
  kind: "project";
55
55
  root: string;
@@ -80,6 +80,11 @@ export declare const ControlRunStartRequest: z.ZodObject<{
80
80
  * per-harness settings default. */
81
81
  models: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
82
82
  effort: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "xhigh", "max"]>>;
83
+ /** Harness-scoped effort map (harness id → effort). Specific beats general:
84
+ * an entry here wins over the scalar `effort` and the per-harness settings
85
+ * default, analogous to `models`. Exact Retry replays the frozen
86
+ * per-lane efforts through this map so a non-primary lane keeps its effort. */
87
+ efforts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<["low", "medium", "high", "xhigh", "max"]>>>;
83
88
  reviewerModels: z.ZodOptional<z.ZodRecord<z.ZodEnum<["openai", "anthropic", "google", "cursor", "opencode", "xai", "local", "unknown"]>, z.ZodString>>;
84
89
  reviewerEfforts: z.ZodOptional<z.ZodRecord<z.ZodEnum<["openai", "anthropic", "google", "cursor", "opencode", "xai", "local", "unknown"]>, z.ZodEnum<["low", "medium", "high", "xhigh", "max"]>>>;
85
90
  n: z.ZodOptional<z.ZodNumber>;
@@ -244,8 +249,8 @@ export declare const ControlRunStartRequest: z.ZodObject<{
244
249
  prompt: string;
245
250
  scope: {
246
251
  kind: "project";
247
- root: string;
248
252
  context: "auto";
253
+ root: string;
249
254
  } | {
250
255
  kind: "none";
251
256
  };
@@ -280,6 +285,7 @@ export declare const ControlRunStartRequest: z.ZodObject<{
280
285
  retryOf?: string | undefined;
281
286
  primaryHarness?: string | undefined;
282
287
  routingGoal?: "auto" | "quality" | "economy" | undefined;
288
+ efforts?: Record<string, "low" | "medium" | "high" | "xhigh" | "max"> | undefined;
283
289
  reviewerModels?: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", string>> | undefined;
284
290
  reviewerEfforts?: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", "low" | "medium" | "high" | "xhigh" | "max">> | undefined;
285
291
  n?: number | undefined;
@@ -354,6 +360,7 @@ export declare const ControlRunStartRequest: z.ZodObject<{
354
360
  } | undefined;
355
361
  primaryHarness?: string | undefined;
356
362
  routingGoal?: "auto" | "quality" | "economy" | undefined;
363
+ efforts?: Record<string, "low" | "medium" | "high" | "xhigh" | "max"> | undefined;
357
364
  reviewerModels?: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", string>> | undefined;
358
365
  reviewerEfforts?: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", "low" | "medium" | "high" | "xhigh" | "max">> | undefined;
359
366
  n?: number | undefined;
@@ -415,8 +422,8 @@ export declare const ControlRunRetryResponse: z.ZodObject<{
415
422
  }, "strict", z.ZodTypeAny, {
416
423
  state: string;
417
424
  turnId: string | null;
418
- runId: string | null;
419
425
  jobId: string;
426
+ runId: string | null;
420
427
  retryOf: string;
421
428
  }, {
422
429
  state: string;
@@ -449,8 +456,8 @@ export declare const ControlRunAgainDraft: z.ZodObject<{
449
456
  context: z.ZodDefault<z.ZodEnum<["auto"]>>;
450
457
  }, "strict", z.ZodTypeAny, {
451
458
  kind: "project";
452
- root: string;
453
459
  context: "auto";
460
+ root: string;
454
461
  }, {
455
462
  kind: "project";
456
463
  root: string;
@@ -481,6 +488,11 @@ export declare const ControlRunAgainDraft: z.ZodObject<{
481
488
  * per-harness settings default. */
482
489
  models: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
483
490
  effort: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "xhigh", "max"]>>;
491
+ /** Harness-scoped effort map (harness id → effort). Specific beats general:
492
+ * an entry here wins over the scalar `effort` and the per-harness settings
493
+ * default, analogous to `models`. Exact Retry replays the frozen
494
+ * per-lane efforts through this map so a non-primary lane keeps its effort. */
495
+ efforts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<["low", "medium", "high", "xhigh", "max"]>>>;
484
496
  reviewerModels: z.ZodOptional<z.ZodRecord<z.ZodEnum<["openai", "anthropic", "google", "cursor", "opencode", "xai", "local", "unknown"]>, z.ZodString>>;
485
497
  reviewerEfforts: z.ZodOptional<z.ZodRecord<z.ZodEnum<["openai", "anthropic", "google", "cursor", "opencode", "xai", "local", "unknown"]>, z.ZodEnum<["low", "medium", "high", "xhigh", "max"]>>>;
486
498
  n: z.ZodOptional<z.ZodNumber>;
@@ -645,8 +657,8 @@ export declare const ControlRunAgainDraft: z.ZodObject<{
645
657
  prompt: string;
646
658
  scope: {
647
659
  kind: "project";
648
- root: string;
649
660
  context: "auto";
661
+ root: string;
650
662
  } | {
651
663
  kind: "none";
652
664
  };
@@ -681,6 +693,7 @@ export declare const ControlRunAgainDraft: z.ZodObject<{
681
693
  retryOf?: string | undefined;
682
694
  primaryHarness?: string | undefined;
683
695
  routingGoal?: "auto" | "quality" | "economy" | undefined;
696
+ efforts?: Record<string, "low" | "medium" | "high" | "xhigh" | "max"> | undefined;
684
697
  reviewerModels?: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", string>> | undefined;
685
698
  reviewerEfforts?: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", "low" | "medium" | "high" | "xhigh" | "max">> | undefined;
686
699
  n?: number | undefined;
@@ -755,6 +768,7 @@ export declare const ControlRunAgainDraft: z.ZodObject<{
755
768
  } | undefined;
756
769
  primaryHarness?: string | undefined;
757
770
  routingGoal?: "auto" | "quality" | "economy" | undefined;
771
+ efforts?: Record<string, "low" | "medium" | "high" | "xhigh" | "max"> | undefined;
758
772
  reviewerModels?: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", string>> | undefined;
759
773
  reviewerEfforts?: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", "low" | "medium" | "high" | "xhigh" | "max">> | undefined;
760
774
  n?: number | undefined;
@@ -809,8 +823,8 @@ export declare const ControlRunAgainDraft: z.ZodObject<{
809
823
  prompt: string;
810
824
  scope: {
811
825
  kind: "project";
812
- root: string;
813
826
  context: "auto";
827
+ root: string;
814
828
  } | {
815
829
  kind: "none";
816
830
  };
@@ -845,6 +859,7 @@ export declare const ControlRunAgainDraft: z.ZodObject<{
845
859
  retryOf?: string | undefined;
846
860
  primaryHarness?: string | undefined;
847
861
  routingGoal?: "auto" | "quality" | "economy" | undefined;
862
+ efforts?: Record<string, "low" | "medium" | "high" | "xhigh" | "max"> | undefined;
848
863
  reviewerModels?: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", string>> | undefined;
849
864
  reviewerEfforts?: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", "low" | "medium" | "high" | "xhigh" | "max">> | undefined;
850
865
  n?: number | undefined;
@@ -927,6 +942,7 @@ export declare const ControlRunAgainDraft: z.ZodObject<{
927
942
  } | undefined;
928
943
  primaryHarness?: string | undefined;
929
944
  routingGoal?: "auto" | "quality" | "economy" | undefined;
945
+ efforts?: Record<string, "low" | "medium" | "high" | "xhigh" | "max"> | undefined;
930
946
  reviewerModels?: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", string>> | undefined;
931
947
  reviewerEfforts?: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", "low" | "medium" | "high" | "xhigh" | "max">> | undefined;
932
948
  n?: number | undefined;
@@ -983,9 +999,12 @@ export declare const ControlQueuedRunInfo: z.ZodObject<{
983
999
  error?: string | undefined;
984
1000
  }>;
985
1001
  export type ControlQueuedRunInfo = z.infer<typeof ControlQueuedRunInfo>;
1002
+ export declare const RunFailureCode: z.ZodEnum<["finite_zero", "hard_cap", "estimate_headroom", "unknown_paid_in_flight", "budget_overshoot", "cost_unverifiable"]>;
1003
+ export type RunFailureCode = z.infer<typeof RunFailureCode>;
986
1004
  export declare const RunFailure: z.ZodObject<{
987
1005
  phase: z.ZodDefault<z.ZodString>;
988
- category: z.ZodDefault<z.ZodEnum<["validation", "project", "auth", "harness_unavailable", "harness_error", "budget", "policy", "cancelled", "internal", "unknown"]>>;
1006
+ category: z.ZodDefault<z.ZodEnum<["validation", "project", "auth", "harness_unavailable", "harness_error", "config_error", "budget", "policy", "cancelled", "internal", "unknown"]>>;
1007
+ code: z.ZodDefault<z.ZodNullable<z.ZodEnum<["finite_zero", "hard_cap", "estimate_headroom", "unknown_paid_in_flight", "budget_overshoot", "cost_unverifiable"]>>>;
989
1008
  harnessId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
990
1009
  attemptId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
991
1010
  safeMessage: z.ZodString;
@@ -995,11 +1014,12 @@ export declare const RunFailure: z.ZodObject<{
995
1014
  runDir: z.ZodDefault<z.ZodNullable<z.ZodString>>;
996
1015
  nextActions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
997
1016
  }, "strip", z.ZodTypeAny, {
1017
+ code: "budget_overshoot" | "cost_unverifiable" | "finite_zero" | "hard_cap" | "estimate_headroom" | "unknown_paid_in_flight" | null;
998
1018
  harnessId: string | null;
999
1019
  attemptId: string | null;
1000
1020
  runDir: string | null;
1001
1021
  phase: string;
1002
- category: "validation" | "unknown" | "harness_error" | "cancelled" | "auth" | "policy" | "budget" | "project" | "harness_unavailable" | "internal";
1022
+ category: "validation" | "unknown" | "harness_error" | "cancelled" | "auth" | "policy" | "budget" | "project" | "harness_unavailable" | "config_error" | "internal";
1003
1023
  safeMessage: string;
1004
1024
  rawDetailRef: string | null;
1005
1025
  logRefs: string[];
@@ -1007,11 +1027,12 @@ export declare const RunFailure: z.ZodObject<{
1007
1027
  nextActions: string[];
1008
1028
  }, {
1009
1029
  safeMessage: string;
1030
+ code?: "budget_overshoot" | "cost_unverifiable" | "finite_zero" | "hard_cap" | "estimate_headroom" | "unknown_paid_in_flight" | null | undefined;
1010
1031
  harnessId?: string | null | undefined;
1011
1032
  attemptId?: string | null | undefined;
1012
1033
  runDir?: string | null | undefined;
1013
1034
  phase?: string | undefined;
1014
- category?: "validation" | "unknown" | "harness_error" | "cancelled" | "auth" | "policy" | "budget" | "project" | "harness_unavailable" | "internal" | undefined;
1035
+ category?: "validation" | "unknown" | "harness_error" | "cancelled" | "auth" | "policy" | "budget" | "project" | "harness_unavailable" | "config_error" | "internal" | undefined;
1015
1036
  rawDetailRef?: string | null | undefined;
1016
1037
  logRefs?: string[] | undefined;
1017
1038
  eventRefs?: string[] | undefined;
@@ -1025,13 +1046,13 @@ export declare const ControlProjectMetadata: z.ZodObject<{
1025
1046
  context: z.ZodDefault<z.ZodEnum<["off", "auto"]>>;
1026
1047
  }, "strip", z.ZodTypeAny, {
1027
1048
  kind: "none" | "project";
1028
- root: string | null;
1029
1049
  context: "off" | "auto";
1050
+ root: string | null;
1030
1051
  projectName: string | null;
1031
1052
  }, {
1032
1053
  kind?: "none" | "project" | undefined;
1033
- root?: string | null | undefined;
1034
1054
  context?: "off" | "auto" | undefined;
1055
+ root?: string | null | undefined;
1035
1056
  projectName?: string | null | undefined;
1036
1057
  }>;
1037
1058
  export type ControlProjectMetadata = z.infer<typeof ControlProjectMetadata>;
@@ -1051,7 +1072,7 @@ export declare const ControlWebEvidence: z.ZodObject<{
1051
1072
  /** False when the run predates telemetry.yaml; surfaces must render "telemetry unavailable". */
1052
1073
  available: z.ZodDefault<z.ZodBoolean>;
1053
1074
  }, "strip", z.ZodTypeAny, {
1054
- status: "failed" | "none" | "attempted" | "unverified" | "satisfied";
1075
+ status: "failed" | "none" | "unverified" | "attempted" | "satisfied";
1055
1076
  available: boolean;
1056
1077
  target: string | null;
1057
1078
  mode: "off" | "auto" | "cached" | "live";
@@ -1063,7 +1084,7 @@ export declare const ControlWebEvidence: z.ZodObject<{
1063
1084
  satisfied: boolean;
1064
1085
  errorSummary: string | null;
1065
1086
  }, {
1066
- status?: "failed" | "none" | "attempted" | "unverified" | "satisfied" | undefined;
1087
+ status?: "failed" | "none" | "unverified" | "attempted" | "satisfied" | undefined;
1067
1088
  available?: boolean | undefined;
1068
1089
  target?: string | null | undefined;
1069
1090
  mode?: "off" | "auto" | "cached" | "live" | undefined;
@@ -1088,14 +1109,14 @@ export declare const ControlRouteInfo: z.ZodObject<{
1088
1109
  verified: z.ZodDefault<z.ZodBoolean>;
1089
1110
  }, "strip", z.ZodTypeAny, {
1090
1111
  harnessId: string | null;
1112
+ verified: boolean;
1091
1113
  requestedModel: string | null;
1092
1114
  observedModel: string | null;
1093
- verified: boolean;
1094
1115
  }, {
1095
1116
  harnessId?: string | null | undefined;
1117
+ verified?: boolean | undefined;
1096
1118
  requestedModel?: string | null | undefined;
1097
1119
  observedModel?: string | null | undefined;
1098
- verified?: boolean | undefined;
1099
1120
  }>;
1100
1121
  export type ControlRouteInfo = z.infer<typeof ControlRouteInfo>;
1101
1122
  /**
@@ -1199,7 +1220,8 @@ export declare const ControlRunSummary: z.ZodObject<{
1199
1220
  error: z.ZodOptional<z.ZodString>;
1200
1221
  failure: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1201
1222
  phase: z.ZodDefault<z.ZodString>;
1202
- category: z.ZodDefault<z.ZodEnum<["validation", "project", "auth", "harness_unavailable", "harness_error", "budget", "policy", "cancelled", "internal", "unknown"]>>;
1223
+ category: z.ZodDefault<z.ZodEnum<["validation", "project", "auth", "harness_unavailable", "harness_error", "config_error", "budget", "policy", "cancelled", "internal", "unknown"]>>;
1224
+ code: z.ZodDefault<z.ZodNullable<z.ZodEnum<["finite_zero", "hard_cap", "estimate_headroom", "unknown_paid_in_flight", "budget_overshoot", "cost_unverifiable"]>>>;
1203
1225
  harnessId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1204
1226
  attemptId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1205
1227
  safeMessage: z.ZodString;
@@ -1209,11 +1231,12 @@ export declare const ControlRunSummary: z.ZodObject<{
1209
1231
  runDir: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1210
1232
  nextActions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1211
1233
  }, "strip", z.ZodTypeAny, {
1234
+ code: "budget_overshoot" | "cost_unverifiable" | "finite_zero" | "hard_cap" | "estimate_headroom" | "unknown_paid_in_flight" | null;
1212
1235
  harnessId: string | null;
1213
1236
  attemptId: string | null;
1214
1237
  runDir: string | null;
1215
1238
  phase: string;
1216
- category: "validation" | "unknown" | "harness_error" | "cancelled" | "auth" | "policy" | "budget" | "project" | "harness_unavailable" | "internal";
1239
+ category: "validation" | "unknown" | "harness_error" | "cancelled" | "auth" | "policy" | "budget" | "project" | "harness_unavailable" | "config_error" | "internal";
1217
1240
  safeMessage: string;
1218
1241
  rawDetailRef: string | null;
1219
1242
  logRefs: string[];
@@ -1221,11 +1244,12 @@ export declare const ControlRunSummary: z.ZodObject<{
1221
1244
  nextActions: string[];
1222
1245
  }, {
1223
1246
  safeMessage: string;
1247
+ code?: "budget_overshoot" | "cost_unverifiable" | "finite_zero" | "hard_cap" | "estimate_headroom" | "unknown_paid_in_flight" | null | undefined;
1224
1248
  harnessId?: string | null | undefined;
1225
1249
  attemptId?: string | null | undefined;
1226
1250
  runDir?: string | null | undefined;
1227
1251
  phase?: string | undefined;
1228
- category?: "validation" | "unknown" | "harness_error" | "cancelled" | "auth" | "policy" | "budget" | "project" | "harness_unavailable" | "internal" | undefined;
1252
+ category?: "validation" | "unknown" | "harness_error" | "cancelled" | "auth" | "policy" | "budget" | "project" | "harness_unavailable" | "config_error" | "internal" | undefined;
1229
1253
  rawDetailRef?: string | null | undefined;
1230
1254
  logRefs?: string[] | undefined;
1231
1255
  eventRefs?: string[] | undefined;
@@ -1238,13 +1262,13 @@ export declare const ControlRunSummary: z.ZodObject<{
1238
1262
  context: z.ZodDefault<z.ZodEnum<["off", "auto"]>>;
1239
1263
  }, "strip", z.ZodTypeAny, {
1240
1264
  kind: "none" | "project";
1241
- root: string | null;
1242
1265
  context: "off" | "auto";
1266
+ root: string | null;
1243
1267
  projectName: string | null;
1244
1268
  }, {
1245
1269
  kind?: "none" | "project" | undefined;
1246
- root?: string | null | undefined;
1247
1270
  context?: "off" | "auto" | undefined;
1271
+ root?: string | null | undefined;
1248
1272
  projectName?: string | null | undefined;
1249
1273
  }>>;
1250
1274
  mode: z.ZodOptional<z.ZodEnum<["ask", "plan", "agent"]>>;
@@ -1380,7 +1404,7 @@ export declare const ControlRunSummary: z.ZodObject<{
1380
1404
  /** False when the run predates telemetry.yaml; surfaces must render "telemetry unavailable". */
1381
1405
  available: z.ZodDefault<z.ZodBoolean>;
1382
1406
  }, "strip", z.ZodTypeAny, {
1383
- status: "failed" | "none" | "attempted" | "unverified" | "satisfied";
1407
+ status: "failed" | "none" | "unverified" | "attempted" | "satisfied";
1384
1408
  available: boolean;
1385
1409
  target: string | null;
1386
1410
  mode: "off" | "auto" | "cached" | "live";
@@ -1392,7 +1416,7 @@ export declare const ControlRunSummary: z.ZodObject<{
1392
1416
  satisfied: boolean;
1393
1417
  errorSummary: string | null;
1394
1418
  }, {
1395
- status?: "failed" | "none" | "attempted" | "unverified" | "satisfied" | undefined;
1419
+ status?: "failed" | "none" | "unverified" | "attempted" | "satisfied" | undefined;
1396
1420
  available?: boolean | undefined;
1397
1421
  target?: string | null | undefined;
1398
1422
  mode?: "off" | "auto" | "cached" | "live" | undefined;
@@ -1499,19 +1523,70 @@ export declare const ControlRunSummary: z.ZodObject<{
1499
1523
  noChanges: z.ZodDefault<z.ZodBoolean>;
1500
1524
  checks: z.ZodDefault<z.ZodEnum<["passed", "failed", "not_configured"]>>;
1501
1525
  review: z.ZodDefault<z.ZodEnum<["approved", "blocked", "not_run"]>>;
1502
- reason: z.ZodDefault<z.ZodNullable<z.ZodEnum<["harness_failed", "no_changes", "review_blocked", "checks_failed", "budget_exhausted", "budget_overshoot", "cost_unverifiable", "not_converged", "stuck_no_progress", "wall_clock_exceeded", "user_cancelled", "crash_interrupted"]>>>;
1526
+ reason: z.ZodDefault<z.ZodNullable<z.ZodEnum<["harness_failed", "no_changes", "review_blocked", "checks_failed", "budget_exhausted", "budget_overshoot", "cost_unverifiable", "not_converged", "stuck_no_progress", "wall_clock_exceeded", "user_cancelled", "crash_interrupted", "input_required", "work_incomplete", "context_capacity_exhausted", "work_report_contract"]>>>;
1527
+ work_state: z.ZodOptional<z.ZodObject<{
1528
+ state: z.ZodEnum<["completed", "needs_input", "incomplete", "unverified"]>;
1529
+ source: z.ZodEnum<["constrained", "validated", "absent"]>;
1530
+ required_inputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
1531
+ kind: z.ZodEnum<["file", "context", "credential", "permission", "decision", "external_dependency"]>;
1532
+ locator: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1533
+ description: z.ZodString;
1534
+ }, "strip", z.ZodTypeAny, {
1535
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
1536
+ description: string;
1537
+ locator: string | null;
1538
+ }, {
1539
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
1540
+ description: string;
1541
+ locator?: string | null | undefined;
1542
+ }>, "many">>;
1543
+ }, "strip", z.ZodTypeAny, {
1544
+ source: "constrained" | "validated" | "absent";
1545
+ state: "completed" | "needs_input" | "incomplete" | "unverified";
1546
+ required_inputs?: {
1547
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
1548
+ description: string;
1549
+ locator: string | null;
1550
+ }[] | undefined;
1551
+ }, {
1552
+ source: "constrained" | "validated" | "absent";
1553
+ state: "completed" | "needs_input" | "incomplete" | "unverified";
1554
+ required_inputs?: {
1555
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
1556
+ description: string;
1557
+ locator?: string | null | undefined;
1558
+ }[] | undefined;
1559
+ }>>;
1503
1560
  }, "strict", z.ZodTypeAny, {
1504
1561
  review: "not_run" | "approved" | "blocked";
1505
- reason: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | null;
1562
+ reason: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | "input_required" | "work_incomplete" | "context_capacity_exhausted" | "work_report_contract" | null;
1506
1563
  checks: "passed" | "failed" | "not_configured";
1507
1564
  lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
1508
1565
  noChanges: boolean;
1566
+ work_state?: {
1567
+ source: "constrained" | "validated" | "absent";
1568
+ state: "completed" | "needs_input" | "incomplete" | "unverified";
1569
+ required_inputs?: {
1570
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
1571
+ description: string;
1572
+ locator: string | null;
1573
+ }[] | undefined;
1574
+ } | undefined;
1509
1575
  }, {
1510
1576
  lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
1511
1577
  review?: "not_run" | "approved" | "blocked" | undefined;
1512
- reason?: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | null | undefined;
1578
+ reason?: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | "input_required" | "work_incomplete" | "context_capacity_exhausted" | "work_report_contract" | null | undefined;
1513
1579
  checks?: "passed" | "failed" | "not_configured" | undefined;
1514
1580
  noChanges?: boolean | undefined;
1581
+ work_state?: {
1582
+ source: "constrained" | "validated" | "absent";
1583
+ state: "completed" | "needs_input" | "incomplete" | "unverified";
1584
+ required_inputs?: {
1585
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
1586
+ description: string;
1587
+ locator?: string | null | undefined;
1588
+ }[] | undefined;
1589
+ } | undefined;
1515
1590
  }>>>;
1516
1591
  /** True while at least one interaction.requested has no answered/timeout. */
1517
1592
  waitingOnUser: z.ZodDefault<z.ZodBoolean>;
@@ -1523,14 +1598,65 @@ export declare const ControlRunSummary: z.ZodObject<{
1523
1598
  verified: z.ZodDefault<z.ZodBoolean>;
1524
1599
  }, "strip", z.ZodTypeAny, {
1525
1600
  harnessId: string | null;
1601
+ verified: boolean;
1526
1602
  requestedModel: string | null;
1527
1603
  observedModel: string | null;
1528
- verified: boolean;
1529
1604
  }, {
1530
1605
  harnessId?: string | null | undefined;
1606
+ verified?: boolean | undefined;
1531
1607
  requestedModel?: string | null | undefined;
1532
1608
  observedModel?: string | null | undefined;
1533
- verified?: boolean | undefined;
1609
+ }>>>;
1610
+ /** QA-034: typed routing rationale projected verbatim from
1611
+ * telemetry.routing_rationale — the ordered/dropped pool, decisive reason,
1612
+ * and per-candidate billing/cost tuples. Null when no ranking was computed
1613
+ * (explicit single-harness pool) or on legacy runs. */
1614
+ routingRationale: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1615
+ goal: z.ZodEnum<["auto", "quality", "economy"]>;
1616
+ paid_fallback: z.ZodEnum<["never", "when_unavailable", "allowed_within_cap"]>;
1617
+ order: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1618
+ dropped: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1619
+ reason: z.ZodEnum<["subscription_entitlement_first", "lowest_incremental_cash", "quality_tier", "expiring_quota_slack", "all_incremental_cash_unknown", "declared_order"]>;
1620
+ entries: z.ZodDefault<z.ZodArray<z.ZodObject<{
1621
+ harness_id: z.ZodString;
1622
+ billing_knowledge: z.ZodEnum<["proven_zero", "subscription_entitlement", "metered", "unknown"]>;
1623
+ incremental_cost_usd: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1624
+ eligible: z.ZodBoolean;
1625
+ }, "strip", z.ZodTypeAny, {
1626
+ harness_id: string;
1627
+ billing_knowledge: "unknown" | "proven_zero" | "subscription_entitlement" | "metered";
1628
+ incremental_cost_usd: number | null;
1629
+ eligible: boolean;
1630
+ }, {
1631
+ harness_id: string;
1632
+ billing_knowledge: "unknown" | "proven_zero" | "subscription_entitlement" | "metered";
1633
+ eligible: boolean;
1634
+ incremental_cost_usd?: number | null | undefined;
1635
+ }>, "many">>;
1636
+ }, "strip", z.ZodTypeAny, {
1637
+ entries: {
1638
+ harness_id: string;
1639
+ billing_knowledge: "unknown" | "proven_zero" | "subscription_entitlement" | "metered";
1640
+ incremental_cost_usd: number | null;
1641
+ eligible: boolean;
1642
+ }[];
1643
+ reason: "subscription_entitlement_first" | "lowest_incremental_cash" | "quality_tier" | "expiring_quota_slack" | "all_incremental_cash_unknown" | "declared_order";
1644
+ goal: "auto" | "quality" | "economy";
1645
+ paid_fallback: "never" | "when_unavailable" | "allowed_within_cap";
1646
+ order: string[];
1647
+ dropped: string[];
1648
+ }, {
1649
+ reason: "subscription_entitlement_first" | "lowest_incremental_cash" | "quality_tier" | "expiring_quota_slack" | "all_incremental_cash_unknown" | "declared_order";
1650
+ goal: "auto" | "quality" | "economy";
1651
+ paid_fallback: "never" | "when_unavailable" | "allowed_within_cap";
1652
+ entries?: {
1653
+ harness_id: string;
1654
+ billing_knowledge: "unknown" | "proven_zero" | "subscription_entitlement" | "metered";
1655
+ eligible: boolean;
1656
+ incremental_cost_usd?: number | null | undefined;
1657
+ }[] | undefined;
1658
+ order?: string[] | undefined;
1659
+ dropped?: string[] | undefined;
1534
1660
  }>>>;
1535
1661
  tests: z.ZodOptional<z.ZodArray<z.ZodObject<{
1536
1662
  program: z.ZodString;
@@ -1553,27 +1679,21 @@ export declare const ControlRunSummary: z.ZodObject<{
1553
1679
  finishedAt: z.ZodOptional<z.ZodString>;
1554
1680
  }, "strip", z.ZodTypeAny, {
1555
1681
  state: "failed" | "cancelled" | "running" | "succeeded" | "interrupted" | "queued";
1556
- runId: string;
1557
- outcomeFacts: {
1558
- review: "not_run" | "approved" | "blocked";
1559
- reason: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | null;
1560
- checks: "passed" | "failed" | "not_configured";
1561
- lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
1562
- noChanges: boolean;
1563
- } | null;
1564
1682
  project: {
1565
1683
  kind: "none" | "project";
1566
- root: string | null;
1567
1684
  context: "off" | "auto";
1685
+ root: string | null;
1568
1686
  projectName: string | null;
1569
1687
  };
1570
1688
  jobId: string;
1689
+ runId: string;
1571
1690
  failure: {
1691
+ code: "budget_overshoot" | "cost_unverifiable" | "finite_zero" | "hard_cap" | "estimate_headroom" | "unknown_paid_in_flight" | null;
1572
1692
  harnessId: string | null;
1573
1693
  attemptId: string | null;
1574
1694
  runDir: string | null;
1575
1695
  phase: string;
1576
- category: "validation" | "unknown" | "harness_error" | "cancelled" | "auth" | "policy" | "budget" | "project" | "harness_unavailable" | "internal";
1696
+ category: "validation" | "unknown" | "harness_error" | "cancelled" | "auth" | "policy" | "budget" | "project" | "harness_unavailable" | "config_error" | "internal";
1577
1697
  safeMessage: string;
1578
1698
  rawDetailRef: string | null;
1579
1699
  logRefs: string[];
@@ -1581,7 +1701,7 @@ export declare const ControlRunSummary: z.ZodObject<{
1581
1701
  nextActions: string[];
1582
1702
  } | null;
1583
1703
  webEvidence: {
1584
- status: "failed" | "none" | "attempted" | "unverified" | "satisfied";
1704
+ status: "failed" | "none" | "unverified" | "attempted" | "satisfied";
1585
1705
  available: boolean;
1586
1706
  target: string | null;
1587
1707
  mode: "off" | "auto" | "cached" | "live";
@@ -1619,12 +1739,41 @@ export declare const ControlRunSummary: z.ZodObject<{
1619
1739
  preTurnSha: string | null;
1620
1740
  revertable: boolean;
1621
1741
  };
1742
+ outcomeFacts: {
1743
+ review: "not_run" | "approved" | "blocked";
1744
+ reason: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | "input_required" | "work_incomplete" | "context_capacity_exhausted" | "work_report_contract" | null;
1745
+ checks: "passed" | "failed" | "not_configured";
1746
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
1747
+ noChanges: boolean;
1748
+ work_state?: {
1749
+ source: "constrained" | "validated" | "absent";
1750
+ state: "completed" | "needs_input" | "incomplete" | "unverified";
1751
+ required_inputs?: {
1752
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
1753
+ description: string;
1754
+ locator: string | null;
1755
+ }[] | undefined;
1756
+ } | undefined;
1757
+ } | null;
1622
1758
  waitingOnUser: boolean;
1623
1759
  route: {
1624
1760
  harnessId: string | null;
1761
+ verified: boolean;
1625
1762
  requestedModel: string | null;
1626
1763
  observedModel: string | null;
1627
- verified: boolean;
1764
+ } | null;
1765
+ routingRationale: {
1766
+ entries: {
1767
+ harness_id: string;
1768
+ billing_knowledge: "unknown" | "proven_zero" | "subscription_entitlement" | "metered";
1769
+ incremental_cost_usd: number | null;
1770
+ eligible: boolean;
1771
+ }[];
1772
+ reason: "subscription_entitlement_first" | "lowest_incremental_cash" | "quality_tier" | "expiring_quota_slack" | "all_incremental_cash_unknown" | "declared_order";
1773
+ goal: "auto" | "quality" | "economy";
1774
+ paid_fallback: "never" | "when_unavailable" | "allowed_within_cap";
1775
+ order: string[];
1776
+ dropped: string[];
1628
1777
  } | null;
1629
1778
  startedAt?: string | undefined;
1630
1779
  error?: string | undefined;
@@ -1633,7 +1782,6 @@ export declare const ControlRunSummary: z.ZodObject<{
1633
1782
  prompt?: string | undefined;
1634
1783
  access?: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native" | undefined;
1635
1784
  harnesses?: string[] | undefined;
1636
- runDir?: string | undefined;
1637
1785
  model?: string | undefined;
1638
1786
  tests?: {
1639
1787
  args: string[];
@@ -1642,6 +1790,7 @@ export declare const ControlRunSummary: z.ZodObject<{
1642
1790
  cwd?: string | undefined;
1643
1791
  }[] | undefined;
1644
1792
  taskId?: string | undefined;
1793
+ runDir?: string | undefined;
1645
1794
  primaryHarness?: string | undefined;
1646
1795
  routingGoal?: "auto" | "quality" | "economy" | undefined;
1647
1796
  n?: number | undefined;
@@ -1688,8 +1837,8 @@ export declare const ControlRunSummary: z.ZodObject<{
1688
1837
  finishedAt?: string | undefined;
1689
1838
  }, {
1690
1839
  state: "failed" | "cancelled" | "running" | "succeeded" | "interrupted" | "queued";
1691
- runId: string;
1692
1840
  jobId: string;
1841
+ runId: string;
1693
1842
  startedAt?: string | undefined;
1694
1843
  error?: string | undefined;
1695
1844
  createdAt?: string | undefined;
@@ -1697,14 +1846,6 @@ export declare const ControlRunSummary: z.ZodObject<{
1697
1846
  prompt?: string | undefined;
1698
1847
  access?: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native" | undefined;
1699
1848
  harnesses?: string[] | undefined;
1700
- runDir?: string | undefined;
1701
- outcomeFacts?: {
1702
- lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
1703
- review?: "not_run" | "approved" | "blocked" | undefined;
1704
- reason?: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | null | undefined;
1705
- checks?: "passed" | "failed" | "not_configured" | undefined;
1706
- noChanges?: boolean | undefined;
1707
- } | null | undefined;
1708
1849
  model?: string | undefined;
1709
1850
  tests?: {
1710
1851
  program: string;
@@ -1714,11 +1855,12 @@ export declare const ControlRunSummary: z.ZodObject<{
1714
1855
  }[] | undefined;
1715
1856
  project?: {
1716
1857
  kind?: "none" | "project" | undefined;
1717
- root?: string | null | undefined;
1718
1858
  context?: "off" | "auto" | undefined;
1859
+ root?: string | null | undefined;
1719
1860
  projectName?: string | null | undefined;
1720
1861
  } | undefined;
1721
1862
  taskId?: string | undefined;
1863
+ runDir?: string | undefined;
1722
1864
  primaryHarness?: string | undefined;
1723
1865
  routingGoal?: "auto" | "quality" | "economy" | undefined;
1724
1866
  n?: number | undefined;
@@ -1740,11 +1882,12 @@ export declare const ControlRunSummary: z.ZodObject<{
1740
1882
  }[] | undefined;
1741
1883
  failure?: {
1742
1884
  safeMessage: string;
1885
+ code?: "budget_overshoot" | "cost_unverifiable" | "finite_zero" | "hard_cap" | "estimate_headroom" | "unknown_paid_in_flight" | null | undefined;
1743
1886
  harnessId?: string | null | undefined;
1744
1887
  attemptId?: string | null | undefined;
1745
1888
  runDir?: string | null | undefined;
1746
1889
  phase?: string | undefined;
1747
- category?: "validation" | "unknown" | "harness_error" | "cancelled" | "auth" | "policy" | "budget" | "project" | "harness_unavailable" | "internal" | undefined;
1890
+ category?: "validation" | "unknown" | "harness_error" | "cancelled" | "auth" | "policy" | "budget" | "project" | "harness_unavailable" | "config_error" | "internal" | undefined;
1748
1891
  rawDetailRef?: string | null | undefined;
1749
1892
  logRefs?: string[] | undefined;
1750
1893
  eventRefs?: string[] | undefined;
@@ -1774,7 +1917,7 @@ export declare const ControlRunSummary: z.ZodObject<{
1774
1917
  webRequired?: boolean | undefined;
1775
1918
  webMode?: "off" | "auto" | "cached" | "live" | undefined;
1776
1919
  webEvidence?: {
1777
- status?: "failed" | "none" | "attempted" | "unverified" | "satisfied" | undefined;
1920
+ status?: "failed" | "none" | "unverified" | "attempted" | "satisfied" | undefined;
1778
1921
  available?: boolean | undefined;
1779
1922
  target?: string | null | undefined;
1780
1923
  mode?: "off" | "auto" | "cached" | "live" | undefined;
@@ -1813,12 +1956,41 @@ export declare const ControlRunSummary: z.ZodObject<{
1813
1956
  preTurnSha?: string | null | undefined;
1814
1957
  revertable?: boolean | undefined;
1815
1958
  } | undefined;
1959
+ outcomeFacts?: {
1960
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
1961
+ review?: "not_run" | "approved" | "blocked" | undefined;
1962
+ reason?: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | "input_required" | "work_incomplete" | "context_capacity_exhausted" | "work_report_contract" | null | undefined;
1963
+ checks?: "passed" | "failed" | "not_configured" | undefined;
1964
+ noChanges?: boolean | undefined;
1965
+ work_state?: {
1966
+ source: "constrained" | "validated" | "absent";
1967
+ state: "completed" | "needs_input" | "incomplete" | "unverified";
1968
+ required_inputs?: {
1969
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
1970
+ description: string;
1971
+ locator?: string | null | undefined;
1972
+ }[] | undefined;
1973
+ } | undefined;
1974
+ } | null | undefined;
1816
1975
  waitingOnUser?: boolean | undefined;
1817
1976
  route?: {
1818
1977
  harnessId?: string | null | undefined;
1978
+ verified?: boolean | undefined;
1819
1979
  requestedModel?: string | null | undefined;
1820
1980
  observedModel?: string | null | undefined;
1821
- verified?: boolean | undefined;
1981
+ } | null | undefined;
1982
+ routingRationale?: {
1983
+ reason: "subscription_entitlement_first" | "lowest_incremental_cash" | "quality_tier" | "expiring_quota_slack" | "all_incremental_cash_unknown" | "declared_order";
1984
+ goal: "auto" | "quality" | "economy";
1985
+ paid_fallback: "never" | "when_unavailable" | "allowed_within_cap";
1986
+ entries?: {
1987
+ harness_id: string;
1988
+ billing_knowledge: "unknown" | "proven_zero" | "subscription_entitlement" | "metered";
1989
+ eligible: boolean;
1990
+ incremental_cost_usd?: number | null | undefined;
1991
+ }[] | undefined;
1992
+ order?: string[] | undefined;
1993
+ dropped?: string[] | undefined;
1822
1994
  } | null | undefined;
1823
1995
  finishedAt?: string | undefined;
1824
1996
  }>;
@@ -1834,6 +2006,12 @@ export declare const ControlTimelineEvent: z.ZodObject<{
1834
2006
  toolName: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1835
2007
  target: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1836
2008
  errorSummary: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2009
+ /** Unsupported per-harness knobs the selected route silently could not honor
2010
+ * (INV-105): the engine discloses them on `harness.started`, and this
2011
+ * projection carries them so the row can render a visible warning ("max_turns
2012
+ * was ignored") instead of an indistinguishable benign start (QA-070). Empty
2013
+ * for every event that dropped nothing. */
2014
+ ignoredSettings: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1837
2015
  rawRef: z.ZodDefault<z.ZodNullable<z.ZodString>>;
1838
2016
  }, "strip", z.ZodTypeAny, {
1839
2017
  type: string;
@@ -1845,6 +2023,7 @@ export declare const ControlTimelineEvent: z.ZodObject<{
1845
2023
  errorSummary: string | null;
1846
2024
  severity: "error" | "info" | "warning";
1847
2025
  toolName: string | null;
2026
+ ignoredSettings: string[];
1848
2027
  rawRef: string | null;
1849
2028
  ts?: string | undefined;
1850
2029
  }, {
@@ -1858,9 +2037,12 @@ export declare const ControlTimelineEvent: z.ZodObject<{
1858
2037
  errorSummary?: string | null | undefined;
1859
2038
  severity?: "error" | "info" | "warning" | undefined;
1860
2039
  toolName?: string | null | undefined;
2040
+ ignoredSettings?: string[] | undefined;
1861
2041
  rawRef?: string | null | undefined;
1862
2042
  }>;
1863
2043
  export type ControlTimelineEvent = z.infer<typeof ControlTimelineEvent>;
2044
+ export declare const ControlEvidenceIntegrity: z.ZodEnum<["complete", "incomplete", "unavailable"]>;
2045
+ export type ControlEvidenceIntegrity = z.infer<typeof ControlEvidenceIntegrity>;
1864
2046
  export declare const ControlBudgetSnapshot: z.ZodObject<{
1865
2047
  paidBudget: z.ZodDefault<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1866
2048
  kind: z.ZodLiteral<"unlimited">;
@@ -1879,9 +2061,18 @@ export declare const ControlBudgetSnapshot: z.ZodObject<{
1879
2061
  maxUsd: number;
1880
2062
  }>]>>;
1881
2063
  spendUsd: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
2064
+ /** Subscription VALUATION in USD (QA-023c/QA-017b): what this run's
2065
+ * native-subscription work would approximately have cost by token valuation,
2066
+ * accumulated separately from real billed cash. Null when no valuation is
2067
+ * known — an UNKNOWN valuation (e.g. a harness that never reported usage)
2068
+ * stays null and is NEVER coerced to a fake $0. Cash exact $0 + a non-null
2069
+ * valuation is the honest subscription shape. */
2070
+ valuationUsd: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
2071
+ valuationKnowledge: z.ZodDefault<z.ZodEnum<["exact", "estimated", "unknown"]>>;
1882
2072
  remainingUsd: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1883
2073
  estimated: z.ZodDefault<z.ZodBoolean>;
1884
2074
  source: z.ZodDefault<z.ZodEnum<["decision", "events", "settings", "unknown"]>>;
2075
+ evidence: z.ZodDefault<z.ZodEnum<["complete", "incomplete", "unavailable"]>>;
1885
2076
  }, "strip", z.ZodTypeAny, {
1886
2077
  source: "unknown" | "decision" | "events" | "settings";
1887
2078
  estimated: boolean;
@@ -1892,7 +2083,10 @@ export declare const ControlBudgetSnapshot: z.ZodObject<{
1892
2083
  maxUsd: number;
1893
2084
  };
1894
2085
  spendUsd: number | null;
2086
+ valuationUsd: number | null;
2087
+ valuationKnowledge: "exact" | "unknown" | "estimated";
1895
2088
  remainingUsd: number | null;
2089
+ evidence: "unavailable" | "incomplete" | "complete";
1896
2090
  }, {
1897
2091
  source?: "unknown" | "decision" | "events" | "settings" | undefined;
1898
2092
  estimated?: boolean | undefined;
@@ -1903,7 +2097,10 @@ export declare const ControlBudgetSnapshot: z.ZodObject<{
1903
2097
  maxUsd: number;
1904
2098
  } | undefined;
1905
2099
  spendUsd?: number | null | undefined;
2100
+ valuationUsd?: number | null | undefined;
2101
+ valuationKnowledge?: "exact" | "unknown" | "estimated" | undefined;
1906
2102
  remainingUsd?: number | null | undefined;
2103
+ evidence?: "unavailable" | "incomplete" | "complete" | undefined;
1907
2104
  }>;
1908
2105
  export type ControlBudgetSnapshot = z.infer<typeof ControlBudgetSnapshot>;
1909
2106
  export declare const ControlArtifactInfo: z.ZodObject<{
@@ -2174,14 +2371,14 @@ export declare const ControlRunControlResponse: z.ZodObject<{
2174
2371
  runId: z.ZodOptional<z.ZodString>;
2175
2372
  message: z.ZodOptional<z.ZodString>;
2176
2373
  }, "strip", z.ZodTypeAny, {
2177
- status: "rejected" | "queued" | "applied" | "unsupported";
2374
+ status: "unsupported" | "rejected" | "queued" | "applied";
2178
2375
  accepted: boolean;
2179
2376
  message?: string | undefined;
2180
2377
  runId?: string | undefined;
2181
2378
  }, {
2182
2379
  accepted: boolean;
2183
2380
  message?: string | undefined;
2184
- status?: "rejected" | "queued" | "applied" | "unsupported" | undefined;
2381
+ status?: "unsupported" | "rejected" | "queued" | "applied" | undefined;
2185
2382
  runId?: string | undefined;
2186
2383
  }>;
2187
2384
  export type ControlRunControlResponse = z.infer<typeof ControlRunControlResponse>;
@@ -2343,12 +2540,12 @@ export declare const ControlRunDecisionResponse: z.ZodObject<{
2343
2540
  newRunId: z.ZodOptional<z.ZodString>;
2344
2541
  message: z.ZodOptional<z.ZodString>;
2345
2542
  }, "strip", z.ZodTypeAny, {
2346
- status: "rejected" | "applied" | "unsupported" | "requeued";
2543
+ status: "unsupported" | "rejected" | "applied" | "requeued";
2347
2544
  accepted: boolean;
2348
2545
  message?: string | undefined;
2349
2546
  newRunId?: string | undefined;
2350
2547
  }, {
2351
- status: "rejected" | "applied" | "unsupported" | "requeued";
2548
+ status: "unsupported" | "rejected" | "applied" | "requeued";
2352
2549
  accepted: boolean;
2353
2550
  message?: string | undefined;
2354
2551
  newRunId?: string | undefined;
@@ -2519,19 +2716,70 @@ export declare const ControlTurnRunCard: z.ZodObject<{
2519
2716
  noChanges: z.ZodDefault<z.ZodBoolean>;
2520
2717
  checks: z.ZodDefault<z.ZodEnum<["passed", "failed", "not_configured"]>>;
2521
2718
  review: z.ZodDefault<z.ZodEnum<["approved", "blocked", "not_run"]>>;
2522
- reason: z.ZodDefault<z.ZodNullable<z.ZodEnum<["harness_failed", "no_changes", "review_blocked", "checks_failed", "budget_exhausted", "budget_overshoot", "cost_unverifiable", "not_converged", "stuck_no_progress", "wall_clock_exceeded", "user_cancelled", "crash_interrupted"]>>>;
2719
+ reason: z.ZodDefault<z.ZodNullable<z.ZodEnum<["harness_failed", "no_changes", "review_blocked", "checks_failed", "budget_exhausted", "budget_overshoot", "cost_unverifiable", "not_converged", "stuck_no_progress", "wall_clock_exceeded", "user_cancelled", "crash_interrupted", "input_required", "work_incomplete", "context_capacity_exhausted", "work_report_contract"]>>>;
2720
+ work_state: z.ZodOptional<z.ZodObject<{
2721
+ state: z.ZodEnum<["completed", "needs_input", "incomplete", "unverified"]>;
2722
+ source: z.ZodEnum<["constrained", "validated", "absent"]>;
2723
+ required_inputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
2724
+ kind: z.ZodEnum<["file", "context", "credential", "permission", "decision", "external_dependency"]>;
2725
+ locator: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2726
+ description: z.ZodString;
2727
+ }, "strip", z.ZodTypeAny, {
2728
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
2729
+ description: string;
2730
+ locator: string | null;
2731
+ }, {
2732
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
2733
+ description: string;
2734
+ locator?: string | null | undefined;
2735
+ }>, "many">>;
2736
+ }, "strip", z.ZodTypeAny, {
2737
+ source: "constrained" | "validated" | "absent";
2738
+ state: "completed" | "needs_input" | "incomplete" | "unverified";
2739
+ required_inputs?: {
2740
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
2741
+ description: string;
2742
+ locator: string | null;
2743
+ }[] | undefined;
2744
+ }, {
2745
+ source: "constrained" | "validated" | "absent";
2746
+ state: "completed" | "needs_input" | "incomplete" | "unverified";
2747
+ required_inputs?: {
2748
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
2749
+ description: string;
2750
+ locator?: string | null | undefined;
2751
+ }[] | undefined;
2752
+ }>>;
2523
2753
  }, "strict", z.ZodTypeAny, {
2524
2754
  review: "not_run" | "approved" | "blocked";
2525
- reason: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | null;
2755
+ reason: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | "input_required" | "work_incomplete" | "context_capacity_exhausted" | "work_report_contract" | null;
2526
2756
  checks: "passed" | "failed" | "not_configured";
2527
2757
  lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
2528
2758
  noChanges: boolean;
2759
+ work_state?: {
2760
+ source: "constrained" | "validated" | "absent";
2761
+ state: "completed" | "needs_input" | "incomplete" | "unverified";
2762
+ required_inputs?: {
2763
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
2764
+ description: string;
2765
+ locator: string | null;
2766
+ }[] | undefined;
2767
+ } | undefined;
2529
2768
  }, {
2530
2769
  lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
2531
2770
  review?: "not_run" | "approved" | "blocked" | undefined;
2532
- reason?: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | null | undefined;
2771
+ reason?: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | "input_required" | "work_incomplete" | "context_capacity_exhausted" | "work_report_contract" | null | undefined;
2533
2772
  checks?: "passed" | "failed" | "not_configured" | undefined;
2534
2773
  noChanges?: boolean | undefined;
2774
+ work_state?: {
2775
+ source: "constrained" | "validated" | "absent";
2776
+ state: "completed" | "needs_input" | "incomplete" | "unverified";
2777
+ required_inputs?: {
2778
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
2779
+ description: string;
2780
+ locator?: string | null | undefined;
2781
+ }[] | undefined;
2782
+ } | undefined;
2535
2783
  }>>>;
2536
2784
  spendUsd: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2537
2785
  outputReadyState: z.ZodDefault<z.ZodEnum<["pending", "finalizing", "ready", "diagnostic"]>>;
@@ -2539,13 +2787,6 @@ export declare const ControlTurnRunCard: z.ZodObject<{
2539
2787
  finishedAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2540
2788
  }, "strip", z.ZodTypeAny, {
2541
2789
  state: "failed" | "cancelled" | "running" | "succeeded" | "interrupted" | "queued";
2542
- outcomeFacts: {
2543
- review: "not_run" | "approved" | "blocked";
2544
- reason: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | null;
2545
- checks: "passed" | "failed" | "not_configured";
2546
- lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
2547
- noChanges: boolean;
2548
- } | null;
2549
2790
  outputReadyState: "pending" | "finalizing" | "ready" | "diagnostic";
2550
2791
  result: {
2551
2792
  kind: "plan" | "none" | "patch" | "answer" | "report";
@@ -2562,6 +2803,22 @@ export declare const ControlTurnRunCard: z.ZodObject<{
2562
2803
  preTurnSha: string | null;
2563
2804
  revertable: boolean;
2564
2805
  };
2806
+ outcomeFacts: {
2807
+ review: "not_run" | "approved" | "blocked";
2808
+ reason: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | "input_required" | "work_incomplete" | "context_capacity_exhausted" | "work_report_contract" | null;
2809
+ checks: "passed" | "failed" | "not_configured";
2810
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
2811
+ noChanges: boolean;
2812
+ work_state?: {
2813
+ source: "constrained" | "validated" | "absent";
2814
+ state: "completed" | "needs_input" | "incomplete" | "unverified";
2815
+ required_inputs?: {
2816
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
2817
+ description: string;
2818
+ locator: string | null;
2819
+ }[] | undefined;
2820
+ } | undefined;
2821
+ } | null;
2565
2822
  waitingOnUser: boolean;
2566
2823
  finishedAt: string | null;
2567
2824
  mode?: "ask" | "plan" | "agent" | undefined;
@@ -2571,13 +2828,6 @@ export declare const ControlTurnRunCard: z.ZodObject<{
2571
2828
  }, {
2572
2829
  state: "failed" | "cancelled" | "running" | "succeeded" | "interrupted" | "queued";
2573
2830
  mode?: "ask" | "plan" | "agent" | undefined;
2574
- outcomeFacts?: {
2575
- lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
2576
- review?: "not_run" | "approved" | "blocked" | undefined;
2577
- reason?: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | null | undefined;
2578
- checks?: "passed" | "failed" | "not_configured" | undefined;
2579
- noChanges?: boolean | undefined;
2580
- } | null | undefined;
2581
2831
  n?: number | undefined;
2582
2832
  strategy?: "attempts" | "create" | "race" | "until_clean" | "deep_scan" | null | undefined;
2583
2833
  spendUsd?: number | null | undefined;
@@ -2597,6 +2847,22 @@ export declare const ControlTurnRunCard: z.ZodObject<{
2597
2847
  preTurnSha?: string | null | undefined;
2598
2848
  revertable?: boolean | undefined;
2599
2849
  } | undefined;
2850
+ outcomeFacts?: {
2851
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
2852
+ review?: "not_run" | "approved" | "blocked" | undefined;
2853
+ reason?: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | "input_required" | "work_incomplete" | "context_capacity_exhausted" | "work_report_contract" | null | undefined;
2854
+ checks?: "passed" | "failed" | "not_configured" | undefined;
2855
+ noChanges?: boolean | undefined;
2856
+ work_state?: {
2857
+ source: "constrained" | "validated" | "absent";
2858
+ state: "completed" | "needs_input" | "incomplete" | "unverified";
2859
+ required_inputs?: {
2860
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
2861
+ description: string;
2862
+ locator?: string | null | undefined;
2863
+ }[] | undefined;
2864
+ } | undefined;
2865
+ } | null | undefined;
2600
2866
  waitingOnUser?: boolean | undefined;
2601
2867
  finishedAt?: string | null | undefined;
2602
2868
  }>;
@@ -2608,6 +2874,16 @@ export declare const ControlThreadTurn: z.ZodObject<{
2608
2874
  parentRunId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2609
2875
  /** Set when this turn implements an approved plan from an earlier run. */
2610
2876
  planRunId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2877
+ /** The SHA-256 of the exact plan bytes this Implement turn froze (INV-081),
2878
+ * persisted on the durable turn but historically dropped by the projection
2879
+ * (QA-046). Surfaces render a compact "implemented plan <run> · sha256 <hash>"
2880
+ * receipt; null on non-Implement turns and legacy turns predating the freeze. */
2881
+ planHash: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2882
+ /** True when the operator chose "Implement anyway" over a plan that still had
2883
+ * open questions (INV-081 provenance); the durable turn records it but the
2884
+ * projection dropped it (QA-046). Surfaces render a persistent warning receipt
2885
+ * so the destructive-override choice survives reload. Defaults false. */
2886
+ planReadinessOverridden: z.ZodDefault<z.ZodBoolean>;
2611
2887
  kind: z.ZodDefault<z.ZodEnum<["initial", "followup", "decision"]>>;
2612
2888
  prompt: z.ZodDefault<z.ZodString>;
2613
2889
  /** Embedded run card (outcome/state) so the chat renders without N+1 fetches. */
@@ -2678,19 +2954,70 @@ export declare const ControlThreadTurn: z.ZodObject<{
2678
2954
  noChanges: z.ZodDefault<z.ZodBoolean>;
2679
2955
  checks: z.ZodDefault<z.ZodEnum<["passed", "failed", "not_configured"]>>;
2680
2956
  review: z.ZodDefault<z.ZodEnum<["approved", "blocked", "not_run"]>>;
2681
- reason: z.ZodDefault<z.ZodNullable<z.ZodEnum<["harness_failed", "no_changes", "review_blocked", "checks_failed", "budget_exhausted", "budget_overshoot", "cost_unverifiable", "not_converged", "stuck_no_progress", "wall_clock_exceeded", "user_cancelled", "crash_interrupted"]>>>;
2957
+ reason: z.ZodDefault<z.ZodNullable<z.ZodEnum<["harness_failed", "no_changes", "review_blocked", "checks_failed", "budget_exhausted", "budget_overshoot", "cost_unverifiable", "not_converged", "stuck_no_progress", "wall_clock_exceeded", "user_cancelled", "crash_interrupted", "input_required", "work_incomplete", "context_capacity_exhausted", "work_report_contract"]>>>;
2958
+ work_state: z.ZodOptional<z.ZodObject<{
2959
+ state: z.ZodEnum<["completed", "needs_input", "incomplete", "unverified"]>;
2960
+ source: z.ZodEnum<["constrained", "validated", "absent"]>;
2961
+ required_inputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
2962
+ kind: z.ZodEnum<["file", "context", "credential", "permission", "decision", "external_dependency"]>;
2963
+ locator: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2964
+ description: z.ZodString;
2965
+ }, "strip", z.ZodTypeAny, {
2966
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
2967
+ description: string;
2968
+ locator: string | null;
2969
+ }, {
2970
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
2971
+ description: string;
2972
+ locator?: string | null | undefined;
2973
+ }>, "many">>;
2974
+ }, "strip", z.ZodTypeAny, {
2975
+ source: "constrained" | "validated" | "absent";
2976
+ state: "completed" | "needs_input" | "incomplete" | "unverified";
2977
+ required_inputs?: {
2978
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
2979
+ description: string;
2980
+ locator: string | null;
2981
+ }[] | undefined;
2982
+ }, {
2983
+ source: "constrained" | "validated" | "absent";
2984
+ state: "completed" | "needs_input" | "incomplete" | "unverified";
2985
+ required_inputs?: {
2986
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
2987
+ description: string;
2988
+ locator?: string | null | undefined;
2989
+ }[] | undefined;
2990
+ }>>;
2682
2991
  }, "strict", z.ZodTypeAny, {
2683
2992
  review: "not_run" | "approved" | "blocked";
2684
- reason: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | null;
2993
+ reason: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | "input_required" | "work_incomplete" | "context_capacity_exhausted" | "work_report_contract" | null;
2685
2994
  checks: "passed" | "failed" | "not_configured";
2686
2995
  lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
2687
2996
  noChanges: boolean;
2997
+ work_state?: {
2998
+ source: "constrained" | "validated" | "absent";
2999
+ state: "completed" | "needs_input" | "incomplete" | "unverified";
3000
+ required_inputs?: {
3001
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
3002
+ description: string;
3003
+ locator: string | null;
3004
+ }[] | undefined;
3005
+ } | undefined;
2688
3006
  }, {
2689
3007
  lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
2690
3008
  review?: "not_run" | "approved" | "blocked" | undefined;
2691
- reason?: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | null | undefined;
3009
+ reason?: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | "input_required" | "work_incomplete" | "context_capacity_exhausted" | "work_report_contract" | null | undefined;
2692
3010
  checks?: "passed" | "failed" | "not_configured" | undefined;
2693
3011
  noChanges?: boolean | undefined;
3012
+ work_state?: {
3013
+ source: "constrained" | "validated" | "absent";
3014
+ state: "completed" | "needs_input" | "incomplete" | "unverified";
3015
+ required_inputs?: {
3016
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
3017
+ description: string;
3018
+ locator?: string | null | undefined;
3019
+ }[] | undefined;
3020
+ } | undefined;
2694
3021
  }>>>;
2695
3022
  spendUsd: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
2696
3023
  outputReadyState: z.ZodDefault<z.ZodEnum<["pending", "finalizing", "ready", "diagnostic"]>>;
@@ -2698,13 +3025,6 @@ export declare const ControlThreadTurn: z.ZodObject<{
2698
3025
  finishedAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2699
3026
  }, "strip", z.ZodTypeAny, {
2700
3027
  state: "failed" | "cancelled" | "running" | "succeeded" | "interrupted" | "queued";
2701
- outcomeFacts: {
2702
- review: "not_run" | "approved" | "blocked";
2703
- reason: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | null;
2704
- checks: "passed" | "failed" | "not_configured";
2705
- lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
2706
- noChanges: boolean;
2707
- } | null;
2708
3028
  outputReadyState: "pending" | "finalizing" | "ready" | "diagnostic";
2709
3029
  result: {
2710
3030
  kind: "plan" | "none" | "patch" | "answer" | "report";
@@ -2721,6 +3041,22 @@ export declare const ControlThreadTurn: z.ZodObject<{
2721
3041
  preTurnSha: string | null;
2722
3042
  revertable: boolean;
2723
3043
  };
3044
+ outcomeFacts: {
3045
+ review: "not_run" | "approved" | "blocked";
3046
+ reason: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | "input_required" | "work_incomplete" | "context_capacity_exhausted" | "work_report_contract" | null;
3047
+ checks: "passed" | "failed" | "not_configured";
3048
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
3049
+ noChanges: boolean;
3050
+ work_state?: {
3051
+ source: "constrained" | "validated" | "absent";
3052
+ state: "completed" | "needs_input" | "incomplete" | "unverified";
3053
+ required_inputs?: {
3054
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
3055
+ description: string;
3056
+ locator: string | null;
3057
+ }[] | undefined;
3058
+ } | undefined;
3059
+ } | null;
2724
3060
  waitingOnUser: boolean;
2725
3061
  finishedAt: string | null;
2726
3062
  mode?: "ask" | "plan" | "agent" | undefined;
@@ -2730,13 +3066,6 @@ export declare const ControlThreadTurn: z.ZodObject<{
2730
3066
  }, {
2731
3067
  state: "failed" | "cancelled" | "running" | "succeeded" | "interrupted" | "queued";
2732
3068
  mode?: "ask" | "plan" | "agent" | undefined;
2733
- outcomeFacts?: {
2734
- lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
2735
- review?: "not_run" | "approved" | "blocked" | undefined;
2736
- reason?: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | null | undefined;
2737
- checks?: "passed" | "failed" | "not_configured" | undefined;
2738
- noChanges?: boolean | undefined;
2739
- } | null | undefined;
2740
3069
  n?: number | undefined;
2741
3070
  strategy?: "attempts" | "create" | "race" | "until_clean" | "deep_scan" | null | undefined;
2742
3071
  spendUsd?: number | null | undefined;
@@ -2756,6 +3085,22 @@ export declare const ControlThreadTurn: z.ZodObject<{
2756
3085
  preTurnSha?: string | null | undefined;
2757
3086
  revertable?: boolean | undefined;
2758
3087
  } | undefined;
3088
+ outcomeFacts?: {
3089
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
3090
+ review?: "not_run" | "approved" | "blocked" | undefined;
3091
+ reason?: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | "input_required" | "work_incomplete" | "context_capacity_exhausted" | "work_report_contract" | null | undefined;
3092
+ checks?: "passed" | "failed" | "not_configured" | undefined;
3093
+ noChanges?: boolean | undefined;
3094
+ work_state?: {
3095
+ source: "constrained" | "validated" | "absent";
3096
+ state: "completed" | "needs_input" | "incomplete" | "unverified";
3097
+ required_inputs?: {
3098
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
3099
+ description: string;
3100
+ locator?: string | null | undefined;
3101
+ }[] | undefined;
3102
+ } | undefined;
3103
+ } | null | undefined;
2759
3104
  waitingOnUser?: boolean | undefined;
2760
3105
  finishedAt?: string | null | undefined;
2761
3106
  }>>>;
@@ -2835,15 +3180,10 @@ export declare const ControlThreadTurn: z.ZodObject<{
2835
3180
  planRunId: string | null;
2836
3181
  runId: string | null;
2837
3182
  parentRunId: string | null;
3183
+ planHash: string | null;
3184
+ planReadinessOverridden: boolean;
2838
3185
  run: {
2839
3186
  state: "failed" | "cancelled" | "running" | "succeeded" | "interrupted" | "queued";
2840
- outcomeFacts: {
2841
- review: "not_run" | "approved" | "blocked";
2842
- reason: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | null;
2843
- checks: "passed" | "failed" | "not_configured";
2844
- lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
2845
- noChanges: boolean;
2846
- } | null;
2847
3187
  outputReadyState: "pending" | "finalizing" | "ready" | "diagnostic";
2848
3188
  result: {
2849
3189
  kind: "plan" | "none" | "patch" | "answer" | "report";
@@ -2860,6 +3200,22 @@ export declare const ControlThreadTurn: z.ZodObject<{
2860
3200
  preTurnSha: string | null;
2861
3201
  revertable: boolean;
2862
3202
  };
3203
+ outcomeFacts: {
3204
+ review: "not_run" | "approved" | "blocked";
3205
+ reason: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | "input_required" | "work_incomplete" | "context_capacity_exhausted" | "work_report_contract" | null;
3206
+ checks: "passed" | "failed" | "not_configured";
3207
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
3208
+ noChanges: boolean;
3209
+ work_state?: {
3210
+ source: "constrained" | "validated" | "absent";
3211
+ state: "completed" | "needs_input" | "incomplete" | "unverified";
3212
+ required_inputs?: {
3213
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
3214
+ description: string;
3215
+ locator: string | null;
3216
+ }[] | undefined;
3217
+ } | undefined;
3218
+ } | null;
2863
3219
  waitingOnUser: boolean;
2864
3220
  finishedAt: string | null;
2865
3221
  mode?: "ask" | "plan" | "agent" | undefined;
@@ -2891,16 +3247,11 @@ export declare const ControlThreadTurn: z.ZodObject<{
2891
3247
  planRunId?: string | null | undefined;
2892
3248
  runId?: string | null | undefined;
2893
3249
  parentRunId?: string | null | undefined;
3250
+ planHash?: string | null | undefined;
3251
+ planReadinessOverridden?: boolean | undefined;
2894
3252
  run?: {
2895
3253
  state: "failed" | "cancelled" | "running" | "succeeded" | "interrupted" | "queued";
2896
3254
  mode?: "ask" | "plan" | "agent" | undefined;
2897
- outcomeFacts?: {
2898
- lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
2899
- review?: "not_run" | "approved" | "blocked" | undefined;
2900
- reason?: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | null | undefined;
2901
- checks?: "passed" | "failed" | "not_configured" | undefined;
2902
- noChanges?: boolean | undefined;
2903
- } | null | undefined;
2904
3255
  n?: number | undefined;
2905
3256
  strategy?: "attempts" | "create" | "race" | "until_clean" | "deep_scan" | null | undefined;
2906
3257
  spendUsd?: number | null | undefined;
@@ -2920,6 +3271,22 @@ export declare const ControlThreadTurn: z.ZodObject<{
2920
3271
  preTurnSha?: string | null | undefined;
2921
3272
  revertable?: boolean | undefined;
2922
3273
  } | undefined;
3274
+ outcomeFacts?: {
3275
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
3276
+ review?: "not_run" | "approved" | "blocked" | undefined;
3277
+ reason?: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | "input_required" | "work_incomplete" | "context_capacity_exhausted" | "work_report_contract" | null | undefined;
3278
+ checks?: "passed" | "failed" | "not_configured" | undefined;
3279
+ noChanges?: boolean | undefined;
3280
+ work_state?: {
3281
+ source: "constrained" | "validated" | "absent";
3282
+ state: "completed" | "needs_input" | "incomplete" | "unverified";
3283
+ required_inputs?: {
3284
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
3285
+ description: string;
3286
+ locator?: string | null | undefined;
3287
+ }[] | undefined;
3288
+ } | undefined;
3289
+ } | null | undefined;
2923
3290
  waitingOnUser?: boolean | undefined;
2924
3291
  finishedAt?: string | null | undefined;
2925
3292
  } | null | undefined;
@@ -2939,8 +3306,8 @@ export declare const ControlThreadCreateRequest: z.ZodObject<{
2939
3306
  context: z.ZodDefault<z.ZodEnum<["auto"]>>;
2940
3307
  }, "strict", z.ZodTypeAny, {
2941
3308
  kind: "project";
2942
- root: string;
2943
3309
  context: "auto";
3310
+ root: string;
2944
3311
  }, {
2945
3312
  kind: "project";
2946
3313
  root: string;
@@ -2963,8 +3330,8 @@ export declare const ControlThreadCreateRequest: z.ZodObject<{
2963
3330
  }, "strict", z.ZodTypeAny, {
2964
3331
  scope: {
2965
3332
  kind: "project";
2966
- root: string;
2967
3333
  context: "auto";
3334
+ root: string;
2968
3335
  } | {
2969
3336
  kind: "none";
2970
3337
  };
@@ -3276,6 +3643,16 @@ export declare const ControlThreadDetail: z.ZodObject<{
3276
3643
  parentRunId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
3277
3644
  /** Set when this turn implements an approved plan from an earlier run. */
3278
3645
  planRunId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
3646
+ /** The SHA-256 of the exact plan bytes this Implement turn froze (INV-081),
3647
+ * persisted on the durable turn but historically dropped by the projection
3648
+ * (QA-046). Surfaces render a compact "implemented plan <run> · sha256 <hash>"
3649
+ * receipt; null on non-Implement turns and legacy turns predating the freeze. */
3650
+ planHash: z.ZodDefault<z.ZodNullable<z.ZodString>>;
3651
+ /** True when the operator chose "Implement anyway" over a plan that still had
3652
+ * open questions (INV-081 provenance); the durable turn records it but the
3653
+ * projection dropped it (QA-046). Surfaces render a persistent warning receipt
3654
+ * so the destructive-override choice survives reload. Defaults false. */
3655
+ planReadinessOverridden: z.ZodDefault<z.ZodBoolean>;
3279
3656
  kind: z.ZodDefault<z.ZodEnum<["initial", "followup", "decision"]>>;
3280
3657
  prompt: z.ZodDefault<z.ZodString>;
3281
3658
  /** Embedded run card (outcome/state) so the chat renders without N+1 fetches. */
@@ -3346,19 +3723,70 @@ export declare const ControlThreadDetail: z.ZodObject<{
3346
3723
  noChanges: z.ZodDefault<z.ZodBoolean>;
3347
3724
  checks: z.ZodDefault<z.ZodEnum<["passed", "failed", "not_configured"]>>;
3348
3725
  review: z.ZodDefault<z.ZodEnum<["approved", "blocked", "not_run"]>>;
3349
- reason: z.ZodDefault<z.ZodNullable<z.ZodEnum<["harness_failed", "no_changes", "review_blocked", "checks_failed", "budget_exhausted", "budget_overshoot", "cost_unverifiable", "not_converged", "stuck_no_progress", "wall_clock_exceeded", "user_cancelled", "crash_interrupted"]>>>;
3726
+ reason: z.ZodDefault<z.ZodNullable<z.ZodEnum<["harness_failed", "no_changes", "review_blocked", "checks_failed", "budget_exhausted", "budget_overshoot", "cost_unverifiable", "not_converged", "stuck_no_progress", "wall_clock_exceeded", "user_cancelled", "crash_interrupted", "input_required", "work_incomplete", "context_capacity_exhausted", "work_report_contract"]>>>;
3727
+ work_state: z.ZodOptional<z.ZodObject<{
3728
+ state: z.ZodEnum<["completed", "needs_input", "incomplete", "unverified"]>;
3729
+ source: z.ZodEnum<["constrained", "validated", "absent"]>;
3730
+ required_inputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
3731
+ kind: z.ZodEnum<["file", "context", "credential", "permission", "decision", "external_dependency"]>;
3732
+ locator: z.ZodDefault<z.ZodNullable<z.ZodString>>;
3733
+ description: z.ZodString;
3734
+ }, "strip", z.ZodTypeAny, {
3735
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
3736
+ description: string;
3737
+ locator: string | null;
3738
+ }, {
3739
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
3740
+ description: string;
3741
+ locator?: string | null | undefined;
3742
+ }>, "many">>;
3743
+ }, "strip", z.ZodTypeAny, {
3744
+ source: "constrained" | "validated" | "absent";
3745
+ state: "completed" | "needs_input" | "incomplete" | "unverified";
3746
+ required_inputs?: {
3747
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
3748
+ description: string;
3749
+ locator: string | null;
3750
+ }[] | undefined;
3751
+ }, {
3752
+ source: "constrained" | "validated" | "absent";
3753
+ state: "completed" | "needs_input" | "incomplete" | "unverified";
3754
+ required_inputs?: {
3755
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
3756
+ description: string;
3757
+ locator?: string | null | undefined;
3758
+ }[] | undefined;
3759
+ }>>;
3350
3760
  }, "strict", z.ZodTypeAny, {
3351
3761
  review: "not_run" | "approved" | "blocked";
3352
- reason: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | null;
3762
+ reason: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | "input_required" | "work_incomplete" | "context_capacity_exhausted" | "work_report_contract" | null;
3353
3763
  checks: "passed" | "failed" | "not_configured";
3354
3764
  lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
3355
3765
  noChanges: boolean;
3766
+ work_state?: {
3767
+ source: "constrained" | "validated" | "absent";
3768
+ state: "completed" | "needs_input" | "incomplete" | "unverified";
3769
+ required_inputs?: {
3770
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
3771
+ description: string;
3772
+ locator: string | null;
3773
+ }[] | undefined;
3774
+ } | undefined;
3356
3775
  }, {
3357
3776
  lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
3358
3777
  review?: "not_run" | "approved" | "blocked" | undefined;
3359
- reason?: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | null | undefined;
3778
+ reason?: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | "input_required" | "work_incomplete" | "context_capacity_exhausted" | "work_report_contract" | null | undefined;
3360
3779
  checks?: "passed" | "failed" | "not_configured" | undefined;
3361
3780
  noChanges?: boolean | undefined;
3781
+ work_state?: {
3782
+ source: "constrained" | "validated" | "absent";
3783
+ state: "completed" | "needs_input" | "incomplete" | "unverified";
3784
+ required_inputs?: {
3785
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
3786
+ description: string;
3787
+ locator?: string | null | undefined;
3788
+ }[] | undefined;
3789
+ } | undefined;
3362
3790
  }>>>;
3363
3791
  spendUsd: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
3364
3792
  outputReadyState: z.ZodDefault<z.ZodEnum<["pending", "finalizing", "ready", "diagnostic"]>>;
@@ -3366,13 +3794,6 @@ export declare const ControlThreadDetail: z.ZodObject<{
3366
3794
  finishedAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
3367
3795
  }, "strip", z.ZodTypeAny, {
3368
3796
  state: "failed" | "cancelled" | "running" | "succeeded" | "interrupted" | "queued";
3369
- outcomeFacts: {
3370
- review: "not_run" | "approved" | "blocked";
3371
- reason: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | null;
3372
- checks: "passed" | "failed" | "not_configured";
3373
- lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
3374
- noChanges: boolean;
3375
- } | null;
3376
3797
  outputReadyState: "pending" | "finalizing" | "ready" | "diagnostic";
3377
3798
  result: {
3378
3799
  kind: "plan" | "none" | "patch" | "answer" | "report";
@@ -3389,6 +3810,22 @@ export declare const ControlThreadDetail: z.ZodObject<{
3389
3810
  preTurnSha: string | null;
3390
3811
  revertable: boolean;
3391
3812
  };
3813
+ outcomeFacts: {
3814
+ review: "not_run" | "approved" | "blocked";
3815
+ reason: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | "input_required" | "work_incomplete" | "context_capacity_exhausted" | "work_report_contract" | null;
3816
+ checks: "passed" | "failed" | "not_configured";
3817
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
3818
+ noChanges: boolean;
3819
+ work_state?: {
3820
+ source: "constrained" | "validated" | "absent";
3821
+ state: "completed" | "needs_input" | "incomplete" | "unverified";
3822
+ required_inputs?: {
3823
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
3824
+ description: string;
3825
+ locator: string | null;
3826
+ }[] | undefined;
3827
+ } | undefined;
3828
+ } | null;
3392
3829
  waitingOnUser: boolean;
3393
3830
  finishedAt: string | null;
3394
3831
  mode?: "ask" | "plan" | "agent" | undefined;
@@ -3398,13 +3835,6 @@ export declare const ControlThreadDetail: z.ZodObject<{
3398
3835
  }, {
3399
3836
  state: "failed" | "cancelled" | "running" | "succeeded" | "interrupted" | "queued";
3400
3837
  mode?: "ask" | "plan" | "agent" | undefined;
3401
- outcomeFacts?: {
3402
- lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
3403
- review?: "not_run" | "approved" | "blocked" | undefined;
3404
- reason?: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | null | undefined;
3405
- checks?: "passed" | "failed" | "not_configured" | undefined;
3406
- noChanges?: boolean | undefined;
3407
- } | null | undefined;
3408
3838
  n?: number | undefined;
3409
3839
  strategy?: "attempts" | "create" | "race" | "until_clean" | "deep_scan" | null | undefined;
3410
3840
  spendUsd?: number | null | undefined;
@@ -3424,6 +3854,22 @@ export declare const ControlThreadDetail: z.ZodObject<{
3424
3854
  preTurnSha?: string | null | undefined;
3425
3855
  revertable?: boolean | undefined;
3426
3856
  } | undefined;
3857
+ outcomeFacts?: {
3858
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
3859
+ review?: "not_run" | "approved" | "blocked" | undefined;
3860
+ reason?: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | "input_required" | "work_incomplete" | "context_capacity_exhausted" | "work_report_contract" | null | undefined;
3861
+ checks?: "passed" | "failed" | "not_configured" | undefined;
3862
+ noChanges?: boolean | undefined;
3863
+ work_state?: {
3864
+ source: "constrained" | "validated" | "absent";
3865
+ state: "completed" | "needs_input" | "incomplete" | "unverified";
3866
+ required_inputs?: {
3867
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
3868
+ description: string;
3869
+ locator?: string | null | undefined;
3870
+ }[] | undefined;
3871
+ } | undefined;
3872
+ } | null | undefined;
3427
3873
  waitingOnUser?: boolean | undefined;
3428
3874
  finishedAt?: string | null | undefined;
3429
3875
  }>>>;
@@ -3503,15 +3949,10 @@ export declare const ControlThreadDetail: z.ZodObject<{
3503
3949
  planRunId: string | null;
3504
3950
  runId: string | null;
3505
3951
  parentRunId: string | null;
3952
+ planHash: string | null;
3953
+ planReadinessOverridden: boolean;
3506
3954
  run: {
3507
3955
  state: "failed" | "cancelled" | "running" | "succeeded" | "interrupted" | "queued";
3508
- outcomeFacts: {
3509
- review: "not_run" | "approved" | "blocked";
3510
- reason: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | null;
3511
- checks: "passed" | "failed" | "not_configured";
3512
- lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
3513
- noChanges: boolean;
3514
- } | null;
3515
3956
  outputReadyState: "pending" | "finalizing" | "ready" | "diagnostic";
3516
3957
  result: {
3517
3958
  kind: "plan" | "none" | "patch" | "answer" | "report";
@@ -3528,6 +3969,22 @@ export declare const ControlThreadDetail: z.ZodObject<{
3528
3969
  preTurnSha: string | null;
3529
3970
  revertable: boolean;
3530
3971
  };
3972
+ outcomeFacts: {
3973
+ review: "not_run" | "approved" | "blocked";
3974
+ reason: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | "input_required" | "work_incomplete" | "context_capacity_exhausted" | "work_report_contract" | null;
3975
+ checks: "passed" | "failed" | "not_configured";
3976
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
3977
+ noChanges: boolean;
3978
+ work_state?: {
3979
+ source: "constrained" | "validated" | "absent";
3980
+ state: "completed" | "needs_input" | "incomplete" | "unverified";
3981
+ required_inputs?: {
3982
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
3983
+ description: string;
3984
+ locator: string | null;
3985
+ }[] | undefined;
3986
+ } | undefined;
3987
+ } | null;
3531
3988
  waitingOnUser: boolean;
3532
3989
  finishedAt: string | null;
3533
3990
  mode?: "ask" | "plan" | "agent" | undefined;
@@ -3559,16 +4016,11 @@ export declare const ControlThreadDetail: z.ZodObject<{
3559
4016
  planRunId?: string | null | undefined;
3560
4017
  runId?: string | null | undefined;
3561
4018
  parentRunId?: string | null | undefined;
4019
+ planHash?: string | null | undefined;
4020
+ planReadinessOverridden?: boolean | undefined;
3562
4021
  run?: {
3563
4022
  state: "failed" | "cancelled" | "running" | "succeeded" | "interrupted" | "queued";
3564
4023
  mode?: "ask" | "plan" | "agent" | undefined;
3565
- outcomeFacts?: {
3566
- lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
3567
- review?: "not_run" | "approved" | "blocked" | undefined;
3568
- reason?: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | null | undefined;
3569
- checks?: "passed" | "failed" | "not_configured" | undefined;
3570
- noChanges?: boolean | undefined;
3571
- } | null | undefined;
3572
4024
  n?: number | undefined;
3573
4025
  strategy?: "attempts" | "create" | "race" | "until_clean" | "deep_scan" | null | undefined;
3574
4026
  spendUsd?: number | null | undefined;
@@ -3588,6 +4040,22 @@ export declare const ControlThreadDetail: z.ZodObject<{
3588
4040
  preTurnSha?: string | null | undefined;
3589
4041
  revertable?: boolean | undefined;
3590
4042
  } | undefined;
4043
+ outcomeFacts?: {
4044
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
4045
+ review?: "not_run" | "approved" | "blocked" | undefined;
4046
+ reason?: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | "input_required" | "work_incomplete" | "context_capacity_exhausted" | "work_report_contract" | null | undefined;
4047
+ checks?: "passed" | "failed" | "not_configured" | undefined;
4048
+ noChanges?: boolean | undefined;
4049
+ work_state?: {
4050
+ source: "constrained" | "validated" | "absent";
4051
+ state: "completed" | "needs_input" | "incomplete" | "unverified";
4052
+ required_inputs?: {
4053
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
4054
+ description: string;
4055
+ locator?: string | null | undefined;
4056
+ }[] | undefined;
4057
+ } | undefined;
4058
+ } | null | undefined;
3591
4059
  waitingOnUser?: boolean | undefined;
3592
4060
  finishedAt?: string | null | undefined;
3593
4061
  } | null | undefined;
@@ -3646,15 +4114,10 @@ export declare const ControlThreadDetail: z.ZodObject<{
3646
4114
  planRunId: string | null;
3647
4115
  runId: string | null;
3648
4116
  parentRunId: string | null;
4117
+ planHash: string | null;
4118
+ planReadinessOverridden: boolean;
3649
4119
  run: {
3650
4120
  state: "failed" | "cancelled" | "running" | "succeeded" | "interrupted" | "queued";
3651
- outcomeFacts: {
3652
- review: "not_run" | "approved" | "blocked";
3653
- reason: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | null;
3654
- checks: "passed" | "failed" | "not_configured";
3655
- lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
3656
- noChanges: boolean;
3657
- } | null;
3658
4121
  outputReadyState: "pending" | "finalizing" | "ready" | "diagnostic";
3659
4122
  result: {
3660
4123
  kind: "plan" | "none" | "patch" | "answer" | "report";
@@ -3671,6 +4134,22 @@ export declare const ControlThreadDetail: z.ZodObject<{
3671
4134
  preTurnSha: string | null;
3672
4135
  revertable: boolean;
3673
4136
  };
4137
+ outcomeFacts: {
4138
+ review: "not_run" | "approved" | "blocked";
4139
+ reason: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | "input_required" | "work_incomplete" | "context_capacity_exhausted" | "work_report_contract" | null;
4140
+ checks: "passed" | "failed" | "not_configured";
4141
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
4142
+ noChanges: boolean;
4143
+ work_state?: {
4144
+ source: "constrained" | "validated" | "absent";
4145
+ state: "completed" | "needs_input" | "incomplete" | "unverified";
4146
+ required_inputs?: {
4147
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
4148
+ description: string;
4149
+ locator: string | null;
4150
+ }[] | undefined;
4151
+ } | undefined;
4152
+ } | null;
3674
4153
  waitingOnUser: boolean;
3675
4154
  finishedAt: string | null;
3676
4155
  mode?: "ask" | "plan" | "agent" | undefined;
@@ -3733,16 +4212,11 @@ export declare const ControlThreadDetail: z.ZodObject<{
3733
4212
  planRunId?: string | null | undefined;
3734
4213
  runId?: string | null | undefined;
3735
4214
  parentRunId?: string | null | undefined;
4215
+ planHash?: string | null | undefined;
4216
+ planReadinessOverridden?: boolean | undefined;
3736
4217
  run?: {
3737
4218
  state: "failed" | "cancelled" | "running" | "succeeded" | "interrupted" | "queued";
3738
4219
  mode?: "ask" | "plan" | "agent" | undefined;
3739
- outcomeFacts?: {
3740
- lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
3741
- review?: "not_run" | "approved" | "blocked" | undefined;
3742
- reason?: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | null | undefined;
3743
- checks?: "passed" | "failed" | "not_configured" | undefined;
3744
- noChanges?: boolean | undefined;
3745
- } | null | undefined;
3746
4220
  n?: number | undefined;
3747
4221
  strategy?: "attempts" | "create" | "race" | "until_clean" | "deep_scan" | null | undefined;
3748
4222
  spendUsd?: number | null | undefined;
@@ -3762,6 +4236,22 @@ export declare const ControlThreadDetail: z.ZodObject<{
3762
4236
  preTurnSha?: string | null | undefined;
3763
4237
  revertable?: boolean | undefined;
3764
4238
  } | undefined;
4239
+ outcomeFacts?: {
4240
+ lifecycle: "failed" | "cancelled" | "succeeded" | "interrupted";
4241
+ review?: "not_run" | "approved" | "blocked" | undefined;
4242
+ reason?: "harness_failed" | "no_changes" | "review_blocked" | "checks_failed" | "budget_exhausted" | "budget_overshoot" | "cost_unverifiable" | "not_converged" | "stuck_no_progress" | "wall_clock_exceeded" | "user_cancelled" | "crash_interrupted" | "input_required" | "work_incomplete" | "context_capacity_exhausted" | "work_report_contract" | null | undefined;
4243
+ checks?: "passed" | "failed" | "not_configured" | undefined;
4244
+ noChanges?: boolean | undefined;
4245
+ work_state?: {
4246
+ source: "constrained" | "validated" | "absent";
4247
+ state: "completed" | "needs_input" | "incomplete" | "unverified";
4248
+ required_inputs?: {
4249
+ kind: "file" | "context" | "decision" | "credential" | "permission" | "external_dependency";
4250
+ description: string;
4251
+ locator?: string | null | undefined;
4252
+ }[] | undefined;
4253
+ } | undefined;
4254
+ } | null | undefined;
3765
4255
  waitingOnUser?: boolean | undefined;
3766
4256
  finishedAt?: string | null | undefined;
3767
4257
  } | null | undefined;
@@ -3920,6 +4410,8 @@ export declare const ControlHarnessListResponse: z.ZodObject<{
3920
4410
  tool_lists: z.ZodDefault<z.ZodBoolean>;
3921
4411
  interactive: z.ZodDefault<z.ZodBoolean>;
3922
4412
  json_schema_output: z.ZodDefault<z.ZodBoolean>;
4413
+ work_report_transport: z.ZodDefault<z.ZodEnum<["constrained", "validated", "unsupported"]>>;
4414
+ structured_output_channel: z.ZodDefault<z.ZodEnum<["side_tool", "final_message"]>>;
3923
4415
  effort_levels: z.ZodDefault<z.ZodArray<z.ZodEnum<["low", "medium", "high", "xhigh", "max"]>, "many">>;
3924
4416
  known_models: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
3925
4417
  id: z.ZodString;
@@ -3947,6 +4439,8 @@ export declare const ControlHarnessListResponse: z.ZodObject<{
3947
4439
  tool_lists: boolean;
3948
4440
  interactive: boolean;
3949
4441
  json_schema_output: boolean;
4442
+ work_report_transport: "constrained" | "validated" | "unsupported";
4443
+ structured_output_channel: "side_tool" | "final_message";
3950
4444
  effort_levels: ("low" | "medium" | "high" | "xhigh" | "max")[];
3951
4445
  known_models: (string | {
3952
4446
  id: string;
@@ -3968,6 +4462,8 @@ export declare const ControlHarnessListResponse: z.ZodObject<{
3968
4462
  tool_lists?: boolean | undefined;
3969
4463
  interactive?: boolean | undefined;
3970
4464
  json_schema_output?: boolean | undefined;
4465
+ work_report_transport?: "constrained" | "validated" | "unsupported" | undefined;
4466
+ structured_output_channel?: "side_tool" | "final_message" | undefined;
3971
4467
  effort_levels?: ("low" | "medium" | "high" | "xhigh" | "max")[] | undefined;
3972
4468
  known_models?: (string | {
3973
4469
  id: string;
@@ -4023,6 +4519,8 @@ export declare const ControlHarnessListResponse: z.ZodObject<{
4023
4519
  tool_lists: boolean;
4024
4520
  interactive: boolean;
4025
4521
  json_schema_output: boolean;
4522
+ work_report_transport: "constrained" | "validated" | "unsupported";
4523
+ structured_output_channel: "side_tool" | "final_message";
4026
4524
  effort_levels: ("low" | "medium" | "high" | "xhigh" | "max")[];
4027
4525
  known_models: (string | {
4028
4526
  id: string;
@@ -4053,6 +4551,8 @@ export declare const ControlHarnessListResponse: z.ZodObject<{
4053
4551
  tool_lists?: boolean | undefined;
4054
4552
  interactive?: boolean | undefined;
4055
4553
  json_schema_output?: boolean | undefined;
4554
+ work_report_transport?: "constrained" | "validated" | "unsupported" | undefined;
4555
+ structured_output_channel?: "side_tool" | "final_message" | undefined;
4056
4556
  effort_levels?: ("low" | "medium" | "high" | "xhigh" | "max")[] | undefined;
4057
4557
  known_models?: (string | {
4058
4558
  id: string;
@@ -4235,6 +4735,8 @@ export declare const ControlHarnessListResponse: z.ZodObject<{
4235
4735
  tool_lists: boolean;
4236
4736
  interactive: boolean;
4237
4737
  json_schema_output: boolean;
4738
+ work_report_transport: "constrained" | "validated" | "unsupported";
4739
+ structured_output_channel: "side_tool" | "final_message";
4238
4740
  effort_levels: ("low" | "medium" | "high" | "xhigh" | "max")[];
4239
4741
  known_models: (string | {
4240
4742
  id: string;
@@ -4283,6 +4785,8 @@ export declare const ControlHarnessListResponse: z.ZodObject<{
4283
4785
  tool_lists?: boolean | undefined;
4284
4786
  interactive?: boolean | undefined;
4285
4787
  json_schema_output?: boolean | undefined;
4788
+ work_report_transport?: "constrained" | "validated" | "unsupported" | undefined;
4789
+ structured_output_channel?: "side_tool" | "final_message" | undefined;
4286
4790
  effort_levels?: ("low" | "medium" | "high" | "xhigh" | "max")[] | undefined;
4287
4791
  known_models?: (string | {
4288
4792
  id: string;
@@ -4415,6 +4919,8 @@ export declare const ControlHarnessListResponse: z.ZodObject<{
4415
4919
  tool_lists: boolean;
4416
4920
  interactive: boolean;
4417
4921
  json_schema_output: boolean;
4922
+ work_report_transport: "constrained" | "validated" | "unsupported";
4923
+ structured_output_channel: "side_tool" | "final_message";
4418
4924
  effort_levels: ("low" | "medium" | "high" | "xhigh" | "max")[];
4419
4925
  known_models: (string | {
4420
4926
  id: string;
@@ -4465,6 +4971,8 @@ export declare const ControlHarnessListResponse: z.ZodObject<{
4465
4971
  tool_lists?: boolean | undefined;
4466
4972
  interactive?: boolean | undefined;
4467
4973
  json_schema_output?: boolean | undefined;
4974
+ work_report_transport?: "constrained" | "validated" | "unsupported" | undefined;
4975
+ structured_output_channel?: "side_tool" | "final_message" | undefined;
4468
4976
  effort_levels?: ("low" | "medium" | "high" | "xhigh" | "max")[] | undefined;
4469
4977
  known_models?: (string | {
4470
4978
  id: string;
@@ -4754,6 +5262,8 @@ export declare const ControlSettingsSnapshot: z.ZodObject<{
4754
5262
  maxUsd: number;
4755
5263
  };
4756
5264
  };
5265
+ sources: string[];
5266
+ interactionTimeoutMs: number;
4757
5267
  routing: {
4758
5268
  goal: "auto" | "quality" | "economy";
4759
5269
  primaryHarness: string | null;
@@ -4776,8 +5286,6 @@ export declare const ControlSettingsSnapshot: z.ZodObject<{
4776
5286
  maxDelayMs: number;
4777
5287
  };
4778
5288
  };
4779
- sources: string[];
4780
- interactionTimeoutMs: number;
4781
5289
  }, {
4782
5290
  harnesses?: Record<string, {
4783
5291
  enabled?: boolean | undefined;
@@ -4801,6 +5309,8 @@ export declare const ControlSettingsSnapshot: z.ZodObject<{
4801
5309
  maxUsd: number;
4802
5310
  } | undefined;
4803
5311
  } | undefined;
5312
+ sources?: string[] | undefined;
5313
+ interactionTimeoutMs?: number | undefined;
4804
5314
  routing?: {
4805
5315
  goal?: "auto" | "quality" | "economy" | undefined;
4806
5316
  primaryHarness?: string | null | undefined;
@@ -4823,8 +5333,6 @@ export declare const ControlSettingsSnapshot: z.ZodObject<{
4823
5333
  maxDelayMs?: number | undefined;
4824
5334
  } | undefined;
4825
5335
  } | undefined;
4826
- sources?: string[] | undefined;
4827
- interactionTimeoutMs?: number | undefined;
4828
5336
  }>;
4829
5337
  export type ControlSettingsSnapshot = z.infer<typeof ControlSettingsSnapshot>;
4830
5338
  /**