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

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 (75) hide show
  1. package/README.md +23 -15
  2. package/docs/contracts.md +138 -2
  3. package/docs/release-notes/0.1.0-alpha.31.md +44 -0
  4. package/docs/upgrade.md +44 -0
  5. package/lib/agents/cli-adapter.js +1 -0
  6. package/lib/cli.js +23 -1
  7. package/lib/contracts/cli.d.ts +1077 -4
  8. package/lib/contracts/cli.js +43 -1
  9. package/lib/contracts/diagnosis.d.ts +2 -1
  10. package/lib/contracts/diagnosis.js +1 -0
  11. package/lib/contracts/events.d.ts +414 -5
  12. package/lib/contracts/events.js +46 -1
  13. package/lib/contracts/execution.d.ts +112 -1
  14. package/lib/contracts/execution.js +38 -0
  15. package/lib/contracts/handoff.d.ts +694 -0
  16. package/lib/contracts/handoff.js +291 -0
  17. package/lib/contracts/index.d.ts +1 -0
  18. package/lib/contracts/index.js +1 -0
  19. package/lib/contracts/policy.d.ts +27 -1
  20. package/lib/contracts/policy.js +38 -2
  21. package/lib/contracts/published.d.ts +841 -2
  22. package/lib/contracts/published.js +2 -0
  23. package/lib/contracts/repair-policy.js +5 -0
  24. package/lib/contracts/report.d.ts +2 -0
  25. package/lib/control/harness.d.ts +37 -11
  26. package/lib/control/harness.js +3 -0
  27. package/lib/control/recovery.d.ts +1 -1
  28. package/lib/engine/engine.d.ts +15 -7
  29. package/lib/engine/engine.js +24 -0
  30. package/lib/engine/joint-runner.d.ts +6 -0
  31. package/lib/engine/joint-runner.js +20 -4
  32. package/lib/engine/property-recovery.js +1 -0
  33. package/lib/engine/reuse.js +1 -0
  34. package/lib/engine/runner.d.ts +8 -0
  35. package/lib/engine/runner.js +116 -11
  36. package/lib/engine/stall-sweep.d.ts +137 -0
  37. package/lib/engine/stall-sweep.js +393 -0
  38. package/lib/environment/activity.d.ts +34 -0
  39. package/lib/environment/activity.js +55 -0
  40. package/lib/environment/lifecycle.js +1 -0
  41. package/lib/environment/process.d.ts +7 -1
  42. package/lib/environment/process.js +14 -0
  43. package/lib/environment/redaction.d.ts +2 -0
  44. package/lib/environment/redaction.js +19 -0
  45. package/lib/explain/state.d.ts +1 -1
  46. package/lib/explain/state.js +12 -0
  47. package/lib/handoff/index.d.ts +2 -0
  48. package/lib/handoff/index.js +3 -0
  49. package/lib/handoff/markdown.d.ts +6 -0
  50. package/lib/handoff/markdown.js +153 -0
  51. package/lib/handoff/pack.d.ts +49 -0
  52. package/lib/handoff/pack.js +492 -0
  53. package/lib/index.d.ts +2 -1
  54. package/lib/index.js +1 -0
  55. package/lib/integrations/connector/redact.d.ts +2 -13
  56. package/lib/integrations/connector/redact.js +2 -21
  57. package/lib/projections/attempt.d.ts +28 -0
  58. package/lib/projections/attempt.js +14 -0
  59. package/lib/projections/stop.d.ts +11 -1
  60. package/lib/projections/stop.js +29 -0
  61. package/lib/report/compute.js +1 -0
  62. package/lib/storage/document.d.ts +28 -6
  63. package/lib/storage/sqlite.d.ts +2 -0
  64. package/lib/storage/sqlite.js +9 -1
  65. package/lib/verification/gates-at.d.ts +11 -1
  66. package/lib/verification/gates-at.js +28 -2
  67. package/lib/verification/gates.d.ts +3 -1
  68. package/lib/verification/gates.js +5 -0
  69. package/package.json +1 -1
  70. package/schemas/execution-document.schema.json +68 -0
  71. package/schemas/execution-policy.schema.json +32 -0
  72. package/schemas/handoff-pack.schema.json +1424 -0
  73. package/schemas/run-event.schema.json +360 -0
  74. package/schemas/stop-diagnosis.schema.json +1 -0
  75. package/schemas/value-report.schema.json +1 -0
@@ -126,6 +126,50 @@ export declare const eventPayloads: {
126
126
  failed: "failed";
127
127
  }>>;
128
128
  }, z.core.$strict>;
