@popoverai/dotrequirements 0.25.0 → 0.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/dist/cli.js +8 -1
  2. package/dist/codebase-to-spec/area-name.d.ts +13 -0
  3. package/dist/codebase-to-spec/area-name.js +18 -0
  4. package/dist/codebase-to-spec/cache.d.ts +31 -0
  5. package/dist/codebase-to-spec/cache.js +29 -1
  6. package/dist/codebase-to-spec/compose.d.ts +7 -4
  7. package/dist/codebase-to-spec/compose.js +10 -21
  8. package/dist/codebase-to-spec/dispatch.js +1 -1
  9. package/dist/codebase-to-spec/present.d.ts +9 -0
  10. package/dist/codebase-to-spec/present.js +30 -4
  11. package/dist/codebase-to-spec/prompts/planner-initial.d.ts +3 -2
  12. package/dist/codebase-to-spec/prompts/planner-initial.js +3 -2
  13. package/dist/codebase-to-spec/renumber.d.ts +52 -0
  14. package/dist/codebase-to-spec/renumber.js +105 -0
  15. package/dist/codebase-to-spec/schemas.d.ts +35 -240
  16. package/dist/codebase-to-spec/schemas.js +5 -173
  17. package/dist/codebase-to-spec/skill-install.d.ts +16 -6
  18. package/dist/codebase-to-spec/skill-install.js +109 -47
  19. package/dist/codebase-to-spec/version-check.d.ts +31 -0
  20. package/dist/codebase-to-spec/version-check.js +56 -0
  21. package/dist/commands/ai-setup.d.ts +12 -1
  22. package/dist/commands/ai-setup.js +65 -33
  23. package/dist/commands/codebase-to-spec/dispatch-editor.js +1 -1
  24. package/dist/commands/codebase-to-spec/dispatch-spec.js +1 -1
  25. package/dist/commands/codebase-to-spec/index.js +7 -103
  26. package/dist/commands/codebase-to-spec/pack.d.ts +4 -0
  27. package/dist/commands/codebase-to-spec/pack.js +25 -1
  28. package/dist/commands/codebase-to-spec/present-orchestrator.d.ts +3 -1
  29. package/dist/commands/codebase-to-spec/present-orchestrator.js +11 -4
  30. package/dist/commands/init.js +6 -1
  31. package/dist/commands/link-resolution.d.ts +79 -0
  32. package/dist/commands/link-resolution.js +141 -0
  33. package/dist/commands/link.d.ts +14 -4
  34. package/dist/commands/link.js +369 -16
  35. package/dist/commands/pull.js +19 -2
  36. package/dist/commands/push.js +36 -2
  37. package/dist/convex.d.ts +5 -3
  38. package/dist/convex.js +5 -3
  39. package/dist/harness/cache.d.ts +0 -14
  40. package/dist/harness/cache.js +1 -41
  41. package/dist/harness/finalize.js +2 -2
  42. package/dist/harness/prepare.js +1 -3
  43. package/dist/harness/requirementsLoader.d.ts +3 -3
  44. package/dist/harness/requirementsLoader.js +13 -8
  45. package/dist/mcp/handlers/authoring.d.ts +5 -5
  46. package/dist/mcp/handlers/authoring.js +9 -9
  47. package/dist/mcp/handlers/push.d.ts +2 -2
  48. package/dist/mcp/handlers/push.js +36 -3
  49. package/dist/mcp/handlers/review.d.ts +4 -4
  50. package/dist/mcp/handlers/review.js +4 -4
  51. package/dist/mcp/handlers/search.d.ts +1 -1
  52. package/dist/mcp/handlers/search.js +1 -1
  53. package/dist/mcp/index.js +29 -0
  54. package/dist/push/core.d.ts +18 -0
  55. package/dist/push/core.js +70 -3
  56. package/dist/push/index.d.ts +1 -1
  57. package/dist/push/index.js +1 -1
  58. package/dist/schema/parser-core.js +5 -1
  59. package/dist/schema/parser.js +5 -1
  60. package/dist/schema/run-marker.d.ts +38 -0
  61. package/dist/schema/run-marker.js +138 -0
  62. package/dist/schema/schemas.d.ts +12 -0
  63. package/dist/schema/schemas.js +1 -0
  64. package/dist/templates/agents/cts-worker.md +1 -1
  65. package/dist/templates/skills/codebase-to-spec/SKILL.md +39 -11
  66. package/dist/templates/workflows/specify-codebase.js +4 -2
  67. package/dist/utils/own-package.d.ts +10 -0
  68. package/dist/utils/own-package.js +13 -0
  69. package/dist/utils/project-selector.d.ts +5 -0
  70. package/dist/utils/project-selector.js +4 -0
  71. package/package.json +2 -2
  72. package/dist/codebase-to-spec/edit-loop.d.ts +0 -54
  73. package/dist/codebase-to-spec/edit-loop.js +0 -195
  74. package/dist/codebase-to-spec/editor.d.ts +0 -54
  75. package/dist/codebase-to-spec/editor.js +0 -74
  76. package/dist/codebase-to-spec/fan-out.d.ts +0 -63
  77. package/dist/codebase-to-spec/fan-out.js +0 -215
  78. package/dist/codebase-to-spec/outline-review-loop.d.ts +0 -51
  79. package/dist/codebase-to-spec/outline-review-loop.js +0 -187
  80. package/dist/codebase-to-spec/planner.d.ts +0 -41
  81. package/dist/codebase-to-spec/planner.js +0 -76
  82. package/dist/codebase-to-spec/prompts/outline-reviewer.d.ts +0 -12
  83. package/dist/codebase-to-spec/prompts/outline-reviewer.js +0 -89
  84. package/dist/codebase-to-spec/slice.d.ts +0 -49
  85. package/dist/codebase-to-spec/slice.js +0 -111
  86. package/dist/codebase-to-spec/specifier.d.ts +0 -60
  87. package/dist/codebase-to-spec/specifier.js +0 -85
  88. package/dist/codebase-to-spec/summary.d.ts +0 -51
  89. package/dist/codebase-to-spec/summary.js +0 -183
  90. package/dist/commands/codebase-to-spec/compose.d.ts +0 -14
  91. package/dist/commands/codebase-to-spec/compose.js +0 -57
  92. package/dist/commands/codebase-to-spec/edit-loop.d.ts +0 -16
  93. package/dist/commands/codebase-to-spec/edit-loop.js +0 -83
  94. package/dist/commands/codebase-to-spec/fan-out.d.ts +0 -19
  95. package/dist/commands/codebase-to-spec/fan-out.js +0 -77
  96. package/dist/commands/codebase-to-spec/plan-loop.d.ts +0 -26
  97. package/dist/commands/codebase-to-spec/plan-loop.js +0 -105
  98. package/dist/commands/codebase-to-spec/present.d.ts +0 -26
  99. package/dist/commands/codebase-to-spec/present.js +0 -97
  100. package/dist/commands/codebase-to-spec/run.d.ts +0 -20
  101. package/dist/commands/codebase-to-spec/run.js +0 -86
  102. package/dist/commands/codebase-to-spec/specify-area.d.ts +0 -18
  103. package/dist/commands/codebase-to-spec/specify-area.js +0 -82
