@claudexor/schema 1.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (248) hide show
  1. package/dist/agent-capabilities.d.ts +88 -16
  2. package/dist/agent-capabilities.d.ts.map +1 -1
  3. package/dist/agent-capabilities.js +49 -18
  4. package/dist/agent-capabilities.js.map +1 -1
  5. package/dist/apply-eligibility.d.ts.map +1 -1
  6. package/dist/apply-eligibility.js +22 -6
  7. package/dist/apply-eligibility.js.map +1 -1
  8. package/dist/attachment.d.ts +113 -48
  9. package/dist/attachment.d.ts.map +1 -1
  10. package/dist/attachment.js +60 -45
  11. package/dist/attachment.js.map +1 -1
  12. package/dist/auth.d.ts +1423 -0
  13. package/dist/auth.d.ts.map +1 -0
  14. package/dist/auth.js +317 -0
  15. package/dist/auth.js.map +1 -0
  16. package/dist/budget.d.ts +133 -16
  17. package/dist/budget.d.ts.map +1 -1
  18. package/dist/budget.js +65 -22
  19. package/dist/budget.js.map +1 -1
  20. package/dist/config.d.ts +449 -115
  21. package/dist/config.d.ts.map +1 -1
  22. package/dist/config.js +114 -41
  23. package/dist/config.js.map +1 -1
  24. package/dist/context.d.ts +6 -6
  25. package/dist/context.d.ts.map +1 -1
  26. package/dist/context.js +31 -7
  27. package/dist/context.js.map +1 -1
  28. package/dist/control-operation-responses.d.ts +1172 -0
  29. package/dist/control-operation-responses.d.ts.map +1 -0
  30. package/dist/control-operation-responses.js +35 -0
  31. package/dist/control-operation-responses.js.map +1 -0
  32. package/dist/control-run-detail.d.ts +443 -242
  33. package/dist/control-run-detail.d.ts.map +1 -1
  34. package/dist/control-run-detail.js +72 -17
  35. package/dist/control-run-detail.js.map +1 -1
  36. package/dist/control-run-retry.d.ts +88 -0
  37. package/dist/control-run-retry.d.ts.map +1 -0
  38. package/dist/control-run-retry.js +40 -0
  39. package/dist/control-run-retry.js.map +1 -0
  40. package/dist/control-run-scope.d.ts +25 -0
  41. package/dist/control-run-scope.d.ts.map +1 -0
  42. package/dist/control-run-scope.js +22 -0
  43. package/dist/control-run-scope.js.map +1 -0
  44. package/dist/control-secret.d.ts +90 -0
  45. package/dist/control-secret.d.ts.map +1 -0
  46. package/dist/control-secret.js +35 -0
  47. package/dist/control-secret.js.map +1 -0
  48. package/dist/control-spec.d.ts +592 -0
  49. package/dist/control-spec.d.ts.map +1 -0
  50. package/dist/control-spec.js +85 -0
  51. package/dist/control-spec.js.map +1 -0
  52. package/dist/control-thread-apply.d.ts +175 -0
  53. package/dist/control-thread-apply.d.ts.map +1 -0
  54. package/dist/control-thread-apply.js +31 -0
  55. package/dist/control-thread-apply.js.map +1 -0
  56. package/dist/control-trust.d.ts +74 -10
  57. package/dist/control-trust.d.ts.map +1 -1
  58. package/dist/control-trust.js +31 -11
  59. package/dist/control-trust.js.map +1 -1
  60. package/dist/control.d.ts +1391 -878
  61. package/dist/control.d.ts.map +1 -1
  62. package/dist/control.js +468 -310
  63. package/dist/control.js.map +1 -1
  64. package/dist/decision.d.ts +10 -10
  65. package/dist/decision.d.ts.map +1 -1
  66. package/dist/decision.js +62 -15
  67. package/dist/decision.js.map +1 -1
  68. package/dist/delivery.d.ts +99 -0
  69. package/dist/delivery.d.ts.map +1 -0
  70. package/dist/delivery.js +19 -0
  71. package/dist/delivery.js.map +1 -0
  72. package/dist/events.d.ts +25 -2
  73. package/dist/events.d.ts.map +1 -1
  74. package/dist/events.js +25 -4
  75. package/dist/events.js.map +1 -1
  76. package/dist/gate.d.ts +2 -2
  77. package/dist/gate.d.ts.map +1 -1
  78. package/dist/gate.js +25 -5
  79. package/dist/gate.js.map +1 -1
  80. package/dist/harness.d.ts +558 -175
  81. package/dist/harness.d.ts.map +1 -1
  82. package/dist/harness.js +207 -82
  83. package/dist/harness.js.map +1 -1
  84. package/dist/index.d.ts +15 -0
  85. package/dist/index.d.ts.map +1 -1
  86. package/dist/index.js +15 -0
  87. package/dist/index.js.map +1 -1
  88. package/dist/operation.d.ts +185 -0
  89. package/dist/operation.d.ts.map +1 -0
  90. package/dist/operation.js +50 -0
  91. package/dist/operation.js.map +1 -0
  92. package/dist/orchestrate.d.ts +127 -22
  93. package/dist/orchestrate.d.ts.map +1 -1
  94. package/dist/orchestrate.js +61 -7
  95. package/dist/orchestrate.js.map +1 -1
  96. package/dist/primitives.d.ts.map +1 -1
  97. package/dist/primitives.js +4 -1
  98. package/dist/primitives.js.map +1 -1
  99. package/dist/problem.d.ts +29 -0
  100. package/dist/problem.d.ts.map +1 -0
  101. package/dist/problem.js +17 -0
  102. package/dist/problem.js.map +1 -0
  103. package/dist/project.d.ts +97 -0
  104. package/dist/project.d.ts.map +1 -0
  105. package/dist/project.js +27 -0
  106. package/dist/project.js.map +1 -0
  107. package/dist/quota.d.ts +251 -0
  108. package/dist/quota.d.ts.map +1 -0
  109. package/dist/quota.js +46 -0
  110. package/dist/quota.js.map +1 -0
  111. package/dist/raw.d.ts +195 -0
  112. package/dist/raw.d.ts.map +1 -0
  113. package/dist/raw.js +58 -0
  114. package/dist/raw.js.map +1 -0
  115. package/dist/recovery.d.ts +515 -0
  116. package/dist/recovery.d.ts.map +1 -0
  117. package/dist/recovery.js +93 -0
  118. package/dist/recovery.js.map +1 -0
  119. package/dist/request-requirements.d.ts +36 -0
  120. package/dist/request-requirements.d.ts.map +1 -0
  121. package/dist/request-requirements.js +26 -0
  122. package/dist/request-requirements.js.map +1 -0
  123. package/dist/review.d.ts +26 -26
  124. package/dist/review.d.ts.map +1 -1
  125. package/dist/review.js +50 -10
  126. package/dist/review.js.map +1 -1
  127. package/dist/route.d.ts +10 -10
  128. package/dist/route.d.ts.map +1 -1
  129. package/dist/route.js +19 -4
  130. package/dist/route.js.map +1 -1
  131. package/dist/setup.d.ts +9766 -0
  132. package/dist/setup.d.ts.map +1 -0
  133. package/dist/setup.js +450 -0
  134. package/dist/setup.js.map +1 -0
  135. package/dist/spec.d.ts +174 -57
  136. package/dist/spec.d.ts.map +1 -1
  137. package/dist/spec.js +69 -16
  138. package/dist/spec.js.map +1 -1
  139. package/dist/surface-run-controls.d.ts.map +1 -1
  140. package/dist/surface-run-controls.js +25 -21
  141. package/dist/surface-run-controls.js.map +1 -1
  142. package/dist/task.d.ts +1560 -58
  143. package/dist/task.d.ts.map +1 -1
  144. package/dist/task.js +97 -18
  145. package/dist/task.js.map +1 -1
  146. package/dist/telemetry.d.ts +233 -60
  147. package/dist/telemetry.d.ts.map +1 -1
  148. package/dist/telemetry.js +97 -15
  149. package/dist/telemetry.js.map +1 -1
  150. package/dist/thread.d.ts +68 -41
  151. package/dist/thread.d.ts.map +1 -1
  152. package/dist/thread.js +45 -11
  153. package/dist/thread.js.map +1 -1
  154. package/dist/workproduct.d.ts +3 -3
  155. package/dist/workproduct.d.ts.map +1 -1
  156. package/dist/workproduct.js.map +1 -1
  157. package/dist/workspace.d.ts +1 -1
  158. package/dist/workspace.d.ts.map +1 -1
  159. package/dist/workspace.js +12 -3
  160. package/dist/workspace.js.map +1 -1
  161. package/generated/AgentCapabilityCatalog.schema.json +53 -11
  162. package/generated/BudgetLease.schema.json +55 -6
  163. package/generated/BudgetObservation.schema.json +28 -7
  164. package/generated/ConformanceReport.schema.json +49 -0
  165. package/generated/ControlApplyCheckResponse.schema.json +34 -0
  166. package/generated/ControlArtifactListResponse.schema.json +57 -0
  167. package/generated/ControlAuthReadinessRefreshRequest.schema.json +38 -0
  168. package/generated/ControlAuthReadinessRefreshResponse.schema.json +85 -0
  169. package/generated/ControlDeliveryResponse.schema.json +136 -0
  170. package/generated/ControlHandshakeRequest.schema.json +26 -0
  171. package/generated/ControlHandshakeResponse.schema.json +30 -0
  172. package/generated/ControlHarnessListResponse.schema.json +103 -12
  173. package/generated/ControlHarnessSettingsPatch.schema.json +0 -12
  174. package/generated/ControlJournalEvent.schema.json +42 -0
  175. package/generated/ControlJournalExportReceipt.schema.json +49 -0
  176. package/generated/ControlJournalInspection.schema.json +149 -0
  177. package/generated/ControlJournalQuarantineReceipt.schema.json +55 -0
  178. package/generated/ControlJournalQuarantineRequest.schema.json +24 -0
  179. package/generated/ControlJournalValidation.schema.json +181 -0
  180. package/generated/ControlOperationCatalog.schema.json +128 -0
  181. package/generated/ControlOperationDescriptor.schema.json +110 -0
  182. package/generated/ControlProblem.schema.json +59 -0
  183. package/generated/ControlProject.schema.json +42 -0
  184. package/generated/ControlProjectListResponse.schema.json +54 -0
  185. package/generated/ControlProjectRegisterRequest.schema.json +19 -0
  186. package/generated/ControlProjectRelinkRequest.schema.json +19 -0
  187. package/generated/ControlQueuedRunInfo.schema.json +4 -2
  188. package/generated/ControlQuotaResponse.schema.json +176 -0
  189. package/generated/ControlResource.schema.json +59 -0
  190. package/generated/ControlRunAgainDraft.schema.json +499 -0
  191. package/generated/ControlRunDetail.schema.json +197 -30
  192. package/generated/ControlRunListResponse.schema.json +797 -0
  193. package/generated/ControlRunRetryResponse.schema.json +54 -0
  194. package/generated/ControlRunStartRequest.schema.json +83 -55
  195. package/generated/ControlRunStartResponse.schema.json +78 -0
  196. package/generated/ControlRunSummary.schema.json +140 -20
  197. package/generated/ControlSecretListResponse.schema.json +8 -14
  198. package/generated/ControlSecretMutationResponse.schema.json +32 -0
  199. package/generated/ControlSecretSetRequest.schema.json +27 -0
  200. package/generated/ControlSettingsSnapshot.schema.json +118 -44
  201. package/generated/ControlSettingsUpdateRequest.schema.json +110 -40
  202. package/generated/ControlSetupJob.schema.json +763 -65
  203. package/generated/ControlSetupJobCreateRequest.schema.json +11 -13
  204. package/generated/ControlSetupJobEvent.schema.json +861 -5
  205. package/generated/ControlSetupJobListFilter.schema.json +35 -0
  206. package/generated/ControlSetupJobListResponse.schema.json +763 -65
  207. package/generated/ControlSetupJobSnapshot.schema.json +870 -0
  208. package/generated/ControlSpecAnswersRequest.schema.json +74 -0
  209. package/generated/ControlSpecQuestionsRequest.schema.json +128 -2
  210. package/generated/ControlSpecSession.schema.json +249 -0
  211. package/generated/ControlSpecSessionListResponse.schema.json +261 -0
  212. package/generated/ControlThread.schema.json +20 -2
  213. package/generated/ControlThreadApplyResponse.schema.json +139 -0
  214. package/generated/ControlThreadDetail.schema.json +32 -4
  215. package/generated/ControlThreadListResponse.schema.json +20 -2
  216. package/generated/ControlThreadTurnRequest.schema.json +373 -0
  217. package/generated/ControlThreadTurnResponse.schema.json +73 -0
  218. package/generated/ControlThreadUpdateRequest.schema.json +1 -1
  219. package/generated/ControlTrustListResponse.schema.json +6 -0
  220. package/generated/ControlTrustState.schema.json +6 -0
  221. package/generated/ControlTrustUpdateRequest.schema.json +65 -3
  222. package/generated/ControlUploadCreateRequest.schema.json +37 -0
  223. package/generated/ControlUploadFinalizeRequest.schema.json +17 -0
  224. package/generated/ControlUploadStatus.schema.json +40 -0
  225. package/generated/DecisionRecord.schema.json +6 -3
  226. package/generated/GlobalConfig.schema.json +105 -58
  227. package/generated/HarnessEvent.schema.json +201 -10
  228. package/generated/HarnessManifest.schema.json +63 -12
  229. package/generated/HarnessStatusDto.schema.json +103 -12
  230. package/generated/OrchestrateContract.schema.json +32 -6
  231. package/generated/OrchestratePlan.schema.json +20 -0
  232. package/generated/OrchestratePlanProgress.schema.json +61 -0
  233. package/generated/PaidBudget.schema.json +42 -0
  234. package/generated/Project.schema.json +45 -0
  235. package/generated/ProjectConfig.schema.json +45 -18
  236. package/generated/RawContextPacket.schema.json +184 -0
  237. package/generated/RawGitPatchEnvelope.schema.json +70 -0
  238. package/generated/RunTelemetry.schema.json +80 -0
  239. package/generated/SecretMetadata.schema.json +4 -7
  240. package/generated/SpecPack.schema.json +118 -7
  241. package/generated/TaskContract.schema.json +159 -26
  242. package/generated/TestCommandInvocation.schema.json +45 -0
  243. package/generated/Thread.schema.json +62 -6
  244. package/generated/ThreadTurn.schema.json +24 -11
  245. package/generated/TrustConfig.schema.json +77 -0
  246. package/package.json +1 -1
  247. package/generated/ControlSetupJobConfirmRequest.schema.json +0 -18
  248. package/generated/ControlSpecFreezeRequest.schema.json +0 -83
