@mgiles/perk 2.3.0 → 3.1.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 (145) hide show
  1. package/README.md +1 -1
  2. package/extension/adapters/planAdapterPlannotator.ts +135 -91
  3. package/extension/adapters/planAdapterTombell.ts +5 -3
  4. package/extension/doors/address.ts +235 -37
  5. package/extension/doors/annotationPush.ts +924 -0
  6. package/extension/doors/auditWaveTools.ts +352 -0
  7. package/extension/doors/ciExecutor.ts +220 -55
  8. package/extension/doors/commitCompact.ts +98 -10
  9. package/extension/doors/draftReviewWaveTools.ts +412 -0
  10. package/extension/doors/dreamWaveTools.ts +475 -0
  11. package/extension/doors/harvestWaveTools.ts +279 -0
  12. package/extension/doors/land.ts +1 -0
  13. package/extension/doors/learn.ts +24 -6
  14. package/extension/doors/learnFactory.ts +33 -7
  15. package/extension/doors/lifecycleGates.ts +1 -1
  16. package/extension/doors/objectiveReviewBrowser.ts +537 -0
  17. package/extension/doors/objectiveStack.ts +1143 -0
  18. package/extension/doors/planReviewBrowser.ts +475 -0
  19. package/extension/doors/plannotatorHandoff.ts +120 -49
  20. package/extension/doors/prReview.ts +180 -63
  21. package/extension/doors/prReviewBrowser.ts +31 -23
  22. package/extension/doors/prReviewDynamic.ts +57 -30
  23. package/extension/doors/prReviewTerminal.ts +6 -11
  24. package/extension/doors/reviewWaveTools.ts +397 -0
  25. package/extension/doors/selfcheck.ts +1 -1
  26. package/extension/doors/submit.ts +82 -7
  27. package/extension/factories/gistAuthor.ts +4 -4
  28. package/extension/factories/gistDraft.ts +1 -1
  29. package/extension/factories/gistSave.ts +2 -2
  30. package/extension/factories/objective.ts +7 -7
  31. package/extension/factories/objectiveAuthor.ts +5 -4
  32. package/extension/factories/objectiveDraft.ts +153 -30
  33. package/extension/factories/objectiveDreamReport.ts +347 -0
  34. package/extension/factories/objectivePlan.ts +163 -9
  35. package/extension/factories/objectiveSave.ts +90 -2
  36. package/extension/factories/planMode.ts +5 -3
  37. package/extension/factories/planReview.ts +304 -46
  38. package/extension/factories/planTitle.ts +27 -9
  39. package/extension/hunkFeedback/inbox.ts +389 -0
  40. package/extension/hunkFeedback/perkFeedback.ts +364 -0
  41. package/extension/hunkFeedback/receiver.ts +296 -0
  42. package/extension/hunkFeedback/store.ts +533 -0
  43. package/extension/index.ts +169 -57
  44. package/extension/substrate/agentScratch.ts +171 -0
  45. package/extension/substrate/bindingDelivery.ts +9 -11
  46. package/extension/substrate/cache.ts +166 -23
  47. package/extension/substrate/coldDoor.ts +2 -3
  48. package/extension/substrate/command.ts +9 -6
  49. package/extension/substrate/config.ts +41 -12
  50. package/extension/substrate/git.ts +95 -2
  51. package/extension/substrate/providers.ts +4 -33
  52. package/extension/substrate/resources.ts +11 -0
  53. package/extension/substrate/result.ts +16 -7
  54. package/extension/substrate/sessionData.ts +8 -6
  55. package/extension/substrate/sessionPointers.ts +4 -5
  56. package/extension/substrate/structuredOutput.ts +78 -19
  57. package/extension/substrate/toolGating.ts +179 -23
  58. package/extension/substrate/workflowState.ts +50 -2
  59. package/extension/surfaces/footerProvider.ts +6 -6
  60. package/extension/surfaces/report.ts +38 -12
  61. package/extension/surfaces/surfaces.ts +213 -275
  62. package/extension/vendor/btw/btw.ts +94 -17
  63. package/extension/waves/adversarialReviewWave.ts +181 -0
  64. package/extension/waves/auditWave.ts +312 -0
  65. package/extension/waves/draftReviewWave.ts +205 -0
  66. package/extension/waves/dreamReducerWave.ts +700 -0
  67. package/extension/waves/dreamReport.ts +1494 -0
  68. package/extension/waves/dreamWave.ts +927 -0
  69. package/extension/waves/harvestWave.ts +399 -0
  70. package/extension/waves/memoryAdapter.ts +14 -1
  71. package/extension/waves/objectiveExplorerWave.ts +120 -0
  72. package/extension/waves/ponytail.ts +104 -0
  73. package/extension/waves/prReviewDynamicWave.ts +383 -72
  74. package/extension/waves/prReviewWave.ts +175 -25
  75. package/extension/waves/reportWave.ts +503 -107
  76. package/extension/waves/reviewClassifierWave.ts +109 -0
  77. package/extension/waves/rpcAdapter.ts +65 -2
  78. package/extension/worker/readOnlySession.ts +4 -5
  79. package/extension/worker/worker.ts +71 -93
  80. package/extension/workerMain.ts +4 -6
  81. package/package.json +18 -5
  82. package/prompts/README.md +19 -0
  83. package/prompts/_fixtures/live.yaml +115 -65
  84. package/prompts/commit-and-compact-continuation.md +13 -0
  85. package/prompts/common/resume-advisory.md +1 -0
  86. package/prompts/contexts/adapters/plannotator-gist.md +13 -0
  87. package/prompts/contexts/adapters/plannotator-objective.md +8 -3
  88. package/prompts/contexts/adapters/plannotator-plan.md +8 -3
  89. package/prompts/contexts/gist-authoring.md +6 -20
  90. package/prompts/contexts/objective-authoring.md +6 -18
  91. package/prompts/stages/address/action.md +3 -14
  92. package/prompts/stages/address/preview.md +2 -13
  93. package/prompts/stages/audit.md +18 -0
  94. package/prompts/stages/conflict-resolution.md +1 -1
  95. package/prompts/stages/gist-author/seed.md +4 -4
  96. package/prompts/stages/gist-save.md +1 -1
  97. package/prompts/stages/implement.md +3 -1
  98. package/prompts/stages/learn-code.md +1 -1
  99. package/prompts/stages/learn-docs.md +2 -2
  100. package/prompts/stages/learn-dream.md +10 -0
  101. package/prompts/stages/learn-harvest.md +15 -0
  102. package/prompts/stages/learn-orchestrate.md +1 -1
  103. package/prompts/stages/objective-author/adopt.md +5 -3
  104. package/prompts/stages/objective-author/file.md +5 -4
  105. package/prompts/stages/objective-author/seed.md +5 -4
  106. package/prompts/stages/objective-land.md +7 -0
  107. package/prompts/stages/objective-plan/guidance.md +2 -13
  108. package/prompts/stages/objective-plan/seed.md +5 -12
  109. package/prompts/stages/objective-recover.md +8 -0
  110. package/prompts/stages/objective-replan.md +4 -2
  111. package/prompts/stages/objective-review-browser.md +9 -0
  112. package/prompts/stages/objective-sync.md +6 -0
  113. package/prompts/stages/plan-from/adopt.md +2 -2
  114. package/prompts/stages/plan-from/file.md +2 -2
  115. package/prompts/stages/plan-review-browser.md +9 -0
  116. package/prompts/stages/pr-review-browser/active.md +6 -14
  117. package/prompts/stages/pr-review-browser/foreign.md +6 -14
  118. package/prompts/stages/pr-review-dynamic.md +6 -6
  119. package/prompts/stages/pr-review-terminal/active.md +7 -15
  120. package/prompts/stages/pr-review-terminal/foreign.md +7 -15
  121. package/prompts/stages/pr-review-terminal/local.md +1 -1
  122. package/prompts/stages/pr-review.md +5 -5
  123. package/prompts/stages/replan.md +3 -3
  124. package/shared/README.md +2 -2
  125. package/shared/bindings.yaml +15 -0
  126. package/shared/contracts-history.md +11 -0
  127. package/shared/contracts.md +5373 -281
  128. package/shared/providers.yaml +27 -60
  129. package/shared/registry.yaml +42 -18
  130. package/shared/schemas/inputs/review-post-batch.schema.json +14 -1
  131. package/shared/schemas/outputs/objective-doctor.schema.json +487 -0
  132. package/shared/schemas/outputs/objective-stack-land.schema.json +732 -0
  133. package/shared/schemas/outputs/objective-stack-recover.schema.json +397 -0
  134. package/shared/schemas/outputs/objective-stack-status.schema.json +577 -0
  135. package/shared/schemas/outputs/objective-stack-sync.schema.json +184 -0
  136. package/shared/schemas/outputs/plan-save.schema.json +12 -0
  137. package/shared/schemas/outputs/pr-land.schema.json +3 -3
  138. package/shared/schemas/outputs/pr-submit.schema.json +177 -1
  139. package/extension/adapters/todoAdapterJuicesharp.ts +0 -102
  140. package/extension/checkpoints/checkpoints.ts +0 -550
  141. package/extension/checkpoints/planSteps.ts +0 -108
  142. package/extension/doors/askUser.ts +0 -198
  143. package/prompts/common/output-schemas/objective-explorer.md +0 -36
  144. package/prompts/common/output-schemas/review-classifier.md +0 -47
  145. package/prompts/contexts/adapters/juicesharp-todo.md +0 -7