@@ -1,12 +1,10 @@
1
1
  /**
2
- * JSON schemas for outline + reviewer output.
3
- *
4
- * The CLI passes these to `claude -p --json-schema` to constrain agent output,
5
- * then validates the parsed result before driving the loop.
2
+ * Schemas for the codebase-to-spec outline and the conversational
3
+ * orchestrator's review / partial-result shapes. Workers validate their JSON
4
+ * output against these before returning it to the workflow.
6
5
  *
7
6
  * Requirements covered:
8
7
  * - CTS-PLAN-1: outline structure
9
- * - CTS-PLAN-2: outline reviewer output structure (categorized findings + verdict)
10
8
  */
11
9
  import { z } from "zod";
12
10
  export declare const CustomerSchema: z.ZodObject<{
@@ -135,208 +133,6 @@ export declare const OutlineSchema: z.ZodObject<{
135
133
  }[];
136
134
  }>;
137
135
  export type Outline = z.infer<typeof OutlineSchema>;
138
- /**
139
- * JSON Schema for the outline, passed to `claude -p --json-schema`.
140
- * Mirrors OutlineSchema in JSON Schema form (which `claude -p` accepts).
141
- */
142
- export declare const OUTLINE_JSON_SCHEMA: {
143
- readonly type: "object";
144
- readonly properties: {
145
- readonly title: {
146
- readonly type: "string";
147
- };
148
- readonly defaultPrefix: {
149
- readonly type: "string";
150
- };
151
- readonly summary: {
152
- readonly type: "string";
153
- };
154
- readonly areas: {
155
- readonly type: "array";
156
- readonly items: {
157
- readonly type: "object";
158
- readonly properties: {
159
- readonly name: {
160
- readonly type: "string";
161
- };
162
- readonly description: {
163
- readonly type: "string";
164
- };
165
- readonly prefix: {
166
- readonly type: "string";
167
- };
168
- readonly files: {
169
- readonly type: "array";
170
- readonly items: {
171
- readonly type: "string";
172
- };
173
- };
174
- readonly customers: {
175
- readonly type: "array";
176
- readonly minItems: 1;
177
- readonly items: {
178
- readonly type: "object";
179
- readonly properties: {
180
- readonly name: {
181
- readonly type: "string";
182
- };
183
- readonly description: {
184
- readonly type: "string";
185
- };
186
- };
187
- readonly required: readonly ["name", "description"];
188
- readonly additionalProperties: false;
189
- };
190
- };
191
- };
192
- readonly required: readonly ["name", "description", "prefix", "files", "customers"];
193
- readonly additionalProperties: false;
194
- };
195
- };
196
- };
197
- readonly required: readonly ["title", "defaultPrefix", "summary", "areas"];
198
- readonly additionalProperties: false;
199
- };
200
- export declare const VerdictValues: readonly ["approved", "approved-with-revisions", "requires-another-review"];
201
- export type Verdict = (typeof VerdictValues)[number];
202
- export declare const OutlineReviewSchema: z.ZodObject<{
203
- coverage_gaps: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
204
- framing_errors: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
205
- granularity_issues: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
206
- file_assignment_issues: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
207
- revisions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
208
- verdict: z.ZodEnum<["approved", "approved-with-revisions", "requires-another-review"]>;
209
- }, "strip", z.ZodTypeAny, {
210
- coverage_gaps: string[];
211
- framing_errors: string[];
212
- granularity_issues: string[];
213
- file_assignment_issues: string[];
214
- revisions: string[];
215
- verdict: "approved" | "approved-with-revisions" | "requires-another-review";
216
- }, {
217
- verdict: "approved" | "approved-with-revisions" | "requires-another-review";
218
- coverage_gaps?: string[] | undefined;
219
- framing_errors?: string[] | undefined;
220
- granularity_issues?: string[] | undefined;
221
- file_assignment_issues?: string[] | undefined;
222
- revisions?: string[] | undefined;
223
- }>;
224
- export type OutlineReview = z.infer<typeof OutlineReviewSchema>;
225
- export declare const OUTLINE_REVIEW_JSON_SCHEMA: {
226
- readonly type: "object";
227
- readonly properties: {
228
- readonly coverage_gaps: {
229
- readonly type: "array";
230
- readonly items: {
231
- readonly type: "string";
232
- };
233
- };
234
- readonly framing_errors: {
235
- readonly type: "array";
236
- readonly items: {
237
- readonly type: "string";
238
- };
239
- };
240
- readonly granularity_issues: {
241
- readonly type: "array";
242
- readonly items: {
243
- readonly type: "string";
244
- };
245
- };
246
- readonly file_assignment_issues: {
247
- readonly type: "array";
248
- readonly items: {
249
- readonly type: "string";
250
- };
251
- };
252
- readonly revisions: {
253
- readonly type: "array";
254
- readonly items: {
255
- readonly type: "string";
256
- };
257
- };
258
- readonly verdict: {
259
- readonly type: "string";
260
- readonly enum: readonly string[];
261
- };
262
- };
263
- readonly required: readonly ["coverage_gaps", "framing_errors", "granularity_issues", "file_assignment_issues", "revisions", "verdict"];
264
- readonly additionalProperties: false;
265
- };
266
- /**
267
- * Try to parse a string as JSON and validate against the outline schema.
268
- * Throws with a descriptive message on failure (caller catches and either
269
- * retries or fails the loop).
270
- */
271
- export declare function parseOutline(text: string): Outline;
272
- /**
273
- * Parse a reviewer's JSON output and validate against the outline-review schema.
274
- */
275
- export declare function parseOutlineReview(text: string): OutlineReview;
276
- export declare const SpecReviewSchema: z.ZodObject<{
277
- coverage_gaps: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
278
- framing_errors: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
279
- cross_area_issues: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
280
- internal_mechanics_drift: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
281
- revisions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
282
- verdict: z.ZodEnum<["approved", "approved-with-revisions", "requires-another-review"]>;
283
- }, "strip", z.ZodTypeAny, {
284
- coverage_gaps: string[];
285
- framing_errors: string[];
286
- revisions: string[];
287
- verdict: "approved" | "approved-with-revisions" | "requires-another-review";
288
- cross_area_issues: string[];
289
- internal_mechanics_drift: string[];
290
- }, {
291
- verdict: "approved" | "approved-with-revisions" | "requires-another-review";
292
- coverage_gaps?: string[] | undefined;
293
- framing_errors?: string[] | undefined;
294
- revisions?: string[] | undefined;
295
- cross_area_issues?: string[] | undefined;
296
- internal_mechanics_drift?: string[] | undefined;
297
- }>;
298
- export type SpecReview = z.infer<typeof SpecReviewSchema>;
299
- export declare const SPEC_REVIEW_JSON_SCHEMA: {
300
- readonly type: "object";
301
- readonly properties: {
302
- readonly coverage_gaps: {
303
- readonly type: "array";
304
- readonly items: {
305
- readonly type: "string";
306
- };
307
- };
308
- readonly framing_errors: {
309
- readonly type: "array";
310
- readonly items: {
311
- readonly type: "string";
312
- };
313
- };
314
- readonly cross_area_issues: {
315
- readonly type: "array";
316
- readonly items: {
317
- readonly type: "string";
318
- };
319
- };
320
- readonly internal_mechanics_drift: {
321
- readonly type: "array";
322
- readonly items: {
323
- readonly type: "string";
324
- };
325
- };
326
- readonly revisions: {
327
- readonly type: "array";
328
- readonly items: {
329
- readonly type: "string";
330
- };
331
- };
332
- readonly verdict: {
333
- readonly type: "string";
334
- readonly enum: readonly string[];
335
- };
336
- };
337
- readonly required: readonly ["coverage_gaps", "framing_errors", "cross_area_issues", "internal_mechanics_drift", "revisions", "verdict"];
338
- readonly additionalProperties: false;
339
- };
340
136
  export declare const ConversationalCustomerSchema: z.ZodObject<{
341
137
  description: z.ZodString;
342
138
  }, "strip", z.ZodTypeAny, {
@@ -363,11 +159,11 @@ export declare const ConversationalReviewEntrySchema: z.ZodDiscriminatedUnion<"r
363
159
  result: z.ZodLiteral<"needs-revision">;
364
160
  revisions: z.ZodArray<z.ZodString, "many">;
365
161
  }, "strip", z.ZodTypeAny, {
366
- revisions: string[];
367
162
  result: "needs-revision";
368
- }, {
369
163
  revisions: string[];
164
+ }, {
370
165
  result: "needs-revision";
166
+ revisions: string[];
371
167
  }>]>;
