@exaudeus/workrail 3.73.1 → 3.74.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 (41) hide show
  1. package/dist/cli-worktrain.js +126 -1
  2. package/dist/console-ui/assets/{index-txIYXGHx.js → index-CfU3va8H.js} +1 -1
  3. package/dist/console-ui/index.html +1 -1
  4. package/dist/coordinators/pr-review.d.ts +11 -1
  5. package/dist/coordinators/types.d.ts +15 -0
  6. package/dist/coordinators/types.js +2 -0
  7. package/dist/manifest.json +81 -57
  8. package/dist/mcp/handlers/v2-advance-core/index.d.ts +1 -0
  9. package/dist/mcp/handlers/v2-advance-core/index.js +3 -3
  10. package/dist/mcp/handlers/v2-advance-core/outcome-success.js +4 -18
  11. package/dist/mcp/handlers/v2-advance-events.d.ts +1 -1
  12. package/dist/mcp/handlers/v2-advance-events.js +1 -1
  13. package/dist/mcp/handlers/v2-execution/advance.d.ts +1 -0
  14. package/dist/mcp/handlers/v2-execution/advance.js +3 -3
  15. package/dist/mcp/handlers/v2-execution/continue-advance.d.ts +1 -0
  16. package/dist/mcp/handlers/v2-execution/continue-advance.js +2 -1
  17. package/dist/mcp/handlers/v2-execution/index.js +3 -1
  18. package/dist/mcp/server.js +6 -4
  19. package/dist/mcp/types.d.ts +2 -0
  20. package/dist/trigger/coordinator-deps.js +203 -36
  21. package/dist/trigger/delivery-action.d.ts +1 -0
  22. package/dist/trigger/delivery-action.js +1 -1
  23. package/dist/trigger/delivery-pipeline.d.ts +13 -2
  24. package/dist/trigger/delivery-pipeline.js +58 -3
  25. package/dist/trigger/trigger-router.js +6 -3
  26. package/dist/v2/durable-core/constants.d.ts +1 -0
  27. package/dist/v2/durable-core/constants.js +1 -0
  28. package/dist/v2/durable-core/schemas/export-bundle/index.d.ts +202 -0
  29. package/dist/v2/durable-core/schemas/session/events.d.ts +56 -0
  30. package/dist/v2/durable-core/schemas/session/events.js +8 -0
  31. package/dist/v2/infra/local/git-snapshot/index.d.ts +6 -0
  32. package/dist/v2/infra/local/git-snapshot/index.js +39 -0
  33. package/dist/v2/ports/git-snapshot.port.d.ts +10 -0
  34. package/dist/v2/ports/git-snapshot.port.js +9 -0
  35. package/dist/v2/projections/session-metrics.js +17 -2
  36. package/docs/authoring.md +23 -0
  37. package/docs/design/engine-boundary-discovery.md +123 -0
  38. package/docs/design/engine-boundary-review-findings.md +72 -0
  39. package/docs/ideas/backlog.md +129 -48
  40. package/package.json +1 -1
  41. package/spec/authoring-spec.json +36 -1
@@ -238,8 +238,8 @@
238
238
  "bytes": 31
239
239
  },
240
240
  "cli-worktrain.js": {
241
- "sha256": "ab9815d8a2a571ac8fc4923eb3c1f51fc6e096403d3b75a80cd12d0bfe1858f2",
242
- "bytes": 60401
241
+ "sha256": "fe38aca6a553491f3c9e0bd916cedbcd6a58d5cce230b1f47a52066f0b622851",
242
+ "bytes": 67617
243
243
  },
244
244
  "cli.d.ts": {
245
245
  "sha256": "43e818adf60173644896298637f47b01d5819b17eda46eaa32d0c7d64724d012",
@@ -473,16 +473,16 @@
473
473
  "sha256": "5fe866e54f796975dec5d8ba9983aefd86074db212d3fccd64eed04bc9f0b3da",
474
474
  "bytes": 8011
475
475
  },
476
+ "console-ui/assets/index-CfU3va8H.js": {
477
+ "sha256": "7f7a29c1c312c2966f68131e1ade49ab0daf94ffd425c5c2d0b21add58c0028f",
478
+ "bytes": 768234
479
+ },
476
480
  "console-ui/assets/index-DHrKiMCf.css": {
477
481
  "sha256": "40290b50e21ee7e82433efe13b1aa31c1ea608bd057a5c4e324982f284bc928b",
478
482
  "bytes": 60673
479
483
  },
480
- "console-ui/assets/index-txIYXGHx.js": {
481
- "sha256": "88e3b657dc931a64d3bf5a0800ef2f90c4a7da6b447c999c3d2877f4411aedce",
482
- "bytes": 768234
483
- },
484
484
  "console-ui/index.html": {
485
- "sha256": "afac36567459f0128238205754e717a11c860d832b072520324e082e79d96f15",
485
+ "sha256": "3f08f8bf69e386e4ceca01a42720523c8e667635e7c5fbf2f3038540f29681e1",
486
486
  "bytes": 417
487
487
  },
488
488
  "console/standalone-console.d.ts": {
@@ -574,8 +574,8 @@
574
574
  "bytes": 1198
575
575
  },
