@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,487 @@
1
+ {
2
+ "$defs": {
3
+ "_CorruptionFindingOut": {
4
+ "additionalProperties": false,
5
+ "description": "One kind-corruption finding over the objective's issue-tier carrier (report-only \u2014\n``--fix`` never touches it; no repair code path exists).",
6
+ "properties": {
7
+ "code": {
8
+ "title": "Code",
9
+ "type": "string"
10
+ },
11
+ "carrier": {
12
+ "title": "Carrier",
13
+ "type": "string"
14
+ },
15
+ "message": {
16
+ "title": "Message",
17
+ "type": "string"
18
+ },
19
+ "remediation": {
20
+ "title": "Remediation",
21
+ "type": "string"
22
+ }
23
+ },
24
+ "required": [
25
+ "code",
26
+ "carrier",
27
+ "message",
28
+ "remediation"
29
+ ],
30
+ "title": "_CorruptionFindingOut",
31
+ "type": "object"
32
+ },
33
+ "_DriftConditionOut": {
34
+ "additionalProperties": false,
35
+ "properties": {
36
+ "code": {
37
+ "title": "Code",
38
+ "type": "string"
39
+ },
40
+ "severity": {
41
+ "title": "Severity",
42
+ "type": "string"
43
+ },
44
+ "node_id": {
45
+ "anyOf": [
46
+ {
47
+ "type": "string"
48
+ },
49
+ {
50
+ "type": "null"
51
+ }
52
+ ],
53
+ "title": "Node Id"
54
+ },
55
+ "target": {
56
+ "anyOf": [
57
+ {
58
+ "type": "string"
59
+ },
60
+ {
61
+ "type": "null"
62
+ }
63
+ ],
64
+ "title": "Target"
65
+ },
66
+ "message": {
67
+ "title": "Message",
68
+ "type": "string"
69
+ },
70
+ "repairable": {
71
+ "title": "Repairable",
72
+ "type": "boolean"
73
+ }
74
+ },
75
+ "required": [
76
+ "code",
77
+ "severity",
78
+ "node_id",
79
+ "target",
80
+ "message",
81
+ "repairable"
82
+ ],
83
+ "title": "_DriftConditionOut",
84
+ "type": "object"
85
+ },
86
+ "_RepairActionOut": {
87
+ "additionalProperties": false,
88
+ "description": "One manifest repair action. ``error`` carries the write-failure message on the\n**failed** action only \u2014 the key is omitted entirely when ``None`` (contracts.md\n\u00a78.54's documented conditionality; the emission is byte-identical to the historical\nhand-built payload).",
89
+ "properties": {
90
+ "code": {
91
+ "title": "Code",
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
+ "error": {
106
+ "anyOf": [
107
+ {
108
+ "type": "string"
109
+ },
110
+ {
111
+ "type": "null"
112
+ }
113
+ ],
114
+ "default": null,
115
+ "title": "Error"
116
+ }
117
+ },
118
+ "required": [
119
+ "code",
120
+ "node_id"
121
+ ],
122
+ "title": "_RepairActionOut",
123
+ "type": "object"
124
+ },
125
+ "_RepairResultOut": {
126
+ "additionalProperties": false,
127
+ "properties": {
128
+ "applied": {
129
+ "items": {
130
+ "$ref": "#/$defs/_RepairActionOut"
131
+ },
132
+ "title": "Applied",
133
+ "type": "array"
134
+ },
135
+ "failed": {
136
+ "anyOf": [
137
+ {
138
+ "$ref": "#/$defs/_RepairActionOut"
139
+ },
140
+ {
141
+ "type": "null"
142
+ }
143
+ ]
144
+ },
145
+ "remaining": {
146
+ "items": {
147
+ "$ref": "#/$defs/_DriftConditionOut"
148
+ },
149
+ "title": "Remaining",
150
+ "type": "array"
151
+ },
152
+ "aborted": {
153
+ "title": "Aborted",
154
+ "type": "boolean"
155
+ },
156
+ "dry_run": {
157
+ "title": "Dry Run",
158
+ "type": "boolean"
159
+ }
160
+ },
161
+ "required": [
162
+ "applied",
163
+ "failed",
164
+ "remaining",
165
+ "aborted",
166
+ "dry_run"
167
+ ],
168
+ "title": "_RepairResultOut",
169
+ "type": "object"
170
+ },
171
+ "_TrainDiagnosisOut": {
172
+ "additionalProperties": false,
173
+ "properties": {
174
+ "state": {
175
+ "title": "State",
176
+ "type": "string"
177
+ },
178
+ "objective_id": {
179
+ "title": "Objective Id",
180
+ "type": "string"
181
+ },
182
+ "redirected_from": {
183
+ "anyOf": [
184
+ {
185
+ "type": "string"
186
+ },
187
+ {
188
+ "type": "null"
189
+ }
190
+ ],
191
+ "title": "Redirected From"
192
+ },
193
+ "error_type": {
194
+ "anyOf": [
195
+ {
196
+ "type": "string"
197
+ },
198
+ {
199
+ "type": "null"
200
+ }
201
+ ],
202
+ "title": "Error Type"
203
+ },
204
+ "message": {
205
+ "anyOf": [
206
+ {
207
+ "type": "string"
208
+ },
209
+ {
210
+ "type": "null"
211
+ }
212
+ ],
213
+ "title": "Message"
214
+ },
215
+ "blockers": {
216
+ "items": {
217
+ "$ref": "#/$defs/_TrainFindingOut"
218
+ },
219
+ "title": "Blockers",
220
+ "type": "array"
221
+ },
222
+ "information": {
223
+ "items": {
224
+ "$ref": "#/$defs/_TrainFindingOut"
225
+ },
226
+ "title": "Information",
227
+ "type": "array"
228
+ }
229
+ },
230
+ "required": [
231
+ "state",
232
+ "objective_id",
233
+ "redirected_from",
234
+ "error_type",
235
+ "message",
236
+ "blockers",
237
+ "information"
238
+ ],
239
+ "title": "_TrainDiagnosisOut",
240
+ "type": "object"
241
+ },
242
+ "_TrainFindingOut": {
243
+ "additionalProperties": false,
244
+ "properties": {
245
+ "code": {
246
+ "title": "Code",
247
+ "type": "string"
248
+ },
249
+ "severity": {
250
+ "title": "Severity",
251
+ "type": "string"
252
+ },
253
+ "node_id": {
254
+ "anyOf": [
255
+ {
256
+ "type": "string"
257
+ },
258
+ {
259
+ "type": "null"
260
+ }
261
+ ],
262
+ "title": "Node Id"
263
+ },
264
+ "plan_id": {
265
+ "anyOf": [
266
+ {
267
+ "type": "string"
268
+ },
269
+ {
270
+ "type": "null"
271
+ }
272
+ ],
273
+ "title": "Plan Id"
274
+ },
275
+ "message": {
276
+ "title": "Message",
277
+ "type": "string"
278
+ },
279
+ "repairable": {
280
+ "title": "Repairable",
281
+ "type": "boolean"
282
+ },
283
+ "remediation": {
284
+ "anyOf": [
285
+ {
286
+ "type": "string"
287
+ },
288
+ {
289
+ "type": "null"
290
+ }
291
+ ],
292
+ "title": "Remediation"
293
+ }
294
+ },
295
+ "required": [
296
+ "code",
297
+ "severity",
298
+ "node_id",
299
+ "plan_id",
300
+ "message",
301
+ "repairable",
302
+ "remediation"
303
+ ],
304
+ "title": "_TrainFindingOut",
305
+ "type": "object"
306
+ },
307
+ "_TrainFixOut": {
308
+ "additionalProperties": false,
309
+ "properties": {
310
+ "state": {
311
+ "title": "State",
312
+ "type": "string"
313
+ },
314
+ "applied": {
315
+ "items": {
316
+ "$ref": "#/$defs/_TrainRepairActionOut"
317
+ },
318
+ "title": "Applied",
319
+ "type": "array"
320
+ },
321
+ "skipped": {
322
+ "items": {
323
+ "$ref": "#/$defs/_TrainRepairActionOut"
324
+ },
325
+ "title": "Skipped",
326
+ "type": "array"
327
+ },
328
+ "failed": {
329
+ "anyOf": [
330
+ {
331
+ "$ref": "#/$defs/_TrainRepairActionOut"
332
+ },
333
+ {
334
+ "type": "null"
335
+ }
336
+ ]
337
+ },
338
+ "remaining": {
339
+ "items": {
340
+ "$ref": "#/$defs/_TrainFindingOut"
341
+ },
342
+ "title": "Remaining",
343
+ "type": "array"
344
+ },
345
+ "aborted": {
346
+ "title": "Aborted",
347
+ "type": "boolean"
348
+ },
349
+ "dry_run": {
350
+ "title": "Dry Run",
351
+ "type": "boolean"
352
+ }
353
+ },
354
+ "required": [
355
+ "state",
356
+ "applied",
357
+ "skipped",
358
+ "failed",
359
+ "remaining",
360
+ "aborted",
361
+ "dry_run"
362
+ ],
363
+ "title": "_TrainFixOut",
364
+ "type": "object"
365
+ },
366
+ "_TrainRepairActionOut": {
367
+ "additionalProperties": false,
368
+ "properties": {
369
+ "code": {
370
+ "title": "Code",
371
+ "type": "string"
372
+ },
373
+ "node_id": {
374
+ "title": "Node Id",
375
+ "type": "string"
376
+ },
377
+ "outcome": {
378
+ "title": "Outcome",
379
+ "type": "string"
380
+ },
381
+ "error": {
382
+ "anyOf": [
383
+ {
384
+ "type": "string"
385
+ },
386
+ {
387
+ "type": "null"
388
+ }
389
+ ],
390
+ "title": "Error"
391
+ }
392
+ },
393
+ "required": [
394
+ "code",
395
+ "node_id",
396
+ "outcome",
397
+ "error"
398
+ ],
399
+ "title": "_TrainRepairActionOut",
400
+ "type": "object"
401
+ }
402
+ },
403
+ "additionalProperties": false,
404
+ "description": "The ``perk objective doctor --json`` report envelope (contracts.md \u00a78.54). Field\ndeclaration order is load-bearing (the machine surface's exact key order) \u2014 do not\nreorder. The failure envelope stays the shared ``fail(...)`` path.",
405
+ "properties": {
406
+ "success": {
407
+ "title": "Success",
408
+ "type": "boolean"
409
+ },
410
+ "error_type": {
411
+ "anyOf": [
412
+ {
413
+ "type": "string"
414
+ },
415
+ {
416
+ "type": "null"
417
+ }
418
+ ],
419
+ "title": "Error Type"
420
+ },
421
+ "objective": {
422
+ "title": "Objective",
423
+ "type": "string"
424
+ },
425
+ "drift": {
426
+ "items": {
427
+ "$ref": "#/$defs/_DriftConditionOut"
428
+ },
429
+ "title": "Drift",
430
+ "type": "array"
431
+ },
432
+ "fix": {
433
+ "anyOf": [
434
+ {
435
+ "$ref": "#/$defs/_RepairResultOut"
436
+ },
437
+ {
438
+ "type": "null"
439
+ }
440
+ ]
441
+ },
442
+ "redirected_from": {
443
+ "anyOf": [
444
+ {
445
+ "type": "string"
446
+ },
447
+ {
448
+ "type": "null"
449
+ }
450
+ ],
451
+ "title": "Redirected From"
452
+ },
453
+ "train": {
454
+ "$ref": "#/$defs/_TrainDiagnosisOut"
455
+ },
456
+ "train_fix": {
457
+ "anyOf": [
458
+ {
459
+ "$ref": "#/$defs/_TrainFixOut"
460
+ },
461
+ {
462
+ "type": "null"
463
+ }
464
+ ]
465
+ },
466
+ "corruption": {
467
+ "items": {
468
+ "$ref": "#/$defs/_CorruptionFindingOut"
469
+ },
470
+ "title": "Corruption",
471
+ "type": "array"
472
+ }
473
+ },
474
+ "required": [
475
+ "success",
476
+ "error_type",
477
+ "objective",
478
+ "drift",
479
+ "fix",
480
+ "redirected_from",
481
+ "train",
482
+ "train_fix",
483
+ "corruption"
484
+ ],
485
+ "title": "ObjectiveDoctorOut",
486
+ "type": "object"
487
+ }