package/dist/config.d.ts CHANGED
@@ -22,45 +22,80 @@ export declare const ProjectConfig: z.ZodObject<{
22
22
  exclude?: string[] | undefined;
23
23
  }>>;
24
24
  tests: z.ZodDefault<z.ZodObject<{
25
- commands: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
25
+ commands: z.ZodDefault<z.ZodArray<z.ZodObject<{
26
+ program: z.ZodString;
27
+ args: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
28
+ cwd: z.ZodOptional<z.ZodString>;
29
+ envAllowlist: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
30
+ }, "strict", z.ZodTypeAny, {
31
+ program: string;
32
+ args: string[];
33
+ envAllowlist: string[];
34
+ cwd?: string | undefined;
35
+ }, {
36
+ program: string;
37
+ cwd?: string | undefined;
38
+ args?: string[] | undefined;
39
+ envAllowlist?: string[] | undefined;
40
+ }>, "many">>;
26
41
  }, "strict", z.ZodTypeAny, {
27
- commands: string[];
42
+ commands: {
43
+ program: string;
44
+ args: string[];
45
+ envAllowlist: string[];
46
+ cwd?: string | undefined;
47
+ }[];
28
48
  }, {
29
- commands?: string[] | undefined;
49
+ commands?: {
50
+ program: string;
51
+ cwd?: string | undefined;
52
+ args?: string[] | undefined;
53
+ envAllowlist?: string[] | undefined;
54
+ }[] | undefined;
30
55
  }>>;