576
576
  "coordinators/pr-review.d.ts": {
577
- "sha256": "d46e4923995a0b43aefee25da298b86235fae0ad105e548b3174c0eea9c1f8d0",
578
- "bytes": 3947
577
+ "sha256": "0dba830dd29cd82c58300ca9fdfb4c29d0acd0b257740ce3e65f2360239a106b",
578
+ "bytes": 4501
579
579
  },
580
580
  "coordinators/pr-review.js": {
581
581
  "sha256": "385baa9e6252dbd84060bb423ce219884d519752f4a6e9f8f04e5f503fa38b67",
@@ -589,6 +589,14 @@
589
589
  "sha256": "195953d6c0e28d749407e5e3fb29b963cf14629c03508792a44bf0866f7c9d33",
590
590
  "bytes": 1815
591
591
  },
592
+ "coordinators/types.d.ts": {
593
+ "sha256": "913320eccf4737884fe73446e82ab0becbeeec55fa704c0613f19afe31a120aa",
594
+ "bytes": 413
595
+ },
596
+ "coordinators/types.js": {
597
+ "sha256": "d43aa81f5bc89faa359e0f97c814ba25155591ff078fbb9bfd40f8c7c9683230",
598
+ "bytes": 77
599
+ },
592
600
  "core/error-handler.d.ts": {
593
601
  "sha256": "80451f12ac8e185133ec3dc4c57285491a785f27525ed21e729db1da3f61010d",
594
602
  "bytes": 1368
@@ -1166,12 +1174,12 @@
1166
1174
  "bytes": 5741
1167
1175
  },
1168
1176
  "mcp/handlers/v2-advance-core/index.d.ts": {
1169
- "sha256": "8c306cad3b4b5120f206df58a4c0e7a8bcca1a68d01759a1bd5e28e64649e904",
1170
- "bytes": 3567
1177
+ "sha256": "be738510d019c387bf755c97ac0e1fc2513c77bccbb9084e6b59fd7f78d2f6fc",
1178
+ "bytes": 3661
1171
1179
  },
1172
1180
  "mcp/handlers/v2-advance-core/index.js": {
1173
- "sha256": "a821bb07fab92983c7d9aaf2806d885ca3bd2240186b69f335150c94cceae0fd",
1174
- "bytes": 8087
1181
+ "sha256": "f3238283cd06dc7f3e28ae46fc7497deb09f95f4087b285cdb14871c343a65cc",
1182
+ "bytes": 8126
1175
1183
  },
1176
1184
  "mcp/handlers/v2-advance-core/input-validation.d.ts": {
1177
1185
  "sha256": "4e057b4496c0d0b263a1296f313df6583df3b5fb34855c1e26d38cbdd39536ea",
@@ -1194,16 +1202,16 @@
1194
1202
  "bytes": 1055
1195
1203
  },
1196
1204
  "mcp/handlers/v2-advance-core/outcome-success.js": {
1197
- "sha256": "56af614d2fb96d70e6bd6af33434ab0eb29d59757c1c0b963568cd0cefe97c6b",
1198
- "bytes": 9981
1205
+ "sha256": "92c6971536d97cd34d2bf9c391dc0c5bae1eb44ceb0e313990ce49a97d9e6a78",
1206
+ "bytes": 9617
1199
1207
  },
1200
1208
  "mcp/handlers/v2-advance-events.d.ts": {
1201
- "sha256": "318894df12e0dfc74cad9e81fcea44bc04ea972d6e887cd5b196de1f144e256b",
1202
- "bytes": 3226
1209
+ "sha256": "eb8cbcc5cf8bc55d44468e21e4eb75710bb76216e1ff395453d25007b3c041a1",
1210
+ "bytes": 3235
1203
1211
  },
1204
1212
  "mcp/handlers/v2-advance-events.js": {
1205
- "sha256": "b3278a63cebab6b54b72cef596c0c7dee31d04246a29339828f283386174e6ad",
1206
- "bytes": 5919
1213
+ "sha256": "8b4352085fc5960845792c4305ce5b2256f1fdc34ebb3ce311f69e069286f60c",
1214
+ "bytes": 5941
1207
1215
  },
1208
1216
  "mcp/handlers/v2-checkpoint.d.ts": {
1209
1217
  "sha256": "8f22b341bb0ffffb3b24a89067e2a6513ef004ca21c1a42ce48979c2c663b18c",
@@ -1246,20 +1254,20 @@
1246
1254
  "bytes": 645
1247
1255
  },
1248
1256
  "mcp/handlers/v2-execution/advance.d.ts": {
1249
- "sha256": "87f555395916cff6737b989a27cdf1ba558c0ebb87d81195c7c9adcb20cc089a",
1250
- "bytes": 2116
1257
+ "sha256": "e6060dd20c5efcf317900c7712317e702df79ff5d1bd53a7ab38aa6869403daa",
1258
+ "bytes": 2210
1251
1259
  },
1252
1260
  "mcp/handlers/v2-execution/advance.js": {
1253
- "sha256": "849726273445bfc7e10352b6a0896a12b3aad7df952e63fe88016d59ce9c8e85",
1254
- "bytes": 3828
1261
+ "sha256": "c5c5e6e6bd1cc073da499a505a5ed03122f979a9106d2f9d7c3e0b603ffcedc2",
1262
+ "bytes": 3867
1255
1263
  },
