@exaudeus/workrail 3.75.0 → 3.77.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/dist/console-ui/assets/index-D9pYbwS0.js +28 -0
  2. package/dist/console-ui/index.html +1 -1
  3. package/dist/coordinators/adaptive-pipeline.d.ts +8 -0
  4. package/dist/coordinators/context-assembly.d.ts +4 -0
  5. package/dist/coordinators/context-assembly.js +156 -0
  6. package/dist/coordinators/modes/full-pipeline.d.ts +1 -1
  7. package/dist/coordinators/modes/full-pipeline.js +140 -27
  8. package/dist/coordinators/modes/implement-shared.d.ts +3 -2
  9. package/dist/coordinators/modes/implement-shared.js +16 -6
  10. package/dist/coordinators/modes/implement.js +49 -3
  11. package/dist/coordinators/pipeline-run-context.d.ts +1811 -0
  12. package/dist/coordinators/pipeline-run-context.js +114 -0
  13. package/dist/daemon/context-loader.d.ts +1 -1
  14. package/dist/daemon/core/agent-client.d.ts +7 -0
  15. package/dist/daemon/core/agent-client.js +31 -0
  16. package/dist/daemon/core/index.d.ts +6 -0
  17. package/dist/daemon/core/index.js +19 -0
  18. package/dist/daemon/core/session-context.d.ts +14 -0
  19. package/dist/daemon/core/session-context.js +24 -0
  20. package/dist/daemon/core/session-result.d.ts +10 -0
  21. package/dist/daemon/core/session-result.js +92 -0
  22. package/dist/daemon/core/system-prompt.d.ts +6 -0
  23. package/dist/daemon/core/system-prompt.js +151 -0
  24. package/dist/daemon/io/conversation-log.d.ts +2 -0
  25. package/dist/daemon/io/conversation-log.js +45 -0
  26. package/dist/daemon/io/execution-stats.d.ts +7 -0
  27. package/dist/daemon/io/execution-stats.js +86 -0
  28. package/dist/daemon/io/index.d.ts +5 -0
  29. package/dist/daemon/io/index.js +24 -0
  30. package/dist/daemon/io/session-notes-loader.d.ts +4 -0
  31. package/dist/daemon/io/session-notes-loader.js +45 -0
  32. package/dist/daemon/io/soul-loader.d.ts +3 -0
  33. package/dist/daemon/io/soul-loader.js +68 -0
  34. package/dist/daemon/io/workspace-context-loader.d.ts +17 -0
  35. package/dist/daemon/io/workspace-context-loader.js +137 -0
  36. package/dist/daemon/runner/agent-loop-runner.d.ts +28 -0
  37. package/dist/daemon/runner/agent-loop-runner.js +250 -0
  38. package/dist/daemon/runner/construct-tools.d.ts +5 -0
  39. package/dist/daemon/runner/construct-tools.js +30 -0
  40. package/dist/daemon/runner/finalize-session.d.ts +3 -0
  41. package/dist/daemon/runner/finalize-session.js +75 -0
  42. package/dist/daemon/runner/index.d.ts +8 -0
  43. package/dist/daemon/runner/index.js +18 -0
  44. package/dist/daemon/runner/pre-agent-session.d.ts +7 -0
  45. package/dist/daemon/runner/pre-agent-session.js +227 -0
  46. package/dist/daemon/runner/runner-types.d.ts +73 -0
  47. package/dist/daemon/runner/runner-types.js +39 -0
  48. package/dist/daemon/runner/tool-schemas.d.ts +1 -0
  49. package/dist/daemon/runner/tool-schemas.js +151 -0
  50. package/dist/daemon/session-scope.d.ts +1 -1
  51. package/dist/daemon/startup-recovery.d.ts +20 -0
  52. package/dist/daemon/startup-recovery.js +323 -0
  53. package/dist/daemon/state/index.d.ts +6 -0
  54. package/dist/daemon/state/index.js +14 -0
  55. package/dist/daemon/state/session-state.d.ts +23 -0
  56. package/dist/daemon/state/session-state.js +44 -0
  57. package/dist/daemon/state/stuck-detection.d.ts +22 -0
  58. package/dist/daemon/state/stuck-detection.js +25 -0
  59. package/dist/daemon/state/terminal-signal.d.ts +9 -0
  60. package/dist/daemon/state/terminal-signal.js +10 -0
  61. package/dist/daemon/tools/file-tools.d.ts +1 -1
  62. package/dist/daemon/turn-end/detect-stuck.d.ts +2 -2
  63. package/dist/daemon/turn-end/detect-stuck.js +2 -2
  64. package/dist/daemon/turn-end/step-injector.d.ts +1 -1
  65. package/dist/daemon/types.d.ts +105 -0
  66. package/dist/daemon/types.js +11 -0
  67. package/dist/daemon/workflow-enricher.d.ts +16 -0
  68. package/dist/daemon/workflow-enricher.js +58 -0
  69. package/dist/daemon/workflow-runner.d.ts +13 -277
  70. package/dist/daemon/workflow-runner.js +63 -1421
  71. package/dist/manifest.json +280 -56
  72. package/dist/trigger/coordinator-deps.d.ts +1 -1
  73. package/dist/trigger/coordinator-deps.js +131 -0
  74. package/dist/trigger/delivery-client.d.ts +1 -1
  75. package/dist/trigger/delivery-pipeline.d.ts +1 -1
  76. package/dist/trigger/notification-service.d.ts +1 -1
  77. package/dist/trigger/trigger-listener.js +6 -2
  78. package/dist/trigger/trigger-router.d.ts +2 -2
  79. package/dist/v2/durable-core/domain/artifact-contract-validator.js +99 -0
  80. package/dist/v2/durable-core/schemas/artifacts/discovery-handoff.d.ts +39 -0
  81. package/dist/v2/durable-core/schemas/artifacts/discovery-handoff.js +10 -1
  82. package/dist/v2/durable-core/schemas/artifacts/index.d.ts +2 -1
  83. package/dist/v2/durable-core/schemas/artifacts/index.js +12 -1
  84. package/dist/v2/durable-core/schemas/artifacts/phase-handoff.d.ts +89 -0
  85. package/dist/v2/durable-core/schemas/artifacts/phase-handoff.js +56 -0
  86. package/docs/authoring-v2.md +12 -0
  87. package/docs/ideas/backlog.md +639 -25
  88. package/docs/reference/worktrain-daemon-invariants.md +33 -49
  89. package/docs/vision.md +5 -15
  90. package/package.json +2 -2
  91. package/workflows/coding-task-workflow-agentic.json +9 -6
  92. package/workflows/mr-review-workflow.agentic.v2.json +2 -2
  93. package/workflows/wr.discovery.json +2 -1
  94. package/workflows/wr.shaping.json +7 -4
  95. package/dist/console-ui/assets/index-BvBihscd.js +0 -28
