@dzhechkov/harness-core 0.3.145 → 0.3.147
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/.dz-manifest.json +82 -34
- package/README.md +3 -1
- package/dist/compounding.d.ts +27 -0
- package/dist/compounding.d.ts.map +1 -1
- package/dist/compounding.js +29 -0
- package/dist/compounding.js.map +1 -1
- package/dist/cost-ledger.d.ts +318 -0
- package/dist/cost-ledger.d.ts.map +1 -0
- package/dist/cost-ledger.js +871 -0
- package/dist/cost-ledger.js.map +1 -0
- package/dist/cost-scoring.d.ts +9 -0
- package/dist/cost-scoring.d.ts.map +1 -1
- package/dist/cost-scoring.js +18 -0
- package/dist/cost-scoring.js.map +1 -1
- package/dist/event-chain.d.ts +302 -0
- package/dist/event-chain.d.ts.map +1 -0
- package/dist/event-chain.js +663 -0
- package/dist/event-chain.js.map +1 -0
- package/dist/index.d.ts +9 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/operations.d.ts.map +1 -1
- package/dist/operations.js +26 -0
- package/dist/operations.js.map +1 -1
- package/dist/recall-usage.d.ts +52 -4
- package/dist/recall-usage.d.ts.map +1 -1
- package/dist/recall-usage.js +106 -21
- package/dist/recall-usage.js.map +1 -1
- package/dist/usage.d.ts +32 -0
- package/dist/usage.d.ts.map +1 -1
- package/dist/usage.js +59 -10
- package/dist/usage.js.map +1 -1
- package/package.json +3 -3
- package/sbom.json +153 -33
- package/src/compounding.ts +61 -0
- package/src/cost-ledger.ts +1105 -0
- package/src/cost-scoring.ts +17 -0
- package/src/event-chain.ts +870 -0
- package/src/index.ts +86 -0
- package/src/operations.ts +25 -0
- package/src/recall-usage.ts +142 -24
- package/src/usage.ts +74 -12
package/sbom.json
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"hashes": [
|
|
26
26
|
{
|
|
27
27
|
"alg": "SHA-256",
|
|
28
|
-
"content": "
|
|
28
|
+
"content": "3f150cc9734f8ed97077ab0ab609c705d8252c7039de89b591c6254505e54fe5"
|
|
29
29
|
}
|
|
30
30
|
]
|
|
31
31
|
},
|
|
@@ -615,7 +615,7 @@
|
|
|
615
615
|
"hashes": [
|
|
616
616
|
{
|
|
617
617
|
"alg": "SHA-256",
|
|
618
|
-
"content": "
|
|
618
|
+
"content": "26f6cf197298e8ccf61d72bb26d6f5e88a3d58af3ff0b3351f44755c5acff1da"
|
|
619
619
|
}
|
|
620
620
|
]
|
|
621
621
|
},
|
|
@@ -625,7 +625,7 @@
|
|
|
625
625
|
"hashes": [
|
|
626
626
|
{
|
|
627
627
|
"alg": "SHA-256",
|
|
628
|
-
"content": "
|
|
628
|
+
"content": "571ea5e0ebb71a5325da6171b09affeb6ba3d4b759d0eb4cc8d3af57dd369104"
|
|
629
629
|
}
|
|
630
630
|
]
|
|
631
631
|
},
|
|
@@ -635,7 +635,7 @@
|
|
|
635
635
|
"hashes": [
|
|
636
636
|
{
|
|
637
637
|
"alg": "SHA-256",
|
|
638
|
-
"content": "
|
|
638
|
+
"content": "83db18eb05a6400809b7c1624e3df24f40f1050b39f022d87448d8017399e4e0"
|
|
639
639
|
}
|
|
640
640
|
]
|
|
641
641
|
},
|
|
@@ -645,7 +645,47 @@
|
|
|
645
645
|
"hashes": [
|
|
646
646
|
{
|
|
647
647
|
"alg": "SHA-256",
|
|
648
|
-
"content": "
|
|
648
|
+
"content": "f353339d08c311fb69d44960e97bcc9ddfc01d7bdb8c3ae26e9884a494c0338f"
|
|
649
|
+
}
|
|
650
|
+
]
|
|
651
|
+
},
|
|
652
|
+
{
|
|
653
|
+
"type": "file",
|
|
654
|
+
"name": "dist/cost-ledger.d.ts",
|
|
655
|
+
"hashes": [
|
|
656
|
+
{
|
|
657
|
+
"alg": "SHA-256",
|
|
658
|
+
"content": "872006c1a6dac23672b6879fa5b7506d2ce7e57f9682d518ffd986e9522e623f"
|
|
659
|
+
}
|
|
660
|
+
]
|
|
661
|
+
},
|
|
662
|
+
{
|
|
663
|
+
"type": "file",
|
|
664
|
+
"name": "dist/cost-ledger.d.ts.map",
|
|
665
|
+
"hashes": [
|
|
666
|
+
{
|
|
667
|
+
"alg": "SHA-256",
|
|
668
|
+
"content": "8df65b2795b029e0c8a1e3de73593d487ab4b730be134646215935d0a6c73709"
|
|
669
|
+
}
|
|
670
|
+
]
|
|
671
|
+
},
|
|
672
|
+
{
|
|
673
|
+
"type": "file",
|
|
674
|
+
"name": "dist/cost-ledger.js",
|
|
675
|
+
"hashes": [
|
|
676
|
+
{
|
|
677
|
+
"alg": "SHA-256",
|
|
678
|
+
"content": "da9c70db0807f05b19825a5344d3f73ff11e3759ad5be8b2db75c259be2e0580"
|
|
679
|
+
}
|
|
680
|
+
]
|
|
681
|
+
},
|
|
682
|
+
{
|
|
683
|
+
"type": "file",
|
|
684
|
+
"name": "dist/cost-ledger.js.map",
|
|
685
|
+
"hashes": [
|
|
686
|
+
{
|
|
687
|
+
"alg": "SHA-256",
|
|
688
|
+
"content": "48aa21f898920731f12e1454793f6d4bb9bcc4d0b1bef519bf1f7df87b7723f6"
|
|
649
689
|
}
|
|
650
690
|
]
|
|
651
691
|
},
|
|
@@ -655,7 +695,7 @@
|
|
|
655
695
|
"hashes": [
|
|
656
696
|
{
|
|
657
697
|
"alg": "SHA-256",
|
|
658
|
-
"content": "
|
|
698
|
+
"content": "be1b6a913c8ed391e12a3e0d703733fdbca0d7975d2f40a895f85921583220da"
|
|
659
699
|
}
|
|
660
700
|
]
|
|
661
701
|
},
|
|
@@ -665,7 +705,7 @@
|
|
|
665
705
|
"hashes": [
|
|
666
706
|
{
|
|
667
707
|
"alg": "SHA-256",
|
|
668
|
-
"content": "
|
|
708
|
+
"content": "04a3e07b206bf9f88750bdf061b7370558f6a6af95e109347cf18d92dbc22437"
|
|
669
709
|
}
|
|
670
710
|
]
|
|
671
711
|
},
|
|
@@ -675,7 +715,7 @@
|
|
|
675
715
|
"hashes": [
|
|
676
716
|
{
|
|
677
717
|
"alg": "SHA-256",
|
|
678
|
-
"content": "
|
|
718
|
+
"content": "27a8789698060e69be20fe2beccf792603ad3b414aa95563e1cccddb7ab4a8cc"
|
|
679
719
|
}
|
|
680
720
|
]
|
|
681
721
|
},
|
|
@@ -685,7 +725,7 @@
|
|
|
685
725
|
"hashes": [
|
|
686
726
|
{
|
|
687
727
|
"alg": "SHA-256",
|
|
688
|
-
"content": "
|
|
728
|
+
"content": "fe5762b4ac2c5249116c5a18223cf41e87510feb498a8d0663a2bd6a2cadf074"
|
|
689
729
|
}
|
|
690
730
|
]
|
|
691
731
|
},
|
|
@@ -929,6 +969,46 @@
|
|
|
929
969
|
}
|
|
930
970
|
]
|
|
931
971
|
},
|
|
972
|
+
{
|
|
973
|
+
"type": "file",
|
|
974
|
+
"name": "dist/event-chain.d.ts",
|
|
975
|
+
"hashes": [
|
|
976
|
+
{
|
|
977
|
+
"alg": "SHA-256",
|
|
978
|
+
"content": "ded196d2527e16e60981cef9d2502d1d5eeedbaa7c40be95ac178522682d1693"
|
|
979
|
+
}
|
|
980
|
+
]
|
|
981
|
+
},
|
|
982
|
+
{
|
|
983
|
+
"type": "file",
|
|
984
|
+
"name": "dist/event-chain.d.ts.map",
|
|
985
|
+
"hashes": [
|
|
986
|
+
{
|
|
987
|
+
"alg": "SHA-256",
|
|
988
|
+
"content": "06e9f082b4e361b796042815bd75d807231d98965e9acbbb63d500efa932a87d"
|
|
989
|
+
}
|
|
990
|
+
]
|
|
991
|
+
},
|
|
992
|
+
{
|
|
993
|
+
"type": "file",
|
|
994
|
+
"name": "dist/event-chain.js",
|
|
995
|
+
"hashes": [
|
|
996
|
+
{
|
|
997
|
+
"alg": "SHA-256",
|
|
998
|
+
"content": "8ad73164e893627c867468a21bc5dd1386dd82adb3ea06b2b785cfa7415d558b"
|
|
999
|
+
}
|
|
1000
|
+
]
|
|
1001
|
+
},
|
|
1002
|
+
{
|
|
1003
|
+
"type": "file",
|
|
1004
|
+
"name": "dist/event-chain.js.map",
|
|
1005
|
+
"hashes": [
|
|
1006
|
+
{
|
|
1007
|
+
"alg": "SHA-256",
|
|
1008
|
+
"content": "a874ba52b35ed445f2310a04bb0fbdb0ba34db18601d0086e7e666b7bafc8a16"
|
|
1009
|
+
}
|
|
1010
|
+
]
|
|
1011
|
+
},
|
|
932
1012
|
{
|
|
933
1013
|
"type": "file",
|
|
934
1014
|
"name": "dist/feature-adr-claim-gate.d.ts",
|
|
@@ -1175,7 +1255,7 @@
|
|
|
1175
1255
|
"hashes": [
|
|
1176
1256
|
{
|
|
1177
1257
|
"alg": "SHA-256",
|
|
1178
|
-
"content": "
|
|
1258
|
+
"content": "84fc227b59f6ae02326b366860eba86a91402c9c1b63dc93e05829e864e79dfc"
|
|
1179
1259
|
}
|
|
1180
1260
|
]
|
|
1181
1261
|
},
|
|
@@ -1185,7 +1265,7 @@
|
|
|
1185
1265
|
"hashes": [
|
|
1186
1266
|
{
|
|
1187
1267
|
"alg": "SHA-256",
|
|
1188
|
-
"content": "
|
|
1268
|
+
"content": "441c711a53d331714f0deeea05dcbdc484900ca488c3e60c6488e186f556ce32"
|
|
1189
1269
|
}
|
|
1190
1270
|
]
|
|
1191
1271
|
},
|
|
@@ -1195,7 +1275,7 @@
|
|
|
1195
1275
|
"hashes": [
|
|
1196
1276
|
{
|
|
1197
1277
|
"alg": "SHA-256",
|
|
1198
|
-
"content": "
|
|
1278
|
+
"content": "a5b73c6bf53a7638adbba592757ac470a28b77a613a316760d9c2b59fbb8f7c5"
|
|
1199
1279
|
}
|
|
1200
1280
|
]
|
|
1201
1281
|
},
|
|
@@ -1205,7 +1285,7 @@
|
|
|
1205
1285
|
"hashes": [
|
|
1206
1286
|
{
|
|
1207
1287
|
"alg": "SHA-256",
|
|
1208
|
-
"content": "
|
|
1288
|
+
"content": "f060b457663973b21d4b5f803f0b8a3fdfc6c34736bd855ee4d63cfe9108095e"
|
|
1209
1289
|
}
|
|
1210
1290
|
]
|
|
1211
1291
|
},
|
|
@@ -1305,7 +1385,7 @@
|
|
|
1305
1385
|
"hashes": [
|
|
1306
1386
|
{
|
|
1307
1387
|
"alg": "SHA-256",
|
|
1308
|
-
"content": "
|
|
1388
|
+
"content": "ce02526852f7c5d8579a5384f4aa9aafb7b099fdfc61c1482aa969bff7407a24"
|
|
1309
1389
|
}
|
|
1310
1390
|
]
|
|
1311
1391
|
},
|
|
@@ -1315,7 +1395,7 @@
|
|
|
1315
1395
|
"hashes": [
|
|
1316
1396
|
{
|
|
1317
1397
|
"alg": "SHA-256",
|
|
1318
|
-
"content": "
|
|
1398
|
+
"content": "b7b9bda39dc55594375688740b9d717d07ea2f12166fbee14a29f62868268a9c"
|
|
1319
1399
|
}
|
|
1320
1400
|
]
|
|
1321
1401
|
},
|
|
@@ -1325,7 +1405,7 @@
|
|
|
1325
1405
|
"hashes": [
|
|
1326
1406
|
{
|
|
1327
1407
|
"alg": "SHA-256",
|
|
1328
|
-
"content": "
|
|
1408
|
+
"content": "bf83c2c1af9481f4e03db72553b2d8c3b5b8ad2f87f0aab7e4d579f32e4a32d6"
|
|
1329
1409
|
}
|
|
1330
1410
|
]
|
|
1331
1411
|
},
|
|
@@ -1695,7 +1775,7 @@
|
|
|
1695
1775
|
"hashes": [
|
|
1696
1776
|
{
|
|
1697
1777
|
"alg": "SHA-256",
|
|
1698
|
-
"content": "
|
|
1778
|
+
"content": "412aa688ee1fb6bd6c132ad2f97421d6330846de1743b9461436051f29dead15"
|
|
1699
1779
|
}
|
|
1700
1780
|
]
|
|
1701
1781
|
},
|
|
@@ -1705,7 +1785,7 @@
|
|
|
1705
1785
|
"hashes": [
|
|
1706
1786
|
{
|
|
1707
1787
|
"alg": "SHA-256",
|
|
1708
|
-
"content": "
|
|
1788
|
+
"content": "758657ff3c0aef6919351af23fc229617576263d24d36b2400f5ffe43f8d1384"
|
|
1709
1789
|
}
|
|
1710
1790
|
]
|
|
1711
1791
|
},
|
|
@@ -1715,7 +1795,7 @@
|
|
|
1715
1795
|
"hashes": [
|
|
1716
1796
|
{
|
|
1717
1797
|
"alg": "SHA-256",
|
|
1718
|
-
"content": "
|
|
1798
|
+
"content": "b3603074fa6c80ee1dad75fe6f93b44f90dcfcbad81325ecca379f70c9f2fd60"
|
|
1719
1799
|
}
|
|
1720
1800
|
]
|
|
1721
1801
|
},
|
|
@@ -1725,7 +1805,7 @@
|
|
|
1725
1805
|
"hashes": [
|
|
1726
1806
|
{
|
|
1727
1807
|
"alg": "SHA-256",
|
|
1728
|
-
"content": "
|
|
1808
|
+
"content": "e4103c95577ac2876df7f604b1fa1c9e590e9a0df7185abc0f9d9f5bdc18ff1f"
|
|
1729
1809
|
}
|
|
1730
1810
|
]
|
|
1731
1811
|
},
|
|
@@ -2535,7 +2615,7 @@
|
|
|
2535
2615
|
"hashes": [
|
|
2536
2616
|
{
|
|
2537
2617
|
"alg": "SHA-256",
|
|
2538
|
-
"content": "
|
|
2618
|
+
"content": "a03311bd06b17ee842215a65755d08d0c1e07188af344c495f73d7c5196c163f"
|
|
2539
2619
|
}
|
|
2540
2620
|
]
|
|
2541
2621
|
},
|
|
@@ -2545,7 +2625,7 @@
|
|
|
2545
2625
|
"hashes": [
|
|
2546
2626
|
{
|
|
2547
2627
|
"alg": "SHA-256",
|
|
2548
|
-
"content": "
|
|
2628
|
+
"content": "33eb02f603e5b668dbfa4af6ed5747d039e2562c5e018c149c21c3c4eed9549c"
|
|
2549
2629
|
}
|
|
2550
2630
|
]
|
|
2551
2631
|
},
|
|
@@ -2555,7 +2635,7 @@
|
|
|
2555
2635
|
"hashes": [
|
|
2556
2636
|
{
|
|
2557
2637
|
"alg": "SHA-256",
|
|
2558
|
-
"content": "
|
|
2638
|
+
"content": "065a9b2209111adcc448d53191ed37a08db09029cf89188446186bc284ff45bf"
|
|
2559
2639
|
}
|
|
2560
2640
|
]
|
|
2561
2641
|
},
|
|
@@ -2565,7 +2645,7 @@
|
|
|
2565
2645
|
"hashes": [
|
|
2566
2646
|
{
|
|
2567
2647
|
"alg": "SHA-256",
|
|
2568
|
-
"content": "
|
|
2648
|
+
"content": "e1562daf935c8e1f0dd0f3372cd5ff9c999d137d80fd900d06cd62e8b511ebb1"
|
|
2569
2649
|
}
|
|
2570
2650
|
]
|
|
2571
2651
|
},
|
|
@@ -2655,7 +2735,7 @@
|
|
|
2655
2735
|
"hashes": [
|
|
2656
2736
|
{
|
|
2657
2737
|
"alg": "SHA-256",
|
|
2658
|
-
"content": "
|
|
2738
|
+
"content": "3a43b9ad9634b8242d96045c423cd09e03637c53761a91d56462cc45fca0dadf"
|
|
2659
2739
|
}
|
|
2660
2740
|
]
|
|
2661
2741
|
},
|
|
@@ -2805,7 +2885,17 @@
|
|
|
2805
2885
|
"hashes": [
|
|
2806
2886
|
{
|
|
2807
2887
|
"alg": "SHA-256",
|
|
2808
|
-
"content": "
|
|
2888
|
+
"content": "1b20b2b6ababea386d195ab3481a0af6582fda2757720732b5098e162964da32"
|
|
2889
|
+
}
|
|
2890
|
+
]
|
|
2891
|
+
},
|
|
2892
|
+
{
|
|
2893
|
+
"type": "file",
|
|
2894
|
+
"name": "src/cost-ledger.ts",
|
|
2895
|
+
"hashes": [
|
|
2896
|
+
{
|
|
2897
|
+
"alg": "SHA-256",
|
|
2898
|
+
"content": "0658e1caedea358d50e69c5b52ac704b29f614349b7527b2ddd0f82911428abd"
|
|
2809
2899
|
}
|
|
2810
2900
|
]
|
|
2811
2901
|
},
|
|
@@ -2815,7 +2905,7 @@
|
|
|
2815
2905
|
"hashes": [
|
|
2816
2906
|
{
|
|
2817
2907
|
"alg": "SHA-256",
|
|
2818
|
-
"content": "
|
|
2908
|
+
"content": "8ca46e3e1396242f91fbd517b76ebbdf775d3540a033208ba0f0ca33d779d07a"
|
|
2819
2909
|
}
|
|
2820
2910
|
]
|
|
2821
2911
|
},
|
|
@@ -2879,6 +2969,16 @@
|
|
|
2879
2969
|
}
|
|
2880
2970
|
]
|
|
2881
2971
|
},
|
|
2972
|
+
{
|
|
2973
|
+
"type": "file",
|
|
2974
|
+
"name": "src/event-chain.ts",
|
|
2975
|
+
"hashes": [
|
|
2976
|
+
{
|
|
2977
|
+
"alg": "SHA-256",
|
|
2978
|
+
"content": "f8306131a5021167169b525733da711ff378382f0a7368376f35834c350a9e23"
|
|
2979
|
+
}
|
|
2980
|
+
]
|
|
2981
|
+
},
|
|
2882
2982
|
{
|
|
2883
2983
|
"type": "file",
|
|
2884
2984
|
"name": "src/feature-adr-claim-gate.ts",
|
|
@@ -2945,7 +3045,7 @@
|
|
|
2945
3045
|
"hashes": [
|
|
2946
3046
|
{
|
|
2947
3047
|
"alg": "SHA-256",
|
|
2948
|
-
"content": "
|
|
3048
|
+
"content": "d16a13dfe781142b154b9d21a0f6a98cddc1e47505e7a500bc7a53b7377961a3"
|
|
2949
3049
|
}
|
|
2950
3050
|
]
|
|
2951
3051
|
},
|
|
@@ -2975,7 +3075,7 @@
|
|
|
2975
3075
|
"hashes": [
|
|
2976
3076
|
{
|
|
2977
3077
|
"alg": "SHA-256",
|
|
2978
|
-
"content": "
|
|
3078
|
+
"content": "939e75c6a80e5812a3ab5f3ebc5fe39dd646211a27077fb47f499ecab53e790c"
|
|
2979
3079
|
}
|
|
2980
3080
|
]
|
|
2981
3081
|
},
|
|
@@ -3065,7 +3165,7 @@
|
|
|
3065
3165
|
"hashes": [
|
|
3066
3166
|
{
|
|
3067
3167
|
"alg": "SHA-256",
|
|
3068
|
-
"content": "
|
|
3168
|
+
"content": "71a1e596f5f877b4ecb04cebf0670922824d0466488302e1ba9553407dfbe9af"
|
|
3069
3169
|
}
|
|
3070
3170
|
]
|
|
3071
3171
|
},
|
|
@@ -3275,7 +3375,7 @@
|
|
|
3275
3375
|
"hashes": [
|
|
3276
3376
|
{
|
|
3277
3377
|
"alg": "SHA-256",
|
|
3278
|
-
"content": "
|
|
3378
|
+
"content": "317fc95287308a8d7ea92222d234bf62f8415ab97e40c8ceaf2f6a3f1ac5d80c"
|
|
3279
3379
|
}
|
|
3280
3380
|
]
|
|
3281
3381
|
},
|
|
@@ -3465,7 +3565,17 @@
|
|
|
3465
3565
|
"hashes": [
|
|
3466
3566
|
{
|
|
3467
3567
|
"alg": "SHA-256",
|
|
3468
|
-
"content": "
|
|
3568
|
+
"content": "89265131de29a2841e73068e4be256e1cbe7bd8dbd0c8eacc79039626b41e6f0"
|
|
3569
|
+
}
|
|
3570
|
+
]
|
|
3571
|
+
},
|
|
3572
|
+
{
|
|
3573
|
+
"type": "file",
|
|
3574
|
+
"name": "test/cost-ledger.test.ts",
|
|
3575
|
+
"hashes": [
|
|
3576
|
+
{
|
|
3577
|
+
"alg": "SHA-256",
|
|
3578
|
+
"content": "75a5d06f5221fed7f98997a544c880836ead6fe74cc03ebe8c1a0875fb48ad9c"
|
|
3469
3579
|
}
|
|
3470
3580
|
]
|
|
3471
3581
|
},
|
|
@@ -3569,6 +3679,16 @@
|
|
|
3569
3679
|
}
|
|
3570
3680
|
]
|
|
3571
3681
|
},
|
|
3682
|
+
{
|
|
3683
|
+
"type": "file",
|
|
3684
|
+
"name": "test/event-chain.test.ts",
|
|
3685
|
+
"hashes": [
|
|
3686
|
+
{
|
|
3687
|
+
"alg": "SHA-256",
|
|
3688
|
+
"content": "b5addb1026c8b408e49fee9e561c12ea22d8b4e94ae7092ebe60419c7a384ab6"
|
|
3689
|
+
}
|
|
3690
|
+
]
|
|
3691
|
+
},
|
|
3572
3692
|
{
|
|
3573
3693
|
"type": "file",
|
|
3574
3694
|
"name": "test/feature-adr-abs-paths.test.ts",
|
|
@@ -3805,7 +3925,7 @@
|
|
|
3805
3925
|
"hashes": [
|
|
3806
3926
|
{
|
|
3807
3927
|
"alg": "SHA-256",
|
|
3808
|
-
"content": "
|
|
3928
|
+
"content": "a26d2b3cc2434cc0846e73c1c6d5c6d7223e5be5a24217b75f62d494affa2089"
|
|
3809
3929
|
}
|
|
3810
3930
|
]
|
|
3811
3931
|
},
|
package/src/compounding.ts
CHANGED
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
* Everything here is PURE: callers gather facts (files, store rows); this module only computes.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
+
import { EVENT_CHAIN_SCOPE, verifyEventChainText } from './event-chain.js';
|
|
19
|
+
|
|
18
20
|
// ── Seeded statistics (verbatim-shape port from darwin-mode bench/stats.ts) ──
|
|
19
21
|
|
|
20
22
|
/** Deterministic PRNG — same seed, same stream, byte-identical reports. */
|
|
@@ -153,11 +155,24 @@ export interface GuardEvent {
|
|
|
153
155
|
readonly rules: readonly string[]; // violated rule ids
|
|
154
156
|
}
|
|
155
157
|
|
|
158
|
+
/**
|
|
159
|
+
* A raw evidence log, handed over verbatim so the chain verdict has exactly ONE definition
|
|
160
|
+
* (`verifyEventChainText`) instead of a CLI-side copy that can drift from it — the drift class this
|
|
161
|
+
* repo keeps catching. Absent ⇒ the report simply has no chain line.
|
|
162
|
+
*/
|
|
163
|
+
export interface EvidenceLogFact {
|
|
164
|
+
/** Display label, e.g. `.dz/recall-usage.jsonl`. */
|
|
165
|
+
readonly log: string;
|
|
166
|
+
readonly text: string;
|
|
167
|
+
}
|
|
168
|
+
|
|
156
169
|
export interface CompoundingFacts {
|
|
157
170
|
readonly lessons: readonly LessonRow[];
|
|
158
171
|
readonly usage: readonly UsageEvent[];
|
|
159
172
|
readonly guard: readonly GuardEvent[];
|
|
160
173
|
readonly nowTs: string;
|
|
174
|
+
/** The evidence logs themselves — verified as hash chains (feature event-chain, ADR-001). */
|
|
175
|
+
readonly evidenceLogs?: readonly EvidenceLogFact[];
|
|
161
176
|
}
|
|
162
177
|
|
|
163
178
|
// ── The report ──────────────────────────────────────────────────────
|
|
@@ -197,11 +212,27 @@ export interface ReplayReadiness {
|
|
|
197
212
|
readonly note: string;
|
|
198
213
|
}
|
|
199
214
|
|
|
215
|
+
/** Per-log chain health — an INSTRUMENTATION fact about the evidence, not a learning verdict. */
|
|
216
|
+
export interface EvidenceChainHealth {
|
|
217
|
+
readonly log: string;
|
|
218
|
+
readonly ok: boolean;
|
|
219
|
+
readonly chained: number;
|
|
220
|
+
/** Records written before chaining existed: LEGAL, and honestly reported as uncovered. */
|
|
221
|
+
readonly preChainPrefix: number;
|
|
222
|
+
readonly defects: number;
|
|
223
|
+
readonly defectKinds: readonly string[];
|
|
224
|
+
}
|
|
225
|
+
|
|
200
226
|
export interface InstrumentationHealth {
|
|
201
227
|
readonly lastUsageTs: string | null;
|
|
202
228
|
readonly gapDays: number | null;
|
|
203
229
|
/** True when the newest usage record is recent enough to trust the leg is alive. */
|
|
204
230
|
readonly applyLegLive: boolean;
|
|
231
|
+
/** One entry per evidence log handed in. Empty when no logs were provided. */
|
|
232
|
+
readonly chains: readonly EvidenceChainHealth[];
|
|
233
|
+
/** True when every provided log verifies. Vacuously true when none were provided — that is why
|
|
234
|
+
* {@link EvidenceChainHealth} carries the counts: "no logs" must not read like "all clean". */
|
|
235
|
+
readonly chainsOk: boolean;
|
|
205
236
|
}
|
|
206
237
|
|
|
207
238
|
export interface CompoundingReport {
|
|
@@ -306,10 +337,26 @@ export function assembleCompoundingReport(facts: CompoundingFacts): CompoundingR
|
|
|
306
337
|
const CLOCK_SKEW_MS = 60_000;
|
|
307
338
|
const gapMs = lastUsage && Number.isFinite(nowMs) ? nowMs - lastUsage.ms : null;
|
|
308
339
|
const gapValid = gapMs !== null && gapMs >= -CLOCK_SKEW_MS;
|
|
340
|
+
// 4b. Evidence-chain health. The numbers above are only worth as much as the log they came from,
|
|
341
|
+
// and a compaction bug already inflated that log once (2 → 4 → 6, fixed 2026-07-28).
|
|
342
|
+
const chains: EvidenceChainHealth[] = (facts.evidenceLogs ?? []).map((f) => {
|
|
343
|
+
const v = verifyEventChainText(typeof f.text === 'string' ? f.text : '');
|
|
344
|
+
return {
|
|
345
|
+
log: f.log,
|
|
346
|
+
ok: v.ok,
|
|
347
|
+
chained: v.chained,
|
|
348
|
+
preChainPrefix: v.preChainPrefix,
|
|
349
|
+
defects: v.defects.length,
|
|
350
|
+
defectKinds: [...new Set(v.defects.map((d) => d.kind))],
|
|
351
|
+
};
|
|
352
|
+
});
|
|
353
|
+
|
|
309
354
|
const instrumentation: InstrumentationHealth = {
|
|
310
355
|
lastUsageTs: lastUsage?.ts ?? null,
|
|
311
356
|
gapDays: gapValid ? Math.max(0, Math.floor(gapMs / 86_400_000)) : null,
|
|
312
357
|
applyLegLive: gapValid && gapMs <= APPLY_LEG_STALE_DAYS * 86_400_000,
|
|
358
|
+
chains,
|
|
359
|
+
chainsOk: chains.every((c) => c.ok),
|
|
313
360
|
};
|
|
314
361
|
|
|
315
362
|
const improvedRules = trajectory.filter((t) => t.improved).length;
|
|
@@ -318,6 +365,13 @@ export function assembleCompoundingReport(facts: CompoundingFacts): CompoundingR
|
|
|
318
365
|
trajectory.length > 0 ? `guard: ${improvedRules}/${trajectory.length} rules recur less in the later half` : 'guard: not enough history',
|
|
319
366
|
`cold-vs-warm: ${replay.verdict === 'insufficient-data' ? 'INSUFFICIENT DATA (accruing)' : 'READY to measure'}`,
|
|
320
367
|
instrumentation.applyLegLive ? 'apply leg: live' : 'apply leg: STALE — fix the instrumentation before trusting anything above',
|
|
368
|
+
...(chains.length === 0
|
|
369
|
+
? []
|
|
370
|
+
: [
|
|
371
|
+
instrumentation.chainsOk
|
|
372
|
+
? 'evidence chain: verified'
|
|
373
|
+
: 'evidence chain: CORRUPT — the numbers above are computed from a damaged log',
|
|
374
|
+
]),
|
|
321
375
|
].join(' · ');
|
|
322
376
|
|
|
323
377
|
return { pool, guardTrajectory: trajectory, replay, instrumentation, verdict };
|
|
@@ -345,6 +399,13 @@ export function renderCompoundingReport(r: CompoundingReport): string {
|
|
|
345
399
|
(r.instrumentation.gapDays !== null ? ` (${r.instrumentation.gapDays}d ago)` : '') +
|
|
346
400
|
` — ${r.instrumentation.applyLegLive ? 'live' : 'STALE'}`,
|
|
347
401
|
);
|
|
402
|
+
for (const c of r.instrumentation.chains) {
|
|
403
|
+
out.push(
|
|
404
|
+
` EVIDENCE CHAIN ${c.log}: ${c.ok ? 'verified' : `FAILED — ${c.defects} defect(s) [${c.defectKinds.join(', ')}]`}` +
|
|
405
|
+
` · ${c.chained} chained · ${c.preChainPrefix} pre-chain (uncovered)`,
|
|
406
|
+
);
|
|
407
|
+
}
|
|
408
|
+
if (r.instrumentation.chains.length > 0) out.push(` scope: ${EVENT_CHAIN_SCOPE}`);
|
|
348
409
|
out.push('');
|
|
349
410
|
out.push(` VERDICT: ${r.verdict}`);
|
|
350
411
|
return out.join('\n');
|