1256
1264
  "mcp/handlers/v2-execution/continue-advance.d.ts": {
1257
- "sha256": "6de9b9bb05dee9bbc2c3729960601eca4eb59da5b2e2d2baa5acf20fd14cb118",
1258
- "bytes": 2070
1265
+ "sha256": "de65ee6a04e2151394a407a40f74eeeb72e03d9919a63ef85fb353464e08a474",
1266
+ "bytes": 2164
1259
1267
  },
1260
1268
  "mcp/handlers/v2-execution/continue-advance.js": {
1261
- "sha256": "30e82a97410d19105859b49fcdb0711a602eb25d0a1ce2cc55a190f696926f1b",
1262
- "bytes": 10227
1269
+ "sha256": "eb1fe005ec29aa55a8a03e6df3462232aa804d8d33c884163eb9a7f650983c55",
1270
+ "bytes": 10269
1263
1271
  },
1264
1272
  "mcp/handlers/v2-execution/continue-rehydrate.d.ts": {
1265
1273
  "sha256": "8412323cb149f7818ed19400758da9e0452b35a18d080afd88955a03bd965b92",
@@ -1274,8 +1282,8 @@
1274
1282
  "bytes": 1437
1275
1283
  },
1276
1284
  "mcp/handlers/v2-execution/index.js": {
1277
- "sha256": "ab5ca7e41236fcbcbb0116b3a11bd931478f8ec4be1073884c33d6aee86cc22e",
1278
- "bytes": 7757
1285
+ "sha256": "ee6ba69f2aae10f1ef0faa8806e4df2eb71a657086fb603d3b44c43675aa58c9",
1286
+ "bytes": 7948
1279
1287
  },
1280
1288
  "mcp/handlers/v2-execution/replay.d.ts": {
1281
1289
  "sha256": "4f1601755e98c336f7d98c096753c38559d76ab5ebbacb1aed679983d46cb6b7",
@@ -1402,8 +1410,8 @@
1402
1410
  "bytes": 960
1403
1411
  },
1404
1412
  "mcp/server.js": {
1405
- "sha256": "b4bb802ebe0fe7374ff0c60062bc9950fc2aba9aef21934805d16d531c0e8313",
1406
- "bytes": 15911
1413
+ "sha256": "91e4b51e8be636d70ebf5113e962c9c23adc918fb4e03da6f7c2a04e5825c35e",
1414
+ "bytes": 16048
1407
1415
  },
1408
1416
  "mcp/step-content-envelope.d.ts": {
1409
1417
  "sha256": "19bd63c4d4de1d5d93393d346625d28ffd1bebdc320d4ba4e694cb740ec97d3b",
@@ -1502,8 +1510,8 @@
1502
1510
  "bytes": 747
1503
1511
  },
1504
1512
  "mcp/types.d.ts": {
1505
- "sha256": "801d390c856e733b5c728d0500dffc8c40c1247892682f58655aba1a9dfb9653",
1506
- "bytes": 4981
1513
+ "sha256": "cd0d181354d236cb1d87a74457407789983351ac425741daa2f00f56d4b352c3",
1514
+ "bytes": 5102
1507
1515
  },
1508
1516
  "mcp/types.js": {
1509
1517
  "sha256": "d10c4070e4c3454d80f0fa9cdc0e978c69c53c13fd09baa8710fcd802fed8926",
@@ -1786,16 +1794,16 @@
1786
1794
  "bytes": 854
1787
1795
  },
1788
1796
  "trigger/coordinator-deps.js": {
1789
- "sha256": "ade7810cf782d88e58074e75a937de08b350ff2ffae533b563fb37753c7ef49c",
1790
- "bytes": 15048
1797
+ "sha256": "1b400abbd6158e900d4559c74b9f3069a46b60fd02d046f36e30cc40a58acb51",
1798
+ "bytes": 22626
1791
1799
  },
1792
1800
  "trigger/delivery-action.d.ts": {
1793
- "sha256": "559e2b2645aa60528f73de351cd35ebf45c5b82f47797aa15ddd681319315d39",
1794
- "bytes": 1759
1801
+ "sha256": "bba98a08e35653304b604cd3ec126374cb731620db27ee2c8d6782d5b5b31207",
1802
+ "bytes": 1785
1795
1803
  },
1796
1804
  "trigger/delivery-action.js": {
1797
- "sha256": "44790087b051ed8a4f3e5cdd3bed5d3026260a12d99b57b5740d99fe68efb2ec",
1798
- "bytes": 14646
1805
+ "sha256": "26442cbe007f6f1b595d43db2b2d1acd2ba7798beb09566d225081af9a021324",
1806
+ "bytes": 14651
1799
1807
  },
1800
1808
  "trigger/delivery-client.d.ts": {
1801
1809
  "sha256": "0cb2be24b854cb31e3d2fe7eeaba6032de7a9b2a5290c8bc886df94faf5306f7",
@@ -1806,12 +1814,12 @@
1806
1814
  "bytes": 1269
1807
1815
  },
