devcontour-harness 0.1.0-alpha.30 → 0.1.0-alpha.34

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 (97) hide show
  1. package/README.md +43 -16
  2. package/docs/architecture.md +12 -0
  3. package/docs/compatibility.md +21 -18
  4. package/docs/contracts.md +270 -12
  5. package/docs/release-notes/0.1.0-alpha.31.md +44 -0
  6. package/docs/release-notes/0.1.0-alpha.32.md +33 -0
  7. package/docs/release-notes/0.1.0-alpha.33.md +29 -0
  8. package/docs/release-notes/0.1.0-alpha.34.md +32 -0
  9. package/docs/upgrade.md +181 -0
  10. package/lib/agents/cli-adapter.js +1 -0
  11. package/lib/cli.js +25 -3
  12. package/lib/contracts/cli.d.ts +1381 -18
  13. package/lib/contracts/cli.js +43 -1
  14. package/lib/contracts/diagnosis.d.ts +2 -1
  15. package/lib/contracts/diagnosis.js +1 -0
  16. package/lib/contracts/events.d.ts +760 -5
  17. package/lib/contracts/events.js +109 -3
  18. package/lib/contracts/execution.d.ts +112 -1
  19. package/lib/contracts/execution.js +38 -0
  20. package/lib/contracts/failure.d.ts +6 -1
  21. package/lib/contracts/failure.js +5 -1
  22. package/lib/contracts/handoff.d.ts +702 -0
  23. package/lib/contracts/handoff.js +305 -0
  24. package/lib/contracts/index.d.ts +1 -0
  25. package/lib/contracts/index.js +1 -0
  26. package/lib/contracts/policy.d.ts +27 -1
  27. package/lib/contracts/policy.js +38 -2
  28. package/lib/contracts/published.d.ts +1016 -3
  29. package/lib/contracts/published.js +2 -0
  30. package/lib/contracts/repair-policy.js +5 -0
  31. package/lib/contracts/report.d.ts +118 -2
  32. package/lib/contracts/report.js +61 -3
  33. package/lib/control/base-move.d.ts +7 -2
  34. package/lib/control/base-move.js +14 -1
  35. package/lib/control/harness.d.ts +81 -19
  36. package/lib/control/harness.js +8 -93
  37. package/lib/control/recovery.d.ts +1 -1
  38. package/lib/control/status.d.ts +235 -0
  39. package/lib/control/status.js +101 -0
  40. package/lib/engine/budget.d.ts +78 -0
  41. package/lib/engine/budget.js +13 -2
  42. package/lib/engine/classify.d.ts +14 -1
  43. package/lib/engine/classify.js +34 -0
  44. package/lib/engine/engine.d.ts +31 -11
  45. package/lib/engine/engine.js +99 -5
  46. package/lib/engine/joint-runner.d.ts +6 -0
  47. package/lib/engine/joint-runner.js +20 -4
  48. package/lib/engine/property-recovery.js +1 -0
  49. package/lib/engine/reuse.js +1 -0
  50. package/lib/engine/runner.d.ts +8 -0
  51. package/lib/engine/runner.js +120 -16
  52. package/lib/engine/stall-sweep.d.ts +137 -0
  53. package/lib/engine/stall-sweep.js +393 -0
  54. package/lib/environment/activity.d.ts +34 -0
  55. package/lib/environment/activity.js +55 -0
  56. package/lib/environment/isolation.d.ts +67 -3
  57. package/lib/environment/isolation.js +148 -5
  58. package/lib/environment/lifecycle.js +2 -1
  59. package/lib/environment/process.d.ts +7 -1
  60. package/lib/environment/process.js +14 -0
  61. package/lib/environment/redaction.d.ts +2 -0
  62. package/lib/environment/redaction.js +19 -0
  63. package/lib/explain/state.d.ts +26 -5
  64. package/lib/explain/state.js +41 -0
  65. package/lib/handoff/index.d.ts +2 -0
  66. package/lib/handoff/index.js +3 -0
  67. package/lib/handoff/markdown.d.ts +6 -0
  68. package/lib/handoff/markdown.js +155 -0
  69. package/lib/handoff/pack.d.ts +79 -0
  70. package/lib/handoff/pack.js +531 -0
  71. package/lib/index.d.ts +19 -3
  72. package/lib/index.js +18 -1
  73. package/lib/integrations/connector/redact.d.ts +2 -13
  74. package/lib/integrations/connector/redact.js +2 -21
  75. package/lib/integrations/connector/testing.js +1 -1
  76. package/lib/projections/attempt.d.ts +28 -0
  77. package/lib/projections/attempt.js +14 -0
  78. package/lib/projections/next.d.ts +3 -1
  79. package/lib/projections/next.js +4 -1
  80. package/lib/projections/stop.d.ts +22 -1
  81. package/lib/projections/stop.js +73 -15
  82. package/lib/report/compute.js +229 -21
  83. package/lib/report/document.js +31 -7
  84. package/lib/storage/document.d.ts +28 -6
  85. package/lib/storage/sqlite.d.ts +2 -0
  86. package/lib/storage/sqlite.js +9 -1
  87. package/lib/verification/gates-at.d.ts +11 -1
  88. package/lib/verification/gates-at.js +28 -2
  89. package/lib/verification/gates.d.ts +3 -1
  90. package/lib/verification/gates.js +25 -4
  91. package/package.json +1 -1
  92. package/schemas/execution-document.schema.json +68 -0
  93. package/schemas/execution-policy.schema.json +32 -0
  94. package/schemas/handoff-pack.schema.json +1430 -0
  95. package/schemas/run-event.schema.json +679 -0
  96. package/schemas/stop-diagnosis.schema.json +1 -0
  97. package/schemas/value-report.schema.json +236 -3
