@nanobpm/nano-workforce 0.45.0 → 0.46.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.
- package/CHANGELOG.md +7 -0
- package/SPEC.md +40 -0
- package/app/plan.test.ts +80 -3
- package/app/plan.ts +118 -8
- package/db/migrations/020_plan_review_escalation.sql +51 -0
- package/nano.app.json +4 -0
- package/openapi.yaml +70 -3
- package/operations/answerPlanEscalation.test.ts +115 -0
- package/operations/answerPlanEscalation.ts +41 -0
- package/operations/postMessage.ts +25 -5
- package/operations/startAndMessage.test.ts +58 -0
- package/package.json +1 -1
- package/pages/epic.page.json +61 -1
- package/prompts/plan.md +11 -0
- package/resources/agent-guide.md +13 -3
- package/resources/processes/plan-fanout.bpmn +191 -109
- package/workers/persist-plan-escalation/worker.test.ts +80 -0
- package/workers/persist-plan-escalation/worker.ts +73 -0
- package/workers/record-plan-review/worker.test.ts +59 -39
- package/workers/record-plan-review/worker.ts +53 -29
|
@@ -5,6 +5,11 @@
|
|
|
5
5
|
<zeebe:subscription correlationKey="=planKey + ":" + task.id" />
|
|
6
6
|
</bpmn:extensionElements>
|
|
7
7
|
</bpmn:message>
|
|
8
|
+
<bpmn:message id="Message_planEscalationAnswered" name="plan-escalation-answered">
|
|
9
|
+
<bpmn:extensionElements>
|
|
10
|
+
<zeebe:subscription correlationKey="=planKey" />
|
|
11
|
+
</bpmn:extensionElements>
|
|
12
|
+
</bpmn:message>
|
|
8
13
|
<bpmn:message id="Message_waveMerged" name="wave-merged">
|
|
9
14
|
<bpmn:extensionElements>
|
|
10
15
|
<zeebe:subscription correlationKey="=planKey" />
|
|
@@ -26,6 +31,7 @@
|
|
|
26
31
|
</bpmn:extensionElements>
|
|
27
32
|
<bpmn:incoming>f_toPlan</bpmn:incoming>
|
|
28
33
|
<bpmn:incoming>f_plan_revise</bpmn:incoming>
|
|
34
|
+
<bpmn:incoming>f_plan_answer_revise</bpmn:incoming>
|
|
29
35
|
<bpmn:outgoing>f_toRecordPlan</bpmn:outgoing>
|
|
30
36
|
</bpmn:serviceTask>
|
|
31
37
|
<bpmn:serviceTask id="record-plan" name="Record plan & levelize">
|
|
@@ -55,13 +61,32 @@
|
|
|
55
61
|
<bpmn:exclusiveGateway id="gw-plan-review" name="plan approved?" default="f_plan_revise">
|
|
56
62
|
<bpmn:incoming>f_toGwPlanReview</bpmn:incoming>
|
|
57
63
|
<bpmn:outgoing>f_plan_proceed</bpmn:outgoing>
|
|
64
|
+
<bpmn:outgoing>f_plan_escalate</bpmn:outgoing>
|
|
58
65
|
<bpmn:outgoing>f_plan_revise</bpmn:outgoing>
|
|
59
66
|
</bpmn:exclusiveGateway>
|
|
67
|
+
<bpmn:serviceTask id="persist-plan-escalation" name="Record plan escalation">
|
|
68
|
+
<bpmn:extensionElements>
|
|
69
|
+
<zeebe:taskDefinition type="pr.persist-plan-escalation" />
|
|
70
|
+
</bpmn:extensionElements>
|
|
71
|
+
<bpmn:incoming>f_plan_escalate</bpmn:incoming>
|
|
72
|
+
<bpmn:outgoing>f_toWaitPlanAnswer</bpmn:outgoing>
|
|
73
|
+
</bpmn:serviceTask>
|
|
74
|
+
<bpmn:intermediateCatchEvent id="wait-plan-answer" name="Wait: plan answer">
|
|
75
|
+
<bpmn:incoming>f_toWaitPlanAnswer</bpmn:incoming>
|
|
76
|
+
<bpmn:outgoing>f_toGwPlanAnswer</bpmn:outgoing>
|
|
77
|
+
<bpmn:messageEventDefinition id="med_planAnswered" messageRef="Message_planEscalationAnswered" />
|
|
78
|
+
</bpmn:intermediateCatchEvent>
|
|
79
|
+
<bpmn:exclusiveGateway id="gw-plan-answer" name="proceed override?" default="f_plan_answer_revise">
|
|
80
|
+
<bpmn:incoming>f_toGwPlanAnswer</bpmn:incoming>
|
|
81
|
+
<bpmn:outgoing>f_plan_answer_proceed</bpmn:outgoing>
|
|
82
|
+
<bpmn:outgoing>f_plan_answer_revise</bpmn:outgoing>
|
|
83
|
+
</bpmn:exclusiveGateway>
|
|
60
84
|
<bpmn:serviceTask id="select-wave" name="Select wave">
|
|
61
85
|
<bpmn:extensionElements>
|
|
62
86
|
<zeebe:taskDefinition type="pr.select-wave" />
|
|
63
87
|
</bpmn:extensionElements>
|
|
64
88
|
<bpmn:incoming>f_plan_proceed</bpmn:incoming>
|
|
89
|
+
<bpmn:incoming>f_plan_answer_proceed</bpmn:incoming>
|
|
65
90
|
<bpmn:incoming>f_waveMerged</bpmn:incoming>
|
|
66
91
|
<bpmn:outgoing>f_toImplement</bpmn:outgoing>
|
|
67
92
|
</bpmn:serviceTask>
|
|
@@ -218,7 +243,16 @@
|
|
|
218
243
|
<bpmn:sequenceFlow id="f_plan_proceed" name="approved" sourceRef="gw-plan-review" targetRef="select-wave">
|
|
219
244
|
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">=planApproved</bpmn:conditionExpression>
|
|
220
245
|
</bpmn:sequenceFlow>
|
|
246
|
+
<bpmn:sequenceFlow id="f_plan_escalate" name="escalated" sourceRef="gw-plan-review" targetRef="persist-plan-escalation">
|
|
247
|
+
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">=planEscalated</bpmn:conditionExpression>
|
|
248
|
+
</bpmn:sequenceFlow>
|
|
221
249
|
<bpmn:sequenceFlow id="f_plan_revise" name="revise" sourceRef="gw-plan-review" targetRef="plan" />
|
|
250
|
+
<bpmn:sequenceFlow id="f_toWaitPlanAnswer" sourceRef="persist-plan-escalation" targetRef="wait-plan-answer" />
|
|
251
|
+
<bpmn:sequenceFlow id="f_toGwPlanAnswer" sourceRef="wait-plan-answer" targetRef="gw-plan-answer" />
|
|
252
|
+
<bpmn:sequenceFlow id="f_plan_answer_proceed" name="proceed" sourceRef="gw-plan-answer" targetRef="select-wave">
|
|
253
|
+
<bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">=planEscalationDirective = "proceed"</bpmn:conditionExpression>
|
|
254
|
+
</bpmn:sequenceFlow>
|
|
255
|
+
<bpmn:sequenceFlow id="f_plan_answer_revise" name="revise" sourceRef="gw-plan-answer" targetRef="plan" />
|
|
222
256
|
<bpmn:sequenceFlow id="f_toImplement" sourceRef="select-wave" targetRef="implement" />
|
|
223
257
|
<bpmn:sequenceFlow id="f_toRecordWave" sourceRef="implement" targetRef="record-wave" />
|
|
224
258
|
<bpmn:sequenceFlow id="f_toTrialNeeded" sourceRef="record-wave" targetRef="gw-trial-needed" />
|
|
@@ -268,70 +302,85 @@
|
|
|
268
302
|
<bpmndi:BPMNShape id="BPMNShape_gw-plan-review" bpmnElement="gw-plan-review" isMarkerVisible="true">
|
|
269
303
|
<dc:Bounds x="1016" y="215" width="50" height="50" />
|
|
270
304
|
<bpmndi:BPMNLabel>
|
|
271
|
-
<dc:Bounds x="
|
|
305
|
+
<dc:Bounds x="968" y="270" width="67" height="28" />
|
|
306
|
+
</bpmndi:BPMNLabel>
|
|
307
|
+
</bpmndi:BPMNShape>
|
|
308
|
+
<bpmndi:BPMNShape id="BPMNShape_persist-plan-escalation" bpmnElement="persist-plan-escalation">
|
|
309
|
+
<dc:Bounds x="1166" y="360" width="100" height="80" />
|
|
310
|
+
</bpmndi:BPMNShape>
|
|
311
|
+
<bpmndi:BPMNShape id="BPMNShape_wait-plan-answer" bpmnElement="wait-plan-answer">
|
|
312
|
+
<dc:Bounds x="1366" y="382" width="36" height="36" />
|
|
313
|
+
<bpmndi:BPMNLabel>
|
|
314
|
+
<dc:Bounds x="1347" y="423" width="75" height="28" />
|
|
315
|
+
</bpmndi:BPMNLabel>
|
|
316
|
+
</bpmndi:BPMNShape>
|
|
317
|
+
<bpmndi:BPMNShape id="BPMNShape_gw-plan-answer" bpmnElement="gw-plan-answer" isMarkerVisible="true">
|
|
318
|
+
<dc:Bounds x="1502" y="375" width="50" height="50" />
|
|
319
|
+
<bpmndi:BPMNLabel>
|
|
320
|
+
<dc:Bounds x="1557" y="386" width="67" height="28" />
|
|
272
321
|
</bpmndi:BPMNLabel>
|
|
273
322
|
</bpmndi:BPMNShape>
|
|
274
323
|
<bpmndi:BPMNShape id="BPMNShape_select-wave" bpmnElement="select-wave">
|
|
275
|
-
<dc:Bounds x="
|
|
324
|
+
<dc:Bounds x="1652" y="200" width="100" height="80" />
|
|
276
325
|
</bpmndi:BPMNShape>
|
|
277
326
|
<bpmndi:BPMNShape id="BPMNShape_implement" bpmnElement="implement" isExpanded="true">
|
|
278
|
-
<dc:Bounds x="
|
|
327
|
+
<dc:Bounds x="1852" y="80" width="802" height="320" />
|
|
279
328
|
</bpmndi:BPMNShape>
|
|
280
329
|
<bpmndi:BPMNShape id="BPMNShape_record-wave" bpmnElement="record-wave">
|
|
281
|
-
<dc:Bounds x="
|
|
330
|
+
<dc:Bounds x="2754" y="200" width="100" height="80" />
|
|
282
331
|
</bpmndi:BPMNShape>
|
|
283
332
|
<bpmndi:BPMNShape id="BPMNShape_gw-trial-needed" bpmnElement="gw-trial-needed" isMarkerVisible="true">
|
|
284
|
-
<dc:Bounds x="
|
|
333
|
+
<dc:Bounds x="2954" y="215" width="50" height="50" />
|
|
285
334
|
<bpmndi:BPMNLabel>
|
|
286
|
-
<dc:Bounds x="
|
|
335
|
+
<dc:Bounds x="2935" y="196" width="88" height="14" />
|
|
287
336
|
</bpmndi:BPMNLabel>
|
|
288
337
|
</bpmndi:BPMNShape>
|
|
289
338
|
<bpmndi:BPMNShape id="BPMNShape_trial-merge" bpmnElement="trial-merge">
|
|
290
|
-
<dc:Bounds x="
|
|
339
|
+
<dc:Bounds x="3104" y="360" width="100" height="80" />
|
|
291
340
|
</bpmndi:BPMNShape>
|
|
292
341
|
<bpmndi:BPMNShape id="BPMNShape_record-trial-merge" bpmnElement="record-trial-merge">
|
|
293
|
-
<dc:Bounds x="
|
|
342
|
+
<dc:Bounds x="3304" y="360" width="100" height="80" />
|
|
294
343
|
</bpmndi:BPMNShape>
|
|
295
344
|
<bpmndi:BPMNShape id="BPMNShape_gw-trial" bpmnElement="gw-trial" isMarkerVisible="true">
|
|
296
|
-
<dc:Bounds x="
|
|
345
|
+
<dc:Bounds x="3504" y="375" width="50" height="50" />
|
|
297
346
|
<bpmndi:BPMNLabel>
|
|
298
|
-
<dc:Bounds x="
|
|
347
|
+
<dc:Bounds x="3559" y="393" width="71" height="14" />
|
|
299
348
|
</bpmndi:BPMNLabel>
|
|
300
349
|
</bpmndi:BPMNShape>
|
|
301
350
|
<bpmndi:BPMNShape id="BPMNShape_persist-trial-escalation" bpmnElement="persist-trial-escalation">
|
|
302
|
-
<dc:Bounds x="
|
|
351
|
+
<dc:Bounds x="3654" y="520" width="100" height="80" />
|
|
303
352
|
</bpmndi:BPMNShape>
|
|
304
353
|
<bpmndi:BPMNShape id="BPMNShape_wait-trial-answer" bpmnElement="wait-trial-answer">
|
|
305
|
-
<dc:Bounds x="
|
|
354
|
+
<dc:Bounds x="3854" y="542" width="36" height="36" />
|
|
306
355
|
<bpmndi:BPMNLabel>
|
|
307
|
-
<dc:Bounds x="
|
|
356
|
+
<dc:Bounds x="3831" y="583" width="82" height="28" />
|
|
308
357
|
</bpmndi:BPMNLabel>
|
|
309
358
|
</bpmndi:BPMNShape>
|
|
310
359
|
<bpmndi:BPMNShape id="BPMNShape_gw-trial-answer" bpmnElement="gw-trial-answer" isMarkerVisible="true">
|
|
311
|
-
<dc:Bounds x="
|
|
360
|
+
<dc:Bounds x="3990" y="535" width="50" height="50" />
|
|
312
361
|
<bpmndi:BPMNLabel>
|
|
313
|
-
<dc:Bounds x="
|
|
362
|
+
<dc:Bounds x="4045" y="546" width="67" height="28" />
|
|
314
363
|
</bpmndi:BPMNLabel>
|
|
315
364
|
</bpmndi:BPMNShape>
|
|
316
365
|
<bpmndi:BPMNShape id="BPMNShape_gw-more" bpmnElement="gw-more" isMarkerVisible="true">
|
|
317
|
-
<dc:Bounds x="
|
|
366
|
+
<dc:Bounds x="4140" y="215" width="50" height="50" />
|
|
318
367
|
<bpmndi:BPMNLabel>
|
|
319
|
-
<dc:Bounds x="
|
|
368
|
+
<dc:Bounds x="4123" y="196" width="84" height="14" />
|
|
320
369
|
</bpmndi:BPMNLabel>
|
|
321
370
|
</bpmndi:BPMNShape>
|
|
322
371
|
<bpmndi:BPMNShape id="BPMNShape_wait-wave-merged" bpmnElement="wait-wave-merged">
|
|
323
|
-
<dc:Bounds x="
|
|
372
|
+
<dc:Bounds x="4322" y="382" width="36" height="36" />
|
|
324
373
|
<bpmndi:BPMNLabel>
|
|
325
|
-
<dc:Bounds x="
|
|
374
|
+
<dc:Bounds x="4301" y="349" width="78" height="28" />
|
|
326
375
|
</bpmndi:BPMNLabel>
|
|
327
376
|
</bpmndi:BPMNShape>
|
|
328
377
|
<bpmndi:BPMNShape id="BPMNShape_record-results" bpmnElement="record-results">
|
|
329
|
-
<dc:Bounds x="
|
|
378
|
+
<dc:Bounds x="4290" y="200" width="100" height="80" />
|
|
330
379
|
</bpmndi:BPMNShape>
|
|
331
380
|
<bpmndi:BPMNShape id="BPMNShape_End" bpmnElement="End">
|
|
332
|
-
<dc:Bounds x="
|
|
381
|
+
<dc:Bounds x="4490" y="222" width="36" height="36" />
|
|
333
382
|
<bpmndi:BPMNLabel>
|
|
334
|
-
<dc:Bounds x="
|
|
383
|
+
<dc:Bounds x="4471" y="263" width="74" height="28" />
|
|
335
384
|
</bpmndi:BPMNLabel>
|
|
336
385
|
</bpmndi:BPMNShape>
|
|
337
386
|
<bpmndi:BPMNEdge id="BPMNEdge_f_toPlan" bpmnElement="f_toPlan">
|
|
@@ -356,112 +405,145 @@
|
|
|
356
405
|
</bpmndi:BPMNEdge>
|
|
357
406
|
<bpmndi:BPMNEdge id="BPMNEdge_f_plan_proceed" bpmnElement="f_plan_proceed">
|
|
358
407
|
<di:waypoint x="1066" y="240" />
|
|
359
|
-
<di:waypoint x="
|
|
408
|
+
<di:waypoint x="1652" y="240" />
|
|
360
409
|
<bpmndi:BPMNLabel>
|
|
361
|
-
<dc:Bounds x="
|
|
410
|
+
<dc:Bounds x="1267" y="218" width="60" height="14" />
|
|
362
411
|
</bpmndi:BPMNLabel>
|
|
363
412
|
</bpmndi:BPMNEdge>
|
|
364
413
|
<bpmndi:BPMNEdge id="BPMNEdge_f_toImplement" bpmnElement="f_toImplement">
|
|
365
|
-
<di:waypoint x="
|
|
366
|
-
<di:waypoint x="
|
|
414
|
+
<di:waypoint x="1752" y="240" />
|
|
415
|
+
<di:waypoint x="1852" y="240" />
|
|
367
416
|
</bpmndi:BPMNEdge>
|
|
368
417
|
<bpmndi:BPMNEdge id="BPMNEdge_f_toRecordWave" bpmnElement="f_toRecordWave">
|
|
369
|
-
<di:waypoint x="
|
|
370
|
-
<di:waypoint x="
|
|
418
|
+
<di:waypoint x="2654" y="240" />
|
|
419
|
+
<di:waypoint x="2754" y="240" />
|
|
371
420
|
</bpmndi:BPMNEdge>
|
|
372
421
|
<bpmndi:BPMNEdge id="BPMNEdge_f_toTrialNeeded" bpmnElement="f_toTrialNeeded">
|
|
373
|
-
<di:waypoint x="
|
|
374
|
-
<di:waypoint x="
|
|
422
|
+
<di:waypoint x="2854" y="240" />
|
|
423
|
+
<di:waypoint x="2954" y="240" />
|
|
375
424
|
</bpmndi:BPMNEdge>
|
|
376
425
|
<bpmndi:BPMNEdge id="BPMNEdge_f_skipTrialMerge" bpmnElement="f_skipTrialMerge">
|
|
377
|
-
<di:waypoint x="
|
|
378
|
-
<di:waypoint x="
|
|
426
|
+
<di:waypoint x="3004" y="240" />
|
|
427
|
+
<di:waypoint x="4140" y="240" />
|
|
379
428
|
<bpmndi:BPMNLabel>
|
|
380
|
-
<dc:Bounds x="
|
|
429
|
+
<dc:Bounds x="3251" y="218" width="32" height="14" />
|
|
381
430
|
</bpmndi:BPMNLabel>
|
|
382
431
|
</bpmndi:BPMNEdge>
|
|
383
432
|
<bpmndi:BPMNEdge id="BPMNEdge_f_done" bpmnElement="f_done">
|
|
384
|
-
<di:waypoint x="
|
|
385
|
-
<di:waypoint x="
|
|
433
|
+
<di:waypoint x="4190" y="240" />
|
|
434
|
+
<di:waypoint x="4290" y="240" />
|
|
386
435
|
<bpmndi:BPMNLabel>
|
|
387
|
-
<dc:Bounds x="
|
|
436
|
+
<dc:Bounds x="4234" y="218" width="32" height="14" />
|
|
388
437
|
</bpmndi:BPMNLabel>
|
|
389
438
|
</bpmndi:BPMNEdge>
|
|
390
439
|
<bpmndi:BPMNEdge id="BPMNEdge_f_toEnd" bpmnElement="f_toEnd">
|
|
391
|
-
<di:waypoint x="
|
|
392
|
-
<di:waypoint x="
|
|
440
|
+
<di:waypoint x="4390" y="240" />
|
|
441
|
+
<di:waypoint x="4490" y="240" />
|
|
442
|
+
</bpmndi:BPMNEdge>
|
|
443
|
+
<bpmndi:BPMNEdge id="BPMNEdge_f_plan_answer_revise" bpmnElement="f_plan_answer_revise">
|
|
444
|
+
<di:waypoint x="1527" y="425" />
|
|
445
|
+
<di:waypoint x="1527" y="460" />
|
|
446
|
+
<di:waypoint x="266" y="460" />
|
|
447
|
+
<di:waypoint x="266" y="280" />
|
|
448
|
+
<bpmndi:BPMNLabel>
|
|
449
|
+
<dc:Bounds x="874" y="438" width="46" height="14" />
|
|
450
|
+
</bpmndi:BPMNLabel>
|
|
393
451
|
</bpmndi:BPMNEdge>
|
|
394
452
|
<bpmndi:BPMNEdge id="BPMNEdge_f_toRecordTrialMerge" bpmnElement="f_toRecordTrialMerge">
|
|
395
|
-
<di:waypoint x="
|
|
396
|
-
<di:waypoint x="
|
|
453
|
+
<di:waypoint x="3204" y="400" />
|
|
454
|
+
<di:waypoint x="3304" y="400" />
|
|
397
455
|
</bpmndi:BPMNEdge>
|
|
398
456
|
<bpmndi:BPMNEdge id="BPMNEdge_f_toGwTrial" bpmnElement="f_toGwTrial">
|
|
399
|
-
<di:waypoint x="
|
|
400
|
-
<di:waypoint x="
|
|
457
|
+
<di:waypoint x="3404" y="400" />
|
|
458
|
+
<di:waypoint x="3504" y="400" />
|
|
401
459
|
</bpmndi:BPMNEdge>
|
|
402
460
|
<bpmndi:BPMNEdge id="BPMNEdge_f_trialProceed" bpmnElement="f_trialProceed">
|
|
403
|
-
<di:waypoint x="
|
|
404
|
-
<di:waypoint x="
|
|
405
|
-
<di:waypoint x="
|
|
461
|
+
<di:waypoint x="3529" y="375" />
|
|
462
|
+
<di:waypoint x="3529" y="240" />
|
|
463
|
+
<di:waypoint x="4140" y="240" />
|
|
406
464
|
<bpmndi:BPMNLabel>
|
|
407
|
-
<dc:Bounds x="
|
|
465
|
+
<dc:Bounds x="3534" y="301" width="53" height="14" />
|
|
408
466
|
</bpmndi:BPMNLabel>
|
|
409
467
|
</bpmndi:BPMNEdge>
|
|
410
468
|
<bpmndi:BPMNEdge id="BPMNEdge_f_trialAnswerRerun" bpmnElement="f_trialAnswerRerun">
|
|
411
|
-
<di:waypoint x="
|
|
412
|
-
<di:waypoint x="
|
|
413
|
-
<di:waypoint x="
|
|
414
|
-
<di:waypoint x="
|
|
469
|
+
<di:waypoint x="4015" y="585" />
|
|
470
|
+
<di:waypoint x="4015" y="620" />
|
|
471
|
+
<di:waypoint x="3154" y="620" />
|
|
472
|
+
<di:waypoint x="3154" y="440" />
|
|
473
|
+
<bpmndi:BPMNLabel>
|
|
474
|
+
<dc:Bounds x="3565" y="598" width="39" height="14" />
|
|
475
|
+
</bpmndi:BPMNLabel>
|
|
476
|
+
</bpmndi:BPMNEdge>
|
|
477
|
+
<bpmndi:BPMNEdge id="BPMNEdge_f_plan_escalate" bpmnElement="f_plan_escalate">
|
|
478
|
+
<di:waypoint x="1041" y="265" />
|
|
479
|
+
<di:waypoint x="1041" y="400" />
|
|
480
|
+
<di:waypoint x="1166" y="400" />
|
|
415
481
|
<bpmndi:BPMNLabel>
|
|
416
|
-
<dc:Bounds x="
|
|
482
|
+
<dc:Bounds x="1046" y="326" width="67" height="14" />
|
|
483
|
+
</bpmndi:BPMNLabel>
|
|
484
|
+
</bpmndi:BPMNEdge>
|
|
485
|
+
<bpmndi:BPMNEdge id="BPMNEdge_f_plan_answer_proceed" bpmnElement="f_plan_answer_proceed">
|
|
486
|
+
<di:waypoint x="1527" y="375" />
|
|
487
|
+
<di:waypoint x="1527" y="240" />
|
|
488
|
+
<di:waypoint x="1652" y="240" />
|
|
489
|
+
<bpmndi:BPMNLabel>
|
|
490
|
+
<dc:Bounds x="1532" y="301" width="53" height="14" />
|
|
417
491
|
</bpmndi:BPMNLabel>
|
|
418
492
|
</bpmndi:BPMNEdge>
|
|
419
493
|
<bpmndi:BPMNEdge id="BPMNEdge_f_runTrialMerge" bpmnElement="f_runTrialMerge">
|
|
420
|
-
<di:waypoint x="
|
|
421
|
-
<di:waypoint x="
|
|
422
|
-
<di:waypoint x="
|
|
494
|
+
<di:waypoint x="2979" y="265" />
|
|
495
|
+
<di:waypoint x="2979" y="400" />
|
|
496
|
+
<di:waypoint x="3104" y="400" />
|
|
423
497
|
<bpmndi:BPMNLabel>
|
|
424
|
-
<dc:Bounds x="
|
|
498
|
+
<dc:Bounds x="2984" y="326" width="25" height="14" />
|
|
425
499
|
</bpmndi:BPMNLabel>
|
|
426
500
|
</bpmndi:BPMNEdge>
|
|
427
501
|
<bpmndi:BPMNEdge id="BPMNEdge_f_trialEscalate" bpmnElement="f_trialEscalate">
|
|
428
|
-
<di:waypoint x="
|
|
429
|
-
<di:waypoint x="
|
|
430
|
-
<di:waypoint x="
|
|
502
|
+
<di:waypoint x="3529" y="425" />
|
|
503
|
+
<di:waypoint x="3529" y="560" />
|
|
504
|
+
<di:waypoint x="3654" y="560" />
|
|
431
505
|
<bpmndi:BPMNLabel>
|
|
432
|
-
<dc:Bounds x="
|
|
506
|
+
<dc:Bounds x="3534" y="486" width="85" height="14" />
|
|
433
507
|
</bpmndi:BPMNLabel>
|
|
434
508
|
</bpmndi:BPMNEdge>
|
|
435
509
|
<bpmndi:BPMNEdge id="BPMNEdge_f_trialAnswerProceed" bpmnElement="f_trialAnswerProceed">
|
|
436
|
-
<di:waypoint x="
|
|
437
|
-
<di:waypoint x="
|
|
438
|
-
<di:waypoint x="
|
|
439
|
-
<di:waypoint x="
|
|
510
|
+
<di:waypoint x="4015" y="535" />
|
|
511
|
+
<di:waypoint x="4015" y="385" />
|
|
512
|
+
<di:waypoint x="4165" y="385" />
|
|
513
|
+
<di:waypoint x="4165" y="265" />
|
|
440
514
|
<bpmndi:BPMNLabel>
|
|
441
|
-
<dc:Bounds x="
|
|
515
|
+
<dc:Bounds x="4064" y="363" width="53" height="14" />
|
|
442
516
|
</bpmndi:BPMNLabel>
|
|
443
517
|
</bpmndi:BPMNEdge>
|
|
444
518
|
<bpmndi:BPMNEdge id="BPMNEdge_f_moreWaves" bpmnElement="f_moreWaves">
|
|
445
|
-
<di:waypoint x="
|
|
446
|
-
<di:waypoint x="
|
|
447
|
-
<di:waypoint x="
|
|
448
|
-
<di:waypoint x="
|
|
449
|
-
<di:waypoint x="
|
|
450
|
-
<di:waypoint x="
|
|
451
|
-
<di:waypoint x="
|
|
452
|
-
<di:waypoint x="
|
|
453
|
-
<di:waypoint x="
|
|
519
|
+
<di:waypoint x="4190" y="240" />
|
|
520
|
+
<di:waypoint x="4210" y="240" />
|
|
521
|
+
<di:waypoint x="4210" y="265" />
|
|
522
|
+
<di:waypoint x="4244" y="265" />
|
|
523
|
+
<di:waypoint x="4244" y="420" />
|
|
524
|
+
<di:waypoint x="4322" y="420" />
|
|
525
|
+
<di:waypoint x="4322" y="438" />
|
|
526
|
+
<di:waypoint x="4340" y="438" />
|
|
527
|
+
<di:waypoint x="4340" y="418" />
|
|
454
528
|
<bpmndi:BPMNLabel>
|
|
455
|
-
<dc:Bounds x="
|
|
529
|
+
<dc:Bounds x="4249" y="336" width="35" height="14" />
|
|
456
530
|
</bpmndi:BPMNLabel>
|
|
457
531
|
</bpmndi:BPMNEdge>
|
|
532
|
+
<bpmndi:BPMNEdge id="BPMNEdge_f_toWaitPlanAnswer" bpmnElement="f_toWaitPlanAnswer">
|
|
533
|
+
<di:waypoint x="1266" y="400" />
|
|
534
|
+
<di:waypoint x="1366" y="400" />
|
|
535
|
+
</bpmndi:BPMNEdge>
|
|
536
|
+
<bpmndi:BPMNEdge id="BPMNEdge_f_toGwPlanAnswer" bpmnElement="f_toGwPlanAnswer">
|
|
537
|
+
<di:waypoint x="1402" y="400" />
|
|
538
|
+
<di:waypoint x="1502" y="400" />
|
|
539
|
+
</bpmndi:BPMNEdge>
|
|
458
540
|
<bpmndi:BPMNEdge id="BPMNEdge_f_toWaitTrial" bpmnElement="f_toWaitTrial">
|
|
459
|
-
<di:waypoint x="
|
|
460
|
-
<di:waypoint x="
|
|
541
|
+
<di:waypoint x="3754" y="560" />
|
|
542
|
+
<di:waypoint x="3854" y="560" />
|
|
461
543
|
</bpmndi:BPMNEdge>
|
|
462
544
|
<bpmndi:BPMNEdge id="BPMNEdge_f_toGwTrialAnswer" bpmnElement="f_toGwTrialAnswer">
|
|
463
|
-
<di:waypoint x="
|
|
464
|
-
<di:waypoint x="
|
|
545
|
+
<di:waypoint x="3890" y="560" />
|
|
546
|
+
<di:waypoint x="3990" y="560" />
|
|
465
547
|
</bpmndi:BPMNEdge>
|
|
466
548
|
<bpmndi:BPMNEdge id="BPMNEdge_f_plan_revise" bpmnElement="f_plan_revise">
|
|
467
549
|
<di:waypoint x="1041" y="215" />
|
|
@@ -473,73 +555,73 @@
|
|
|
473
555
|
</bpmndi:BPMNLabel>
|
|
474
556
|
</bpmndi:BPMNEdge>
|
|
475
557
|
<bpmndi:BPMNEdge id="BPMNEdge_f_waveMerged" bpmnElement="f_waveMerged">
|
|
476
|
-
<di:waypoint x="
|
|
477
|
-
<di:waypoint x="
|
|
478
|
-
<di:waypoint x="
|
|
479
|
-
<di:waypoint x="
|
|
558
|
+
<di:waypoint x="4340" y="418" />
|
|
559
|
+
<di:waypoint x="4340" y="640" />
|
|
560
|
+
<di:waypoint x="1702" y="640" />
|
|
561
|
+
<di:waypoint x="1702" y="280" />
|
|
480
562
|
</bpmndi:BPMNEdge>
|
|
481
563
|
<bpmndi:BPMNShape id="BPMNShape_w_start" bpmnElement="w_start">
|
|
482
|
-
<dc:Bounds x="
|
|
564
|
+
<dc:Bounds x="1892" y="142" width="36" height="36" />
|
|
483
565
|
<bpmndi:BPMNLabel>
|
|
484
|
-
<dc:Bounds x="
|
|
566
|
+
<dc:Bounds x="1893" y="183" width="34" height="14" />
|
|
485
567
|
</bpmndi:BPMNLabel>
|
|
486
568
|
</bpmndi:BPMNShape>
|
|
487
569
|
<bpmndi:BPMNShape id="BPMNShape_implement-task" bpmnElement="implement-task">
|
|
488
|
-
<dc:Bounds x="
|
|
570
|
+
<dc:Bounds x="2028" y="120" width="100" height="80" />
|
|
489
571
|
</bpmndi:BPMNShape>
|
|
490
572
|
<bpmndi:BPMNShape id="BPMNShape_w_gw" bpmnElement="w_gw" isMarkerVisible="true">
|
|
491
|
-
<dc:Bounds x="
|
|
573
|
+
<dc:Bounds x="2228" y="135" width="50" height="50" />
|
|
492
574
|
<bpmndi:BPMNLabel>
|
|
493
|
-
<dc:Bounds x="
|
|
575
|
+
<dc:Bounds x="2216" y="116" width="74" height="14" />
|
|
494
576
|
</bpmndi:BPMNLabel>
|
|
495
577
|
</bpmndi:BPMNShape>
|
|
496
578
|
<bpmndi:BPMNShape id="BPMNShape_persist-task-escalation" bpmnElement="persist-task-escalation">
|
|
497
|
-
<dc:Bounds x="
|
|
579
|
+
<dc:Bounds x="2378" y="280" width="100" height="80" />
|
|
498
580
|
</bpmndi:BPMNShape>
|
|
499
581
|
<bpmndi:BPMNShape id="BPMNShape_wait-feature-answer" bpmnElement="wait-feature-answer">
|
|
500
|
-
<dc:Bounds x="
|
|
582
|
+
<dc:Bounds x="2578" y="302" width="36" height="36" />
|
|
501
583
|
<bpmndi:BPMNLabel>
|
|
502
|
-
<dc:Bounds x="
|
|
584
|
+
<dc:Bounds x="2554" y="269" width="85" height="28" />
|
|
503
585
|
</bpmndi:BPMNLabel>
|
|
504
586
|
</bpmndi:BPMNShape>
|
|
505
587
|
<bpmndi:BPMNShape id="BPMNShape_w_end" bpmnElement="w_end">
|
|
506
|
-
<dc:Bounds x="
|
|
588
|
+
<dc:Bounds x="2410" y="142" width="36" height="36" />
|
|
507
589
|
<bpmndi:BPMNLabel>
|
|
508
|
-
<dc:Bounds x="
|
|
590
|
+
<dc:Bounds x="2395" y="183" width="66" height="14" />
|
|
509
591
|
</bpmndi:BPMNLabel>
|
|
510
592
|
</bpmndi:BPMNShape>
|
|
511
593
|
<bpmndi:BPMNEdge id="BPMNEdge_w_toImpl" bpmnElement="w_toImpl">
|
|
512
|
-
<di:waypoint x="
|
|
513
|
-
<di:waypoint x="
|
|
594
|
+
<di:waypoint x="1928" y="160" />
|
|
595
|
+
<di:waypoint x="2028" y="160" />
|
|
514
596
|
</bpmndi:BPMNEdge>
|
|
515
597
|
<bpmndi:BPMNEdge id="BPMNEdge_w_toGw" bpmnElement="w_toGw">
|
|
516
|
-
<di:waypoint x="
|
|
517
|
-
<di:waypoint x="
|
|
598
|
+
<di:waypoint x="2128" y="160" />
|
|
599
|
+
<di:waypoint x="2228" y="160" />
|
|
518
600
|
</bpmndi:BPMNEdge>
|
|
519
601
|
<bpmndi:BPMNEdge id="BPMNEdge_w_done" bpmnElement="w_done">
|
|
520
|
-
<di:waypoint x="
|
|
521
|
-
<di:waypoint x="
|
|
602
|
+
<di:waypoint x="2278" y="160" />
|
|
603
|
+
<di:waypoint x="2410" y="160" />
|
|
522
604
|
<bpmndi:BPMNLabel>
|
|
523
|
-
<dc:Bounds x="
|
|
605
|
+
<dc:Bounds x="2328" y="138" width="32" height="14" />
|
|
524
606
|
</bpmndi:BPMNLabel>
|
|
525
607
|
</bpmndi:BPMNEdge>
|
|
526
608
|
<bpmndi:BPMNEdge id="BPMNEdge_w_escalate" bpmnElement="w_escalate">
|
|
527
|
-
<di:waypoint x="
|
|
528
|
-
<di:waypoint x="
|
|
529
|
-
<di:waypoint x="
|
|
609
|
+
<di:waypoint x="2253" y="185" />
|
|
610
|
+
<di:waypoint x="2253" y="320" />
|
|
611
|
+
<di:waypoint x="2378" y="320" />
|
|
530
612
|
<bpmndi:BPMNLabel>
|
|
531
|
-
<dc:Bounds x="
|
|
613
|
+
<dc:Bounds x="2258" y="246" width="67" height="14" />
|
|
532
614
|
</bpmndi:BPMNLabel>
|
|
533
615
|
</bpmndi:BPMNEdge>
|
|
534
616
|
<bpmndi:BPMNEdge id="BPMNEdge_w_toWait" bpmnElement="w_toWait">
|
|
535
|
-
<di:waypoint x="
|
|
536
|
-
<di:waypoint x="
|
|
617
|
+
<di:waypoint x="2478" y="320" />
|
|
618
|
+
<di:waypoint x="2578" y="320" />
|
|
537
619
|
</bpmndi:BPMNEdge>
|
|
538
620
|
<bpmndi:BPMNEdge id="BPMNEdge_w_answerLoop" bpmnElement="w_answerLoop">
|
|
539
|
-
<di:waypoint x="
|
|
540
|
-
<di:waypoint x="
|
|
541
|
-
<di:waypoint x="
|
|
542
|
-
<di:waypoint x="
|
|
621
|
+
<di:waypoint x="2596" y="338" />
|
|
622
|
+
<di:waypoint x="2596" y="380" />
|
|
623
|
+
<di:waypoint x="2078" y="380" />
|
|
624
|
+
<di:waypoint x="2078" y="200" />
|
|
543
625
|
</bpmndi:BPMNEdge>
|
|
544
626
|
</bpmndi:BPMNPlane>
|
|
545
627
|
</bpmndi:BPMNDiagram>
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { test } from "node:test";
|
|
2
|
+
import { assertEquals, assertRejects } from "#test-assert";
|
|
3
|
+
import { noopLog } from "../../test/log.ts";
|
|
4
|
+
import handler from "./worker.ts";
|
|
5
|
+
|
|
6
|
+
function fakeApp(escalations: any[] = []) {
|
|
7
|
+
const plans = [{ plan_key: "owner/repo#12", status: "dispatched" }];
|
|
8
|
+
const match = (r: Record<string, unknown>, q: Record<string, unknown>) =>
|
|
9
|
+
Object.entries(q).every(([f, v]) => r[f] === v);
|
|
10
|
+
const table = (rows: any[], key: string) => ({
|
|
11
|
+
find: (q: any) => Promise.resolve(rows.filter((r) => match(r, q))),
|
|
12
|
+
insert: (row: any) => {
|
|
13
|
+
row.id = row.id ?? rows.length + 1;
|
|
14
|
+
rows.push(row);
|
|
15
|
+
return Promise.resolve(row.id);
|
|
16
|
+
},
|
|
17
|
+
update: (id: any, patch: any) => {
|
|
18
|
+
const row = rows.find((r) => r[key] === id);
|
|
19
|
+
if (row) Object.assign(row, patch);
|
|
20
|
+
return Promise.resolve(row);
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
return {
|
|
24
|
+
data: {
|
|
25
|
+
table(name: string) {
|
|
26
|
+
return name === "plans" ? table(plans, "plan_key") : table(escalations, "id");
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
log: noopLog(),
|
|
30
|
+
_plans: plans,
|
|
31
|
+
_escalations: escalations,
|
|
32
|
+
} as any;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
test("records an open plan-review escalation and surfaces it on the plan", async () => {
|
|
36
|
+
const app = fakeApp();
|
|
37
|
+
const out = await handler({
|
|
38
|
+
variables: {
|
|
39
|
+
planKey: "owner/repo#12",
|
|
40
|
+
planReviewEpoch: 1,
|
|
41
|
+
planReviewRound: 2,
|
|
42
|
+
planFindings: "needs a seam",
|
|
43
|
+
},
|
|
44
|
+
jobKey: "j1",
|
|
45
|
+
} as any, app as any);
|
|
46
|
+
|
|
47
|
+
assertEquals(out.planEscalationId, 1);
|
|
48
|
+
assertEquals(app._escalations[0].plan_key, "owner/repo#12");
|
|
49
|
+
assertEquals(app._escalations[0].epoch, 1);
|
|
50
|
+
assertEquals(app._escalations[0].round, 2);
|
|
51
|
+
assertEquals(app._escalations[0].findings, "needs a seam");
|
|
52
|
+
assertEquals(app._plans[0].open_plan_escalation_id, 1);
|
|
53
|
+
assertEquals(app._plans[0].open_plan_findings, "needs a seam");
|
|
54
|
+
assertEquals(app._plans[0].status, "planning");
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
test("missing planKey fails loudly instead of parking an unanswerable escalation", async () => {
|
|
58
|
+
const app = fakeApp();
|
|
59
|
+
await assertRejects(
|
|
60
|
+
() => handler({
|
|
61
|
+
variables: { planKey: " ", planFindings: "needs a seam" },
|
|
62
|
+
jobKey: "j-missing",
|
|
63
|
+
} as any, app as any),
|
|
64
|
+
Error,
|
|
65
|
+
"persist-plan-escalation: missing planKey in process scope",
|
|
66
|
+
);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
test("non-string planKey is treated as missing rather than coerced to a bogus key", async () => {
|
|
70
|
+
const app = fakeApp();
|
|
71
|
+
await assertRejects(
|
|
72
|
+
() => handler({
|
|
73
|
+
variables: { planKey: 123, planFindings: "needs a seam" },
|
|
74
|
+
jobKey: "j-nonstring",
|
|
75
|
+
} as any, app as any),
|
|
76
|
+
Error,
|
|
77
|
+
"persist-plan-escalation: missing planKey in process scope",
|
|
78
|
+
);
|
|
79
|
+
assertEquals(app._escalations.length, 0);
|
|
80
|
+
});
|