372
168
  export type ConversationalReviewEntry = z.infer<typeof ConversationalReviewEntrySchema>;
373
169
  /**
@@ -387,27 +183,27 @@ export declare const ConversationalReviewSchema: z.ZodObject<{
387
183
  result: z.ZodLiteral<"needs-revision">;
388
184
  revisions: z.ZodArray<z.ZodString, "many">;
389
185
  }, "strip", z.ZodTypeAny, {
390
- revisions: string[];
391
186
  result: "needs-revision";
392
- }, {
393
187
  revisions: string[];
188
+ }, {
394
189
  result: "needs-revision";
190
+ revisions: string[];
395
191
  }>]>, "many">;
396
192
  }, "strip", z.ZodTypeAny, {
397
193
  result: "approved" | "needs-revision";
398
194
  thread: ({
399
195
  result: "approved";
400
196
  } | {
401
- revisions: string[];
402
197
  result: "needs-revision";
198
+ revisions: string[];
403
199
  })[];
404
200
  }, {
405
201
  result: "approved" | "needs-revision";
406
202
  thread: ({
407
203
  result: "approved";
408
204
  } | {
409
- revisions: string[];
410
205
  result: "needs-revision";
206
+ revisions: string[];
411
207
  })[];
412
208
  }>;
413
209
  export type ConversationalReview = z.infer<typeof ConversationalReviewSchema>;
@@ -442,27 +238,27 @@ export declare const ConversationalAreaSchema: z.ZodObject<{
442
238
  result: z.ZodLiteral<"needs-revision">;
443
239
  revisions: z.ZodArray<z.ZodString, "many">;
444
240
  }, "strip", z.ZodTypeAny, {
445
- revisions: string[];
446
241
  result: "needs-revision";
447
- }, {
448
242
  revisions: string[];
243
+ }, {
449
244
  result: "needs-revision";
245
+ revisions: string[];
450
246
  }>]>, "many">;
451
247
  }, "strip", z.ZodTypeAny, {
452
248
  result: "approved" | "needs-revision";
453
249
  thread: ({
454
250
  result: "approved";
455
251
  } | {
456
- revisions: string[];
457
252
  result: "needs-revision";
253
+ revisions: string[];
458
254
  })[];
459
255
  }, {
460
256
  result: "approved" | "needs-revision";
461
257
  thread: ({
462
258
  result: "approved";
463
259
  } | {
464
- revisions: string[];
465
260
  result: "needs-revision";
261
+ revisions: string[];
466
262
  })[];
467
263
  }>>;
468
264
  }, "strip", z.ZodTypeAny, {
@@ -478,8 +274,8 @@ export declare const ConversationalAreaSchema: z.ZodObject<{
478
274
  thread: ({
479
275
  result: "approved";
480
276
  } | {
481
- revisions: string[];
482
277
  result: "needs-revision";
278
+ revisions: string[];
483
279
  })[];
484
280
  } | undefined;
485
281
  }, {
@@ -495,8 +291,8 @@ export declare const ConversationalAreaSchema: z.ZodObject<{
495
291
  thread: ({
496
292
  result: "approved";
497
293
  } | {
498
- revisions: string[];
499
294
  result: "needs-revision";
295
+ revisions: string[];
500
296
  })[];
501
297
  } | undefined;
502
298
  }>;
@@ -522,27 +318,27 @@ export declare const ConversationalOutlineSchema: z.ZodObject<{
522
318
  result: z.ZodLiteral<"needs-revision">;
523
319
  revisions: z.ZodArray<z.ZodString, "many">;
524
320
  }, "strip", z.ZodTypeAny, {
525
- revisions: string[];
526
321
  result: "needs-revision";
527
- }, {
528
322
  revisions: string[];
323
+ }, {
529
324
  result: "needs-revision";
325
+ revisions: string[];
530
326
  }>]>, "many">;
531
327
  }, "strip", z.ZodTypeAny, {
532
328
  result: "approved" | "needs-revision";
533
329
  thread: ({
534
330
  result: "approved";
535
331
  } | {
536
- revisions: string[];
537
332
  result: "needs-revision";
333
+ revisions: string[];
538
334
  })[];
539
335
  }, {
540
336
  result: "approved" | "needs-revision";
541
337
  thread: ({
542
338
  result: "approved";
543
339
  } | {
544
- revisions: string[];
545
340
  result: "needs-revision";
341
+ revisions: string[];
546
342
  })[];
547
343
  }>>;
548
344
  /**
@@ -565,27 +361,27 @@ export declare const ConversationalOutlineSchema: z.ZodObject<{
565
361
  result: z.ZodLiteral<"needs-revision">;
566
362
  revisions: z.ZodArray<z.ZodString, "many">;
567
363
  }, "strip", z.ZodTypeAny, {
568
- revisions: string[];
569
364
  result: "needs-revision";
570
- }, {
571
365
  revisions: string[];
366
+ }, {
572
367
  result: "needs-revision";
368
+ revisions: string[];
573
369
  }>]>, "many">;
574
370
  }, "strip", z.ZodTypeAny, {
575
371
  result: "approved" | "needs-revision";
576
372
  thread: ({
577
373
  result: "approved";
578
374
  } | {
579
- revisions: string[];
580
375
  result: "needs-revision";
376
+ revisions: string[];
581
377
  })[];
582
378
  }, {
583
379
  result: "approved" | "needs-revision";
584
380
  thread: ({
585
381
  result: "approved";
586
382
  } | {
587
- revisions: string[];
588
383
  result: "needs-revision";
384
+ revisions: string[];
589
385
  })[];
590
386
  }>>;
591
387
  areas: z.ZodArray<z.ZodObject<{
@@ -619,27 +415,27 @@ export declare const ConversationalOutlineSchema: z.ZodObject<{
619
415
  result: z.ZodLiteral<"needs-revision">;
620
416
  revisions: z.ZodArray<z.ZodString, "many">;
621
417
  }, "strip", z.ZodTypeAny, {
622
- revisions: string[];
623
418
  result: "needs-revision";
624
- }, {
625
419
  revisions: string[];
420
+ }, {
626
421
  result: "needs-revision";
422
+ revisions: string[];
627
423
  }>]>, "many">;
628
424
  }, "strip", z.ZodTypeAny, {
629
425
  result: "approved" | "needs-revision";
630
426
  thread: ({
631
427
  result: "approved";
632
428
  } | {
633
- revisions: string[];
634
429
  result: "needs-revision";
430
+ revisions: string[];
635
431
  })[];
636
432
  }, {
637
433
  result: "approved" | "needs-revision";
638
434
  thread: ({
639
435
  result: "approved";
640
436
  } | {
641
- revisions: string[];
642
437
  result: "needs-revision";
438
+ revisions: string[];
643
439
  })[];
644
440
  }>>;
645
441
  }, "strip", z.ZodTypeAny, {
@@ -655,8 +451,8 @@ export declare const ConversationalOutlineSchema: z.ZodObject<{
655
451
  thread: ({
656
452
  result: "approved";
657
453
  } | {
658
- revisions: string[];
659
454
  result: "needs-revision";
455
+ revisions: string[];
660
456
  })[];
661
457
  } | undefined;
662
458
  }, {
@@ -672,8 +468,8 @@ export declare const ConversationalOutlineSchema: z.ZodObject<{
672
468
  thread: ({
673
469
  result: "approved";
674
470
  } | {
675
- revisions: string[];
676
471
  result: "needs-revision";
472
+ revisions: string[];
677
473
  })[];
678
474
  } | undefined;
679
475
  }>, "many">;
@@ -694,8 +490,8 @@ export declare const ConversationalOutlineSchema: z.ZodObject<{
694
490
  thread: ({
695
491
  result: "approved";
696
492
  } | {
697
- revisions: string[];
698
493
  result: "needs-revision";
494
+ revisions: string[];
699
495
  })[];
700
496
  } | undefined;
701
497
  }[];
@@ -704,8 +500,8 @@ export declare const ConversationalOutlineSchema: z.ZodObject<{
704
500
  thread: ({
705
501
  result: "approved";
706
502
  } | {
707
- revisions: string[];
708
503
  result: "needs-revision";
504
+ revisions: string[];
709
505
  })[];
710
506
  } | undefined;
711
507
  crossAreaReview?: {
@@ -713,8 +509,8 @@ export declare const ConversationalOutlineSchema: z.ZodObject<{
713
509
  thread: ({
714
510
  result: "approved";
715
511
  } | {
716
- revisions: string[];
717
512
  result: "needs-revision";
513
+ revisions: string[];
718
514
  })[];
719
515
  } | undefined;
720
516
  }, {
@@ -734,8 +530,8 @@ export declare const ConversationalOutlineSchema: z.ZodObject<{
734
530
  thread: ({
735
531
  result: "approved";
736
532
  } | {
737
- revisions: string[];
738
533
  result: "needs-revision";
534
+ revisions: string[];
739
535
  })[];
740
536
  } | undefined;
741
537
  }[];
@@ -744,8 +540,8 @@ export declare const ConversationalOutlineSchema: z.ZodObject<{
744
540
  thread: ({
745
541
  result: "approved";
746
542
  } | {
747
- revisions: string[];
748
543
  result: "needs-revision";
544
+ revisions: string[];
749
545
  })[];
750
546
  } | undefined;
751
547
  crossAreaReview?: {
@@ -753,8 +549,8 @@ export declare const ConversationalOutlineSchema: z.ZodObject<{
753
549
  thread: ({
754
550
  result: "approved";
755
551
  } | {
756
- revisions: string[];
757
552
  result: "needs-revision";
553
+ revisions: string[];
758
554
  })[];
759
555
  } | undefined;
760
556
  }>;
@@ -865,5 +661,4 @@ export declare function parsePartialResult(text: string): PartialResult;
865
661
  * non-empty `revisions` list.
866
662
  */