@@ -0,0 +1,702 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Пакет передачи контекста (`harness handoff`, `handoffPack`): состояние доски
4
+ * для следующей сессии ведущего агента, собранное из хранилища, а не из
5
+ * памяти агента. Факты — только из сохранённого состояния; свободный текст
6
+ * агента — только `intentions`.
7
+ *
8
+ * Пакет ограничен по размеру, чтобы поместиться в контекст агента: списки
9
+ * обрезаются по `HANDOFF_LIMITS` (число отброшенного — в `truncated`), каждая
10
+ * строка из хранилища очищается от escape-последовательностей и управляющих
11
+ * символов и усекается до предела своего поля с «…» (без разрыва суррогатной
12
+ * пары), а сериализованный пакет не больше `HANDOFF_MAX_BYTES` байт UTF-8:
13
+ * сверх него записи отбрасываются (`truncated.bySize`).
14
+ *
15
+ * Литералы `nextSteps` повторяют `src/projections/next.ts` (модуль без zod);
16
+ * тест сверяет оба перечня поэлементно.
17
+ */
18
+ export declare const HANDOFF_VERSION = 1;
19
+ export declare const HANDOFF_LIMITS: {
20
+ /** Открытые поручения (не принятые и не отменённые). */
21
+ readonly works: 50;
22
+ /** Остановки и решения (`explain`), после свёртки одинаковых. */
23
+ readonly stops: 30;
24
+ /** Ссылки evidence одной остановки. */
25
+ readonly evidence: 5;
26
+ /** Поручения, перечисленные у свёрнутой остановки. */
27
+ readonly stopWorks: 20;
28
+ /** Последние провалы попыток, новые первыми. */
29
+ readonly failures: 10;
30
+ /** Незавершённые записи попыток. */
31
+ readonly unfinished: 20;
32
+ /** Блокировки одного поручения. */
33
+ readonly blockers: 3;
34
+ /** Строки бюджетов (общий и групп — первыми). */
35
+ readonly budgets: 20;
36
+ /** Задания графов с восстановлениями. */
37
+ readonly repairs: 10;
38
+ /** Намерения агента и знаков в каждом. */
39
+ readonly intentions: 20;
40
+ readonly intentionChars: 1000;
41
+ /** Предел строки факта из хранилища. */
42
+ readonly text: 300;
43
+ /** Предел идентификатора, имени стадии, владельца из хранилища. */
44
+ readonly name: 200;
45
+ };
46
+ /** Предел сериализованного пакета (JSON, UTF-8). */
47
+ export declare const HANDOFF_MAX_BYTES: number;
48
+ /**
49
+ * Наименьший предел, который хост может задать пакету (`maxBytes` у
50
+ * `handoffPack`): ниже него не помещается даже обычный минимальный пакет.
51
+ * Это не гарантия: записи, которые не отбрасываются (сводка, очередь, идущие
52
+ * попытки, задания, следующий шаг), могут не уложиться и в больший предел.
53
+ */
54
+ export declare const HANDOFF_MIN_BYTES: number;
55
+ export declare const handoffNextSteps: readonly ["accepted", "cancelled", "recovery-awaiting-lead", "recovery-analyzing", "recovery-applying", "recovery-retry-allowed", "recovery-retrying", "recovery-awaiting-user", "recovery-stopped", "corpus-adoption", "held", "plan-review", "attempt-running", "retry-within-budget", "attempts-exhausted", "awaiting-claim"];
56
+ /** Команда harness, которая выполняет следующий шаг, когда он — запуск команды. */
57
+ export declare const handoffCommands: readonly ["harness run", "harness resume"];
58
+ export declare const handoffPackSchema: z.ZodObject<{
59
+ handoffVersion: z.ZodLiteral<1>;
60
+ at: z.ZodISODateTime;
61
+ graphId: z.ZodOptional<z.ZodString>;
62
+ limits: z.ZodObject<{
63
+ maxAttempts: z.ZodNumber;
64
+ repairBudget: z.ZodNumber;
65
+ }, z.core.$strict>;
66
+ summary: z.ZodObject<{
67
+ works: z.ZodNumber;
68
+ open: z.ZodNumber;
69
+ done: z.ZodNumber;
70
+ cancelled: z.ZodNumber;
71
+ byStatus: z.ZodArray<z.ZodObject<{
72
+ status: z.ZodEnum<{
73
+ ready: "ready";
74
+ failed: "failed";
75
+ cancelled: "cancelled";
76
+ draft: "draft";
77
+ running: "running";
78
+ verifying: "verifying";
79
+ reviewing: "reviewing";
80
+ integrating: "integrating";
81
+ done: "done";
82
+ }>;
83
+ count: z.ZodNumber;
84
+ }, z.core.$strict>>;
85
+ }, z.core.$strict>;
86
+ queue: z.ZodObject<{
87
+ paused: z.ZodBoolean;
88
+ reason: z.ZodOptional<z.ZodEnum<{
89
+ runtime: "runtime";
90
+ operator: "operator";
91
+ shutdown: "shutdown";
92
+ "base-check": "base-check";
93
+ reconfigure: "reconfigure";
94
+ }>>;
95
+ detail: z.ZodOptional<z.ZodString>;
96
+ since: z.ZodOptional<z.ZodISODateTime>;
97
+ operation: z.ZodOptional<z.ZodString>;
98
+ failures: z.ZodOptional<z.ZodArray<z.ZodEnum<{
99
+ gate: "gate";
100
+ unknown: "unknown";
101
+ review: "review";
102
+ cancelled: "cancelled";
103
+ environment: "environment";
104
+ timeout: "timeout";
105
+ "provider-auth": "provider-auth";
106
+ stalled: "stalled";
107
+ "stale-base": "stale-base";
108
+ "empty-result": "empty-result";
109
+ unfinished: "unfinished";
110
+ "scope-violation": "scope-violation";
111
+ "review-protocol": "review-protocol";
112
+ merge: "merge";
113
+ budget: "budget";
114
+ "needs-lead": "needs-lead";
115
+ }>>>;
116
+ liftedByRun: z.ZodOptional<z.ZodLiteral<true>>;
117
+ code: z.ZodOptional<z.ZodEnum<{
118
+ INVALID_INPUT: "INVALID_INPUT";
119
+ UNSUPPORTED_COMMAND: "UNSUPPORTED_COMMAND";
120
+ UNSUPPORTED_VERSION: "UNSUPPORTED_VERSION";
121
+ GRAPH_CYCLE: "GRAPH_CYCLE";
122
+ GRAPH_UNKNOWN_DEPENDENCY: "GRAPH_UNKNOWN_DEPENDENCY";
123
+ GRAPH_DUPLICATE_ID: "GRAPH_DUPLICATE_ID";
124
+ GATE_UNKNOWN: "GATE_UNKNOWN";
125
+ GATE_GROUP_CYCLE: "GATE_GROUP_CYCLE";
126
+ REVIEWER_SAME_VENDOR: "REVIEWER_SAME_VENDOR";
127
+ REVIEWER_MISSING: "REVIEWER_MISSING";
128
+ RESPONSE_TOO_LARGE: "RESPONSE_TOO_LARGE";
129
+ APPROVAL_STALE: "APPROVAL_STALE";
130
+ APPROVAL_REQUIRED: "APPROVAL_REQUIRED";
131
+ LEASE_STALE: "LEASE_STALE";
132
+ CONTROLLER_BUSY: "CONTROLLER_BUSY";
133
+ PAUSED: "PAUSED";
134
+ NOT_READY: "NOT_READY";
135
+ SCOPE_VIOLATION: "SCOPE_VIOLATION";
136
+ GATE_FAILED: "GATE_FAILED";
137
+ REVIEW_REJECTED: "REVIEW_REJECTED";
138
+ BUDGET_EXHAUSTED: "BUDGET_EXHAUSTED";
139
+ BUDGET_UNKNOWN: "BUDGET_UNKNOWN";
140
+ ATTEMPTS_EXHAUSTED: "ATTEMPTS_EXHAUSTED";
141
+ REVISION_CONFLICT: "REVISION_CONFLICT";
142
+ CANCELLED: "CANCELLED";
143
+ NOT_FOUND: "NOT_FOUND";
144
+ PATH_CONFLICT: "PATH_CONFLICT";
145
+ STATE_VERSION_UNSUPPORTED: "STATE_VERSION_UNSUPPORTED";
146
+ RUNTIME_UNAVAILABLE: "RUNTIME_UNAVAILABLE";
147
+ REVIEW_PROTOCOL_INVALID: "REVIEW_PROTOCOL_INVALID";
148
+ SANDBOX_UNAVAILABLE: "SANDBOX_UNAVAILABLE";
149
+ GIT_FAILED: "GIT_FAILED";
150
+ STORAGE_FAILED: "STORAGE_FAILED";
151
+ DELIVERY_FAILED: "DELIVERY_FAILED";
152
+ INTERNAL: "INTERNAL";
153
+ }>>;
154
+ actor: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
155
+ controller: "controller";
156
+ lead: "lead";
157
+ user: "user";
158
+ }>>>;
159
+ action: z.ZodOptional<z.ZodEnum<{
160
+ none: "none";
161
+ wait: "wait";
162
+ retry: "retry";
163
+ "review-plan": "review-plan";
164
+ "diagnose-failure": "diagnose-failure";
165
+ "reset-attempts": "reset-attempts";
166
+ "raise-budget": "raise-budget";
167
+ "replan-dependents": "replan-dependents";
168
+ "recovery-decision": "recovery-decision";
169
+ "user-decision": "user-decision";
170
+ "resume-queue": "resume-queue";
171
+ "fix-environment": "fix-environment";
172
+ "fix-access": "fix-access";
173
+ }>>;
174
+ }, z.core.$strict>;
175
+ controller: z.ZodOptional<z.ZodObject<{
176
+ owner: z.ZodString;
177
+ until: z.ZodISODateTime;
178
+ live: z.ZodBoolean;
179
+ }, z.core.$strict>>;
180
+ active: z.ZodArray<z.ZodObject<{
181
+ workId: z.ZodString;
182
+ title: z.ZodString;
183
+ runId: z.ZodString;
184
+ attempt: z.ZodNumber;
185
+ phase: z.ZodEnum<{
186
+ ready: "ready";
187
+ failed: "failed";
188
+ cancelled: "cancelled";
189
+ draft: "draft";
190
+ running: "running";
191
+ verifying: "verifying";
192
+ reviewing: "reviewing";
193
+ integrating: "integrating";
194
+ done: "done";
195
+ }>;
196
+ runtime: z.ZodString;
197
+ elapsedMs: z.ZodNumber;
198
+ stage: z.ZodOptional<z.ZodObject<{
199
+ name: z.ZodString;
200
+ elapsedMs: z.ZodNumber;
201
+ }, z.core.$strict>>;
202
+ sinceHeartbeatMs: z.ZodOptional<z.ZodNumber>;
203
+ leaseUntil: z.ZodISODateTime;
204
+ stale: z.ZodBoolean;
205
+ gates: z.ZodObject<{
206
+ phase: z.ZodEnum<{
207
+ candidate: "candidate";
208
+ integration: "integration";
209
+ }>;
210
+ required: z.ZodNumber;
211
+ passed: z.ZodNumber;
212
+ failed: z.ZodNumber;
213
+ remaining: z.ZodNumber;
214
+ }, z.core.$strict>;
215
+ }, z.core.$strict>>;
216
+ unfinished: z.ZodArray<z.ZodObject<{
217
+ runId: z.ZodString;
218
+ workId: z.ZodString;
219
+ attempt: z.ZodNumber;
220
+ phase: z.ZodEnum<{
221
+ ready: "ready";
222
+ failed: "failed";
223
+ cancelled: "cancelled";
224
+ draft: "draft";
225
+ running: "running";
226
+ verifying: "verifying";
227
+ reviewing: "reviewing";
228
+ integrating: "integrating";
229
+ done: "done";
230
+ }>;
231
+ startedAt: z.ZodISODateTime;
232
+ stale: z.ZodBoolean;
233
+ current: z.ZodBoolean;
234
+ interrupted: z.ZodOptional<z.ZodLiteral<"shutdown">>;
235
+ }, z.core.$strict>>;
236
+ works: z.ZodArray<z.ZodObject<{
237
+ id: z.ZodString;
238
+ graphId: z.ZodString;
239
+ title: z.ZodString;
240
+ status: z.ZodEnum<{
241
+ ready: "ready";
242
+ failed: "failed";
243
+ cancelled: "cancelled";
244
+ draft: "draft";
245
+ running: "running";
246
+ verifying: "verifying";
247
+ reviewing: "reviewing";
248
+ integrating: "integrating";
249
+ done: "done";
250
+ }>;
251
+ attempt: z.ZodNumber;
252
+ failureKind: z.ZodOptional<z.ZodEnum<{
253
+ gate: "gate";
254
+ unknown: "unknown";
255
+ review: "review";
256
+ cancelled: "cancelled";
257
+ environment: "environment";
258
+ timeout: "timeout";
259
+ "provider-auth": "provider-auth";
260
+ stalled: "stalled";
261
+ "stale-base": "stale-base";
262
+ "empty-result": "empty-result";
263
+ unfinished: "unfinished";
264
+ "scope-violation": "scope-violation";
265
+ "review-protocol": "review-protocol";
266
+ merge: "merge";
267
+ budget: "budget";
268
+ "needs-lead": "needs-lead";
269
+ }>>;
270
+ failure: z.ZodOptional<z.ZodString>;
271
+ hold: z.ZodOptional<z.ZodObject<{
272
+ operation: z.ZodString;
273
+ reason: z.ZodString;
274
+ }, z.core.$strict>>;
275
+ recovery: z.ZodOptional<z.ZodObject<{
276
+ status: z.ZodString;
277
+ property: z.ZodString;
278
+ reason: z.ZodOptional<z.ZodString>;
279
+ proposal: z.ZodOptional<z.ZodString>;
280
+ }, z.core.$strict>>;
281
+ blockers: z.ZodArray<z.ZodObject<{
282
+ code: z.ZodEnum<{
283
+ INVALID_INPUT: "INVALID_INPUT";
284
+ UNSUPPORTED_COMMAND: "UNSUPPORTED_COMMAND";
285
+ UNSUPPORTED_VERSION: "UNSUPPORTED_VERSION";
286
+ GRAPH_CYCLE: "GRAPH_CYCLE";
287
+ GRAPH_UNKNOWN_DEPENDENCY: "GRAPH_UNKNOWN_DEPENDENCY";
288
+ GRAPH_DUPLICATE_ID: "GRAPH_DUPLICATE_ID";
289
+ GATE_UNKNOWN: "GATE_UNKNOWN";
290
+ GATE_GROUP_CYCLE: "GATE_GROUP_CYCLE";
291
+ REVIEWER_SAME_VENDOR: "REVIEWER_SAME_VENDOR";
292
+ REVIEWER_MISSING: "REVIEWER_MISSING";
293
+ RESPONSE_TOO_LARGE: "RESPONSE_TOO_LARGE";
294
+ APPROVAL_STALE: "APPROVAL_STALE";
295
+ APPROVAL_REQUIRED: "APPROVAL_REQUIRED";
296
+ LEASE_STALE: "LEASE_STALE";
297
+ CONTROLLER_BUSY: "CONTROLLER_BUSY";
298
+ PAUSED: "PAUSED";
299
+ NOT_READY: "NOT_READY";
300
+ SCOPE_VIOLATION: "SCOPE_VIOLATION";
301
+ GATE_FAILED: "GATE_FAILED";
302
+ REVIEW_REJECTED: "REVIEW_REJECTED";
303
+ BUDGET_EXHAUSTED: "BUDGET_EXHAUSTED";
304
+ BUDGET_UNKNOWN: "BUDGET_UNKNOWN";
305
+ ATTEMPTS_EXHAUSTED: "ATTEMPTS_EXHAUSTED";
306
+ REVISION_CONFLICT: "REVISION_CONFLICT";
307
+ CANCELLED: "CANCELLED";
308
+ NOT_FOUND: "NOT_FOUND";
309
+ PATH_CONFLICT: "PATH_CONFLICT";
310
+ STATE_VERSION_UNSUPPORTED: "STATE_VERSION_UNSUPPORTED";
311
+ RUNTIME_UNAVAILABLE: "RUNTIME_UNAVAILABLE";
312
+ REVIEW_PROTOCOL_INVALID: "REVIEW_PROTOCOL_INVALID";
313
+ SANDBOX_UNAVAILABLE: "SANDBOX_UNAVAILABLE";
314
+ GIT_FAILED: "GIT_FAILED";
315
+ STORAGE_FAILED: "STORAGE_FAILED";
316
+ DELIVERY_FAILED: "DELIVERY_FAILED";
317
+ INTERNAL: "INTERNAL";
318
+ }>;
319
+ message: z.ZodString;
320
+ }, z.core.$strict>>;
321
+ blockersTruncated: z.ZodOptional<z.ZodNumber>;
322
+ next: z.ZodObject<{
323
+ actor: z.ZodNullable<z.ZodEnum<{
324
+ controller: "controller";
325
+ lead: "lead";
326
+ user: "user";
327
+ }>>;
328
+ action: z.ZodEnum<{
329
+ none: "none";
330
+ wait: "wait";
331
+ retry: "retry";
332
+ "review-plan": "review-plan";
333
+ "diagnose-failure": "diagnose-failure";
334
+ "reset-attempts": "reset-attempts";
335
+ "raise-budget": "raise-budget";
336
+ "replan-dependents": "replan-dependents";
337
+ "recovery-decision": "recovery-decision";
338
+ "user-decision": "user-decision";
339
+ "resume-queue": "resume-queue";
340
+ "fix-environment": "fix-environment";
341
+ "fix-access": "fix-access";
342
+ }>;
343
+ step: z.ZodOptional<z.ZodEnum<{
344
+ accepted: "accepted";
345
+ cancelled: "cancelled";
346
+ "recovery-awaiting-lead": "recovery-awaiting-lead";
347
+ "recovery-analyzing": "recovery-analyzing";
348
+ "recovery-applying": "recovery-applying";
349
+ "recovery-retry-allowed": "recovery-retry-allowed";
350
+ "recovery-retrying": "recovery-retrying";
351
+ "recovery-awaiting-user": "recovery-awaiting-user";
352
+ "recovery-stopped": "recovery-stopped";
353
+ "corpus-adoption": "corpus-adoption";
354
+ held: "held";
355
+ "plan-review": "plan-review";
356
+ "attempt-running": "attempt-running";
357
+ "retry-within-budget": "retry-within-budget";
358
+ "attempts-exhausted": "attempts-exhausted";
359
+ "awaiting-claim": "awaiting-claim";
360
+ }>>;
361
+ property: z.ZodOptional<z.ZodString>;
362
+ detail: z.ZodOptional<z.ZodString>;
363
+ command: z.ZodOptional<z.ZodEnum<{
364
+ "harness run": "harness run";
365
+ "harness resume": "harness resume";
366
+ }>>;
367
+ }, z.core.$strict>;
368
+ }, z.core.$strict>>;
369
+ stops: z.ZodArray<z.ZodObject<{
370
+ code: z.ZodEnum<{
371
+ INVALID_INPUT: "INVALID_INPUT";
372
+ UNSUPPORTED_COMMAND: "UNSUPPORTED_COMMAND";
373
+ UNSUPPORTED_VERSION: "UNSUPPORTED_VERSION";
374
+ GRAPH_CYCLE: "GRAPH_CYCLE";
375
+ GRAPH_UNKNOWN_DEPENDENCY: "GRAPH_UNKNOWN_DEPENDENCY";
376
+ GRAPH_DUPLICATE_ID: "GRAPH_DUPLICATE_ID";
377
+ GATE_UNKNOWN: "GATE_UNKNOWN";
378
+ GATE_GROUP_CYCLE: "GATE_GROUP_CYCLE";
379
+ REVIEWER_SAME_VENDOR: "REVIEWER_SAME_VENDOR";
380
+ REVIEWER_MISSING: "REVIEWER_MISSING";
381
+ RESPONSE_TOO_LARGE: "RESPONSE_TOO_LARGE";
382
+ APPROVAL_STALE: "APPROVAL_STALE";
383
+ APPROVAL_REQUIRED: "APPROVAL_REQUIRED";
384
+ LEASE_STALE: "LEASE_STALE";
385
+ CONTROLLER_BUSY: "CONTROLLER_BUSY";
386
+ PAUSED: "PAUSED";
387
+ NOT_READY: "NOT_READY";
388
+ SCOPE_VIOLATION: "SCOPE_VIOLATION";
389
+ GATE_FAILED: "GATE_FAILED";
390
+ REVIEW_REJECTED: "REVIEW_REJECTED";
391
+ BUDGET_EXHAUSTED: "BUDGET_EXHAUSTED";
392
+ BUDGET_UNKNOWN: "BUDGET_UNKNOWN";
393
+ ATTEMPTS_EXHAUSTED: "ATTEMPTS_EXHAUSTED";
394
+ REVISION_CONFLICT: "REVISION_CONFLICT";
395
+ CANCELLED: "CANCELLED";
396
+ NOT_FOUND: "NOT_FOUND";
397
+ PATH_CONFLICT: "PATH_CONFLICT";
398
+ STATE_VERSION_UNSUPPORTED: "STATE_VERSION_UNSUPPORTED";
399
+ RUNTIME_UNAVAILABLE: "RUNTIME_UNAVAILABLE";
400
+ REVIEW_PROTOCOL_INVALID: "REVIEW_PROTOCOL_INVALID";
401
+ SANDBOX_UNAVAILABLE: "SANDBOX_UNAVAILABLE";
402
+ GIT_FAILED: "GIT_FAILED";
403
+ STORAGE_FAILED: "STORAGE_FAILED";
404
+ DELIVERY_FAILED: "DELIVERY_FAILED";
405
+ INTERNAL: "INTERNAL";
406
+ }>;
407
+ cause: z.ZodEnum<{
408
+ gate: "gate";
409
+ unknown: "unknown";
410
+ review: "review";
411
+ cancelled: "cancelled";
412
+ environment: "environment";
413
+ timeout: "timeout";
414
+ "provider-auth": "provider-auth";
415
+ stalled: "stalled";
416
+ "stale-base": "stale-base";
417
+ "empty-result": "empty-result";
418
+ unfinished: "unfinished";
419
+ "scope-violation": "scope-violation";
420
+ "review-protocol": "review-protocol";
421
+ merge: "merge";
422
+ budget: "budget";
423
+ "needs-lead": "needs-lead";
424
+ "runtime-missing": "runtime-missing";
425
+ "controller-busy": "controller-busy";
426
+ "operator-pause": "operator-pause";
427
+ "approval-required": "approval-required";
428
+ "not-ready": "not-ready";
429
+ }>;
430
+ phase: z.ZodEnum<{
431
+ gates: "gates";
432
+ preflight: "preflight";
433
+ review: "review";
434
+ integration: "integration";
435
+ delivery: "delivery";
436
+ claim: "claim";
437
+ implementation: "implementation";
438
+ }>;
439
+ actor: z.ZodNullable<z.ZodEnum<{
440
+ controller: "controller";
441
+ lead: "lead";
442
+ user: "user";
443
+ }>>;
444
+ action: z.ZodEnum<{
445
+ none: "none";
446
+ wait: "wait";
447
+ retry: "retry";
448
+ "review-plan": "review-plan";
449
+ "diagnose-failure": "diagnose-failure";
450
+ "reset-attempts": "reset-attempts";
451
+ "raise-budget": "raise-budget";
452
+ "replan-dependents": "replan-dependents";
453
+ "recovery-decision": "recovery-decision";
454
+ "user-decision": "user-decision";
455
+ "resume-queue": "resume-queue";
456
+ "fix-environment": "fix-environment";
457
+ "fix-access": "fix-access";
458
+ }>;
459
+ retryPlanned: z.ZodBoolean;
460
+ message: z.ZodString;
461
+ evidence: z.ZodArray<z.ZodObject<{
462
+ kind: z.ZodEnum<{
463
+ attempt: "attempt";
464
+ evidence: "evidence";
465
+ event: "event";
466
+ doctor: "doctor";
467
+ }>;
468
+ id: z.ZodString;
469
+ sha: z.ZodOptional<z.ZodString>;
470
+ }, z.core.$strict>>;
471
+ workId: z.ZodOptional<z.ZodString>;
472
+ runId: z.ZodOptional<z.ZodString>;
473
+ queue: z.ZodOptional<z.ZodLiteral<true>>;
474
+ works: z.ZodOptional<z.ZodArray<z.ZodString>>;
475
+ worksCount: z.ZodOptional<z.ZodNumber>;
476
+ }, z.core.$strict>>;
477
+ failures: z.ZodArray<z.ZodObject<{
478
+ runId: z.ZodString;
479
+ workId: z.ZodString;
480
+ workStatus: z.ZodOptional<z.ZodEnum<{
481
+ ready: "ready";
482
+ failed: "failed";
483
+ cancelled: "cancelled";
484
+ draft: "draft";
485
+ running: "running";
486
+ verifying: "verifying";
487
+ reviewing: "reviewing";
488
+ integrating: "integrating";
489
+ done: "done";
490
+ }>>;
491
+ attempt: z.ZodNumber;
492
+ status: z.ZodEnum<{
493
+ failed: "failed";
494
+ expired: "expired";
495
+ }>;
496
+ phase: z.ZodEnum<{
497
+ ready: "ready";
498
+ failed: "failed";
499
+ cancelled: "cancelled";
500
+ draft: "draft";
501
+ running: "running";
502
+ verifying: "verifying";
503
+ reviewing: "reviewing";
504
+ integrating: "integrating";
505
+ done: "done";
506
+ }>;
507
+ finishedAt: z.ZodOptional<z.ZodISODateTime>;
508
+ failureKind: z.ZodOptional<z.ZodEnum<{
509
+ gate: "gate";
510
+ unknown: "unknown";
511
+ review: "review";
512
+ cancelled: "cancelled";
513
+ environment: "environment";
514
+ timeout: "timeout";
515
+ "provider-auth": "provider-auth";
516
+ stalled: "stalled";
517
+ "stale-base": "stale-base";
518
+ "empty-result": "empty-result";
519
+ unfinished: "unfinished";
520
+ "scope-violation": "scope-violation";
521
+ "review-protocol": "review-protocol";
522
+ merge: "merge";
523
+ budget: "budget";
524
+ "needs-lead": "needs-lead";
525
+ }>>;
526
+ code: z.ZodEnum<{
527
+ INVALID_INPUT: "INVALID_INPUT";
528
+ UNSUPPORTED_COMMAND: "UNSUPPORTED_COMMAND";
529
+ UNSUPPORTED_VERSION: "UNSUPPORTED_VERSION";
530
+ GRAPH_CYCLE: "GRAPH_CYCLE";
531
+ GRAPH_UNKNOWN_DEPENDENCY: "GRAPH_UNKNOWN_DEPENDENCY";
532
+ GRAPH_DUPLICATE_ID: "GRAPH_DUPLICATE_ID";
533
+ GATE_UNKNOWN: "GATE_UNKNOWN";
534
+ GATE_GROUP_CYCLE: "GATE_GROUP_CYCLE";
535
+ REVIEWER_SAME_VENDOR: "REVIEWER_SAME_VENDOR";
536
+ REVIEWER_MISSING: "REVIEWER_MISSING";
537
+ RESPONSE_TOO_LARGE: "RESPONSE_TOO_LARGE";
538
+ APPROVAL_STALE: "APPROVAL_STALE";
539
+ APPROVAL_REQUIRED: "APPROVAL_REQUIRED";
540
+ LEASE_STALE: "LEASE_STALE";
541
+ CONTROLLER_BUSY: "CONTROLLER_BUSY";
542
+ PAUSED: "PAUSED";
543
+ NOT_READY: "NOT_READY";
544
+ SCOPE_VIOLATION: "SCOPE_VIOLATION";
545
+ GATE_FAILED: "GATE_FAILED";
546
+ REVIEW_REJECTED: "REVIEW_REJECTED";
547
+ BUDGET_EXHAUSTED: "BUDGET_EXHAUSTED";
548
+ BUDGET_UNKNOWN: "BUDGET_UNKNOWN";
549
+ ATTEMPTS_EXHAUSTED: "ATTEMPTS_EXHAUSTED";
550
+ REVISION_CONFLICT: "REVISION_CONFLICT";
551
+ CANCELLED: "CANCELLED";
552
+ NOT_FOUND: "NOT_FOUND";
553
+ PATH_CONFLICT: "PATH_CONFLICT";
554
+ STATE_VERSION_UNSUPPORTED: "STATE_VERSION_UNSUPPORTED";
555
+ RUNTIME_UNAVAILABLE: "RUNTIME_UNAVAILABLE";
556
+ REVIEW_PROTOCOL_INVALID: "REVIEW_PROTOCOL_INVALID";
557
+ SANDBOX_UNAVAILABLE: "SANDBOX_UNAVAILABLE";
558
+ GIT_FAILED: "GIT_FAILED";
559
+ STORAGE_FAILED: "STORAGE_FAILED";
560
+ DELIVERY_FAILED: "DELIVERY_FAILED";
561
+ INTERNAL: "INTERNAL";
562
+ }>;
563
+ error: z.ZodOptional<z.ZodString>;
564
+ }, z.core.$strict>>;
565
+ budgets: z.ZodOptional<z.ZodObject<{
566
+ onUnknown: z.ZodEnum<{
567
+ continue: "continue";
568
+ stop: "stop";
569
+ }>;
570
+ entries: z.ZodArray<z.ZodObject<{
571
+ scope: z.ZodEnum<{
572
+ work: "work";
573
+ group: "group";
574
+ total: "total";
575
+ }>;
576
+ id: z.ZodOptional<z.ZodString>;
577
+ state: z.ZodEnum<{
578
+ exceeded: "exceeded";
579
+ undetermined: "undetermined";
580
+ within: "within";
581
+ }>;
582
+ limitUsd: z.ZodOptional<z.ZodNumber>;
583
+ limitMs: z.ZodOptional<z.ZodNumber>;
584
+ reportedUsd: z.ZodNumber;
585
+ estimatedUsd: z.ZodNumber;
586
+ complete: z.ZodBoolean;
587
+ unknownCalls: z.ZodNumber;
588
+ unfinishedCalls: z.ZodNumber;
589
+ abandonedCalls: z.ZodNumber;
590
+ uncoveredRuns: z.ZodNumber;
591
+ durationMs: z.ZodNumber;
592
+ remainingUsd: z.ZodNullable<z.ZodNumber>;
593
+ remainingMs: z.ZodNullable<z.ZodNumber>;
594
+ reason: z.ZodOptional<z.ZodString>;
595
+ }, z.core.$strict>>;
596
+ }, z.core.$strict>>;
597
+ repairs: z.ZodArray<z.ZodObject<{
598
+ graphId: z.ZodString;
599
+ status: z.ZodString;
600
+ used: z.ZodNumber;
601
+ budget: z.ZodNumber;
602
+ }, z.core.$strict>>;
603
+ next: z.ZodObject<{
604
+ actor: z.ZodNullable<z.ZodEnum<{
605
+ controller: "controller";
606
+ lead: "lead";
607
+ user: "user";
608
+ }>>;
609
+ action: z.ZodEnum<{
610
+ none: "none";
611
+ wait: "wait";
612
+ retry: "retry";
613
+ "review-plan": "review-plan";
614
+ "diagnose-failure": "diagnose-failure";
615
+ "reset-attempts": "reset-attempts";
616
+ "raise-budget": "raise-budget";
617
+ "replan-dependents": "replan-dependents";
618
+ "recovery-decision": "recovery-decision";
619
+ "user-decision": "user-decision";
620
+ "resume-queue": "resume-queue";
621
+ "fix-environment": "fix-environment";
622
+ "fix-access": "fix-access";
623
+ }>;
624
+ step: z.ZodOptional<z.ZodEnum<{
625
+ accepted: "accepted";
626
+ cancelled: "cancelled";
627
+ "recovery-awaiting-lead": "recovery-awaiting-lead";
628
+ "recovery-analyzing": "recovery-analyzing";
629
+ "recovery-applying": "recovery-applying";
630
+ "recovery-retry-allowed": "recovery-retry-allowed";
631
+ "recovery-retrying": "recovery-retrying";
632
+ "recovery-awaiting-user": "recovery-awaiting-user";
633
+ "recovery-stopped": "recovery-stopped";
634
+ "corpus-adoption": "corpus-adoption";
635
+ held: "held";
636
+ "plan-review": "plan-review";
637
+ "attempt-running": "attempt-running";
638
+ "retry-within-budget": "retry-within-budget";
639
+ "attempts-exhausted": "attempts-exhausted";
640
+ "awaiting-claim": "awaiting-claim";
641
+ }>>;
642
+ property: z.ZodOptional<z.ZodString>;
643
+ detail: z.ZodOptional<z.ZodString>;
644
+ command: z.ZodOptional<z.ZodEnum<{
645
+ "harness run": "harness run";
646
+ "harness resume": "harness resume";
647
+ }>>;
648
+ workId: z.ZodOptional<z.ZodString>;
649
+ code: z.ZodOptional<z.ZodEnum<{
650
+ INVALID_INPUT: "INVALID_INPUT";
651
+ UNSUPPORTED_COMMAND: "UNSUPPORTED_COMMAND";
652
+ UNSUPPORTED_VERSION: "UNSUPPORTED_VERSION";
653
+ GRAPH_CYCLE: "GRAPH_CYCLE";
654
+ GRAPH_UNKNOWN_DEPENDENCY: "GRAPH_UNKNOWN_DEPENDENCY";
655
+ GRAPH_DUPLICATE_ID: "GRAPH_DUPLICATE_ID";
656
+ GATE_UNKNOWN: "GATE_UNKNOWN";
657
+ GATE_GROUP_CYCLE: "GATE_GROUP_CYCLE";
658
+ REVIEWER_SAME_VENDOR: "REVIEWER_SAME_VENDOR";
659
+ REVIEWER_MISSING: "REVIEWER_MISSING";
660
+ RESPONSE_TOO_LARGE: "RESPONSE_TOO_LARGE";
661
+ APPROVAL_STALE: "APPROVAL_STALE";
662
+ APPROVAL_REQUIRED: "APPROVAL_REQUIRED";
663
+ LEASE_STALE: "LEASE_STALE";
664
+ CONTROLLER_BUSY: "CONTROLLER_BUSY";
665
+ PAUSED: "PAUSED";
666
+ NOT_READY: "NOT_READY";
667
+ SCOPE_VIOLATION: "SCOPE_VIOLATION";
668
+ GATE_FAILED: "GATE_FAILED";
669
+ REVIEW_REJECTED: "REVIEW_REJECTED";
670
+ BUDGET_EXHAUSTED: "BUDGET_EXHAUSTED";
671
+ BUDGET_UNKNOWN: "BUDGET_UNKNOWN";
672
+ ATTEMPTS_EXHAUSTED: "ATTEMPTS_EXHAUSTED";
673
+ REVISION_CONFLICT: "REVISION_CONFLICT";
674
+ CANCELLED: "CANCELLED";
675
+ NOT_FOUND: "NOT_FOUND";
676
+ PATH_CONFLICT: "PATH_CONFLICT";
677
+ STATE_VERSION_UNSUPPORTED: "STATE_VERSION_UNSUPPORTED";
678
+ RUNTIME_UNAVAILABLE: "RUNTIME_UNAVAILABLE";
679
+ REVIEW_PROTOCOL_INVALID: "REVIEW_PROTOCOL_INVALID";
680
+ SANDBOX_UNAVAILABLE: "SANDBOX_UNAVAILABLE";
681
+ GIT_FAILED: "GIT_FAILED";
682
+ STORAGE_FAILED: "STORAGE_FAILED";
683
+ DELIVERY_FAILED: "DELIVERY_FAILED";
684
+ INTERNAL: "INTERNAL";
685
+ }>>;
686
+ }, z.core.$strict>;
687
+ intentions: z.ZodArray<z.ZodString>;
688
+ truncated: z.ZodObject<{
689
+ works: z.ZodNumber;
690
+ stops: z.ZodNumber;
691
+ failures: z.ZodNumber;
692
+ unfinished: z.ZodNumber;
693
+ budgets: z.ZodNumber;
694
+ budgetsWithin: z.ZodNumber;
695
+ budgetsShared: z.ZodDefault<z.ZodNumber>;
696
+ repairs: z.ZodNumber;
697
+ intentions: z.ZodNumber;
698
+ intentionsDropped: z.ZodNumber;
699
+ bySize: z.ZodBoolean;
700
+ }, z.core.$strict>;
701
+ }, z.core.$strict>;
702
+ export type HandoffPack = z.infer<typeof handoffPackSchema>;