31
56
  budget: z.ZodDefault<z.ZodObject<{
32
- portfolio: z.ZodDefault<z.ZodEnum<["daily-rich", "balanced", "cheapest", "strongest", "burn", "subscription-first", "api-overflow", "conserve-claude", "conserve-codex"]>>;
57
+ routing_goal: z.ZodOptional<z.ZodEnum<["auto", "quality", "economy"]>>;
33
58
  }, "strict", z.ZodTypeAny, {
34
- portfolio: "daily-rich" | "balanced" | "cheapest" | "strongest" | "burn" | "subscription-first" | "api-overflow" | "conserve-claude" | "conserve-codex";
59
+ routing_goal?: "auto" | "quality" | "economy" | undefined;
35
60
  }, {
36
- portfolio?: "daily-rich" | "balanced" | "cheapest" | "strongest" | "burn" | "subscription-first" | "api-overflow" | "conserve-claude" | "conserve-codex" | undefined;
61
+ routing_goal?: "auto" | "quality" | "economy" | undefined;
37
62
  }>>;
38
63
  }, "strict", z.ZodTypeAny, {
39
64
  version: 1;
65
+ tests: {
66
+ commands: {
67
+ program: string;
68
+ args: string[];
69
+ envAllowlist: string[];
70
+ cwd?: string | undefined;
71
+ }[];
72
+ };
73
+ budget: {
74
+ routing_goal?: "auto" | "quality" | "economy" | undefined;
75
+ };
40
76
  context: {
41
77
  mandatory_files: string[];
42
78
  include: string[];
43
79
  exclude: string[];
44
80
  };
45
- tests: {
46
- commands: string[];
47
- };
48
- budget: {
49
- portfolio: "daily-rich" | "balanced" | "cheapest" | "strongest" | "burn" | "subscription-first" | "api-overflow" | "conserve-claude" | "conserve-codex";
50
- };
51
81
  }, {
52
82
  version?: 1 | undefined;
83
+ tests?: {
84
+ commands?: {
85
+ program: string;
86
+ cwd?: string | undefined;
87
+ args?: string[] | undefined;
88
+ envAllowlist?: string[] | undefined;
89
+ }[] | undefined;
90
+ } | undefined;
91
+ budget?: {
92
+ routing_goal?: "auto" | "quality" | "economy" | undefined;
93
+ } | undefined;
53
94
  context?: {
54
95
  mandatory_files?: string[] | undefined;
55
96
  include?: string[] | undefined;
56
97
  exclude?: string[] | undefined;
57
98
  } | undefined;
58
- tests?: {
59
- commands?: string[] | undefined;
60
- } | undefined;
61
- budget?: {
62
- portfolio?: "daily-rich" | "balanced" | "cheapest" | "strongest" | "burn" | "subscription-first" | "api-overflow" | "conserve-claude" | "conserve-codex" | undefined;
63
- } | undefined;
64
99
  }>;
65
100
  export type ProjectConfig = z.infer<typeof ProjectConfig>;
66
101
  /** Sensitive trust settings — only valid in global/user-local/trust files. */
@@ -76,22 +111,69 @@ export declare const TrustConfig: z.ZodObject<{
76
111
  * carry null and surfaces disclose them as revocable only via CLI.
77
112
  */
78
113
  repo_root: z.ZodDefault<z.ZodNullable<z.ZodString>>;
114
+ test_command_grants: z.ZodDefault<z.ZodArray<z.ZodObject<{
115
+ projectDigest: z.ZodString;
116
+ configDigest: z.ZodString;
117
+ commandDigest: z.ZodString;
118
+ executablePath: z.ZodString;
119
+ executableDigest: z.ZodString;
120
+ scriptPath: z.ZodDefault<z.ZodNullable<z.ZodString>>;
121
+ scriptDigest: z.ZodDefault<z.ZodNullable<z.ZodString>>;
122
+ accessProfile: z.ZodEnum<["readonly", "workspace_write", "full", "external_sandbox_full", "inherit_native"]>;
123
+ }, "strict", z.ZodTypeAny, {
124
+ projectDigest: string;
125
+ configDigest: string;
126
+ commandDigest: string;
127
+ executablePath: string;
128
+ executableDigest: string;
129
+ scriptPath: string | null;
130
+ scriptDigest: string | null;
131
+ accessProfile: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native";
132
+ }, {
133
+ projectDigest: string;
134
+ configDigest: string;
135
+ commandDigest: string;
136
+ executablePath: string;
137
+ executableDigest: string;
138
+ accessProfile: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native";
139
+ scriptPath?: string | null | undefined;
140
+ scriptDigest?: string | null | undefined;
141
+ }>, "many">>;
79
142
  }, "strict", z.ZodTypeAny, {
80
143
  version: 1;
81
144
  access_default: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native";
82
145
  allow_full_access: boolean;
83
146
  repo_root: string | null;
147
+ test_command_grants: {
148
+ projectDigest: string;
149
+ configDigest: string;
150
+ commandDigest: string;
151
+ executablePath: string;
152
+ executableDigest: string;
153
+ scriptPath: string | null;
154
+ scriptDigest: string | null;
155
+ accessProfile: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native";
156
+ }[];
84
157
  }, {
85
158
  version?: 1 | undefined;
86
159
  access_default?: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native" | undefined;
87
160
  allow_full_access?: boolean | undefined;
88
161
  repo_root?: string | null | undefined;
162
+ test_command_grants?: {
163
+ projectDigest: string;
164
+ configDigest: string;
165
+ commandDigest: string;
166
+ executablePath: string;
167
+ executableDigest: string;
168
+ accessProfile: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native";
169
+ scriptPath?: string | null | undefined;
170
+ scriptDigest?: string | null | undefined;
171
+ }[] | undefined;
89
172
  }>;
90
173
  export type TrustConfig = z.infer<typeof TrustConfig>;
