@claudexor/schema 4.8.2 → 5.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (195) hide show
  1. package/dist/account-resources.d.ts +325 -56
  2. package/dist/account-resources.d.ts.map +1 -1
  3. package/dist/account-resources.js +35 -5
  4. package/dist/account-resources.js.map +1 -1
  5. package/dist/account-routing-evidence.d.ts +253 -45
  6. package/dist/account-routing-evidence.d.ts.map +1 -1
  7. package/dist/account-target.d.ts +19 -5
  8. package/dist/account-target.d.ts.map +1 -1
  9. package/dist/account-target.js +14 -1
  10. package/dist/account-target.js.map +1 -1
  11. package/dist/agent-capabilities.d.ts +183 -0
  12. package/dist/agent-capabilities.d.ts.map +1 -1
  13. package/dist/agent-capabilities.js +2 -0
  14. package/dist/agent-capabilities.js.map +1 -1
  15. package/dist/budget.d.ts +3 -0
  16. package/dist/budget.d.ts.map +1 -1
  17. package/dist/budget.js +5 -1
  18. package/dist/budget.js.map +1 -1
  19. package/dist/capture-inventory.d.ts +60 -0
  20. package/dist/capture-inventory.d.ts.map +1 -0
  21. package/dist/capture-inventory.js +57 -0
  22. package/dist/capture-inventory.js.map +1 -0
  23. package/dist/control-harness-list.d.ts +102 -18
  24. package/dist/control-harness-list.d.ts.map +1 -1
  25. package/dist/control-harness-models.d.ts +299 -6
  26. package/dist/control-harness-models.d.ts.map +1 -1
  27. package/dist/control-harness-models.js +12 -3
  28. package/dist/control-harness-models.js.map +1 -1
  29. package/dist/control-operation-responses.d.ts +606 -23
  30. package/dist/control-operation-responses.d.ts.map +1 -1
  31. package/dist/control-operation-responses.js +3 -0
  32. package/dist/control-operation-responses.js.map +1 -1
  33. package/dist/control-run-detail.d.ts +1178 -72
  34. package/dist/control-run-detail.d.ts.map +1 -1
  35. package/dist/control-run-event-part.d.ts +3 -3
  36. package/dist/control-run-event-part.js +1 -1
  37. package/dist/control-run-event-part.js.map +1 -1
  38. package/dist/control-run-failure.d.ts +276 -12
  39. package/dist/control-run-failure.d.ts.map +1 -1
  40. package/dist/control-run-failure.js +54 -16
  41. package/dist/control-run-failure.js.map +1 -1
  42. package/dist/control-run-message.js +1 -1
  43. package/dist/control-run-message.js.map +1 -1
  44. package/dist/control-thread-apply.d.ts +165 -0
  45. package/dist/control-thread-apply.d.ts.map +1 -1
  46. package/dist/control-timeline.d.ts.map +1 -1
  47. package/dist/control-timeline.js +7 -3
  48. package/dist/control-timeline.js.map +1 -1
  49. package/dist/control.d.ts +383 -42
  50. package/dist/control.d.ts.map +1 -1
  51. package/dist/control.js +9 -5
  52. package/dist/control.js.map +1 -1
  53. package/dist/credential-profile-snapshot.d.ts +506 -90
  54. package/dist/credential-profile-snapshot.d.ts.map +1 -1
  55. package/dist/decision.d.ts +9 -9
  56. package/dist/decision.d.ts.map +1 -1
  57. package/dist/decision.js +4 -0
  58. package/dist/decision.js.map +1 -1
  59. package/dist/delivery.d.ts +162 -0
  60. package/dist/delivery.d.ts.map +1 -1
  61. package/dist/delivery.js +32 -0
  62. package/dist/delivery.js.map +1 -1
  63. package/dist/events.d.ts +7 -6
  64. package/dist/events.d.ts.map +1 -1
  65. package/dist/events.js +15 -8
  66. package/dist/events.js.map +1 -1
  67. package/dist/git-result.d.ts +99 -0
  68. package/dist/git-result.d.ts.map +1 -0
  69. package/dist/git-result.js +80 -0
  70. package/dist/git-result.js.map +1 -0
  71. package/dist/harness-model.d.ts +89 -0
  72. package/dist/harness-model.d.ts.map +1 -1
  73. package/dist/harness-model.js +83 -0
  74. package/dist/harness-model.js.map +1 -1
  75. package/dist/harness.d.ts +353 -35
  76. package/dist/harness.d.ts.map +1 -1
  77. package/dist/harness.js +4 -19
  78. package/dist/harness.js.map +1 -1
  79. package/dist/index.d.ts +5 -0
  80. package/dist/index.d.ts.map +1 -1
  81. package/dist/index.js +5 -0
  82. package/dist/index.js.map +1 -1
  83. package/dist/mcp-run-result.d.ts +620 -51
  84. package/dist/mcp-run-result.d.ts.map +1 -1
  85. package/dist/mcp-run-result.js +45 -5
  86. package/dist/mcp-run-result.js.map +1 -1
  87. package/dist/mcp-run-wait.d.ts +7 -7
  88. package/dist/primitives.d.ts.map +1 -1
  89. package/dist/primitives.js +3 -2
  90. package/dist/primitives.js.map +1 -1
  91. package/dist/project.d.ts +45 -1
  92. package/dist/project.d.ts.map +1 -1
  93. package/dist/project.js +26 -1
  94. package/dist/project.js.map +1 -1
  95. package/dist/quota-read.d.ts +6 -3
  96. package/dist/quota-read.d.ts.map +1 -1
  97. package/dist/quota-read.js +7 -1
  98. package/dist/quota-read.js.map +1 -1
  99. package/dist/quota-scope.d.ts +29 -0
  100. package/dist/quota-scope.d.ts.map +1 -0
  101. package/dist/quota-scope.js +95 -0
  102. package/dist/quota-scope.js.map +1 -0
  103. package/dist/rate-limit.d.ts +3 -0
  104. package/dist/rate-limit.d.ts.map +1 -1
  105. package/dist/rate-limit.js +5 -1
  106. package/dist/rate-limit.js.map +1 -1
  107. package/dist/raw.d.ts +223 -1
  108. package/dist/raw.d.ts.map +1 -1
  109. package/dist/raw.js +86 -0
  110. package/dist/raw.js.map +1 -1
  111. package/dist/readiness.d.ts +87 -18
  112. package/dist/readiness.d.ts.map +1 -1
  113. package/dist/readiness.js +7 -6
  114. package/dist/readiness.js.map +1 -1
  115. package/dist/route-health.d.ts +303 -0
  116. package/dist/route-health.d.ts.map +1 -0
  117. package/dist/route-health.js +71 -0
  118. package/dist/route-health.js.map +1 -0
  119. package/dist/run-continuity.d.ts +3 -0
  120. package/dist/run-continuity.d.ts.map +1 -1
  121. package/dist/run-continuity.js +4 -0
  122. package/dist/run-continuity.js.map +1 -1
  123. package/dist/run-facts.d.ts +5 -5
  124. package/dist/run-facts.d.ts.map +1 -1
  125. package/dist/run-facts.js +1 -0
  126. package/dist/run-facts.js.map +1 -1
  127. package/dist/setup-login.d.ts +1 -1
  128. package/dist/setup-login.js +1 -1
  129. package/dist/setup.d.ts +1 -1
  130. package/dist/setup.js +1 -1
  131. package/dist/status-projection.d.ts.map +1 -1
  132. package/dist/status-projection.js +3 -0
  133. package/dist/status-projection.js.map +1 -1
  134. package/dist/telemetry.d.ts +239 -7
  135. package/dist/telemetry.d.ts.map +1 -1
  136. package/dist/telemetry.js +4 -2
  137. package/dist/telemetry.js.map +1 -1
  138. package/dist/thread-history.d.ts +1109 -161
  139. package/dist/thread-history.d.ts.map +1 -1
  140. package/dist/thread-history.js +1 -1
  141. package/dist/thread-history.js.map +1 -1
  142. package/dist/tool-ref.d.ts +94 -3
  143. package/dist/tool-ref.d.ts.map +1 -1
  144. package/dist/tool-ref.js +98 -6
  145. package/dist/tool-ref.js.map +1 -1
  146. package/dist/workspace-preparation.d.ts +54 -0
  147. package/dist/workspace-preparation.d.ts.map +1 -0
  148. package/dist/workspace-preparation.js +59 -0
  149. package/dist/workspace-preparation.js.map +1 -0
  150. package/generated/AgentCapabilityCatalog.schema.json +54 -0
  151. package/generated/BudgetObservation.schema.json +8 -1
  152. package/generated/ControlAccountResetResponse.schema.json +60 -1
  153. package/generated/ControlAccountResourcesFreshnessResponse.schema.json +46 -2
  154. package/generated/ControlAccountResourcesResponse.schema.json +46 -2
  155. package/generated/ControlApplyCheckResponse.schema.json +47 -0
  156. package/generated/ControlCredentialProfilesQueryResponse.schema.json +105 -4
  157. package/generated/ControlCredentialProfilesResourcesResponse.schema.json +105 -4
  158. package/generated/ControlCredentialProfilesSnapshotResponse.schema.json +59 -2
  159. package/generated/ControlDeliveryResponse.schema.json +154 -0
  160. package/generated/ControlHarnessAccountCatalog.schema.json +13 -0
  161. package/generated/ControlHarnessAccountModelsResponse.schema.json +13 -0
  162. package/generated/ControlHarnessListResponse.schema.json +59 -2
  163. package/generated/ControlHarnessModelsQueryResponse.schema.json +97 -51
  164. package/generated/ControlHarnessModelsResponse.schema.json +96 -0
  165. package/generated/ControlProjectRemoveReceipt.schema.json +36 -0
  166. package/generated/ControlQuotaQueryResponse.schema.json +46 -2
  167. package/generated/ControlQuotaReadRequest.schema.json +4 -0
  168. package/generated/ControlQuotaRefreshRequest.schema.json +12 -3
  169. package/generated/ControlRouteHealth.schema.json +202 -0
  170. package/generated/ControlRunDetail.schema.json +344 -5
  171. package/generated/ControlRunEventPart.schema.json +4 -2
  172. package/generated/ControlRunListResponse.schema.json +341 -2
  173. package/generated/ControlRunMessageRequest.schema.json +1 -1
  174. package/generated/ControlRunSummary.schema.json +341 -2
  175. package/generated/ControlThreadApplyResponse.schema.json +154 -0
  176. package/generated/ControlThreadDetail.schema.json +1 -0
  177. package/generated/DecisionRecord.schema.json +1 -0
  178. package/generated/HarnessEvent.schema.json +189 -5
  179. package/generated/HarnessManifest.schema.json +57 -0
  180. package/generated/HarnessModel.schema.json +13 -0
  181. package/generated/HarnessStatusDto.schema.json +59 -2
  182. package/generated/JournaledRunCreatedPayload.schema.json +2 -2
  183. package/generated/McpAccountsToolResult.schema.json +105 -4
  184. package/generated/McpRunHandleResult.schema.json +279 -2
  185. package/generated/McpRunToolResult.schema.json +269 -0
  186. package/generated/McpRunWaitResult.schema.json +3 -1
  187. package/generated/RawContextPacket.schema.json +98 -0
  188. package/generated/RunContinuityReceipt.schema.json +8 -0
  189. package/generated/RunEvent.schema.json +3 -1
  190. package/generated/RunFacts.schema.json +1 -0
  191. package/generated/RunFailure.schema.json +201 -0
  192. package/generated/RunTelemetry.schema.json +123 -2
  193. package/generated/ThreadHistoryPage.schema.json +203 -1
  194. package/generated/WorkspacePreparedPayload.schema.json +67 -0
  195. package/package.json +2 -2