1808
1816
  "trigger/delivery-pipeline.d.ts": {
1809
- "sha256": "b22d6048844357996bff383cea6c3cf5fc7ba75a0ee4441c755e83654af4b77b",
1810
- "bytes": 858
1817
+ "sha256": "257f04e9018bda1a4a373e0709951057dd40b9a30c749c87f3a720f77137bbba",
1818
+ "bytes": 1463
1811
1819
  },
1812
1820
  "trigger/delivery-pipeline.js": {
1813
- "sha256": "a5628cbf46cb65090e9e34c86fc78cb0b5fe2be6558efa2a3ce2009600a42d0a",
1814
- "bytes": 6796
1821
+ "sha256": "ba011b9360749df47ee540cea08ccba57534a57a8a1d91d3ec240f990396be14",
1822
+ "bytes": 9611
1815
1823
  },
1816
1824
  "trigger/dispatch-deduplicator.d.ts": {
1817
1825
  "sha256": "e1b7f48f7c03a391812ff7b40aa8cff7784d175df7c58de1a152e2a2c4eff060",
@@ -1874,8 +1882,8 @@
1874
1882
  "bytes": 3220
1875
1883
  },
1876
1884
  "trigger/trigger-router.js": {
1877
- "sha256": "9676fb57236040d46b923c8016394b519561ab18c99884dc190cf2221e2f1ecf",
1878
- "bytes": 20550
1885
+ "sha256": "ec971ba1f36a6ace7521fad51ba833fa804d5591b3b51e9805e331bbf5ef7159",
1886
+ "bytes": 20769
1879
1887
  },
1880
1888
  "trigger/trigger-store.d.ts": {
1881
1889
  "sha256": "f846ca66494a2a1b834914652c845373d777bdeaaaefdc101ad1e78083d9ad5b",
@@ -2030,12 +2038,12 @@
2030
2038
  "bytes": 447
2031
2039
  },
2032
2040
  "v2/durable-core/constants.d.ts": {
2033
- "sha256": "14b721867f0866a9a2955b19f16868c39394e80dce2bd94021e6e7f6b4f62429",
2034
- "bytes": 4159
2041
+ "sha256": "bc135e1c75f1eedd84bcb0d98148cc4c37a265cd53403e2abad59e1ab2286335",
2042
+ "bytes": 4212
2035
2043
  },
2036
2044
  "v2/durable-core/constants.js": {
2037
- "sha256": "21a7a514d3a365c7e7690c1c57dd402a25686bfd2dea38082fcc02ee6c266a5c",
2038
- "bytes": 3987
2045
+ "sha256": "a122a4f5e48711620ea511b873558602853b6faf92a5b9d17c877ed944eabd37",
2046
+ "bytes": 4031
2039
2047
  },
2040
2048
  "v2/durable-core/domain/ack-advance-append-plan.d.ts": {
2041
2049
  "sha256": "2b4a8ad0e1d9e9066f100f958e572f19af590ab70946c2396d2d5568875bdf00",
@@ -2478,8 +2486,8 @@
2478
2486
  "bytes": 3397
2479
2487
  },
2480
2488
  "v2/durable-core/schemas/export-bundle/index.d.ts": {
2481
- "sha256": "ae48214ae394702c323a6a4ccd0498ba54c3abcc3104ea9396f5f226b633423e",
2482
- "bytes": 552192
2489
+ "sha256": "bbe43832c5f0c09949104907d14d7b903163d0453bead5afafe59e80f8a7070a",
2490
+ "bytes": 557686
2483
2491
  },
2484
2492
  "v2/durable-core/schemas/export-bundle/index.js": {
2485
2493
  "sha256": "6e3566b2d05ea6302bbf4d311b8ec3e94725a8523834efe7670a79e7bd7dc40d",
@@ -2534,12 +2542,12 @@
2534
2542
  "bytes": 2138
2535
2543
  },
2536
2544
  "v2/durable-core/schemas/session/events.d.ts": {
2537
- "sha256": "878c97d2442d782d202316606b46ad8bf51ba98b0f8b892fd1f6a1c1a6e8eb70",
2538
- "bytes": 84874
2545
+ "sha256": "12f5c9736ab568deeac2fde429a6bb1cb357486b4770ef7fae81b82676898690",
2546
+ "bytes": 86130
2539
2547
  },
2540
2548
  "v2/durable-core/schemas/session/events.js": {
2541
- "sha256": "23651dfa8219a75318474629c45e37bdad2f91f48d1555dfbed649c5c2ed830a",
2542
- "bytes": 13894
2549
+ "sha256": "6cd52e959d42430636a57f6b914792c490e8ae7a8f790cab74ffddffbc6fd262",
2550
+ "bytes": 14212
2543
2551
  },
2544
2552
  "v2/durable-core/schemas/session/gaps.d.ts": {
2545
2553
  "sha256": "85d17b865a1ebe9deaa0c99d69039c514b217362715c6697b0bc5908cbf9fff0",
@@ -2773,6 +2781,14 @@
2773
2781
  "sha256": "c6239baab7d36b12ded5fb5383a8f41e13980470846a7a033e995a6827ba0fda",
2774
2782
  "bytes": 8429
2775
2783
  },