91
- /** Global user config (~/.claudexor/config.yaml). */
174
+ /** Claudexor v2 global user config (~/.claudexor/v2/config.yaml). */
92
175
  export declare const GlobalConfig: z.ZodObject<{
93
176
  version: z.ZodDefault<z.ZodLiteral<1>>;
94
- default_portfolio: z.ZodDefault<z.ZodEnum<["daily-rich", "balanced", "cheapest", "strongest", "burn", "subscription-first", "api-overflow", "conserve-claude", "conserve-codex"]>>;
95
177
  /**
96
178
  * How long an interactive run waits for the user's answer to a harness
97
179
  * question (interaction.requested) before delivering a benign decline and
@@ -110,43 +192,89 @@ export declare const GlobalConfig: z.ZodObject<{
110
192
  env_inheritance: z.ZodDefault<z.ZodEnum<["mirror_native", "clean"]>>;
111
193
  /** Default auth route preference (subscription/api_key/auto). */
112
194
  auth_preference: z.ZodDefault<z.ZodEnum<["subscription", "api_key", "auto"]>>;
113
- /**
114
- * Operator-tunable per-provider-family quality priors (0..1) feeding
115
- * RouterCandidate.qualityForIntent. A DECLARED prior, not
116
- * invented magic: unset families ride the router's neutral 0.5.
117
- */
118
- quality_priors: z.ZodDefault<z.ZodRecord<z.ZodEnum<["openai", "anthropic", "google", "cursor", "opencode", "xai", "local", "unknown"]>, z.ZodNumber>>;
195
+ goal: z.ZodDefault<z.ZodEnum<["auto", "quality", "economy"]>>;
196
+ paid_fallback: z.ZodDefault<z.ZodEnum<["never", "when_unavailable", "allowed_within_cap"]>>;
197
+ quality_tiers: z.ZodDefault<z.ZodRecord<z.ZodEnum<["plan", "spec", "implement", "create_from_scratch", "repair", "review", "verify", "synthesize", "explain", "audit", "orchestrate"]>, z.ZodArray<z.ZodArray<z.ZodObject<{
198
+ harness: z.ZodString;
199
+ model: z.ZodString;
200
+ effort: z.ZodEnum<["low", "medium", "high", "xhigh", "max"]>;
201
+ }, "strict", z.ZodTypeAny, {
202
+ harness: string;
203
+ model: string;
204
+ effort: "low" | "medium" | "high" | "xhigh" | "max";
205
+ }, {
206
+ harness: string;
207
+ model: string;
208
+ effort: "low" | "medium" | "high" | "xhigh" | "max";
209
+ }>, "many">, "many">>>;
119
210
  }, "strict", z.ZodTypeAny, {
120
211
  auth_preference: "auto" | "subscription" | "api_key";
121
212
  env_inheritance: "mirror_native" | "clean";
122
213
  primary_harness: string | null;
123
214
  eligible_harnesses: string[];
124
215
  default_policy: "auto" | "primary";
125
- quality_priors: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", number>>;
216
+ goal: "auto" | "quality" | "economy";
217
+ paid_fallback: "never" | "when_unavailable" | "allowed_within_cap";
218
+ quality_tiers: Partial<Record<"plan" | "audit" | "orchestrate" | "spec" | "implement" | "create_from_scratch" | "repair" | "review" | "verify" | "synthesize" | "explain", {
219
+ harness: string;
220
+ model: string;
221
+ effort: "low" | "medium" | "high" | "xhigh" | "max";
222
+ }[][]>>;
126
223
  }, {
127
224
  auth_preference?: "auto" | "subscription" | "api_key" | undefined;
128
225
  env_inheritance?: "mirror_native" | "clean" | undefined;
129
226
  primary_harness?: string | null | undefined;
130
227
  eligible_harnesses?: string[] | undefined;
131
228
  default_policy?: "auto" | "primary" | undefined;
132
- quality_priors?: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", number>> | undefined;
229
+ goal?: "auto" | "quality" | "economy" | undefined;
230
+ paid_fallback?: "never" | "when_unavailable" | "allowed_within_cap" | undefined;
231
+ quality_tiers?: Partial<Record<"plan" | "audit" | "orchestrate" | "spec" | "implement" | "create_from_scratch" | "repair" | "review" | "verify" | "synthesize" | "explain", {
232
+ harness: string;
233
+ model: string;
234
+ effort: "low" | "medium" | "high" | "xhigh" | "max";
235
+ }[][]>> | undefined;
133
236
  }>>;
134
237
  budget: z.ZodDefault<z.ZodObject<{
135
- max_usd_per_run: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
238
+ paid_budget_per_run: z.ZodDefault<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
239
+ kind: z.ZodLiteral<"unlimited">;
240
+ }, "strict", z.ZodTypeAny, {
241
+ kind: "unlimited";
242
+ }, {
243
+ kind: "unlimited";
244
+ }>, z.ZodObject<{
245
+ kind: z.ZodLiteral<"finite">;
246
+ maxUsd: z.ZodNumber;
247
+ }, "strict", z.ZodTypeAny, {
248
+ kind: "finite";
249
+ maxUsd: number;
250
+ }, {
251
+ kind: "finite";
252
+ maxUsd: number;
253
+ }>]>>;
136
254
  /**
137
255
  * Per-candidate reservation floor (USD) held against the run cap for
138
256
  * every race-wave slot AFTER the first, BEFORE any usage streams.
139
257
  * Makes concurrent in-flight candidates visible to the budget breaker
140
- * so a parallel wave cannot blow past `max_usd_per_run` between
258
+ * so a parallel wave cannot blow past the finite paid budget between
141
259
  * settlements. The first slot never holds it: a cap smaller than the
142
260
  * floor still runs one candidate and stops on real usage.
143
261
  */
144
262
  estimate_usd_floor: z.ZodDefault<z.ZodNumber>;
145
263
  }, "strict", z.ZodTypeAny, {
146
- max_usd_per_run: number | null;
264
+ paid_budget_per_run: {
265
+ kind: "unlimited";
266
+ } | {
267
+ kind: "finite";
268
+ maxUsd: number;
269
+ };
147
270
  estimate_usd_floor: number;
148
271
  }, {
149
- max_usd_per_run?: number | null | undefined;
272
+ paid_budget_per_run?: {
273
+ kind: "unlimited";
274
+ } | {
275
+ kind: "finite";
276
+ maxUsd: number;
277
+ } | undefined;
150
278
  estimate_usd_floor?: number | undefined;
151
279
  }>>;
