@atolis-hq/wake 0.4.80 → 0.4.81
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/dist/src/activities/contracts/event-schema.d.ts +30 -8
- package/dist/src/activities/contracts/event-schema.js +1 -0
- package/dist/src/activities/pr/activity-support.js +1 -0
- package/dist/src/activities/pr/policy.js +1 -1
- package/dist/src/activities/pr/vocabulary.d.ts +1 -0
- package/dist/src/activities/pr/vocabulary.js +1 -0
- package/dist/src/bootstrap/config/root-schema.d.ts +10 -0
- package/dist/src/bootstrap/integration-runtime.js +7 -1
- package/dist/src/bootstrap/version.js +1 -1
- package/dist/src/control-plane/application/activation-scheduler.js +3 -0
- package/dist/src/integrations/delivery/application/delivery-service.js +14 -3
- package/dist/src/integrations/delivery/application/merged-delivery-evidence.d.ts +12 -0
- package/dist/src/integrations/delivery/application/merged-delivery-evidence.js +67 -0
- package/dist/src/integrations/fake/durable-delivery-provider.d.ts +7 -0
- package/dist/src/integrations/fake/durable-delivery-provider.js +9 -0
- package/dist/src/integrations/github/infrastructure/delivery.d.ts +1 -1
- package/dist/src/integrations/github/infrastructure/delivery.js +26 -1
- package/dist/src/integrations/github/provider.js +12 -0
- package/dist/src/integrations/index.d.ts +1 -0
- package/dist/src/integrations/index.js +1 -0
- package/dist/src/orchestration/contracts/config.d.ts +15 -0
- package/dist/src/orchestration/contracts/config.js +15 -2
- package/dist/src/orchestration/contracts/event-decoder.d.ts +1 -0
- package/dist/src/orchestration/contracts/event-decoder.js +1 -0
- package/dist/src/orchestration/contracts/events.d.ts +1 -0
- package/dist/src/orchestration/contracts/views.d.ts +1 -0
- package/dist/src/orchestration/domain/retry-policy.js +17 -4
- package/dist/src/orchestration/domain/workflow-instance-events.js +1 -0
- package/package.json +1 -1
|
@@ -45,6 +45,7 @@ export declare const deniedOutcomeSchema: z.ZodObject<{
|
|
|
45
45
|
"correlation-conflict": "correlation-conflict";
|
|
46
46
|
"stale-approval": "stale-approval";
|
|
47
47
|
"checks-pending": "checks-pending";
|
|
48
|
+
"checks-could-not-be-read": "checks-could-not-be-read";
|
|
48
49
|
"checks-failing": "checks-failing";
|
|
49
50
|
"untrusted-actor": "untrusted-actor";
|
|
50
51
|
"too-many-files-changed": "too-many-files-changed";
|
|
@@ -348,6 +349,7 @@ export declare function createResourceFactDraftSchemas(eventTypes: ActivityEvent
|
|
|
348
349
|
"correlation-conflict": "correlation-conflict";
|
|
349
350
|
"stale-approval": "stale-approval";
|
|
350
351
|
"checks-pending": "checks-pending";
|
|
352
|
+
"checks-could-not-be-read": "checks-could-not-be-read";
|
|
351
353
|
"checks-failing": "checks-failing";
|
|
352
354
|
"untrusted-actor": "untrusted-actor";
|
|
353
355
|
"too-many-files-changed": "too-many-files-changed";
|
|
@@ -483,6 +485,7 @@ export declare function createDenialDraftSchemas(eventTypes: ActivityEventTypes)
|
|
|
483
485
|
"correlation-conflict": "correlation-conflict";
|
|
484
486
|
"stale-approval": "stale-approval";
|
|
485
487
|
"checks-pending": "checks-pending";
|
|
488
|
+
"checks-could-not-be-read": "checks-could-not-be-read";
|
|
486
489
|
"checks-failing": "checks-failing";
|
|
487
490
|
"untrusted-actor": "untrusted-actor";
|
|
488
491
|
"too-many-files-changed": "too-many-files-changed";
|
|
@@ -538,6 +541,7 @@ export declare function createDenialDraftSchemas(eventTypes: ActivityEventTypes)
|
|
|
538
541
|
"correlation-conflict": "correlation-conflict";
|
|
539
542
|
"stale-approval": "stale-approval";
|
|
540
543
|
"checks-pending": "checks-pending";
|
|
544
|
+
"checks-could-not-be-read": "checks-could-not-be-read";
|
|
541
545
|
"checks-failing": "checks-failing";
|
|
542
546
|
"untrusted-actor": "untrusted-actor";
|
|
543
547
|
"too-many-files-changed": "too-many-files-changed";
|
|
@@ -853,6 +857,7 @@ export declare function createActivityEventSchemas(eventTypes: ActivityEventType
|
|
|
853
857
|
"correlation-conflict": "correlation-conflict";
|
|
854
858
|
"stale-approval": "stale-approval";
|
|
855
859
|
"checks-pending": "checks-pending";
|
|
860
|
+
"checks-could-not-be-read": "checks-could-not-be-read";
|
|
856
861
|
"checks-failing": "checks-failing";
|
|
857
862
|
"untrusted-actor": "untrusted-actor";
|
|
858
863
|
"too-many-files-changed": "too-many-files-changed";
|
|
@@ -996,6 +1001,7 @@ export declare function createActivityEventSchemas(eventTypes: ActivityEventType
|
|
|
996
1001
|
"correlation-conflict": "correlation-conflict";
|
|
997
1002
|
"stale-approval": "stale-approval";
|
|
998
1003
|
"checks-pending": "checks-pending";
|
|
1004
|
+
"checks-could-not-be-read": "checks-could-not-be-read";
|
|
999
1005
|
"checks-failing": "checks-failing";
|
|
1000
1006
|
"untrusted-actor": "untrusted-actor";
|
|
1001
1007
|
"too-many-files-changed": "too-many-files-changed";
|
|
@@ -1051,6 +1057,7 @@ export declare function createActivityEventSchemas(eventTypes: ActivityEventType
|
|
|
1051
1057
|
"correlation-conflict": "correlation-conflict";
|
|
1052
1058
|
"stale-approval": "stale-approval";
|
|
1053
1059
|
"checks-pending": "checks-pending";
|
|
1060
|
+
"checks-could-not-be-read": "checks-could-not-be-read";
|
|
1054
1061
|
"checks-failing": "checks-failing";
|
|
1055
1062
|
"untrusted-actor": "untrusted-actor";
|
|
1056
1063
|
"too-many-files-changed": "too-many-files-changed";
|
|
@@ -1169,6 +1176,7 @@ export declare function createActivityEventSchemas(eventTypes: ActivityEventType
|
|
|
1169
1176
|
"correlation-conflict": "correlation-conflict";
|
|
1170
1177
|
"stale-approval": "stale-approval";
|
|
1171
1178
|
"checks-pending": "checks-pending";
|
|
1179
|
+
"checks-could-not-be-read": "checks-could-not-be-read";
|
|
1172
1180
|
"checks-failing": "checks-failing";
|
|
1173
1181
|
"untrusted-actor": "untrusted-actor";
|
|
1174
1182
|
"too-many-files-changed": "too-many-files-changed";
|
|
@@ -1218,6 +1226,7 @@ export declare function createActivityEventSchemas(eventTypes: ActivityEventType
|
|
|
1218
1226
|
"correlation-conflict": "correlation-conflict";
|
|
1219
1227
|
"stale-approval": "stale-approval";
|
|
1220
1228
|
"checks-pending": "checks-pending";
|
|
1229
|
+
"checks-could-not-be-read": "checks-could-not-be-read";
|
|
1221
1230
|
"checks-failing": "checks-failing";
|
|
1222
1231
|
"untrusted-actor": "untrusted-actor";
|
|
1223
1232
|
"too-many-files-changed": "too-many-files-changed";
|
|
@@ -1381,6 +1390,7 @@ export declare function createActivityEventSchemas(eventTypes: ActivityEventType
|
|
|
1381
1390
|
"correlation-conflict": "correlation-conflict";
|
|
1382
1391
|
"stale-approval": "stale-approval";
|
|
1383
1392
|
"checks-pending": "checks-pending";
|
|
1393
|
+
"checks-could-not-be-read": "checks-could-not-be-read";
|
|
1384
1394
|
"checks-failing": "checks-failing";
|
|
1385
1395
|
"untrusted-actor": "untrusted-actor";
|
|
1386
1396
|
"too-many-files-changed": "too-many-files-changed";
|
|
@@ -1430,6 +1440,7 @@ export declare function createActivityEventSchemas(eventTypes: ActivityEventType
|
|
|
1430
1440
|
"correlation-conflict": "correlation-conflict";
|
|
1431
1441
|
"stale-approval": "stale-approval";
|
|
1432
1442
|
"checks-pending": "checks-pending";
|
|
1443
|
+
"checks-could-not-be-read": "checks-could-not-be-read";
|
|
1433
1444
|
"checks-failing": "checks-failing";
|
|
1434
1445
|
"untrusted-actor": "untrusted-actor";
|
|
1435
1446
|
"too-many-files-changed": "too-many-files-changed";
|
|
@@ -1473,7 +1484,7 @@ export declare function createActivityEventSchemas(eventTypes: ActivityEventType
|
|
|
1473
1484
|
payload: {
|
|
1474
1485
|
activationId: import("./identifiers.js").ActivationId;
|
|
1475
1486
|
idempotencyKey: string;
|
|
1476
|
-
reason: "closed" | "missing-resource" | "ambiguous-resource" | "correlation-conflict" | "stale-approval" | "checks-pending" | "checks-failing" | "untrusted-actor" | "too-many-files-changed" | "blocked-path-changed" | "changed-files-unavailable";
|
|
1487
|
+
reason: "closed" | "missing-resource" | "ambiguous-resource" | "correlation-conflict" | "stale-approval" | "checks-pending" | "checks-could-not-be-read" | "checks-failing" | "untrusted-actor" | "too-many-files-changed" | "blocked-path-changed" | "changed-files-unavailable";
|
|
1477
1488
|
target?: "primary" | {
|
|
1478
1489
|
resourceId: import("../../resources/index.js").ResourceId;
|
|
1479
1490
|
} | undefined;
|
|
@@ -1500,7 +1511,7 @@ export declare function createActivityEventSchemas(eventTypes: ActivityEventType
|
|
|
1500
1511
|
outcome: {
|
|
1501
1512
|
kind: "blocked";
|
|
1502
1513
|
data: {
|
|
1503
|
-
reason: "closed" | "missing-resource" | "ambiguous-resource" | "correlation-conflict" | "stale-approval" | "checks-pending" | "checks-failing" | "untrusted-actor" | "too-many-files-changed" | "blocked-path-changed" | "changed-files-unavailable";
|
|
1514
|
+
reason: "closed" | "missing-resource" | "ambiguous-resource" | "correlation-conflict" | "stale-approval" | "checks-pending" | "checks-could-not-be-read" | "checks-failing" | "untrusted-actor" | "too-many-files-changed" | "blocked-path-changed" | "changed-files-unavailable";
|
|
1504
1515
|
resourceId?: string | undefined;
|
|
1505
1516
|
revision?: string | undefined;
|
|
1506
1517
|
policy?: {
|
|
@@ -1518,7 +1529,7 @@ export declare function createActivityEventSchemas(eventTypes: ActivityEventType
|
|
|
1518
1529
|
outcome: {
|
|
1519
1530
|
kind: "blocked";
|
|
1520
1531
|
data: {
|
|
1521
|
-
reason: "closed" | "missing-resource" | "ambiguous-resource" | "correlation-conflict" | "stale-approval" | "checks-pending" | "checks-failing" | "untrusted-actor" | "too-many-files-changed" | "blocked-path-changed" | "changed-files-unavailable";
|
|
1532
|
+
reason: "closed" | "missing-resource" | "ambiguous-resource" | "correlation-conflict" | "stale-approval" | "checks-pending" | "checks-could-not-be-read" | "checks-failing" | "untrusted-actor" | "too-many-files-changed" | "blocked-path-changed" | "changed-files-unavailable";
|
|
1522
1533
|
resourceId?: string | undefined;
|
|
1523
1534
|
revision?: string | undefined;
|
|
1524
1535
|
policy?: {
|
|
@@ -1547,7 +1558,7 @@ export declare function createActivityEventSchemas(eventTypes: ActivityEventType
|
|
|
1547
1558
|
payload: {
|
|
1548
1559
|
activationId: import("./identifiers.js").ActivationId;
|
|
1549
1560
|
idempotencyKey: string;
|
|
1550
|
-
reason: "closed" | "missing-resource" | "ambiguous-resource" | "correlation-conflict" | "stale-approval" | "checks-pending" | "checks-failing" | "untrusted-actor" | "too-many-files-changed" | "blocked-path-changed" | "changed-files-unavailable";
|
|
1561
|
+
reason: "closed" | "missing-resource" | "ambiguous-resource" | "correlation-conflict" | "stale-approval" | "checks-pending" | "checks-could-not-be-read" | "checks-failing" | "untrusted-actor" | "too-many-files-changed" | "blocked-path-changed" | "changed-files-unavailable";
|
|
1551
1562
|
target?: "primary" | {
|
|
1552
1563
|
resourceId: import("../../resources/index.js").ResourceId;
|
|
1553
1564
|
} | undefined;
|
|
@@ -1668,6 +1679,7 @@ export declare function createActivityEventSchemas(eventTypes: ActivityEventType
|
|
|
1668
1679
|
"correlation-conflict": "correlation-conflict";
|
|
1669
1680
|
"stale-approval": "stale-approval";
|
|
1670
1681
|
"checks-pending": "checks-pending";
|
|
1682
|
+
"checks-could-not-be-read": "checks-could-not-be-read";
|
|
1671
1683
|
"checks-failing": "checks-failing";
|
|
1672
1684
|
"untrusted-actor": "untrusted-actor";
|
|
1673
1685
|
"too-many-files-changed": "too-many-files-changed";
|
|
@@ -1717,6 +1729,7 @@ export declare function createActivityEventSchemas(eventTypes: ActivityEventType
|
|
|
1717
1729
|
"correlation-conflict": "correlation-conflict";
|
|
1718
1730
|
"stale-approval": "stale-approval";
|
|
1719
1731
|
"checks-pending": "checks-pending";
|
|
1732
|
+
"checks-could-not-be-read": "checks-could-not-be-read";
|
|
1720
1733
|
"checks-failing": "checks-failing";
|
|
1721
1734
|
"untrusted-actor": "untrusted-actor";
|
|
1722
1735
|
"too-many-files-changed": "too-many-files-changed";
|
|
@@ -1890,6 +1903,7 @@ export declare function createActivityEventSchemas(eventTypes: ActivityEventType
|
|
|
1890
1903
|
"correlation-conflict": "correlation-conflict";
|
|
1891
1904
|
"stale-approval": "stale-approval";
|
|
1892
1905
|
"checks-pending": "checks-pending";
|
|
1906
|
+
"checks-could-not-be-read": "checks-could-not-be-read";
|
|
1893
1907
|
"checks-failing": "checks-failing";
|
|
1894
1908
|
"untrusted-actor": "untrusted-actor";
|
|
1895
1909
|
"too-many-files-changed": "too-many-files-changed";
|
|
@@ -1939,6 +1953,7 @@ export declare function createActivityEventSchemas(eventTypes: ActivityEventType
|
|
|
1939
1953
|
"correlation-conflict": "correlation-conflict";
|
|
1940
1954
|
"stale-approval": "stale-approval";
|
|
1941
1955
|
"checks-pending": "checks-pending";
|
|
1956
|
+
"checks-could-not-be-read": "checks-could-not-be-read";
|
|
1942
1957
|
"checks-failing": "checks-failing";
|
|
1943
1958
|
"untrusted-actor": "untrusted-actor";
|
|
1944
1959
|
"too-many-files-changed": "too-many-files-changed";
|
|
@@ -1982,7 +1997,7 @@ export declare function createActivityEventSchemas(eventTypes: ActivityEventType
|
|
|
1982
1997
|
payload: {
|
|
1983
1998
|
activationId: import("./identifiers.js").ActivationId;
|
|
1984
1999
|
idempotencyKey: string;
|
|
1985
|
-
reason: "closed" | "missing-resource" | "ambiguous-resource" | "correlation-conflict" | "stale-approval" | "checks-pending" | "checks-failing" | "untrusted-actor" | "too-many-files-changed" | "blocked-path-changed" | "changed-files-unavailable";
|
|
2000
|
+
reason: "closed" | "missing-resource" | "ambiguous-resource" | "correlation-conflict" | "stale-approval" | "checks-pending" | "checks-could-not-be-read" | "checks-failing" | "untrusted-actor" | "too-many-files-changed" | "blocked-path-changed" | "changed-files-unavailable";
|
|
1986
2001
|
target?: "primary" | {
|
|
1987
2002
|
resourceId: import("../../resources/index.js").ResourceId;
|
|
1988
2003
|
} | undefined;
|
|
@@ -2009,7 +2024,7 @@ export declare function createActivityEventSchemas(eventTypes: ActivityEventType
|
|
|
2009
2024
|
outcome: {
|
|
2010
2025
|
kind: "blocked";
|
|
2011
2026
|
data: {
|
|
2012
|
-
reason: "closed" | "missing-resource" | "ambiguous-resource" | "correlation-conflict" | "stale-approval" | "checks-pending" | "checks-failing" | "untrusted-actor" | "too-many-files-changed" | "blocked-path-changed" | "changed-files-unavailable";
|
|
2027
|
+
reason: "closed" | "missing-resource" | "ambiguous-resource" | "correlation-conflict" | "stale-approval" | "checks-pending" | "checks-could-not-be-read" | "checks-failing" | "untrusted-actor" | "too-many-files-changed" | "blocked-path-changed" | "changed-files-unavailable";
|
|
2013
2028
|
resourceId?: string | undefined;
|
|
2014
2029
|
revision?: string | undefined;
|
|
2015
2030
|
policy?: {
|
|
@@ -2027,7 +2042,7 @@ export declare function createActivityEventSchemas(eventTypes: ActivityEventType
|
|
|
2027
2042
|
outcome: {
|
|
2028
2043
|
kind: "blocked";
|
|
2029
2044
|
data: {
|
|
2030
|
-
reason: "closed" | "missing-resource" | "ambiguous-resource" | "correlation-conflict" | "stale-approval" | "checks-pending" | "checks-failing" | "untrusted-actor" | "too-many-files-changed" | "blocked-path-changed" | "changed-files-unavailable";
|
|
2045
|
+
reason: "closed" | "missing-resource" | "ambiguous-resource" | "correlation-conflict" | "stale-approval" | "checks-pending" | "checks-could-not-be-read" | "checks-failing" | "untrusted-actor" | "too-many-files-changed" | "blocked-path-changed" | "changed-files-unavailable";
|
|
2031
2046
|
resourceId?: string | undefined;
|
|
2032
2047
|
revision?: string | undefined;
|
|
2033
2048
|
policy?: {
|
|
@@ -2056,7 +2071,7 @@ export declare function createActivityEventSchemas(eventTypes: ActivityEventType
|
|
|
2056
2071
|
payload: {
|
|
2057
2072
|
activationId: import("./identifiers.js").ActivationId;
|
|
2058
2073
|
idempotencyKey: string;
|
|
2059
|
-
reason: "closed" | "missing-resource" | "ambiguous-resource" | "correlation-conflict" | "stale-approval" | "checks-pending" | "checks-failing" | "untrusted-actor" | "too-many-files-changed" | "blocked-path-changed" | "changed-files-unavailable";
|
|
2074
|
+
reason: "closed" | "missing-resource" | "ambiguous-resource" | "correlation-conflict" | "stale-approval" | "checks-pending" | "checks-could-not-be-read" | "checks-failing" | "untrusted-actor" | "too-many-files-changed" | "blocked-path-changed" | "changed-files-unavailable";
|
|
2060
2075
|
target?: "primary" | {
|
|
2061
2076
|
resourceId: import("../../resources/index.js").ResourceId;
|
|
2062
2077
|
} | undefined;
|
|
@@ -2371,6 +2386,7 @@ export declare function createActivityEventSchemas(eventTypes: ActivityEventType
|
|
|
2371
2386
|
"correlation-conflict": "correlation-conflict";
|
|
2372
2387
|
"stale-approval": "stale-approval";
|
|
2373
2388
|
"checks-pending": "checks-pending";
|
|
2389
|
+
"checks-could-not-be-read": "checks-could-not-be-read";
|
|
2374
2390
|
"checks-failing": "checks-failing";
|
|
2375
2391
|
"untrusted-actor": "untrusted-actor";
|
|
2376
2392
|
"too-many-files-changed": "too-many-files-changed";
|
|
@@ -2505,6 +2521,7 @@ export declare function createActivityEventSchemas(eventTypes: ActivityEventType
|
|
|
2505
2521
|
"correlation-conflict": "correlation-conflict";
|
|
2506
2522
|
"stale-approval": "stale-approval";
|
|
2507
2523
|
"checks-pending": "checks-pending";
|
|
2524
|
+
"checks-could-not-be-read": "checks-could-not-be-read";
|
|
2508
2525
|
"checks-failing": "checks-failing";
|
|
2509
2526
|
"untrusted-actor": "untrusted-actor";
|
|
2510
2527
|
"too-many-files-changed": "too-many-files-changed";
|
|
@@ -2560,6 +2577,7 @@ export declare function createActivityEventSchemas(eventTypes: ActivityEventType
|
|
|
2560
2577
|
"correlation-conflict": "correlation-conflict";
|
|
2561
2578
|
"stale-approval": "stale-approval";
|
|
2562
2579
|
"checks-pending": "checks-pending";
|
|
2580
|
+
"checks-could-not-be-read": "checks-could-not-be-read";
|
|
2563
2581
|
"checks-failing": "checks-failing";
|
|
2564
2582
|
"untrusted-actor": "untrusted-actor";
|
|
2565
2583
|
"too-many-files-changed": "too-many-files-changed";
|
|
@@ -2666,6 +2684,7 @@ export declare function createActivityEventSchemas(eventTypes: ActivityEventType
|
|
|
2666
2684
|
"correlation-conflict": "correlation-conflict";
|
|
2667
2685
|
"stale-approval": "stale-approval";
|
|
2668
2686
|
"checks-pending": "checks-pending";
|
|
2687
|
+
"checks-could-not-be-read": "checks-could-not-be-read";
|
|
2669
2688
|
"checks-failing": "checks-failing";
|
|
2670
2689
|
"untrusted-actor": "untrusted-actor";
|
|
2671
2690
|
"too-many-files-changed": "too-many-files-changed";
|
|
@@ -2715,6 +2734,7 @@ export declare function createActivityEventSchemas(eventTypes: ActivityEventType
|
|
|
2715
2734
|
"correlation-conflict": "correlation-conflict";
|
|
2716
2735
|
"stale-approval": "stale-approval";
|
|
2717
2736
|
"checks-pending": "checks-pending";
|
|
2737
|
+
"checks-could-not-be-read": "checks-could-not-be-read";
|
|
2718
2738
|
"checks-failing": "checks-failing";
|
|
2719
2739
|
"untrusted-actor": "untrusted-actor";
|
|
2720
2740
|
"too-many-files-changed": "too-many-files-changed";
|
|
@@ -2836,6 +2856,7 @@ export declare function createActivityEventSchemas(eventTypes: ActivityEventType
|
|
|
2836
2856
|
"correlation-conflict": "correlation-conflict";
|
|
2837
2857
|
"stale-approval": "stale-approval";
|
|
2838
2858
|
"checks-pending": "checks-pending";
|
|
2859
|
+
"checks-could-not-be-read": "checks-could-not-be-read";
|
|
2839
2860
|
"checks-failing": "checks-failing";
|
|
2840
2861
|
"untrusted-actor": "untrusted-actor";
|
|
2841
2862
|
"too-many-files-changed": "too-many-files-changed";
|
|
@@ -2885,6 +2906,7 @@ export declare function createActivityEventSchemas(eventTypes: ActivityEventType
|
|
|
2885
2906
|
"correlation-conflict": "correlation-conflict";
|
|
2886
2907
|
"stale-approval": "stale-approval";
|
|
2887
2908
|
"checks-pending": "checks-pending";
|
|
2909
|
+
"checks-could-not-be-read": "checks-could-not-be-read";
|
|
2888
2910
|
"checks-failing": "checks-failing";
|
|
2889
2911
|
"untrusted-actor": "untrusted-actor";
|
|
2890
2912
|
"too-many-files-changed": "too-many-files-changed";
|
|
@@ -53,6 +53,7 @@ const denialCodeSchema = z.enum([
|
|
|
53
53
|
PullRequestDenialCode.Closed,
|
|
54
54
|
PullRequestDenialCode.StaleApproval,
|
|
55
55
|
PullRequestDenialCode.ChecksPending,
|
|
56
|
+
PullRequestDenialCode.ChecksUnavailable,
|
|
56
57
|
PullRequestDenialCode.ChecksFailing,
|
|
57
58
|
PullRequestDenialCode.UntrustedActor,
|
|
58
59
|
PullRequestDenialCode.TooManyFilesChanged,
|
|
@@ -40,6 +40,7 @@ export const pullRequestOutcomeSchema = z.union([
|
|
|
40
40
|
PullRequestDenialCode.Closed,
|
|
41
41
|
PullRequestDenialCode.StaleApproval,
|
|
42
42
|
PullRequestDenialCode.ChecksPending,
|
|
43
|
+
PullRequestDenialCode.ChecksUnavailable,
|
|
43
44
|
PullRequestDenialCode.ChecksFailing,
|
|
44
45
|
PullRequestDenialCode.UntrustedActor,
|
|
45
46
|
PullRequestDenialCode.TooManyFilesChanged,
|
|
@@ -139,7 +139,7 @@ function changedFilesAuthority(pullRequest, resource, policy) {
|
|
|
139
139
|
}
|
|
140
140
|
function checkAuthority(pullRequest, allowPendingChecks) {
|
|
141
141
|
if (pullRequest.checks === PullRequestCheckState.Unknown)
|
|
142
|
-
return denied(PullRequestDenialCode.
|
|
142
|
+
return denied(PullRequestDenialCode.ChecksUnavailable);
|
|
143
143
|
if (pullRequest.checks === PullRequestCheckState.Pending && !allowPendingChecks)
|
|
144
144
|
return denied(PullRequestDenialCode.ChecksPending);
|
|
145
145
|
return pullRequest.checks === PullRequestCheckState.Failing
|
|
@@ -31,6 +31,7 @@ export declare const PullRequestDenialCode: {
|
|
|
31
31
|
readonly Closed: "closed";
|
|
32
32
|
readonly StaleApproval: "stale-approval";
|
|
33
33
|
readonly ChecksPending: "checks-pending";
|
|
34
|
+
readonly ChecksUnavailable: "checks-could-not-be-read";
|
|
34
35
|
readonly ChecksFailing: "checks-failing";
|
|
35
36
|
readonly UntrustedActor: "untrusted-actor";
|
|
36
37
|
readonly TooManyFilesChanged: "too-many-files-changed";
|
|
@@ -27,6 +27,7 @@ export const PullRequestDenialCode = defineClosedVocabulary({
|
|
|
27
27
|
Closed: 'closed',
|
|
28
28
|
StaleApproval: 'stale-approval',
|
|
29
29
|
ChecksPending: 'checks-pending',
|
|
30
|
+
ChecksUnavailable: 'checks-could-not-be-read',
|
|
30
31
|
ChecksFailing: 'checks-failing',
|
|
31
32
|
UntrustedActor: 'untrusted-actor',
|
|
32
33
|
TooManyFilesChanged: 'too-many-files-changed',
|
|
@@ -63,6 +63,11 @@ declare const orchestrationConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
|
63
63
|
}, z.core.$strict>>;
|
|
64
64
|
retry: z.ZodOptional<z.ZodObject<{
|
|
65
65
|
max: z.ZodNumber;
|
|
66
|
+
reasons: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
67
|
+
"checks-pending": "checks-pending";
|
|
68
|
+
"checks-could-not-be-read": "checks-could-not-be-read";
|
|
69
|
+
}>>>;
|
|
70
|
+
delaysMs: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
66
71
|
}, z.core.$strict>>;
|
|
67
72
|
await: z.ZodOptional<z.ZodObject<{
|
|
68
73
|
signal: z.ZodString;
|
|
@@ -219,6 +224,11 @@ export declare const rootConfigSchema: z.ZodObject<{
|
|
|
219
224
|
}, z.core.$strict>>;
|
|
220
225
|
retry: z.ZodOptional<z.ZodObject<{
|
|
221
226
|
max: z.ZodNumber;
|
|
227
|
+
reasons: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
228
|
+
"checks-pending": "checks-pending";
|
|
229
|
+
"checks-could-not-be-read": "checks-could-not-be-read";
|
|
230
|
+
}>>>;
|
|
231
|
+
delaysMs: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
222
232
|
}, z.core.$strict>>;
|
|
223
233
|
await: z.ZodOptional<z.ZodObject<{
|
|
224
234
|
signal: z.ZodString;
|
|
@@ -6,7 +6,7 @@ import { ActivityExecutionKind, activityName, } from '../activities/index.js';
|
|
|
6
6
|
import { ControlEventType, ControlStreamKind, TriggerService, createDurableRunnerIneligibility, createIntakePipeline, createRunnerPipeline, createTriggerReactor, createWorkCancellationPolicy, hasOpenWorkCapacity, readOpenWorkItemIds, selectControlEvent, triggerInvocationProjection, triggerInvocationStream, } from '../control-plane/index.js';
|
|
7
7
|
import { ConversationOriginKind, workItemIdForConversation } from '../conversations/index.js';
|
|
8
8
|
import { ExecutionStreamKind, NoEligibleRunnerError, RunRepository, createRuntimeMemoryProfile, decodeActivationExecutionEvent, isActiveRunStatus, isRunStream, runId, } from '../execution/index.js';
|
|
9
|
-
import { AgentRunPublicationReactor, ArtifactRegistrationReactor, DeliveryOutcomeReactor, DeliveryService, IntegrationStreamKind, PollService, ProviderRegistry, deliveryProjectionDefinitions, fakeProviderDefinition, publishConversationCommandFeedback, } from '../integrations/index.js';
|
|
9
|
+
import { AgentRunPublicationReactor, ArtifactRegistrationReactor, DeliveryOutcomeReactor, DeliveryService, IntegrationStreamKind, PollService, ProviderRegistry, deliveryProjectionDefinitions, fakeProviderDefinition, publishConversationCommandFeedback, reconcileMergedDeliveries, } from '../integrations/index.js';
|
|
10
10
|
import { compileWorkflowSelectors, createConversationCommandReactor, createPullRequestTransitionEvidence, createResourceTransitionReactor, createWatchReactor, createWatchReconciler, isWorkflowInstanceStream, selectWorkflow, workflowInstanceId, workflowName, } from '../orchestration/index.js';
|
|
11
11
|
import { BuiltInResourceCapability, resourceId, } from '../resources/index.js';
|
|
12
12
|
import { isWorkItemStream } from '../work/index.js';
|
|
@@ -273,6 +273,12 @@ export async function composeIntegrationRuntime(input) {
|
|
|
273
273
|
await recoverMergedWaits();
|
|
274
274
|
await watchReconciler.reconcileOnce();
|
|
275
275
|
await artifacts.reconcileOnce();
|
|
276
|
+
await reconcileMergedDeliveries({
|
|
277
|
+
journal: input.journal,
|
|
278
|
+
projections: input.projections,
|
|
279
|
+
orchestration: input.orchestration,
|
|
280
|
+
pullRequests: input.pullRequests,
|
|
281
|
+
});
|
|
276
282
|
await outcomes.reconcileOnce();
|
|
277
283
|
for (const provider of providers) {
|
|
278
284
|
await provider.reconciler?.reconcileOnce();
|
|
@@ -124,6 +124,6 @@ export function resolveWakeVersion(options = {}) {
|
|
|
124
124
|
return `g${headHash.slice(0, 7)}`;
|
|
125
125
|
return '0.1.0-dev';
|
|
126
126
|
}
|
|
127
|
-
export const wakeVersion = "v0.4.
|
|
127
|
+
export const wakeVersion = "v0.4.81";
|
|
128
128
|
/** The registry-installable version used by packaged sandbox images. */
|
|
129
129
|
export const wakePackageVersion = packageVersion(defaultRepoRoot) ?? wakeVersion;
|
|
@@ -91,6 +91,9 @@ export function createActivationScheduler(orchestration, execution, resources, c
|
|
|
91
91
|
}
|
|
92
92
|
const rawPending = await orchestration.listPendingActivations(options.workItemId);
|
|
93
93
|
const pending = (await Promise.all(rawPending.map(async (candidate) => {
|
|
94
|
+
if (candidate.activation.notBefore !== undefined &&
|
|
95
|
+
Date.parse(candidate.activation.notBefore) > clock.now().getTime())
|
|
96
|
+
return null;
|
|
94
97
|
const work = await dependencies.work?.get(candidate.workflow.workItemId);
|
|
95
98
|
return work?.frozen || work?.deleted ? null : candidate;
|
|
96
99
|
}))).filter((candidate) => candidate !== null);
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { EventActorKind, EventSourceKind, } from '@atolis-hq/eventing';
|
|
3
3
|
import { deliveryStream, IntegrationStreamKind } from '../../contracts/streams.js';
|
|
4
4
|
import { createDeliveryEventData, } from '../contracts/event-factory.js';
|
|
5
|
-
import { DeliveryEventType } from '../contracts/events.js';
|
|
6
|
-
import { DeliveryResultKind, DeliveryState } from '../contracts/vocabulary.js';
|
|
5
|
+
import { DeliveryEventType, selectDeliveryEvent } from '../contracts/events.js';
|
|
6
|
+
import { DeliveryIntentKind, DeliveryResultKind, DeliveryState } from '../contracts/vocabulary.js';
|
|
7
7
|
export class DeliveryService {
|
|
8
8
|
dependencies;
|
|
9
9
|
constructor(dependencies) {
|
|
@@ -92,7 +92,18 @@ export class DeliveryService {
|
|
|
92
92
|
}
|
|
93
93
|
async append(intent, draft) {
|
|
94
94
|
const stream = deliveryStream(intent.intentEventId);
|
|
95
|
-
const
|
|
95
|
+
const facts = await this.dependencies.journal.readStream(stream);
|
|
96
|
+
// A durable confirmation from merged evidence can win while provider I/O is in flight.
|
|
97
|
+
if (intent.kind === DeliveryIntentKind.PrMerge &&
|
|
98
|
+
facts.some((fact) => {
|
|
99
|
+
const delivery = selectDeliveryEvent(fact);
|
|
100
|
+
return (delivery?.event.eventType === DeliveryEventType.Confirmed ||
|
|
101
|
+
delivery?.event.eventType === DeliveryEventType.Failed ||
|
|
102
|
+
(delivery?.event.eventType === DeliveryEventType.Reconciled &&
|
|
103
|
+
delivery.event.payload.result === DeliveryResultKind.Confirmed));
|
|
104
|
+
}))
|
|
105
|
+
return;
|
|
106
|
+
const sequence = facts.length;
|
|
96
107
|
await this.dependencies.journal.appendToStream(stream, sequence, [
|
|
97
108
|
createDeliveryEventData(draft),
|
|
98
109
|
]);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type EventJournal, type ProjectionStore } from '@atolis-hq/eventing';
|
|
2
|
+
import { type PullRequestService } from '../../../activities/index.js';
|
|
3
|
+
import { type OrchestrationService } from '../../../orchestration/index.js';
|
|
4
|
+
import type { DeliveryIntentView } from '../contracts/views.js';
|
|
5
|
+
export declare function reconcileMergedDeliveries(input: {
|
|
6
|
+
readonly journal: EventJournal;
|
|
7
|
+
readonly projections: ProjectionStore;
|
|
8
|
+
readonly orchestration: Pick<OrchestrationService, 'get'>;
|
|
9
|
+
readonly pullRequests: PullRequestService;
|
|
10
|
+
}): Promise<void>;
|
|
11
|
+
/** Reconcile durable merged evidence only after the exact intent's wait exists. */
|
|
12
|
+
export declare function confirmMergedDelivery(intent: DeliveryIntentView, journal: EventJournal, orchestration: Pick<OrchestrationService, 'get'>, pullRequests: PullRequestService): Promise<void>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { EventActorKind, EventSourceKind, } from '@atolis-hq/eventing';
|
|
2
|
+
import { ActivityEventType, PullRequestState, selectPrimaryPullRequest, } from '../../../activities/index.js';
|
|
3
|
+
import { ActivityActivationStatus, workflowInstanceId, } from '../../../orchestration/index.js';
|
|
4
|
+
import { deliveryStream, IntegrationStreamKind } from '../../contracts/streams.js';
|
|
5
|
+
import { createDeliveryEventData } from '../contracts/event-factory.js';
|
|
6
|
+
import { DeliveryEventType, selectDeliveryEvent } from '../contracts/events.js';
|
|
7
|
+
import { DeliveryIntentKind, DeliveryResultKind, DeliveryState } from '../contracts/vocabulary.js';
|
|
8
|
+
export async function reconcileMergedDeliveries(input) {
|
|
9
|
+
for (const entry of await input.projections.list(IntegrationStreamKind.Delivery)) {
|
|
10
|
+
await confirmMergedDelivery(entry.value, input.journal, input.orchestration, input.pullRequests);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/** Reconcile durable merged evidence only after the exact intent's wait exists. */
|
|
14
|
+
export async function confirmMergedDelivery(intent, journal, orchestration, pullRequests) {
|
|
15
|
+
if (intent.payload.kind !== DeliveryIntentKind.PrMerge ||
|
|
16
|
+
!('revision' in intent.payload) ||
|
|
17
|
+
(intent.state !== DeliveryState.Pending && intent.state !== DeliveryState.Ambiguous))
|
|
18
|
+
return;
|
|
19
|
+
const instance = await orchestration.get(workflowInstanceId(intent.workflowInstanceId));
|
|
20
|
+
if (!isMatchingWait(instance, intent))
|
|
21
|
+
return;
|
|
22
|
+
const selected = selectPrimaryPullRequest(await pullRequests.authorityInput(instance.workItemId), instance.workItemId);
|
|
23
|
+
if (selected?.pullRequest.resourceId !== intent.resourceId ||
|
|
24
|
+
selected.pullRequest.state !== PullRequestState.Merged ||
|
|
25
|
+
selected.pullRequest.headRevision !== intent.payload.revision)
|
|
26
|
+
return;
|
|
27
|
+
const evidence = (await pullRequests.factsFor(intent.resourceId)).find((fact) => fact.event.eventType === ActivityEventType.PrStateChanged &&
|
|
28
|
+
fact.event.payload.state === PullRequestState.Merged);
|
|
29
|
+
if (evidence === undefined)
|
|
30
|
+
return;
|
|
31
|
+
const stream = deliveryStream(intent.intentEventId);
|
|
32
|
+
const facts = await journal.readStream(stream);
|
|
33
|
+
if (facts.some((fact) => {
|
|
34
|
+
const delivery = selectDeliveryEvent(fact);
|
|
35
|
+
return (delivery?.event.eventType === DeliveryEventType.Failed ||
|
|
36
|
+
delivery?.event.eventType === DeliveryEventType.Confirmed ||
|
|
37
|
+
(delivery?.event.eventType === DeliveryEventType.Reconciled &&
|
|
38
|
+
delivery.event.payload.result === DeliveryResultKind.Confirmed));
|
|
39
|
+
}))
|
|
40
|
+
return;
|
|
41
|
+
await journal.appendToStream(stream, facts.length, [
|
|
42
|
+
createDeliveryEventData({
|
|
43
|
+
eventId: `${intent.intentEventId}:merged-evidence`,
|
|
44
|
+
eventType: DeliveryEventType.Reconciled,
|
|
45
|
+
occurredAt: evidence.event.occurredAt,
|
|
46
|
+
correlationId: evidence.event.correlationId,
|
|
47
|
+
causationId: evidence.event.eventId,
|
|
48
|
+
actor: { kind: EventActorKind.System, id: 'delivery-outcome-reactor' },
|
|
49
|
+
source: { kind: EventSourceKind.Internal, id: IntegrationStreamKind.Delivery },
|
|
50
|
+
payload: {
|
|
51
|
+
intentEventId: intent.intentEventId,
|
|
52
|
+
intentGlobalPosition: intent.globalPosition,
|
|
53
|
+
workflowInstanceId: intent.workflowInstanceId,
|
|
54
|
+
activationId: intent.activationId,
|
|
55
|
+
occurrenceOrdinal: intent.occurrenceOrdinal + 1,
|
|
56
|
+
result: DeliveryResultKind.Confirmed,
|
|
57
|
+
externalId: selected.resource.resource.externalKey.key,
|
|
58
|
+
},
|
|
59
|
+
}),
|
|
60
|
+
]);
|
|
61
|
+
}
|
|
62
|
+
function isMatchingWait(instance, intent) {
|
|
63
|
+
return (instance?.pendingActivation?.activationId === intent.activationId &&
|
|
64
|
+
instance.pendingActivation.status === ActivityActivationStatus.Waiting &&
|
|
65
|
+
instance.waitingFor?.signalKind === 'delivery-result' &&
|
|
66
|
+
instance.waitingFor.intentEventId === intent.intentEventId);
|
|
67
|
+
}
|
|
@@ -7,12 +7,19 @@ export declare class DurableFakeDeliveryProvider implements ExternalDeliveryAdap
|
|
|
7
7
|
deliveryCalls: number;
|
|
8
8
|
private ambiguous;
|
|
9
9
|
private crashAfterEffect;
|
|
10
|
+
private deferEffect;
|
|
10
11
|
constructor(options?: DurableFakeDeliveryProviderOptions);
|
|
11
12
|
private readonly effectsFile;
|
|
12
13
|
crashAfterNextEffect(): void;
|
|
14
|
+
deferNextDelivery(): void;
|
|
13
15
|
deliver(intent: DeliveryIntentView): Promise<{
|
|
16
|
+
kind: "ambiguous";
|
|
17
|
+
reconciliationKey: EventId;
|
|
18
|
+
externalId?: never;
|
|
19
|
+
} | {
|
|
14
20
|
kind: "confirmed";
|
|
15
21
|
externalId: string;
|
|
22
|
+
reconciliationKey?: never;
|
|
16
23
|
}>;
|
|
17
24
|
rememberAmbiguous(intentEventId: EventId, reconciliationKey: string): void;
|
|
18
25
|
reconcile(_intent: DeliveryIntentView, reconciliationKey: string): Promise<{
|
|
@@ -5,6 +5,7 @@ export class DurableFakeDeliveryProvider {
|
|
|
5
5
|
deliveryCalls = 0;
|
|
6
6
|
ambiguous = new Map();
|
|
7
7
|
crashAfterEffect = false;
|
|
8
|
+
deferEffect = false;
|
|
8
9
|
constructor(options = {}) {
|
|
9
10
|
this.effects = new Map(Object.entries(options.effects ?? {}));
|
|
10
11
|
this.effectsFile = options.effectsFile;
|
|
@@ -13,8 +14,16 @@ export class DurableFakeDeliveryProvider {
|
|
|
13
14
|
crashAfterNextEffect() {
|
|
14
15
|
this.crashAfterEffect = true;
|
|
15
16
|
}
|
|
17
|
+
deferNextDelivery() {
|
|
18
|
+
this.deferEffect = true;
|
|
19
|
+
}
|
|
16
20
|
async deliver(intent) {
|
|
17
21
|
this.deliveryCalls += 1;
|
|
22
|
+
if (this.deferEffect) {
|
|
23
|
+
this.deferEffect = false;
|
|
24
|
+
this.rememberAmbiguous(intent.intentEventId, intent.intentEventId);
|
|
25
|
+
return { kind: DeliveryResultKind.Ambiguous, reconciliationKey: intent.intentEventId };
|
|
26
|
+
}
|
|
18
27
|
const existing = this.effects.get(intent.intentEventId);
|
|
19
28
|
if (existing !== undefined)
|
|
20
29
|
return { kind: DeliveryResultKind.Confirmed, externalId: existing };
|
|
@@ -3,4 +3,4 @@ import type { DeliveryIntentView } from '../../delivery/contracts/views.js';
|
|
|
3
3
|
export declare function createGitHubDelivery(deliver: (intent: DeliveryIntentView, idempotencyKey: string) => Promise<string>, reconcileIssue?: (intent: DeliveryIntentView) => Promise<string | null>, precondition?: (intent: DeliveryIntentView) => Promise<{
|
|
4
4
|
readonly allowed: boolean;
|
|
5
5
|
readonly reason?: string;
|
|
6
|
-
}>): ExternalDeliveryAdapter;
|
|
6
|
+
}>, mergedTarget?: (intent: DeliveryIntentView) => Promise<string | null>): ExternalDeliveryAdapter;
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import { BuiltInActivityName } from '../../../activities/index.js';
|
|
2
2
|
import { DeliveryResultKind } from '../../delivery/contracts/vocabulary.js';
|
|
3
3
|
const GitHubDeliveryFailureCode = 'github-error';
|
|
4
|
-
export function createGitHubDelivery(deliver, reconcileIssue, precondition) {
|
|
4
|
+
export function createGitHubDelivery(deliver, reconcileIssue, precondition, mergedTarget) {
|
|
5
|
+
async function confirmedMerge(intent) {
|
|
6
|
+
if (intent.kind !== BuiltInActivityName.PullRequestMerge)
|
|
7
|
+
return null;
|
|
8
|
+
const externalId = await mergedTarget?.(intent);
|
|
9
|
+
return externalId == null ? null : { kind: DeliveryResultKind.Confirmed, externalId };
|
|
10
|
+
}
|
|
5
11
|
return {
|
|
6
12
|
async deliver(intent) {
|
|
7
13
|
try {
|
|
14
|
+
const merged = await confirmedMerge(intent);
|
|
15
|
+
if (merged !== null)
|
|
16
|
+
return merged;
|
|
8
17
|
if (intent.kind === BuiltInActivityName.PullRequestMerge &&
|
|
9
18
|
'autoMerge' in intent.payload &&
|
|
10
19
|
intent.payload.autoMerge) {
|
|
@@ -18,6 +27,14 @@ export function createGitHubDelivery(deliver, reconcileIssue, precondition) {
|
|
|
18
27
|
};
|
|
19
28
|
}
|
|
20
29
|
catch (error) {
|
|
30
|
+
try {
|
|
31
|
+
const merged = await confirmedMerge(intent);
|
|
32
|
+
if (merged !== null)
|
|
33
|
+
return merged;
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
// Unavailable evidence cannot turn a failed attempt into success.
|
|
37
|
+
}
|
|
21
38
|
return {
|
|
22
39
|
kind: DeliveryResultKind.Failed,
|
|
23
40
|
code: GitHubDeliveryFailureCode,
|
|
@@ -26,6 +43,14 @@ export function createGitHubDelivery(deliver, reconcileIssue, precondition) {
|
|
|
26
43
|
}
|
|
27
44
|
},
|
|
28
45
|
async reconcile(intent) {
|
|
46
|
+
if (intent.kind === BuiltInActivityName.PullRequestMerge) {
|
|
47
|
+
try {
|
|
48
|
+
return (await confirmedMerge(intent)) ?? { kind: DeliveryResultKind.Unknown };
|
|
49
|
+
}
|
|
50
|
+
catch {
|
|
51
|
+
return { kind: DeliveryResultKind.Unknown };
|
|
52
|
+
}
|
|
53
|
+
}
|
|
29
54
|
if (intent.kind !== BuiltInActivityName.IssueComplete || reconcileIssue === undefined)
|
|
30
55
|
return { kind: DeliveryResultKind.Unknown };
|
|
31
56
|
try {
|
|
@@ -142,6 +142,18 @@ export const gitHubProviderDefinition = {
|
|
|
142
142
|
catch {
|
|
143
143
|
return { allowed: false, reason: 'lookup-unavailable' };
|
|
144
144
|
}
|
|
145
|
+
}, async (intent) => {
|
|
146
|
+
if (intent.payload.kind !== BuiltInActivityName.PullRequestMerge ||
|
|
147
|
+
!('revision' in intent.payload))
|
|
148
|
+
return null;
|
|
149
|
+
const resource = await services.resources.get(resourceId(intent.resourceId));
|
|
150
|
+
if (resource === null)
|
|
151
|
+
return null;
|
|
152
|
+
const parsed = parsePullRequestKey(resource.externalKey.key);
|
|
153
|
+
if (parsed === null)
|
|
154
|
+
return null;
|
|
155
|
+
const pr = await client.getPullRequest(parsed.owner, parsed.repo, parsed.number);
|
|
156
|
+
return pr.merged && pr.head.sha === intent.payload.revision ? String(pr.id) : null;
|
|
145
157
|
}),
|
|
146
158
|
verifyArtifact: async (kind, externalKey, context) => {
|
|
147
159
|
if (kind !== resourceKind('pull-request'))
|
|
@@ -17,6 +17,7 @@ export * from './contracts/provider.js';
|
|
|
17
17
|
export * from './contracts/reply-routing.js';
|
|
18
18
|
export * from './contracts/streams.js';
|
|
19
19
|
export * from './delivery/application/delivery-outcome-reactor.js';
|
|
20
|
+
export * from './delivery/application/merged-delivery-evidence.js';
|
|
20
21
|
export * from './delivery/application/delivery-projector.js';
|
|
21
22
|
export * from './delivery/application/delivery-service.js';
|
|
22
23
|
export * from './delivery/contracts/commands.js';
|
|
@@ -17,6 +17,7 @@ export * from './contracts/provider.js';
|
|
|
17
17
|
export * from './contracts/reply-routing.js';
|
|
18
18
|
export * from './contracts/streams.js';
|
|
19
19
|
export * from './delivery/application/delivery-outcome-reactor.js';
|
|
20
|
+
export * from './delivery/application/merged-delivery-evidence.js';
|
|
20
21
|
export * from './delivery/application/delivery-projector.js';
|
|
21
22
|
export * from './delivery/application/delivery-service.js';
|
|
22
23
|
export * from './delivery/contracts/commands.js';
|
|
@@ -89,6 +89,11 @@ export declare const outcomeRouteConfigSchema: z.ZodObject<{
|
|
|
89
89
|
}, z.core.$strict>>;
|
|
90
90
|
retry: z.ZodOptional<z.ZodObject<{
|
|
91
91
|
max: z.ZodNumber;
|
|
92
|
+
reasons: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
93
|
+
"checks-pending": "checks-pending";
|
|
94
|
+
"checks-could-not-be-read": "checks-could-not-be-read";
|
|
95
|
+
}>>>;
|
|
96
|
+
delaysMs: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
92
97
|
}, z.core.$strict>>;
|
|
93
98
|
await: z.ZodOptional<z.ZodObject<{
|
|
94
99
|
signal: z.ZodString;
|
|
@@ -152,6 +157,11 @@ export declare const stageConfigSchema: z.ZodObject<{
|
|
|
152
157
|
}, z.core.$strict>>;
|
|
153
158
|
retry: z.ZodOptional<z.ZodObject<{
|
|
154
159
|
max: z.ZodNumber;
|
|
160
|
+
reasons: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
161
|
+
"checks-pending": "checks-pending";
|
|
162
|
+
"checks-could-not-be-read": "checks-could-not-be-read";
|
|
163
|
+
}>>>;
|
|
164
|
+
delaysMs: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
155
165
|
}, z.core.$strict>>;
|
|
156
166
|
await: z.ZodOptional<z.ZodObject<{
|
|
157
167
|
signal: z.ZodString;
|
|
@@ -259,6 +269,11 @@ export declare const workflowDefinitionConfigSchema: z.ZodObject<{
|
|
|
259
269
|
}, z.core.$strict>>;
|
|
260
270
|
retry: z.ZodOptional<z.ZodObject<{
|
|
261
271
|
max: z.ZodNumber;
|
|
272
|
+
reasons: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
273
|
+
"checks-pending": "checks-pending";
|
|
274
|
+
"checks-could-not-be-read": "checks-could-not-be-read";
|
|
275
|
+
}>>>;
|
|
276
|
+
delaysMs: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
262
277
|
}, z.core.$strict>>;
|
|
263
278
|
await: z.ZodOptional<z.ZodObject<{
|
|
264
279
|
signal: z.ZodString;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { ApprovalAuthorityKind, ConversationSurfaceCapability, WorkflowStatus, } from './vocabulary.js';
|
|
3
|
-
import { ActivityEventType, PullRequestCheckState, PullRequestMergeability, PullRequestState, } from '../../activities/index.js';
|
|
3
|
+
import { ActivityEventType, PullRequestCheckState, PullRequestDenialCode, PullRequestMergeability, PullRequestState, } from '../../activities/index.js';
|
|
4
4
|
import { WorkspaceMode } from '../../execution/index.js';
|
|
5
5
|
import { MatchMode } from '../../kernel/index.js';
|
|
6
6
|
const identifier = z.string().trim().min(1);
|
|
@@ -106,7 +106,20 @@ export const outcomeRouteConfigSchema = z
|
|
|
106
106
|
activities: z.array(followOnActivityConfigSchema).readonly().optional(),
|
|
107
107
|
then: identifier,
|
|
108
108
|
repeat: bound.optional(),
|
|
109
|
-
retry:
|
|
109
|
+
retry: z
|
|
110
|
+
.object({
|
|
111
|
+
max: z.number().int().positive(),
|
|
112
|
+
reasons: z
|
|
113
|
+
.array(z.enum([PullRequestDenialCode.ChecksUnavailable, PullRequestDenialCode.ChecksPending]))
|
|
114
|
+
.min(1)
|
|
115
|
+
.optional(),
|
|
116
|
+
delaysMs: z.array(z.number().int().positive()).min(1).optional(),
|
|
117
|
+
})
|
|
118
|
+
.strict()
|
|
119
|
+
.refine((value) => value.delaysMs === undefined || value.delaysMs.length === value.max, {
|
|
120
|
+
message: 'retry.delaysMs must contain one delay per retry',
|
|
121
|
+
})
|
|
122
|
+
.optional(),
|
|
110
123
|
await: awaitConfigSchema.optional(),
|
|
111
124
|
watchGates: z.array(watchGateConfigSchema).optional(),
|
|
112
125
|
resourceTransitions: z.array(resourceTransitionConfigSchema).min(1).optional(),
|
|
@@ -52,6 +52,7 @@ export declare const waitingOutcomeSchema: z.ZodPipe<z.ZodObject<{
|
|
|
52
52
|
};
|
|
53
53
|
}>>;
|
|
54
54
|
export declare const activityRequestedSchema: z.ZodObject<{
|
|
55
|
+
notBefore: z.ZodOptional<z.ZodISODateTime>;
|
|
55
56
|
activationId: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../activities/index.js").ActivationId, string>>;
|
|
56
57
|
ordinal: z.ZodNumber;
|
|
57
58
|
activity: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../activities/index.js").ActivityName, string>>;
|
|
@@ -71,6 +71,7 @@ const executionSchema = z
|
|
|
71
71
|
.strict();
|
|
72
72
|
export const activityRequestedSchema = z
|
|
73
73
|
.object({
|
|
74
|
+
notBefore: z.iso.datetime().optional(),
|
|
74
75
|
activationId: brandedStringSchema(activationId),
|
|
75
76
|
ordinal: z.number().int().positive(),
|
|
76
77
|
activity: brandedStringSchema(activityName),
|
|
@@ -174,6 +174,7 @@ export interface GroupBudgetExhaustedPayload extends ChildCoordinationMetadata {
|
|
|
174
174
|
readonly workflowName?: WorkflowName;
|
|
175
175
|
}
|
|
176
176
|
export interface ActivityRequestedPayload {
|
|
177
|
+
readonly notBefore?: string;
|
|
177
178
|
readonly activationId: ActivationId;
|
|
178
179
|
readonly ordinal: number;
|
|
179
180
|
readonly activity: ActivityName;
|
|
@@ -4,6 +4,7 @@ import type { ApprovalAuthority, CompiledResourceTransition, StageConfig, Transi
|
|
|
4
4
|
import type { OrchestrationGroupId, SignalName, StageName, WorkflowInstanceId, WorkflowName } from './identifiers.js';
|
|
5
5
|
import type { ActivityActivationStatus, WorkflowStatus } from './vocabulary.js';
|
|
6
6
|
export interface ActivityActivationView {
|
|
7
|
+
readonly notBefore?: string;
|
|
7
8
|
readonly activationId: ActivationId;
|
|
8
9
|
readonly ordinal: number;
|
|
9
10
|
readonly activity: ActivityName;
|
|
@@ -5,6 +5,13 @@ import { activation, nextOrdinal, stateDraft } from './decision-events.js';
|
|
|
5
5
|
export function mayRetry(route, state, outcome) {
|
|
6
6
|
if (route.retry === undefined || requiresReconciliation(outcome))
|
|
7
7
|
return false;
|
|
8
|
+
if (route.retry.reasons !== undefined) {
|
|
9
|
+
const data = outcome.data;
|
|
10
|
+
if (typeof data !== 'object' || data === null || !('reason' in data))
|
|
11
|
+
return false;
|
|
12
|
+
if (!route.retry.reasons.some((reason) => reason === data.reason))
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
8
15
|
const retryKey = `${state.currentStage}:${outcome.kind}`;
|
|
9
16
|
return (state.retryCounts[retryKey] ?? 0) < route.retry.max;
|
|
10
17
|
}
|
|
@@ -12,12 +19,18 @@ export function requestRetry(events, definition, state, input) {
|
|
|
12
19
|
const retryKey = `${state.currentStage}:${input.outcome.kind}`;
|
|
13
20
|
const count = (state.retryCounts[retryKey] ?? 0) + 1;
|
|
14
21
|
const stage = definition.stages[stageName(state.currentStage)];
|
|
22
|
+
const delay = stage.on[input.outcome.kind]?.retry?.delaysMs?.[count - 1];
|
|
15
23
|
events.push(stateDraft(state, input, { eventType: OrchestrationEventType.RetryCounted, payload: { retryKey, count } }, events.length + 1), stateDraft(state, input, {
|
|
16
24
|
eventType: OrchestrationEventType.ActivityRequested,
|
|
17
|
-
payload:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
25
|
+
payload: {
|
|
26
|
+
...(delay === undefined
|
|
27
|
+
? {}
|
|
28
|
+
: { notBefore: new Date(Date.parse(input.occurredAt) + delay).toISOString() }),
|
|
29
|
+
...activation(state.workflowInstanceId, nextOrdinal(state), stage.activity, stage.with, {
|
|
30
|
+
execution: stage.execution,
|
|
31
|
+
stage: stageName(state.currentStage),
|
|
32
|
+
}),
|
|
33
|
+
},
|
|
21
34
|
}, events.length + 2));
|
|
22
35
|
}
|
|
23
36
|
function requiresReconciliation(outcome) {
|
|
@@ -203,6 +203,7 @@ function applyActivityRequested(state, payload) {
|
|
|
203
203
|
state.status = orchestrationStatusTransitions[OrchestrationEventType.ActivityRequested];
|
|
204
204
|
delete state.waitingFor;
|
|
205
205
|
state.pendingActivation = {
|
|
206
|
+
...(payload.notBefore === undefined ? {} : { notBefore: payload.notBefore }),
|
|
206
207
|
activationId: payload.activationId,
|
|
207
208
|
ordinal: payload.ordinal,
|
|
208
209
|
activity: payload.activity,
|