129
+ /**
130
+ * Обход controller сменил живость исполняющейся попытки (только переходы).
131
+ * У `stalled` — снимок: процессы исполняющихся команд и хвост их вывода
132
+ * (замаскированные), и что controller сделал (`action`).
133
+ */
134
+ readonly 'attempt.liveness': z.ZodObject<{
135
+ state: z.ZodEnum<{
136
+ active: "active";
137
+ stalled: "stalled";
138
+ quiet: "quiet";
139
+ }>;
140
+ previous: z.ZodEnum<{
141
+ active: "active";
142
+ stalled: "stalled";
143
+ quiet: "quiet";
144
+ }>;
145
+ lastMovementAt: z.ZodISODateTime;
146
+ idleMs: z.ZodNumber;
147
+ activity: z.ZodOptional<z.ZodObject<{
148
+ kind: z.ZodEnum<{
149
+ gate: "gate";
150
+ command: "command";
151
+ agent: "agent";
152
+ step: "step";
153
+ }>;
154
+ label: z.ZodString;
155
+ }, z.core.$strict>>;
156
+ cpuUnavailable: z.ZodOptional<z.ZodBoolean>;
157
+ action: z.ZodOptional<z.ZodEnum<{
158
+ report: "report";
159
+ stop: "stop";
160
+ }>>;
161
+ snapshot: z.ZodOptional<z.ZodObject<{
162
+ processes: z.ZodArray<z.ZodObject<{
163
+ pid: z.ZodNumber;
164
+ parentPid: z.ZodNumber;
165
+ cpuMs: z.ZodOptional<z.ZodNumber>;
166
+ command: z.ZodString;
167
+ }, z.core.$strict>>;
168
+ processesUnavailable: z.ZodOptional<z.ZodBoolean>;
169
+ tail: z.ZodString;
170
+ artifact: z.ZodOptional<z.ZodString>;
171
+ }, z.core.$strict>>;
172
+ }, z.core.$strict>;
129
173
  readonly 'attempt.failed': z.ZodObject<{
130
174
  failureKind: z.ZodEnum<{
131
175
  gate: "gate";
@@ -135,6 +179,7 @@ export declare const eventPayloads: {
135
179
  environment: "environment";
136
180
  timeout: "timeout";
137
181
  "provider-auth": "provider-auth";
182
+ stalled: "stalled";
138
183
  "stale-base": "stale-base";
139
184
  "empty-result": "empty-result";
140
185
  unfinished: "unfinished";
@@ -182,6 +227,7 @@ export declare const eventPayloads: {
182
227
  environment: "environment";
183
228
  timeout: "timeout";
184
229
  "provider-auth": "provider-auth";
230
+ stalled: "stalled";
185
231
  "stale-base": "stale-base";
186
232
  "empty-result": "empty-result";
187
233
  unfinished: "unfinished";
@@ -254,6 +300,51 @@ export declare const eventPayloads: {
254
300
  workIds: z.ZodArray<z.ZodString>;
255
301
  policyDigest: z.ZodString;
256
302
  }, z.core.$strict>;
303
+ /**
304
+ * Обход зависших совместной проверки сменил её живость (только переходы);
305
+ * нагрузка — как у `attempt.liveness`. При `report` это единственный след
306
+ * зависания: записи попытки у проверки нет.
307
+ */
308
+ readonly 'joint.liveness': z.ZodObject<{
309
+ state: z.ZodEnum<{
310
+ active: "active";
311
+ stalled: "stalled";
312
+ quiet: "quiet";
313
+ }>;
314
+ previous: z.ZodEnum<{
315
+ active: "active";
316
+ stalled: "stalled";
317
+ quiet: "quiet";
318
+ }>;
319
+ lastMovementAt: z.ZodISODateTime;
320
+ idleMs: z.ZodNumber;
321
+ activity: z.ZodOptional<z.ZodObject<{
322
+ kind: z.ZodEnum<{
323
+ gate: "gate";
324
+ command: "command";
325
+ agent: "agent";
326
+ step: "step";
327
+ }>;
328
+ label: z.ZodString;
329
+ }, z.core.$strict>>;
330
+ cpuUnavailable: z.ZodOptional<z.ZodBoolean>;
331
+ action: z.ZodOptional<z.ZodEnum<{
332
+ report: "report";
333
+ stop: "stop";
334
+ }>>;
335
+ snapshot: z.ZodOptional<z.ZodObject<{
336
+ processes: z.ZodArray<z.ZodObject<{
337
+ pid: z.ZodNumber;
338
+ parentPid: z.ZodNumber;
339
+ cpuMs: z.ZodOptional<z.ZodNumber>;
340
+ command: z.ZodString;
341
+ }, z.core.$strict>>;
342
+ processesUnavailable: z.ZodOptional<z.ZodBoolean>;
343
+ tail: z.ZodString;
344
+ artifact: z.ZodOptional<z.ZodString>;
345
+ }, z.core.$strict>>;
346
+ verificationId: z.ZodString;
347
+ }, z.core.$strict>;
257
348
  /** Совместная проверка закончилась: `passed` — только с manifest. */
258
349
  readonly 'joint.finished': z.ZodObject<{
259
350
  verificationId: z.ZodString;
@@ -323,6 +414,8 @@ export declare const eventPayloads: {
323
414
  }, z.core.$strict>;
324
415
  };
325
416
  export type EventType = keyof typeof eventPayloads;
417
+ /** Нагрузка события своего типа. */
418
+ export type RunEventPayload<T extends EventType> = z.infer<(typeof eventPayloads)[T]>;
326
419
  export declare const eventTypes: EventType[];
327
420
  declare const envelopeSchema: z.ZodObject<{
328
421
  apiVersion: z.ZodLiteral<"devcontour-harness/v1alpha1">;
@@ -343,7 +436,7 @@ export declare const runEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
343
436
  workId: z.ZodOptional<z.ZodString>;
344
437
  runId: z.ZodOptional<z.ZodString>;
345
438
  attempt: z.ZodOptional<z.ZodNumber>;
346
- type: z.ZodLiteral<"graph.registered" | "graph.reviewed" | "graph.approved" | "work.ready" | "work.held" | "attempt.claimed" | "attempt.phase" | "attempt.gate" | "attempt.review" | "attempt.stage" | "attempt.failed" | "attempt.expired" | "attempt.cancelled" | "attempt.recovered" | "work.accepted" | "work.blocked" | "control.paused" | "control.resumed" | "controller.acquired" | "controller.released" | "budget.blocked" | "corpus.adopted" | "work.recovery" | "joint.started" | "joint.finished" | "policy.applied" | "policy.reconfigure" | "delivery.pending" | "delivery.delivered" | "delivery.failed" | "delivery.conflict" | "delivery.uncertain">;
439
+ type: z.ZodLiteral<"graph.registered" | "graph.reviewed" | "graph.approved" | "work.ready" | "work.held" | "attempt.claimed" | "attempt.phase" | "attempt.gate" | "attempt.review" | "attempt.stage" | "attempt.liveness" | "attempt.failed" | "attempt.expired" | "attempt.cancelled" | "attempt.recovered" | "work.accepted" | "work.blocked" | "control.paused" | "control.resumed" | "controller.acquired" | "controller.released" | "budget.blocked" | "corpus.adopted" | "work.recovery" | "joint.started" | "joint.liveness" | "joint.finished" | "policy.applied" | "policy.reconfigure" | "delivery.pending" | "delivery.delivered" | "delivery.failed" | "delivery.conflict" | "delivery.uncertain">;
347
440
  payload: z.ZodObject<{
348
441
  digest: z.ZodString;
349
442
  orders: z.ZodNumber;
@@ -446,6 +539,44 @@ export declare const runEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
446
539
  passed: "passed";
447
540
  failed: "failed";
448
541
  }>>;
542
+ }, z.core.$strict> | z.ZodObject<{
543
+ state: z.ZodEnum<{
544
+ active: "active";
545
+ stalled: "stalled";
546
+ quiet: "quiet";
547
+ }>;
548
+ previous: z.ZodEnum<{
549
+ active: "active";
550
+ stalled: "stalled";
551
+ quiet: "quiet";
552
+ }>;
553
+ lastMovementAt: z.ZodISODateTime;
554
+ idleMs: z.ZodNumber;
555
+ activity: z.ZodOptional<z.ZodObject<{
556
+ kind: z.ZodEnum<{
557
+ gate: "gate";
558
+ command: "command";
559
+ agent: "agent";
560
+ step: "step";
561
+ }>;
562
+ label: z.ZodString;
563
+ }, z.core.$strict>>;
564
+ cpuUnavailable: z.ZodOptional<z.ZodBoolean>;
565
+ action: z.ZodOptional<z.ZodEnum<{
566
+ report: "report";
567
+ stop: "stop";
568
+ }>>;
569
+ snapshot: z.ZodOptional<z.ZodObject<{
570
+ processes: z.ZodArray<z.ZodObject<{
571
+ pid: z.ZodNumber;
572
+ parentPid: z.ZodNumber;
573
+ cpuMs: z.ZodOptional<z.ZodNumber>;
574
+ command: z.ZodString;
575
+ }, z.core.$strict>>;
576
+ processesUnavailable: z.ZodOptional<z.ZodBoolean>;
577
+ tail: z.ZodString;
578
+ artifact: z.ZodOptional<z.ZodString>;
579
+ }, z.core.$strict>>;
449
580
  }, z.core.$strict> | z.ZodObject<{
450
581
  failureKind: z.ZodEnum<{
451
582
  gate: "gate";
@@ -455,6 +586,7 @@ export declare const runEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
455
586
  environment: "environment";
456
587
  timeout: "timeout";
457
588
  "provider-auth": "provider-auth";
589
+ stalled: "stalled";
458
590
  "stale-base": "stale-base";
459
591
  "empty-result": "empty-result";
460
592
  unfinished: "unfinished";
@@ -496,6 +628,7 @@ export declare const runEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
496
628
  environment: "environment";
497
629
  timeout: "timeout";
498
630
  "provider-auth": "provider-auth";
631
+ stalled: "stalled";
499
632
  "stale-base": "stale-base";
500
633
  "empty-result": "empty-result";
501
634
  unfinished: "unfinished";
@@ -557,6 +690,45 @@ export declare const runEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
557
690
  verificationId: z.ZodString;
558
691
  workIds: z.ZodArray<z.ZodString>;
559
692
  policyDigest: z.ZodString;
693
+ }, z.core.$strict> | z.ZodObject<{
694
+ state: z.ZodEnum<{
695
+ active: "active";
696
+ stalled: "stalled";
697
+ quiet: "quiet";
698
+ }>;
699
+ previous: z.ZodEnum<{
700
+ active: "active";
701
+ stalled: "stalled";
702
+ quiet: "quiet";
703
+ }>;
704
+ lastMovementAt: z.ZodISODateTime;
705
+ idleMs: z.ZodNumber;
706
+ activity: z.ZodOptional<z.ZodObject<{
707
+ kind: z.ZodEnum<{
708
+ gate: "gate";
709
+ command: "command";
710
+ agent: "agent";
711
+ step: "step";
712
+ }>;
713
+ label: z.ZodString;
714
+ }, z.core.$strict>>;
715
+ cpuUnavailable: z.ZodOptional<z.ZodBoolean>;
716
+ action: z.ZodOptional<z.ZodEnum<{
717
+ report: "report";
718
+ stop: "stop";
719
+ }>>;
720
+ snapshot: z.ZodOptional<z.ZodObject<{
721
+ processes: z.ZodArray<z.ZodObject<{
722
+ pid: z.ZodNumber;
723
+ parentPid: z.ZodNumber;
724
+ cpuMs: z.ZodOptional<z.ZodNumber>;
725
+ command: z.ZodString;
726
+ }, z.core.$strict>>;
727
+ processesUnavailable: z.ZodOptional<z.ZodBoolean>;
728
+ tail: z.ZodString;
729
+ artifact: z.ZodOptional<z.ZodString>;
730
+ }, z.core.$strict>>;
731
+ verificationId: z.ZodString;
560
732
  }, z.core.$strict> | z.ZodObject<{
561
733
  verificationId: z.ZodString;
562
734
  status: z.ZodEnum<{
@@ -618,7 +790,7 @@ export declare const runEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
618
790
  workId: z.ZodOptional<z.ZodString>;
619
791
  runId: z.ZodOptional<z.ZodString>;
620
792
  attempt: z.ZodOptional<z.ZodNumber>;
621
- type: z.ZodLiteral<"graph.registered" | "graph.reviewed" | "graph.approved" | "work.ready" | "work.held" | "attempt.claimed" | "attempt.phase" | "attempt.gate" | "attempt.review" | "attempt.stage" | "attempt.failed" | "attempt.expired" | "attempt.cancelled" | "attempt.recovered" | "work.accepted" | "work.blocked" | "control.paused" | "control.resumed" | "controller.acquired" | "controller.released" | "budget.blocked" | "corpus.adopted" | "work.recovery" | "joint.started" | "joint.finished" | "policy.applied" | "policy.reconfigure" | "delivery.pending" | "delivery.delivered" | "delivery.failed" | "delivery.conflict" | "delivery.uncertain">;
793
+ type: z.ZodLiteral<"graph.registered" | "graph.reviewed" | "graph.approved" | "work.ready" | "work.held" | "attempt.claimed" | "attempt.phase" | "attempt.gate" | "attempt.review" | "attempt.stage" | "attempt.liveness" | "attempt.failed" | "attempt.expired" | "attempt.cancelled" | "attempt.recovered" | "work.accepted" | "work.blocked" | "control.paused" | "control.resumed" | "controller.acquired" | "controller.released" | "budget.blocked" | "corpus.adopted" | "work.recovery" | "joint.started" | "joint.liveness" | "joint.finished" | "policy.applied" | "policy.reconfigure" | "delivery.pending" | "delivery.delivered" | "delivery.failed" | "delivery.conflict" | "delivery.uncertain">;
622
794
  payload: z.ZodObject<{
623
795
  digest: z.ZodString;
624
796
  orders: z.ZodNumber;
@@ -721,6 +893,44 @@ export declare const runEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
721
893
  passed: "passed";
722
894
  failed: "failed";
723
895
  }>>;
896
+ }, z.core.$strict> | z.ZodObject<{
897
+ state: z.ZodEnum<{
898
+ active: "active";
899
+ stalled: "stalled";
900
+ quiet: "quiet";
901
+ }>;
902
+ previous: z.ZodEnum<{
903
+ active: "active";
904
+ stalled: "stalled";
905
+ quiet: "quiet";
906
+ }>;
907
+ lastMovementAt: z.ZodISODateTime;
908
+ idleMs: z.ZodNumber;
909
+ activity: z.ZodOptional<z.ZodObject<{
910
+ kind: z.ZodEnum<{
911
+ gate: "gate";
912
+ command: "command";
913
+ agent: "agent";
914
+ step: "step";
915
+ }>;
916
+ label: z.ZodString;
917
+ }, z.core.$strict>>;
918
+ cpuUnavailable: z.ZodOptional<z.ZodBoolean>;
919
+ action: z.ZodOptional<z.ZodEnum<{
920
+ report: "report";
921
+ stop: "stop";
922
+ }>>;
923
+ snapshot: z.ZodOptional<z.ZodObject<{
924
+ processes: z.ZodArray<z.ZodObject<{
925
+ pid: z.ZodNumber;
926
+ parentPid: z.ZodNumber;
927
+ cpuMs: z.ZodOptional<z.ZodNumber>;
928
+ command: z.ZodString;
929
+ }, z.core.$strict>>;
930
+ processesUnavailable: z.ZodOptional<z.ZodBoolean>;
931
+ tail: z.ZodString;
932
+ artifact: z.ZodOptional<z.ZodString>;
933
+ }, z.core.$strict>>;
724
934
  }, z.core.$strict> | z.ZodObject<{
725
935
  failureKind: z.ZodEnum<{
726
936
  gate: "gate";
@@ -730,6 +940,7 @@ export declare const runEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
730
940
  environment: "environment";
731
941
  timeout: "timeout";
732
942
  "provider-auth": "provider-auth";
943
+ stalled: "stalled";
733
944
  "stale-base": "stale-base";
734
945
  "empty-result": "empty-result";
735
946
  unfinished: "unfinished";
@@ -771,6 +982,7 @@ export declare const runEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
771
982
  environment: "environment";
772
983
  timeout: "timeout";
773
984
  "provider-auth": "provider-auth";
985
+ stalled: "stalled";
774
986
  "stale-base": "stale-base";
775
987
  "empty-result": "empty-result";
776
988
  unfinished: "unfinished";
@@ -832,6 +1044,45 @@ export declare const runEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
832
1044
  verificationId: z.ZodString;
833
1045
  workIds: z.ZodArray<z.ZodString>;
834
1046
  policyDigest: z.ZodString;
1047
+ }, z.core.$strict> | z.ZodObject<{
1048
+ state: z.ZodEnum<{
1049
+ active: "active";
1050
+ stalled: "stalled";
1051
+ quiet: "quiet";
1052
+ }>;
1053
+ previous: z.ZodEnum<{
1054
+ active: "active";
1055
+ stalled: "stalled";
1056
+ quiet: "quiet";
1057
+ }>;
1058
+ lastMovementAt: z.ZodISODateTime;
1059
+ idleMs: z.ZodNumber;
1060
+ activity: z.ZodOptional<z.ZodObject<{
1061
+ kind: z.ZodEnum<{
1062
+ gate: "gate";
1063
+ command: "command";
1064
+ agent: "agent";
1065
+ step: "step";
1066
+ }>;
1067
+ label: z.ZodString;
1068
+ }, z.core.$strict>>;
1069
+ cpuUnavailable: z.ZodOptional<z.ZodBoolean>;
1070
+ action: z.ZodOptional<z.ZodEnum<{
1071
+ report: "report";
1072
+ stop: "stop";
1073
+ }>>;
1074
+ snapshot: z.ZodOptional<z.ZodObject<{
1075
+ processes: z.ZodArray<z.ZodObject<{
1076
+ pid: z.ZodNumber;
1077
+ parentPid: z.ZodNumber;
1078
+ cpuMs: z.ZodOptional<z.ZodNumber>;
1079
+ command: z.ZodString;
1080
+ }, z.core.$strict>>;
1081
+ processesUnavailable: z.ZodOptional<z.ZodBoolean>;
1082
+ tail: z.ZodString;
1083
+ artifact: z.ZodOptional<z.ZodString>;
1084
+ }, z.core.$strict>>;
1085
+ verificationId: z.ZodString;
835
1086
  }, z.core.$strict> | z.ZodObject<{
836
1087
  verificationId: z.ZodString;
837
1088
  status: z.ZodEnum<{
@@ -923,7 +1174,7 @@ export declare const readRunEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
923
1174
  workId: z.ZodOptional<z.ZodString>;
924
1175
  runId: z.ZodOptional<z.ZodString>;
925
1176
  attempt: z.ZodOptional<z.ZodNumber>;
926
- type: z.ZodLiteral<"graph.registered" | "graph.reviewed" | "graph.approved" | "work.ready" | "work.held" | "attempt.claimed" | "attempt.phase" | "attempt.gate" | "attempt.review" | "attempt.stage" | "attempt.failed" | "attempt.expired" | "attempt.cancelled" | "attempt.recovered" | "work.accepted" | "work.blocked" | "control.paused" | "control.resumed" | "controller.acquired" | "controller.released" | "budget.blocked" | "corpus.adopted" | "work.recovery" | "joint.started" | "joint.finished" | "policy.applied" | "policy.reconfigure" | "delivery.pending" | "delivery.delivered" | "delivery.failed" | "delivery.conflict" | "delivery.uncertain">;
1177
+ type: z.ZodLiteral<"graph.registered" | "graph.reviewed" | "graph.approved" | "work.ready" | "work.held" | "attempt.claimed" | "attempt.phase" | "attempt.gate" | "attempt.review" | "attempt.stage" | "attempt.liveness" | "attempt.failed" | "attempt.expired" | "attempt.cancelled" | "attempt.recovered" | "work.accepted" | "work.blocked" | "control.paused" | "control.resumed" | "controller.acquired" | "controller.released" | "budget.blocked" | "corpus.adopted" | "work.recovery" | "joint.started" | "joint.liveness" | "joint.finished" | "policy.applied" | "policy.reconfigure" | "delivery.pending" | "delivery.delivered" | "delivery.failed" | "delivery.conflict" | "delivery.uncertain">;
927
1178
  payload: z.ZodObject<{
928
1179
  digest: z.ZodString;
929
1180
  orders: z.ZodNumber;
@@ -1026,6 +1277,44 @@ export declare const readRunEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1026
1277
  passed: "passed";
1027
1278
  failed: "failed";
1028
1279
  }>>;
1280
+ }, z.core.$strict> | z.ZodObject<{
1281
+ state: z.ZodEnum<{
1282
+ active: "active";
1283
+ stalled: "stalled";
1284
+ quiet: "quiet";
1285
+ }>;
1286
+ previous: z.ZodEnum<{
1287
+ active: "active";
1288
+ stalled: "stalled";
1289
+ quiet: "quiet";
1290
+ }>;
1291
+ lastMovementAt: z.ZodISODateTime;
1292
+ idleMs: z.ZodNumber;
1293
+ activity: z.ZodOptional<z.ZodObject<{
1294
+ kind: z.ZodEnum<{
1295
+ gate: "gate";
1296
+ command: "command";
1297
+ agent: "agent";
1298
+ step: "step";
1299
+ }>;
1300
+ label: z.ZodString;
1301
+ }, z.core.$strict>>;
1302
+ cpuUnavailable: z.ZodOptional<z.ZodBoolean>;
1303
+ action: z.ZodOptional<z.ZodEnum<{
1304
+ report: "report";
1305
+ stop: "stop";
1306
+ }>>;
1307
+ snapshot: z.ZodOptional<z.ZodObject<{
1308
+ processes: z.ZodArray<z.ZodObject<{
1309
+ pid: z.ZodNumber;
1310
+ parentPid: z.ZodNumber;
1311
+ cpuMs: z.ZodOptional<z.ZodNumber>;
1312
+ command: z.ZodString;
1313
+ }, z.core.$strict>>;
1314
+ processesUnavailable: z.ZodOptional<z.ZodBoolean>;
1315
+ tail: z.ZodString;
1316
+ artifact: z.ZodOptional<z.ZodString>;
1317
+ }, z.core.$strict>>;
1029
1318
  }, z.core.$strict> | z.ZodObject<{
1030
1319
  failureKind: z.ZodEnum<{
1031
1320
  gate: "gate";
@@ -1035,6 +1324,7 @@ export declare const readRunEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1035
1324
  environment: "environment";
1036
1325
  timeout: "timeout";
1037
1326
  "provider-auth": "provider-auth";
1327
+ stalled: "stalled";
1038
1328
  "stale-base": "stale-base";
1039
1329
  "empty-result": "empty-result";
1040
1330
  unfinished: "unfinished";
@@ -1076,6 +1366,7 @@ export declare const readRunEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1076
1366
  environment: "environment";
1077
1367
  timeout: "timeout";
1078
1368
  "provider-auth": "provider-auth";
1369
+ stalled: "stalled";
1079
1370
  "stale-base": "stale-base";
1080
1371
  "empty-result": "empty-result";
1081
1372
  unfinished: "unfinished";
@@ -1137,6 +1428,45 @@ export declare const readRunEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1137
1428
  verificationId: z.ZodString;
1138
1429
  workIds: z.ZodArray<z.ZodString>;
1139
1430
  policyDigest: z.ZodString;
1431
+ }, z.core.$strict> | z.ZodObject<{
1432
+ state: z.ZodEnum<{
1433
+ active: "active";
1434
+ stalled: "stalled";
1435
+ quiet: "quiet";
1436
+ }>;
1437
+ previous: z.ZodEnum<{
1438
+ active: "active";
1439
+ stalled: "stalled";
1440
+ quiet: "quiet";
1441
+ }>;
1442
+ lastMovementAt: z.ZodISODateTime;
1443
+ idleMs: z.ZodNumber;
1444
+ activity: z.ZodOptional<z.ZodObject<{
1445
+ kind: z.ZodEnum<{
1446
+ gate: "gate";
1447
+ command: "command";
1448
+ agent: "agent";
1449
+ step: "step";
1450
+ }>;
1451
+ label: z.ZodString;
1452
+ }, z.core.$strict>>;
1453
+ cpuUnavailable: z.ZodOptional<z.ZodBoolean>;
1454
+ action: z.ZodOptional<z.ZodEnum<{
1455
+ report: "report";
1456
+ stop: "stop";
1457
+ }>>;
1458
+ snapshot: z.ZodOptional<z.ZodObject<{
1459
+ processes: z.ZodArray<z.ZodObject<{
1460
+ pid: z.ZodNumber;
1461
+ parentPid: z.ZodNumber;
1462
+ cpuMs: z.ZodOptional<z.ZodNumber>;
1463
+ command: z.ZodString;
1464
+ }, z.core.$strict>>;
1465
+ processesUnavailable: z.ZodOptional<z.ZodBoolean>;
1466
+ tail: z.ZodString;
1467
+ artifact: z.ZodOptional<z.ZodString>;
1468
+ }, z.core.$strict>>;
1469
+ verificationId: z.ZodString;
1140
1470
  }, z.core.$strict> | z.ZodObject<{
1141
1471
  verificationId: z.ZodString;
1142
1472
  status: z.ZodEnum<{
@@ -1198,7 +1528,7 @@ export declare const readRunEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1198
1528
  workId: z.ZodOptional<z.ZodString>;
1199
1529
  runId: z.ZodOptional<z.ZodString>;
1200
1530
  attempt: z.ZodOptional<z.ZodNumber>;
1201
- type: z.ZodLiteral<"graph.registered" | "graph.reviewed" | "graph.approved" | "work.ready" | "work.held" | "attempt.claimed" | "attempt.phase" | "attempt.gate" | "attempt.review" | "attempt.stage" | "attempt.failed" | "attempt.expired" | "attempt.cancelled" | "attempt.recovered" | "work.accepted" | "work.blocked" | "control.paused" | "control.resumed" | "controller.acquired" | "controller.released" | "budget.blocked" | "corpus.adopted" | "work.recovery" | "joint.started" | "joint.finished" | "policy.applied" | "policy.reconfigure" | "delivery.pending" | "delivery.delivered" | "delivery.failed" | "delivery.conflict" | "delivery.uncertain">;
1531
+ type: z.ZodLiteral<"graph.registered" | "graph.reviewed" | "graph.approved" | "work.ready" | "work.held" | "attempt.claimed" | "attempt.phase" | "attempt.gate" | "attempt.review" | "attempt.stage" | "attempt.liveness" | "attempt.failed" | "attempt.expired" | "attempt.cancelled" | "attempt.recovered" | "work.accepted" | "work.blocked" | "control.paused" | "control.resumed" | "controller.acquired" | "controller.released" | "budget.blocked" | "corpus.adopted" | "work.recovery" | "joint.started" | "joint.liveness" | "joint.finished" | "policy.applied" | "policy.reconfigure" | "delivery.pending" | "delivery.delivered" | "delivery.failed" | "delivery.conflict" | "delivery.uncertain">;
1202
1532
  payload: z.ZodObject<{
1203
1533
  digest: z.ZodString;
1204
1534
  orders: z.ZodNumber;
@@ -1301,6 +1631,44 @@ export declare const readRunEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1301
1631
  passed: "passed";
1302
1632
  failed: "failed";
1303
1633
  }>>;
1634
+ }, z.core.$strict> | z.ZodObject<{
1635
+ state: z.ZodEnum<{
1636
+ active: "active";
1637
+ stalled: "stalled";
1638
+ quiet: "quiet";
1639
+ }>;
1640
+ previous: z.ZodEnum<{
1641
+ active: "active";
1642
+ stalled: "stalled";
1643
+ quiet: "quiet";
1644
+ }>;
1645
+ lastMovementAt: z.ZodISODateTime;
1646
+ idleMs: z.ZodNumber;
1647
+ activity: z.ZodOptional<z.ZodObject<{
1648
+ kind: z.ZodEnum<{
1649
+ gate: "gate";
1650
+ command: "command";
1651
+ agent: "agent";
1652
+ step: "step";
1653
+ }>;
1654
+ label: z.ZodString;
1655
+ }, z.core.$strict>>;
1656
+ cpuUnavailable: z.ZodOptional<z.ZodBoolean>;
1657
+ action: z.ZodOptional<z.ZodEnum<{
1658
+ report: "report";
1659
+ stop: "stop";
1660
+ }>>;
1661
+ snapshot: z.ZodOptional<z.ZodObject<{
1662
+ processes: z.ZodArray<z.ZodObject<{
1663
+ pid: z.ZodNumber;
1664
+ parentPid: z.ZodNumber;
1665
+ cpuMs: z.ZodOptional<z.ZodNumber>;
1666
+ command: z.ZodString;
1667
+ }, z.core.$strict>>;
1668
+ processesUnavailable: z.ZodOptional<z.ZodBoolean>;
1669
+ tail: z.ZodString;
1670
+ artifact: z.ZodOptional<z.ZodString>;
1671
+ }, z.core.$strict>>;
1304
1672
  }, z.core.$strict> | z.ZodObject<{
1305
1673
  failureKind: z.ZodEnum<{
1306
1674
  gate: "gate";
@@ -1310,6 +1678,7 @@ export declare const readRunEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1310
1678
  environment: "environment";
1311
1679
  timeout: "timeout";
1312
1680
  "provider-auth": "provider-auth";
1681
+ stalled: "stalled";
1313
1682
  "stale-base": "stale-base";
1314
1683
  "empty-result": "empty-result";
1315
1684
  unfinished: "unfinished";
@@ -1351,6 +1720,7 @@ export declare const readRunEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1351
1720
  environment: "environment";
1352
1721
  timeout: "timeout";
1353
1722
  "provider-auth": "provider-auth";
1723
+ stalled: "stalled";
1354
1724
  "stale-base": "stale-base";
1355
1725
  "empty-result": "empty-result";
1356
1726
  unfinished: "unfinished";
@@ -1412,6 +1782,45 @@ export declare const readRunEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1412
1782
  verificationId: z.ZodString;
1413
1783
  workIds: z.ZodArray<z.ZodString>;
1414
1784
  policyDigest: z.ZodString;
1785
+ }, z.core.$strict> | z.ZodObject<{
1786
+ state: z.ZodEnum<{
1787
+ active: "active";
1788
+ stalled: "stalled";
1789
+ quiet: "quiet";
1790
+ }>;
1791
+ previous: z.ZodEnum<{
1792
+ active: "active";
1793
+ stalled: "stalled";
1794
+ quiet: "quiet";
1795
+ }>;
1796
+ lastMovementAt: z.ZodISODateTime;
1797
+ idleMs: z.ZodNumber;
1798
+ activity: z.ZodOptional<z.ZodObject<{
1799
+ kind: z.ZodEnum<{
1800
+ gate: "gate";
1801
+ command: "command";
1802
+ agent: "agent";
1803
+ step: "step";
1804
+ }>;
1805
+ label: z.ZodString;
1806
+ }, z.core.$strict>>;
1807
+ cpuUnavailable: z.ZodOptional<z.ZodBoolean>;
1808
+ action: z.ZodOptional<z.ZodEnum<{
1809
+ report: "report";
1810
+ stop: "stop";
1811
+ }>>;
1812
+ snapshot: z.ZodOptional<z.ZodObject<{
1813
+ processes: z.ZodArray<z.ZodObject<{
1814
+ pid: z.ZodNumber;
1815
+ parentPid: z.ZodNumber;
1816
+ cpuMs: z.ZodOptional<z.ZodNumber>;
1817
+ command: z.ZodString;
1818
+ }, z.core.$strict>>;
1819
+ processesUnavailable: z.ZodOptional<z.ZodBoolean>;
1820
+ tail: z.ZodString;
1821
+ artifact: z.ZodOptional<z.ZodString>;
1822
+ }, z.core.$strict>>;
1823
+ verificationId: z.ZodString;
1415
1824
  }, z.core.$strict> | z.ZodObject<{
1416
1825
  verificationId: z.ZodString;
1417
1826
  status: z.ZodEnum<{
@@ -1494,6 +1903,6 @@ export type RunEventDraft = {
1494
1903
  * остановки очереди), поэтому harness использует те же имена, а не новые.
1495
1904
  * `heartbeat` продлевает сроки и события не создаёт.
1496
1905
  */
1497
- export declare const transactionKinds: readonly ["run.claimed", "heartbeat", "run.heartbeat-failed", "run.phase", "run.context", "run.dependencies", "run.dependency-freshness", "run.consumer-checked", "run.implementation-basis", "run.partial", "run.continuation", "run.model", "run.timing.started", "run.timing.finished", "evidence.recorded", "reproduction.recorded", "findings.recorded", "task.done", "run.failed", "run.recovered", "recovery.rejected", "runs.expired", "task.retry", "task.cancelled", "task.held", "task.released", "task.hold-transferred", "wait.started", "wait.cleared", "recovery.reserved", "recovery.decided", "recovery.applied", "recovery.interrupted", "scheduler.started", "scheduler.paused", "scheduler.released", "scheduler.error", "scheduler.blockers", "config.started", "config.reconfigured", "config.reconfigure-requested", "config.reconfigure-cleared", "graph.registered", "graph.reviewed", "graph.approved", "delivery.recorded", "workspace.verification.started", "workspace.manifest", "workspace.evidence", "workspace.verified", "workspace.failed", "base.moved", "workflow.updated", "usage.recorded", "checks.recorded", "checks.adopted", "checks.awaiting-operator", "checks.adoption-abandoned", "checks.spike"];
1906
+ export declare const transactionKinds: readonly ["run.claimed", "heartbeat", "run.heartbeat-failed", "run.phase", "run.context", "run.dependencies", "run.dependency-freshness", "run.consumer-checked", "run.implementation-basis", "run.partial", "run.continuation", "run.model", "run.timing.started", "run.timing.finished", "run.liveness", "evidence.recorded", "reproduction.recorded", "findings.recorded", "task.done", "run.failed", "run.recovered", "recovery.rejected", "runs.expired", "task.retry", "task.cancelled", "task.held", "task.released", "task.hold-transferred", "wait.started", "wait.cleared", "recovery.reserved", "recovery.decided", "recovery.applied", "recovery.interrupted", "scheduler.started", "scheduler.paused", "scheduler.released", "scheduler.error", "scheduler.blockers", "config.started", "config.reconfigured", "config.reconfigure-requested", "config.reconfigure-cleared", "graph.registered", "graph.reviewed", "graph.approved", "delivery.recorded", "workspace.verification.started", "workspace.manifest", "workspace.evidence", "workspace.verified", "workspace.failed", "workspace.liveness", "base.moved", "workflow.updated", "usage.recorded", "checks.recorded", "checks.adopted", "checks.awaiting-operator", "checks.adoption-abandoned", "checks.spike"];
1498
1907
  export type TransactionKind = (typeof transactionKinds)[number];
1499
1908
  export {};