867
663
  export declare function parseReviewVerdict(text: string): ConversationalReviewEntry;
868
- export declare function parseSpecReview(text: string): SpecReview;
869
664
  //# sourceMappingURL=schemas.d.ts.map
@@ -1,12 +1,10 @@
1
1
  /**
2
- * JSON schemas for outline + reviewer output.
3
- *
4
- * The CLI passes these to `claude -p --json-schema` to constrain agent output,
5
- * then validates the parsed result before driving the loop.
2
+ * Schemas for the codebase-to-spec outline and the conversational
3
+ * orchestrator's review / partial-result shapes. Workers validate their JSON
4
+ * output against these before returning it to the workflow.
6
5
  *
7
6
  * Requirements covered:
8
7
  * - CTS-PLAN-1: outline structure
9
- * - CTS-PLAN-2: outline reviewer output structure (categorized findings + verdict)
10
8
  */
11
9
  import { z } from "zod";
12
10
  // ---------- Outline ----------
@@ -37,165 +35,14 @@ export const OutlineSchema = z.object({
37
35
  summary: z.string().min(1),
38
36
  areas: z.array(AreaSchema).min(1),
39
37
  });
40
- /**
41
- * JSON Schema for the outline, passed to `claude -p --json-schema`.
42
- * Mirrors OutlineSchema in JSON Schema form (which `claude -p` accepts).
43
- */
44
- export const OUTLINE_JSON_SCHEMA = {
45
- type: "object",
46
- properties: {
47
- title: { type: "string" },
48
- defaultPrefix: { type: "string" },
49
- summary: { type: "string" },
50
- areas: {
51
- type: "array",
52
- items: {
53
- type: "object",
54
- properties: {
55
- name: { type: "string" },
56
- description: { type: "string" },
57
- prefix: { type: "string" },
58
- files: { type: "array", items: { type: "string" } },
59
- customers: {
60
- type: "array",
61
- minItems: 1,
62
- items: {
63
- type: "object",
64
- properties: {
65
- name: { type: "string" },
66
- description: { type: "string" },
67
- },
68
- required: ["name", "description"],
69
- additionalProperties: false,
70
- },
71
- },
72
- },
73
- required: ["name", "description", "prefix", "files", "customers"],
74
- additionalProperties: false,
75
- },
76
- },
77
- },
78
- required: ["title", "defaultPrefix", "summary", "areas"],
79
- additionalProperties: false,
80
- };
81
- // ---------- Outline review verdict ----------
82
- export const VerdictValues = [
83
- "approved",
84
- "approved-with-revisions",
85
- "requires-another-review",
86
- ];
87
- export const OutlineReviewSchema = z.object({
88
- coverage_gaps: z.array(z.string()).default([]),
89
- framing_errors: z.array(z.string()).default([]),
90
- granularity_issues: z.array(z.string()).default([]),
91
- file_assignment_issues: z.array(z.string()).default([]),
92
- revisions: z.array(z.string()).default([]),
93
- verdict: z.enum(VerdictValues),
94
- });
95
- export const OUTLINE_REVIEW_JSON_SCHEMA = {
96
- type: "object",
97
- properties: {
98
- coverage_gaps: { type: "array", items: { type: "string" } },
99
- framing_errors: { type: "array", items: { type: "string" } },
100
- granularity_issues: { type: "array", items: { type: "string" } },
101
- file_assignment_issues: { type: "array", items: { type: "string" } },
102
- revisions: { type: "array", items: { type: "string" } },
103
- verdict: {
104
- type: "string",
105
- enum: VerdictValues,
106
- },
107
- },
108
- required: [
109
- "coverage_gaps",
110
- "framing_errors",
111
- "granularity_issues",
112
- "file_assignment_issues",
113
- "revisions",
114
- "verdict",
115
- ],
116
- additionalProperties: false,
117
- };
118
- /**
119
- * Try to parse a string as JSON and validate against the outline schema.
120
- * Throws with a descriptive message on failure (caller catches and either
121
- * retries or fails the loop).
122
- */
123
- export function parseOutline(text) {
124
- const trimmed = text.trim();
125
- // Try direct parse first; fall back to extracting first {...} block.
126
- let raw;
127
- try {
128
- raw = JSON.parse(trimmed);
129
- }
130
- catch {
131
- const match = trimmed.match(/(\{[\s\S]*\})/);
132
- if (!match) {
133
- throw new Error("Outline output is not valid JSON and contains no JSON object");
134
- }
135
- raw = JSON.parse(match[1]);
136
- }
137
- return OutlineSchema.parse(raw);
138
- }
139
- /**
140
- * Parse a reviewer's JSON output and validate against the outline-review schema.
141
- */
142
- export function parseOutlineReview(text) {
143
- const trimmed = text.trim();
144
- let raw;
145
- try {
146
- raw = JSON.parse(trimmed);
147
- }
148
- catch {
149
- const match = trimmed.match(/(\{[\s\S]*\})/);
150
- if (!match) {
151
- throw new Error("Reviewer output is not valid JSON and contains no JSON object");
152
- }
153
- raw = JSON.parse(match[1]);
154
- }
155
- return OutlineReviewSchema.parse(raw);
156
- }
157
- // ---------- Spec review verdict ----------
158
- //
159
- // Same three-verdict structure as the outline reviewer, with categories
160
- // tailored to document-level cohesion concerns.
161
- export const SpecReviewSchema = z.object({
162
- coverage_gaps: z.array(z.string()).default([]),
163
- framing_errors: z.array(z.string()).default([]),
164
- cross_area_issues: z.array(z.string()).default([]),
165
- internal_mechanics_drift: z.array(z.string()).default([]),
166
- revisions: z.array(z.string()).default([]),
167
- verdict: z.enum(VerdictValues),
168
- });
169
- export const SPEC_REVIEW_JSON_SCHEMA = {
170
- type: "object",
171
- properties: {
172
- coverage_gaps: { type: "array", items: { type: "string" } },
173
- framing_errors: { type: "array", items: { type: "string" } },
174
- cross_area_issues: { type: "array", items: { type: "string" } },
175
- internal_mechanics_drift: { type: "array", items: { type: "string" } },
176
- revisions: { type: "array", items: { type: "string" } },
177
- verdict: {
178
- type: "string",
179
- enum: VerdictValues,
180
- },
181
- },
182
- required: [
183
- "coverage_gaps",
184
- "framing_errors",
185
- "cross_area_issues",
186
- "internal_mechanics_drift",
187
- "revisions",
188
- "verdict",
189
- ],
190
- additionalProperties: false,
191
- };
192
38
  // ---------- Conversational orchestrator outline (Phase 2b refactor) ----------
