@dzhechkov/harness-core 0.3.144 → 0.3.146
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 +77 -29
- package/README.md +2 -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/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/guard-promotion.d.ts +364 -0
- package/dist/guard-promotion.d.ts.map +1 -0
- package/dist/guard-promotion.js +760 -0
- package/dist/guard-promotion.js.map +1 -0
- package/dist/guard.d.ts +33 -1
- package/dist/guard.d.ts.map +1 -1
- package/dist/guard.js +57 -3
- package/dist/guard.js.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- 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/package.json +3 -3
- package/sbom.json +148 -28
- package/src/compounding.ts +61 -0
- package/src/event-chain.ts +870 -0
- package/src/guard-promotion.ts +958 -0
- package/src/guard.ts +76 -3
- package/src/index.ts +52 -0
- package/src/operations.ts +25 -0
- package/src/recall-usage.ts +142 -24
package/sbom.json
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"hashes": [
|
|
26
26
|
{
|
|
27
27
|
"alg": "SHA-256",
|
|
28
|
-
"content": "
|
|
28
|
+
"content": "3ce64136feb92682d69ed9b8275ff1f894a4007826d8a2b115b260021bc0f42d"
|
|
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,7 @@
|
|
|
645
645
|
"hashes": [
|
|
646
646
|
{
|
|
647
647
|
"alg": "SHA-256",
|
|
648
|
-
"content": "
|
|
648
|
+
"content": "f353339d08c311fb69d44960e97bcc9ddfc01d7bdb8c3ae26e9884a494c0338f"
|
|
649
649
|
}
|
|
650
650
|
]
|
|
651
651
|
},
|
|
@@ -929,6 +929,46 @@
|
|
|
929
929
|
}
|
|
930
930
|
]
|
|
931
931
|
},
|
|
932
|
+
{
|
|
933
|
+
"type": "file",
|
|
934
|
+
"name": "dist/event-chain.d.ts",
|
|
935
|
+
"hashes": [
|
|
936
|
+
{
|
|
937
|
+
"alg": "SHA-256",
|
|
938
|
+
"content": "ded196d2527e16e60981cef9d2502d1d5eeedbaa7c40be95ac178522682d1693"
|
|
939
|
+
}
|
|
940
|
+
]
|
|
941
|
+
},
|
|
942
|
+
{
|
|
943
|
+
"type": "file",
|
|
944
|
+
"name": "dist/event-chain.d.ts.map",
|
|
945
|
+
"hashes": [
|
|
946
|
+
{
|
|
947
|
+
"alg": "SHA-256",
|
|
948
|
+
"content": "06e9f082b4e361b796042815bd75d807231d98965e9acbbb63d500efa932a87d"
|
|
949
|
+
}
|
|
950
|
+
]
|
|
951
|
+
},
|
|
952
|
+
{
|
|
953
|
+
"type": "file",
|
|
954
|
+
"name": "dist/event-chain.js",
|
|
955
|
+
"hashes": [
|
|
956
|
+
{
|
|
957
|
+
"alg": "SHA-256",
|
|
958
|
+
"content": "8ad73164e893627c867468a21bc5dd1386dd82adb3ea06b2b785cfa7415d558b"
|
|
959
|
+
}
|
|
960
|
+
]
|
|
961
|
+
},
|
|
962
|
+
{
|
|
963
|
+
"type": "file",
|
|
964
|
+
"name": "dist/event-chain.js.map",
|
|
965
|
+
"hashes": [
|
|
966
|
+
{
|
|
967
|
+
"alg": "SHA-256",
|
|
968
|
+
"content": "a874ba52b35ed445f2310a04bb0fbdb0ba34db18601d0086e7e666b7bafc8a16"
|
|
969
|
+
}
|
|
970
|
+
]
|
|
971
|
+
},
|
|
932
972
|
{
|
|
933
973
|
"type": "file",
|
|
934
974
|
"name": "dist/feature-adr-claim-gate.d.ts",
|
|
@@ -1049,13 +1089,53 @@
|
|
|
1049
1089
|
}
|
|
1050
1090
|
]
|
|
1051
1091
|
},
|
|
1092
|
+
{
|
|
1093
|
+
"type": "file",
|
|
1094
|
+
"name": "dist/guard-promotion.d.ts",
|
|
1095
|
+
"hashes": [
|
|
1096
|
+
{
|
|
1097
|
+
"alg": "SHA-256",
|
|
1098
|
+
"content": "eba21256fa7ed8082acf9571c0606aa2926c0a13635fd994aa74f44d7f3db1d4"
|
|
1099
|
+
}
|
|
1100
|
+
]
|
|
1101
|
+
},
|
|
1102
|
+
{
|
|
1103
|
+
"type": "file",
|
|
1104
|
+
"name": "dist/guard-promotion.d.ts.map",
|
|
1105
|
+
"hashes": [
|
|
1106
|
+
{
|
|
1107
|
+
"alg": "SHA-256",
|
|
1108
|
+
"content": "6da389f6fbdae2b886d526db90b09ca7fabac88f26ff96e73cdfd98d1a6a90d4"
|
|
1109
|
+
}
|
|
1110
|
+
]
|
|
1111
|
+
},
|
|
1112
|
+
{
|
|
1113
|
+
"type": "file",
|
|
1114
|
+
"name": "dist/guard-promotion.js",
|
|
1115
|
+
"hashes": [
|
|
1116
|
+
{
|
|
1117
|
+
"alg": "SHA-256",
|
|
1118
|
+
"content": "a03bf0166ac3056d93c67a2571c6300cc92941424cc5a8aecce529a6879e4a47"
|
|
1119
|
+
}
|
|
1120
|
+
]
|
|
1121
|
+
},
|
|
1122
|
+
{
|
|
1123
|
+
"type": "file",
|
|
1124
|
+
"name": "dist/guard-promotion.js.map",
|
|
1125
|
+
"hashes": [
|
|
1126
|
+
{
|
|
1127
|
+
"alg": "SHA-256",
|
|
1128
|
+
"content": "858b3ad88b0c2fdf3a66a89075df493e3592cbf8c12f3df880be93a0e446ad8e"
|
|
1129
|
+
}
|
|
1130
|
+
]
|
|
1131
|
+
},
|
|
1052
1132
|
{
|
|
1053
1133
|
"type": "file",
|
|
1054
1134
|
"name": "dist/guard.d.ts",
|
|
1055
1135
|
"hashes": [
|
|
1056
1136
|
{
|
|
1057
1137
|
"alg": "SHA-256",
|
|
1058
|
-
"content": "
|
|
1138
|
+
"content": "5ac5bd9b2d927117d124861c5532a0618c5f3f4859b8a91a6b62203475db047e"
|
|
1059
1139
|
}
|
|
1060
1140
|
]
|
|
1061
1141
|
},
|
|
@@ -1065,7 +1145,7 @@
|
|
|
1065
1145
|
"hashes": [
|
|
1066
1146
|
{
|
|
1067
1147
|
"alg": "SHA-256",
|
|
1068
|
-
"content": "
|
|
1148
|
+
"content": "f56619488145d4ccdac45298cb76647ea670d5b37d210f30972b602d3fad5f24"
|
|
1069
1149
|
}
|
|
1070
1150
|
]
|
|
1071
1151
|
},
|
|
@@ -1075,7 +1155,7 @@
|
|
|
1075
1155
|
"hashes": [
|
|
1076
1156
|
{
|
|
1077
1157
|
"alg": "SHA-256",
|
|
1078
|
-
"content": "
|
|
1158
|
+
"content": "7dc53438c377aa007264384fc30f34764fcb969fd6d0bfae15a0b976bafd0e17"
|
|
1079
1159
|
}
|
|
1080
1160
|
]
|
|
1081
1161
|
},
|
|
@@ -1085,7 +1165,7 @@
|
|
|
1085
1165
|
"hashes": [
|
|
1086
1166
|
{
|
|
1087
1167
|
"alg": "SHA-256",
|
|
1088
|
-
"content": "
|
|
1168
|
+
"content": "389544fa42d0010f48ae1bccdd81170053fbd56d5131c1479db87535c9a34662"
|
|
1089
1169
|
}
|
|
1090
1170
|
]
|
|
1091
1171
|
},
|
|
@@ -1135,7 +1215,7 @@
|
|
|
1135
1215
|
"hashes": [
|
|
1136
1216
|
{
|
|
1137
1217
|
"alg": "SHA-256",
|
|
1138
|
-
"content": "
|
|
1218
|
+
"content": "c012cd5c1e1139755edd4a27daeef19e765d70f3764c0f074a0397b5f8252dac"
|
|
1139
1219
|
}
|
|
1140
1220
|
]
|
|
1141
1221
|
},
|
|
@@ -1145,7 +1225,7 @@
|
|
|
1145
1225
|
"hashes": [
|
|
1146
1226
|
{
|
|
1147
1227
|
"alg": "SHA-256",
|
|
1148
|
-
"content": "
|
|
1228
|
+
"content": "a0505d3d55931149733d95c1e294160395e221c567e92682acd4194c0c3d17fc"
|
|
1149
1229
|
}
|
|
1150
1230
|
]
|
|
1151
1231
|
},
|
|
@@ -1155,7 +1235,7 @@
|
|
|
1155
1235
|
"hashes": [
|
|
1156
1236
|
{
|
|
1157
1237
|
"alg": "SHA-256",
|
|
1158
|
-
"content": "
|
|
1238
|
+
"content": "07cf71990a2f7e7e126b02082ba82df93b99239e4ca4179c995cdfc00dcfb88c"
|
|
1159
1239
|
}
|
|
1160
1240
|
]
|
|
1161
1241
|
},
|
|
@@ -1165,7 +1245,7 @@
|
|
|
1165
1245
|
"hashes": [
|
|
1166
1246
|
{
|
|
1167
1247
|
"alg": "SHA-256",
|
|
1168
|
-
"content": "
|
|
1248
|
+
"content": "bc82e97c1ccded5006c1459bbcd3a84eb18651761d9b74d68d3aabe3be1101dc"
|
|
1169
1249
|
}
|
|
1170
1250
|
]
|
|
1171
1251
|
},
|
|
@@ -1265,7 +1345,7 @@
|
|
|
1265
1345
|
"hashes": [
|
|
1266
1346
|
{
|
|
1267
1347
|
"alg": "SHA-256",
|
|
1268
|
-
"content": "
|
|
1348
|
+
"content": "ce02526852f7c5d8579a5384f4aa9aafb7b099fdfc61c1482aa969bff7407a24"
|
|
1269
1349
|
}
|
|
1270
1350
|
]
|
|
1271
1351
|
},
|
|
@@ -1275,7 +1355,7 @@
|
|
|
1275
1355
|
"hashes": [
|
|
1276
1356
|
{
|
|
1277
1357
|
"alg": "SHA-256",
|
|
1278
|
-
"content": "
|
|
1358
|
+
"content": "b7b9bda39dc55594375688740b9d717d07ea2f12166fbee14a29f62868268a9c"
|
|
1279
1359
|
}
|
|
1280
1360
|
]
|
|
1281
1361
|
},
|
|
@@ -1285,7 +1365,7 @@
|
|
|
1285
1365
|
"hashes": [
|
|
1286
1366
|
{
|
|
1287
1367
|
"alg": "SHA-256",
|
|
1288
|
-
"content": "
|
|
1368
|
+
"content": "bf83c2c1af9481f4e03db72553b2d8c3b5b8ad2f87f0aab7e4d579f32e4a32d6"
|
|
1289
1369
|
}
|
|
1290
1370
|
]
|
|
1291
1371
|
},
|
|
@@ -1655,7 +1735,7 @@
|
|
|
1655
1735
|
"hashes": [
|
|
1656
1736
|
{
|
|
1657
1737
|
"alg": "SHA-256",
|
|
1658
|
-
"content": "
|
|
1738
|
+
"content": "412aa688ee1fb6bd6c132ad2f97421d6330846de1743b9461436051f29dead15"
|
|
1659
1739
|
}
|
|
1660
1740
|
]
|
|
1661
1741
|
},
|
|
@@ -1665,7 +1745,7 @@
|
|
|
1665
1745
|
"hashes": [
|
|
1666
1746
|
{
|
|
1667
1747
|
"alg": "SHA-256",
|
|
1668
|
-
"content": "
|
|
1748
|
+
"content": "758657ff3c0aef6919351af23fc229617576263d24d36b2400f5ffe43f8d1384"
|
|
1669
1749
|
}
|
|
1670
1750
|
]
|
|
1671
1751
|
},
|
|
@@ -1675,7 +1755,7 @@
|
|
|
1675
1755
|
"hashes": [
|
|
1676
1756
|
{
|
|
1677
1757
|
"alg": "SHA-256",
|
|
1678
|
-
"content": "
|
|
1758
|
+
"content": "b3603074fa6c80ee1dad75fe6f93b44f90dcfcbad81325ecca379f70c9f2fd60"
|
|
1679
1759
|
}
|
|
1680
1760
|
]
|
|
1681
1761
|
},
|
|
@@ -1685,7 +1765,7 @@
|
|
|
1685
1765
|
"hashes": [
|
|
1686
1766
|
{
|
|
1687
1767
|
"alg": "SHA-256",
|
|
1688
|
-
"content": "
|
|
1768
|
+
"content": "e4103c95577ac2876df7f604b1fa1c9e590e9a0df7185abc0f9d9f5bdc18ff1f"
|
|
1689
1769
|
}
|
|
1690
1770
|
]
|
|
1691
1771
|
},
|
|
@@ -2615,7 +2695,7 @@
|
|
|
2615
2695
|
"hashes": [
|
|
2616
2696
|
{
|
|
2617
2697
|
"alg": "SHA-256",
|
|
2618
|
-
"content": "
|
|
2698
|
+
"content": "de8265cfe636d0042855988d585b3e3165e4a61da0259c0a498fccdac79e1ec4"
|
|
2619
2699
|
}
|
|
2620
2700
|
]
|
|
2621
2701
|
},
|
|
@@ -2765,7 +2845,7 @@
|
|
|
2765
2845
|
"hashes": [
|
|
2766
2846
|
{
|
|
2767
2847
|
"alg": "SHA-256",
|
|
2768
|
-
"content": "
|
|
2848
|
+
"content": "1b20b2b6ababea386d195ab3481a0af6582fda2757720732b5098e162964da32"
|
|
2769
2849
|
}
|
|
2770
2850
|
]
|
|
2771
2851
|
},
|
|
@@ -2839,6 +2919,16 @@
|
|
|
2839
2919
|
}
|
|
2840
2920
|
]
|
|
2841
2921
|
},
|
|
2922
|
+
{
|
|
2923
|
+
"type": "file",
|
|
2924
|
+
"name": "src/event-chain.ts",
|
|
2925
|
+
"hashes": [
|
|
2926
|
+
{
|
|
2927
|
+
"alg": "SHA-256",
|
|
2928
|
+
"content": "f8306131a5021167169b525733da711ff378382f0a7368376f35834c350a9e23"
|
|
2929
|
+
}
|
|
2930
|
+
]
|
|
2931
|
+
},
|
|
2842
2932
|
{
|
|
2843
2933
|
"type": "file",
|
|
2844
2934
|
"name": "src/feature-adr-claim-gate.ts",
|
|
@@ -2869,13 +2959,23 @@
|
|
|
2869
2959
|
}
|
|
2870
2960
|
]
|
|
2871
2961
|
},
|
|
2962
|
+
{
|
|
2963
|
+
"type": "file",
|
|
2964
|
+
"name": "src/guard-promotion.ts",
|
|
2965
|
+
"hashes": [
|
|
2966
|
+
{
|
|
2967
|
+
"alg": "SHA-256",
|
|
2968
|
+
"content": "45e05ef83ac730442760a55f9859f36b2b2a56db53465ca0267f517024646026"
|
|
2969
|
+
}
|
|
2970
|
+
]
|
|
2971
|
+
},
|
|
2872
2972
|
{
|
|
2873
2973
|
"type": "file",
|
|
2874
2974
|
"name": "src/guard.ts",
|
|
2875
2975
|
"hashes": [
|
|
2876
2976
|
{
|
|
2877
2977
|
"alg": "SHA-256",
|
|
2878
|
-
"content": "
|
|
2978
|
+
"content": "e7559a9f42448374ae133a323f8d9e4fa21625b15853d544e1c077ae9331a2ce"
|
|
2879
2979
|
}
|
|
2880
2980
|
]
|
|
2881
2981
|
},
|
|
@@ -2895,7 +2995,7 @@
|
|
|
2895
2995
|
"hashes": [
|
|
2896
2996
|
{
|
|
2897
2997
|
"alg": "SHA-256",
|
|
2898
|
-
"content": "
|
|
2998
|
+
"content": "570656aaa56d8da53c83f2e93af93e6b9af4398b3e75a7077bf5a7206eee42b5"
|
|
2899
2999
|
}
|
|
2900
3000
|
]
|
|
2901
3001
|
},
|
|
@@ -2925,7 +3025,7 @@
|
|
|
2925
3025
|
"hashes": [
|
|
2926
3026
|
{
|
|
2927
3027
|
"alg": "SHA-256",
|
|
2928
|
-
"content": "
|
|
3028
|
+
"content": "939e75c6a80e5812a3ab5f3ebc5fe39dd646211a27077fb47f499ecab53e790c"
|
|
2929
3029
|
}
|
|
2930
3030
|
]
|
|
2931
3031
|
},
|
|
@@ -3015,7 +3115,7 @@
|
|
|
3015
3115
|
"hashes": [
|
|
3016
3116
|
{
|
|
3017
3117
|
"alg": "SHA-256",
|
|
3018
|
-
"content": "
|
|
3118
|
+
"content": "71a1e596f5f877b4ecb04cebf0670922824d0466488302e1ba9553407dfbe9af"
|
|
3019
3119
|
}
|
|
3020
3120
|
]
|
|
3021
3121
|
},
|
|
@@ -3415,7 +3515,7 @@
|
|
|
3415
3515
|
"hashes": [
|
|
3416
3516
|
{
|
|
3417
3517
|
"alg": "SHA-256",
|
|
3418
|
-
"content": "
|
|
3518
|
+
"content": "89265131de29a2841e73068e4be256e1cbe7bd8dbd0c8eacc79039626b41e6f0"
|
|
3419
3519
|
}
|
|
3420
3520
|
]
|
|
3421
3521
|
},
|
|
@@ -3519,6 +3619,16 @@
|
|
|
3519
3619
|
}
|
|
3520
3620
|
]
|
|
3521
3621
|
},
|
|
3622
|
+
{
|
|
3623
|
+
"type": "file",
|
|
3624
|
+
"name": "test/event-chain.test.ts",
|
|
3625
|
+
"hashes": [
|
|
3626
|
+
{
|
|
3627
|
+
"alg": "SHA-256",
|
|
3628
|
+
"content": "b5addb1026c8b408e49fee9e561c12ea22d8b4e94ae7092ebe60419c7a384ab6"
|
|
3629
|
+
}
|
|
3630
|
+
]
|
|
3631
|
+
},
|
|
3522
3632
|
{
|
|
3523
3633
|
"type": "file",
|
|
3524
3634
|
"name": "test/feature-adr-abs-paths.test.ts",
|
|
@@ -3619,6 +3729,16 @@
|
|
|
3619
3729
|
}
|
|
3620
3730
|
]
|
|
3621
3731
|
},
|
|
3732
|
+
{
|
|
3733
|
+
"type": "file",
|
|
3734
|
+
"name": "test/guard-promotion.test.ts",
|
|
3735
|
+
"hashes": [
|
|
3736
|
+
{
|
|
3737
|
+
"alg": "SHA-256",
|
|
3738
|
+
"content": "c7d38f9ba7d2a1a1d5e40b9422eeef0ffc7784b015adb41a9c8d89893f529c9e"
|
|
3739
|
+
}
|
|
3740
|
+
]
|
|
3741
|
+
},
|
|
3622
3742
|
{
|
|
3623
3743
|
"type": "file",
|
|
3624
3744
|
"name": "test/guard.test.ts",
|
|
@@ -3745,7 +3865,7 @@
|
|
|
3745
3865
|
"hashes": [
|
|
3746
3866
|
{
|
|
3747
3867
|
"alg": "SHA-256",
|
|
3748
|
-
"content": "
|
|
3868
|
+
"content": "a26d2b3cc2434cc0846e73c1c6d5c6d7223e5be5a24217b75f62d494affa2089"
|
|
3749
3869
|
}
|
|
3750
3870
|
]
|
|
3751
3871
|
},
|
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');
|