@@ -0,0 +1,577 @@
1
+ {
2
+ "$defs": {
3
+ "ContinuationOut": {
4
+ "additionalProperties": false,
5
+ "description": "This lineage's pending sync-continuation manifest (contracts.md \u00a78.44/\u00a78.49) \u2014 a\nmachine-local CLI-side observation. ``parseable: false`` rows carry nulls for every\nfield the unreadable file cannot account for.",
6
+ "properties": {
7
+ "operation_id": {
8
+ "anyOf": [
9
+ {
10
+ "type": "string"
11
+ },
12
+ {
13
+ "type": "null"
14
+ }
15
+ ],
16
+ "title": "Operation Id"
17
+ },
18
+ "conflict_node_id": {
19
+ "anyOf": [
20
+ {
21
+ "type": "string"
22
+ },
23
+ {
24
+ "type": "null"
25
+ }
26
+ ],
27
+ "title": "Conflict Node Id"
28
+ },
29
+ "adopted_node": {
30
+ "anyOf": [
31
+ {
32
+ "type": "string"
33
+ },
34
+ {
35
+ "type": "null"
36
+ }
37
+ ],
38
+ "title": "Adopted Node"
39
+ },
40
+ "created": {
41
+ "anyOf": [
42
+ {
43
+ "type": "string"
44
+ },
45
+ {
46
+ "type": "null"
47
+ }
48
+ ],
49
+ "title": "Created"
50
+ },
51
+ "worktree_path": {
52
+ "anyOf": [
53
+ {
54
+ "type": "string"
55
+ },
56
+ {
57
+ "type": "null"
58
+ }
59
+ ],
60
+ "title": "Worktree Path"
61
+ },
62
+ "manifest_path": {
63
+ "title": "Manifest Path",
64
+ "type": "string"
65
+ },
66
+ "parseable": {
67
+ "title": "Parseable",
68
+ "type": "boolean"
69
+ }
70
+ },
71
+ "required": [
72
+ "operation_id",
73
+ "conflict_node_id",
74
+ "adopted_node",
75
+ "created",
76
+ "worktree_path",
77
+ "manifest_path",
78
+ "parseable"
79
+ ],
80
+ "title": "ContinuationOut",
81
+ "type": "object"
82
+ },
83
+ "FindingOut": {
84
+ "additionalProperties": false,
85
+ "properties": {
86
+ "code": {
87
+ "title": "Code",
88
+ "type": "string"
89
+ },
90
+ "message": {
91
+ "title": "Message",
92
+ "type": "string"
93
+ },
94
+ "node_id": {
95
+ "anyOf": [
96
+ {
97
+ "type": "string"
98
+ },
99
+ {
100
+ "type": "null"
101
+ }
102
+ ],
103
+ "title": "Node Id"
104
+ },
105
+ "plan_id": {
106
+ "anyOf": [
107
+ {
108
+ "type": "string"
109
+ },
110
+ {
111
+ "type": "null"
112
+ }
113
+ ],
114
+ "title": "Plan Id"
115
+ }
116
+ },
117
+ "required": [
118
+ "code",
119
+ "message",
120
+ "node_id",
121
+ "plan_id"
122
+ ],
123
+ "title": "FindingOut",
124
+ "type": "object"
125
+ },
126
+ "LayerOut": {
127
+ "additionalProperties": false,
128
+ "properties": {
129
+ "node_id": {
130
+ "title": "Node Id",
131
+ "type": "string"
132
+ },
133
+ "plan_id": {
134
+ "anyOf": [
135
+ {
136
+ "type": "string"
137
+ },
138
+ {
139
+ "type": "null"
140
+ }
141
+ ],
142
+ "title": "Plan Id"
143
+ },
144
+ "branch": {
145
+ "anyOf": [
146
+ {
147
+ "type": "string"
148
+ },
149
+ {
150
+ "type": "null"
151
+ }
152
+ ],
153
+ "title": "Branch"
154
+ },
155
+ "pr_number": {
156
+ "anyOf": [
157
+ {
158
+ "type": "integer"
159
+ },
160
+ {
161
+ "type": "null"
162
+ }
163
+ ],
164
+ "title": "Pr Number"
165
+ },
166
+ "intent": {
167
+ "title": "Intent",
168
+ "type": "string"
169
+ },
170
+ "publication": {
171
+ "title": "Publication",
172
+ "type": "string"
173
+ },
174
+ "git": {
175
+ "title": "Git",
176
+ "type": "string"
177
+ },
178
+ "pr": {
179
+ "title": "Pr",
180
+ "type": "string"
181
+ },
182
+ "membership": {
183
+ "title": "Membership",
184
+ "type": "string"
185
+ },
186
+ "writer": {
187
+ "title": "Writer",
188
+ "type": "string"
189
+ },
190
+ "finalization": {
191
+ "title": "Finalization",
192
+ "type": "string"
193
+ },
194
+ "parent_checkpoint_sha": {
195
+ "anyOf": [
196
+ {
197
+ "type": "string"
198
+ },
199
+ {
200
+ "type": "null"
201
+ }
202
+ ],
203
+ "title": "Parent Checkpoint Sha"
204
+ },
205
+ "published_head_sha": {
206
+ "anyOf": [
207
+ {
208
+ "type": "string"
209
+ },
210
+ {
211
+ "type": "null"
212
+ }
213
+ ],
214
+ "title": "Published Head Sha"
215
+ },
216
+ "observed_remote_head_sha": {
217
+ "anyOf": [
218
+ {
219
+ "type": "string"
220
+ },
221
+ {
222
+ "type": "null"
223
+ }
224
+ ],
225
+ "title": "Observed Remote Head Sha"
226
+ },
227
+ "observed_pr_base": {
228
+ "anyOf": [
229
+ {
230
+ "type": "string"
231
+ },
232
+ {
233
+ "type": "null"
234
+ }
235
+ ],
236
+ "title": "Observed Pr Base"
237
+ },
238
+ "expected_pr_base": {
239
+ "anyOf": [
240
+ {
241
+ "type": "string"
242
+ },
243
+ {
244
+ "type": "null"
245
+ }
246
+ ],
247
+ "title": "Expected Pr Base"
248
+ }
249
+ },
250
+ "required": [
251
+ "node_id",
252
+ "plan_id",
253
+ "branch",
254
+ "pr_number",
255
+ "intent",
256
+ "publication",
257
+ "git",
258
+ "pr",
259
+ "membership",
260
+ "writer",
261
+ "finalization",
262
+ "parent_checkpoint_sha",
263
+ "published_head_sha",
264
+ "observed_remote_head_sha",
265
+ "observed_pr_base",
266
+ "expected_pr_base"
267
+ ],
268
+ "title": "LayerOut",
269
+ "type": "object"
270
+ },
271
+ "NextBuildReadyOut": {
272
+ "additionalProperties": false,
273
+ "description": "The derived build-readiness block (contracts.md \u00a78.46): the readiness-derived next\nlayer, the fail-closed verdict, and the exact veto when blocked.",
274
+ "properties": {
275
+ "node_id": {
276
+ "anyOf": [
277
+ {
278
+ "type": "string"
279
+ },
280
+ {
281
+ "type": "null"
282
+ }
283
+ ],
284
+ "title": "Node Id"
285
+ },
286
+ "ready": {
287
+ "title": "Ready",
288
+ "type": "boolean"
289
+ },
290
+ "reason": {
291
+ "anyOf": [
292
+ {
293
+ "type": "string"
294
+ },
295
+ {
296
+ "type": "null"
297
+ }
298
+ ],
299
+ "title": "Reason"
300
+ }
301
+ },
302
+ "required": [
303
+ "node_id",
304
+ "ready",
305
+ "reason"
306
+ ],
307
+ "title": "NextBuildReadyOut",
308
+ "type": "object"
309
+ },
310
+ "ObjectiveOut": {
311
+ "additionalProperties": false,
312
+ "description": "The resolved (ACTIVE) objective identity; ``redirected_from`` names the originally\nrequested objective when a ``superseded_by`` chain redirected forward.",
313
+ "properties": {
314
+ "id": {
315
+ "title": "Id",
316
+ "type": "string"
317
+ },
318
+ "url": {
319
+ "title": "Url",
320
+ "type": "string"
321
+ },
322
+ "redirected_from": {
323
+ "anyOf": [
324
+ {
325
+ "type": "string"
326
+ },
327
+ {
328
+ "type": "null"
329
+ }
330
+ ],
331
+ "title": "Redirected From"
332
+ }
333
+ },
334
+ "required": [
335
+ "id",
336
+ "url",
337
+ "redirected_from"
338
+ ],
339
+ "title": "ObjectiveOut",
340
+ "type": "object"
341
+ },
342
+ "OperationOut": {
343
+ "additionalProperties": false,
344
+ "properties": {
345
+ "operation_id": {
346
+ "title": "Operation Id",
347
+ "type": "string"
348
+ },
349
+ "kind": {
350
+ "title": "Kind",
351
+ "type": "string"
352
+ },
353
+ "prepared_created": {
354
+ "title": "Prepared Created",
355
+ "type": "string"
356
+ }
357
+ },
358
+ "required": [
359
+ "operation_id",
360
+ "kind",
361
+ "prepared_created"
362
+ ],
363
+ "title": "OperationOut",
364
+ "type": "object"
365
+ },
366
+ "OrphanedResidueOut": {
367
+ "additionalProperties": false,
368
+ "description": "The machine-local orphaned-sync-residue observation (contracts.md \u00a78.44/\u00a78.51).\n``observed: false`` + ``reason`` whenever the Config load or the classifier's git/fs\nreads fail \u2014 an unobserved state is never serialized as clean empty lists;\n``observed: true`` with empty lists means genuinely clean.",
369
+ "properties": {
370
+ "observed": {
371
+ "title": "Observed",
372
+ "type": "boolean"
373
+ },
374
+ "reason": {
375
+ "anyOf": [
376
+ {
377
+ "type": "string"
378
+ },
379
+ {
380
+ "type": "null"
381
+ }
382
+ ],
383
+ "title": "Reason"
384
+ },
385
+ "worktrees": {
386
+ "items": {
387
+ "type": "string"
388
+ },
389
+ "title": "Worktrees",
390
+ "type": "array"
391
+ },
392
+ "refs": {
393
+ "items": {
394
+ "type": "string"
395
+ },
396
+ "title": "Refs",
397
+ "type": "array"
398
+ }
399
+ },
400
+ "required": [
401
+ "observed",
402
+ "reason",
403
+ "worktrees",
404
+ "refs"
405
+ ],
406
+ "title": "OrphanedResidueOut",
407
+ "type": "object"
408
+ },
409
+ "TrainOut": {
410
+ "additionalProperties": false,
411
+ "properties": {
412
+ "delivery_lineage": {
413
+ "anyOf": [
414
+ {
415
+ "type": "string"
416
+ },
417
+ {
418
+ "type": "null"
419
+ }
420
+ ],
421
+ "title": "Delivery Lineage"
422
+ },
423
+ "base": {
424
+ "title": "Base",
425
+ "type": "string"
426
+ },
427
+ "published_prefix_len": {
428
+ "title": "Published Prefix Len",
429
+ "type": "integer"
430
+ },
431
+ "layers": {
432
+ "items": {
433
+ "$ref": "#/$defs/LayerOut"
434
+ },
435
+ "title": "Layers",
436
+ "type": "array"
437
+ },
438
+ "unresolved_operation": {
439
+ "anyOf": [
440
+ {
441
+ "$ref": "#/$defs/OperationOut"
442
+ },
443
+ {
444
+ "type": "null"
445
+ }
446
+ ]
447
+ },
448
+ "blockers": {
449
+ "items": {
450
+ "$ref": "#/$defs/FindingOut"
451
+ },
452
+ "title": "Blockers",
453
+ "type": "array"
454
+ },
455
+ "information": {
456
+ "items": {
457
+ "$ref": "#/$defs/FindingOut"
458
+ },
459
+ "title": "Information",
460
+ "type": "array"
461
+ },
462
+ "next_build_ready": {
463
+ "$ref": "#/$defs/NextBuildReadyOut"
464
+ },
465
+ "observed_base_head_sha": {
466
+ "anyOf": [
467
+ {
468
+ "type": "string"
469
+ },
470
+ {
471
+ "type": "null"
472
+ }
473
+ ],
474
+ "title": "Observed Base Head Sha"
475
+ },
476
+ "landed_prefix_len": {
477
+ "default": 0,
478
+ "title": "Landed Prefix Len",
479
+ "type": "integer"
480
+ }
481
+ },
482
+ "required": [
483
+ "delivery_lineage",
484
+ "base",
485
+ "published_prefix_len",
486
+ "layers",
487
+ "unresolved_operation",
488
+ "blockers",
489
+ "information",
490
+ "next_build_ready",
491
+ "observed_base_head_sha"
492
+ ],
493
+ "title": "TrainOut",
494
+ "type": "object"
495
+ }
496
+ },
497
+ "additionalProperties": false,
498
+ "description": "The ``perk objective stack status --json`` envelope. ``delivery`` is\n``incremental | stacked``; exactly one of ``train`` / ``no_train`` is set (``no_train``\ncarries the successful no-train explanation for an incremental objective).\n``operations`` / ``continuation`` / ``orphaned_residue`` are the \u00a78.44 detailed-status\nadditions (always-on, additive).",
499
+ "properties": {
500
+ "success": {
501
+ "title": "Success",
502
+ "type": "boolean"
503
+ },
504
+ "error_type": {
505
+ "anyOf": [
506
+ {
507
+ "type": "string"
508
+ },
509
+ {
510
+ "type": "null"
511
+ }
512
+ ],
513
+ "title": "Error Type"
514
+ },
515
+ "objective": {
516
+ "$ref": "#/$defs/ObjectiveOut"
517
+ },
518
+ "delivery": {
519
+ "title": "Delivery",
520
+ "type": "string"
521
+ },
522
+ "train": {
523
+ "anyOf": [
524
+ {
525
+ "$ref": "#/$defs/TrainOut"
526
+ },
527
+ {
528
+ "type": "null"
529
+ }
530
+ ]
531
+ },
532
+ "no_train": {
533
+ "anyOf": [
534
+ {
535
+ "type": "string"
536
+ },
537
+ {
538
+ "type": "null"
539
+ }
540
+ ],
541
+ "title": "No Train"
542
+ },
543
+ "operations": {
544
+ "items": {
545
+ "$ref": "#/$defs/OperationOut"
546
+ },
547
+ "title": "Operations",
548
+ "type": "array"
549
+ },
550
+ "continuation": {
551
+ "anyOf": [
552
+ {
553
+ "$ref": "#/$defs/ContinuationOut"
554
+ },
555
+ {
556
+ "type": "null"
557
+ }
558
+ ]
559
+ },
560
+ "orphaned_residue": {
561
+ "$ref": "#/$defs/OrphanedResidueOut"
562
+ }
563
+ },
564
+ "required": [
565
+ "success",
566
+ "error_type",
567
+ "objective",
568
+ "delivery",
569
+ "train",
570
+ "no_train",
571
+ "operations",
572
+ "continuation",
573
+ "orphaned_residue"
574
+ ],
575
+ "title": "ObjectiveStackStatusOut",
576
+ "type": "object"
577
+ }