152
280
  runtime: z.ZodDefault<z.ZodObject<{
@@ -202,7 +330,6 @@ export declare const GlobalConfig: z.ZodObject<{
202
330
  effort: z.ZodDefault<z.ZodNullable<z.ZodEnum<["low", "medium", "high", "xhigh", "max"]>>>;
203
331
  max_turns: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
204
332
  max_rounds: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
205
- max_usd: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
206
333
  tools_allow: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
207
334
  tools_deny: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
208
335
  fallback_model: z.ZodDefault<z.ZodNullable<z.ZodString>>;
@@ -213,11 +340,10 @@ export declare const GlobalConfig: z.ZodObject<{
213
340
  fallback_model: string | null;
214
341
  max_turns: number | null;
215
342
  web: "off" | "auto" | "cached" | "live";
216
- max_usd: number | null;
217
343
  auth_preference: "auto" | "subscription" | "api_key";
218
344
  enabled: boolean;
219
- default_model: string | null;
220
345
  effort: "low" | "medium" | "high" | "xhigh" | "max" | null;
346
+ default_model: string | null;
221
347
  max_rounds: number | null;
222
348
  tools_allow: string[];
223
349
  tools_deny: string[];
@@ -225,11 +351,10 @@ export declare const GlobalConfig: z.ZodObject<{
225
351
  fallback_model?: string | null | undefined;
226
352
  max_turns?: number | null | undefined;
227
353
  web?: "off" | "auto" | "cached" | "live" | undefined;
228
- max_usd?: number | null | undefined;
229
354
  auth_preference?: "auto" | "subscription" | "api_key" | undefined;
230
355
  enabled?: boolean | undefined;
231
- default_model?: string | null | undefined;
232
356
  effort?: "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
357
+ default_model?: string | null | undefined;
233
358
  max_rounds?: number | null | undefined;
234
359
  tools_allow?: string[] | undefined;
235
360
  tools_deny?: string[] | undefined;
@@ -240,20 +365,23 @@ export declare const GlobalConfig: z.ZodObject<{
240
365
  fallback_model: string | null;
241
366
  max_turns: number | null;
242
367
  web: "off" | "auto" | "cached" | "live";
243
- max_usd: number | null;
244
368
  auth_preference: "auto" | "subscription" | "api_key";
245
369
  enabled: boolean;
246
- default_model: string | null;
247
370
  effort: "low" | "medium" | "high" | "xhigh" | "max" | null;
371
+ default_model: string | null;
248
372
  max_rounds: number | null;
249
373
  tools_allow: string[];
250
374
  tools_deny: string[];
251
375
  }>;
252
376
  budget: {
253
- max_usd_per_run: number | null;
377
+ paid_budget_per_run: {
378
+ kind: "unlimited";
379
+ } | {
380
+ kind: "finite";
381
+ maxUsd: number;
382
+ };
254
383
  estimate_usd_floor: number;
255
384
  };
256
- default_portfolio: "daily-rich" | "balanced" | "cheapest" | "strongest" | "burn" | "subscription-first" | "api-overflow" | "conserve-claude" | "conserve-codex";
257
385
  interaction_timeout_ms: number;
258
386
  routing: {
259
387
  auth_preference: "auto" | "subscription" | "api_key";
@@ -261,7 +389,13 @@ export declare const GlobalConfig: z.ZodObject<{
261
389
  primary_harness: string | null;
262
390
  eligible_harnesses: string[];
263
391
  default_policy: "auto" | "primary";
264
- quality_priors: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", number>>;
392
+ goal: "auto" | "quality" | "economy";
393
+ paid_fallback: "never" | "when_unavailable" | "allowed_within_cap";
394
+ quality_tiers: Partial<Record<"plan" | "audit" | "orchestrate" | "spec" | "implement" | "create_from_scratch" | "repair" | "review" | "verify" | "synthesize" | "explain", {
395
+ harness: string;
396
+ model: string;
397
+ effort: "low" | "medium" | "high" | "xhigh" | "max";
398
+ }[][]>>;
265
399
  };
266
400
  runtime: {
267
401
  transient_retry: {
@@ -278,20 +412,23 @@ export declare const GlobalConfig: z.ZodObject<{
278
412
  fallback_model?: string | null | undefined;
279
413
  max_turns?: number | null | undefined;
280
414
  web?: "off" | "auto" | "cached" | "live" | undefined;
281
- max_usd?: number | null | undefined;
282
415
  auth_preference?: "auto" | "subscription" | "api_key" | undefined;
283
416
  enabled?: boolean | undefined;
284
- default_model?: string | null | undefined;
285
417
  effort?: "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
418
+ default_model?: string | null | undefined;
286
419
  max_rounds?: number | null | undefined;
287
420
  tools_allow?: string[] | undefined;
288
421
  tools_deny?: string[] | undefined;
289
422
  }> | undefined;
290
423
  budget?: {
291
- max_usd_per_run?: number | null | undefined;
424
+ paid_budget_per_run?: {
425
+ kind: "unlimited";
426
+ } | {
427
+ kind: "finite";
428
+ maxUsd: number;
429
+ } | undefined;
292
430
  estimate_usd_floor?: number | undefined;
293
431
  } | undefined;
294
- default_portfolio?: "daily-rich" | "balanced" | "cheapest" | "strongest" | "burn" | "subscription-first" | "api-overflow" | "conserve-claude" | "conserve-codex" | undefined;
295
432
  interaction_timeout_ms?: number | undefined;
296
433
  routing?: {
297
434
  auth_preference?: "auto" | "subscription" | "api_key" | undefined;
@@ -299,7 +436,13 @@ export declare const GlobalConfig: z.ZodObject<{
299
436
  primary_harness?: string | null | undefined;
300
437
  eligible_harnesses?: string[] | undefined;
301
438
  default_policy?: "auto" | "primary" | undefined;
302
- quality_priors?: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", number>> | undefined;
439
+ goal?: "auto" | "quality" | "economy" | undefined;
440
+ paid_fallback?: "never" | "when_unavailable" | "allowed_within_cap" | undefined;
441
+ quality_tiers?: Partial<Record<"plan" | "audit" | "orchestrate" | "spec" | "implement" | "create_from_scratch" | "repair" | "review" | "verify" | "synthesize" | "explain", {
442
+ harness: string;
443
+ model: string;
444
+ effort: "low" | "medium" | "high" | "xhigh" | "max";
445
+ }[][]>> | undefined;
303
446
  } | undefined;
304
447
  runtime?: {
305
448
  transient_retry?: {
@@ -330,45 +473,80 @@ export declare const ResolvedConfig: z.ZodObject<{
330
473
  exclude?: string[] | undefined;
331
474
  }>>;
332
475
  tests: z.ZodDefault<z.ZodObject<{
333
- commands: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
476
+ commands: z.ZodDefault<z.ZodArray<z.ZodObject<{
477
+ program: z.ZodString;
478
+ args: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
479
+ cwd: z.ZodOptional<z.ZodString>;
480
+ envAllowlist: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
481
+ }, "strict", z.ZodTypeAny, {
482
+ program: string;
483
+ args: string[];
484
+ envAllowlist: string[];
485
+ cwd?: string | undefined;
486
+ }, {
487
+ program: string;
488
+ cwd?: string | undefined;
489
+ args?: string[] | undefined;
490
+ envAllowlist?: string[] | undefined;
491
+ }>, "many">>;
334
492
  }, "strict", z.ZodTypeAny, {
335
- commands: string[];
493
+ commands: {
494
+ program: string;
495
+ args: string[];
496
+ envAllowlist: string[];
497
+ cwd?: string | undefined;
498
+ }[];
336
499
  }, {
337
- commands?: string[] | undefined;
500
+ commands?: {
501
+ program: string;
502
+ cwd?: string | undefined;
503
+ args?: string[] | undefined;
504
+ envAllowlist?: string[] | undefined;
505
+ }[] | undefined;
338
506
  }>>;
339
507
  budget: z.ZodDefault<z.ZodObject<{
340
- portfolio: z.ZodDefault<z.ZodEnum<["daily-rich", "balanced", "cheapest", "strongest", "burn", "subscription-first", "api-overflow", "conserve-claude", "conserve-codex"]>>;
508
+ routing_goal: z.ZodOptional<z.ZodEnum<["auto", "quality", "economy"]>>;
341
509
  }, "strict", z.ZodTypeAny, {
342
- portfolio: "daily-rich" | "balanced" | "cheapest" | "strongest" | "burn" | "subscription-first" | "api-overflow" | "conserve-claude" | "conserve-codex";
510
+ routing_goal?: "auto" | "quality" | "economy" | undefined;
343
511
  }, {
344
- portfolio?: "daily-rich" | "balanced" | "cheapest" | "strongest" | "burn" | "subscription-first" | "api-overflow" | "conserve-claude" | "conserve-codex" | undefined;
512
+ routing_goal?: "auto" | "quality" | "economy" | undefined;
345
513
  }>>;
346
514
  }, "strict", z.ZodTypeAny, {
347
515
  version: 1;
516
+ tests: {
517
+ commands: {
518
+ program: string;
519
+ args: string[];
520
+ envAllowlist: string[];
521
+ cwd?: string | undefined;
522
+ }[];
523
+ };
524
+ budget: {
525
+ routing_goal?: "auto" | "quality" | "economy" | undefined;
526
+ };
348
527
  context: {
349
528
  mandatory_files: string[];
350
529
  include: string[];
351
530
  exclude: string[];
352
531
  };
353
- tests: {
354
- commands: string[];
355
- };
356
- budget: {
357
- portfolio: "daily-rich" | "balanced" | "cheapest" | "strongest" | "burn" | "subscription-first" | "api-overflow" | "conserve-claude" | "conserve-codex";
358
- };
359
532
  }, {
360
533
  version?: 1 | undefined;
534
+ tests?: {
535
+ commands?: {
536
+ program: string;
537
+ cwd?: string | undefined;
538
+ args?: string[] | undefined;
539
+ envAllowlist?: string[] | undefined;
540
+ }[] | undefined;
541
+ } | undefined;
542
+ budget?: {
543
+ routing_goal?: "auto" | "quality" | "economy" | undefined;
544
+ } | undefined;
361
545
  context?: {
362
546
  mandatory_files?: string[] | undefined;
363
547
  include?: string[] | undefined;
364
548
  exclude?: string[] | undefined;
365
549
  } | undefined;
366
- tests?: {
367
- commands?: string[] | undefined;
368
- } | undefined;
369
- budget?: {
370
- portfolio?: "daily-rich" | "balanced" | "cheapest" | "strongest" | "burn" | "subscription-first" | "api-overflow" | "conserve-claude" | "conserve-codex" | undefined;
371
- } | undefined;
372
550
  }>;
373
551
  trust: z.ZodObject<{
374
552
  version: z.ZodDefault<z.ZodLiteral<1>>;
@@ -382,20 +560,67 @@ export declare const ResolvedConfig: z.ZodObject<{
382
560
  * carry null and surfaces disclose them as revocable only via CLI.
383
561
  */
384
562
  repo_root: z.ZodDefault<z.ZodNullable<z.ZodString>>;
563
+ test_command_grants: z.ZodDefault<z.ZodArray<z.ZodObject<{
564
+ projectDigest: z.ZodString;
565
+ configDigest: z.ZodString;
566
+ commandDigest: z.ZodString;
567
+ executablePath: z.ZodString;
568
+ executableDigest: z.ZodString;
569
+ scriptPath: z.ZodDefault<z.ZodNullable<z.ZodString>>;
570
+ scriptDigest: z.ZodDefault<z.ZodNullable<z.ZodString>>;
571
+ accessProfile: z.ZodEnum<["readonly", "workspace_write", "full", "external_sandbox_full", "inherit_native"]>;
572
+ }, "strict", z.ZodTypeAny, {
573
+ projectDigest: string;
574
+ configDigest: string;
575
+ commandDigest: string;
576
+ executablePath: string;
577
+ executableDigest: string;
578
+ scriptPath: string | null;
579
+ scriptDigest: string | null;
580
+ accessProfile: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native";
581
+ }, {
582
+ projectDigest: string;
583
+ configDigest: string;
584
+ commandDigest: string;
585
+ executablePath: string;
586
+ executableDigest: string;
587
+ accessProfile: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native";
588
+ scriptPath?: string | null | undefined;
589
+ scriptDigest?: string | null | undefined;
590
+ }>, "many">>;
385
591
  }, "strict", z.ZodTypeAny, {
386
592
  version: 1;
387
593
  access_default: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native";
388
594
  allow_full_access: boolean;
389
595
  repo_root: string | null;
596
+ test_command_grants: {
597
+ projectDigest: string;
598
+ configDigest: string;
599
+ commandDigest: string;
600
+ executablePath: string;
601
+ executableDigest: string;
602
+ scriptPath: string | null;
603
+ scriptDigest: string | null;
604
+ accessProfile: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native";
605
+ }[];
390
606
  }, {
391
607
  version?: 1 | undefined;
392
608
  access_default?: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native" | undefined;
393
609
  allow_full_access?: boolean | undefined;
394
610
  repo_root?: string | null | undefined;
611
+ test_command_grants?: {
612
+ projectDigest: string;
613
+ configDigest: string;
614
+ commandDigest: string;
615
+ executablePath: string;
616
+ executableDigest: string;
617
+ accessProfile: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native";
618
+ scriptPath?: string | null | undefined;
619
+ scriptDigest?: string | null | undefined;
620
+ }[] | undefined;
395
621
  }>;
396
622
  global: z.ZodObject<{
397
623
  version: z.ZodDefault<z.ZodLiteral<1>>;
398
- default_portfolio: z.ZodDefault<z.ZodEnum<["daily-rich", "balanced", "cheapest", "strongest", "burn", "subscription-first", "api-overflow", "conserve-claude", "conserve-codex"]>>;
399
624
  /**
400
625
  * How long an interactive run waits for the user's answer to a harness
401
626
  * question (interaction.requested) before delivering a benign decline and
@@ -414,43 +639,89 @@ export declare const ResolvedConfig: z.ZodObject<{
414
639
  env_inheritance: z.ZodDefault<z.ZodEnum<["mirror_native", "clean"]>>;
415
640
  /** Default auth route preference (subscription/api_key/auto). */
416
641
  auth_preference: z.ZodDefault<z.ZodEnum<["subscription", "api_key", "auto"]>>;
417
- /**
418
- * Operator-tunable per-provider-family quality priors (0..1) feeding
419
- * RouterCandidate.qualityForIntent. A DECLARED prior, not
420
- * invented magic: unset families ride the router's neutral 0.5.
421
- */
422
- quality_priors: z.ZodDefault<z.ZodRecord<z.ZodEnum<["openai", "anthropic", "google", "cursor", "opencode", "xai", "local", "unknown"]>, z.ZodNumber>>;
642
+ goal: z.ZodDefault<z.ZodEnum<["auto", "quality", "economy"]>>;
643
+ paid_fallback: z.ZodDefault<z.ZodEnum<["never", "when_unavailable", "allowed_within_cap"]>>;
644
+ quality_tiers: z.ZodDefault<z.ZodRecord<z.ZodEnum<["plan", "spec", "implement", "create_from_scratch", "repair", "review", "verify", "synthesize", "explain", "audit", "orchestrate"]>, z.ZodArray<z.ZodArray<z.ZodObject<{
645
+ harness: z.ZodString;
646
+ model: z.ZodString;
647
+ effort: z.ZodEnum<["low", "medium", "high", "xhigh", "max"]>;
648
+ }, "strict", z.ZodTypeAny, {
649
+ harness: string;
650
+ model: string;
651
+ effort: "low" | "medium" | "high" | "xhigh" | "max";
652
+ }, {
653
+ harness: string;
654
+ model: string;
655
+ effort: "low" | "medium" | "high" | "xhigh" | "max";
656
+ }>, "many">, "many">>>;
423
657
  }, "strict", z.ZodTypeAny, {
424
658
  auth_preference: "auto" | "subscription" | "api_key";
425
659
  env_inheritance: "mirror_native" | "clean";
426
660
  primary_harness: string | null;
427
661
  eligible_harnesses: string[];
428
662
  default_policy: "auto" | "primary";
429
- quality_priors: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", number>>;
663
+ goal: "auto" | "quality" | "economy";
664
+ paid_fallback: "never" | "when_unavailable" | "allowed_within_cap";
665
+ quality_tiers: Partial<Record<"plan" | "audit" | "orchestrate" | "spec" | "implement" | "create_from_scratch" | "repair" | "review" | "verify" | "synthesize" | "explain", {
666
+ harness: string;
667
+ model: string;
668
+ effort: "low" | "medium" | "high" | "xhigh" | "max";
669
+ }[][]>>;
430
670
  }, {
431
671
  auth_preference?: "auto" | "subscription" | "api_key" | undefined;
432
672
  env_inheritance?: "mirror_native" | "clean" | undefined;
433
673
  primary_harness?: string | null | undefined;
434
674
  eligible_harnesses?: string[] | undefined;
435
675
  default_policy?: "auto" | "primary" | undefined;
436
- quality_priors?: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", number>> | undefined;
676
+ goal?: "auto" | "quality" | "economy" | undefined;
677
+ paid_fallback?: "never" | "when_unavailable" | "allowed_within_cap" | undefined;
678
+ quality_tiers?: Partial<Record<"plan" | "audit" | "orchestrate" | "spec" | "implement" | "create_from_scratch" | "repair" | "review" | "verify" | "synthesize" | "explain", {
679
+ harness: string;
680
+ model: string;
681
+ effort: "low" | "medium" | "high" | "xhigh" | "max";
682
+ }[][]>> | undefined;
437
683
  }>>;
438
684
  budget: z.ZodDefault<z.ZodObject<{
439
- max_usd_per_run: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
685
+ paid_budget_per_run: z.ZodDefault<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
686
+ kind: z.ZodLiteral<"unlimited">;
687
+ }, "strict", z.ZodTypeAny, {
688
+ kind: "unlimited";
689
+ }, {
690
+ kind: "unlimited";
691
+ }>, z.ZodObject<{
692
+ kind: z.ZodLiteral<"finite">;
693
+ maxUsd: z.ZodNumber;
694
+ }, "strict", z.ZodTypeAny, {
695
+ kind: "finite";
696
+ maxUsd: number;
697
+ }, {
698
+ kind: "finite";
699
+ maxUsd: number;
700
+ }>]>>;
440
701
  /**
441
702
  * Per-candidate reservation floor (USD) held against the run cap for
442
703
  * every race-wave slot AFTER the first, BEFORE any usage streams.
443
704
  * Makes concurrent in-flight candidates visible to the budget breaker
444
- * so a parallel wave cannot blow past `max_usd_per_run` between
705
+ * so a parallel wave cannot blow past the finite paid budget between
445
706
  * settlements. The first slot never holds it: a cap smaller than the
446
707
  * floor still runs one candidate and stops on real usage.
447
708
  */
448
709
  estimate_usd_floor: z.ZodDefault<z.ZodNumber>;
449
710
  }, "strict", z.ZodTypeAny, {
450
- max_usd_per_run: number | null;
711
+ paid_budget_per_run: {
712
+ kind: "unlimited";
713
+ } | {
714
+ kind: "finite";
715
+ maxUsd: number;
716
+ };
451
717
  estimate_usd_floor: number;
452
718
  }, {
453
- max_usd_per_run?: number | null | undefined;
719
+ paid_budget_per_run?: {
720
+ kind: "unlimited";
721
+ } | {
722
+ kind: "finite";
723
+ maxUsd: number;
724
+ } | undefined;
454
725
  estimate_usd_floor?: number | undefined;
455
726
  }>>;
456
727
  runtime: z.ZodDefault<z.ZodObject<{
@@ -506,7 +777,6 @@ export declare const ResolvedConfig: z.ZodObject<{
506
777
  effort: z.ZodDefault<z.ZodNullable<z.ZodEnum<["low", "medium", "high", "xhigh", "max"]>>>;
507
778
  max_turns: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
508
779
  max_rounds: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
509
- max_usd: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
510
780
  tools_allow: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
511
781
  tools_deny: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
512
782
  fallback_model: z.ZodDefault<z.ZodNullable<z.ZodString>>;
@@ -517,11 +787,10 @@ export declare const ResolvedConfig: z.ZodObject<{
517
787
  fallback_model: string | null;
518
788
  max_turns: number | null;
519
789
  web: "off" | "auto" | "cached" | "live";
520
- max_usd: number | null;
521
790
  auth_preference: "auto" | "subscription" | "api_key";
522
791
  enabled: boolean;
523
- default_model: string | null;
524
792
  effort: "low" | "medium" | "high" | "xhigh" | "max" | null;
793
+ default_model: string | null;
525
794
  max_rounds: number | null;
526
795
  tools_allow: string[];
527
796
  tools_deny: string[];
@@ -529,11 +798,10 @@ export declare const ResolvedConfig: z.ZodObject<{
529
798
  fallback_model?: string | null | undefined;
530
799
  max_turns?: number | null | undefined;
531
800
  web?: "off" | "auto" | "cached" | "live" | undefined;
532
- max_usd?: number | null | undefined;
533
801
  auth_preference?: "auto" | "subscription" | "api_key" | undefined;
534
802
  enabled?: boolean | undefined;
535
- default_model?: string | null | undefined;
536
803
  effort?: "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
804
+ default_model?: string | null | undefined;
537
805
  max_rounds?: number | null | undefined;
538
806
  tools_allow?: string[] | undefined;
539
807
  tools_deny?: string[] | undefined;
@@ -544,20 +812,23 @@ export declare const ResolvedConfig: z.ZodObject<{
544
812
  fallback_model: string | null;
545
813
  max_turns: number | null;
546
814
  web: "off" | "auto" | "cached" | "live";
547
- max_usd: number | null;
548
815
  auth_preference: "auto" | "subscription" | "api_key";
549
816
  enabled: boolean;
550
- default_model: string | null;
551
817
  effort: "low" | "medium" | "high" | "xhigh" | "max" | null;
818
+ default_model: string | null;
552
819
  max_rounds: number | null;
553
820
  tools_allow: string[];
554
821
  tools_deny: string[];
555
822
  }>;
556
823
  budget: {
557
- max_usd_per_run: number | null;
824
+ paid_budget_per_run: {
825
+ kind: "unlimited";
826
+ } | {
827
+ kind: "finite";
828
+ maxUsd: number;
829
+ };
558
830
  estimate_usd_floor: number;
559
831
  };
560
- default_portfolio: "daily-rich" | "balanced" | "cheapest" | "strongest" | "burn" | "subscription-first" | "api-overflow" | "conserve-claude" | "conserve-codex";
561
832
  interaction_timeout_ms: number;
562
833
  routing: {
563
834
  auth_preference: "auto" | "subscription" | "api_key";
@@ -565,7 +836,13 @@ export declare const ResolvedConfig: z.ZodObject<{
565
836
  primary_harness: string | null;
566
837
  eligible_harnesses: string[];
567
838
  default_policy: "auto" | "primary";
568
- quality_priors: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", number>>;
839
+ goal: "auto" | "quality" | "economy";
840
+ paid_fallback: "never" | "when_unavailable" | "allowed_within_cap";
841
+ quality_tiers: Partial<Record<"plan" | "audit" | "orchestrate" | "spec" | "implement" | "create_from_scratch" | "repair" | "review" | "verify" | "synthesize" | "explain", {
842
+ harness: string;
843
+ model: string;
844
+ effort: "low" | "medium" | "high" | "xhigh" | "max";
845
+ }[][]>>;
569
846
  };
570
847
  runtime: {
571
848
  transient_retry: {
@@ -582,20 +859,23 @@ export declare const ResolvedConfig: z.ZodObject<{
582
859
  fallback_model?: string | null | undefined;
583
860
  max_turns?: number | null | undefined;
584
861
  web?: "off" | "auto" | "cached" | "live" | undefined;
585
- max_usd?: number | null | undefined;
586
862
  auth_preference?: "auto" | "subscription" | "api_key" | undefined;
587
863
  enabled?: boolean | undefined;
588
- default_model?: string | null | undefined;
589
864
  effort?: "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
865
+ default_model?: string | null | undefined;
590
866
  max_rounds?: number | null | undefined;
591
867
  tools_allow?: string[] | undefined;
592
868
  tools_deny?: string[] | undefined;
593
869
  }> | undefined;
594
870
  budget?: {
595
- max_usd_per_run?: number | null | undefined;
871
+ paid_budget_per_run?: {
872
+ kind: "unlimited";
873
+ } | {
874
+ kind: "finite";
875
+ maxUsd: number;
876
+ } | undefined;
596
877
  estimate_usd_floor?: number | undefined;
597
878
  } | undefined;
598
- default_portfolio?: "daily-rich" | "balanced" | "cheapest" | "strongest" | "burn" | "subscription-first" | "api-overflow" | "conserve-claude" | "conserve-codex" | undefined;
599
879
  interaction_timeout_ms?: number | undefined;
600
880
  routing?: {
601
881
  auth_preference?: "auto" | "subscription" | "api_key" | undefined;
@@ -603,7 +883,13 @@ export declare const ResolvedConfig: z.ZodObject<{
603
883
  primary_harness?: string | null | undefined;
604
884
  eligible_harnesses?: string[] | undefined;
605
885
  default_policy?: "auto" | "primary" | undefined;
606
- quality_priors?: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", number>> | undefined;
886
+ goal?: "auto" | "quality" | "economy" | undefined;
887
+ paid_fallback?: "never" | "when_unavailable" | "allowed_within_cap" | undefined;
888
+ quality_tiers?: Partial<Record<"plan" | "audit" | "orchestrate" | "spec" | "implement" | "create_from_scratch" | "repair" | "review" | "verify" | "synthesize" | "explain", {
889
+ harness: string;
890
+ model: string;
891
+ effort: "low" | "medium" | "high" | "xhigh" | "max";
892
+ }[][]>> | undefined;
607
893
  } | undefined;
608
894
  runtime?: {
609
895
  transient_retry?: {
@@ -619,23 +905,38 @@ export declare const ResolvedConfig: z.ZodObject<{
619
905
  }, "strip", z.ZodTypeAny, {
620
906
  project: {
621
907
  version: 1;
908
+ tests: {
909
+ commands: {
910
+ program: string;
911
+ args: string[];
912
+ envAllowlist: string[];
913
+ cwd?: string | undefined;
914
+ }[];
915
+ };
916
+ budget: {
917
+ routing_goal?: "auto" | "quality" | "economy" | undefined;
918
+ };
622
919
  context: {
623
920
  mandatory_files: string[];
624
921
  include: string[];
625
922
  exclude: string[];
626
923
  };
627
- tests: {
628
- commands: string[];
629
- };
630
- budget: {
631
- portfolio: "daily-rich" | "balanced" | "cheapest" | "strongest" | "burn" | "subscription-first" | "api-overflow" | "conserve-claude" | "conserve-codex";
632
- };
633
924
  };
634
925
  trust: {
635
926
  version: 1;
636
927
  access_default: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native";
637
928
  allow_full_access: boolean;
638
929
  repo_root: string | null;
930
+ test_command_grants: {
931
+ projectDigest: string;
932
+ configDigest: string;
933
+ commandDigest: string;
934
+ executablePath: string;
935
+ executableDigest: string;
936
+ scriptPath: string | null;
937
+ scriptDigest: string | null;
938
+ accessProfile: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native";
939
+ }[];
639
940
  };
640
941
  global: {
641
942
  version: 1;
@@ -643,20 +944,23 @@ export declare const ResolvedConfig: z.ZodObject<{
643
944
  fallback_model: string | null;
644
945
  max_turns: number | null;
645
946
  web: "off" | "auto" | "cached" | "live";
646
- max_usd: number | null;
647
947
  auth_preference: "auto" | "subscription" | "api_key";
648
948
  enabled: boolean;
649
- default_model: string | null;
650
949
  effort: "low" | "medium" | "high" | "xhigh" | "max" | null;
950
+ default_model: string | null;
651
951
  max_rounds: number | null;
652
952
  tools_allow: string[];
653
953
  tools_deny: string[];
654
954
  }>;
655
955
  budget: {
656
- max_usd_per_run: number | null;
956
+ paid_budget_per_run: {
957
+ kind: "unlimited";
958
+ } | {
959
+ kind: "finite";
960
+ maxUsd: number;
961
+ };
657
962
  estimate_usd_floor: number;
658
963
  };
659
- default_portfolio: "daily-rich" | "balanced" | "cheapest" | "strongest" | "burn" | "subscription-first" | "api-overflow" | "conserve-claude" | "conserve-codex";
660
964
  interaction_timeout_ms: number;
661
965
  routing: {
662
966
  auth_preference: "auto" | "subscription" | "api_key";
@@ -664,7 +968,13 @@ export declare const ResolvedConfig: z.ZodObject<{
664
968
  primary_harness: string | null;
665
969
  eligible_harnesses: string[];
666
970
  default_policy: "auto" | "primary";
667
- quality_priors: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", number>>;
971
+ goal: "auto" | "quality" | "economy";
972
+ paid_fallback: "never" | "when_unavailable" | "allowed_within_cap";
973
+ quality_tiers: Partial<Record<"plan" | "audit" | "orchestrate" | "spec" | "implement" | "create_from_scratch" | "repair" | "review" | "verify" | "synthesize" | "explain", {
974
+ harness: string;
975
+ model: string;
976
+ effort: "low" | "medium" | "high" | "xhigh" | "max";
977
+ }[][]>>;
668
978
  };
669
979
  runtime: {
670
980
  transient_retry: {
@@ -680,23 +990,38 @@ export declare const ResolvedConfig: z.ZodObject<{
680
990
  }, {
681
991
  project: {
682
992
  version?: 1 | undefined;
993
+ tests?: {
994
+ commands?: {
995
+ program: string;
996
+ cwd?: string | undefined;
997
+ args?: string[] | undefined;
998
+ envAllowlist?: string[] | undefined;
999
+ }[] | undefined;
1000
+ } | undefined;
1001
+ budget?: {
1002
+ routing_goal?: "auto" | "quality" | "economy" | undefined;
1003
+ } | undefined;
683
1004
  context?: {
684
1005
  mandatory_files?: string[] | undefined;
685
1006
  include?: string[] | undefined;
686
1007
  exclude?: string[] | undefined;
687
1008
  } | undefined;
688
- tests?: {
689
- commands?: string[] | undefined;
690
- } | undefined;
691
- budget?: {
692
- portfolio?: "daily-rich" | "balanced" | "cheapest" | "strongest" | "burn" | "subscription-first" | "api-overflow" | "conserve-claude" | "conserve-codex" | undefined;
693
- } | undefined;
694
1009
  };
695
1010
  trust: {
696
1011
  version?: 1 | undefined;
697
1012
  access_default?: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native" | undefined;
698
1013
  allow_full_access?: boolean | undefined;
699
1014
  repo_root?: string | null | undefined;
1015
+ test_command_grants?: {
1016
+ projectDigest: string;
1017
+ configDigest: string;
1018
+ commandDigest: string;
1019
+ executablePath: string;
1020
+ executableDigest: string;
1021
+ accessProfile: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native";
1022
+ scriptPath?: string | null | undefined;
1023
+ scriptDigest?: string | null | undefined;
1024
+ }[] | undefined;
700
1025
  };
701
1026
  global: {
702
1027
  version?: 1 | undefined;
@@ -704,20 +1029,23 @@ export declare const ResolvedConfig: z.ZodObject<{
704
1029
  fallback_model?: string | null | undefined;
705
1030
  max_turns?: number | null | undefined;
706
1031
  web?: "off" | "auto" | "cached" | "live" | undefined;
707
- max_usd?: number | null | undefined;
708
1032
  auth_preference?: "auto" | "subscription" | "api_key" | undefined;
709
1033
  enabled?: boolean | undefined;
710
- default_model?: string | null | undefined;
711
1034
  effort?: "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
1035
+ default_model?: string | null | undefined;
712
1036
  max_rounds?: number | null | undefined;
713
1037
  tools_allow?: string[] | undefined;
714
1038
  tools_deny?: string[] | undefined;
715
1039
  }> | undefined;
716
1040
  budget?: {
717
- max_usd_per_run?: number | null | undefined;
1041
+ paid_budget_per_run?: {
1042
+ kind: "unlimited";
1043
+ } | {
1044
+ kind: "finite";
1045
+ maxUsd: number;
1046
+ } | undefined;
718
1047
  estimate_usd_floor?: number | undefined;
719
1048
  } | undefined;
720
- default_portfolio?: "daily-rich" | "balanced" | "cheapest" | "strongest" | "burn" | "subscription-first" | "api-overflow" | "conserve-claude" | "conserve-codex" | undefined;
721
1049
  interaction_timeout_ms?: number | undefined;
722
1050
  routing?: {
723
1051
  auth_preference?: "auto" | "subscription" | "api_key" | undefined;
@@ -725,7 +1053,13 @@ export declare const ResolvedConfig: z.ZodObject<{
725
1053
  primary_harness?: string | null | undefined;
726
1054
  eligible_harnesses?: string[] | undefined;
727
1055
  default_policy?: "auto" | "primary" | undefined;
728
- quality_priors?: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", number>> | undefined;
1056
+ goal?: "auto" | "quality" | "economy" | undefined;
1057
+ paid_fallback?: "never" | "when_unavailable" | "allowed_within_cap" | undefined;
1058
+ quality_tiers?: Partial<Record<"plan" | "audit" | "orchestrate" | "spec" | "implement" | "create_from_scratch" | "repair" | "review" | "verify" | "synthesize" | "explain", {
1059
+ harness: string;
1060
+ model: string;
1061
+ effort: "low" | "medium" | "high" | "xhigh" | "max";
1062
+ }[][]>> | undefined;
729
1063
  } | undefined;
730
1064
  runtime?: {
731
1065
  transient_retry?: {