@@ -0,0 +1,1811 @@
1
+ import { z } from 'zod';
2
+ import type { Result } from 'neverthrow';
3
+ import { type DiscoveryHandoffArtifactV1, type ShapingHandoffArtifactV1, type CodingHandoffArtifactV1, type ReviewVerdictArtifactV1 } from '../v2/durable-core/schemas/artifacts/index.js';
4
+ export type PhaseResult<TArtifact> = {
5
+ readonly kind: 'full';
6
+ readonly artifact: TArtifact;
7
+ readonly confidenceBand: 'high' | 'medium' | 'low' | null;
8
+ readonly recapMarkdown: string | null;
9
+ } | {
10
+ readonly kind: 'partial';
11
+ readonly recapMarkdown: string;
12
+ } | {
13
+ readonly kind: 'fallback';
14
+ readonly recapMarkdown: string | null;
15
+ };
16
+ export declare const MIN_NOTES_LENGTH_FOR_PHASE_RESULT = 50;
17
+ export declare function buildPhaseResult<TArtifact>(artifact: TArtifact | null, recapMarkdown: string | null): PhaseResult<TArtifact>;
18
+ export interface DiscoveryPhaseRecord {
19
+ readonly completedAt: string;
20
+ readonly sessionHandle: string;
21
+ readonly result: PhaseResult<DiscoveryHandoffArtifactV1>;
22
+ }
23
+ export interface ShapingPhaseRecord {
24
+ readonly completedAt: string;
25
+ readonly sessionHandle: string;
26
+ readonly result: PhaseResult<ShapingHandoffArtifactV1>;
27
+ }
28
+ export interface CodingPhaseRecord {
29
+ readonly completedAt: string;
30
+ readonly sessionHandle: string;
31
+ readonly result: PhaseResult<CodingHandoffArtifactV1>;
32
+ }
33
+ export interface ReviewPhaseRecord {
34
+ readonly completedAt: string;
35
+ readonly sessionHandle: string;
36
+ readonly result: PhaseResult<ReviewVerdictArtifactV1>;
37
+ }
38
+ export type PhaseRecord = {
39
+ readonly phase: 'discovery';
40
+ readonly record: DiscoveryPhaseRecord;
41
+ } | {
42
+ readonly phase: 'shaping';
43
+ readonly record: ShapingPhaseRecord;
44
+ } | {
45
+ readonly phase: 'coding';
46
+ readonly record: CodingPhaseRecord;
47
+ } | {
48
+ readonly phase: 'review';
49
+ readonly record: ReviewPhaseRecord;
50
+ };
51
+ export interface PipelineRunContext {
52
+ readonly runId: string;
53
+ readonly goal: string;
54
+ readonly workspace: string;
55
+ readonly startedAt: string;
56
+ readonly pipelineMode: 'FULL' | 'IMPLEMENT' | 'REVIEW_ONLY' | 'QUICK_REVIEW';
57
+ readonly status?: 'in_progress' | 'completed';
58
+ readonly phases: {
59
+ readonly discovery?: DiscoveryPhaseRecord;
60
+ readonly shaping?: ShapingPhaseRecord;
61
+ readonly coding?: CodingPhaseRecord;
62
+ readonly review?: ReviewPhaseRecord;
63
+ };
64
+ }
65
+ export declare const DiscoveryPhaseRecordSchema: z.ZodObject<{
66
+ completedAt: z.ZodString;
67
+ sessionHandle: z.ZodString;
68
+ result: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
69
+ kind: z.ZodLiteral<"full">;
70
+ artifact: z.ZodObject<{
71
+ kind: z.ZodLiteral<"wr.discovery_handoff">;
72
+ version: z.ZodLiteral<1>;
73
+ selectedDirection: z.ZodString;
74
+ designDocPath: z.ZodString;
75
+ confidenceBand: z.ZodEnum<["high", "medium", "low"]>;
76
+ keyInvariants: z.ZodArray<z.ZodString, "many">;
77
+ rejectedDirections: z.ZodOptional<z.ZodArray<z.ZodObject<{
78
+ direction: z.ZodString;
79
+ reason: z.ZodString;
80
+ }, "strip", z.ZodTypeAny, {
81
+ reason: string;
82
+ direction: string;
83
+ }, {
84
+ reason: string;
85
+ direction: string;
86
+ }>, "many">>;
87
+ implementationConstraints: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
88
+ keyCodebaseLocations: z.ZodOptional<z.ZodArray<z.ZodObject<{
89
+ path: z.ZodString;
90
+ relevance: z.ZodString;
91
+ }, "strip", z.ZodTypeAny, {
92
+ path: string;
93
+ relevance: string;
94
+ }, {
95
+ path: string;
96
+ relevance: string;
97
+ }>, "many">>;
98
+ }, "strict", z.ZodTypeAny, {
99
+ kind: "wr.discovery_handoff";
100
+ version: 1;
101
+ selectedDirection: string;
102
+ designDocPath: string;
103
+ confidenceBand: "low" | "high" | "medium";
104
+ keyInvariants: string[];
105
+ rejectedDirections?: {
106
+ reason: string;
107
+ direction: string;
108
+ }[] | undefined;
109
+ implementationConstraints?: string[] | undefined;
110
+ keyCodebaseLocations?: {
111
+ path: string;
112
+ relevance: string;
113
+ }[] | undefined;
114
+ }, {
115
+ kind: "wr.discovery_handoff";
116
+ version: 1;
117
+ selectedDirection: string;
118
+ designDocPath: string;
119
+ confidenceBand: "low" | "high" | "medium";
120
+ keyInvariants: string[];
121
+ rejectedDirections?: {
122
+ reason: string;
123
+ direction: string;
124
+ }[] | undefined;
125
+ implementationConstraints?: string[] | undefined;
126
+ keyCodebaseLocations?: {
127
+ path: string;
128
+ relevance: string;
129
+ }[] | undefined;
130
+ }>;
131
+ confidenceBand: z.ZodNullable<z.ZodEnum<["high", "medium", "low"]>>;
132
+ recapMarkdown: z.ZodNullable<z.ZodString>;
133
+ }, "strip", z.ZodTypeAny, {
134
+ kind: "full";
135
+ artifact: {
136
+ kind: "wr.discovery_handoff";
137
+ version: 1;
138
+ selectedDirection: string;
139
+ designDocPath: string;
140
+ confidenceBand: "low" | "high" | "medium";
141
+ keyInvariants: string[];
142
+ rejectedDirections?: {
143
+ reason: string;
144
+ direction: string;
145
+ }[] | undefined;
146
+ implementationConstraints?: string[] | undefined;
147
+ keyCodebaseLocations?: {
148
+ path: string;
149
+ relevance: string;
150
+ }[] | undefined;
151
+ };
152
+ confidenceBand: "low" | "high" | "medium" | null;
153
+ recapMarkdown: string | null;
154
+ }, {
155
+ kind: "full";
156
+ artifact: {
157
+ kind: "wr.discovery_handoff";
158
+ version: 1;
159
+ selectedDirection: string;
160
+ designDocPath: string;
161
+ confidenceBand: "low" | "high" | "medium";
162
+ keyInvariants: string[];
163
+ rejectedDirections?: {
164
+ reason: string;
165
+ direction: string;
166
+ }[] | undefined;
167
+ implementationConstraints?: string[] | undefined;
168
+ keyCodebaseLocations?: {
169
+ path: string;
170
+ relevance: string;
171
+ }[] | undefined;
172
+ };
173
+ confidenceBand: "low" | "high" | "medium" | null;
174
+ recapMarkdown: string | null;
175
+ }>, z.ZodObject<{
176
+ kind: z.ZodLiteral<"partial">;
177
+ recapMarkdown: z.ZodString;
178
+ }, "strip", z.ZodTypeAny, {
179
+ kind: "partial";
180
+ recapMarkdown: string;
181
+ }, {
182
+ kind: "partial";
183
+ recapMarkdown: string;
184
+ }>, z.ZodObject<{
185
+ kind: z.ZodLiteral<"fallback">;
186
+ recapMarkdown: z.ZodNullable<z.ZodString>;
187
+ }, "strip", z.ZodTypeAny, {
188
+ kind: "fallback";
189
+ recapMarkdown: string | null;
190
+ }, {
191
+ kind: "fallback";
192
+ recapMarkdown: string | null;
193
+ }>]>;
194
+ }, "strip", z.ZodTypeAny, {
195
+ result: {
196
+ kind: "full";
197
+ artifact: {
198
+ kind: "wr.discovery_handoff";
199
+ version: 1;
200
+ selectedDirection: string;
201
+ designDocPath: string;
202
+ confidenceBand: "low" | "high" | "medium";
203
+ keyInvariants: string[];
204
+ rejectedDirections?: {
205
+ reason: string;
206
+ direction: string;
207
+ }[] | undefined;
208
+ implementationConstraints?: string[] | undefined;
209
+ keyCodebaseLocations?: {
210
+ path: string;
211
+ relevance: string;
212
+ }[] | undefined;
213
+ };
214
+ confidenceBand: "low" | "high" | "medium" | null;
215
+ recapMarkdown: string | null;
216
+ } | {
217
+ kind: "partial";
218
+ recapMarkdown: string;
219
+ } | {
220
+ kind: "fallback";
221
+ recapMarkdown: string | null;
222
+ };
223
+ completedAt: string;
224
+ sessionHandle: string;
225
+ }, {
226
+ result: {
227
+ kind: "full";
228
+ artifact: {
229
+ kind: "wr.discovery_handoff";
230
+ version: 1;
231
+ selectedDirection: string;
232
+ designDocPath: string;
233
+ confidenceBand: "low" | "high" | "medium";
234
+ keyInvariants: string[];
235
+ rejectedDirections?: {
236
+ reason: string;
237
+ direction: string;
238
+ }[] | undefined;
239
+ implementationConstraints?: string[] | undefined;
240
+ keyCodebaseLocations?: {
241
+ path: string;
242
+ relevance: string;
243
+ }[] | undefined;
244
+ };
245
+ confidenceBand: "low" | "high" | "medium" | null;
246
+ recapMarkdown: string | null;
247
+ } | {
248
+ kind: "partial";
249
+ recapMarkdown: string;
250
+ } | {
251
+ kind: "fallback";
252
+ recapMarkdown: string | null;
253
+ };
254
+ completedAt: string;
255
+ sessionHandle: string;
256
+ }>;
257
+ export declare const ShapingPhaseRecordSchema: z.ZodObject<{
258
+ completedAt: z.ZodString;
259
+ sessionHandle: z.ZodString;
260
+ result: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
261
+ kind: z.ZodLiteral<"full">;
262
+ artifact: z.ZodObject<{
263
+ kind: z.ZodLiteral<"wr.shaping_handoff">;
264
+ version: z.ZodLiteral<1>;
265
+ pitchPath: z.ZodString;
266
+ selectedShape: z.ZodString;
267
+ appetite: z.ZodString;
268
+ keyConstraints: z.ZodArray<z.ZodString, "many">;
269
+ rabbitHoles: z.ZodArray<z.ZodString, "many">;
270
+ outOfScope: z.ZodArray<z.ZodString, "many">;
271
+ validationChecklist: z.ZodArray<z.ZodString, "many">;
272
+ }, "strict", z.ZodTypeAny, {
273
+ kind: "wr.shaping_handoff";
274
+ version: 1;
275
+ pitchPath: string;
276
+ selectedShape: string;
277
+ appetite: string;
278
+ keyConstraints: string[];
279
+ rabbitHoles: string[];
280
+ outOfScope: string[];
281
+ validationChecklist: string[];
282
+ }, {
283
+ kind: "wr.shaping_handoff";
284
+ version: 1;
285
+ pitchPath: string;
286
+ selectedShape: string;
287
+ appetite: string;
288
+ keyConstraints: string[];
289
+ rabbitHoles: string[];
290
+ outOfScope: string[];
291
+ validationChecklist: string[];
292
+ }>;
293
+ confidenceBand: z.ZodNullable<z.ZodEnum<["high", "medium", "low"]>>;
294
+ recapMarkdown: z.ZodNullable<z.ZodString>;
295
+ }, "strip", z.ZodTypeAny, {
296
+ kind: "full";
297
+ artifact: {
298
+ kind: "wr.shaping_handoff";
299
+ version: 1;
300
+ pitchPath: string;
301
+ selectedShape: string;
302
+ appetite: string;
303
+ keyConstraints: string[];
304
+ rabbitHoles: string[];
305
+ outOfScope: string[];
306
+ validationChecklist: string[];
307
+ };
308
+ confidenceBand: "low" | "high" | "medium" | null;
309
+ recapMarkdown: string | null;
310
+ }, {
311
+ kind: "full";
312
+ artifact: {
313
+ kind: "wr.shaping_handoff";
314
+ version: 1;
315
+ pitchPath: string;
316
+ selectedShape: string;
317
+ appetite: string;
318
+ keyConstraints: string[];
319
+ rabbitHoles: string[];
320
+ outOfScope: string[];
321
+ validationChecklist: string[];
322
+ };
323
+ confidenceBand: "low" | "high" | "medium" | null;
324
+ recapMarkdown: string | null;
325
+ }>, z.ZodObject<{
326
+ kind: z.ZodLiteral<"partial">;
327
+ recapMarkdown: z.ZodString;
328
+ }, "strip", z.ZodTypeAny, {
329
+ kind: "partial";
330
+ recapMarkdown: string;
331
+ }, {
332
+ kind: "partial";
333
+ recapMarkdown: string;
334
+ }>, z.ZodObject<{
335
+ kind: z.ZodLiteral<"fallback">;
336
+ recapMarkdown: z.ZodNullable<z.ZodString>;
337
+ }, "strip", z.ZodTypeAny, {
338
+ kind: "fallback";
339
+ recapMarkdown: string | null;
340
+ }, {
341
+ kind: "fallback";
342
+ recapMarkdown: string | null;
343
+ }>]>;
344
+ }, "strip", z.ZodTypeAny, {
345
+ result: {
346
+ kind: "full";
347
+ artifact: {
348
+ kind: "wr.shaping_handoff";
349
+ version: 1;
350
+ pitchPath: string;
351
+ selectedShape: string;
352
+ appetite: string;
353
+ keyConstraints: string[];
354
+ rabbitHoles: string[];
355
+ outOfScope: string[];
356
+ validationChecklist: string[];
357
+ };
358
+ confidenceBand: "low" | "high" | "medium" | null;
359
+ recapMarkdown: string | null;
360
+ } | {
361
+ kind: "partial";
362
+ recapMarkdown: string;
363
+ } | {
364
+ kind: "fallback";
365
+ recapMarkdown: string | null;
366
+ };
367
+ completedAt: string;
368
+ sessionHandle: string;
369
+ }, {
370
+ result: {
371
+ kind: "full";
372
+ artifact: {
373
+ kind: "wr.shaping_handoff";
374
+ version: 1;
375
+ pitchPath: string;
376
+ selectedShape: string;
377
+ appetite: string;
378
+ keyConstraints: string[];
379
+ rabbitHoles: string[];
380
+ outOfScope: string[];
381
+ validationChecklist: string[];
382
+ };
383
+ confidenceBand: "low" | "high" | "medium" | null;
384
+ recapMarkdown: string | null;
385
+ } | {
386
+ kind: "partial";
387
+ recapMarkdown: string;
388
+ } | {
389
+ kind: "fallback";
390
+ recapMarkdown: string | null;
391
+ };
392
+ completedAt: string;
393
+ sessionHandle: string;
394
+ }>;
395
+ export declare const CodingPhaseRecordSchema: z.ZodObject<{
396
+ completedAt: z.ZodString;
397
+ sessionHandle: z.ZodString;
398
+ result: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
399
+ kind: z.ZodLiteral<"full">;
400
+ artifact: z.ZodObject<{
401
+ kind: z.ZodLiteral<"wr.coding_handoff">;
402
+ version: z.ZodLiteral<1>;
403
+ branchName: z.ZodString;
404
+ keyDecisions: z.ZodArray<z.ZodString, "many">;
405
+ knownLimitations: z.ZodArray<z.ZodString, "many">;
406
+ testsAdded: z.ZodArray<z.ZodString, "many">;
407
+ filesChanged: z.ZodArray<z.ZodString, "many">;
408
+ correctedAssumptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
409
+ assumed: z.ZodString;
410
+ actual: z.ZodString;
411
+ }, "strip", z.ZodTypeAny, {
412
+ assumed: string;
413
+ actual: string;
414
+ }, {
415
+ assumed: string;
416
+ actual: string;
417
+ }>, "many">>;
418
+ }, "strict", z.ZodTypeAny, {
419
+ kind: "wr.coding_handoff";
420
+ version: 1;
421
+ branchName: string;
422
+ keyDecisions: string[];
423
+ knownLimitations: string[];
424
+ testsAdded: string[];
425
+ filesChanged: string[];
426
+ correctedAssumptions?: {
427
+ assumed: string;
428
+ actual: string;
429
+ }[] | undefined;
430
+ }, {
431
+ kind: "wr.coding_handoff";
432
+ version: 1;
433
+ branchName: string;
434
+ keyDecisions: string[];
435
+ knownLimitations: string[];
436
+ testsAdded: string[];
437
+ filesChanged: string[];
438
+ correctedAssumptions?: {
439
+ assumed: string;
440
+ actual: string;
441
+ }[] | undefined;
442
+ }>;
443
+ confidenceBand: z.ZodNullable<z.ZodEnum<["high", "medium", "low"]>>;
444
+ recapMarkdown: z.ZodNullable<z.ZodString>;
445
+ }, "strip", z.ZodTypeAny, {
446
+ kind: "full";
447
+ artifact: {
448
+ kind: "wr.coding_handoff";
449
+ version: 1;
450
+ branchName: string;
451
+ keyDecisions: string[];
452
+ knownLimitations: string[];
453
+ testsAdded: string[];
454
+ filesChanged: string[];
455
+ correctedAssumptions?: {
456
+ assumed: string;
457
+ actual: string;
458
+ }[] | undefined;
459
+ };
460
+ confidenceBand: "low" | "high" | "medium" | null;
461
+ recapMarkdown: string | null;
462
+ }, {
463
+ kind: "full";
464
+ artifact: {
465
+ kind: "wr.coding_handoff";
466
+ version: 1;
467
+ branchName: string;
468
+ keyDecisions: string[];
469
+ knownLimitations: string[];
470
+ testsAdded: string[];
471
+ filesChanged: string[];
472
+ correctedAssumptions?: {
473
+ assumed: string;
474
+ actual: string;
475
+ }[] | undefined;
476
+ };
477
+ confidenceBand: "low" | "high" | "medium" | null;
478
+ recapMarkdown: string | null;
479
+ }>, z.ZodObject<{
480
+ kind: z.ZodLiteral<"partial">;
481
+ recapMarkdown: z.ZodString;
482
+ }, "strip", z.ZodTypeAny, {
483
+ kind: "partial";
484
+ recapMarkdown: string;
485
+ }, {
486
+ kind: "partial";
487
+ recapMarkdown: string;
488
+ }>, z.ZodObject<{
489
+ kind: z.ZodLiteral<"fallback">;
490
+ recapMarkdown: z.ZodNullable<z.ZodString>;
491
+ }, "strip", z.ZodTypeAny, {
492
+ kind: "fallback";
493
+ recapMarkdown: string | null;
494
+ }, {
495
+ kind: "fallback";
496
+ recapMarkdown: string | null;
497
+ }>]>;
498
+ }, "strip", z.ZodTypeAny, {
499
+ result: {
500
+ kind: "full";
501
+ artifact: {
502
+ kind: "wr.coding_handoff";
503
+ version: 1;
504
+ branchName: string;
505
+ keyDecisions: string[];
506
+ knownLimitations: string[];
507
+ testsAdded: string[];
508
+ filesChanged: string[];
509
+ correctedAssumptions?: {
510
+ assumed: string;
511
+ actual: string;
512
+ }[] | undefined;
513
+ };
514
+ confidenceBand: "low" | "high" | "medium" | null;
515
+ recapMarkdown: string | null;
516
+ } | {
517
+ kind: "partial";
518
+ recapMarkdown: string;
519
+ } | {
520
+ kind: "fallback";
521
+ recapMarkdown: string | null;
522
+ };
523
+ completedAt: string;
524
+ sessionHandle: string;
525
+ }, {
526
+ result: {
527
+ kind: "full";
528
+ artifact: {
529
+ kind: "wr.coding_handoff";
530
+ version: 1;
531
+ branchName: string;
532
+ keyDecisions: string[];
533
+ knownLimitations: string[];
534
+ testsAdded: string[];
535
+ filesChanged: string[];
536
+ correctedAssumptions?: {
537
+ assumed: string;
538
+ actual: string;
539
+ }[] | undefined;
540
+ };
541
+ confidenceBand: "low" | "high" | "medium" | null;
542
+ recapMarkdown: string | null;
543
+ } | {
544
+ kind: "partial";
545
+ recapMarkdown: string;
546
+ } | {
547
+ kind: "fallback";
548
+ recapMarkdown: string | null;
549
+ };
550
+ completedAt: string;
551
+ sessionHandle: string;
552
+ }>;
553
+ export declare const ReviewPhaseRecordSchema: z.ZodObject<{
554
+ completedAt: z.ZodString;
555
+ sessionHandle: z.ZodString;
556
+ result: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
557
+ kind: z.ZodLiteral<"full">;
558
+ artifact: z.ZodObject<{
559
+ kind: z.ZodLiteral<"wr.review_verdict">;
560
+ verdict: z.ZodEnum<["clean", "minor", "blocking"]>;
561
+ confidence: z.ZodEnum<["high", "medium", "low"]>;
562
+ findings: z.ZodArray<z.ZodObject<{
563
+ severity: z.ZodEnum<["critical", "major", "minor", "nit"]>;
564
+ summary: z.ZodString;
565
+ findingCategory: z.ZodOptional<z.ZodEnum<["correctness", "security", "architecture", "ux", "performance", "testing", "style"]>>;
566
+ }, "strict", z.ZodTypeAny, {
567
+ severity: "critical" | "minor" | "major" | "nit";
568
+ summary: string;
569
+ findingCategory?: "correctness" | "security" | "architecture" | "ux" | "performance" | "testing" | "style" | undefined;
570
+ }, {
571
+ severity: "critical" | "minor" | "major" | "nit";
572
+ summary: string;
573
+ findingCategory?: "correctness" | "security" | "architecture" | "ux" | "performance" | "testing" | "style" | undefined;
574
+ }>, "many">;
575
+ summary: z.ZodString;
576
+ }, "strict", z.ZodTypeAny, {
577
+ kind: "wr.review_verdict";
578
+ summary: string;
579
+ confidence: "low" | "high" | "medium";
580
+ verdict: "clean" | "minor" | "blocking";
581
+ findings: {
582
+ severity: "critical" | "minor" | "major" | "nit";
583
+ summary: string;
584
+ findingCategory?: "correctness" | "security" | "architecture" | "ux" | "performance" | "testing" | "style" | undefined;
585
+ }[];
586
+ }, {
587
+ kind: "wr.review_verdict";
588
+ summary: string;
589
+ confidence: "low" | "high" | "medium";
590
+ verdict: "clean" | "minor" | "blocking";
591
+ findings: {
592
+ severity: "critical" | "minor" | "major" | "nit";
593
+ summary: string;
594
+ findingCategory?: "correctness" | "security" | "architecture" | "ux" | "performance" | "testing" | "style" | undefined;
595
+ }[];
596
+ }>;
597
+ confidenceBand: z.ZodNullable<z.ZodEnum<["high", "medium", "low"]>>;
598
+ recapMarkdown: z.ZodNullable<z.ZodString>;
599
+ }, "strip", z.ZodTypeAny, {
600
+ kind: "full";
601
+ artifact: {
602
+ kind: "wr.review_verdict";
603
+ summary: string;
604
+ confidence: "low" | "high" | "medium";
605
+ verdict: "clean" | "minor" | "blocking";
606
+ findings: {
607
+ severity: "critical" | "minor" | "major" | "nit";
608
+ summary: string;
609
+ findingCategory?: "correctness" | "security" | "architecture" | "ux" | "performance" | "testing" | "style" | undefined;
610
+ }[];
611
+ };
612
+ confidenceBand: "low" | "high" | "medium" | null;
613
+ recapMarkdown: string | null;
614
+ }, {
615
+ kind: "full";
616
+ artifact: {
617
+ kind: "wr.review_verdict";
618
+ summary: string;
619
+ confidence: "low" | "high" | "medium";
620
+ verdict: "clean" | "minor" | "blocking";
621
+ findings: {
622
+ severity: "critical" | "minor" | "major" | "nit";
623
+ summary: string;
624
+ findingCategory?: "correctness" | "security" | "architecture" | "ux" | "performance" | "testing" | "style" | undefined;
625
+ }[];
626
+ };
627
+ confidenceBand: "low" | "high" | "medium" | null;
628
+ recapMarkdown: string | null;
629
+ }>, z.ZodObject<{
630
+ kind: z.ZodLiteral<"partial">;
631
+ recapMarkdown: z.ZodString;
632
+ }, "strip", z.ZodTypeAny, {
633
+ kind: "partial";
634
+ recapMarkdown: string;
635
+ }, {
636
+ kind: "partial";
637
+ recapMarkdown: string;
638
+ }>, z.ZodObject<{
639
+ kind: z.ZodLiteral<"fallback">;
640
+ recapMarkdown: z.ZodNullable<z.ZodString>;
641
+ }, "strip", z.ZodTypeAny, {
642
+ kind: "fallback";
643
+ recapMarkdown: string | null;
644
+ }, {
645
+ kind: "fallback";
646
+ recapMarkdown: string | null;
647
+ }>]>;
648
+ }, "strip", z.ZodTypeAny, {
649
+ result: {
650
+ kind: "full";
651
+ artifact: {
652
+ kind: "wr.review_verdict";
653
+ summary: string;
654
+ confidence: "low" | "high" | "medium";
655
+ verdict: "clean" | "minor" | "blocking";
656
+ findings: {
657
+ severity: "critical" | "minor" | "major" | "nit";
658
+ summary: string;
659
+ findingCategory?: "correctness" | "security" | "architecture" | "ux" | "performance" | "testing" | "style" | undefined;
660
+ }[];
661
+ };
662
+ confidenceBand: "low" | "high" | "medium" | null;
663
+ recapMarkdown: string | null;
664
+ } | {
665
+ kind: "partial";
666
+ recapMarkdown: string;
667
+ } | {
668
+ kind: "fallback";
669
+ recapMarkdown: string | null;
670
+ };
671
+ completedAt: string;
672
+ sessionHandle: string;
673
+ }, {
674
+ result: {
675
+ kind: "full";
676
+ artifact: {
677
+ kind: "wr.review_verdict";
678
+ summary: string;
679
+ confidence: "low" | "high" | "medium";
680
+ verdict: "clean" | "minor" | "blocking";
681
+ findings: {
682
+ severity: "critical" | "minor" | "major" | "nit";
683
+ summary: string;
684
+ findingCategory?: "correctness" | "security" | "architecture" | "ux" | "performance" | "testing" | "style" | undefined;
685
+ }[];
686
+ };
687
+ confidenceBand: "low" | "high" | "medium" | null;
688
+ recapMarkdown: string | null;
689
+ } | {
690
+ kind: "partial";
691
+ recapMarkdown: string;
692
+ } | {
693
+ kind: "fallback";
694
+ recapMarkdown: string | null;
695
+ };
696
+ completedAt: string;
697
+ sessionHandle: string;
698
+ }>;
699
+ export declare const PipelineRunContextSchema: z.ZodObject<{
700
+ runId: z.ZodString;
701
+ goal: z.ZodString;
702
+ workspace: z.ZodString;
703
+ startedAt: z.ZodString;
704
+ pipelineMode: z.ZodEnum<["FULL", "IMPLEMENT", "REVIEW_ONLY", "QUICK_REVIEW"]>;
705
+ status: z.ZodOptional<z.ZodEnum<["in_progress", "completed"]>>;
706
+ phases: z.ZodObject<{
707
+ discovery: z.ZodOptional<z.ZodObject<{
708
+ completedAt: z.ZodString;
709
+ sessionHandle: z.ZodString;
710
+ result: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
711
+ kind: z.ZodLiteral<"full">;
712
+ artifact: z.ZodObject<{
713
+ kind: z.ZodLiteral<"wr.discovery_handoff">;
714
+ version: z.ZodLiteral<1>;
715
+ selectedDirection: z.ZodString;
716
+ designDocPath: z.ZodString;
717
+ confidenceBand: z.ZodEnum<["high", "medium", "low"]>;
718
+ keyInvariants: z.ZodArray<z.ZodString, "many">;
719
+ rejectedDirections: z.ZodOptional<z.ZodArray<z.ZodObject<{
720
+ direction: z.ZodString;
721
+ reason: z.ZodString;
722
+ }, "strip", z.ZodTypeAny, {
723
+ reason: string;
724
+ direction: string;
725
+ }, {
726
+ reason: string;
727
+ direction: string;
728
+ }>, "many">>;
729
+ implementationConstraints: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
730
+ keyCodebaseLocations: z.ZodOptional<z.ZodArray<z.ZodObject<{
731
+ path: z.ZodString;
732
+ relevance: z.ZodString;
733
+ }, "strip", z.ZodTypeAny, {
734
+ path: string;
735
+ relevance: string;
736
+ }, {
737
+ path: string;
738
+ relevance: string;
739
+ }>, "many">>;
740
+ }, "strict", z.ZodTypeAny, {
741
+ kind: "wr.discovery_handoff";
742
+ version: 1;
743
+ selectedDirection: string;
744
+ designDocPath: string;
745
+ confidenceBand: "low" | "high" | "medium";
746
+ keyInvariants: string[];
747
+ rejectedDirections?: {
748
+ reason: string;
749
+ direction: string;
750
+ }[] | undefined;
751
+ implementationConstraints?: string[] | undefined;
752
+ keyCodebaseLocations?: {
753
+ path: string;
754
+ relevance: string;
755
+ }[] | undefined;
756
+ }, {
757
+ kind: "wr.discovery_handoff";
758
+ version: 1;
759
+ selectedDirection: string;
760
+ designDocPath: string;
761
+ confidenceBand: "low" | "high" | "medium";
762
+ keyInvariants: string[];
763
+ rejectedDirections?: {
764
+ reason: string;
765
+ direction: string;
766
+ }[] | undefined;
767
+ implementationConstraints?: string[] | undefined;
768
+ keyCodebaseLocations?: {
769
+ path: string;
770
+ relevance: string;
771
+ }[] | undefined;
772
+ }>;
773
+ confidenceBand: z.ZodNullable<z.ZodEnum<["high", "medium", "low"]>>;
774
+ recapMarkdown: z.ZodNullable<z.ZodString>;
775
+ }, "strip", z.ZodTypeAny, {
776
+ kind: "full";
777
+ artifact: {
778
+ kind: "wr.discovery_handoff";
779
+ version: 1;
780
+ selectedDirection: string;
781
+ designDocPath: string;
782
+ confidenceBand: "low" | "high" | "medium";
783
+ keyInvariants: string[];
784
+ rejectedDirections?: {
785
+ reason: string;
786
+ direction: string;
787
+ }[] | undefined;
788
+ implementationConstraints?: string[] | undefined;
789
+ keyCodebaseLocations?: {
790
+ path: string;
791
+ relevance: string;
792
+ }[] | undefined;
793
+ };
794
+ confidenceBand: "low" | "high" | "medium" | null;
795
+ recapMarkdown: string | null;
796
+ }, {
797
+ kind: "full";
798
+ artifact: {
799
+ kind: "wr.discovery_handoff";
800
+ version: 1;
801
+ selectedDirection: string;
802
+ designDocPath: string;
803
+ confidenceBand: "low" | "high" | "medium";
804
+ keyInvariants: string[];
805
+ rejectedDirections?: {
806
+ reason: string;
807
+ direction: string;
808
+ }[] | undefined;
809
+ implementationConstraints?: string[] | undefined;
810
+ keyCodebaseLocations?: {
811
+ path: string;
812
+ relevance: string;
813
+ }[] | undefined;
814
+ };
815
+ confidenceBand: "low" | "high" | "medium" | null;
816
+ recapMarkdown: string | null;
817
+ }>, z.ZodObject<{
818
+ kind: z.ZodLiteral<"partial">;
819
+ recapMarkdown: z.ZodString;
820
+ }, "strip", z.ZodTypeAny, {
821
+ kind: "partial";
822
+ recapMarkdown: string;
823
+ }, {
824
+ kind: "partial";
825
+ recapMarkdown: string;
826
+ }>, z.ZodObject<{
827
+ kind: z.ZodLiteral<"fallback">;
828
+ recapMarkdown: z.ZodNullable<z.ZodString>;
829
+ }, "strip", z.ZodTypeAny, {
830
+ kind: "fallback";
831
+ recapMarkdown: string | null;
832
+ }, {
833
+ kind: "fallback";
834
+ recapMarkdown: string | null;
835
+ }>]>;
836
+ }, "strip", z.ZodTypeAny, {
837
+ result: {
838
+ kind: "full";
839
+ artifact: {
840
+ kind: "wr.discovery_handoff";
841
+ version: 1;
842
+ selectedDirection: string;
843
+ designDocPath: string;
844
+ confidenceBand: "low" | "high" | "medium";
845
+ keyInvariants: string[];
846
+ rejectedDirections?: {
847
+ reason: string;
848
+ direction: string;
849
+ }[] | undefined;
850
+ implementationConstraints?: string[] | undefined;
851
+ keyCodebaseLocations?: {
852
+ path: string;
853
+ relevance: string;
854
+ }[] | undefined;
855
+ };
856
+ confidenceBand: "low" | "high" | "medium" | null;
857
+ recapMarkdown: string | null;
858
+ } | {
859
+ kind: "partial";
860
+ recapMarkdown: string;
861
+ } | {
862
+ kind: "fallback";
863
+ recapMarkdown: string | null;
864
+ };
865
+ completedAt: string;
866
+ sessionHandle: string;
867
+ }, {
868
+ result: {
869
+ kind: "full";
870
+ artifact: {
871
+ kind: "wr.discovery_handoff";
872
+ version: 1;
873
+ selectedDirection: string;
874
+ designDocPath: string;
875
+ confidenceBand: "low" | "high" | "medium";
876
+ keyInvariants: string[];
877
+ rejectedDirections?: {
878
+ reason: string;
879
+ direction: string;
880
+ }[] | undefined;
881
+ implementationConstraints?: string[] | undefined;
882
+ keyCodebaseLocations?: {
883
+ path: string;
884
+ relevance: string;
885
+ }[] | undefined;
886
+ };
887
+ confidenceBand: "low" | "high" | "medium" | null;
888
+ recapMarkdown: string | null;
889
+ } | {
890
+ kind: "partial";
891
+ recapMarkdown: string;
892
+ } | {
893
+ kind: "fallback";
894
+ recapMarkdown: string | null;
895
+ };
896
+ completedAt: string;
897
+ sessionHandle: string;
898
+ }>>;
899
+ shaping: z.ZodOptional<z.ZodObject<{
900
+ completedAt: z.ZodString;
901
+ sessionHandle: z.ZodString;
902
+ result: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
903
+ kind: z.ZodLiteral<"full">;
904
+ artifact: z.ZodObject<{
905
+ kind: z.ZodLiteral<"wr.shaping_handoff">;
906
+ version: z.ZodLiteral<1>;
907
+ pitchPath: z.ZodString;
908
+ selectedShape: z.ZodString;
909
+ appetite: z.ZodString;
910
+ keyConstraints: z.ZodArray<z.ZodString, "many">;
911
+ rabbitHoles: z.ZodArray<z.ZodString, "many">;
912
+ outOfScope: z.ZodArray<z.ZodString, "many">;
913
+ validationChecklist: z.ZodArray<z.ZodString, "many">;
914
+ }, "strict", z.ZodTypeAny, {
915
+ kind: "wr.shaping_handoff";
916
+ version: 1;
917
+ pitchPath: string;
918
+ selectedShape: string;
919
+ appetite: string;
920
+ keyConstraints: string[];
921
+ rabbitHoles: string[];
922
+ outOfScope: string[];
923
+ validationChecklist: string[];
924
+ }, {
925
+ kind: "wr.shaping_handoff";
926
+ version: 1;
927
+ pitchPath: string;
928
+ selectedShape: string;
929
+ appetite: string;
930
+ keyConstraints: string[];
931
+ rabbitHoles: string[];
932
+ outOfScope: string[];
933
+ validationChecklist: string[];
934
+ }>;
935
+ confidenceBand: z.ZodNullable<z.ZodEnum<["high", "medium", "low"]>>;
936
+ recapMarkdown: z.ZodNullable<z.ZodString>;
937
+ }, "strip", z.ZodTypeAny, {
938
+ kind: "full";
939
+ artifact: {
940
+ kind: "wr.shaping_handoff";
941
+ version: 1;
942
+ pitchPath: string;
943
+ selectedShape: string;
944
+ appetite: string;
945
+ keyConstraints: string[];
946
+ rabbitHoles: string[];
947
+ outOfScope: string[];
948
+ validationChecklist: string[];
949
+ };
950
+ confidenceBand: "low" | "high" | "medium" | null;
951
+ recapMarkdown: string | null;
952
+ }, {
953
+ kind: "full";
954
+ artifact: {
955
+ kind: "wr.shaping_handoff";
956
+ version: 1;
957
+ pitchPath: string;
958
+ selectedShape: string;
959
+ appetite: string;
960
+ keyConstraints: string[];
961
+ rabbitHoles: string[];
962
+ outOfScope: string[];
963
+ validationChecklist: string[];
964
+ };
965
+ confidenceBand: "low" | "high" | "medium" | null;
966
+ recapMarkdown: string | null;
967
+ }>, z.ZodObject<{
968
+ kind: z.ZodLiteral<"partial">;
969
+ recapMarkdown: z.ZodString;
970
+ }, "strip", z.ZodTypeAny, {
971
+ kind: "partial";
972
+ recapMarkdown: string;
973
+ }, {
974
+ kind: "partial";
975
+ recapMarkdown: string;
976
+ }>, z.ZodObject<{
977
+ kind: z.ZodLiteral<"fallback">;
978
+ recapMarkdown: z.ZodNullable<z.ZodString>;
979
+ }, "strip", z.ZodTypeAny, {
980
+ kind: "fallback";
981
+ recapMarkdown: string | null;
982
+ }, {
983
+ kind: "fallback";
984
+ recapMarkdown: string | null;
985
+ }>]>;
986
+ }, "strip", z.ZodTypeAny, {
987
+ result: {
988
+ kind: "full";
989
+ artifact: {
990
+ kind: "wr.shaping_handoff";
991
+ version: 1;
992
+ pitchPath: string;
993
+ selectedShape: string;
994
+ appetite: string;
995
+ keyConstraints: string[];
996
+ rabbitHoles: string[];
997
+ outOfScope: string[];
998
+ validationChecklist: string[];
999
+ };
1000
+ confidenceBand: "low" | "high" | "medium" | null;
1001
+ recapMarkdown: string | null;
1002
+ } | {
1003
+ kind: "partial";
1004
+ recapMarkdown: string;
1005
+ } | {
1006
+ kind: "fallback";
1007
+ recapMarkdown: string | null;
1008
+ };
1009
+ completedAt: string;
1010
+ sessionHandle: string;
1011
+ }, {
1012
+ result: {
1013
+ kind: "full";
1014
+ artifact: {
1015
+ kind: "wr.shaping_handoff";
1016
+ version: 1;
1017
+ pitchPath: string;
1018
+ selectedShape: string;
1019
+ appetite: string;
1020
+ keyConstraints: string[];
1021
+ rabbitHoles: string[];
1022
+ outOfScope: string[];
1023
+ validationChecklist: string[];
1024
+ };
1025
+ confidenceBand: "low" | "high" | "medium" | null;
1026
+ recapMarkdown: string | null;
1027
+ } | {
1028
+ kind: "partial";
1029
+ recapMarkdown: string;
1030
+ } | {
1031
+ kind: "fallback";
1032
+ recapMarkdown: string | null;
1033
+ };
1034
+ completedAt: string;
1035
+ sessionHandle: string;
1036
+ }>>;
1037
+ coding: z.ZodOptional<z.ZodObject<{
1038
+ completedAt: z.ZodString;
1039
+ sessionHandle: z.ZodString;
1040
+ result: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1041
+ kind: z.ZodLiteral<"full">;
1042
+ artifact: z.ZodObject<{
1043
+ kind: z.ZodLiteral<"wr.coding_handoff">;
1044
+ version: z.ZodLiteral<1>;
1045
+ branchName: z.ZodString;
1046
+ keyDecisions: z.ZodArray<z.ZodString, "many">;
1047
+ knownLimitations: z.ZodArray<z.ZodString, "many">;
1048
+ testsAdded: z.ZodArray<z.ZodString, "many">;
1049
+ filesChanged: z.ZodArray<z.ZodString, "many">;
1050
+ correctedAssumptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
1051
+ assumed: z.ZodString;
1052
+ actual: z.ZodString;
1053
+ }, "strip", z.ZodTypeAny, {
1054
+ assumed: string;
1055
+ actual: string;
1056
+ }, {
1057
+ assumed: string;
1058
+ actual: string;
1059
+ }>, "many">>;
1060
+ }, "strict", z.ZodTypeAny, {
1061
+ kind: "wr.coding_handoff";
1062
+ version: 1;
1063
+ branchName: string;
1064
+ keyDecisions: string[];
1065
+ knownLimitations: string[];
1066
+ testsAdded: string[];
1067
+ filesChanged: string[];
1068
+ correctedAssumptions?: {
1069
+ assumed: string;
1070
+ actual: string;
1071
+ }[] | undefined;
1072
+ }, {
1073
+ kind: "wr.coding_handoff";
1074
+ version: 1;
1075
+ branchName: string;
1076
+ keyDecisions: string[];
1077
+ knownLimitations: string[];
1078
+ testsAdded: string[];
1079
+ filesChanged: string[];
1080
+ correctedAssumptions?: {
1081
+ assumed: string;
1082
+ actual: string;
1083
+ }[] | undefined;
1084
+ }>;
1085
+ confidenceBand: z.ZodNullable<z.ZodEnum<["high", "medium", "low"]>>;
1086
+ recapMarkdown: z.ZodNullable<z.ZodString>;
1087
+ }, "strip", z.ZodTypeAny, {
1088
+ kind: "full";
1089
+ artifact: {
1090
+ kind: "wr.coding_handoff";
1091
+ version: 1;
1092
+ branchName: string;
1093
+ keyDecisions: string[];
1094
+ knownLimitations: string[];
1095
+ testsAdded: string[];
1096
+ filesChanged: string[];
1097
+ correctedAssumptions?: {
1098
+ assumed: string;
1099
+ actual: string;
1100
+ }[] | undefined;
1101
+ };
1102
+ confidenceBand: "low" | "high" | "medium" | null;
1103
+ recapMarkdown: string | null;
1104
+ }, {
1105
+ kind: "full";
1106
+ artifact: {
1107
+ kind: "wr.coding_handoff";
1108
+ version: 1;
1109
+ branchName: string;
1110
+ keyDecisions: string[];
1111
+ knownLimitations: string[];
1112
+ testsAdded: string[];
1113
+ filesChanged: string[];
1114
+ correctedAssumptions?: {
1115
+ assumed: string;
1116
+ actual: string;
1117
+ }[] | undefined;
1118
+ };
1119
+ confidenceBand: "low" | "high" | "medium" | null;
1120
+ recapMarkdown: string | null;
1121
+ }>, z.ZodObject<{
1122
+ kind: z.ZodLiteral<"partial">;
1123
+ recapMarkdown: z.ZodString;
1124
+ }, "strip", z.ZodTypeAny, {
1125
+ kind: "partial";
1126
+ recapMarkdown: string;
1127
+ }, {
1128
+ kind: "partial";
1129
+ recapMarkdown: string;
1130
+ }>, z.ZodObject<{
1131
+ kind: z.ZodLiteral<"fallback">;
1132
+ recapMarkdown: z.ZodNullable<z.ZodString>;
1133
+ }, "strip", z.ZodTypeAny, {
1134
+ kind: "fallback";
1135
+ recapMarkdown: string | null;
1136
+ }, {
1137
+ kind: "fallback";
1138
+ recapMarkdown: string | null;
1139
+ }>]>;
1140
+ }, "strip", z.ZodTypeAny, {
1141
+ result: {
1142
+ kind: "full";
1143
+ artifact: {
1144
+ kind: "wr.coding_handoff";
1145
+ version: 1;
1146
+ branchName: string;
1147
+ keyDecisions: string[];
1148
+ knownLimitations: string[];
1149
+ testsAdded: string[];
1150
+ filesChanged: string[];
1151
+ correctedAssumptions?: {
1152
+ assumed: string;
1153
+ actual: string;
1154
+ }[] | undefined;
1155
+ };
1156
+ confidenceBand: "low" | "high" | "medium" | null;
1157
+ recapMarkdown: string | null;
1158
+ } | {
1159
+ kind: "partial";
1160
+ recapMarkdown: string;
1161
+ } | {
1162
+ kind: "fallback";
1163
+ recapMarkdown: string | null;
1164
+ };
1165
+ completedAt: string;
1166
+ sessionHandle: string;
1167
+ }, {
1168
+ result: {
1169
+ kind: "full";
1170
+ artifact: {
1171
+ kind: "wr.coding_handoff";
1172
+ version: 1;
1173
+ branchName: string;
1174
+ keyDecisions: string[];
1175
+ knownLimitations: string[];
1176
+ testsAdded: string[];
1177
+ filesChanged: string[];
1178
+ correctedAssumptions?: {
1179
+ assumed: string;
1180
+ actual: string;
1181
+ }[] | undefined;
1182
+ };
1183
+ confidenceBand: "low" | "high" | "medium" | null;
1184
+ recapMarkdown: string | null;
1185
+ } | {
1186
+ kind: "partial";
1187
+ recapMarkdown: string;
1188
+ } | {
1189
+ kind: "fallback";
1190
+ recapMarkdown: string | null;
1191
+ };
1192
+ completedAt: string;
1193
+ sessionHandle: string;
1194
+ }>>;
1195
+ review: z.ZodOptional<z.ZodObject<{
1196
+ completedAt: z.ZodString;
1197
+ sessionHandle: z.ZodString;
1198
+ result: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1199
+ kind: z.ZodLiteral<"full">;
1200
+ artifact: z.ZodObject<{
1201
+ kind: z.ZodLiteral<"wr.review_verdict">;
1202
+ verdict: z.ZodEnum<["clean", "minor", "blocking"]>;
1203
+ confidence: z.ZodEnum<["high", "medium", "low"]>;
1204
+ findings: z.ZodArray<z.ZodObject<{
1205
+ severity: z.ZodEnum<["critical", "major", "minor", "nit"]>;
1206
+ summary: z.ZodString;
1207
+ findingCategory: z.ZodOptional<z.ZodEnum<["correctness", "security", "architecture", "ux", "performance", "testing", "style"]>>;
1208
+ }, "strict", z.ZodTypeAny, {
1209
+ severity: "critical" | "minor" | "major" | "nit";
1210
+ summary: string;
1211
+ findingCategory?: "correctness" | "security" | "architecture" | "ux" | "performance" | "testing" | "style" | undefined;
1212
+ }, {
1213
+ severity: "critical" | "minor" | "major" | "nit";
1214
+ summary: string;
1215
+ findingCategory?: "correctness" | "security" | "architecture" | "ux" | "performance" | "testing" | "style" | undefined;
1216
+ }>, "many">;
1217
+ summary: z.ZodString;
1218
+ }, "strict", z.ZodTypeAny, {
1219
+ kind: "wr.review_verdict";
1220
+ summary: string;
1221
+ confidence: "low" | "high" | "medium";
1222
+ verdict: "clean" | "minor" | "blocking";
1223
+ findings: {
1224
+ severity: "critical" | "minor" | "major" | "nit";
1225
+ summary: string;
1226
+ findingCategory?: "correctness" | "security" | "architecture" | "ux" | "performance" | "testing" | "style" | undefined;
1227
+ }[];
1228
+ }, {
1229
+ kind: "wr.review_verdict";
1230
+ summary: string;
1231
+ confidence: "low" | "high" | "medium";
1232
+ verdict: "clean" | "minor" | "blocking";
1233
+ findings: {
1234
+ severity: "critical" | "minor" | "major" | "nit";
1235
+ summary: string;
1236
+ findingCategory?: "correctness" | "security" | "architecture" | "ux" | "performance" | "testing" | "style" | undefined;
1237
+ }[];
1238
+ }>;
1239
+ confidenceBand: z.ZodNullable<z.ZodEnum<["high", "medium", "low"]>>;
1240
+ recapMarkdown: z.ZodNullable<z.ZodString>;
1241
+ }, "strip", z.ZodTypeAny, {
1242
+ kind: "full";
1243
+ artifact: {
1244
+ kind: "wr.review_verdict";
1245
+ summary: string;
1246
+ confidence: "low" | "high" | "medium";
1247
+ verdict: "clean" | "minor" | "blocking";
1248
+ findings: {
1249
+ severity: "critical" | "minor" | "major" | "nit";
1250
+ summary: string;
1251
+ findingCategory?: "correctness" | "security" | "architecture" | "ux" | "performance" | "testing" | "style" | undefined;
1252
+ }[];
1253
+ };
1254
+ confidenceBand: "low" | "high" | "medium" | null;
1255
+ recapMarkdown: string | null;
1256
+ }, {
1257
+ kind: "full";
1258
+ artifact: {
1259
+ kind: "wr.review_verdict";
1260
+ summary: string;
1261
+ confidence: "low" | "high" | "medium";
1262
+ verdict: "clean" | "minor" | "blocking";
1263
+ findings: {
1264
+ severity: "critical" | "minor" | "major" | "nit";
1265
+ summary: string;
1266
+ findingCategory?: "correctness" | "security" | "architecture" | "ux" | "performance" | "testing" | "style" | undefined;
1267
+ }[];
1268
+ };
1269
+ confidenceBand: "low" | "high" | "medium" | null;
1270
+ recapMarkdown: string | null;
1271
+ }>, z.ZodObject<{
1272
+ kind: z.ZodLiteral<"partial">;
1273
+ recapMarkdown: z.ZodString;
1274
+ }, "strip", z.ZodTypeAny, {
1275
+ kind: "partial";
1276
+ recapMarkdown: string;
1277
+ }, {
1278
+ kind: "partial";
1279
+ recapMarkdown: string;
1280
+ }>, z.ZodObject<{
1281
+ kind: z.ZodLiteral<"fallback">;
1282
+ recapMarkdown: z.ZodNullable<z.ZodString>;
1283
+ }, "strip", z.ZodTypeAny, {
1284
+ kind: "fallback";
1285
+ recapMarkdown: string | null;
1286
+ }, {
1287
+ kind: "fallback";
1288
+ recapMarkdown: string | null;
1289
+ }>]>;
1290
+ }, "strip", z.ZodTypeAny, {
1291
+ result: {
1292
+ kind: "full";
1293
+ artifact: {
1294
+ kind: "wr.review_verdict";
1295
+ summary: string;
1296
+ confidence: "low" | "high" | "medium";
1297
+ verdict: "clean" | "minor" | "blocking";
1298
+ findings: {
1299
+ severity: "critical" | "minor" | "major" | "nit";
1300
+ summary: string;
1301
+ findingCategory?: "correctness" | "security" | "architecture" | "ux" | "performance" | "testing" | "style" | undefined;
1302
+ }[];
1303
+ };
1304
+ confidenceBand: "low" | "high" | "medium" | null;
1305
+ recapMarkdown: string | null;
1306
+ } | {
1307
+ kind: "partial";
1308
+ recapMarkdown: string;
1309
+ } | {
1310
+ kind: "fallback";
1311
+ recapMarkdown: string | null;
1312
+ };
1313
+ completedAt: string;
1314
+ sessionHandle: string;
1315
+ }, {
1316
+ result: {
1317
+ kind: "full";
1318
+ artifact: {
1319
+ kind: "wr.review_verdict";
1320
+ summary: string;
1321
+ confidence: "low" | "high" | "medium";
1322
+ verdict: "clean" | "minor" | "blocking";
1323
+ findings: {
1324
+ severity: "critical" | "minor" | "major" | "nit";
1325
+ summary: string;
1326
+ findingCategory?: "correctness" | "security" | "architecture" | "ux" | "performance" | "testing" | "style" | undefined;
1327
+ }[];
1328
+ };
1329
+ confidenceBand: "low" | "high" | "medium" | null;
1330
+ recapMarkdown: string | null;
1331
+ } | {
1332
+ kind: "partial";
1333
+ recapMarkdown: string;
1334
+ } | {
1335
+ kind: "fallback";
1336
+ recapMarkdown: string | null;
1337
+ };
1338
+ completedAt: string;
1339
+ sessionHandle: string;
1340
+ }>>;
1341
+ }, "strip", z.ZodTypeAny, {
1342
+ coding?: {
1343
+ result: {
1344
+ kind: "full";
1345
+ artifact: {
1346
+ kind: "wr.coding_handoff";
1347
+ version: 1;
1348
+ branchName: string;
1349
+ keyDecisions: string[];
1350
+ knownLimitations: string[];
1351
+ testsAdded: string[];
1352
+ filesChanged: string[];
1353
+ correctedAssumptions?: {
1354
+ assumed: string;
1355
+ actual: string;
1356
+ }[] | undefined;
1357
+ };
1358
+ confidenceBand: "low" | "high" | "medium" | null;
1359
+ recapMarkdown: string | null;
1360
+ } | {
1361
+ kind: "partial";
1362
+ recapMarkdown: string;
1363
+ } | {
1364
+ kind: "fallback";
1365
+ recapMarkdown: string | null;
1366
+ };
1367
+ completedAt: string;
1368
+ sessionHandle: string;
1369
+ } | undefined;
1370
+ review?: {
1371
+ result: {
1372
+ kind: "full";
1373
+ artifact: {
1374
+ kind: "wr.review_verdict";
1375
+ summary: string;
1376
+ confidence: "low" | "high" | "medium";
1377
+ verdict: "clean" | "minor" | "blocking";
1378
+ findings: {
1379
+ severity: "critical" | "minor" | "major" | "nit";
1380
+ summary: string;
1381
+ findingCategory?: "correctness" | "security" | "architecture" | "ux" | "performance" | "testing" | "style" | undefined;
1382
+ }[];
1383
+ };
1384
+ confidenceBand: "low" | "high" | "medium" | null;
1385
+ recapMarkdown: string | null;
1386
+ } | {
1387
+ kind: "partial";
1388
+ recapMarkdown: string;
1389
+ } | {
1390
+ kind: "fallback";
1391
+ recapMarkdown: string | null;
1392
+ };
1393
+ completedAt: string;
1394
+ sessionHandle: string;
1395
+ } | undefined;
1396
+ discovery?: {
1397
+ result: {
1398
+ kind: "full";
1399
+ artifact: {
1400
+ kind: "wr.discovery_handoff";
1401
+ version: 1;
1402
+ selectedDirection: string;
1403
+ designDocPath: string;
1404
+ confidenceBand: "low" | "high" | "medium";
1405
+ keyInvariants: string[];
1406
+ rejectedDirections?: {
1407
+ reason: string;
1408
+ direction: string;
1409
+ }[] | undefined;
1410
+ implementationConstraints?: string[] | undefined;
1411
+ keyCodebaseLocations?: {
1412
+ path: string;
1413
+ relevance: string;
1414
+ }[] | undefined;
1415
+ };
1416
+ confidenceBand: "low" | "high" | "medium" | null;
1417
+ recapMarkdown: string | null;
1418
+ } | {
1419
+ kind: "partial";
1420
+ recapMarkdown: string;
1421
+ } | {
1422
+ kind: "fallback";
1423
+ recapMarkdown: string | null;
1424
+ };
1425
+ completedAt: string;
1426
+ sessionHandle: string;
1427
+ } | undefined;
1428
+ shaping?: {
1429
+ result: {
1430
+ kind: "full";
1431
+ artifact: {
1432
+ kind: "wr.shaping_handoff";
1433
+ version: 1;
1434
+ pitchPath: string;
1435
+ selectedShape: string;
1436
+ appetite: string;
1437
+ keyConstraints: string[];
1438
+ rabbitHoles: string[];
1439
+ outOfScope: string[];
1440
+ validationChecklist: string[];
1441
+ };
1442
+ confidenceBand: "low" | "high" | "medium" | null;
1443
+ recapMarkdown: string | null;
1444
+ } | {
1445
+ kind: "partial";
1446
+ recapMarkdown: string;
1447
+ } | {
1448
+ kind: "fallback";
1449
+ recapMarkdown: string | null;
1450
+ };
1451
+ completedAt: string;
1452
+ sessionHandle: string;
1453
+ } | undefined;
1454
+ }, {
1455
+ coding?: {
1456
+ result: {
1457
+ kind: "full";
1458
+ artifact: {
1459
+ kind: "wr.coding_handoff";
1460
+ version: 1;
1461
+ branchName: string;
1462
+ keyDecisions: string[];
1463
+ knownLimitations: string[];
1464
+ testsAdded: string[];
1465
+ filesChanged: string[];
1466
+ correctedAssumptions?: {
1467
+ assumed: string;
1468
+ actual: string;
1469
+ }[] | undefined;
1470
+ };
1471
+ confidenceBand: "low" | "high" | "medium" | null;
1472
+ recapMarkdown: string | null;
1473
+ } | {
1474
+ kind: "partial";
1475
+ recapMarkdown: string;
1476
+ } | {
1477
+ kind: "fallback";
1478
+ recapMarkdown: string | null;
1479
+ };
1480
+ completedAt: string;
1481
+ sessionHandle: string;
1482
+ } | undefined;
1483
+ review?: {
1484
+ result: {
1485
+ kind: "full";
1486
+ artifact: {
1487
+ kind: "wr.review_verdict";
1488
+ summary: string;
1489
+ confidence: "low" | "high" | "medium";
1490
+ verdict: "clean" | "minor" | "blocking";
1491
+ findings: {
1492
+ severity: "critical" | "minor" | "major" | "nit";
1493
+ summary: string;
1494
+ findingCategory?: "correctness" | "security" | "architecture" | "ux" | "performance" | "testing" | "style" | undefined;
1495
+ }[];
1496
+ };
1497
+ confidenceBand: "low" | "high" | "medium" | null;
1498
+ recapMarkdown: string | null;
1499
+ } | {
1500
+ kind: "partial";
1501
+ recapMarkdown: string;
1502
+ } | {
1503
+ kind: "fallback";
1504
+ recapMarkdown: string | null;
1505
+ };
1506
+ completedAt: string;
1507
+ sessionHandle: string;
1508
+ } | undefined;
1509
+ discovery?: {
1510
+ result: {
1511
+ kind: "full";
1512
+ artifact: {
1513
+ kind: "wr.discovery_handoff";
1514
+ version: 1;
1515
+ selectedDirection: string;
1516
+ designDocPath: string;
1517
+ confidenceBand: "low" | "high" | "medium";
1518
+ keyInvariants: string[];
1519
+ rejectedDirections?: {
1520
+ reason: string;
1521
+ direction: string;
1522
+ }[] | undefined;
1523
+ implementationConstraints?: string[] | undefined;
1524
+ keyCodebaseLocations?: {
1525
+ path: string;
1526
+ relevance: string;
1527
+ }[] | undefined;
1528
+ };
1529
+ confidenceBand: "low" | "high" | "medium" | null;
1530
+ recapMarkdown: string | null;
1531
+ } | {
1532
+ kind: "partial";
1533
+ recapMarkdown: string;
1534
+ } | {
1535
+ kind: "fallback";
1536
+ recapMarkdown: string | null;
1537
+ };
1538
+ completedAt: string;
1539
+ sessionHandle: string;
1540
+ } | undefined;
1541
+ shaping?: {
1542
+ result: {
1543
+ kind: "full";
1544
+ artifact: {
1545
+ kind: "wr.shaping_handoff";
1546
+ version: 1;
1547
+ pitchPath: string;
1548
+ selectedShape: string;
1549
+ appetite: string;
1550
+ keyConstraints: string[];
1551
+ rabbitHoles: string[];
1552
+ outOfScope: string[];
1553
+ validationChecklist: string[];
1554
+ };
1555
+ confidenceBand: "low" | "high" | "medium" | null;
1556
+ recapMarkdown: string | null;
1557
+ } | {
1558
+ kind: "partial";
1559
+ recapMarkdown: string;
1560
+ } | {
1561
+ kind: "fallback";
1562
+ recapMarkdown: string | null;
1563
+ };
1564
+ completedAt: string;
1565
+ sessionHandle: string;
1566
+ } | undefined;
1567
+ }>;
1568
+ }, "strip", z.ZodTypeAny, {
1569
+ runId: string;
1570
+ goal: string;
1571
+ workspace: string;
1572
+ startedAt: string;
1573
+ pipelineMode: "QUICK_REVIEW" | "REVIEW_ONLY" | "IMPLEMENT" | "FULL";
1574
+ phases: {
1575
+ coding?: {
1576
+ result: {
1577
+ kind: "full";
1578
+ artifact: {
1579
+ kind: "wr.coding_handoff";
1580
+ version: 1;
1581
+ branchName: string;
1582
+ keyDecisions: string[];
1583
+ knownLimitations: string[];
1584
+ testsAdded: string[];
1585
+ filesChanged: string[];
1586
+ correctedAssumptions?: {
1587
+ assumed: string;
1588
+ actual: string;
1589
+ }[] | undefined;
1590
+ };
1591
+ confidenceBand: "low" | "high" | "medium" | null;
1592
+ recapMarkdown: string | null;
1593
+ } | {
1594
+ kind: "partial";
1595
+ recapMarkdown: string;
1596
+ } | {
1597
+ kind: "fallback";
1598
+ recapMarkdown: string | null;
1599
+ };
1600
+ completedAt: string;
1601
+ sessionHandle: string;
1602
+ } | undefined;
1603
+ review?: {
1604
+ result: {
1605
+ kind: "full";
1606
+ artifact: {
1607
+ kind: "wr.review_verdict";
1608
+ summary: string;
1609
+ confidence: "low" | "high" | "medium";
1610
+ verdict: "clean" | "minor" | "blocking";
1611
+ findings: {
1612
+ severity: "critical" | "minor" | "major" | "nit";
1613
+ summary: string;
1614
+ findingCategory?: "correctness" | "security" | "architecture" | "ux" | "performance" | "testing" | "style" | undefined;
1615
+ }[];
1616
+ };
1617
+ confidenceBand: "low" | "high" | "medium" | null;
1618
+ recapMarkdown: string | null;
1619
+ } | {
1620
+ kind: "partial";
1621
+ recapMarkdown: string;
1622
+ } | {
1623
+ kind: "fallback";
1624
+ recapMarkdown: string | null;
1625
+ };
1626
+ completedAt: string;
1627
+ sessionHandle: string;
1628
+ } | undefined;
1629
+ discovery?: {
1630
+ result: {
1631
+ kind: "full";
1632
+ artifact: {
1633
+ kind: "wr.discovery_handoff";
1634
+ version: 1;
1635
+ selectedDirection: string;
1636
+ designDocPath: string;
1637
+ confidenceBand: "low" | "high" | "medium";
1638
+ keyInvariants: string[];
1639
+ rejectedDirections?: {
1640
+ reason: string;
1641
+ direction: string;
1642
+ }[] | undefined;
1643
+ implementationConstraints?: string[] | undefined;
1644
+ keyCodebaseLocations?: {
1645
+ path: string;
1646
+ relevance: string;
1647
+ }[] | undefined;
1648
+ };
1649
+ confidenceBand: "low" | "high" | "medium" | null;
1650
+ recapMarkdown: string | null;
1651
+ } | {
1652
+ kind: "partial";
1653
+ recapMarkdown: string;
1654
+ } | {
1655
+ kind: "fallback";
1656
+ recapMarkdown: string | null;
1657
+ };
1658
+ completedAt: string;
1659
+ sessionHandle: string;
1660
+ } | undefined;
1661
+ shaping?: {
1662
+ result: {
1663
+ kind: "full";
1664
+ artifact: {
1665
+ kind: "wr.shaping_handoff";
1666
+ version: 1;
1667
+ pitchPath: string;
1668
+ selectedShape: string;
1669
+ appetite: string;
1670
+ keyConstraints: string[];
1671
+ rabbitHoles: string[];
1672
+ outOfScope: string[];
1673
+ validationChecklist: string[];
1674
+ };
1675
+ confidenceBand: "low" | "high" | "medium" | null;
1676
+ recapMarkdown: string | null;
1677
+ } | {
1678
+ kind: "partial";
1679
+ recapMarkdown: string;
1680
+ } | {
1681
+ kind: "fallback";
1682
+ recapMarkdown: string | null;
1683
+ };
1684
+ completedAt: string;
1685
+ sessionHandle: string;
1686
+ } | undefined;
1687
+ };
1688
+ status?: "completed" | "in_progress" | undefined;
1689
+ }, {
1690
+ runId: string;
1691
+ goal: string;
1692
+ workspace: string;
1693
+ startedAt: string;
1694
+ pipelineMode: "QUICK_REVIEW" | "REVIEW_ONLY" | "IMPLEMENT" | "FULL";
1695
+ phases: {
1696
+ coding?: {
1697
+ result: {
1698
+ kind: "full";
1699
+ artifact: {
1700
+ kind: "wr.coding_handoff";
1701
+ version: 1;
1702
+ branchName: string;
1703
+ keyDecisions: string[];
1704
+ knownLimitations: string[];
1705
+ testsAdded: string[];
1706
+ filesChanged: string[];
1707
+ correctedAssumptions?: {
1708
+ assumed: string;
1709
+ actual: string;
1710
+ }[] | undefined;
1711
+ };
1712
+ confidenceBand: "low" | "high" | "medium" | null;
1713
+ recapMarkdown: string | null;
1714
+ } | {
1715
+ kind: "partial";
1716
+ recapMarkdown: string;
1717
+ } | {
1718
+ kind: "fallback";
1719
+ recapMarkdown: string | null;
1720
+ };
1721
+ completedAt: string;
1722
+ sessionHandle: string;
1723
+ } | undefined;
1724
+ review?: {
1725
+ result: {
1726
+ kind: "full";
1727
+ artifact: {
1728
+ kind: "wr.review_verdict";
1729
+ summary: string;
1730
+ confidence: "low" | "high" | "medium";
1731
+ verdict: "clean" | "minor" | "blocking";
1732
+ findings: {
1733
+ severity: "critical" | "minor" | "major" | "nit";
1734
+ summary: string;
1735
+ findingCategory?: "correctness" | "security" | "architecture" | "ux" | "performance" | "testing" | "style" | undefined;
1736
+ }[];
1737
+ };
1738
+ confidenceBand: "low" | "high" | "medium" | null;
1739
+ recapMarkdown: string | null;
1740
+ } | {
1741
+ kind: "partial";
1742
+ recapMarkdown: string;
1743
+ } | {
1744
+ kind: "fallback";
1745
+ recapMarkdown: string | null;
1746
+ };
1747
+ completedAt: string;
1748
+ sessionHandle: string;
1749
+ } | undefined;
1750
+ discovery?: {
1751
+ result: {
1752
+ kind: "full";
1753
+ artifact: {
1754
+ kind: "wr.discovery_handoff";
1755
+ version: 1;
1756
+ selectedDirection: string;
1757
+ designDocPath: string;
1758
+ confidenceBand: "low" | "high" | "medium";
1759
+ keyInvariants: string[];
1760
+ rejectedDirections?: {
1761
+ reason: string;
1762
+ direction: string;
1763
+ }[] | undefined;
1764
+ implementationConstraints?: string[] | undefined;
1765
+ keyCodebaseLocations?: {
1766
+ path: string;
1767
+ relevance: string;
1768
+ }[] | undefined;
1769
+ };
1770
+ confidenceBand: "low" | "high" | "medium" | null;
1771
+ recapMarkdown: string | null;
1772
+ } | {
1773
+ kind: "partial";
1774
+ recapMarkdown: string;
1775
+ } | {
1776
+ kind: "fallback";
1777
+ recapMarkdown: string | null;
1778
+ };
1779
+ completedAt: string;
1780
+ sessionHandle: string;
1781
+ } | undefined;
1782
+ shaping?: {
1783
+ result: {
1784
+ kind: "full";
1785
+ artifact: {
1786
+ kind: "wr.shaping_handoff";
1787
+ version: 1;
1788
+ pitchPath: string;
1789
+ selectedShape: string;
1790
+ appetite: string;
1791
+ keyConstraints: string[];
1792
+ rabbitHoles: string[];
1793
+ outOfScope: string[];
1794
+ validationChecklist: string[];
1795
+ };
1796
+ confidenceBand: "low" | "high" | "medium" | null;
1797
+ recapMarkdown: string | null;
1798
+ } | {
1799
+ kind: "partial";
1800
+ recapMarkdown: string;
1801
+ } | {
1802
+ kind: "fallback";
1803
+ recapMarkdown: string | null;
1804
+ };
1805
+ completedAt: string;
1806
+ sessionHandle: string;
1807
+ } | undefined;
1808
+ };
1809
+ status?: "completed" | "in_progress" | undefined;
1810
+ }>;
1811
+ export declare function parsePipelineRunContext(raw: unknown): Result<PipelineRunContext, string>;