@@ -402,6 +402,7 @@ export declare const ControlRunDetail: z.ZodObject<{
402
402
  modelMismatch: z.ZodNullable<z.ZodBoolean>;
403
403
  identityCheck: z.ZodEnum<["matched_before_effects", "mismatch_before_effects", "mismatch_after_possible_effects", "not_applicable"]>;
404
404
  inputDelivery: z.ZodEnum<["confirmed", "uncertain", "not_applicable"]>;
405
+ sourceRetirement: z.ZodOptional<z.ZodEnum<["retired", "not_confirmed"]>>;
405
406
  }, "strict", z.ZodTypeAny, {
406
407
  tryIndex: number;
407
408
  attemptId: string;
@@ -423,6 +424,7 @@ export declare const ControlRunDetail: z.ZodObject<{
423
424
  modelMismatch: boolean | null;
424
425
  identityCheck: "matched_before_effects" | "mismatch_after_possible_effects" | "mismatch_before_effects" | "not_applicable";
425
426
  inputDelivery: "confirmed" | "not_applicable" | "uncertain";
427
+ sourceRetirement?: "not_confirmed" | "retired" | undefined;
426
428
  }, {
427
429
  tryIndex: number;
428
430
  attemptId: string;
@@ -444,6 +446,7 @@ export declare const ControlRunDetail: z.ZodObject<{
444
446
  modelMismatch: boolean | null;
445
447
  identityCheck: "matched_before_effects" | "mismatch_after_possible_effects" | "mismatch_before_effects" | "not_applicable";
446
448
  inputDelivery: "confirmed" | "not_applicable" | "uncertain";
449
+ sourceRetirement?: "not_confirmed" | "retired" | undefined;
447
450
  }>, "many">>;
448
451
  retainedEnvelope: z.ZodDefault<z.ZodNullable<z.ZodObject<{
449
452
  root: z.ZodString;
@@ -525,13 +528,54 @@ export declare const ControlRunDetail: z.ZodObject<{
525
528
  source: "grok_init";
526
529
  reported_source: string;
527
530
  }>]>>;
531
+ rawContextShortfall: z.ZodOptional<z.ZodObject<{
532
+ model: z.ZodString;
533
+ context_window: z.ZodNumber;
534
+ packet_tokens: z.ZodNumber;
535
+ framing_tokens: z.ZodNumber;
536
+ output_allowance_tokens: z.ZodNumber;
537
+ mandatory_files: z.ZodArray<z.ZodObject<{
538
+ path: z.ZodString;
539
+ estimated_tokens: z.ZodNumber;
540
+ }, "strict", z.ZodTypeAny, {
541
+ path: string;
542
+ estimated_tokens: number;
543
+ }, {
544
+ path: string;
545
+ estimated_tokens: number;
546
+ }>, "many">;
547
+ }, "strict", z.ZodTypeAny, {
548
+ model: string;
549
+ context_window: number;
550
+ packet_tokens: number;
551
+ framing_tokens: number;
552
+ output_allowance_tokens: number;
553
+ mandatory_files: {
554
+ path: string;
555
+ estimated_tokens: number;
556
+ }[];
557
+ }, {
558
+ model: string;
559
+ context_window: number;
560
+ packet_tokens: number;
561
+ framing_tokens: number;
562
+ output_allowance_tokens: number;
563
+ mandatory_files: {
564
+ path: string;
565
+ estimated_tokens: number;
566
+ }[];
567
+ }>>;
528
568
  captureFailure: z.ZodOptional<z.ZodObject<{
529
- code: z.ZodEnum<["capture_output_exceeded", "capture_output_incomplete", "capture_preview_truncated", "capture_failed"]>;
569
+ code: z.ZodEnum<["capture_output_exceeded", "capture_output_incomplete", "capture_preview_truncated", "capture_space_insufficient", "capture_git_stalled", "capture_git_signal", "capture_read_failed", "capture_object_missing", "capture_failed"]>;
530
570
  message: z.ZodString;
531
571
  causeCode: z.ZodOptional<z.ZodString>;
532
572
  bufferBudgetBytes: z.ZodOptional<z.ZodNumber>;
533
573
  stream: z.ZodOptional<z.ZodEnum<["stdout", "stderr"]>>;
534
574
  drain: z.ZodOptional<z.ZodLiteral<"truncated">>;
575
+ requiredBytes: z.ZodOptional<z.ZodNumber>;
576
+ availableBytes: z.ZodOptional<z.ZodNumber>;
577
+ signal: z.ZodOptional<z.ZodString>;
578
+ stallMs: z.ZodOptional<z.ZodNumber>;
535
579
  cleanup: z.ZodOptional<z.ZodObject<{
536
580
  code: z.ZodNullable<z.ZodString>;
537
581
  message: z.ZodString;
@@ -542,32 +586,91 @@ export declare const ControlRunDetail: z.ZodObject<{
542
586
  code: string | null;
543
587
  message: string;
544
588
  }>>;
589
+ inventory: z.ZodOptional<z.ZodObject<{
590
+ exact: z.ZodLiteral<false>;
591
+ changedFiles: z.ZodNumber;
592
+ largest: z.ZodArray<z.ZodObject<{
593
+ path: z.ZodString;
594
+ change: z.ZodEnum<["added", "modified", "deleted", "type_changed"]>;
595
+ sizeBytes: z.ZodNullable<z.ZodNumber>;
596
+ }, "strip", z.ZodTypeAny, {
597
+ path: string;
598
+ change: "added" | "deleted" | "modified" | "type_changed";
599
+ sizeBytes: number | null;
600
+ }, {
601
+ path: string;
602
+ change: "added" | "deleted" | "modified" | "type_changed";
603
+ sizeBytes: number | null;
604
+ }>, "many">;
605
+ }, "strip", z.ZodTypeAny, {
606
+ exact: false;
607
+ changedFiles: number;
608
+ largest: {
609
+ path: string;
610
+ change: "added" | "deleted" | "modified" | "type_changed";
611
+ sizeBytes: number | null;
612
+ }[];
613
+ }, {
614
+ exact: false;
615
+ changedFiles: number;
616
+ largest: {
617
+ path: string;
618
+ change: "added" | "deleted" | "modified" | "type_changed";
619
+ sizeBytes: number | null;
620
+ }[];
621
+ }>>;
545
622
  }, "strip", z.ZodTypeAny, {
546
- code: "capture_failed" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated";
623
+ code: "capture_failed" | "capture_git_signal" | "capture_git_stalled" | "capture_object_missing" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated" | "capture_read_failed" | "capture_space_insufficient";
547
624
  message: string;
548
625
  causeCode?: string | undefined;
549
626
  bufferBudgetBytes?: number | undefined;
550
627
  stream?: "stderr" | "stdout" | undefined;
551
628
  drain?: "truncated" | undefined;
629
+ requiredBytes?: number | undefined;
630
+ availableBytes?: number | undefined;
631
+ signal?: string | undefined;
632
+ stallMs?: number | undefined;
552
633
  cleanup?: {
553
634
  code: string | null;
554
635
  message: string;
555
636
  } | undefined;
637
+ inventory?: {
638
+ exact: false;
639
+ changedFiles: number;
640
+ largest: {
641
+ path: string;
642
+ change: "added" | "deleted" | "modified" | "type_changed";
643
+ sizeBytes: number | null;
644
+ }[];
645
+ } | undefined;
556
646
  }, {
557
- code: "capture_failed" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated";
647
+ code: "capture_failed" | "capture_git_signal" | "capture_git_stalled" | "capture_object_missing" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated" | "capture_read_failed" | "capture_space_insufficient";
558
648
  message: string;
559
649
  causeCode?: string | undefined;
560
650
  bufferBudgetBytes?: number | undefined;
561
651
  stream?: "stderr" | "stdout" | undefined;
562
652
  drain?: "truncated" | undefined;
653
+ requiredBytes?: number | undefined;
654
+ availableBytes?: number | undefined;
655
+ signal?: string | undefined;
656
+ stallMs?: number | undefined;
563
657
  cleanup?: {
564
658
  code: string | null;
565
659
  message: string;
566
660
  } | undefined;
661
+ inventory?: {
662
+ exact: false;
663
+ changedFiles: number;
664
+ largest: {
665
+ path: string;
666
+ change: "added" | "deleted" | "modified" | "type_changed";
667
+ sizeBytes: number | null;
668
+ }[];
669
+ } | undefined;
567
670
  }>>;
568
671
  phase: z.ZodDefault<z.ZodString>;
569
672
  category: z.ZodDefault<z.ZodEnum<["validation", "project", "auth", "harness_unavailable", "harness_error", "config_error", "budget", "policy", "cancelled", "internal", "unknown"]>>;
570
- code: z.ZodDefault<z.ZodNullable<z.ZodEnum<["finite_zero", "hard_cap", "estimate_headroom", "unknown_paid_in_flight", "budget_overshoot", "cost_unverifiable", "delegation_child_drain_timeout", "subscription_window_exhausted", "credential_pool_exhausted", "input_too_large", "vendor_cli_too_old", "credential_source_unconfirmed", "delegated_home_unavailable", "delegated_confinement_unavailable", "delegated_evidence_incomplete", "access_profile_incompatible", "auxiliary_writable_roots_unsupported", "retired_access_profile"]>>>;
673
+ code: z.ZodDefault<z.ZodNullable<z.ZodEnum<["finite_zero", "hard_cap", "estimate_headroom", "unknown_paid_in_flight", "budget_overshoot", "cost_unverifiable", "delegation_child_drain_timeout", "subscription_window_exhausted", "credential_pool_exhausted", "input_too_large", "raw_context_mandatory_unavailable", "raw_context_exceeds_window", "model_catalog_unavailable", "vendor_cli_too_old", "credential_source_unconfirmed", "delegated_home_unavailable", "delegated_confinement_unavailable", "delegated_evidence_incomplete", "access_profile_incompatible", "auxiliary_writable_roots_unsupported", "retired_access_profile"]>>>;
571
674
  harnessId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
572
675
  attemptId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
573
676
  safeMessage: z.ZodString;
@@ -576,6 +679,22 @@ export declare const ControlRunDetail: z.ZodObject<{
576
679
  eventRefs: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
577
680
  runDir: z.ZodDefault<z.ZodNullable<z.ZodString>>;
578
681
  resetsAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
682
+ quotaRefusal: z.ZodOptional<z.ZodObject<{
683
+ basis: z.ZodEnum<["owner_reserve", "provider_window", "provider_cooldown"]>;
684
+ constraintId: z.ZodNullable<z.ZodString>;
685
+ usedRatio: z.ZodNullable<z.ZodNumber>;
686
+ threshold: z.ZodNullable<z.ZodNumber>;
687
+ }, "strip", z.ZodTypeAny, {
688
+ basis: "owner_reserve" | "provider_cooldown" | "provider_window";
689
+ constraintId: string | null;
690
+ usedRatio: number | null;
691
+ threshold: number | null;
692
+ }, {
693
+ basis: "owner_reserve" | "provider_cooldown" | "provider_window";
694
+ constraintId: string | null;
695
+ usedRatio: number | null;
696
+ threshold: number | null;
697
+ }>>;
579
698
  vendorFailure: z.ZodDefault<z.ZodNullable<z.ZodObject<{
580
699
  code: z.ZodNullable<z.ZodString>;
581
700
  message: z.ZodNullable<z.ZodString>;
@@ -668,21 +787,45 @@ export declare const ControlRunDetail: z.ZodObject<{
668
787
  source: "grok_init";
669
788
  reported_source: string;
670
789
  } | undefined;
790
+ rawContextShortfall?: {
791
+ model: string;
792
+ context_window: number;
793
+ packet_tokens: number;
794
+ framing_tokens: number;
795
+ output_allowance_tokens: number;
796
+ mandatory_files: {
797
+ path: string;
798
+ estimated_tokens: number;
799
+ }[];
800
+ } | undefined;
671
801
  captureFailure?: {
672
- code: "capture_failed" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated";
802
+ code: "capture_failed" | "capture_git_signal" | "capture_git_stalled" | "capture_object_missing" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated" | "capture_read_failed" | "capture_space_insufficient";
673
803
  message: string;
674
804
  causeCode?: string | undefined;
675
805
  bufferBudgetBytes?: number | undefined;
676
806
  stream?: "stderr" | "stdout" | undefined;
677
807
  drain?: "truncated" | undefined;
808
+ requiredBytes?: number | undefined;
809
+ availableBytes?: number | undefined;
810
+ signal?: string | undefined;
811
+ stallMs?: number | undefined;
678
812
  cleanup?: {
679
813
  code: string | null;
680
814
  message: string;
681
815
  } | undefined;
816
+ inventory?: {
817
+ exact: false;
818
+ changedFiles: number;
819
+ largest: {
820
+ path: string;
821
+ change: "added" | "deleted" | "modified" | "type_changed";
822
+ sizeBytes: number | null;
823
+ }[];
824
+ } | undefined;
682
825
  } | undefined;
683
826
  phase: string;
684
827
  category: "auth" | "budget" | "cancelled" | "config_error" | "harness_error" | "harness_unavailable" | "internal" | "policy" | "project" | "unknown" | "validation";
685
- code: "access_profile_incompatible" | "auxiliary_writable_roots_unsupported" | "budget_overshoot" | "cost_unverifiable" | "credential_pool_exhausted" | "credential_source_unconfirmed" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "input_too_large" | "retired_access_profile" | "subscription_window_exhausted" | "unknown_paid_in_flight" | "vendor_cli_too_old" | null;
828
+ code: "access_profile_incompatible" | "auxiliary_writable_roots_unsupported" | "budget_overshoot" | "cost_unverifiable" | "credential_pool_exhausted" | "credential_source_unconfirmed" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "input_too_large" | "model_catalog_unavailable" | "raw_context_exceeds_window" | "raw_context_mandatory_unavailable" | "retired_access_profile" | "subscription_window_exhausted" | "unknown_paid_in_flight" | "vendor_cli_too_old" | null;
686
829
  harnessId: string | null;
687
830
  attemptId: string | null;
688
831
  safeMessage: string;
@@ -691,6 +834,12 @@ export declare const ControlRunDetail: z.ZodObject<{
691
834
  eventRefs: string[];
692
835
  runDir: string | null;
693
836
  resetsAt: string | null;
837
+ quotaRefusal?: {
838
+ basis: "owner_reserve" | "provider_cooldown" | "provider_window";
839
+ constraintId: string | null;
840
+ usedRatio: number | null;
841
+ threshold: number | null;
842
+ } | undefined;
694
843
  vendorFailure: {
695
844
  code: string | null;
696
845
  message: string | null;
@@ -735,21 +884,45 @@ export declare const ControlRunDetail: z.ZodObject<{
735
884
  source: "grok_init";
736
885
  reported_source: string;
737
886
  } | undefined;
887
+ rawContextShortfall?: {
888
+ model: string;
889
+ context_window: number;
890
+ packet_tokens: number;
891
+ framing_tokens: number;
892
+ output_allowance_tokens: number;
893
+ mandatory_files: {
894
+ path: string;
895
+ estimated_tokens: number;
896
+ }[];
897
+ } | undefined;
738
898
  captureFailure?: {
739
- code: "capture_failed" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated";
899
+ code: "capture_failed" | "capture_git_signal" | "capture_git_stalled" | "capture_object_missing" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated" | "capture_read_failed" | "capture_space_insufficient";
740
900
  message: string;
741
901
  causeCode?: string | undefined;
742
902
  bufferBudgetBytes?: number | undefined;
743
903
  stream?: "stderr" | "stdout" | undefined;
744
904
  drain?: "truncated" | undefined;
905
+ requiredBytes?: number | undefined;
906
+ availableBytes?: number | undefined;
907
+ signal?: string | undefined;
908
+ stallMs?: number | undefined;
745
909
  cleanup?: {
746
910
  code: string | null;
747
911
  message: string;
748
912
  } | undefined;
913
+ inventory?: {
914
+ exact: false;
915
+ changedFiles: number;
916
+ largest: {
917
+ path: string;
918
+ change: "added" | "deleted" | "modified" | "type_changed";
919
+ sizeBytes: number | null;
920
+ }[];
921
+ } | undefined;
749
922
  } | undefined;
750
923
  phase?: string | undefined;
751
924
  category?: "auth" | "budget" | "cancelled" | "config_error" | "harness_error" | "harness_unavailable" | "internal" | "policy" | "project" | "unknown" | "validation" | undefined;
752
- code?: "access_profile_incompatible" | "auxiliary_writable_roots_unsupported" | "budget_overshoot" | "cost_unverifiable" | "credential_pool_exhausted" | "credential_source_unconfirmed" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "input_too_large" | "retired_access_profile" | "subscription_window_exhausted" | "unknown_paid_in_flight" | "vendor_cli_too_old" | null | undefined;
925
+ code?: "access_profile_incompatible" | "auxiliary_writable_roots_unsupported" | "budget_overshoot" | "cost_unverifiable" | "credential_pool_exhausted" | "credential_source_unconfirmed" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "input_too_large" | "model_catalog_unavailable" | "raw_context_exceeds_window" | "raw_context_mandatory_unavailable" | "retired_access_profile" | "subscription_window_exhausted" | "unknown_paid_in_flight" | "vendor_cli_too_old" | null | undefined;
753
926
  harnessId?: string | null | undefined;
754
927
  attemptId?: string | null | undefined;
755
928
  safeMessage: string;
@@ -758,6 +931,12 @@ export declare const ControlRunDetail: z.ZodObject<{
758
931
  eventRefs?: string[] | undefined;
759
932
  runDir?: string | null | undefined;
760
933
  resetsAt?: string | null | undefined;
934
+ quotaRefusal?: {
935
+ basis: "owner_reserve" | "provider_cooldown" | "provider_window";
936
+ constraintId: string | null;
937
+ usedRatio: number | null;
938
+ threshold: number | null;
939
+ } | undefined;
761
940
  vendorFailure?: {
762
941
  code: string | null;
763
942
  message: string | null;
@@ -1043,7 +1222,7 @@ export declare const ControlRunDetail: z.ZodObject<{
1043
1222
  checks: z.ZodDefault<z.ZodEnum<["passed", "failed", "not_configured"]>>;
1044
1223
  review: z.ZodDefault<z.ZodEnum<["approved", "blocked", "not_run"]>>;
1045
1224
  review_requested: z.ZodOptional<z.ZodBoolean>;
1046
- 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", "host_cancelled", "owner_task_gone", "crash_interrupted", "workspace_unavailable", "input_required", "work_incomplete", "context_capacity_exhausted", "work_report_contract"]>>>;
1225
+ 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", "host_cancelled", "owner_task_gone", "crash_interrupted", "workspace_unavailable", "capture_refused", "input_required", "work_incomplete", "context_capacity_exhausted", "work_report_contract"]>>>;
1047
1226
  work_state: z.ZodOptional<z.ZodObject<{
1048
1227
  state: z.ZodEnum<["completed", "needs_input", "incomplete", "unverified"]>;
1049
1228
  source: z.ZodEnum<["constrained", "validated", "absent"]>;
@@ -1086,7 +1265,7 @@ export declare const ControlRunDetail: z.ZodObject<{
1086
1265
  checks: "failed" | "not_configured" | "passed";
1087
1266
  review: "approved" | "blocked" | "not_run";
1088
1267
  review_requested?: boolean | undefined;
1089
- reason: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null;
1268
+ reason: "budget_exhausted" | "budget_overshoot" | "capture_refused" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null;
1090
1269
  work_state?: {
1091
1270
  state: "completed" | "incomplete" | "needs_input" | "unverified";
1092
1271
  source: "absent" | "constrained" | "validated";
@@ -1103,7 +1282,7 @@ export declare const ControlRunDetail: z.ZodObject<{
1103
1282
  checks?: "failed" | "not_configured" | "passed" | undefined;
1104
1283
  review?: "approved" | "blocked" | "not_run" | undefined;
1105
1284
  review_requested?: boolean | undefined;
1106
- reason?: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null | undefined;
1285
+ reason?: "budget_exhausted" | "budget_overshoot" | "capture_refused" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null | undefined;
1107
1286
  work_state?: {
1108
1287
  state: "completed" | "incomplete" | "needs_input" | "unverified";
1109
1288
  source: "absent" | "constrained" | "validated";
@@ -1201,6 +1380,74 @@ export declare const ControlRunDetail: z.ZodObject<{
1201
1380
  eligible: boolean;
1202
1381
  }[] | undefined;
1203
1382
  }>>>;
1383
+ rawContext: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1384
+ model: z.ZodString;
1385
+ estimated_request_tokens: z.ZodNumber;
1386
+ budget: z.ZodObject<{
1387
+ estimator: z.ZodLiteral<"chars_div_4">;
1388
+ basis: z.ZodEnum<["model_context_window", "assumed_ceiling"]>;
1389
+ model: z.ZodNullable<z.ZodString>;
1390
+ context_window: z.ZodNullable<z.ZodNumber>;
1391
+ output_allowance_tokens: z.ZodNullable<z.ZodNumber>;
1392
+ framing_tokens: z.ZodNullable<z.ZodNumber>;
1393
+ selection_limit_tokens: z.ZodNumber;
1394
+ estimated_packet_tokens: z.ZodNumber;
1395
+ omitted_for_budget: z.ZodNumber;
1396
+ mandatory_paths: z.ZodArray<z.ZodString, "many">;
1397
+ }, "strict", z.ZodTypeAny, {
1398
+ estimator: "chars_div_4";
1399
+ basis: "assumed_ceiling" | "model_context_window";
1400
+ model: string | null;
1401
+ context_window: number | null;
1402
+ output_allowance_tokens: number | null;
1403
+ framing_tokens: number | null;
1404
+ selection_limit_tokens: number;
1405
+ estimated_packet_tokens: number;
1406
+ omitted_for_budget: number;
1407
+ mandatory_paths: string[];
1408
+ }, {
1409
+ estimator: "chars_div_4";
1410
+ basis: "assumed_ceiling" | "model_context_window";
1411
+ model: string | null;
1412
+ context_window: number | null;
1413
+ output_allowance_tokens: number | null;
1414
+ framing_tokens: number | null;
1415
+ selection_limit_tokens: number;
1416
+ estimated_packet_tokens: number;
1417
+ omitted_for_budget: number;
1418
+ mandatory_paths: string[];
1419
+ }>;
1420
+ }, "strict", z.ZodTypeAny, {
1421
+ model: string;
1422
+ estimated_request_tokens: number;
1423
+ budget: {
1424
+ estimator: "chars_div_4";
1425
+ basis: "assumed_ceiling" | "model_context_window";
1426
+ model: string | null;
1427
+ context_window: number | null;
1428
+ output_allowance_tokens: number | null;
1429
+ framing_tokens: number | null;
1430
+ selection_limit_tokens: number;
1431
+ estimated_packet_tokens: number;
1432
+ omitted_for_budget: number;
1433
+ mandatory_paths: string[];
1434
+ };
1435
+ }, {
1436
+ model: string;
1437
+ estimated_request_tokens: number;
1438
+ budget: {
1439
+ estimator: "chars_div_4";
1440
+ basis: "assumed_ceiling" | "model_context_window";
1441
+ model: string | null;
1442
+ context_window: number | null;
1443
+ output_allowance_tokens: number | null;
1444
+ framing_tokens: number | null;
1445
+ selection_limit_tokens: number;
1446
+ estimated_packet_tokens: number;
1447
+ omitted_for_budget: number;
1448
+ mandatory_paths: string[];
1449
+ };
1450
+ }>>>;
1204
1451
  tests: z.ZodOptional<z.ZodArray<z.ZodObject<{
1205
1452
  program: z.ZodString;
1206
1453
  args: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
@@ -1271,6 +1518,7 @@ export declare const ControlRunDetail: z.ZodObject<{
1271
1518
  modelMismatch: boolean | null;
1272
1519
  identityCheck: "matched_before_effects" | "mismatch_after_possible_effects" | "mismatch_before_effects" | "not_applicable";
1273
1520
  inputDelivery: "confirmed" | "not_applicable" | "uncertain";
1521
+ sourceRetirement?: "not_confirmed" | "retired" | undefined;
1274
1522
  }[] | undefined;
1275
1523
  retainedEnvelope: {
1276
1524
  root: string;
@@ -1303,21 +1551,45 @@ export declare const ControlRunDetail: z.ZodObject<{
1303
1551
  source: "grok_init";
1304
1552
  reported_source: string;
1305
1553
  } | undefined;
1554
+ rawContextShortfall?: {
1555
+ model: string;
1556
+ context_window: number;
1557
+ packet_tokens: number;
1558
+ framing_tokens: number;
1559
+ output_allowance_tokens: number;
1560
+ mandatory_files: {
1561
+ path: string;
1562
+ estimated_tokens: number;
1563
+ }[];
1564
+ } | undefined;
1306
1565
  captureFailure?: {
1307
- code: "capture_failed" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated";
1566
+ code: "capture_failed" | "capture_git_signal" | "capture_git_stalled" | "capture_object_missing" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated" | "capture_read_failed" | "capture_space_insufficient";
1308
1567
  message: string;
1309
1568
  causeCode?: string | undefined;
1310
1569
  bufferBudgetBytes?: number | undefined;
1311
1570
  stream?: "stderr" | "stdout" | undefined;
1312
1571
  drain?: "truncated" | undefined;
1572
+ requiredBytes?: number | undefined;
1573
+ availableBytes?: number | undefined;
1574
+ signal?: string | undefined;
1575
+ stallMs?: number | undefined;
1313
1576
  cleanup?: {
1314
1577
  code: string | null;
1315
1578
  message: string;
1316
1579
  } | undefined;
1580
+ inventory?: {
1581
+ exact: false;
1582
+ changedFiles: number;
1583
+ largest: {
1584
+ path: string;
1585
+ change: "added" | "deleted" | "modified" | "type_changed";
1586
+ sizeBytes: number | null;
1587
+ }[];
1588
+ } | undefined;
1317
1589
  } | undefined;
1318
1590
  phase: string;
1319
1591
  category: "auth" | "budget" | "cancelled" | "config_error" | "harness_error" | "harness_unavailable" | "internal" | "policy" | "project" | "unknown" | "validation";
1320
- code: "access_profile_incompatible" | "auxiliary_writable_roots_unsupported" | "budget_overshoot" | "cost_unverifiable" | "credential_pool_exhausted" | "credential_source_unconfirmed" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "input_too_large" | "retired_access_profile" | "subscription_window_exhausted" | "unknown_paid_in_flight" | "vendor_cli_too_old" | null;
1592
+ code: "access_profile_incompatible" | "auxiliary_writable_roots_unsupported" | "budget_overshoot" | "cost_unverifiable" | "credential_pool_exhausted" | "credential_source_unconfirmed" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "input_too_large" | "model_catalog_unavailable" | "raw_context_exceeds_window" | "raw_context_mandatory_unavailable" | "retired_access_profile" | "subscription_window_exhausted" | "unknown_paid_in_flight" | "vendor_cli_too_old" | null;
1321
1593
  harnessId: string | null;
1322
1594
  attemptId: string | null;
1323
1595
  safeMessage: string;
@@ -1326,6 +1598,12 @@ export declare const ControlRunDetail: z.ZodObject<{
1326
1598
  eventRefs: string[];
1327
1599
  runDir: string | null;
1328
1600
  resetsAt: string | null;
1601
+ quotaRefusal?: {
1602
+ basis: "owner_reserve" | "provider_cooldown" | "provider_window";
1603
+ constraintId: string | null;
1604
+ usedRatio: number | null;
1605
+ threshold: number | null;
1606
+ } | undefined;
1329
1607
  vendorFailure: {
1330
1608
  code: string | null;
1331
1609
  message: string | null;
@@ -1459,7 +1737,7 @@ export declare const ControlRunDetail: z.ZodObject<{
1459
1737
  checks: "failed" | "not_configured" | "passed";
1460
1738
  review: "approved" | "blocked" | "not_run";
1461
1739
  review_requested?: boolean | undefined;
1462
- reason: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null;
1740
+ reason: "budget_exhausted" | "budget_overshoot" | "capture_refused" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null;
1463
1741
  work_state?: {
1464
1742
  state: "completed" | "incomplete" | "needs_input" | "unverified";
1465
1743
  source: "absent" | "constrained" | "validated";
@@ -1499,6 +1777,22 @@ export declare const ControlRunDetail: z.ZodObject<{
1499
1777
  eligible: boolean;
1500
1778
  }[];
1501
1779
  } | null;
1780
+ rawContext: {
1781
+ model: string;
1782
+ estimated_request_tokens: number;
1783
+ budget: {
1784
+ estimator: "chars_div_4";
1785
+ basis: "assumed_ceiling" | "model_context_window";
1786
+ model: string | null;
1787
+ context_window: number | null;
1788
+ output_allowance_tokens: number | null;
1789
+ framing_tokens: number | null;
1790
+ selection_limit_tokens: number;
1791
+ estimated_packet_tokens: number;
1792
+ omitted_for_budget: number;
1793
+ mandatory_paths: string[];
1794
+ };
1795
+ } | null;
1502
1796
  tests?: {
1503
1797
  program: string;
1504
1798
  args: string[];
@@ -1559,6 +1853,7 @@ export declare const ControlRunDetail: z.ZodObject<{
1559
1853
  modelMismatch: boolean | null;
1560
1854
  identityCheck: "matched_before_effects" | "mismatch_after_possible_effects" | "mismatch_before_effects" | "not_applicable";
1561
1855
  inputDelivery: "confirmed" | "not_applicable" | "uncertain";
1856
+ sourceRetirement?: "not_confirmed" | "retired" | undefined;
1562
1857
  }[] | undefined;
1563
1858
  retainedEnvelope?: {
1564
1859
  root: string;
@@ -1591,21 +1886,45 @@ export declare const ControlRunDetail: z.ZodObject<{
1591
1886
  source: "grok_init";
1592
1887
  reported_source: string;
1593
1888
  } | undefined;
1889
+ rawContextShortfall?: {
1890
+ model: string;
1891
+ context_window: number;
1892
+ packet_tokens: number;
1893
+ framing_tokens: number;
1894
+ output_allowance_tokens: number;
1895
+ mandatory_files: {
1896
+ path: string;
1897
+ estimated_tokens: number;
1898
+ }[];
1899
+ } | undefined;
1594
1900
  captureFailure?: {
1595
- code: "capture_failed" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated";
1901
+ code: "capture_failed" | "capture_git_signal" | "capture_git_stalled" | "capture_object_missing" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated" | "capture_read_failed" | "capture_space_insufficient";
1596
1902
  message: string;
1597
1903
  causeCode?: string | undefined;
1598
1904
  bufferBudgetBytes?: number | undefined;
1599
1905
  stream?: "stderr" | "stdout" | undefined;
1600
1906
  drain?: "truncated" | undefined;
1907
+ requiredBytes?: number | undefined;
1908
+ availableBytes?: number | undefined;
1909
+ signal?: string | undefined;
1910
+ stallMs?: number | undefined;
1601
1911
  cleanup?: {
1602
1912
  code: string | null;
1603
1913
  message: string;
1604
1914
  } | undefined;
1915
+ inventory?: {
1916
+ exact: false;
1917
+ changedFiles: number;
1918
+ largest: {
1919
+ path: string;
1920
+ change: "added" | "deleted" | "modified" | "type_changed";
1921
+ sizeBytes: number | null;
1922
+ }[];
1923
+ } | undefined;
1605
1924
  } | undefined;
1606
1925
  phase?: string | undefined;
1607
1926
  category?: "auth" | "budget" | "cancelled" | "config_error" | "harness_error" | "harness_unavailable" | "internal" | "policy" | "project" | "unknown" | "validation" | undefined;
1608
- code?: "access_profile_incompatible" | "auxiliary_writable_roots_unsupported" | "budget_overshoot" | "cost_unverifiable" | "credential_pool_exhausted" | "credential_source_unconfirmed" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "input_too_large" | "retired_access_profile" | "subscription_window_exhausted" | "unknown_paid_in_flight" | "vendor_cli_too_old" | null | undefined;
1927
+ code?: "access_profile_incompatible" | "auxiliary_writable_roots_unsupported" | "budget_overshoot" | "cost_unverifiable" | "credential_pool_exhausted" | "credential_source_unconfirmed" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "input_too_large" | "model_catalog_unavailable" | "raw_context_exceeds_window" | "raw_context_mandatory_unavailable" | "retired_access_profile" | "subscription_window_exhausted" | "unknown_paid_in_flight" | "vendor_cli_too_old" | null | undefined;
1609
1928
  harnessId?: string | null | undefined;
1610
1929
  attemptId?: string | null | undefined;
1611
1930
  safeMessage: string;
@@ -1614,6 +1933,12 @@ export declare const ControlRunDetail: z.ZodObject<{
1614
1933
  eventRefs?: string[] | undefined;
1615
1934
  runDir?: string | null | undefined;
1616
1935
  resetsAt?: string | null | undefined;
1936
+ quotaRefusal?: {
1937
+ basis: "owner_reserve" | "provider_cooldown" | "provider_window";
1938
+ constraintId: string | null;
1939
+ usedRatio: number | null;
1940
+ threshold: number | null;
1941
+ } | undefined;
1617
1942
  vendorFailure?: {
1618
1943
  code: string | null;
1619
1944
  message: string | null;
@@ -1747,7 +2072,7 @@ export declare const ControlRunDetail: z.ZodObject<{
1747
2072
  checks?: "failed" | "not_configured" | "passed" | undefined;
1748
2073
  review?: "approved" | "blocked" | "not_run" | undefined;
1749
2074
  review_requested?: boolean | undefined;
1750
- reason?: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null | undefined;
2075
+ reason?: "budget_exhausted" | "budget_overshoot" | "capture_refused" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null | undefined;
1751
2076
  work_state?: {
1752
2077
  state: "completed" | "incomplete" | "needs_input" | "unverified";
1753
2078
  source: "absent" | "constrained" | "validated";
@@ -1787,6 +2112,22 @@ export declare const ControlRunDetail: z.ZodObject<{
1787
2112
  eligible: boolean;
1788
2113
  }[] | undefined;
1789
2114
  } | null | undefined;
2115
+ rawContext?: {
2116
+ model: string;
2117
+ estimated_request_tokens: number;
2118
+ budget: {
2119
+ estimator: "chars_div_4";
2120
+ basis: "assumed_ceiling" | "model_context_window";
2121
+ model: string | null;
2122
+ context_window: number | null;
2123
+ output_allowance_tokens: number | null;
2124
+ framing_tokens: number | null;
2125
+ selection_limit_tokens: number;
2126
+ estimated_packet_tokens: number;
2127
+ omitted_for_budget: number;
2128
+ mandatory_paths: string[];
2129
+ };
2130
+ } | null | undefined;
1790
2131
  tests?: {
1791
2132
  program: string;
1792
2133
  args?: string[] | undefined;
@@ -2021,6 +2362,7 @@ export declare const ControlRunDetail: z.ZodObject<{
2021
2362
  modelMismatch: z.ZodNullable<z.ZodBoolean>;
2022
2363
  identityCheck: z.ZodEnum<["matched_before_effects", "mismatch_before_effects", "mismatch_after_possible_effects", "not_applicable"]>;
2023
2364
  inputDelivery: z.ZodEnum<["confirmed", "uncertain", "not_applicable"]>;
2365
+ sourceRetirement: z.ZodOptional<z.ZodEnum<["retired", "not_confirmed"]>>;
2024
2366
  }, "strict", z.ZodTypeAny, {
2025
2367
  tryIndex: number;
2026
2368
  attemptId: string;
@@ -2042,6 +2384,7 @@ export declare const ControlRunDetail: z.ZodObject<{
2042
2384
  modelMismatch: boolean | null;
2043
2385
  identityCheck: "matched_before_effects" | "mismatch_after_possible_effects" | "mismatch_before_effects" | "not_applicable";
2044
2386
  inputDelivery: "confirmed" | "not_applicable" | "uncertain";
2387
+ sourceRetirement?: "not_confirmed" | "retired" | undefined;
2045
2388
  }, {
2046
2389
  tryIndex: number;
2047
2390
  attemptId: string;
@@ -2063,6 +2406,7 @@ export declare const ControlRunDetail: z.ZodObject<{
2063
2406
  modelMismatch: boolean | null;
2064
2407
  identityCheck: "matched_before_effects" | "mismatch_after_possible_effects" | "mismatch_before_effects" | "not_applicable";
2065
2408
  inputDelivery: "confirmed" | "not_applicable" | "uncertain";
2409
+ sourceRetirement?: "not_confirmed" | "retired" | undefined;
2066
2410
  }>, "many">>;
2067
2411
  retainedEnvelope: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2068
2412
  root: z.ZodString;
@@ -2144,13 +2488,54 @@ export declare const ControlRunDetail: z.ZodObject<{
2144
2488
  source: "grok_init";
2145
2489
  reported_source: string;
2146
2490
  }>]>>;
2491
+ rawContextShortfall: z.ZodOptional<z.ZodObject<{
2492
+ model: z.ZodString;
2493
+ context_window: z.ZodNumber;
2494
+ packet_tokens: z.ZodNumber;
2495
+ framing_tokens: z.ZodNumber;
2496
+ output_allowance_tokens: z.ZodNumber;
2497
+ mandatory_files: z.ZodArray<z.ZodObject<{
2498
+ path: z.ZodString;
2499
+ estimated_tokens: z.ZodNumber;
2500
+ }, "strict", z.ZodTypeAny, {
2501
+ path: string;
2502
+ estimated_tokens: number;
2503
+ }, {
2504
+ path: string;
2505
+ estimated_tokens: number;
2506
+ }>, "many">;
2507
+ }, "strict", z.ZodTypeAny, {
2508
+ model: string;
2509
+ context_window: number;
2510
+ packet_tokens: number;
2511
+ framing_tokens: number;
2512
+ output_allowance_tokens: number;
2513
+ mandatory_files: {
2514
+ path: string;
2515
+ estimated_tokens: number;
2516
+ }[];
2517
+ }, {
2518
+ model: string;
2519
+ context_window: number;
2520
+ packet_tokens: number;
2521
+ framing_tokens: number;
2522
+ output_allowance_tokens: number;
2523
+ mandatory_files: {
2524
+ path: string;
2525
+ estimated_tokens: number;
2526
+ }[];
2527
+ }>>;
2147
2528
  captureFailure: z.ZodOptional<z.ZodObject<{
2148
- code: z.ZodEnum<["capture_output_exceeded", "capture_output_incomplete", "capture_preview_truncated", "capture_failed"]>;
2529
+ code: z.ZodEnum<["capture_output_exceeded", "capture_output_incomplete", "capture_preview_truncated", "capture_space_insufficient", "capture_git_stalled", "capture_git_signal", "capture_read_failed", "capture_object_missing", "capture_failed"]>;
2149
2530
  message: z.ZodString;
2150
2531
  causeCode: z.ZodOptional<z.ZodString>;
2151
2532
  bufferBudgetBytes: z.ZodOptional<z.ZodNumber>;
2152
2533
  stream: z.ZodOptional<z.ZodEnum<["stdout", "stderr"]>>;
2153
2534
  drain: z.ZodOptional<z.ZodLiteral<"truncated">>;
2535
+ requiredBytes: z.ZodOptional<z.ZodNumber>;
2536
+ availableBytes: z.ZodOptional<z.ZodNumber>;
2537
+ signal: z.ZodOptional<z.ZodString>;
2538
+ stallMs: z.ZodOptional<z.ZodNumber>;
2154
2539
  cleanup: z.ZodOptional<z.ZodObject<{
2155
2540
  code: z.ZodNullable<z.ZodString>;
2156
2541
  message: z.ZodString;
@@ -2161,32 +2546,91 @@ export declare const ControlRunDetail: z.ZodObject<{
2161
2546
  code: string | null;
2162
2547
  message: string;
2163
2548
  }>>;
2549
+ inventory: z.ZodOptional<z.ZodObject<{
2550
+ exact: z.ZodLiteral<false>;
2551
+ changedFiles: z.ZodNumber;
2552
+ largest: z.ZodArray<z.ZodObject<{
2553
+ path: z.ZodString;
2554
+ change: z.ZodEnum<["added", "modified", "deleted", "type_changed"]>;
2555
+ sizeBytes: z.ZodNullable<z.ZodNumber>;
2556
+ }, "strip", z.ZodTypeAny, {
2557
+ path: string;
2558
+ change: "added" | "deleted" | "modified" | "type_changed";
2559
+ sizeBytes: number | null;
2560
+ }, {
2561
+ path: string;
2562
+ change: "added" | "deleted" | "modified" | "type_changed";
2563
+ sizeBytes: number | null;
2564
+ }>, "many">;
2565
+ }, "strip", z.ZodTypeAny, {
2566
+ exact: false;
2567
+ changedFiles: number;
2568
+ largest: {
2569
+ path: string;
2570
+ change: "added" | "deleted" | "modified" | "type_changed";
2571
+ sizeBytes: number | null;
2572
+ }[];
2573
+ }, {
2574
+ exact: false;
2575
+ changedFiles: number;
2576
+ largest: {
2577
+ path: string;
2578
+ change: "added" | "deleted" | "modified" | "type_changed";
2579
+ sizeBytes: number | null;
2580
+ }[];
2581
+ }>>;
2164
2582
  }, "strip", z.ZodTypeAny, {
2165
- code: "capture_failed" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated";
2583
+ code: "capture_failed" | "capture_git_signal" | "capture_git_stalled" | "capture_object_missing" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated" | "capture_read_failed" | "capture_space_insufficient";
2166
2584
  message: string;
2167
2585
  causeCode?: string | undefined;
2168
2586
  bufferBudgetBytes?: number | undefined;
2169
2587
  stream?: "stderr" | "stdout" | undefined;
2170
2588
  drain?: "truncated" | undefined;
2589
+ requiredBytes?: number | undefined;
2590
+ availableBytes?: number | undefined;
2591
+ signal?: string | undefined;
2592
+ stallMs?: number | undefined;
2171
2593
  cleanup?: {
2172
2594
  code: string | null;
2173
2595
  message: string;
2174
2596
  } | undefined;
2597
+ inventory?: {
2598
+ exact: false;
2599
+ changedFiles: number;
2600
+ largest: {
2601
+ path: string;
2602
+ change: "added" | "deleted" | "modified" | "type_changed";
2603
+ sizeBytes: number | null;
2604
+ }[];
2605
+ } | undefined;
2175
2606
  }, {
2176
- code: "capture_failed" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated";
2607
+ code: "capture_failed" | "capture_git_signal" | "capture_git_stalled" | "capture_object_missing" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated" | "capture_read_failed" | "capture_space_insufficient";
2177
2608
  message: string;
2178
2609
  causeCode?: string | undefined;
2179
2610
  bufferBudgetBytes?: number | undefined;
2180
2611
  stream?: "stderr" | "stdout" | undefined;
2181
2612
  drain?: "truncated" | undefined;
2613
+ requiredBytes?: number | undefined;
2614
+ availableBytes?: number | undefined;
2615
+ signal?: string | undefined;
2616
+ stallMs?: number | undefined;
2182
2617
  cleanup?: {
2183
2618
  code: string | null;
2184
2619
  message: string;
2185
2620
  } | undefined;
2621
+ inventory?: {
2622
+ exact: false;
2623
+ changedFiles: number;
2624
+ largest: {
2625
+ path: string;
2626
+ change: "added" | "deleted" | "modified" | "type_changed";
2627
+ sizeBytes: number | null;
2628
+ }[];
2629
+ } | undefined;
2186
2630
  }>>;
2187
2631
  phase: z.ZodDefault<z.ZodString>;
2188
2632
  category: z.ZodDefault<z.ZodEnum<["validation", "project", "auth", "harness_unavailable", "harness_error", "config_error", "budget", "policy", "cancelled", "internal", "unknown"]>>;
2189
- code: z.ZodDefault<z.ZodNullable<z.ZodEnum<["finite_zero", "hard_cap", "estimate_headroom", "unknown_paid_in_flight", "budget_overshoot", "cost_unverifiable", "delegation_child_drain_timeout", "subscription_window_exhausted", "credential_pool_exhausted", "input_too_large", "vendor_cli_too_old", "credential_source_unconfirmed", "delegated_home_unavailable", "delegated_confinement_unavailable", "delegated_evidence_incomplete", "access_profile_incompatible", "auxiliary_writable_roots_unsupported", "retired_access_profile"]>>>;
2633
+ code: z.ZodDefault<z.ZodNullable<z.ZodEnum<["finite_zero", "hard_cap", "estimate_headroom", "unknown_paid_in_flight", "budget_overshoot", "cost_unverifiable", "delegation_child_drain_timeout", "subscription_window_exhausted", "credential_pool_exhausted", "input_too_large", "raw_context_mandatory_unavailable", "raw_context_exceeds_window", "model_catalog_unavailable", "vendor_cli_too_old", "credential_source_unconfirmed", "delegated_home_unavailable", "delegated_confinement_unavailable", "delegated_evidence_incomplete", "access_profile_incompatible", "auxiliary_writable_roots_unsupported", "retired_access_profile"]>>>;
2190
2634
  harnessId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2191
2635
  attemptId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2192
2636
  safeMessage: z.ZodString;
@@ -2195,6 +2639,22 @@ export declare const ControlRunDetail: z.ZodObject<{
2195
2639
  eventRefs: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
2196
2640
  runDir: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2197
2641
  resetsAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
2642
+ quotaRefusal: z.ZodOptional<z.ZodObject<{
2643
+ basis: z.ZodEnum<["owner_reserve", "provider_window", "provider_cooldown"]>;
2644
+ constraintId: z.ZodNullable<z.ZodString>;
2645
+ usedRatio: z.ZodNullable<z.ZodNumber>;
2646
+ threshold: z.ZodNullable<z.ZodNumber>;
2647
+ }, "strip", z.ZodTypeAny, {
2648
+ basis: "owner_reserve" | "provider_cooldown" | "provider_window";
2649
+ constraintId: string | null;
2650
+ usedRatio: number | null;
2651
+ threshold: number | null;
2652
+ }, {
2653
+ basis: "owner_reserve" | "provider_cooldown" | "provider_window";
2654
+ constraintId: string | null;
2655
+ usedRatio: number | null;
2656
+ threshold: number | null;
2657
+ }>>;
2198
2658
  vendorFailure: z.ZodDefault<z.ZodNullable<z.ZodObject<{
2199
2659
  code: z.ZodNullable<z.ZodString>;
2200
2660
  message: z.ZodNullable<z.ZodString>;
@@ -2287,21 +2747,45 @@ export declare const ControlRunDetail: z.ZodObject<{
2287
2747
  source: "grok_init";
2288
2748
  reported_source: string;
2289
2749
  } | undefined;
2750
+ rawContextShortfall?: {
2751
+ model: string;
2752
+ context_window: number;
2753
+ packet_tokens: number;
2754
+ framing_tokens: number;
2755
+ output_allowance_tokens: number;
2756
+ mandatory_files: {
2757
+ path: string;
2758
+ estimated_tokens: number;
2759
+ }[];
2760
+ } | undefined;
2290
2761
  captureFailure?: {
2291
- code: "capture_failed" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated";
2762
+ code: "capture_failed" | "capture_git_signal" | "capture_git_stalled" | "capture_object_missing" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated" | "capture_read_failed" | "capture_space_insufficient";
2292
2763
  message: string;
2293
2764
  causeCode?: string | undefined;
2294
2765
  bufferBudgetBytes?: number | undefined;
2295
2766
  stream?: "stderr" | "stdout" | undefined;
2296
2767
  drain?: "truncated" | undefined;
2768
+ requiredBytes?: number | undefined;
2769
+ availableBytes?: number | undefined;
2770
+ signal?: string | undefined;
2771
+ stallMs?: number | undefined;
2297
2772
  cleanup?: {
2298
2773
  code: string | null;
2299
2774
  message: string;
2300
2775
  } | undefined;
2776
+ inventory?: {
2777
+ exact: false;
2778
+ changedFiles: number;
2779
+ largest: {
2780
+ path: string;
2781
+ change: "added" | "deleted" | "modified" | "type_changed";
2782
+ sizeBytes: number | null;
2783
+ }[];
2784
+ } | undefined;
2301
2785
  } | undefined;
2302
2786
  phase: string;
2303
2787
  category: "auth" | "budget" | "cancelled" | "config_error" | "harness_error" | "harness_unavailable" | "internal" | "policy" | "project" | "unknown" | "validation";
2304
- code: "access_profile_incompatible" | "auxiliary_writable_roots_unsupported" | "budget_overshoot" | "cost_unverifiable" | "credential_pool_exhausted" | "credential_source_unconfirmed" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "input_too_large" | "retired_access_profile" | "subscription_window_exhausted" | "unknown_paid_in_flight" | "vendor_cli_too_old" | null;
2788
+ code: "access_profile_incompatible" | "auxiliary_writable_roots_unsupported" | "budget_overshoot" | "cost_unverifiable" | "credential_pool_exhausted" | "credential_source_unconfirmed" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "input_too_large" | "model_catalog_unavailable" | "raw_context_exceeds_window" | "raw_context_mandatory_unavailable" | "retired_access_profile" | "subscription_window_exhausted" | "unknown_paid_in_flight" | "vendor_cli_too_old" | null;
2305
2789
  harnessId: string | null;
2306
2790
  attemptId: string | null;
2307
2791
  safeMessage: string;
@@ -2310,6 +2794,12 @@ export declare const ControlRunDetail: z.ZodObject<{
2310
2794
  eventRefs: string[];
2311
2795
  runDir: string | null;
2312
2796
  resetsAt: string | null;
2797
+ quotaRefusal?: {
2798
+ basis: "owner_reserve" | "provider_cooldown" | "provider_window";
2799
+ constraintId: string | null;
2800
+ usedRatio: number | null;
2801
+ threshold: number | null;
2802
+ } | undefined;
2313
2803
  vendorFailure: {
2314
2804
  code: string | null;
2315
2805
  message: string | null;
@@ -2354,21 +2844,45 @@ export declare const ControlRunDetail: z.ZodObject<{
2354
2844
  source: "grok_init";
2355
2845
  reported_source: string;
2356
2846
  } | undefined;
2847
+ rawContextShortfall?: {
2848
+ model: string;
2849
+ context_window: number;
2850
+ packet_tokens: number;
2851
+ framing_tokens: number;
2852
+ output_allowance_tokens: number;
2853
+ mandatory_files: {
2854
+ path: string;
2855
+ estimated_tokens: number;
2856
+ }[];
2857
+ } | undefined;
2357
2858
  captureFailure?: {
2358
- code: "capture_failed" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated";
2859
+ code: "capture_failed" | "capture_git_signal" | "capture_git_stalled" | "capture_object_missing" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated" | "capture_read_failed" | "capture_space_insufficient";
2359
2860
  message: string;
2360
2861
  causeCode?: string | undefined;
2361
2862
  bufferBudgetBytes?: number | undefined;
2362
2863
  stream?: "stderr" | "stdout" | undefined;
2363
2864
  drain?: "truncated" | undefined;
2865
+ requiredBytes?: number | undefined;
2866
+ availableBytes?: number | undefined;
2867
+ signal?: string | undefined;
2868
+ stallMs?: number | undefined;
2364
2869
  cleanup?: {
2365
2870
  code: string | null;
2366
2871
  message: string;
2367
2872
  } | undefined;
2873
+ inventory?: {
2874
+ exact: false;
2875
+ changedFiles: number;
2876
+ largest: {
2877
+ path: string;
2878
+ change: "added" | "deleted" | "modified" | "type_changed";
2879
+ sizeBytes: number | null;
2880
+ }[];
2881
+ } | undefined;
2368
2882
  } | undefined;
2369
2883
  phase?: string | undefined;
2370
2884
  category?: "auth" | "budget" | "cancelled" | "config_error" | "harness_error" | "harness_unavailable" | "internal" | "policy" | "project" | "unknown" | "validation" | undefined;
2371
- code?: "access_profile_incompatible" | "auxiliary_writable_roots_unsupported" | "budget_overshoot" | "cost_unverifiable" | "credential_pool_exhausted" | "credential_source_unconfirmed" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "input_too_large" | "retired_access_profile" | "subscription_window_exhausted" | "unknown_paid_in_flight" | "vendor_cli_too_old" | null | undefined;
2885
+ code?: "access_profile_incompatible" | "auxiliary_writable_roots_unsupported" | "budget_overshoot" | "cost_unverifiable" | "credential_pool_exhausted" | "credential_source_unconfirmed" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "input_too_large" | "model_catalog_unavailable" | "raw_context_exceeds_window" | "raw_context_mandatory_unavailable" | "retired_access_profile" | "subscription_window_exhausted" | "unknown_paid_in_flight" | "vendor_cli_too_old" | null | undefined;
2372
2886
  harnessId?: string | null | undefined;
2373
2887
  attemptId?: string | null | undefined;
2374
2888
  safeMessage: string;
@@ -2377,6 +2891,12 @@ export declare const ControlRunDetail: z.ZodObject<{
2377
2891
  eventRefs?: string[] | undefined;
2378
2892
  runDir?: string | null | undefined;
2379
2893
  resetsAt?: string | null | undefined;
2894
+ quotaRefusal?: {
2895
+ basis: "owner_reserve" | "provider_cooldown" | "provider_window";
2896
+ constraintId: string | null;
2897
+ usedRatio: number | null;
2898
+ threshold: number | null;
2899
+ } | undefined;
2380
2900
  vendorFailure?: {
2381
2901
  code: string | null;
2382
2902
  message: string | null;
@@ -2662,7 +3182,7 @@ export declare const ControlRunDetail: z.ZodObject<{
2662
3182
  checks: z.ZodDefault<z.ZodEnum<["passed", "failed", "not_configured"]>>;
2663
3183
  review: z.ZodDefault<z.ZodEnum<["approved", "blocked", "not_run"]>>;
2664
3184
  review_requested: z.ZodOptional<z.ZodBoolean>;
2665
- 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", "host_cancelled", "owner_task_gone", "crash_interrupted", "workspace_unavailable", "input_required", "work_incomplete", "context_capacity_exhausted", "work_report_contract"]>>>;
3185
+ 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", "host_cancelled", "owner_task_gone", "crash_interrupted", "workspace_unavailable", "capture_refused", "input_required", "work_incomplete", "context_capacity_exhausted", "work_report_contract"]>>>;
2666
3186
  work_state: z.ZodOptional<z.ZodObject<{
2667
3187
  state: z.ZodEnum<["completed", "needs_input", "incomplete", "unverified"]>;
2668
3188
  source: z.ZodEnum<["constrained", "validated", "absent"]>;
@@ -2705,7 +3225,7 @@ export declare const ControlRunDetail: z.ZodObject<{
2705
3225
  checks: "failed" | "not_configured" | "passed";
2706
3226
  review: "approved" | "blocked" | "not_run";
2707
3227
  review_requested?: boolean | undefined;
2708
- reason: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null;
3228
+ reason: "budget_exhausted" | "budget_overshoot" | "capture_refused" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null;
2709
3229
  work_state?: {
2710
3230
  state: "completed" | "incomplete" | "needs_input" | "unverified";
2711
3231
  source: "absent" | "constrained" | "validated";
@@ -2722,7 +3242,7 @@ export declare const ControlRunDetail: z.ZodObject<{
2722
3242
  checks?: "failed" | "not_configured" | "passed" | undefined;
2723
3243
  review?: "approved" | "blocked" | "not_run" | undefined;
2724
3244
  review_requested?: boolean | undefined;
2725
- reason?: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null | undefined;
3245
+ reason?: "budget_exhausted" | "budget_overshoot" | "capture_refused" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null | undefined;
2726
3246
  work_state?: {
2727
3247
  state: "completed" | "incomplete" | "needs_input" | "unverified";
2728
3248
  source: "absent" | "constrained" | "validated";
@@ -2820,6 +3340,74 @@ export declare const ControlRunDetail: z.ZodObject<{
2820
3340
  eligible: boolean;
2821
3341
  }[] | undefined;
2822
3342
  }>>>;
3343
+ rawContext: z.ZodDefault<z.ZodNullable<z.ZodObject<{
3344
+ model: z.ZodString;
3345
+ estimated_request_tokens: z.ZodNumber;
3346
+ budget: z.ZodObject<{
3347
+ estimator: z.ZodLiteral<"chars_div_4">;
3348
+ basis: z.ZodEnum<["model_context_window", "assumed_ceiling"]>;
3349
+ model: z.ZodNullable<z.ZodString>;
3350
+ context_window: z.ZodNullable<z.ZodNumber>;
3351
+ output_allowance_tokens: z.ZodNullable<z.ZodNumber>;
3352
+ framing_tokens: z.ZodNullable<z.ZodNumber>;
3353
+ selection_limit_tokens: z.ZodNumber;
3354
+ estimated_packet_tokens: z.ZodNumber;
3355
+ omitted_for_budget: z.ZodNumber;
3356
+ mandatory_paths: z.ZodArray<z.ZodString, "many">;
3357
+ }, "strict", z.ZodTypeAny, {
3358
+ estimator: "chars_div_4";
3359
+ basis: "assumed_ceiling" | "model_context_window";
3360
+ model: string | null;
3361
+ context_window: number | null;
3362
+ output_allowance_tokens: number | null;
3363
+ framing_tokens: number | null;
3364
+ selection_limit_tokens: number;
3365
+ estimated_packet_tokens: number;
3366
+ omitted_for_budget: number;
3367
+ mandatory_paths: string[];
3368
+ }, {
3369
+ estimator: "chars_div_4";
3370
+ basis: "assumed_ceiling" | "model_context_window";
3371
+ model: string | null;
3372
+ context_window: number | null;
3373
+ output_allowance_tokens: number | null;
3374
+ framing_tokens: number | null;
3375
+ selection_limit_tokens: number;
3376
+ estimated_packet_tokens: number;
3377
+ omitted_for_budget: number;
3378
+ mandatory_paths: string[];
3379
+ }>;
3380
+ }, "strict", z.ZodTypeAny, {
3381
+ model: string;
3382
+ estimated_request_tokens: number;
3383
+ budget: {
3384
+ estimator: "chars_div_4";
3385
+ basis: "assumed_ceiling" | "model_context_window";
3386
+ model: string | null;
3387
+ context_window: number | null;
3388
+ output_allowance_tokens: number | null;
3389
+ framing_tokens: number | null;
3390
+ selection_limit_tokens: number;
3391
+ estimated_packet_tokens: number;
3392
+ omitted_for_budget: number;
3393
+ mandatory_paths: string[];
3394
+ };
3395
+ }, {
3396
+ model: string;
3397
+ estimated_request_tokens: number;
3398
+ budget: {
3399
+ estimator: "chars_div_4";
3400
+ basis: "assumed_ceiling" | "model_context_window";
3401
+ model: string | null;
3402
+ context_window: number | null;
3403
+ output_allowance_tokens: number | null;
3404
+ framing_tokens: number | null;
3405
+ selection_limit_tokens: number;
3406
+ estimated_packet_tokens: number;
3407
+ omitted_for_budget: number;
3408
+ mandatory_paths: string[];
3409
+ };
3410
+ }>>>;
2823
3411
  tests: z.ZodOptional<z.ZodArray<z.ZodObject<{
2824
3412
  program: z.ZodString;
2825
3413
  args: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
@@ -2890,6 +3478,7 @@ export declare const ControlRunDetail: z.ZodObject<{
2890
3478
  modelMismatch: boolean | null;
2891
3479
  identityCheck: "matched_before_effects" | "mismatch_after_possible_effects" | "mismatch_before_effects" | "not_applicable";
2892
3480
  inputDelivery: "confirmed" | "not_applicable" | "uncertain";
3481
+ sourceRetirement?: "not_confirmed" | "retired" | undefined;
2893
3482
  }[] | undefined;
2894
3483
  retainedEnvelope: {
2895
3484
  root: string;
@@ -2922,21 +3511,45 @@ export declare const ControlRunDetail: z.ZodObject<{
2922
3511
  source: "grok_init";
2923
3512
  reported_source: string;
2924
3513
  } | undefined;
3514
+ rawContextShortfall?: {
3515
+ model: string;
3516
+ context_window: number;
3517
+ packet_tokens: number;
3518
+ framing_tokens: number;
3519
+ output_allowance_tokens: number;
3520
+ mandatory_files: {
3521
+ path: string;
3522
+ estimated_tokens: number;
3523
+ }[];
3524
+ } | undefined;
2925
3525
  captureFailure?: {
2926
- code: "capture_failed" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated";
3526
+ code: "capture_failed" | "capture_git_signal" | "capture_git_stalled" | "capture_object_missing" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated" | "capture_read_failed" | "capture_space_insufficient";
2927
3527
  message: string;
2928
3528
  causeCode?: string | undefined;
2929
3529
  bufferBudgetBytes?: number | undefined;
2930
3530
  stream?: "stderr" | "stdout" | undefined;
2931
3531
  drain?: "truncated" | undefined;
3532
+ requiredBytes?: number | undefined;
3533
+ availableBytes?: number | undefined;
3534
+ signal?: string | undefined;
3535
+ stallMs?: number | undefined;
2932
3536
  cleanup?: {
2933
3537
  code: string | null;
2934
3538
  message: string;
2935
3539
  } | undefined;
3540
+ inventory?: {
3541
+ exact: false;
3542
+ changedFiles: number;
3543
+ largest: {
3544
+ path: string;
3545
+ change: "added" | "deleted" | "modified" | "type_changed";
3546
+ sizeBytes: number | null;
3547
+ }[];
3548
+ } | undefined;
2936
3549
  } | undefined;
2937
3550
  phase: string;
2938
3551
  category: "auth" | "budget" | "cancelled" | "config_error" | "harness_error" | "harness_unavailable" | "internal" | "policy" | "project" | "unknown" | "validation";
2939
- code: "access_profile_incompatible" | "auxiliary_writable_roots_unsupported" | "budget_overshoot" | "cost_unverifiable" | "credential_pool_exhausted" | "credential_source_unconfirmed" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "input_too_large" | "retired_access_profile" | "subscription_window_exhausted" | "unknown_paid_in_flight" | "vendor_cli_too_old" | null;
3552
+ code: "access_profile_incompatible" | "auxiliary_writable_roots_unsupported" | "budget_overshoot" | "cost_unverifiable" | "credential_pool_exhausted" | "credential_source_unconfirmed" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "input_too_large" | "model_catalog_unavailable" | "raw_context_exceeds_window" | "raw_context_mandatory_unavailable" | "retired_access_profile" | "subscription_window_exhausted" | "unknown_paid_in_flight" | "vendor_cli_too_old" | null;
2940
3553
  harnessId: string | null;
2941
3554
  attemptId: string | null;
2942
3555
  safeMessage: string;
@@ -2945,6 +3558,12 @@ export declare const ControlRunDetail: z.ZodObject<{
2945
3558
  eventRefs: string[];
2946
3559
  runDir: string | null;
2947
3560
  resetsAt: string | null;
3561
+ quotaRefusal?: {
3562
+ basis: "owner_reserve" | "provider_cooldown" | "provider_window";
3563
+ constraintId: string | null;
3564
+ usedRatio: number | null;
3565
+ threshold: number | null;
3566
+ } | undefined;
2948
3567
  vendorFailure: {
2949
3568
  code: string | null;
2950
3569
  message: string | null;
@@ -3078,7 +3697,7 @@ export declare const ControlRunDetail: z.ZodObject<{
3078
3697
  checks: "failed" | "not_configured" | "passed";
3079
3698
  review: "approved" | "blocked" | "not_run";
3080
3699
  review_requested?: boolean | undefined;
3081
- reason: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null;
3700
+ reason: "budget_exhausted" | "budget_overshoot" | "capture_refused" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null;
3082
3701
  work_state?: {
3083
3702
  state: "completed" | "incomplete" | "needs_input" | "unverified";
3084
3703
  source: "absent" | "constrained" | "validated";
@@ -3118,6 +3737,22 @@ export declare const ControlRunDetail: z.ZodObject<{
3118
3737
  eligible: boolean;
3119
3738
  }[];
3120
3739
  } | null;
3740
+ rawContext: {
3741
+ model: string;
3742
+ estimated_request_tokens: number;
3743
+ budget: {
3744
+ estimator: "chars_div_4";
3745
+ basis: "assumed_ceiling" | "model_context_window";
3746
+ model: string | null;
3747
+ context_window: number | null;
3748
+ output_allowance_tokens: number | null;
3749
+ framing_tokens: number | null;
3750
+ selection_limit_tokens: number;
3751
+ estimated_packet_tokens: number;
3752
+ omitted_for_budget: number;
3753
+ mandatory_paths: string[];
3754
+ };
3755
+ } | null;
3121
3756
  tests?: {
3122
3757
  program: string;
3123
3758
  args: string[];
@@ -3178,6 +3813,7 @@ export declare const ControlRunDetail: z.ZodObject<{
3178
3813
  modelMismatch: boolean | null;
3179
3814
  identityCheck: "matched_before_effects" | "mismatch_after_possible_effects" | "mismatch_before_effects" | "not_applicable";
3180
3815
  inputDelivery: "confirmed" | "not_applicable" | "uncertain";
3816
+ sourceRetirement?: "not_confirmed" | "retired" | undefined;
3181
3817
  }[] | undefined;
3182
3818
  retainedEnvelope?: {
3183
3819
  root: string;
@@ -3210,21 +3846,45 @@ export declare const ControlRunDetail: z.ZodObject<{
3210
3846
  source: "grok_init";
3211
3847
  reported_source: string;
3212
3848
  } | undefined;
3849
+ rawContextShortfall?: {
3850
+ model: string;
3851
+ context_window: number;
3852
+ packet_tokens: number;
3853
+ framing_tokens: number;
3854
+ output_allowance_tokens: number;
3855
+ mandatory_files: {
3856
+ path: string;
3857
+ estimated_tokens: number;
3858
+ }[];
3859
+ } | undefined;
3213
3860
  captureFailure?: {
3214
- code: "capture_failed" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated";
3861
+ code: "capture_failed" | "capture_git_signal" | "capture_git_stalled" | "capture_object_missing" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated" | "capture_read_failed" | "capture_space_insufficient";
3215
3862
  message: string;
3216
3863
  causeCode?: string | undefined;
3217
3864
  bufferBudgetBytes?: number | undefined;
3218
3865
  stream?: "stderr" | "stdout" | undefined;
3219
3866
  drain?: "truncated" | undefined;
3867
+ requiredBytes?: number | undefined;
3868
+ availableBytes?: number | undefined;
3869
+ signal?: string | undefined;
3870
+ stallMs?: number | undefined;
3220
3871
  cleanup?: {
3221
3872
  code: string | null;
3222
3873
  message: string;
3223
3874
  } | undefined;
3875
+ inventory?: {
3876
+ exact: false;
3877
+ changedFiles: number;
3878
+ largest: {
3879
+ path: string;
3880
+ change: "added" | "deleted" | "modified" | "type_changed";
3881
+ sizeBytes: number | null;
3882
+ }[];
3883
+ } | undefined;
3224
3884
  } | undefined;
3225
3885
  phase?: string | undefined;
3226
3886
  category?: "auth" | "budget" | "cancelled" | "config_error" | "harness_error" | "harness_unavailable" | "internal" | "policy" | "project" | "unknown" | "validation" | undefined;
3227
- code?: "access_profile_incompatible" | "auxiliary_writable_roots_unsupported" | "budget_overshoot" | "cost_unverifiable" | "credential_pool_exhausted" | "credential_source_unconfirmed" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "input_too_large" | "retired_access_profile" | "subscription_window_exhausted" | "unknown_paid_in_flight" | "vendor_cli_too_old" | null | undefined;
3887
+ code?: "access_profile_incompatible" | "auxiliary_writable_roots_unsupported" | "budget_overshoot" | "cost_unverifiable" | "credential_pool_exhausted" | "credential_source_unconfirmed" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "input_too_large" | "model_catalog_unavailable" | "raw_context_exceeds_window" | "raw_context_mandatory_unavailable" | "retired_access_profile" | "subscription_window_exhausted" | "unknown_paid_in_flight" | "vendor_cli_too_old" | null | undefined;
3228
3888
  harnessId?: string | null | undefined;
3229
3889
  attemptId?: string | null | undefined;
3230
3890
  safeMessage: string;
@@ -3233,6 +3893,12 @@ export declare const ControlRunDetail: z.ZodObject<{
3233
3893
  eventRefs?: string[] | undefined;
3234
3894
  runDir?: string | null | undefined;
3235
3895
  resetsAt?: string | null | undefined;
3896
+ quotaRefusal?: {
3897
+ basis: "owner_reserve" | "provider_cooldown" | "provider_window";
3898
+ constraintId: string | null;
3899
+ usedRatio: number | null;
3900
+ threshold: number | null;
3901
+ } | undefined;
3236
3902
  vendorFailure?: {
3237
3903
  code: string | null;
3238
3904
  message: string | null;
@@ -3366,7 +4032,7 @@ export declare const ControlRunDetail: z.ZodObject<{
3366
4032
  checks?: "failed" | "not_configured" | "passed" | undefined;
3367
4033
  review?: "approved" | "blocked" | "not_run" | undefined;
3368
4034
  review_requested?: boolean | undefined;
3369
- reason?: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null | undefined;
4035
+ reason?: "budget_exhausted" | "budget_overshoot" | "capture_refused" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null | undefined;
3370
4036
  work_state?: {
3371
4037
  state: "completed" | "incomplete" | "needs_input" | "unverified";
3372
4038
  source: "absent" | "constrained" | "validated";
@@ -3406,6 +4072,22 @@ export declare const ControlRunDetail: z.ZodObject<{
3406
4072
  eligible: boolean;
3407
4073
  }[] | undefined;
3408
4074
  } | null | undefined;
4075
+ rawContext?: {
4076
+ model: string;
4077
+ estimated_request_tokens: number;
4078
+ budget: {
4079
+ estimator: "chars_div_4";
4080
+ basis: "assumed_ceiling" | "model_context_window";
4081
+ model: string | null;
4082
+ context_window: number | null;
4083
+ output_allowance_tokens: number | null;
4084
+ framing_tokens: number | null;
4085
+ selection_limit_tokens: number;
4086
+ estimated_packet_tokens: number;
4087
+ omitted_for_budget: number;
4088
+ mandatory_paths: string[];
4089
+ };
4090
+ } | null | undefined;
3409
4091
  tests?: {
3410
4092
  program: string;
3411
4093
  args?: string[] | undefined;
@@ -3429,7 +4111,7 @@ export declare const ControlRunDetail: z.ZodObject<{
3429
4111
  checks: z.ZodDefault<z.ZodEnum<["passed", "failed", "not_configured"]>>;
3430
4112
  review: z.ZodDefault<z.ZodEnum<["approved", "blocked", "not_run"]>>;
3431
4113
  review_requested: z.ZodOptional<z.ZodBoolean>;
3432
- 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", "host_cancelled", "owner_task_gone", "crash_interrupted", "workspace_unavailable", "input_required", "work_incomplete", "context_capacity_exhausted", "work_report_contract"]>>>;
4114
+ 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", "host_cancelled", "owner_task_gone", "crash_interrupted", "workspace_unavailable", "capture_refused", "input_required", "work_incomplete", "context_capacity_exhausted", "work_report_contract"]>>>;
3433
4115
  work_state: z.ZodOptional<z.ZodObject<{
3434
4116
  state: z.ZodEnum<["completed", "needs_input", "incomplete", "unverified"]>;
3435
4117
  source: z.ZodEnum<["constrained", "validated", "absent"]>;
@@ -3472,7 +4154,7 @@ export declare const ControlRunDetail: z.ZodObject<{
3472
4154
  checks: "failed" | "not_configured" | "passed";
3473
4155
  review: "approved" | "blocked" | "not_run";
3474
4156
  review_requested?: boolean | undefined;
3475
- reason: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null;
4157
+ reason: "budget_exhausted" | "budget_overshoot" | "capture_refused" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null;
3476
4158
  work_state?: {
3477
4159
  state: "completed" | "incomplete" | "needs_input" | "unverified";
3478
4160
  source: "absent" | "constrained" | "validated";
@@ -3489,7 +4171,7 @@ export declare const ControlRunDetail: z.ZodObject<{
3489
4171
  checks?: "failed" | "not_configured" | "passed" | undefined;
3490
4172
  review?: "approved" | "blocked" | "not_run" | undefined;
3491
4173
  review_requested?: boolean | undefined;
3492
- reason?: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null | undefined;
4174
+ reason?: "budget_exhausted" | "budget_overshoot" | "capture_refused" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null | undefined;
3493
4175
  work_state?: {
3494
4176
  state: "completed" | "incomplete" | "needs_input" | "unverified";
3495
4177
  source: "absent" | "constrained" | "validated";
@@ -3674,7 +4356,7 @@ export declare const ControlRunDetail: z.ZodObject<{
3674
4356
  checks: "failed" | "not_configured" | "passed";
3675
4357
  review: "approved" | "blocked" | "not_run";
3676
4358
  review_requested?: boolean | undefined;
3677
- reason: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null;
4359
+ reason: "budget_exhausted" | "budget_overshoot" | "capture_refused" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null;
3678
4360
  work_state?: {
3679
4361
  state: "completed" | "incomplete" | "needs_input" | "unverified";
3680
4362
  source: "absent" | "constrained" | "validated";
@@ -3747,7 +4429,7 @@ export declare const ControlRunDetail: z.ZodObject<{
3747
4429
  checks?: "failed" | "not_configured" | "passed" | undefined;
3748
4430
  review?: "approved" | "blocked" | "not_run" | undefined;
3749
4431
  review_requested?: boolean | undefined;
3750
- reason?: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null | undefined;
4432
+ reason?: "budget_exhausted" | "budget_overshoot" | "capture_refused" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null | undefined;
3751
4433
  work_state?: {
3752
4434
  state: "completed" | "incomplete" | "needs_input" | "unverified";
3753
4435
  source: "absent" | "constrained" | "validated";
@@ -3988,7 +4670,7 @@ export declare const ControlRunDetail: z.ZodObject<{
3988
4670
  checks: z.ZodDefault<z.ZodEnum<["passed", "failed", "not_configured"]>>;
3989
4671
  review: z.ZodDefault<z.ZodEnum<["approved", "blocked", "not_run"]>>;
3990
4672
  review_requested: z.ZodOptional<z.ZodBoolean>;
3991
- 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", "host_cancelled", "owner_task_gone", "crash_interrupted", "workspace_unavailable", "input_required", "work_incomplete", "context_capacity_exhausted", "work_report_contract"]>>>;
4673
+ 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", "host_cancelled", "owner_task_gone", "crash_interrupted", "workspace_unavailable", "capture_refused", "input_required", "work_incomplete", "context_capacity_exhausted", "work_report_contract"]>>>;
3992
4674
  work_state: z.ZodOptional<z.ZodObject<{
3993
4675
  state: z.ZodEnum<["completed", "needs_input", "incomplete", "unverified"]>;
3994
4676
  source: z.ZodEnum<["constrained", "validated", "absent"]>;
@@ -4031,7 +4713,7 @@ export declare const ControlRunDetail: z.ZodObject<{
4031
4713
  checks: "failed" | "not_configured" | "passed";
4032
4714
  review: "approved" | "blocked" | "not_run";
4033
4715
  review_requested?: boolean | undefined;
4034
- reason: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null;
4716
+ reason: "budget_exhausted" | "budget_overshoot" | "capture_refused" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null;
4035
4717
  work_state?: {
4036
4718
  state: "completed" | "incomplete" | "needs_input" | "unverified";
4037
4719
  source: "absent" | "constrained" | "validated";
@@ -4048,7 +4730,7 @@ export declare const ControlRunDetail: z.ZodObject<{
4048
4730
  checks?: "failed" | "not_configured" | "passed" | undefined;
4049
4731
  review?: "approved" | "blocked" | "not_run" | undefined;
4050
4732
  review_requested?: boolean | undefined;
4051
- reason?: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null | undefined;
4733
+ reason?: "budget_exhausted" | "budget_overshoot" | "capture_refused" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null | undefined;
4052
4734
  work_state?: {
4053
4735
  state: "completed" | "incomplete" | "needs_input" | "unverified";
4054
4736
  source: "absent" | "constrained" | "validated";
@@ -4168,7 +4850,7 @@ export declare const ControlRunDetail: z.ZodObject<{
4168
4850
  checks: "failed" | "not_configured" | "passed";
4169
4851
  review: "approved" | "blocked" | "not_run";
4170
4852
  review_requested?: boolean | undefined;
4171
- reason: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null;
4853
+ reason: "budget_exhausted" | "budget_overshoot" | "capture_refused" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null;
4172
4854
  work_state?: {
4173
4855
  state: "completed" | "incomplete" | "needs_input" | "unverified";
4174
4856
  source: "absent" | "constrained" | "validated";
@@ -4228,7 +4910,7 @@ export declare const ControlRunDetail: z.ZodObject<{
4228
4910
  checks?: "failed" | "not_configured" | "passed" | undefined;
4229
4911
  review?: "approved" | "blocked" | "not_run" | undefined;
4230
4912
  review_requested?: boolean | undefined;
4231
- reason?: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null | undefined;
4913
+ reason?: "budget_exhausted" | "budget_overshoot" | "capture_refused" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null | undefined;
4232
4914
  work_state?: {
4233
4915
  state: "completed" | "incomplete" | "needs_input" | "unverified";
4234
4916
  source: "absent" | "constrained" | "validated";
@@ -4862,13 +5544,54 @@ export declare const ControlRunDetail: z.ZodObject<{
4862
5544
  source: "grok_init";
4863
5545
  reported_source: string;
4864
5546
  }>]>>;
5547
+ rawContextShortfall: z.ZodOptional<z.ZodObject<{
5548
+ model: z.ZodString;
5549
+ context_window: z.ZodNumber;
5550
+ packet_tokens: z.ZodNumber;
5551
+ framing_tokens: z.ZodNumber;
5552
+ output_allowance_tokens: z.ZodNumber;
5553
+ mandatory_files: z.ZodArray<z.ZodObject<{
5554
+ path: z.ZodString;
5555
+ estimated_tokens: z.ZodNumber;
5556
+ }, "strict", z.ZodTypeAny, {
5557
+ path: string;
5558
+ estimated_tokens: number;
5559
+ }, {
5560
+ path: string;
5561
+ estimated_tokens: number;
5562
+ }>, "many">;
5563
+ }, "strict", z.ZodTypeAny, {
5564
+ model: string;
5565
+ context_window: number;
5566
+ packet_tokens: number;
5567
+ framing_tokens: number;
5568
+ output_allowance_tokens: number;
5569
+ mandatory_files: {
5570
+ path: string;
5571
+ estimated_tokens: number;
5572
+ }[];
5573
+ }, {
5574
+ model: string;
5575
+ context_window: number;
5576
+ packet_tokens: number;
5577
+ framing_tokens: number;
5578
+ output_allowance_tokens: number;
5579
+ mandatory_files: {
5580
+ path: string;
5581
+ estimated_tokens: number;
5582
+ }[];
5583
+ }>>;
4865
5584
  captureFailure: z.ZodOptional<z.ZodObject<{
4866
- code: z.ZodEnum<["capture_output_exceeded", "capture_output_incomplete", "capture_preview_truncated", "capture_failed"]>;
5585
+ code: z.ZodEnum<["capture_output_exceeded", "capture_output_incomplete", "capture_preview_truncated", "capture_space_insufficient", "capture_git_stalled", "capture_git_signal", "capture_read_failed", "capture_object_missing", "capture_failed"]>;
4867
5586
  message: z.ZodString;
4868
5587
  causeCode: z.ZodOptional<z.ZodString>;
4869
5588
  bufferBudgetBytes: z.ZodOptional<z.ZodNumber>;
4870
5589
  stream: z.ZodOptional<z.ZodEnum<["stdout", "stderr"]>>;
4871
5590
  drain: z.ZodOptional<z.ZodLiteral<"truncated">>;
5591
+ requiredBytes: z.ZodOptional<z.ZodNumber>;
5592
+ availableBytes: z.ZodOptional<z.ZodNumber>;
5593
+ signal: z.ZodOptional<z.ZodString>;
5594
+ stallMs: z.ZodOptional<z.ZodNumber>;
4872
5595
  cleanup: z.ZodOptional<z.ZodObject<{
4873
5596
  code: z.ZodNullable<z.ZodString>;
4874
5597
  message: z.ZodString;
@@ -4879,32 +5602,91 @@ export declare const ControlRunDetail: z.ZodObject<{
4879
5602
  code: string | null;
4880
5603
  message: string;
4881
5604
  }>>;
5605
+ inventory: z.ZodOptional<z.ZodObject<{
5606
+ exact: z.ZodLiteral<false>;
5607
+ changedFiles: z.ZodNumber;
5608
+ largest: z.ZodArray<z.ZodObject<{
5609
+ path: z.ZodString;
5610
+ change: z.ZodEnum<["added", "modified", "deleted", "type_changed"]>;
5611
+ sizeBytes: z.ZodNullable<z.ZodNumber>;
5612
+ }, "strip", z.ZodTypeAny, {
5613
+ path: string;
5614
+ change: "added" | "deleted" | "modified" | "type_changed";
5615
+ sizeBytes: number | null;
5616
+ }, {
5617
+ path: string;
5618
+ change: "added" | "deleted" | "modified" | "type_changed";
5619
+ sizeBytes: number | null;
5620
+ }>, "many">;
5621
+ }, "strip", z.ZodTypeAny, {
5622
+ exact: false;
5623
+ changedFiles: number;
5624
+ largest: {
5625
+ path: string;
5626
+ change: "added" | "deleted" | "modified" | "type_changed";
5627
+ sizeBytes: number | null;
5628
+ }[];
5629
+ }, {
5630
+ exact: false;
5631
+ changedFiles: number;
5632
+ largest: {
5633
+ path: string;
5634
+ change: "added" | "deleted" | "modified" | "type_changed";
5635
+ sizeBytes: number | null;
5636
+ }[];
5637
+ }>>;
4882
5638
  }, "strip", z.ZodTypeAny, {
4883
- code: "capture_failed" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated";
5639
+ code: "capture_failed" | "capture_git_signal" | "capture_git_stalled" | "capture_object_missing" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated" | "capture_read_failed" | "capture_space_insufficient";
4884
5640
  message: string;
4885
5641
  causeCode?: string | undefined;
4886
5642
  bufferBudgetBytes?: number | undefined;
4887
5643
  stream?: "stderr" | "stdout" | undefined;
4888
5644
  drain?: "truncated" | undefined;
5645
+ requiredBytes?: number | undefined;
5646
+ availableBytes?: number | undefined;
5647
+ signal?: string | undefined;
5648
+ stallMs?: number | undefined;
4889
5649
  cleanup?: {
4890
5650
  code: string | null;
4891
5651
  message: string;
4892
5652
  } | undefined;
5653
+ inventory?: {
5654
+ exact: false;
5655
+ changedFiles: number;
5656
+ largest: {
5657
+ path: string;
5658
+ change: "added" | "deleted" | "modified" | "type_changed";
5659
+ sizeBytes: number | null;
5660
+ }[];
5661
+ } | undefined;
4893
5662
  }, {
4894
- code: "capture_failed" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated";
5663
+ code: "capture_failed" | "capture_git_signal" | "capture_git_stalled" | "capture_object_missing" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated" | "capture_read_failed" | "capture_space_insufficient";
4895
5664
  message: string;
4896
5665
  causeCode?: string | undefined;
4897
5666
  bufferBudgetBytes?: number | undefined;
4898
5667
  stream?: "stderr" | "stdout" | undefined;
4899
5668
  drain?: "truncated" | undefined;
5669
+ requiredBytes?: number | undefined;
5670
+ availableBytes?: number | undefined;
5671
+ signal?: string | undefined;
5672
+ stallMs?: number | undefined;
4900
5673
  cleanup?: {
4901
5674
  code: string | null;
4902
5675
  message: string;
4903
5676
  } | undefined;
5677
+ inventory?: {
5678
+ exact: false;
5679
+ changedFiles: number;
5680
+ largest: {
5681
+ path: string;
5682
+ change: "added" | "deleted" | "modified" | "type_changed";
5683
+ sizeBytes: number | null;
5684
+ }[];
5685
+ } | undefined;
4904
5686
  }>>;
4905
5687
  phase: z.ZodDefault<z.ZodString>;
4906
5688
  category: z.ZodDefault<z.ZodEnum<["validation", "project", "auth", "harness_unavailable", "harness_error", "config_error", "budget", "policy", "cancelled", "internal", "unknown"]>>;
4907
- code: z.ZodDefault<z.ZodNullable<z.ZodEnum<["finite_zero", "hard_cap", "estimate_headroom", "unknown_paid_in_flight", "budget_overshoot", "cost_unverifiable", "delegation_child_drain_timeout", "subscription_window_exhausted", "credential_pool_exhausted", "input_too_large", "vendor_cli_too_old", "credential_source_unconfirmed", "delegated_home_unavailable", "delegated_confinement_unavailable", "delegated_evidence_incomplete", "access_profile_incompatible", "auxiliary_writable_roots_unsupported", "retired_access_profile"]>>>;
5689
+ code: z.ZodDefault<z.ZodNullable<z.ZodEnum<["finite_zero", "hard_cap", "estimate_headroom", "unknown_paid_in_flight", "budget_overshoot", "cost_unverifiable", "delegation_child_drain_timeout", "subscription_window_exhausted", "credential_pool_exhausted", "input_too_large", "raw_context_mandatory_unavailable", "raw_context_exceeds_window", "model_catalog_unavailable", "vendor_cli_too_old", "credential_source_unconfirmed", "delegated_home_unavailable", "delegated_confinement_unavailable", "delegated_evidence_incomplete", "access_profile_incompatible", "auxiliary_writable_roots_unsupported", "retired_access_profile"]>>>;
4908
5690
  harnessId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
4909
5691
  attemptId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
4910
5692
  safeMessage: z.ZodString;
@@ -4913,6 +5695,22 @@ export declare const ControlRunDetail: z.ZodObject<{
4913
5695
  eventRefs: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
4914
5696
  runDir: z.ZodDefault<z.ZodNullable<z.ZodString>>;
4915
5697
  resetsAt: z.ZodDefault<z.ZodNullable<z.ZodString>>;
5698
+ quotaRefusal: z.ZodOptional<z.ZodObject<{
5699
+ basis: z.ZodEnum<["owner_reserve", "provider_window", "provider_cooldown"]>;
5700
+ constraintId: z.ZodNullable<z.ZodString>;
5701
+ usedRatio: z.ZodNullable<z.ZodNumber>;
5702
+ threshold: z.ZodNullable<z.ZodNumber>;
5703
+ }, "strip", z.ZodTypeAny, {
5704
+ basis: "owner_reserve" | "provider_cooldown" | "provider_window";
5705
+ constraintId: string | null;
5706
+ usedRatio: number | null;
5707
+ threshold: number | null;
5708
+ }, {
5709
+ basis: "owner_reserve" | "provider_cooldown" | "provider_window";
5710
+ constraintId: string | null;
5711
+ usedRatio: number | null;
5712
+ threshold: number | null;
5713
+ }>>;
4916
5714
  vendorFailure: z.ZodDefault<z.ZodNullable<z.ZodObject<{
4917
5715
  code: z.ZodNullable<z.ZodString>;
4918
5716
  message: z.ZodNullable<z.ZodString>;
@@ -5005,21 +5803,45 @@ export declare const ControlRunDetail: z.ZodObject<{
5005
5803
  source: "grok_init";
5006
5804
  reported_source: string;
5007
5805
  } | undefined;
5806
+ rawContextShortfall?: {
5807
+ model: string;
5808
+ context_window: number;
5809
+ packet_tokens: number;
5810
+ framing_tokens: number;
5811
+ output_allowance_tokens: number;
5812
+ mandatory_files: {
5813
+ path: string;
5814
+ estimated_tokens: number;
5815
+ }[];
5816
+ } | undefined;
5008
5817
  captureFailure?: {
5009
- code: "capture_failed" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated";
5818
+ code: "capture_failed" | "capture_git_signal" | "capture_git_stalled" | "capture_object_missing" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated" | "capture_read_failed" | "capture_space_insufficient";
5010
5819
  message: string;
5011
5820
  causeCode?: string | undefined;
5012
5821
  bufferBudgetBytes?: number | undefined;
5013
5822
  stream?: "stderr" | "stdout" | undefined;
5014
5823
  drain?: "truncated" | undefined;
5824
+ requiredBytes?: number | undefined;
5825
+ availableBytes?: number | undefined;
5826
+ signal?: string | undefined;
5827
+ stallMs?: number | undefined;
5015
5828
  cleanup?: {
5016
5829
  code: string | null;
5017
5830
  message: string;
5018
5831
  } | undefined;
5832
+ inventory?: {
5833
+ exact: false;
5834
+ changedFiles: number;
5835
+ largest: {
5836
+ path: string;
5837
+ change: "added" | "deleted" | "modified" | "type_changed";
5838
+ sizeBytes: number | null;
5839
+ }[];
5840
+ } | undefined;
5019
5841
  } | undefined;
5020
5842
  phase: string;
5021
5843
  category: "auth" | "budget" | "cancelled" | "config_error" | "harness_error" | "harness_unavailable" | "internal" | "policy" | "project" | "unknown" | "validation";
5022
- code: "access_profile_incompatible" | "auxiliary_writable_roots_unsupported" | "budget_overshoot" | "cost_unverifiable" | "credential_pool_exhausted" | "credential_source_unconfirmed" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "input_too_large" | "retired_access_profile" | "subscription_window_exhausted" | "unknown_paid_in_flight" | "vendor_cli_too_old" | null;
5844
+ code: "access_profile_incompatible" | "auxiliary_writable_roots_unsupported" | "budget_overshoot" | "cost_unverifiable" | "credential_pool_exhausted" | "credential_source_unconfirmed" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "input_too_large" | "model_catalog_unavailable" | "raw_context_exceeds_window" | "raw_context_mandatory_unavailable" | "retired_access_profile" | "subscription_window_exhausted" | "unknown_paid_in_flight" | "vendor_cli_too_old" | null;
5023
5845
  harnessId: string | null;
5024
5846
  attemptId: string | null;
5025
5847
  safeMessage: string;
@@ -5028,6 +5850,12 @@ export declare const ControlRunDetail: z.ZodObject<{
5028
5850
  eventRefs: string[];
5029
5851
  runDir: string | null;
5030
5852
  resetsAt: string | null;
5853
+ quotaRefusal?: {
5854
+ basis: "owner_reserve" | "provider_cooldown" | "provider_window";
5855
+ constraintId: string | null;
5856
+ usedRatio: number | null;
5857
+ threshold: number | null;
5858
+ } | undefined;
5031
5859
  vendorFailure: {
5032
5860
  code: string | null;
5033
5861
  message: string | null;
@@ -5072,21 +5900,45 @@ export declare const ControlRunDetail: z.ZodObject<{
5072
5900
  source: "grok_init";
5073
5901
  reported_source: string;
5074
5902
  } | undefined;
5903
+ rawContextShortfall?: {
5904
+ model: string;
5905
+ context_window: number;
5906
+ packet_tokens: number;
5907
+ framing_tokens: number;
5908
+ output_allowance_tokens: number;
5909
+ mandatory_files: {
5910
+ path: string;
5911
+ estimated_tokens: number;
5912
+ }[];
5913
+ } | undefined;
5075
5914
  captureFailure?: {
5076
- code: "capture_failed" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated";
5915
+ code: "capture_failed" | "capture_git_signal" | "capture_git_stalled" | "capture_object_missing" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated" | "capture_read_failed" | "capture_space_insufficient";
5077
5916
  message: string;
5078
5917
  causeCode?: string | undefined;
5079
5918
  bufferBudgetBytes?: number | undefined;
5080
5919
  stream?: "stderr" | "stdout" | undefined;
5081
5920
  drain?: "truncated" | undefined;
5921
+ requiredBytes?: number | undefined;
5922
+ availableBytes?: number | undefined;
5923
+ signal?: string | undefined;
5924
+ stallMs?: number | undefined;
5082
5925
  cleanup?: {
5083
5926
  code: string | null;
5084
5927
  message: string;
5085
5928
  } | undefined;
5929
+ inventory?: {
5930
+ exact: false;
5931
+ changedFiles: number;
5932
+ largest: {
5933
+ path: string;
5934
+ change: "added" | "deleted" | "modified" | "type_changed";
5935
+ sizeBytes: number | null;
5936
+ }[];
5937
+ } | undefined;
5086
5938
  } | undefined;
5087
5939
  phase?: string | undefined;
5088
5940
  category?: "auth" | "budget" | "cancelled" | "config_error" | "harness_error" | "harness_unavailable" | "internal" | "policy" | "project" | "unknown" | "validation" | undefined;
5089
- code?: "access_profile_incompatible" | "auxiliary_writable_roots_unsupported" | "budget_overshoot" | "cost_unverifiable" | "credential_pool_exhausted" | "credential_source_unconfirmed" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "input_too_large" | "retired_access_profile" | "subscription_window_exhausted" | "unknown_paid_in_flight" | "vendor_cli_too_old" | null | undefined;
5941
+ code?: "access_profile_incompatible" | "auxiliary_writable_roots_unsupported" | "budget_overshoot" | "cost_unverifiable" | "credential_pool_exhausted" | "credential_source_unconfirmed" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "input_too_large" | "model_catalog_unavailable" | "raw_context_exceeds_window" | "raw_context_mandatory_unavailable" | "retired_access_profile" | "subscription_window_exhausted" | "unknown_paid_in_flight" | "vendor_cli_too_old" | null | undefined;
5090
5942
  harnessId?: string | null | undefined;
5091
5943
  attemptId?: string | null | undefined;
5092
5944
  safeMessage: string;
@@ -5095,6 +5947,12 @@ export declare const ControlRunDetail: z.ZodObject<{
5095
5947
  eventRefs?: string[] | undefined;
5096
5948
  runDir?: string | null | undefined;
5097
5949
  resetsAt?: string | null | undefined;
5950
+ quotaRefusal?: {
5951
+ basis: "owner_reserve" | "provider_cooldown" | "provider_window";
5952
+ constraintId: string | null;
5953
+ usedRatio: number | null;
5954
+ threshold: number | null;
5955
+ } | undefined;
5098
5956
  vendorFailure?: {
5099
5957
  code: string | null;
5100
5958
  message: string | null;
@@ -5213,6 +6071,7 @@ export declare const ControlRunDetail: z.ZodObject<{
5213
6071
  modelMismatch: boolean | null;
5214
6072
  identityCheck: "matched_before_effects" | "mismatch_after_possible_effects" | "mismatch_before_effects" | "not_applicable";
5215
6073
  inputDelivery: "confirmed" | "not_applicable" | "uncertain";
6074
+ sourceRetirement?: "not_confirmed" | "retired" | undefined;
5216
6075
  }[] | undefined;
5217
6076
  retainedEnvelope: {
5218
6077
  root: string;
@@ -5245,21 +6104,45 @@ export declare const ControlRunDetail: z.ZodObject<{
5245
6104
  source: "grok_init";
5246
6105
  reported_source: string;
5247
6106
  } | undefined;
6107
+ rawContextShortfall?: {
6108
+ model: string;
6109
+ context_window: number;
6110
+ packet_tokens: number;
6111
+ framing_tokens: number;
6112
+ output_allowance_tokens: number;
6113
+ mandatory_files: {
6114
+ path: string;
6115
+ estimated_tokens: number;
6116
+ }[];
6117
+ } | undefined;
5248
6118
  captureFailure?: {
5249
- code: "capture_failed" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated";
6119
+ code: "capture_failed" | "capture_git_signal" | "capture_git_stalled" | "capture_object_missing" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated" | "capture_read_failed" | "capture_space_insufficient";
5250
6120
  message: string;
5251
6121
  causeCode?: string | undefined;
5252
6122
  bufferBudgetBytes?: number | undefined;
5253
6123
  stream?: "stderr" | "stdout" | undefined;
5254
6124
  drain?: "truncated" | undefined;
6125
+ requiredBytes?: number | undefined;
6126
+ availableBytes?: number | undefined;
6127
+ signal?: string | undefined;
6128
+ stallMs?: number | undefined;
5255
6129
  cleanup?: {
5256
6130
  code: string | null;
5257
6131
  message: string;
5258
6132
  } | undefined;
6133
+ inventory?: {
6134
+ exact: false;
6135
+ changedFiles: number;
6136
+ largest: {
6137
+ path: string;
6138
+ change: "added" | "deleted" | "modified" | "type_changed";
6139
+ sizeBytes: number | null;
6140
+ }[];
6141
+ } | undefined;
5259
6142
  } | undefined;
5260
6143
  phase: string;
5261
6144
  category: "auth" | "budget" | "cancelled" | "config_error" | "harness_error" | "harness_unavailable" | "internal" | "policy" | "project" | "unknown" | "validation";
5262
- code: "access_profile_incompatible" | "auxiliary_writable_roots_unsupported" | "budget_overshoot" | "cost_unverifiable" | "credential_pool_exhausted" | "credential_source_unconfirmed" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "input_too_large" | "retired_access_profile" | "subscription_window_exhausted" | "unknown_paid_in_flight" | "vendor_cli_too_old" | null;
6145
+ code: "access_profile_incompatible" | "auxiliary_writable_roots_unsupported" | "budget_overshoot" | "cost_unverifiable" | "credential_pool_exhausted" | "credential_source_unconfirmed" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "input_too_large" | "model_catalog_unavailable" | "raw_context_exceeds_window" | "raw_context_mandatory_unavailable" | "retired_access_profile" | "subscription_window_exhausted" | "unknown_paid_in_flight" | "vendor_cli_too_old" | null;
5263
6146
  harnessId: string | null;
5264
6147
  attemptId: string | null;
5265
6148
  safeMessage: string;
@@ -5268,6 +6151,12 @@ export declare const ControlRunDetail: z.ZodObject<{
5268
6151
  eventRefs: string[];
5269
6152
  runDir: string | null;
5270
6153
  resetsAt: string | null;
6154
+ quotaRefusal?: {
6155
+ basis: "owner_reserve" | "provider_cooldown" | "provider_window";
6156
+ constraintId: string | null;
6157
+ usedRatio: number | null;
6158
+ threshold: number | null;
6159
+ } | undefined;
5271
6160
  vendorFailure: {
5272
6161
  code: string | null;
5273
6162
  message: string | null;
@@ -5401,7 +6290,7 @@ export declare const ControlRunDetail: z.ZodObject<{
5401
6290
  checks: "failed" | "not_configured" | "passed";
5402
6291
  review: "approved" | "blocked" | "not_run";
5403
6292
  review_requested?: boolean | undefined;
5404
- reason: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null;
6293
+ reason: "budget_exhausted" | "budget_overshoot" | "capture_refused" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null;
5405
6294
  work_state?: {
5406
6295
  state: "completed" | "incomplete" | "needs_input" | "unverified";
5407
6296
  source: "absent" | "constrained" | "validated";
@@ -5441,6 +6330,22 @@ export declare const ControlRunDetail: z.ZodObject<{
5441
6330
  eligible: boolean;
5442
6331
  }[];
5443
6332
  } | null;
6333
+ rawContext: {
6334
+ model: string;
6335
+ estimated_request_tokens: number;
6336
+ budget: {
6337
+ estimator: "chars_div_4";
6338
+ basis: "assumed_ceiling" | "model_context_window";
6339
+ model: string | null;
6340
+ context_window: number | null;
6341
+ output_allowance_tokens: number | null;
6342
+ framing_tokens: number | null;
6343
+ selection_limit_tokens: number;
6344
+ estimated_packet_tokens: number;
6345
+ omitted_for_budget: number;
6346
+ mandatory_paths: string[];
6347
+ };
6348
+ } | null;
5444
6349
  tests?: {
5445
6350
  program: string;
5446
6351
  args: string[];
@@ -5523,6 +6428,7 @@ export declare const ControlRunDetail: z.ZodObject<{
5523
6428
  modelMismatch: boolean | null;
5524
6429
  identityCheck: "matched_before_effects" | "mismatch_after_possible_effects" | "mismatch_before_effects" | "not_applicable";
5525
6430
  inputDelivery: "confirmed" | "not_applicable" | "uncertain";
6431
+ sourceRetirement?: "not_confirmed" | "retired" | undefined;
5526
6432
  }[] | undefined;
5527
6433
  retainedEnvelope: {
5528
6434
  root: string;
@@ -5555,21 +6461,45 @@ export declare const ControlRunDetail: z.ZodObject<{
5555
6461
  source: "grok_init";
5556
6462
  reported_source: string;
5557
6463
  } | undefined;
6464
+ rawContextShortfall?: {
6465
+ model: string;
6466
+ context_window: number;
6467
+ packet_tokens: number;
6468
+ framing_tokens: number;
6469
+ output_allowance_tokens: number;
6470
+ mandatory_files: {
6471
+ path: string;
6472
+ estimated_tokens: number;
6473
+ }[];
6474
+ } | undefined;
5558
6475
  captureFailure?: {
5559
- code: "capture_failed" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated";
6476
+ code: "capture_failed" | "capture_git_signal" | "capture_git_stalled" | "capture_object_missing" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated" | "capture_read_failed" | "capture_space_insufficient";
5560
6477
  message: string;
5561
6478
  causeCode?: string | undefined;
5562
6479
  bufferBudgetBytes?: number | undefined;
5563
6480
  stream?: "stderr" | "stdout" | undefined;
5564
6481
  drain?: "truncated" | undefined;
6482
+ requiredBytes?: number | undefined;
6483
+ availableBytes?: number | undefined;
6484
+ signal?: string | undefined;
6485
+ stallMs?: number | undefined;
5565
6486
  cleanup?: {
5566
6487
  code: string | null;
5567
6488
  message: string;
5568
6489
  } | undefined;
6490
+ inventory?: {
6491
+ exact: false;
6492
+ changedFiles: number;
6493
+ largest: {
6494
+ path: string;
6495
+ change: "added" | "deleted" | "modified" | "type_changed";
6496
+ sizeBytes: number | null;
6497
+ }[];
6498
+ } | undefined;
5569
6499
  } | undefined;
5570
6500
  phase: string;
5571
6501
  category: "auth" | "budget" | "cancelled" | "config_error" | "harness_error" | "harness_unavailable" | "internal" | "policy" | "project" | "unknown" | "validation";
5572
- code: "access_profile_incompatible" | "auxiliary_writable_roots_unsupported" | "budget_overshoot" | "cost_unverifiable" | "credential_pool_exhausted" | "credential_source_unconfirmed" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "input_too_large" | "retired_access_profile" | "subscription_window_exhausted" | "unknown_paid_in_flight" | "vendor_cli_too_old" | null;
6502
+ code: "access_profile_incompatible" | "auxiliary_writable_roots_unsupported" | "budget_overshoot" | "cost_unverifiable" | "credential_pool_exhausted" | "credential_source_unconfirmed" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "input_too_large" | "model_catalog_unavailable" | "raw_context_exceeds_window" | "raw_context_mandatory_unavailable" | "retired_access_profile" | "subscription_window_exhausted" | "unknown_paid_in_flight" | "vendor_cli_too_old" | null;
5573
6503
  harnessId: string | null;
5574
6504
  attemptId: string | null;
5575
6505
  safeMessage: string;
@@ -5578,6 +6508,12 @@ export declare const ControlRunDetail: z.ZodObject<{
5578
6508
  eventRefs: string[];
5579
6509
  runDir: string | null;
5580
6510
  resetsAt: string | null;
6511
+ quotaRefusal?: {
6512
+ basis: "owner_reserve" | "provider_cooldown" | "provider_window";
6513
+ constraintId: string | null;
6514
+ usedRatio: number | null;
6515
+ threshold: number | null;
6516
+ } | undefined;
5581
6517
  vendorFailure: {
5582
6518
  code: string | null;
5583
6519
  message: string | null;
@@ -5711,7 +6647,7 @@ export declare const ControlRunDetail: z.ZodObject<{
5711
6647
  checks: "failed" | "not_configured" | "passed";
5712
6648
  review: "approved" | "blocked" | "not_run";
5713
6649
  review_requested?: boolean | undefined;
5714
- reason: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null;
6650
+ reason: "budget_exhausted" | "budget_overshoot" | "capture_refused" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null;
5715
6651
  work_state?: {
5716
6652
  state: "completed" | "incomplete" | "needs_input" | "unverified";
5717
6653
  source: "absent" | "constrained" | "validated";
@@ -5751,6 +6687,22 @@ export declare const ControlRunDetail: z.ZodObject<{
5751
6687
  eligible: boolean;
5752
6688
  }[];
5753
6689
  } | null;
6690
+ rawContext: {
6691
+ model: string;
6692
+ estimated_request_tokens: number;
6693
+ budget: {
6694
+ estimator: "chars_div_4";
6695
+ basis: "assumed_ceiling" | "model_context_window";
6696
+ model: string | null;
6697
+ context_window: number | null;
6698
+ output_allowance_tokens: number | null;
6699
+ framing_tokens: number | null;
6700
+ selection_limit_tokens: number;
6701
+ estimated_packet_tokens: number;
6702
+ omitted_for_budget: number;
6703
+ mandatory_paths: string[];
6704
+ };
6705
+ } | null;
5754
6706
  tests?: {
5755
6707
  program: string;
5756
6708
  args: string[];
@@ -5772,7 +6724,7 @@ export declare const ControlRunDetail: z.ZodObject<{
5772
6724
  checks: "failed" | "not_configured" | "passed";
5773
6725
  review: "approved" | "blocked" | "not_run";
5774
6726
  review_requested?: boolean | undefined;
5775
- reason: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null;
6727
+ reason: "budget_exhausted" | "budget_overshoot" | "capture_refused" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null;
5776
6728
  work_state?: {
5777
6729
  state: "completed" | "incomplete" | "needs_input" | "unverified";
5778
6730
  source: "absent" | "constrained" | "validated";
@@ -5897,7 +6849,7 @@ export declare const ControlRunDetail: z.ZodObject<{
5897
6849
  checks: "failed" | "not_configured" | "passed";
5898
6850
  review: "approved" | "blocked" | "not_run";
5899
6851
  review_requested?: boolean | undefined;
5900
- reason: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null;
6852
+ reason: "budget_exhausted" | "budget_overshoot" | "capture_refused" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null;
5901
6853
  work_state?: {
5902
6854
  state: "completed" | "incomplete" | "needs_input" | "unverified";
5903
6855
  source: "absent" | "constrained" | "validated";
@@ -6101,21 +7053,45 @@ export declare const ControlRunDetail: z.ZodObject<{
6101
7053
  source: "grok_init";
6102
7054
  reported_source: string;
6103
7055
  } | undefined;
7056
+ rawContextShortfall?: {
7057
+ model: string;
7058
+ context_window: number;
7059
+ packet_tokens: number;
7060
+ framing_tokens: number;
7061
+ output_allowance_tokens: number;
7062
+ mandatory_files: {
7063
+ path: string;
7064
+ estimated_tokens: number;
7065
+ }[];
7066
+ } | undefined;
6104
7067
  captureFailure?: {
6105
- code: "capture_failed" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated";
7068
+ code: "capture_failed" | "capture_git_signal" | "capture_git_stalled" | "capture_object_missing" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated" | "capture_read_failed" | "capture_space_insufficient";
6106
7069
  message: string;
6107
7070
  causeCode?: string | undefined;
6108
7071
  bufferBudgetBytes?: number | undefined;
6109
7072
  stream?: "stderr" | "stdout" | undefined;
6110
7073
  drain?: "truncated" | undefined;
7074
+ requiredBytes?: number | undefined;
7075
+ availableBytes?: number | undefined;
7076
+ signal?: string | undefined;
7077
+ stallMs?: number | undefined;
6111
7078
  cleanup?: {
6112
7079
  code: string | null;
6113
7080
  message: string;
6114
7081
  } | undefined;
7082
+ inventory?: {
7083
+ exact: false;
7084
+ changedFiles: number;
7085
+ largest: {
7086
+ path: string;
7087
+ change: "added" | "deleted" | "modified" | "type_changed";
7088
+ sizeBytes: number | null;
7089
+ }[];
7090
+ } | undefined;
6115
7091
  } | undefined;
6116
7092
  phase: string;
6117
7093
  category: "auth" | "budget" | "cancelled" | "config_error" | "harness_error" | "harness_unavailable" | "internal" | "policy" | "project" | "unknown" | "validation";
6118
- code: "access_profile_incompatible" | "auxiliary_writable_roots_unsupported" | "budget_overshoot" | "cost_unverifiable" | "credential_pool_exhausted" | "credential_source_unconfirmed" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "input_too_large" | "retired_access_profile" | "subscription_window_exhausted" | "unknown_paid_in_flight" | "vendor_cli_too_old" | null;
7094
+ code: "access_profile_incompatible" | "auxiliary_writable_roots_unsupported" | "budget_overshoot" | "cost_unverifiable" | "credential_pool_exhausted" | "credential_source_unconfirmed" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "input_too_large" | "model_catalog_unavailable" | "raw_context_exceeds_window" | "raw_context_mandatory_unavailable" | "retired_access_profile" | "subscription_window_exhausted" | "unknown_paid_in_flight" | "vendor_cli_too_old" | null;
6119
7095
  harnessId: string | null;
6120
7096
  attemptId: string | null;
6121
7097
  safeMessage: string;
@@ -6124,6 +7100,12 @@ export declare const ControlRunDetail: z.ZodObject<{
6124
7100
  eventRefs: string[];
6125
7101
  runDir: string | null;
6126
7102
  resetsAt: string | null;
7103
+ quotaRefusal?: {
7104
+ basis: "owner_reserve" | "provider_cooldown" | "provider_window";
7105
+ constraintId: string | null;
7106
+ usedRatio: number | null;
7107
+ threshold: number | null;
7108
+ } | undefined;
6127
7109
  vendorFailure: {
6128
7110
  code: string | null;
6129
7111
  message: string | null;
@@ -6230,6 +7212,7 @@ export declare const ControlRunDetail: z.ZodObject<{
6230
7212
  modelMismatch: boolean | null;
6231
7213
  identityCheck: "matched_before_effects" | "mismatch_after_possible_effects" | "mismatch_before_effects" | "not_applicable";
6232
7214
  inputDelivery: "confirmed" | "not_applicable" | "uncertain";
7215
+ sourceRetirement?: "not_confirmed" | "retired" | undefined;
6233
7216
  }[] | undefined;
6234
7217
  retainedEnvelope?: {
6235
7218
  root: string;
@@ -6262,21 +7245,45 @@ export declare const ControlRunDetail: z.ZodObject<{
6262
7245
  source: "grok_init";
6263
7246
  reported_source: string;
6264
7247
  } | undefined;
7248
+ rawContextShortfall?: {
7249
+ model: string;
7250
+ context_window: number;
7251
+ packet_tokens: number;
7252
+ framing_tokens: number;
7253
+ output_allowance_tokens: number;
7254
+ mandatory_files: {
7255
+ path: string;
7256
+ estimated_tokens: number;
7257
+ }[];
7258
+ } | undefined;
6265
7259
  captureFailure?: {
6266
- code: "capture_failed" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated";
7260
+ code: "capture_failed" | "capture_git_signal" | "capture_git_stalled" | "capture_object_missing" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated" | "capture_read_failed" | "capture_space_insufficient";
6267
7261
  message: string;
6268
7262
  causeCode?: string | undefined;
6269
7263
  bufferBudgetBytes?: number | undefined;
6270
7264
  stream?: "stderr" | "stdout" | undefined;
6271
7265
  drain?: "truncated" | undefined;
7266
+ requiredBytes?: number | undefined;
7267
+ availableBytes?: number | undefined;
7268
+ signal?: string | undefined;
7269
+ stallMs?: number | undefined;
6272
7270
  cleanup?: {
6273
7271
  code: string | null;
6274
7272
  message: string;
6275
7273
  } | undefined;
7274
+ inventory?: {
7275
+ exact: false;
7276
+ changedFiles: number;
7277
+ largest: {
7278
+ path: string;
7279
+ change: "added" | "deleted" | "modified" | "type_changed";
7280
+ sizeBytes: number | null;
7281
+ }[];
7282
+ } | undefined;
6276
7283
  } | undefined;
6277
7284
  phase?: string | undefined;
6278
7285
  category?: "auth" | "budget" | "cancelled" | "config_error" | "harness_error" | "harness_unavailable" | "internal" | "policy" | "project" | "unknown" | "validation" | undefined;
6279
- code?: "access_profile_incompatible" | "auxiliary_writable_roots_unsupported" | "budget_overshoot" | "cost_unverifiable" | "credential_pool_exhausted" | "credential_source_unconfirmed" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "input_too_large" | "retired_access_profile" | "subscription_window_exhausted" | "unknown_paid_in_flight" | "vendor_cli_too_old" | null | undefined;
7286
+ code?: "access_profile_incompatible" | "auxiliary_writable_roots_unsupported" | "budget_overshoot" | "cost_unverifiable" | "credential_pool_exhausted" | "credential_source_unconfirmed" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "input_too_large" | "model_catalog_unavailable" | "raw_context_exceeds_window" | "raw_context_mandatory_unavailable" | "retired_access_profile" | "subscription_window_exhausted" | "unknown_paid_in_flight" | "vendor_cli_too_old" | null | undefined;
6280
7287
  harnessId?: string | null | undefined;
6281
7288
  attemptId?: string | null | undefined;
6282
7289
  safeMessage: string;
@@ -6285,6 +7292,12 @@ export declare const ControlRunDetail: z.ZodObject<{
6285
7292
  eventRefs?: string[] | undefined;
6286
7293
  runDir?: string | null | undefined;
6287
7294
  resetsAt?: string | null | undefined;
7295
+ quotaRefusal?: {
7296
+ basis: "owner_reserve" | "provider_cooldown" | "provider_window";
7297
+ constraintId: string | null;
7298
+ usedRatio: number | null;
7299
+ threshold: number | null;
7300
+ } | undefined;
6288
7301
  vendorFailure?: {
6289
7302
  code: string | null;
6290
7303
  message: string | null;
@@ -6418,7 +7431,7 @@ export declare const ControlRunDetail: z.ZodObject<{
6418
7431
  checks?: "failed" | "not_configured" | "passed" | undefined;
6419
7432
  review?: "approved" | "blocked" | "not_run" | undefined;
6420
7433
  review_requested?: boolean | undefined;
6421
- reason?: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null | undefined;
7434
+ reason?: "budget_exhausted" | "budget_overshoot" | "capture_refused" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null | undefined;
6422
7435
  work_state?: {
6423
7436
  state: "completed" | "incomplete" | "needs_input" | "unverified";
6424
7437
  source: "absent" | "constrained" | "validated";
@@ -6458,6 +7471,22 @@ export declare const ControlRunDetail: z.ZodObject<{
6458
7471
  eligible: boolean;
6459
7472
  }[] | undefined;
6460
7473
  } | null | undefined;
7474
+ rawContext?: {
7475
+ model: string;
7476
+ estimated_request_tokens: number;
7477
+ budget: {
7478
+ estimator: "chars_div_4";
7479
+ basis: "assumed_ceiling" | "model_context_window";
7480
+ model: string | null;
7481
+ context_window: number | null;
7482
+ output_allowance_tokens: number | null;
7483
+ framing_tokens: number | null;
7484
+ selection_limit_tokens: number;
7485
+ estimated_packet_tokens: number;
7486
+ omitted_for_budget: number;
7487
+ mandatory_paths: string[];
7488
+ };
7489
+ } | null | undefined;
6461
7490
  tests?: {
6462
7491
  program: string;
6463
7492
  args?: string[] | undefined;
@@ -6540,6 +7569,7 @@ export declare const ControlRunDetail: z.ZodObject<{
6540
7569
  modelMismatch: boolean | null;
6541
7570
  identityCheck: "matched_before_effects" | "mismatch_after_possible_effects" | "mismatch_before_effects" | "not_applicable";
6542
7571
  inputDelivery: "confirmed" | "not_applicable" | "uncertain";
7572
+ sourceRetirement?: "not_confirmed" | "retired" | undefined;
6543
7573
  }[] | undefined;
6544
7574
  retainedEnvelope?: {
6545
7575
  root: string;
@@ -6572,21 +7602,45 @@ export declare const ControlRunDetail: z.ZodObject<{
6572
7602
  source: "grok_init";
6573
7603
  reported_source: string;
6574
7604
  } | undefined;
7605
+ rawContextShortfall?: {
7606
+ model: string;
7607
+ context_window: number;
7608
+ packet_tokens: number;
7609
+ framing_tokens: number;
7610
+ output_allowance_tokens: number;
7611
+ mandatory_files: {
7612
+ path: string;
7613
+ estimated_tokens: number;
7614
+ }[];
7615
+ } | undefined;
6575
7616
  captureFailure?: {
6576
- code: "capture_failed" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated";
7617
+ code: "capture_failed" | "capture_git_signal" | "capture_git_stalled" | "capture_object_missing" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated" | "capture_read_failed" | "capture_space_insufficient";
6577
7618
  message: string;
6578
7619
  causeCode?: string | undefined;
6579
7620
  bufferBudgetBytes?: number | undefined;
6580
7621
  stream?: "stderr" | "stdout" | undefined;
6581
7622
  drain?: "truncated" | undefined;
7623
+ requiredBytes?: number | undefined;
7624
+ availableBytes?: number | undefined;
7625
+ signal?: string | undefined;
7626
+ stallMs?: number | undefined;
6582
7627
  cleanup?: {
6583
7628
  code: string | null;
6584
7629
  message: string;
6585
7630
  } | undefined;
7631
+ inventory?: {
7632
+ exact: false;
7633
+ changedFiles: number;
7634
+ largest: {
7635
+ path: string;
7636
+ change: "added" | "deleted" | "modified" | "type_changed";
7637
+ sizeBytes: number | null;
7638
+ }[];
7639
+ } | undefined;
6586
7640
  } | undefined;
6587
7641
  phase?: string | undefined;
6588
7642
  category?: "auth" | "budget" | "cancelled" | "config_error" | "harness_error" | "harness_unavailable" | "internal" | "policy" | "project" | "unknown" | "validation" | undefined;
6589
- code?: "access_profile_incompatible" | "auxiliary_writable_roots_unsupported" | "budget_overshoot" | "cost_unverifiable" | "credential_pool_exhausted" | "credential_source_unconfirmed" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "input_too_large" | "retired_access_profile" | "subscription_window_exhausted" | "unknown_paid_in_flight" | "vendor_cli_too_old" | null | undefined;
7643
+ code?: "access_profile_incompatible" | "auxiliary_writable_roots_unsupported" | "budget_overshoot" | "cost_unverifiable" | "credential_pool_exhausted" | "credential_source_unconfirmed" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "input_too_large" | "model_catalog_unavailable" | "raw_context_exceeds_window" | "raw_context_mandatory_unavailable" | "retired_access_profile" | "subscription_window_exhausted" | "unknown_paid_in_flight" | "vendor_cli_too_old" | null | undefined;
6590
7644
  harnessId?: string | null | undefined;
6591
7645
  attemptId?: string | null | undefined;
6592
7646
  safeMessage: string;
@@ -6595,6 +7649,12 @@ export declare const ControlRunDetail: z.ZodObject<{
6595
7649
  eventRefs?: string[] | undefined;
6596
7650
  runDir?: string | null | undefined;
6597
7651
  resetsAt?: string | null | undefined;
7652
+ quotaRefusal?: {
7653
+ basis: "owner_reserve" | "provider_cooldown" | "provider_window";
7654
+ constraintId: string | null;
7655
+ usedRatio: number | null;
7656
+ threshold: number | null;
7657
+ } | undefined;
6598
7658
  vendorFailure?: {
6599
7659
  code: string | null;
6600
7660
  message: string | null;
@@ -6728,7 +7788,7 @@ export declare const ControlRunDetail: z.ZodObject<{
6728
7788
  checks?: "failed" | "not_configured" | "passed" | undefined;
6729
7789
  review?: "approved" | "blocked" | "not_run" | undefined;
6730
7790
  review_requested?: boolean | undefined;
6731
- reason?: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null | undefined;
7791
+ reason?: "budget_exhausted" | "budget_overshoot" | "capture_refused" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null | undefined;
6732
7792
  work_state?: {
6733
7793
  state: "completed" | "incomplete" | "needs_input" | "unverified";
6734
7794
  source: "absent" | "constrained" | "validated";
@@ -6768,6 +7828,22 @@ export declare const ControlRunDetail: z.ZodObject<{
6768
7828
  eligible: boolean;
6769
7829
  }[] | undefined;
6770
7830
  } | null | undefined;
7831
+ rawContext?: {
7832
+ model: string;
7833
+ estimated_request_tokens: number;
7834
+ budget: {
7835
+ estimator: "chars_div_4";
7836
+ basis: "assumed_ceiling" | "model_context_window";
7837
+ model: string | null;
7838
+ context_window: number | null;
7839
+ output_allowance_tokens: number | null;
7840
+ framing_tokens: number | null;
7841
+ selection_limit_tokens: number;
7842
+ estimated_packet_tokens: number;
7843
+ omitted_for_budget: number;
7844
+ mandatory_paths: string[];
7845
+ };
7846
+ } | null | undefined;
6771
7847
  tests?: {
6772
7848
  program: string;
6773
7849
  args?: string[] | undefined;
@@ -6789,7 +7865,7 @@ export declare const ControlRunDetail: z.ZodObject<{
6789
7865
  checks?: "failed" | "not_configured" | "passed" | undefined;
6790
7866
  review?: "approved" | "blocked" | "not_run" | undefined;
6791
7867
  review_requested?: boolean | undefined;
6792
- reason?: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null | undefined;
7868
+ reason?: "budget_exhausted" | "budget_overshoot" | "capture_refused" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null | undefined;
6793
7869
  work_state?: {
6794
7870
  state: "completed" | "incomplete" | "needs_input" | "unverified";
6795
7871
  source: "absent" | "constrained" | "validated";
@@ -6914,7 +7990,7 @@ export declare const ControlRunDetail: z.ZodObject<{
6914
7990
  checks?: "failed" | "not_configured" | "passed" | undefined;
6915
7991
  review?: "approved" | "blocked" | "not_run" | undefined;
6916
7992
  review_requested?: boolean | undefined;
6917
- reason?: "budget_exhausted" | "budget_overshoot" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null | undefined;
7993
+ reason?: "budget_exhausted" | "budget_overshoot" | "capture_refused" | "checks_failed" | "context_capacity_exhausted" | "cost_unverifiable" | "crash_interrupted" | "harness_failed" | "host_cancelled" | "input_required" | "no_changes" | "not_converged" | "owner_task_gone" | "review_blocked" | "stuck_no_progress" | "user_cancelled" | "wall_clock_exceeded" | "work_incomplete" | "work_report_contract" | "workspace_unavailable" | null | undefined;
6918
7994
  work_state?: {
6919
7995
  state: "completed" | "incomplete" | "needs_input" | "unverified";
6920
7996
  source: "absent" | "constrained" | "validated";
@@ -7118,21 +8194,45 @@ export declare const ControlRunDetail: z.ZodObject<{
7118
8194
  source: "grok_init";
7119
8195
  reported_source: string;
7120
8196
  } | undefined;
8197
+ rawContextShortfall?: {
8198
+ model: string;
8199
+ context_window: number;
8200
+ packet_tokens: number;
8201
+ framing_tokens: number;
8202
+ output_allowance_tokens: number;
8203
+ mandatory_files: {
8204
+ path: string;
8205
+ estimated_tokens: number;
8206
+ }[];
8207
+ } | undefined;
7121
8208
  captureFailure?: {
7122
- code: "capture_failed" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated";
8209
+ code: "capture_failed" | "capture_git_signal" | "capture_git_stalled" | "capture_object_missing" | "capture_output_exceeded" | "capture_output_incomplete" | "capture_preview_truncated" | "capture_read_failed" | "capture_space_insufficient";
7123
8210
  message: string;
7124
8211
  causeCode?: string | undefined;
7125
8212
  bufferBudgetBytes?: number | undefined;
7126
8213
  stream?: "stderr" | "stdout" | undefined;
7127
8214
  drain?: "truncated" | undefined;
8215
+ requiredBytes?: number | undefined;
8216
+ availableBytes?: number | undefined;
8217
+ signal?: string | undefined;
8218
+ stallMs?: number | undefined;
7128
8219
  cleanup?: {
7129
8220
  code: string | null;
7130
8221
  message: string;
7131
8222
  } | undefined;
8223
+ inventory?: {
8224
+ exact: false;
8225
+ changedFiles: number;
8226
+ largest: {
8227
+ path: string;
8228
+ change: "added" | "deleted" | "modified" | "type_changed";
8229
+ sizeBytes: number | null;
8230
+ }[];
8231
+ } | undefined;
7132
8232
  } | undefined;
7133
8233
  phase?: string | undefined;
7134
8234
  category?: "auth" | "budget" | "cancelled" | "config_error" | "harness_error" | "harness_unavailable" | "internal" | "policy" | "project" | "unknown" | "validation" | undefined;
7135
- code?: "access_profile_incompatible" | "auxiliary_writable_roots_unsupported" | "budget_overshoot" | "cost_unverifiable" | "credential_pool_exhausted" | "credential_source_unconfirmed" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "input_too_large" | "retired_access_profile" | "subscription_window_exhausted" | "unknown_paid_in_flight" | "vendor_cli_too_old" | null | undefined;
8235
+ code?: "access_profile_incompatible" | "auxiliary_writable_roots_unsupported" | "budget_overshoot" | "cost_unverifiable" | "credential_pool_exhausted" | "credential_source_unconfirmed" | "delegated_confinement_unavailable" | "delegated_evidence_incomplete" | "delegated_home_unavailable" | "delegation_child_drain_timeout" | "estimate_headroom" | "finite_zero" | "hard_cap" | "input_too_large" | "model_catalog_unavailable" | "raw_context_exceeds_window" | "raw_context_mandatory_unavailable" | "retired_access_profile" | "subscription_window_exhausted" | "unknown_paid_in_flight" | "vendor_cli_too_old" | null | undefined;
7136
8236
  harnessId?: string | null | undefined;
7137
8237
  attemptId?: string | null | undefined;
7138
8238
  safeMessage: string;
@@ -7141,6 +8241,12 @@ export declare const ControlRunDetail: z.ZodObject<{
7141
8241
  eventRefs?: string[] | undefined;
7142
8242
  runDir?: string | null | undefined;
7143
8243
  resetsAt?: string | null | undefined;
8244
+ quotaRefusal?: {
8245
+ basis: "owner_reserve" | "provider_cooldown" | "provider_window";
8246
+ constraintId: string | null;
8247
+ usedRatio: number | null;
8248
+ threshold: number | null;
8249
+ } | undefined;
7144
8250
  vendorFailure?: {
7145
8251
  code: string | null;
7146
8252
  message: string | null;