2784
+ "v2/infra/local/git-snapshot/index.d.ts": {
2785
+ "sha256": "4399241c19447df846cddfd02609a278c04f471a38f705ce0c7ce8f7c64e66a4",
2786
+ "bytes": 325
2787
+ },
2788
+ "v2/infra/local/git-snapshot/index.js": {
2789
+ "sha256": "a6ed9bde6deef68af8b3e1afe68da36a3066904c04bab741a8388c14b5e1ce8c",
2790
+ "bytes": 1458
2791
+ },
2776
2792
  "v2/infra/local/hmac-sha256/index.d.ts": {
2777
2793
  "sha256": "dda3865510dfaf2f13947410d998da6ffecc9a2e728b3574f81e69d5db859815",
2778
2794
  "bytes": 272
@@ -2949,6 +2965,14 @@
2949
2965
  "sha256": "d43aa81f5bc89faa359e0f97c814ba25155591ff078fbb9bfd40f8c7c9683230",
2950
2966
  "bytes": 77
2951
2967
  },
2968
+ "v2/ports/git-snapshot.port.d.ts": {
2969
+ "sha256": "247186671b5251757257cabb061c5915f479298c566e1533f4e123b251f337e0",
2970
+ "bytes": 377
2971
+ },
2972
+ "v2/ports/git-snapshot.port.js": {
2973
+ "sha256": "750489a646660c6568997361e1df4e3850b8279238e5b423b32119d240b1b575",
2974
+ "bytes": 276
2975
+ },
2952
2976
  "v2/ports/hmac-sha256.port.d.ts": {
2953
2977
  "sha256": "36bb3cffc90ce7e9ce5a60fb6cd1667d584e438ac273ca9e98e73094d98e6da9",
2954
2978
  "bytes": 164
@@ -3202,8 +3226,8 @@
3202
3226
  "bytes": 730
3203
3227
  },
3204
3228
  "v2/projections/session-metrics.js": {
3205
- "sha256": "89dd4c149087234e3f4f18382340a9f855942fd96595783b7d7ad5c76449536a",
3206
- "bytes": 3370
3229
+ "sha256": "3c704be9cd13d2074ef61a974f3f1bcdbb46be99d19567765623bf9f97998a67",
3230
+ "bytes": 3942
3207
3231
  },
3208
3232
  "v2/read-only/v1-to-v2-shim.d.ts": {
3209
3233
  "sha256": "b122df1d4eb4119b65465baa00f157ca4466575d3bc6ac20054a361eaff48e02",
@@ -33,6 +33,7 @@ export interface AdvanceCorePorts {
33
33
  readonly mintNodeId: () => NodeId;
34
34
  readonly mintEventId: () => string;
35
35
  };
36
+ readonly gitSnapshot: import('../../../v2/ports/git-snapshot.port.js').GitSnapshotPortV2;
36
37
  }
