@claudexor/schema 1.0.1 → 2.1.1

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 (278) hide show
  1. package/dist/agent-capabilities.d.ts +102 -30
  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 +117 -52
  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 +1444 -0
  13. package/dist/auth.d.ts.map +1 -0
  14. package/dist/auth.js +371 -0
  15. package/dist/auth.js.map +1 -0
  16. package/dist/budget.d.ts +147 -18
  17. package/dist/budget.d.ts.map +1 -1
  18. package/dist/budget.js +80 -22
  19. package/dist/budget.js.map +1 -1
  20. package/dist/config.d.ts +829 -135
  21. package/dist/config.d.ts.map +1 -1
  22. package/dist/config.js +195 -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-gc.d.ts +185 -0
  29. package/dist/control-gc.d.ts.map +1 -0
  30. package/dist/control-gc.js +81 -0
  31. package/dist/control-gc.js.map +1 -0
  32. package/dist/control-operation-responses.d.ts +1298 -0
  33. package/dist/control-operation-responses.d.ts.map +1 -0
  34. package/dist/control-operation-responses.js +35 -0
  35. package/dist/control-operation-responses.js.map +1 -0
  36. package/dist/control-run-detail.d.ts +556 -247
  37. package/dist/control-run-detail.d.ts.map +1 -1
  38. package/dist/control-run-detail.js +72 -17
  39. package/dist/control-run-detail.js.map +1 -1
  40. package/dist/control-run-retry.d.ts +88 -0
  41. package/dist/control-run-retry.d.ts.map +1 -0
  42. package/dist/control-run-retry.js +40 -0
  43. package/dist/control-run-retry.js.map +1 -0
  44. package/dist/control-run-scope.d.ts +25 -0
  45. package/dist/control-run-scope.d.ts.map +1 -0
  46. package/dist/control-run-scope.js +22 -0
  47. package/dist/control-run-scope.js.map +1 -0
  48. package/dist/control-secret.d.ts +90 -0
  49. package/dist/control-secret.d.ts.map +1 -0
  50. package/dist/control-secret.js +35 -0
  51. package/dist/control-secret.js.map +1 -0
  52. package/dist/control-spec.d.ts +592 -0
  53. package/dist/control-spec.d.ts.map +1 -0
  54. package/dist/control-spec.js +85 -0
  55. package/dist/control-spec.js.map +1 -0
  56. package/dist/control-thread-apply.d.ts +175 -0
  57. package/dist/control-thread-apply.d.ts.map +1 -0
  58. package/dist/control-thread-apply.js +31 -0
  59. package/dist/control-thread-apply.js.map +1 -0
  60. package/dist/control-trust.d.ts +74 -10
  61. package/dist/control-trust.d.ts.map +1 -1
  62. package/dist/control-trust.js +31 -11
  63. package/dist/control-trust.js.map +1 -1
  64. package/dist/control.d.ts +1688 -1334
  65. package/dist/control.d.ts.map +1 -1
  66. package/dist/control.js +592 -333
  67. package/dist/control.js.map +1 -1
  68. package/dist/credential-profile.d.ts +454 -0
  69. package/dist/credential-profile.d.ts.map +1 -0
  70. package/dist/credential-profile.js +140 -0
  71. package/dist/credential-profile.js.map +1 -0
  72. package/dist/decision.d.ts +10 -10
  73. package/dist/decision.d.ts.map +1 -1
  74. package/dist/decision.js +62 -15
  75. package/dist/decision.js.map +1 -1
  76. package/dist/delivery.d.ts +99 -0
  77. package/dist/delivery.d.ts.map +1 -0
  78. package/dist/delivery.js +19 -0
  79. package/dist/delivery.js.map +1 -0
  80. package/dist/events.d.ts +41 -4
  81. package/dist/events.d.ts.map +1 -1
  82. package/dist/events.js +47 -4
  83. package/dist/events.js.map +1 -1
  84. package/dist/gate.d.ts +5 -5
  85. package/dist/gate.d.ts.map +1 -1
  86. package/dist/gate.js +25 -5
  87. package/dist/gate.js.map +1 -1
  88. package/dist/harness.d.ts +775 -237
  89. package/dist/harness.d.ts.map +1 -1
  90. package/dist/harness.js +314 -111
  91. package/dist/harness.js.map +1 -1
  92. package/dist/index.d.ts +19 -0
  93. package/dist/index.d.ts.map +1 -1
  94. package/dist/index.js +19 -0
  95. package/dist/index.js.map +1 -1
  96. package/dist/operation.d.ts +185 -0
  97. package/dist/operation.d.ts.map +1 -0
  98. package/dist/operation.js +50 -0
  99. package/dist/operation.js.map +1 -0
  100. package/dist/orchestrate.d.ts +150 -22
  101. package/dist/orchestrate.d.ts.map +1 -1
  102. package/dist/orchestrate.js +117 -7
  103. package/dist/orchestrate.js.map +1 -1
  104. package/dist/primitives.d.ts.map +1 -1
  105. package/dist/primitives.js +4 -1
  106. package/dist/primitives.js.map +1 -1
  107. package/dist/problem.d.ts +29 -0
  108. package/dist/problem.d.ts.map +1 -0
  109. package/dist/problem.js +17 -0
  110. package/dist/problem.js.map +1 -0
  111. package/dist/project.d.ts +97 -0
  112. package/dist/project.d.ts.map +1 -0
  113. package/dist/project.js +27 -0
  114. package/dist/project.js.map +1 -0
  115. package/dist/quota.d.ts +269 -0
  116. package/dist/quota.d.ts.map +1 -0
  117. package/dist/quota.js +58 -0
  118. package/dist/quota.js.map +1 -0
  119. package/dist/raw.d.ts +195 -0
  120. package/dist/raw.d.ts.map +1 -0
  121. package/dist/raw.js +58 -0
  122. package/dist/raw.js.map +1 -0
  123. package/dist/readiness.d.ts +596 -0
  124. package/dist/readiness.d.ts.map +1 -0
  125. package/dist/readiness.js +87 -0
  126. package/dist/readiness.js.map +1 -0
  127. package/dist/recovery.d.ts +515 -0
  128. package/dist/recovery.d.ts.map +1 -0
  129. package/dist/recovery.js +93 -0
  130. package/dist/recovery.js.map +1 -0
  131. package/dist/request-requirements.d.ts +36 -0
  132. package/dist/request-requirements.d.ts.map +1 -0
  133. package/dist/request-requirements.js +29 -0
  134. package/dist/request-requirements.js.map +1 -0
  135. package/dist/review.d.ts +26 -26
  136. package/dist/review.d.ts.map +1 -1
  137. package/dist/review.js +50 -10
  138. package/dist/review.js.map +1 -1
  139. package/dist/route.d.ts +13 -13
  140. package/dist/route.d.ts.map +1 -1
  141. package/dist/route.js +19 -4
  142. package/dist/route.js.map +1 -1
  143. package/dist/setup.d.ts +9811 -0
  144. package/dist/setup.d.ts.map +1 -0
  145. package/dist/setup.js +475 -0
  146. package/dist/setup.js.map +1 -0
  147. package/dist/spec.d.ts +178 -61
  148. package/dist/spec.d.ts.map +1 -1
  149. package/dist/spec.js +69 -16
  150. package/dist/spec.js.map +1 -1
  151. package/dist/surface-run-controls.d.ts.map +1 -1
  152. package/dist/surface-run-controls.js +25 -21
  153. package/dist/surface-run-controls.js.map +1 -1
  154. package/dist/task.d.ts +1657 -60
  155. package/dist/task.d.ts.map +1 -1
  156. package/dist/task.js +144 -18
  157. package/dist/task.js.map +1 -1
  158. package/dist/telemetry.d.ts +487 -72
  159. package/dist/telemetry.d.ts.map +1 -1
  160. package/dist/telemetry.js +194 -16
  161. package/dist/telemetry.js.map +1 -1
  162. package/dist/thread.d.ts +89 -51
  163. package/dist/thread.d.ts.map +1 -1
  164. package/dist/thread.js +56 -11
  165. package/dist/thread.js.map +1 -1
  166. package/dist/tool-ref.d.ts +45 -0
  167. package/dist/tool-ref.d.ts.map +1 -0
  168. package/dist/tool-ref.js +45 -0
  169. package/dist/tool-ref.js.map +1 -0
  170. package/dist/workproduct.d.ts +3 -3
  171. package/dist/workproduct.d.ts.map +1 -1
  172. package/dist/workproduct.js.map +1 -1
  173. package/dist/workspace.d.ts +3 -3
  174. package/dist/workspace.d.ts.map +1 -1
  175. package/dist/workspace.js +12 -3
  176. package/dist/workspace.js.map +1 -1
  177. package/generated/AgentCapabilityCatalog.schema.json +53 -11
  178. package/generated/BudgetLease.schema.json +55 -6
  179. package/generated/BudgetObservation.schema.json +44 -7
  180. package/generated/ConformanceReport.schema.json +49 -0
  181. package/generated/ControlApplyCheckResponse.schema.json +34 -0
  182. package/generated/ControlArtifactListResponse.schema.json +57 -0
  183. package/generated/ControlAuthReadinessRefreshRequest.schema.json +38 -0
  184. package/generated/ControlAuthReadinessRefreshResponse.schema.json +85 -0
  185. package/generated/ControlCredentialProfileCreateRequest.schema.json +32 -0
  186. package/generated/ControlCredentialProfileCreateResponse.schema.json +142 -0
  187. package/generated/ControlCredentialProfileDeleteResponse.schema.json +107 -0
  188. package/generated/ControlCredentialProfilesResponse.schema.json +155 -0
  189. package/generated/ControlDeliveryResponse.schema.json +136 -0
  190. package/generated/ControlGcReceipt.schema.json +170 -0
  191. package/generated/ControlGcRequest.schema.json +18 -0
  192. package/generated/ControlHandshakeRequest.schema.json +26 -0
  193. package/generated/ControlHandshakeResponse.schema.json +30 -0
  194. package/generated/ControlHarnessListResponse.schema.json +198 -14
  195. package/generated/ControlHarnessModelsResponse.schema.json +19 -0
  196. package/generated/ControlHarnessSettingsPatch.schema.json +9 -12
  197. package/generated/ControlJournalEvent.schema.json +42 -0
  198. package/generated/ControlJournalExportReceipt.schema.json +49 -0
  199. package/generated/ControlJournalInspection.schema.json +149 -0
  200. package/generated/ControlJournalQuarantineReceipt.schema.json +55 -0
  201. package/generated/ControlJournalQuarantineRequest.schema.json +24 -0
  202. package/generated/ControlJournalValidation.schema.json +181 -0
  203. package/generated/ControlOperationCatalog.schema.json +128 -0
  204. package/generated/ControlOperationDescriptor.schema.json +110 -0
  205. package/generated/ControlProblem.schema.json +59 -0
  206. package/generated/ControlProject.schema.json +42 -0
  207. package/generated/ControlProjectListResponse.schema.json +54 -0
  208. package/generated/ControlProjectRegisterRequest.schema.json +19 -0
  209. package/generated/ControlProjectRelinkRequest.schema.json +19 -0
  210. package/generated/ControlQueuedRunInfo.schema.json +4 -2
  211. package/generated/ControlQuotaResponse.schema.json +177 -0
  212. package/generated/ControlResource.schema.json +59 -0
  213. package/generated/ControlRunAgainDraft.schema.json +539 -0
  214. package/generated/ControlRunDetail.schema.json +373 -34
  215. package/generated/ControlRunListResponse.schema.json +968 -0
  216. package/generated/ControlRunRetryResponse.schema.json +54 -0
  217. package/generated/ControlRunStartRequest.schema.json +123 -55
  218. package/generated/ControlRunStartResponse.schema.json +78 -0
  219. package/generated/ControlRunSummary.schema.json +312 -21
  220. package/generated/ControlSecretListResponse.schema.json +8 -14
  221. package/generated/ControlSecretMutationResponse.schema.json +32 -0
  222. package/generated/ControlSecretSetRequest.schema.json +27 -0
  223. package/generated/ControlSettingsSnapshot.schema.json +128 -44
  224. package/generated/ControlSettingsUpdateRequest.schema.json +119 -40
  225. package/generated/ControlSetupJob.schema.json +770 -64
  226. package/generated/ControlSetupJobCreateRequest.schema.json +16 -13
  227. package/generated/ControlSetupJobEvent.schema.json +869 -5
  228. package/generated/ControlSetupJobListFilter.schema.json +35 -0
  229. package/generated/ControlSetupJobListResponse.schema.json +770 -64
  230. package/generated/ControlSetupJobSnapshot.schema.json +878 -0
  231. package/generated/ControlSpecAnswersRequest.schema.json +74 -0
  232. package/generated/ControlSpecQuestionsRequest.schema.json +128 -2
  233. package/generated/ControlSpecSession.schema.json +249 -0
  234. package/generated/ControlSpecSessionListResponse.schema.json +261 -0
  235. package/generated/ControlThread.schema.json +36 -6
  236. package/generated/ControlThreadApplyResponse.schema.json +139 -0
  237. package/generated/ControlThreadCreateRequest.schema.json +6 -2
  238. package/generated/ControlThreadDetail.schema.json +64 -12
  239. package/generated/ControlThreadListResponse.schema.json +36 -6
  240. package/generated/ControlThreadTurnRequest.schema.json +413 -0
  241. package/generated/ControlThreadTurnResponse.schema.json +73 -0
  242. package/generated/ControlThreadUpdateRequest.schema.json +12 -1
  243. package/generated/ControlTrustListResponse.schema.json +6 -0
  244. package/generated/ControlTrustState.schema.json +6 -0
  245. package/generated/ControlTrustUpdateRequest.schema.json +65 -3
  246. package/generated/ControlUploadCreateRequest.schema.json +37 -0
  247. package/generated/ControlUploadFinalizeRequest.schema.json +17 -0
  248. package/generated/ControlUploadStatus.schema.json +40 -0
  249. package/generated/CredentialProfile.schema.json +78 -0
  250. package/generated/CredentialProfileStatus.schema.json +61 -0
  251. package/generated/DecisionRecord.schema.json +6 -3
  252. package/generated/GlobalConfig.schema.json +238 -55
  253. package/generated/HarnessEvent.schema.json +259 -11
  254. package/generated/HarnessManifest.schema.json +96 -14
  255. package/generated/HarnessModel.schema.json +19 -0
  256. package/generated/HarnessStatusDto.schema.json +198 -14
  257. package/generated/OrchestrateContract.schema.json +32 -6
  258. package/generated/OrchestratePlan.schema.json +20 -0
  259. package/generated/OrchestratePlanProgress.schema.json +61 -0
  260. package/generated/PaidBudget.schema.json +42 -0
  261. package/generated/Project.schema.json +45 -0
  262. package/generated/ProjectConfig.schema.json +45 -18
  263. package/generated/RawContextPacket.schema.json +184 -0
  264. package/generated/RawGitPatchEnvelope.schema.json +70 -0
  265. package/generated/RunEvent.schema.json +3 -0
  266. package/generated/RunTelemetry.schema.json +280 -0
  267. package/generated/SecretMetadata.schema.json +4 -7
  268. package/generated/Session.schema.json +14 -0
  269. package/generated/SpecPack.schema.json +118 -7
  270. package/generated/TaskContract.schema.json +224 -30
  271. package/generated/TestCommandInvocation.schema.json +45 -0
  272. package/generated/Thread.schema.json +74 -6
  273. package/generated/ThreadHeadPing.schema.json +40 -0
  274. package/generated/ThreadTurn.schema.json +24 -11
  275. package/generated/TrustConfig.schema.json +77 -0
  276. package/package.json +3 -2
  277. package/generated/ControlSetupJobConfirmRequest.schema.json +0 -18
  278. 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<{
@@ -196,13 +324,122 @@ export declare const GlobalConfig: z.ZodObject<{
196
324
  reviewer_timeout_ms?: number | undefined;
197
325
  harness_inactivity_timeout_ms?: number | undefined;
198
326
  }>>;
327
+ /**
328
+ * Disk retention for engine-owned runtime artifacts (W3.6). The daemon's
329
+ * retention service deletes ONLY terminal, unreferenced run trees past
330
+ * their age — active/queued/blocked runs, runs referenced by live
331
+ * threads, and undelivered/applyable work products always survive, and
332
+ * the newest N runs per project survive regardless of age.
333
+ */
334
+ retention: z.ZodDefault<z.ZodObject<{
335
+ runs_max_age_days: z.ZodDefault<z.ZodNumber>;
336
+ reviews_max_age_days: z.ZodDefault<z.ZodNumber>;
337
+ keep_last_runs_per_project: z.ZodDefault<z.ZodNumber>;
338
+ }, "strict", z.ZodTypeAny, {
339
+ runs_max_age_days: number;
340
+ reviews_max_age_days: number;
341
+ keep_last_runs_per_project: number;
342
+ }, {
343
+ runs_max_age_days?: number | undefined;
344
+ reviews_max_age_days?: number | undefined;
345
+ keep_last_runs_per_project?: number | undefined;
346
+ }>>;
347
+ /**
348
+ * Durable NON-SECRET credential-profile registry (INV-135): additional
349
+ * credential identities per harness beyond the engine default. Uniqueness
350
+ * of (harness_id, profile_id) is enforced here; secret material lives in
351
+ * the vendor dir or the secret store, never in config.
352
+ */
353
+ credential_profiles: z.ZodEffects<z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodObject<{
354
+ profile_id: z.ZodString;
355
+ harness_id: z.ZodString;
356
+ display_name: z.ZodString;
357
+ credential_kind: z.ZodEnum<["config_dir_login", "oauth_token", "api_key"]>;
358
+ isolation_locator: z.ZodDefault<z.ZodNullable<z.ZodString>>;
359
+ secret_ref: z.ZodDefault<z.ZodNullable<z.ZodString>>;
360
+ enabled: z.ZodDefault<z.ZodBoolean>;
361
+ created_at: z.ZodDefault<z.ZodNullable<z.ZodString>>;
362
+ }, "strict", z.ZodTypeAny, {
363
+ profile_id: string;
364
+ harness_id: string;
365
+ display_name: string;
366
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
367
+ isolation_locator: string | null;
368
+ secret_ref: string | null;
369
+ enabled: boolean;
370
+ created_at: string | null;
371
+ }, {
372
+ profile_id: string;
373
+ harness_id: string;
374
+ display_name: string;
375
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
376
+ isolation_locator?: string | null | undefined;
377
+ secret_ref?: string | null | undefined;
378
+ enabled?: boolean | undefined;
379
+ created_at?: string | null | undefined;
380
+ }>, {
381
+ profile_id: string;
382
+ harness_id: string;
383
+ display_name: string;
384
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
385
+ isolation_locator: string | null;
386
+ secret_ref: string | null;
387
+ enabled: boolean;
388
+ created_at: string | null;
389
+ }, {
390
+ profile_id: string;
391
+ harness_id: string;
392
+ display_name: string;
393
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
394
+ isolation_locator?: string | null | undefined;
395
+ secret_ref?: string | null | undefined;
396
+ enabled?: boolean | undefined;
397
+ created_at?: string | null | undefined;
398
+ }>, "many">>, {
399
+ profile_id: string;
400
+ harness_id: string;
401
+ display_name: string;
402
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
403
+ isolation_locator: string | null;
404
+ secret_ref: string | null;
405
+ enabled: boolean;
406
+ created_at: string | null;
407
+ }[], {
408
+ profile_id: string;
409
+ harness_id: string;
410
+ display_name: string;
411
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
412
+ isolation_locator?: string | null | undefined;
413
+ secret_ref?: string | null | undefined;
414
+ enabled?: boolean | undefined;
415
+ created_at?: string | null | undefined;
416
+ }[] | undefined>;
199
417
  harnesses: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
200
418
  enabled: z.ZodDefault<z.ZodBoolean>;
201
419
  default_model: z.ZodDefault<z.ZodNullable<z.ZodString>>;
202
420
  effort: z.ZodDefault<z.ZodNullable<z.ZodEnum<["low", "medium", "high", "xhigh", "max"]>>>;
203
421
  max_turns: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
204
422
  max_rounds: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
205
- max_usd: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
423
+ /**
424
+ * ONE typed profile-selection policy (INV-135, W5.4): what happens
425
+ * when the selected credential profile hits its vendor limit.
426
+ * Rotation is OPT-IN and rotates only on typed vendor-limit
427
+ * signals or proactive headroom breaches — never on ordinary
428
+ * network errors.
429
+ */
430
+ profile_policy: z.ZodDefault<z.ZodObject<{
431
+ limit_action: z.ZodDefault<z.ZodEnum<["fail", "ask", "rotate"]>>;
432
+ rotation_eligible: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
433
+ headroom_threshold: z.ZodDefault<z.ZodNumber>;
434
+ }, "strict", z.ZodTypeAny, {
435
+ limit_action: "ask" | "fail" | "rotate";
436
+ rotation_eligible: string[];
437
+ headroom_threshold: number;
438
+ }, {
439
+ limit_action?: "ask" | "fail" | "rotate" | undefined;
440
+ rotation_eligible?: string[] | undefined;
441
+ headroom_threshold?: number | undefined;
442
+ }>>;
206
443
  tools_allow: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
207
444
  tools_deny: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
208
445
  fallback_model: z.ZodDefault<z.ZodNullable<z.ZodString>>;
@@ -211,26 +448,34 @@ export declare const GlobalConfig: z.ZodObject<{
211
448
  auth_preference: z.ZodDefault<z.ZodEnum<["subscription", "api_key", "auto"]>>;
212
449
  }, "strict", z.ZodTypeAny, {
213
450
  fallback_model: string | null;
214
- max_turns: number | null;
451
+ enabled: boolean;
215
452
  web: "off" | "auto" | "cached" | "live";
216
- max_usd: number | null;
453
+ max_turns: number | null;
217
454
  auth_preference: "auto" | "subscription" | "api_key";
218
- enabled: boolean;
219
- default_model: string | null;
220
455
  effort: "low" | "medium" | "high" | "xhigh" | "max" | null;
456
+ default_model: string | null;
221
457
  max_rounds: number | null;
458
+ profile_policy: {
459
+ limit_action: "ask" | "fail" | "rotate";
460
+ rotation_eligible: string[];
461
+ headroom_threshold: number;
462
+ };
222
463
  tools_allow: string[];
223
464
  tools_deny: string[];
224
465
  }, {
225
466
  fallback_model?: string | null | undefined;
226
- max_turns?: number | null | undefined;
467
+ enabled?: boolean | undefined;
227
468
  web?: "off" | "auto" | "cached" | "live" | undefined;
228
- max_usd?: number | null | undefined;
469
+ max_turns?: number | null | undefined;
229
470
  auth_preference?: "auto" | "subscription" | "api_key" | undefined;
230
- enabled?: boolean | undefined;
231
- default_model?: string | null | undefined;
232
471
  effort?: "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
472
+ default_model?: string | null | undefined;
233
473
  max_rounds?: number | null | undefined;
474
+ profile_policy?: {
475
+ limit_action?: "ask" | "fail" | "rotate" | undefined;
476
+ rotation_eligible?: string[] | undefined;
477
+ headroom_threshold?: number | undefined;
478
+ } | undefined;
234
479
  tools_allow?: string[] | undefined;
235
480
  tools_deny?: string[] | undefined;
236
481
  }>>>;
@@ -238,22 +483,30 @@ export declare const GlobalConfig: z.ZodObject<{
238
483
  version: 1;
239
484
  harnesses: Record<string, {
240
485
  fallback_model: string | null;
241
- max_turns: number | null;
486
+ enabled: boolean;
242
487
  web: "off" | "auto" | "cached" | "live";
243
- max_usd: number | null;
488
+ max_turns: number | null;
244
489
  auth_preference: "auto" | "subscription" | "api_key";
245
- enabled: boolean;
246
- default_model: string | null;
247
490
  effort: "low" | "medium" | "high" | "xhigh" | "max" | null;
491
+ default_model: string | null;
248
492
  max_rounds: number | null;
493
+ profile_policy: {
494
+ limit_action: "ask" | "fail" | "rotate";
495
+ rotation_eligible: string[];
496
+ headroom_threshold: number;
497
+ };
249
498
  tools_allow: string[];
250
499
  tools_deny: string[];
251
500
  }>;
252
501
  budget: {
253
- max_usd_per_run: number | null;
502
+ paid_budget_per_run: {
503
+ kind: "unlimited";
504
+ } | {
505
+ kind: "finite";
506
+ maxUsd: number;
507
+ };
254
508
  estimate_usd_floor: number;
255
509
  };
256
- default_portfolio: "daily-rich" | "balanced" | "cheapest" | "strongest" | "burn" | "subscription-first" | "api-overflow" | "conserve-claude" | "conserve-codex";
257
510
  interaction_timeout_ms: number;
258
511
  routing: {
259
512
  auth_preference: "auto" | "subscription" | "api_key";
@@ -261,7 +514,13 @@ export declare const GlobalConfig: z.ZodObject<{
261
514
  primary_harness: string | null;
262
515
  eligible_harnesses: string[];
263
516
  default_policy: "auto" | "primary";
264
- quality_priors: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", number>>;
517
+ goal: "auto" | "quality" | "economy";
518
+ paid_fallback: "never" | "when_unavailable" | "allowed_within_cap";
519
+ quality_tiers: Partial<Record<"plan" | "audit" | "orchestrate" | "spec" | "implement" | "create_from_scratch" | "repair" | "review" | "verify" | "synthesize" | "explain", {
520
+ harness: string;
521
+ model: string;
522
+ effort: "low" | "medium" | "high" | "xhigh" | "max";
523
+ }[][]>>;
265
524
  };
266
525
  runtime: {
267
526
  transient_retry: {
@@ -272,26 +531,49 @@ export declare const GlobalConfig: z.ZodObject<{
272
531
  reviewer_timeout_ms: number;
273
532
  harness_inactivity_timeout_ms: number;
274
533
  };
534
+ retention: {
535
+ runs_max_age_days: number;
536
+ reviews_max_age_days: number;
537
+ keep_last_runs_per_project: number;
538
+ };
539
+ credential_profiles: {
540
+ profile_id: string;
541
+ harness_id: string;
542
+ display_name: string;
543
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
544
+ isolation_locator: string | null;
545
+ secret_ref: string | null;
546
+ enabled: boolean;
547
+ created_at: string | null;
548
+ }[];
275
549
  }, {
276
550
  version?: 1 | undefined;
277
551
  harnesses?: Record<string, {
278
552
  fallback_model?: string | null | undefined;
279
- max_turns?: number | null | undefined;
553
+ enabled?: boolean | undefined;
280
554
  web?: "off" | "auto" | "cached" | "live" | undefined;
281
- max_usd?: number | null | undefined;
555
+ max_turns?: number | null | undefined;
282
556
  auth_preference?: "auto" | "subscription" | "api_key" | undefined;
283
- enabled?: boolean | undefined;
284
- default_model?: string | null | undefined;
285
557
  effort?: "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
558
+ default_model?: string | null | undefined;
286
559
  max_rounds?: number | null | undefined;
560
+ profile_policy?: {
561
+ limit_action?: "ask" | "fail" | "rotate" | undefined;
562
+ rotation_eligible?: string[] | undefined;
563
+ headroom_threshold?: number | undefined;
564
+ } | undefined;
287
565
  tools_allow?: string[] | undefined;
288
566
  tools_deny?: string[] | undefined;
289
567
  }> | undefined;
290
568
  budget?: {
291
- max_usd_per_run?: number | null | undefined;
569
+ paid_budget_per_run?: {
570
+ kind: "unlimited";
571
+ } | {
572
+ kind: "finite";
573
+ maxUsd: number;
574
+ } | undefined;
292
575
  estimate_usd_floor?: number | undefined;
293
576
  } | undefined;
294
- default_portfolio?: "daily-rich" | "balanced" | "cheapest" | "strongest" | "burn" | "subscription-first" | "api-overflow" | "conserve-claude" | "conserve-codex" | undefined;
295
577
  interaction_timeout_ms?: number | undefined;
296
578
  routing?: {
297
579
  auth_preference?: "auto" | "subscription" | "api_key" | undefined;
@@ -299,7 +581,13 @@ export declare const GlobalConfig: z.ZodObject<{
299
581
  primary_harness?: string | null | undefined;
300
582
  eligible_harnesses?: string[] | undefined;
301
583
  default_policy?: "auto" | "primary" | undefined;
302
- quality_priors?: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", number>> | undefined;
584
+ goal?: "auto" | "quality" | "economy" | undefined;
585
+ paid_fallback?: "never" | "when_unavailable" | "allowed_within_cap" | undefined;
586
+ quality_tiers?: Partial<Record<"plan" | "audit" | "orchestrate" | "spec" | "implement" | "create_from_scratch" | "repair" | "review" | "verify" | "synthesize" | "explain", {
587
+ harness: string;
588
+ model: string;
589
+ effort: "low" | "medium" | "high" | "xhigh" | "max";
590
+ }[][]>> | undefined;
303
591
  } | undefined;
304
592
  runtime?: {
305
593
  transient_retry?: {
@@ -310,6 +598,21 @@ export declare const GlobalConfig: z.ZodObject<{
310
598
  reviewer_timeout_ms?: number | undefined;
311
599
  harness_inactivity_timeout_ms?: number | undefined;
312
600
  } | undefined;
601
+ retention?: {
602
+ runs_max_age_days?: number | undefined;
603
+ reviews_max_age_days?: number | undefined;
604
+ keep_last_runs_per_project?: number | undefined;
605
+ } | undefined;
606
+ credential_profiles?: {
607
+ profile_id: string;
608
+ harness_id: string;
609
+ display_name: string;
610
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
611
+ isolation_locator?: string | null | undefined;
612
+ secret_ref?: string | null | undefined;
613
+ enabled?: boolean | undefined;
614
+ created_at?: string | null | undefined;
615
+ }[] | undefined;
313
616
  }>;
314
617
  export type GlobalConfig = z.infer<typeof GlobalConfig>;
315
618
  /** The fully-resolved effective config after precedence merge. */
@@ -330,45 +633,80 @@ export declare const ResolvedConfig: z.ZodObject<{
330
633
  exclude?: string[] | undefined;
331
634
  }>>;
332
635
  tests: z.ZodDefault<z.ZodObject<{
333
- commands: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
636
+ commands: z.ZodDefault<z.ZodArray<z.ZodObject<{
637
+ program: z.ZodString;
638
+ args: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
639
+ cwd: z.ZodOptional<z.ZodString>;
640
+ envAllowlist: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
641
+ }, "strict", z.ZodTypeAny, {
642
+ program: string;
643
+ args: string[];
644
+ envAllowlist: string[];
645
+ cwd?: string | undefined;
646
+ }, {
647
+ program: string;
648
+ cwd?: string | undefined;
649
+ args?: string[] | undefined;
650
+ envAllowlist?: string[] | undefined;
651
+ }>, "many">>;
334
652
  }, "strict", z.ZodTypeAny, {
335
- commands: string[];
653
+ commands: {
654
+ program: string;
655
+ args: string[];
656
+ envAllowlist: string[];
657
+ cwd?: string | undefined;
658
+ }[];
336
659
  }, {
337
- commands?: string[] | undefined;
660
+ commands?: {
661
+ program: string;
662
+ cwd?: string | undefined;
663
+ args?: string[] | undefined;
664
+ envAllowlist?: string[] | undefined;
665
+ }[] | undefined;
338
666
  }>>;
339
667
  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"]>>;
668
+ routing_goal: z.ZodOptional<z.ZodEnum<["auto", "quality", "economy"]>>;
341
669
  }, "strict", z.ZodTypeAny, {
342
- portfolio: "daily-rich" | "balanced" | "cheapest" | "strongest" | "burn" | "subscription-first" | "api-overflow" | "conserve-claude" | "conserve-codex";
670
+ routing_goal?: "auto" | "quality" | "economy" | undefined;
343
671
  }, {
344
- portfolio?: "daily-rich" | "balanced" | "cheapest" | "strongest" | "burn" | "subscription-first" | "api-overflow" | "conserve-claude" | "conserve-codex" | undefined;
672
+ routing_goal?: "auto" | "quality" | "economy" | undefined;
345
673
  }>>;
346
674
  }, "strict", z.ZodTypeAny, {
347
675
  version: 1;
676
+ tests: {
677
+ commands: {
678
+ program: string;
679
+ args: string[];
680
+ envAllowlist: string[];
681
+ cwd?: string | undefined;
682
+ }[];
683
+ };
684
+ budget: {
685
+ routing_goal?: "auto" | "quality" | "economy" | undefined;
686
+ };
348
687
  context: {
349
688
  mandatory_files: string[];
350
689
  include: string[];
351
690
  exclude: string[];
352
691
  };
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
692
  }, {
360
693
  version?: 1 | undefined;
694
+ tests?: {
695
+ commands?: {
696
+ program: string;
697
+ cwd?: string | undefined;
698
+ args?: string[] | undefined;
699
+ envAllowlist?: string[] | undefined;
700
+ }[] | undefined;
701
+ } | undefined;
702
+ budget?: {
703
+ routing_goal?: "auto" | "quality" | "economy" | undefined;
704
+ } | undefined;
361
705
  context?: {
362
706
  mandatory_files?: string[] | undefined;
363
707
  include?: string[] | undefined;
364
708
  exclude?: string[] | undefined;
365
709
  } | 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
710
  }>;
373
711
  trust: z.ZodObject<{
374
712
  version: z.ZodDefault<z.ZodLiteral<1>>;
@@ -382,20 +720,67 @@ export declare const ResolvedConfig: z.ZodObject<{
382
720
  * carry null and surfaces disclose them as revocable only via CLI.
383
721
  */
384
722
  repo_root: z.ZodDefault<z.ZodNullable<z.ZodString>>;
723
+ test_command_grants: z.ZodDefault<z.ZodArray<z.ZodObject<{
724
+ projectDigest: z.ZodString;
725
+ configDigest: z.ZodString;
726
+ commandDigest: z.ZodString;
727
+ executablePath: z.ZodString;
728
+ executableDigest: z.ZodString;
729
+ scriptPath: z.ZodDefault<z.ZodNullable<z.ZodString>>;
730
+ scriptDigest: z.ZodDefault<z.ZodNullable<z.ZodString>>;
731
+ accessProfile: z.ZodEnum<["readonly", "workspace_write", "full", "external_sandbox_full", "inherit_native"]>;
732
+ }, "strict", z.ZodTypeAny, {
733
+ projectDigest: string;
734
+ configDigest: string;
735
+ commandDigest: string;
736
+ executablePath: string;
737
+ executableDigest: string;
738
+ scriptPath: string | null;
739
+ scriptDigest: string | null;
740
+ accessProfile: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native";
741
+ }, {
742
+ projectDigest: string;
743
+ configDigest: string;
744
+ commandDigest: string;
745
+ executablePath: string;
746
+ executableDigest: string;
747
+ accessProfile: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native";
748
+ scriptPath?: string | null | undefined;
749
+ scriptDigest?: string | null | undefined;
750
+ }>, "many">>;
385
751
  }, "strict", z.ZodTypeAny, {
386
752
  version: 1;
387
753
  access_default: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native";
388
754
  allow_full_access: boolean;
389
755
  repo_root: string | null;
756
+ test_command_grants: {
757
+ projectDigest: string;
758
+ configDigest: string;
759
+ commandDigest: string;
760
+ executablePath: string;
761
+ executableDigest: string;
762
+ scriptPath: string | null;
763
+ scriptDigest: string | null;
764
+ accessProfile: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native";
765
+ }[];
390
766
  }, {
391
767
  version?: 1 | undefined;
392
768
  access_default?: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native" | undefined;
393
769
  allow_full_access?: boolean | undefined;
394
770
  repo_root?: string | null | undefined;
771
+ test_command_grants?: {
772
+ projectDigest: string;
773
+ configDigest: string;
774
+ commandDigest: string;
775
+ executablePath: string;
776
+ executableDigest: string;
777
+ accessProfile: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native";
778
+ scriptPath?: string | null | undefined;
779
+ scriptDigest?: string | null | undefined;
780
+ }[] | undefined;
395
781
  }>;
396
782
  global: z.ZodObject<{
397
783
  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
784
  /**
400
785
  * How long an interactive run waits for the user's answer to a harness
401
786
  * question (interaction.requested) before delivering a benign decline and
@@ -414,43 +799,89 @@ export declare const ResolvedConfig: z.ZodObject<{
414
799
  env_inheritance: z.ZodDefault<z.ZodEnum<["mirror_native", "clean"]>>;
415
800
  /** Default auth route preference (subscription/api_key/auto). */
416
801
  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>>;
802
+ goal: z.ZodDefault<z.ZodEnum<["auto", "quality", "economy"]>>;
803
+ paid_fallback: z.ZodDefault<z.ZodEnum<["never", "when_unavailable", "allowed_within_cap"]>>;
804
+ 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<{
805
+ harness: z.ZodString;
806
+ model: z.ZodString;
807
+ effort: z.ZodEnum<["low", "medium", "high", "xhigh", "max"]>;
808
+ }, "strict", z.ZodTypeAny, {
809
+ harness: string;
810
+ model: string;
811
+ effort: "low" | "medium" | "high" | "xhigh" | "max";
812
+ }, {
813
+ harness: string;
814
+ model: string;
815
+ effort: "low" | "medium" | "high" | "xhigh" | "max";
816
+ }>, "many">, "many">>>;
423
817
  }, "strict", z.ZodTypeAny, {
424
818
  auth_preference: "auto" | "subscription" | "api_key";
425
819
  env_inheritance: "mirror_native" | "clean";
426
820
  primary_harness: string | null;
427
821
  eligible_harnesses: string[];
428
822
  default_policy: "auto" | "primary";
429
- quality_priors: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", number>>;
823
+ goal: "auto" | "quality" | "economy";
824
+ paid_fallback: "never" | "when_unavailable" | "allowed_within_cap";
825
+ quality_tiers: Partial<Record<"plan" | "audit" | "orchestrate" | "spec" | "implement" | "create_from_scratch" | "repair" | "review" | "verify" | "synthesize" | "explain", {
826
+ harness: string;
827
+ model: string;
828
+ effort: "low" | "medium" | "high" | "xhigh" | "max";
829
+ }[][]>>;
430
830
  }, {
431
831
  auth_preference?: "auto" | "subscription" | "api_key" | undefined;
432
832
  env_inheritance?: "mirror_native" | "clean" | undefined;
433
833
  primary_harness?: string | null | undefined;
434
834
  eligible_harnesses?: string[] | undefined;
435
835
  default_policy?: "auto" | "primary" | undefined;
436
- quality_priors?: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", number>> | undefined;
836
+ goal?: "auto" | "quality" | "economy" | undefined;
837
+ paid_fallback?: "never" | "when_unavailable" | "allowed_within_cap" | undefined;
838
+ quality_tiers?: Partial<Record<"plan" | "audit" | "orchestrate" | "spec" | "implement" | "create_from_scratch" | "repair" | "review" | "verify" | "synthesize" | "explain", {
839
+ harness: string;
840
+ model: string;
841
+ effort: "low" | "medium" | "high" | "xhigh" | "max";
842
+ }[][]>> | undefined;
437
843
  }>>;
438
844
  budget: z.ZodDefault<z.ZodObject<{
439
- max_usd_per_run: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
845
+ paid_budget_per_run: z.ZodDefault<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
846
+ kind: z.ZodLiteral<"unlimited">;
847
+ }, "strict", z.ZodTypeAny, {
848
+ kind: "unlimited";
849
+ }, {
850
+ kind: "unlimited";
851
+ }>, z.ZodObject<{
852
+ kind: z.ZodLiteral<"finite">;
853
+ maxUsd: z.ZodNumber;
854
+ }, "strict", z.ZodTypeAny, {
855
+ kind: "finite";
856
+ maxUsd: number;
857
+ }, {
858
+ kind: "finite";
859
+ maxUsd: number;
860
+ }>]>>;
440
861
  /**
441
862
  * Per-candidate reservation floor (USD) held against the run cap for
442
863
  * every race-wave slot AFTER the first, BEFORE any usage streams.
443
864
  * Makes concurrent in-flight candidates visible to the budget breaker
444
- * so a parallel wave cannot blow past `max_usd_per_run` between
865
+ * so a parallel wave cannot blow past the finite paid budget between
445
866
  * settlements. The first slot never holds it: a cap smaller than the
446
867
  * floor still runs one candidate and stops on real usage.
447
868
  */
448
869
  estimate_usd_floor: z.ZodDefault<z.ZodNumber>;
449
870
  }, "strict", z.ZodTypeAny, {
450
- max_usd_per_run: number | null;
871
+ paid_budget_per_run: {
872
+ kind: "unlimited";
873
+ } | {
874
+ kind: "finite";
875
+ maxUsd: number;
876
+ };
451
877
  estimate_usd_floor: number;
452
878
  }, {
453
- max_usd_per_run?: number | null | undefined;
879
+ paid_budget_per_run?: {
880
+ kind: "unlimited";
881
+ } | {
882
+ kind: "finite";
883
+ maxUsd: number;
884
+ } | undefined;
454
885
  estimate_usd_floor?: number | undefined;
455
886
  }>>;
456
887
  runtime: z.ZodDefault<z.ZodObject<{
@@ -500,13 +931,122 @@ export declare const ResolvedConfig: z.ZodObject<{
500
931
  reviewer_timeout_ms?: number | undefined;
501
932
  harness_inactivity_timeout_ms?: number | undefined;
502
933
  }>>;
934
+ /**
935
+ * Disk retention for engine-owned runtime artifacts (W3.6). The daemon's
936
+ * retention service deletes ONLY terminal, unreferenced run trees past
937
+ * their age — active/queued/blocked runs, runs referenced by live
938
+ * threads, and undelivered/applyable work products always survive, and
939
+ * the newest N runs per project survive regardless of age.
940
+ */
941
+ retention: z.ZodDefault<z.ZodObject<{
942
+ runs_max_age_days: z.ZodDefault<z.ZodNumber>;
943
+ reviews_max_age_days: z.ZodDefault<z.ZodNumber>;
944
+ keep_last_runs_per_project: z.ZodDefault<z.ZodNumber>;
945
+ }, "strict", z.ZodTypeAny, {
946
+ runs_max_age_days: number;
947
+ reviews_max_age_days: number;
948
+ keep_last_runs_per_project: number;
949
+ }, {
950
+ runs_max_age_days?: number | undefined;
951
+ reviews_max_age_days?: number | undefined;
952
+ keep_last_runs_per_project?: number | undefined;
953
+ }>>;
954
+ /**
955
+ * Durable NON-SECRET credential-profile registry (INV-135): additional
956
+ * credential identities per harness beyond the engine default. Uniqueness
957
+ * of (harness_id, profile_id) is enforced here; secret material lives in
958
+ * the vendor dir or the secret store, never in config.
959
+ */
960
+ credential_profiles: z.ZodEffects<z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodObject<{
961
+ profile_id: z.ZodString;
962
+ harness_id: z.ZodString;
963
+ display_name: z.ZodString;
964
+ credential_kind: z.ZodEnum<["config_dir_login", "oauth_token", "api_key"]>;
965
+ isolation_locator: z.ZodDefault<z.ZodNullable<z.ZodString>>;
966
+ secret_ref: z.ZodDefault<z.ZodNullable<z.ZodString>>;
967
+ enabled: z.ZodDefault<z.ZodBoolean>;
968
+ created_at: z.ZodDefault<z.ZodNullable<z.ZodString>>;
969
+ }, "strict", z.ZodTypeAny, {
970
+ profile_id: string;
971
+ harness_id: string;
972
+ display_name: string;
973
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
974
+ isolation_locator: string | null;
975
+ secret_ref: string | null;
976
+ enabled: boolean;
977
+ created_at: string | null;
978
+ }, {
979
+ profile_id: string;
980
+ harness_id: string;
981
+ display_name: string;
982
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
983
+ isolation_locator?: string | null | undefined;
984
+ secret_ref?: string | null | undefined;
985
+ enabled?: boolean | undefined;
986
+ created_at?: string | null | undefined;
987
+ }>, {
988
+ profile_id: string;
989
+ harness_id: string;
990
+ display_name: string;
991
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
992
+ isolation_locator: string | null;
993
+ secret_ref: string | null;
994
+ enabled: boolean;
995
+ created_at: string | null;
996
+ }, {
997
+ profile_id: string;
998
+ harness_id: string;
999
+ display_name: string;
1000
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
1001
+ isolation_locator?: string | null | undefined;
1002
+ secret_ref?: string | null | undefined;
1003
+ enabled?: boolean | undefined;
1004
+ created_at?: string | null | undefined;
1005
+ }>, "many">>, {
1006
+ profile_id: string;
1007
+ harness_id: string;
1008
+ display_name: string;
1009
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
1010
+ isolation_locator: string | null;
1011
+ secret_ref: string | null;
1012
+ enabled: boolean;
1013
+ created_at: string | null;
1014
+ }[], {
1015
+ profile_id: string;
1016
+ harness_id: string;
1017
+ display_name: string;
1018
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
1019
+ isolation_locator?: string | null | undefined;
1020
+ secret_ref?: string | null | undefined;
1021
+ enabled?: boolean | undefined;
1022
+ created_at?: string | null | undefined;
1023
+ }[] | undefined>;
503
1024
  harnesses: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
504
1025
  enabled: z.ZodDefault<z.ZodBoolean>;
505
1026
  default_model: z.ZodDefault<z.ZodNullable<z.ZodString>>;
506
1027
  effort: z.ZodDefault<z.ZodNullable<z.ZodEnum<["low", "medium", "high", "xhigh", "max"]>>>;
507
1028
  max_turns: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
508
1029
  max_rounds: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
509
- max_usd: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
1030
+ /**
1031
+ * ONE typed profile-selection policy (INV-135, W5.4): what happens
1032
+ * when the selected credential profile hits its vendor limit.
1033
+ * Rotation is OPT-IN and rotates only on typed vendor-limit
1034
+ * signals or proactive headroom breaches — never on ordinary
1035
+ * network errors.
1036
+ */
1037
+ profile_policy: z.ZodDefault<z.ZodObject<{
1038
+ limit_action: z.ZodDefault<z.ZodEnum<["fail", "ask", "rotate"]>>;
1039
+ rotation_eligible: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
1040
+ headroom_threshold: z.ZodDefault<z.ZodNumber>;
1041
+ }, "strict", z.ZodTypeAny, {
1042
+ limit_action: "ask" | "fail" | "rotate";
1043
+ rotation_eligible: string[];
1044
+ headroom_threshold: number;
1045
+ }, {
1046
+ limit_action?: "ask" | "fail" | "rotate" | undefined;
1047
+ rotation_eligible?: string[] | undefined;
1048
+ headroom_threshold?: number | undefined;
1049
+ }>>;
510
1050
  tools_allow: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
511
1051
  tools_deny: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
512
1052
  fallback_model: z.ZodDefault<z.ZodNullable<z.ZodString>>;
@@ -515,26 +1055,34 @@ export declare const ResolvedConfig: z.ZodObject<{
515
1055
  auth_preference: z.ZodDefault<z.ZodEnum<["subscription", "api_key", "auto"]>>;
516
1056
  }, "strict", z.ZodTypeAny, {
517
1057
  fallback_model: string | null;
518
- max_turns: number | null;
1058
+ enabled: boolean;
519
1059
  web: "off" | "auto" | "cached" | "live";
520
- max_usd: number | null;
1060
+ max_turns: number | null;
521
1061
  auth_preference: "auto" | "subscription" | "api_key";
522
- enabled: boolean;
523
- default_model: string | null;
524
1062
  effort: "low" | "medium" | "high" | "xhigh" | "max" | null;
1063
+ default_model: string | null;
525
1064
  max_rounds: number | null;
1065
+ profile_policy: {
1066
+ limit_action: "ask" | "fail" | "rotate";
1067
+ rotation_eligible: string[];
1068
+ headroom_threshold: number;
1069
+ };
526
1070
  tools_allow: string[];
527
1071
  tools_deny: string[];
528
1072
  }, {
529
1073
  fallback_model?: string | null | undefined;
530
- max_turns?: number | null | undefined;
1074
+ enabled?: boolean | undefined;
531
1075
  web?: "off" | "auto" | "cached" | "live" | undefined;
532
- max_usd?: number | null | undefined;
1076
+ max_turns?: number | null | undefined;
533
1077
  auth_preference?: "auto" | "subscription" | "api_key" | undefined;
534
- enabled?: boolean | undefined;
535
- default_model?: string | null | undefined;
536
1078
  effort?: "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
1079
+ default_model?: string | null | undefined;
537
1080
  max_rounds?: number | null | undefined;
1081
+ profile_policy?: {
1082
+ limit_action?: "ask" | "fail" | "rotate" | undefined;
1083
+ rotation_eligible?: string[] | undefined;
1084
+ headroom_threshold?: number | undefined;
1085
+ } | undefined;
538
1086
  tools_allow?: string[] | undefined;
539
1087
  tools_deny?: string[] | undefined;
540
1088
  }>>>;
@@ -542,22 +1090,30 @@ export declare const ResolvedConfig: z.ZodObject<{
542
1090
  version: 1;
543
1091
  harnesses: Record<string, {
544
1092
  fallback_model: string | null;
545
- max_turns: number | null;
1093
+ enabled: boolean;
546
1094
  web: "off" | "auto" | "cached" | "live";
547
- max_usd: number | null;
1095
+ max_turns: number | null;
548
1096
  auth_preference: "auto" | "subscription" | "api_key";
549
- enabled: boolean;
550
- default_model: string | null;
551
1097
  effort: "low" | "medium" | "high" | "xhigh" | "max" | null;
1098
+ default_model: string | null;
552
1099
  max_rounds: number | null;
1100
+ profile_policy: {
1101
+ limit_action: "ask" | "fail" | "rotate";
1102
+ rotation_eligible: string[];
1103
+ headroom_threshold: number;
1104
+ };
553
1105
  tools_allow: string[];
554
1106
  tools_deny: string[];
555
1107
  }>;
556
1108
  budget: {
557
- max_usd_per_run: number | null;
1109
+ paid_budget_per_run: {
1110
+ kind: "unlimited";
1111
+ } | {
1112
+ kind: "finite";
1113
+ maxUsd: number;
1114
+ };
558
1115
  estimate_usd_floor: number;
559
1116
  };
560
- default_portfolio: "daily-rich" | "balanced" | "cheapest" | "strongest" | "burn" | "subscription-first" | "api-overflow" | "conserve-claude" | "conserve-codex";
561
1117
  interaction_timeout_ms: number;
562
1118
  routing: {
563
1119
  auth_preference: "auto" | "subscription" | "api_key";
@@ -565,7 +1121,13 @@ export declare const ResolvedConfig: z.ZodObject<{
565
1121
  primary_harness: string | null;
566
1122
  eligible_harnesses: string[];
567
1123
  default_policy: "auto" | "primary";
568
- quality_priors: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", number>>;
1124
+ goal: "auto" | "quality" | "economy";
1125
+ paid_fallback: "never" | "when_unavailable" | "allowed_within_cap";
1126
+ quality_tiers: Partial<Record<"plan" | "audit" | "orchestrate" | "spec" | "implement" | "create_from_scratch" | "repair" | "review" | "verify" | "synthesize" | "explain", {
1127
+ harness: string;
1128
+ model: string;
1129
+ effort: "low" | "medium" | "high" | "xhigh" | "max";
1130
+ }[][]>>;
569
1131
  };
570
1132
  runtime: {
571
1133
  transient_retry: {
@@ -576,26 +1138,49 @@ export declare const ResolvedConfig: z.ZodObject<{
576
1138
  reviewer_timeout_ms: number;
577
1139
  harness_inactivity_timeout_ms: number;
578
1140
  };
1141
+ retention: {
1142
+ runs_max_age_days: number;
1143
+ reviews_max_age_days: number;
1144
+ keep_last_runs_per_project: number;
1145
+ };
1146
+ credential_profiles: {
1147
+ profile_id: string;
1148
+ harness_id: string;
1149
+ display_name: string;
1150
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
1151
+ isolation_locator: string | null;
1152
+ secret_ref: string | null;
1153
+ enabled: boolean;
1154
+ created_at: string | null;
1155
+ }[];
579
1156
  }, {
580
1157
  version?: 1 | undefined;
581
1158
  harnesses?: Record<string, {
582
1159
  fallback_model?: string | null | undefined;
583
- max_turns?: number | null | undefined;
1160
+ enabled?: boolean | undefined;
584
1161
  web?: "off" | "auto" | "cached" | "live" | undefined;
585
- max_usd?: number | null | undefined;
1162
+ max_turns?: number | null | undefined;
586
1163
  auth_preference?: "auto" | "subscription" | "api_key" | undefined;
587
- enabled?: boolean | undefined;
588
- default_model?: string | null | undefined;
589
1164
  effort?: "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
1165
+ default_model?: string | null | undefined;
590
1166
  max_rounds?: number | null | undefined;
1167
+ profile_policy?: {
1168
+ limit_action?: "ask" | "fail" | "rotate" | undefined;
1169
+ rotation_eligible?: string[] | undefined;
1170
+ headroom_threshold?: number | undefined;
1171
+ } | undefined;
591
1172
  tools_allow?: string[] | undefined;
592
1173
  tools_deny?: string[] | undefined;
593
1174
  }> | undefined;
594
1175
  budget?: {
595
- max_usd_per_run?: number | null | undefined;
1176
+ paid_budget_per_run?: {
1177
+ kind: "unlimited";
1178
+ } | {
1179
+ kind: "finite";
1180
+ maxUsd: number;
1181
+ } | undefined;
596
1182
  estimate_usd_floor?: number | undefined;
597
1183
  } | undefined;
598
- default_portfolio?: "daily-rich" | "balanced" | "cheapest" | "strongest" | "burn" | "subscription-first" | "api-overflow" | "conserve-claude" | "conserve-codex" | undefined;
599
1184
  interaction_timeout_ms?: number | undefined;
600
1185
  routing?: {
601
1186
  auth_preference?: "auto" | "subscription" | "api_key" | undefined;
@@ -603,7 +1188,13 @@ export declare const ResolvedConfig: z.ZodObject<{
603
1188
  primary_harness?: string | null | undefined;
604
1189
  eligible_harnesses?: string[] | undefined;
605
1190
  default_policy?: "auto" | "primary" | undefined;
606
- quality_priors?: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", number>> | undefined;
1191
+ goal?: "auto" | "quality" | "economy" | undefined;
1192
+ paid_fallback?: "never" | "when_unavailable" | "allowed_within_cap" | undefined;
1193
+ quality_tiers?: Partial<Record<"plan" | "audit" | "orchestrate" | "spec" | "implement" | "create_from_scratch" | "repair" | "review" | "verify" | "synthesize" | "explain", {
1194
+ harness: string;
1195
+ model: string;
1196
+ effort: "low" | "medium" | "high" | "xhigh" | "max";
1197
+ }[][]>> | undefined;
607
1198
  } | undefined;
608
1199
  runtime?: {
609
1200
  transient_retry?: {
@@ -614,49 +1205,87 @@ export declare const ResolvedConfig: z.ZodObject<{
614
1205
  reviewer_timeout_ms?: number | undefined;
615
1206
  harness_inactivity_timeout_ms?: number | undefined;
616
1207
  } | undefined;
1208
+ retention?: {
1209
+ runs_max_age_days?: number | undefined;
1210
+ reviews_max_age_days?: number | undefined;
1211
+ keep_last_runs_per_project?: number | undefined;
1212
+ } | undefined;
1213
+ credential_profiles?: {
1214
+ profile_id: string;
1215
+ harness_id: string;
1216
+ display_name: string;
1217
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
1218
+ isolation_locator?: string | null | undefined;
1219
+ secret_ref?: string | null | undefined;
1220
+ enabled?: boolean | undefined;
1221
+ created_at?: string | null | undefined;
1222
+ }[] | undefined;
617
1223
  }>;
618
1224
  sources: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
619
1225
  }, "strip", z.ZodTypeAny, {
620
1226
  project: {
621
1227
  version: 1;
1228
+ tests: {
1229
+ commands: {
1230
+ program: string;
1231
+ args: string[];
1232
+ envAllowlist: string[];
1233
+ cwd?: string | undefined;
1234
+ }[];
1235
+ };
1236
+ budget: {
1237
+ routing_goal?: "auto" | "quality" | "economy" | undefined;
1238
+ };
622
1239
  context: {
623
1240
  mandatory_files: string[];
624
1241
  include: string[];
625
1242
  exclude: string[];
626
1243
  };
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
1244
  };
634
1245
  trust: {
635
1246
  version: 1;
636
1247
  access_default: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native";
637
1248
  allow_full_access: boolean;
638
1249
  repo_root: string | null;
1250
+ test_command_grants: {
1251
+ projectDigest: string;
1252
+ configDigest: string;
1253
+ commandDigest: string;
1254
+ executablePath: string;
1255
+ executableDigest: string;
1256
+ scriptPath: string | null;
1257
+ scriptDigest: string | null;
1258
+ accessProfile: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native";
1259
+ }[];
639
1260
  };
640
1261
  global: {
641
1262
  version: 1;
642
1263
  harnesses: Record<string, {
643
1264
  fallback_model: string | null;
644
- max_turns: number | null;
1265
+ enabled: boolean;
645
1266
  web: "off" | "auto" | "cached" | "live";
646
- max_usd: number | null;
1267
+ max_turns: number | null;
647
1268
  auth_preference: "auto" | "subscription" | "api_key";
648
- enabled: boolean;
649
- default_model: string | null;
650
1269
  effort: "low" | "medium" | "high" | "xhigh" | "max" | null;
1270
+ default_model: string | null;
651
1271
  max_rounds: number | null;
1272
+ profile_policy: {
1273
+ limit_action: "ask" | "fail" | "rotate";
1274
+ rotation_eligible: string[];
1275
+ headroom_threshold: number;
1276
+ };
652
1277
  tools_allow: string[];
653
1278
  tools_deny: string[];
654
1279
  }>;
655
1280
  budget: {
656
- max_usd_per_run: number | null;
1281
+ paid_budget_per_run: {
1282
+ kind: "unlimited";
1283
+ } | {
1284
+ kind: "finite";
1285
+ maxUsd: number;
1286
+ };
657
1287
  estimate_usd_floor: number;
658
1288
  };
659
- default_portfolio: "daily-rich" | "balanced" | "cheapest" | "strongest" | "burn" | "subscription-first" | "api-overflow" | "conserve-claude" | "conserve-codex";
660
1289
  interaction_timeout_ms: number;
661
1290
  routing: {
662
1291
  auth_preference: "auto" | "subscription" | "api_key";
@@ -664,7 +1293,13 @@ export declare const ResolvedConfig: z.ZodObject<{
664
1293
  primary_harness: string | null;
665
1294
  eligible_harnesses: string[];
666
1295
  default_policy: "auto" | "primary";
667
- quality_priors: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", number>>;
1296
+ goal: "auto" | "quality" | "economy";
1297
+ paid_fallback: "never" | "when_unavailable" | "allowed_within_cap";
1298
+ quality_tiers: Partial<Record<"plan" | "audit" | "orchestrate" | "spec" | "implement" | "create_from_scratch" | "repair" | "review" | "verify" | "synthesize" | "explain", {
1299
+ harness: string;
1300
+ model: string;
1301
+ effort: "low" | "medium" | "high" | "xhigh" | "max";
1302
+ }[][]>>;
668
1303
  };
669
1304
  runtime: {
670
1305
  transient_retry: {
@@ -675,49 +1310,87 @@ export declare const ResolvedConfig: z.ZodObject<{
675
1310
  reviewer_timeout_ms: number;
676
1311
  harness_inactivity_timeout_ms: number;
677
1312
  };
1313
+ retention: {
1314
+ runs_max_age_days: number;
1315
+ reviews_max_age_days: number;
1316
+ keep_last_runs_per_project: number;
1317
+ };
1318
+ credential_profiles: {
1319
+ profile_id: string;
1320
+ harness_id: string;
1321
+ display_name: string;
1322
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
1323
+ isolation_locator: string | null;
1324
+ secret_ref: string | null;
1325
+ enabled: boolean;
1326
+ created_at: string | null;
1327
+ }[];
678
1328
  };
679
1329
  sources: string[];
680
1330
  }, {
681
1331
  project: {
682
1332
  version?: 1 | undefined;
1333
+ tests?: {
1334
+ commands?: {
1335
+ program: string;
1336
+ cwd?: string | undefined;
1337
+ args?: string[] | undefined;
1338
+ envAllowlist?: string[] | undefined;
1339
+ }[] | undefined;
1340
+ } | undefined;
1341
+ budget?: {
1342
+ routing_goal?: "auto" | "quality" | "economy" | undefined;
1343
+ } | undefined;
683
1344
  context?: {
684
1345
  mandatory_files?: string[] | undefined;
685
1346
  include?: string[] | undefined;
686
1347
  exclude?: string[] | undefined;
687
1348
  } | 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
1349
  };
695
1350
  trust: {
696
1351
  version?: 1 | undefined;
697
1352
  access_default?: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native" | undefined;
698
1353
  allow_full_access?: boolean | undefined;
699
1354
  repo_root?: string | null | undefined;
1355
+ test_command_grants?: {
1356
+ projectDigest: string;
1357
+ configDigest: string;
1358
+ commandDigest: string;
1359
+ executablePath: string;
1360
+ executableDigest: string;
1361
+ accessProfile: "readonly" | "workspace_write" | "full" | "external_sandbox_full" | "inherit_native";
1362
+ scriptPath?: string | null | undefined;
1363
+ scriptDigest?: string | null | undefined;
1364
+ }[] | undefined;
700
1365
  };
701
1366
  global: {
702
1367
  version?: 1 | undefined;
703
1368
  harnesses?: Record<string, {
704
1369
  fallback_model?: string | null | undefined;
705
- max_turns?: number | null | undefined;
1370
+ enabled?: boolean | undefined;
706
1371
  web?: "off" | "auto" | "cached" | "live" | undefined;
707
- max_usd?: number | null | undefined;
1372
+ max_turns?: number | null | undefined;
708
1373
  auth_preference?: "auto" | "subscription" | "api_key" | undefined;
709
- enabled?: boolean | undefined;
710
- default_model?: string | null | undefined;
711
1374
  effort?: "low" | "medium" | "high" | "xhigh" | "max" | null | undefined;
1375
+ default_model?: string | null | undefined;
712
1376
  max_rounds?: number | null | undefined;
1377
+ profile_policy?: {
1378
+ limit_action?: "ask" | "fail" | "rotate" | undefined;
1379
+ rotation_eligible?: string[] | undefined;
1380
+ headroom_threshold?: number | undefined;
1381
+ } | undefined;
713
1382
  tools_allow?: string[] | undefined;
714
1383
  tools_deny?: string[] | undefined;
715
1384
  }> | undefined;
716
1385
  budget?: {
717
- max_usd_per_run?: number | null | undefined;
1386
+ paid_budget_per_run?: {
1387
+ kind: "unlimited";
1388
+ } | {
1389
+ kind: "finite";
1390
+ maxUsd: number;
1391
+ } | undefined;
718
1392
  estimate_usd_floor?: number | undefined;
719
1393
  } | undefined;
720
- default_portfolio?: "daily-rich" | "balanced" | "cheapest" | "strongest" | "burn" | "subscription-first" | "api-overflow" | "conserve-claude" | "conserve-codex" | undefined;
721
1394
  interaction_timeout_ms?: number | undefined;
722
1395
  routing?: {
723
1396
  auth_preference?: "auto" | "subscription" | "api_key" | undefined;
@@ -725,7 +1398,13 @@ export declare const ResolvedConfig: z.ZodObject<{
725
1398
  primary_harness?: string | null | undefined;
726
1399
  eligible_harnesses?: string[] | undefined;
727
1400
  default_policy?: "auto" | "primary" | undefined;
728
- quality_priors?: Partial<Record<"openai" | "anthropic" | "google" | "cursor" | "opencode" | "xai" | "local" | "unknown", number>> | undefined;
1401
+ goal?: "auto" | "quality" | "economy" | undefined;
1402
+ paid_fallback?: "never" | "when_unavailable" | "allowed_within_cap" | undefined;
1403
+ quality_tiers?: Partial<Record<"plan" | "audit" | "orchestrate" | "spec" | "implement" | "create_from_scratch" | "repair" | "review" | "verify" | "synthesize" | "explain", {
1404
+ harness: string;
1405
+ model: string;
1406
+ effort: "low" | "medium" | "high" | "xhigh" | "max";
1407
+ }[][]>> | undefined;
729
1408
  } | undefined;
730
1409
  runtime?: {
731
1410
  transient_retry?: {
@@ -736,6 +1415,21 @@ export declare const ResolvedConfig: z.ZodObject<{
736
1415
  reviewer_timeout_ms?: number | undefined;
737
1416
  harness_inactivity_timeout_ms?: number | undefined;
738
1417
  } | undefined;
1418
+ retention?: {
1419
+ runs_max_age_days?: number | undefined;
1420
+ reviews_max_age_days?: number | undefined;
1421
+ keep_last_runs_per_project?: number | undefined;
1422
+ } | undefined;
1423
+ credential_profiles?: {
1424
+ profile_id: string;
1425
+ harness_id: string;
1426
+ display_name: string;
1427
+ credential_kind: "api_key" | "config_dir_login" | "oauth_token";
1428
+ isolation_locator?: string | null | undefined;
1429
+ secret_ref?: string | null | undefined;
1430
+ enabled?: boolean | undefined;
1431
+ created_at?: string | null | undefined;
1432
+ }[] | undefined;
739
1433
  };
740
1434
  sources?: string[] | undefined;
741
1435
  }>;