193
39
  //
194
40
  // The conversational orchestrator uses a single evolving `outline.yaml` as
195
41
  // the pipeline's substrate. The outline carries both the behavioral spec
196
42
  // content (areas, customers, source_files) AND its own lifecycle state
197
43
  // (review.result + review.thread). This is distinct from the legacy
198
- // `OutlineSchema` above, which the `cts run` pipeline still uses.
44
+ // `OutlineSchema` above, which the deterministic compose/present stages still
45
+ // consume (the orchestrator converts to it via `conversationalOutlineToLegacy`).
199
46
  //
200
47
  // Field naming uses "result" rather than "verdict" deliberately: review is
201
48
  // a collaborative interaction with the worker, not a juridical ruling.
@@ -433,19 +280,4 @@ export function parseReviewVerdict(text) {
433
280
  }
434
281
  return ConversationalReviewEntrySchema.parse(raw);
435
282
  }
436
- export function parseSpecReview(text) {
437
- const trimmed = text.trim();
438
- let raw;
439
- try {
440
- raw = JSON.parse(trimmed);
441
- }
442
- catch {
443
- const match = trimmed.match(/(\{[\s\S]*\})/);
444
- if (!match) {
445
- throw new Error("Spec reviewer output is not valid JSON and contains no JSON object");
446
- }
447
- raw = JSON.parse(match[1]);
448
- }
449
- return SpecReviewSchema.parse(raw);
450
- }
451
283
  //# sourceMappingURL=schemas.js.map