37
38
  export interface AdvanceContext {
38
39
  readonly truth: LoadedSessionTruthV2;
@@ -29,7 +29,7 @@ function snapshotOf(mode) {
29
29
  }
30
30
  function executeAdvanceCore(args) {
31
31
  const { mode, truth, sessionId, runId, attemptId, workflowHash, inputContext, inputOutput, lock, pinnedWorkflow, ports } = args;
32
- const { snapshotStore, sessionStore, sha256, idFactory } = ports;
32
+ const { snapshotStore, sessionStore, sha256, idFactory, gitSnapshot } = ports;
33
33
  const currentNodeId = nodeIdOf(mode);
34
34
  const snap = snapshotOf(mode);
35
35
  const engineState = snap.enginePayload.engineState;
@@ -71,7 +71,7 @@ function executeAdvanceCore(args) {
71
71
  };
72
72
  const ctx = { truth, sessionId, runId, currentNodeId, attemptId, workflowHash, inputOutput, pinnedWorkflow, engineState, pendingStep };
73
73
  const computed = { reasons: effectiveReasons, outputRequirement, validation: evalValidation };
74
- const portsLocal = { snapshotStore, sessionStore, sha256, idFactory };
74
+ const portsLocal = { snapshotStore, sessionStore, sha256, idFactory, gitSnapshot };
75
75
  return (0, outcome_blocked_js_1.buildBlockedOutcome)({ mode, snap, ctx, computed, v, lock, ports: portsLocal, lockedIndex: args.lockedIndex });
76
76
  }
77
77
  const validation = phase.validation;
@@ -109,7 +109,7 @@ function executeAdvanceCore(args) {
109
109
  const shouldBlockNow = reasons.length > 0 && (0, reason_model_js_1.shouldBlock)(v.autonomy, reasons);
110
110
  const ctx = { truth, sessionId, runId, currentNodeId, attemptId, workflowHash, inputOutput, pinnedWorkflow, engineState, pendingStep };
111
111
  const computed = { reasons, outputRequirement, validation: effectiveValidation };
112
- const ports = { snapshotStore, sessionStore, sha256, idFactory };
112
+ const ports = { snapshotStore, sessionStore, sha256, idFactory, gitSnapshot };
113
113
  if (shouldBlockNow) {
114
114
  return (0, outcome_blocked_js_1.buildBlockedOutcome)({ mode, snap, ctx, computed, v, lock, ports, lockedIndex: args.lockedIndex });
115
115
  }
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.buildSuccessOutcome = buildSuccessOutcome;
4
- const node_child_process_1 = require("node:child_process");
5
- const node_util_1 = require("node:util");
6
4
  const neverthrow_1 = require("neverthrow");
7
5
  const workflow_compiler_js_1 = require("../../../application/services/workflow-compiler.js");
8
6
  const workflow_interpreter_js_1 = require("../../../application/services/workflow-interpreter.js");
@@ -11,7 +9,6 @@ const v2_state_conversion_js_1 = require("../v2-state-conversion.js");
11
9
  const v2_advance_events_js_1 = require("../v2-advance-events.js");
12
10
  const event_builders_js_1 = require("./event-builders.js");
13
11
  const assessment_recorded_event_builder_js_1 = require("../../../v2/durable-core/domain/assessment-recorded-event-builder.js");
14
- const execFileAsync = (0, node_util_1.promisify)(node_child_process_1.execFile);
15
12
  function readObservation(events, key) {
16
13
  for (const e of events) {
17
14
  if (e.kind !== 'observation_recorded')
@@ -22,17 +19,6 @@ function readObservation(events, key) {
22
19
  }
23
20
  return null;
24
21
  }
25
- async function resolveEndGitSha(repoRoot) {
26
- if (!repoRoot)
27
- return null;
28
- try {
29
- const { stdout } = await execFileAsync('git', ['rev-parse', 'HEAD'], { cwd: repoRoot, timeout: 2000 });
30
- return stdout.trim() || null;
31
- }
32
- catch {
33
- return null;
34
- }
35
- }
36
22
  function successNodeKind(mode) {
37
23
  switch (mode.kind) {
38
24
  case 'fresh': return undefined;
@@ -43,7 +29,7 @@ function buildSuccessOutcome(args) {
43
29
  const { mode, v, lock, ports } = args;
44
30
  const { truth, sessionId, runId, currentNodeId, attemptId, workflowHash, inputOutput, pinnedWorkflow, engineState, pendingStep } = args.ctx;
45
31
  const { reasons, outputRequirement, validation } = args.computed;
46
- const { snapshotStore, sessionStore, sha256, idFactory } = ports;
32
+ const { snapshotStore, sessionStore, sha256, idFactory, gitSnapshot } = ports;
47
33
  const compiler = new workflow_compiler_js_1.WorkflowCompiler();
48
34
  const interpreter = new workflow_interpreter_js_1.WorkflowInterpreter();
49
35
  const compiledWf = compiler.compile(pinnedWorkflow);
@@ -179,9 +165,9 @@ function buildSuccessOutcome(args) {
179
165
  const firstTs = truth.events[0]?.timestampMs;
180
166
  const lastTs = truth.events[truth.events.length - 1]?.timestampMs;
181
167
  const durationMs = (firstTs !== undefined && lastTs !== undefined) ? (lastTs - firstTs) : undefined;
182
- return neverthrow_1.ResultAsync.fromPromise(resolveEndGitSha(repoRoot), (e) => ({ kind: 'advance_apply_failed', message: String(e) })).andThen((endGitSha) => {
183
- const agentCommitShas = [];
184
- const captureConfidence = 'none';
168
+ return neverthrow_1.ResultAsync.fromPromise(gitSnapshot.resolveEndSnapshot(repoRoot, startGitSha), (e) => ({ kind: 'advance_apply_failed', message: String(e) })).andThen(({ endSha: endGitSha, commitShas }) => {
169
+ const agentCommitShas = commitShas;
170
+ const captureConfidence = agentCommitShas.length > 0 ? 'high' : 'none';
185
171
  extraEventsToAppend.push((0, v2_advance_events_js_1.buildRunCompletedEvent)({
186
172
  sessionId: String(sessionId),
187
173
  runId: String(runId),
@@ -64,7 +64,7 @@ export declare function buildRunCompletedEvent(args: {
64
64
  readonly startGitSha: string | null;
65
65
  readonly endGitSha: string | null;
66
66
  readonly gitBranch: string | null;
67
- readonly agentCommitShas: string[];
67
+ readonly agentCommitShas: readonly string[];
68
68
  readonly captureConfidence: 'high' | 'none';
69
69
  readonly durationMs: number | undefined;
70
70
  readonly idFactory: AdvanceCorePorts['idFactory'];
@@ -137,7 +137,7 @@ function buildRunCompletedEvent(args) {
137
137
  startGitSha,
138
138
  endGitSha,
139
139
  gitBranch,
140
- agentCommitShas,
140
+ agentCommitShas: [...agentCommitShas],
141
141
  captureConfidence,
142
142
  ...(durationMs !== undefined ? { durationMs } : {}),
143
143
  },
@@ -30,5 +30,6 @@ export declare function advanceAndRecord(args: {
30
30
  readonly mintNodeId: () => NodeId;
31
31
  readonly mintEventId: () => string;
32
32
  };
33
+ readonly gitSnapshot: import('../../../v2/ports/git-snapshot.port.js').GitSnapshotPortV2;
33
34
  readonly lockedIndex: SessionIndex;
34
35
  }): RA<void, InternalError | SessionEventLogStoreError | SnapshotStoreError>;
@@ -18,7 +18,7 @@ function countBlockedAttemptChainDepth(nodeId, lockedIndex) {
18
18
  return depth;
19
19
  }
20
20
  function advanceAndRecord(args) {
21
- const { truth, sessionId, runId, nodeId, attemptId, workflowHash, dedupeKey, inputContext, inputOutput, lock, pinnedWorkflow, snapshotStore, sessionStore, sha256, idFactory } = args;
21
+ const { truth, sessionId, runId, nodeId, attemptId, workflowHash, dedupeKey, inputContext, inputOutput, lock, pinnedWorkflow, snapshotStore, sessionStore, sha256, idFactory, gitSnapshot } = args;
22
22
  const hasRun = args.lockedIndex.runStartedByRunId.has(String(runId));
23
23
  const nodeCreated = args.lockedIndex.nodeCreatedByNodeId.get(String(nodeId));
24
24
  const hasNode = nodeCreated !== undefined;
@@ -58,7 +58,7 @@ function advanceAndRecord(args) {
58
58
  mode: { kind: 'retry', blockedNodeId: nodeId, blockedSnapshot: snap },
59
59
  truth, sessionId, runId, attemptId, workflowHash, dedupeKey,
60
60
  inputContext, inputOutput, lock, pinnedWorkflow,
61
- ports: { snapshotStore, sessionStore, sha256, idFactory },
61
+ ports: { snapshotStore, sessionStore, sha256, idFactory, gitSnapshot },
62
62
  lockedIndex: args.lockedIndex,
63
63
  });
64
64
  }
@@ -66,7 +66,7 @@ function advanceAndRecord(args) {
66
66
  mode: { kind: 'fresh', sourceNodeId: nodeId, snapshot: snap },
67
67
  truth, sessionId, runId, attemptId, workflowHash, dedupeKey,
68
68
  inputContext, inputOutput, lock, pinnedWorkflow,
69
- ports: { snapshotStore, sessionStore, sha256, idFactory },
69
+ ports: { snapshotStore, sessionStore, sha256, idFactory, gitSnapshot },
70
70
  lockedIndex: args.lockedIndex,
71
71
  });
72
72
  });
@@ -26,6 +26,7 @@ export declare function handleAdvanceIntent(args: {
26
26
  readonly mintEventId: () => string;
27
27
  };
28
28
  readonly sha256: Sha256PortV2;
29
+ readonly gitSnapshot: import('../../../v2/ports/git-snapshot.port.js').GitSnapshotPortV2;
29
30
  readonly aliasStore: import('../../../v2/ports/token-alias-store.port.js').TokenAliasStorePortV2;
30
31
  readonly entropy: import('../../../v2/ports/random-entropy.port.js').RandomEntropyPortV2;
31
32
  readonly cleanResponseFormat?: boolean;
@@ -11,7 +11,7 @@ const advance_js_1 = require("./advance.js");
11
11
  const sorted_event_log_js_1 = require("../../../v2/durable-core/sorted-event-log.js");
12
12
  const session_index_js_1 = require("../../../v2/durable-core/session-index.js");
13
13
  function handleAdvanceIntent(args) {
14
- const { input, sessionId, runId, nodeId, attemptId, workflowHashRef, truth, gate, sessionStore, snapshotStore, pinnedStore, tokenCodecPorts, idFactory, sha256, aliasStore, entropy, cleanResponseFormat } = args;
14
+ const { input, sessionId, runId, nodeId, attemptId, workflowHashRef, truth, gate, sessionStore, snapshotStore, pinnedStore, tokenCodecPorts, idFactory, sha256, gitSnapshot, aliasStore, entropy, cleanResponseFormat } = args;
15
15
  const dedupeKey = `advance_recorded:${sessionId}:${nodeId}:${attemptId}`;
16
16
  const preLockSortedResult = (0, sorted_event_log_js_1.asSortedEventLog)(truth.events);
17
17
  if (preLockSortedResult.isErr()) {
@@ -133,6 +133,7 @@ function handleAdvanceIntent(args) {
133
133
  sessionStore,
134
134
  sha256,
135
135
  idFactory,
136
+ gitSnapshot,
136
137
  lockedIndex,
137
138
  }).andThen(() => sessionStore
138
139
  .load(sessionId)
@@ -5,6 +5,7 @@ exports.handleV2StartWorkflow = handleV2StartWorkflow;
5
5
  exports.handleV2ContinueWorkflow = handleV2ContinueWorkflow;
6
6
  exports.executeContinueWorkflow = executeContinueWorkflow;
7
7
  const types_js_1 = require("../../types.js");
8
+ const git_snapshot_port_js_1 = require("../../../v2/ports/git-snapshot.port.js");
8
9
  const index_js_1 = require("../../../v2/durable-core/tokens/index.js");
9
10
  const index_js_2 = require("../../../v2/durable-core/ids/index.js");
10
11
  const neverthrow_1 = require("neverthrow");
@@ -79,7 +80,7 @@ function loadAndRehydrate(args) {
79
80
  }));
80
81
  }
81
82
  function executeContinueWorkflow(input, ctx) {
82
- const { gate, sessionStore, snapshotStore, pinnedStore, sha256, tokenCodecPorts, idFactory, tokenAliasStore, entropy } = ctx.v2;
83
+ const { gate, sessionStore, snapshotStore, pinnedStore, sha256, tokenCodecPorts, idFactory, tokenAliasStore, entropy, gitSnapshot } = ctx.v2;
83
84
  const ctxCheck = (0, v2_context_budget_js_1.checkContextBudget)({ tool: 'continue_workflow', context: input.context });
84
85
  if (!ctxCheck.ok)
85
86
  return (0, neverthrow_1.errAsync)({ kind: 'validation_failed', failure: ctxCheck.error });
@@ -139,6 +140,7 @@ function executeContinueWorkflow(input, ctx) {
139
140
  tokenCodecPorts,
140
141
  idFactory,
141
142
  sha256,
143
+ gitSnapshot: gitSnapshot ?? new git_snapshot_port_js_1.NullGitSnapshotV2(),
142
144
  aliasStore: tokenAliasStore,
143
145
  entropy,
144
146
  cleanResponseFormat: ctx.featureFlags?.isEnabled('cleanResponseFormat') ?? false,
@@ -45,9 +45,10 @@ const token_codec_ports_js_1 = require("../v2/durable-core/tokens/token-codec-po
45
45
  const validation_js_1 = require("../application/validation.js");
46
46
  const v1_to_v2_shim_js_1 = require("../v2/read-only/v1-to-v2-shim.js");
47
47
  const index_js_1 = require("../v2/infra/local/workspace-anchor/index.js");
48
+ const index_js_2 = require("../v2/infra/local/git-snapshot/index.js");
48
49
  const workspace_roots_manager_js_1 = require("./workspace-roots-manager.js");
49
- const index_js_2 = require("../v2/infra/local/directory-listing/index.js");
50
- const index_js_3 = require("../v2/infra/local/session-summary-provider/index.js");
50
+ const index_js_3 = require("../v2/infra/local/directory-listing/index.js");
51
+ const index_js_4 = require("../v2/infra/local/session-summary-provider/index.js");
51
52
  const tool_factory_js_1 = require("./tool-factory.js");
52
53
  const dev_mode_js_1 = require("./dev-mode.js");
53
54
  const tool_call_timing_js_1 = require("./tool-call-timing.js");
@@ -97,7 +98,7 @@ async function createToolContext() {
97
98
  });
98
99
  const dataDir = container_js_1.container.resolve(tokens_js_1.DI.V2.DataDir);
99
100
  const fsPort = container_js_1.container.resolve(tokens_js_1.DI.V2.FileSystem);
100
- const directoryListing = new index_js_2.LocalDirectoryListingV2(fsPort);
101
+ const directoryListing = new index_js_3.LocalDirectoryListingV2(fsPort);
101
102
  const validationEngine = container_js_1.container.resolve(tokens_js_1.DI.Infra.ValidationEngine);
102
103
  const compiler = container_js_1.container.resolve(tokens_js_1.DI.Services.WorkflowCompiler);
103
104
  const validationPipelineDeps = {
@@ -129,9 +130,10 @@ async function createToolContext() {
129
130
  validationPipelineDeps,
130
131
  resolvedRootUris: [],
131
132
  workspaceResolver: new index_js_1.LocalWorkspaceAnchorV2(process.cwd()),
133
+ gitSnapshot: new index_js_2.LocalGitSnapshotV2(),
132
134
  dataDir,
133
135
  directoryListing,
134
- sessionSummaryProvider: new index_js_3.LocalSessionSummaryProviderV2({
136
+ sessionSummaryProvider: new index_js_4.LocalSessionSummaryProviderV2({
135
137
  directoryListing,
136
138
  dataDir,
137
139
  sessionStore,
@@ -19,6 +19,7 @@ import type { ValidationPipelineDepsPhase1a } from '../application/services/work
19
19
  import type { TokenAliasStorePortV2 } from '../v2/ports/token-alias-store.port.js';
20
20
  import type { RandomEntropyPortV2 } from '../v2/ports/random-entropy.port.js';
21
21
  import type { RememberedRootsStorePortV2 } from '../v2/ports/remembered-roots-store.port.js';
22
+ import type { GitSnapshotPortV2 } from '../v2/ports/git-snapshot.port.js';
22
23
  import type { ManagedSourceStorePortV2 } from '../v2/ports/managed-source-store.port.js';
23
24
  export interface SessionHealthDetails {
24
25
  readonly health: SessionHealthV2;
@@ -66,6 +67,7 @@ export interface V2Dependencies {
66
67
  readonly validationPipelineDeps: ValidationPipelineDepsPhase1a;
67
68
  readonly resolvedRootUris?: readonly string[];
68
69
  readonly workspaceResolver?: WorkspaceContextResolverPortV2;
70
+ readonly gitSnapshot?: GitSnapshotPortV2;
69
71
  readonly dataDir?: DataDirPortV2;
70
72
  readonly directoryListing?: DirectoryListingPortV2;
71
73
  readonly sessionSummaryProvider?: SessionSummaryProviderPortV2;