@dzhechkov/harness-core 0.3.127 → 0.3.129

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 (48) hide show
  1. package/.dz-manifest.json +80 -44
  2. package/README.md +2 -1
  3. package/dist/agentdb-index.d.ts +11 -0
  4. package/dist/agentdb-index.d.ts.map +1 -1
  5. package/dist/agentdb-index.js +44 -0
  6. package/dist/agentdb-index.js.map +1 -1
  7. package/dist/delivery-check.d.ts +169 -0
  8. package/dist/delivery-check.d.ts.map +1 -0
  9. package/dist/delivery-check.js +334 -0
  10. package/dist/delivery-check.js.map +1 -0
  11. package/dist/feature-adr-setup.d.ts +17 -1
  12. package/dist/feature-adr-setup.d.ts.map +1 -1
  13. package/dist/feature-adr-setup.js +76 -1
  14. package/dist/feature-adr-setup.js.map +1 -1
  15. package/dist/index.d.ts +5 -4
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +4 -3
  18. package/dist/index.js.map +1 -1
  19. package/dist/learning-backend.d.ts.map +1 -1
  20. package/dist/learning-backend.js +4 -0
  21. package/dist/learning-backend.js.map +1 -1
  22. package/dist/parity.d.ts +6 -0
  23. package/dist/parity.d.ts.map +1 -1
  24. package/dist/parity.js +20 -1
  25. package/dist/parity.js.map +1 -1
  26. package/dist/patterns.d.ts +74 -1
  27. package/dist/patterns.d.ts.map +1 -1
  28. package/dist/patterns.js +148 -9
  29. package/dist/patterns.js.map +1 -1
  30. package/dist/recall-hook-policy.d.ts +7 -0
  31. package/dist/recall-hook-policy.d.ts.map +1 -1
  32. package/dist/recall-hook-policy.js +6 -2
  33. package/dist/recall-hook-policy.js.map +1 -1
  34. package/dist/vector-tier.d.ts +5 -1
  35. package/dist/vector-tier.d.ts.map +1 -1
  36. package/dist/vector-tier.js +22 -6
  37. package/dist/vector-tier.js.map +1 -1
  38. package/package.json +5 -5
  39. package/sbom.json +133 -43
  40. package/src/agentdb-index.ts +46 -0
  41. package/src/delivery-check.ts +452 -0
  42. package/src/feature-adr-setup.ts +82 -2
  43. package/src/index.ts +5 -3
  44. package/src/learning-backend.ts +4 -0
  45. package/src/parity.ts +21 -1
  46. package/src/patterns.ts +195 -11
  47. package/src/recall-hook-policy.ts +14 -2
  48. package/src/vector-tier.ts +23 -5
package/sbom.json CHANGED
@@ -25,7 +25,27 @@
25
25
  "hashes": [
26
26
  {
27
27
  "alg": "SHA-256",
28
- "content": "8c1e1987456f7747170f0c2fde80611794f685276bfaf5ffa034a2baae68fa84"
28
+ "content": "64ade4559a5d8c120a5f3a0ab2707c62b3fcf04855e4d5c4cdeff2eae1c33ecd"
29
+ }
30
+ ]
31
+ },
32
+ {
33
+ "type": "file",
34
+ "name": "coverage/coverage-final.json",
35
+ "hashes": [
36
+ {
37
+ "alg": "SHA-256",
38
+ "content": "91777773d812050b808c438c071ce13eed69ffaf660f295bf07311a9f512c310"
39
+ }
40
+ ]
41
+ },
42
+ {
43
+ "type": "file",
44
+ "name": "coverage/coverage-summary.json",
45
+ "hashes": [
46
+ {
47
+ "alg": "SHA-256",
48
+ "content": "df1e7169bfc7d9401142d2534ce7b009778cf7bbf9dbe58d8bc0f7e268ffddbb"
29
49
  }
30
50
  ]
31
51
  },
@@ -75,7 +95,7 @@
75
95
  "hashes": [
76
96
  {
77
97
  "alg": "SHA-256",
78
- "content": "c9140e5af51f3af20a36c46909081d851c473190edb2de991b42f0735660fbf6"
98
+ "content": "f5baab841b3179512cf72fd12884869719f0a352b9e231a87dfa1b87b772974f"
79
99
  }
80
100
  ]
81
101
  },
@@ -85,7 +105,7 @@
85
105
  "hashes": [
86
106
  {
87
107
  "alg": "SHA-256",
88
- "content": "8ef6c9aa473d330ee8d934191fb2b715f4f07bba317edff6f212d67fe5146e91"
108
+ "content": "eb8f01ef67cb90a2d95b18ae1f10bb3ce2dd5855dc297402665a1fa621a8fb65"
89
109
  }
90
110
  ]
91
111
  },
@@ -95,7 +115,7 @@
95
115
  "hashes": [
96
116
  {
97
117
  "alg": "SHA-256",
98
- "content": "61c19dbe15ac1ae4a4fc9564c8d4eed1cd1290a6177ec46eaf07832a8c55b4f0"
118
+ "content": "f661d868e08152e9e293c83d9914e53c0c2ea52e0afc0ff49d1f8c320017eabd"
99
119
  }
100
120
  ]
101
121
  },
@@ -105,7 +125,7 @@
105
125
  "hashes": [
106
126
  {
107
127
  "alg": "SHA-256",
108
- "content": "3e73ff7641ad09ac8e7af287f0df4329d08dfa73633cd9b2620224e79f4810ef"
128
+ "content": "a994c29d7f265c129dccaf9c0e00b55eb7f6312af8112691035c3889a113668b"
109
129
  }
110
130
  ]
111
131
  },
@@ -629,6 +649,46 @@
629
649
  }
630
650
  ]
631
651
  },
652
+ {
653
+ "type": "file",
654
+ "name": "dist/delivery-check.d.ts",
655
+ "hashes": [
656
+ {
657
+ "alg": "SHA-256",
658
+ "content": "81ae51ebc0ece4805e87a73d77aeb2adae183c9a5f0cec8409cf323eb0712d04"
659
+ }
660
+ ]
661
+ },
662
+ {
663
+ "type": "file",
664
+ "name": "dist/delivery-check.d.ts.map",
665
+ "hashes": [
666
+ {
667
+ "alg": "SHA-256",
668
+ "content": "e7ae1cc146a5f826e819d413b3bc642400f320c8c8670550f007b05cae2fc785"
669
+ }
670
+ ]
671
+ },
672
+ {
673
+ "type": "file",
674
+ "name": "dist/delivery-check.js",
675
+ "hashes": [
676
+ {
677
+ "alg": "SHA-256",
678
+ "content": "8035d3035a424c3f3790e1179f54b672dce2e4237b6101eb5b779b08c647e6a3"
679
+ }
680
+ ]
681
+ },
682
+ {
683
+ "type": "file",
684
+ "name": "dist/delivery-check.js.map",
685
+ "hashes": [
686
+ {
687
+ "alg": "SHA-256",
688
+ "content": "0ff99de991d8aba7c74c82bb35e38360b01f79bd47998f6fea310df1bc8ada26"
689
+ }
690
+ ]
691
+ },
632
692
  {
633
693
  "type": "file",
634
694
  "name": "dist/discrimination-gate.d.ts",
@@ -835,7 +895,7 @@
835
895
  "hashes": [
836
896
  {
837
897
  "alg": "SHA-256",
838
- "content": "f33f4061f4d5b9ed58eee48a8f8fa1de3504938f4d81ab7ccf97fcdf613389c2"
898
+ "content": "0c4990df97a5e2c0e3fcad8796fe77f40a0684359509b247d34e572c2080ae7e"
839
899
  }
840
900
  ]
841
901
  },
@@ -845,7 +905,7 @@
845
905
  "hashes": [
846
906
  {
847
907
  "alg": "SHA-256",
848
- "content": "e29fe04dc22a8efbbf5d99ac825375dbee61d99f4c81dfe524f34ca8a8f04dc9"
908
+ "content": "878ecf7c4f722a74b529e43c3b51ae7147c868d13b4ed547088407269ec0ce64"
849
909
  }
850
910
  ]
851
911
  },
@@ -855,7 +915,7 @@
855
915
  "hashes": [
856
916
  {
857
917
  "alg": "SHA-256",
858
- "content": "ddb62a1ed7d032bea6f1108dd99113a4f000020175def5725a80a9456b85d784"
918
+ "content": "907cc96e4b5dcfb12f142af1dc511b51bccaa93010681b1e78b433dc52a2b9dd"
859
919
  }
860
920
  ]
861
921
  },
@@ -865,7 +925,7 @@
865
925
  "hashes": [
866
926
  {
867
927
  "alg": "SHA-256",
868
- "content": "2a5844292cda37934efd390d826909f07f0d25b075dd21a2c1d874ac7f72b63e"
928
+ "content": "dc50ce0dd4b4680afdda3e2c650d0d8665c7defce22e4afaeb24d2113c0dec9d"
869
929
  }
870
930
  ]
871
931
  },
@@ -955,7 +1015,7 @@
955
1015
  "hashes": [
956
1016
  {
957
1017
  "alg": "SHA-256",
958
- "content": "60e1b4f90095ac0c9d799477c95fc282eedbd9bbee36e6c637ee72149d9132ad"
1018
+ "content": "ecee9fb65fab5133b2f39642760a3bd508dbe5190b643c32bd1d465f5beb7e97"
959
1019
  }
960
1020
  ]
961
1021
  },
@@ -965,7 +1025,7 @@
965
1025
  "hashes": [
966
1026
  {
967
1027
  "alg": "SHA-256",
968
- "content": "cb3a2c690b76ae528daa5b04cac41568f695c8530d0c9aa6ed6d9a042160a3bc"
1028
+ "content": "df89bb1d72d9b80d0569c833d912d06ef4b318fd0bd071764f6ee185b3588feb"
969
1029
  }
970
1030
  ]
971
1031
  },
@@ -975,7 +1035,7 @@
975
1035
  "hashes": [
976
1036
  {
977
1037
  "alg": "SHA-256",
978
- "content": "eae6156466218996988d2590ca1490a90643202802dd260bdf0da4da3617b6c5"
1038
+ "content": "bf03f6c420d051d21a794a7f4626e594fe9b906c3acc8fffe7f4a93fe03ce655"
979
1039
  }
980
1040
  ]
981
1041
  },
@@ -985,7 +1045,7 @@
985
1045
  "hashes": [
986
1046
  {
987
1047
  "alg": "SHA-256",
988
- "content": "affa437831357d4c8881462741e7ead64136d335507d156fa7e926cfe866d577"
1048
+ "content": "6d2e75ce1a9dff3ed2f917a4784b722f25c5e8d0489a8055961b8b9faa5b1a6b"
989
1049
  }
990
1050
  ]
991
1051
  },
@@ -1005,7 +1065,7 @@
1005
1065
  "hashes": [
1006
1066
  {
1007
1067
  "alg": "SHA-256",
1008
- "content": "389e18ea7bfe22074dcd0ccc373fab234a4161333ae1bae4eb4466ffeaf166e6"
1068
+ "content": "1fb488eaaef87d92cd95ca18901508cfb1793057470c31df01f399dae6c9af6e"
1009
1069
  }
1010
1070
  ]
1011
1071
  },
@@ -1015,7 +1075,7 @@
1015
1075
  "hashes": [
1016
1076
  {
1017
1077
  "alg": "SHA-256",
1018
- "content": "d1c4136cad91ab8e3cee681f5ab7fde0696d5de1da61f6a69be423087f4d2eb9"
1078
+ "content": "55ae03d431dd90aa819f8ea28aa590aad076a2f0222bb076461ce627ac342187"
1019
1079
  }
1020
1080
  ]
1021
1081
  },
@@ -1025,7 +1085,7 @@
1025
1085
  "hashes": [
1026
1086
  {
1027
1087
  "alg": "SHA-256",
1028
- "content": "8bcb517e1d8277479344b5290c09e44ece12a7eca3d1bc5b1e61d4c355aaa2a9"
1088
+ "content": "7752efa7cba6b11dd7230b6d965f72a1b3a9e47e0c32fab619496d67f5f5ba22"
1029
1089
  }
1030
1090
  ]
1031
1091
  },
@@ -1115,7 +1175,7 @@
1115
1175
  "hashes": [
1116
1176
  {
1117
1177
  "alg": "SHA-256",
1118
- "content": "38c018c5dc771cfc48b5c8d4095d23cade1c48000bbde230909b947a727ac8b4"
1178
+ "content": "b1a73a2f30f2b2fbfcb47e2426e778946a191308d85c74055ea1848c4adb054f"
1119
1179
  }
1120
1180
  ]
1121
1181
  },
@@ -1125,7 +1185,7 @@
1125
1185
  "hashes": [
1126
1186
  {
1127
1187
  "alg": "SHA-256",
1128
- "content": "27a9856477d2081d7f01034db570f1a4543dbb3a689cbc0644c3b84f72175eab"
1188
+ "content": "5447cae953690e9cd39ffaf82f9de9fefdfb6e1f6c36142580ed4045e7daf96c"
1129
1189
  }
1130
1190
  ]
1131
1191
  },
@@ -1135,7 +1195,7 @@
1135
1195
  "hashes": [
1136
1196
  {
1137
1197
  "alg": "SHA-256",
1138
- "content": "e51ed5b0014dd240a4139cbfbc81357ebe02543a5611a4be53a7206946f330b6"
1198
+ "content": "e583826b0c8bb6d04bd8f99cf864809c51f77b5cb3e2d5a1d26d2187f589bc74"
1139
1199
  }
1140
1200
  ]
1141
1201
  },
@@ -1145,7 +1205,7 @@
1145
1205
  "hashes": [
1146
1206
  {
1147
1207
  "alg": "SHA-256",
1148
- "content": "7d20318fc13e72655c71b1afdd29cc4fbe239fc564558f6661a26e29c270106b"
1208
+ "content": "3b40a7d296e18446c00b8a75fcb0dfaf12967063be51a4afa38915d4a9c2c70e"
1149
1209
  }
1150
1210
  ]
1151
1211
  },
@@ -1155,7 +1215,7 @@
1155
1215
  "hashes": [
1156
1216
  {
1157
1217
  "alg": "SHA-256",
1158
- "content": "f58c60e77c4dd0a098b2ae076ae8db37cc1f0d63d95870e21083156cfd84f09c"
1218
+ "content": "f1c730b94dc591aa592b7b31b86982561f099680fb822e7da68045ec01d44a99"
1159
1219
  }
1160
1220
  ]
1161
1221
  },
@@ -1165,7 +1225,7 @@
1165
1225
  "hashes": [
1166
1226
  {
1167
1227
  "alg": "SHA-256",
1168
- "content": "282289f512e343985baaf3457ce39bd43927b3fd8ef597532f34e83db0c6cfd8"
1228
+ "content": "f59c1f9742028737b973c4129ac2b4f8e50c3c0b762f48ea2ce97f0a4f89c20a"
1169
1229
  }
1170
1230
  ]
1171
1231
  },
@@ -1175,7 +1235,7 @@
1175
1235
  "hashes": [
1176
1236
  {
1177
1237
  "alg": "SHA-256",
1178
- "content": "5d13af079c98511b2300b05f9f1ca3844578fa4cb110d89194ddde06afd96e19"
1238
+ "content": "f8f8e5a7139e6c898b466a208a14228752501845ca755c94d80e2200cb24d890"
1179
1239
  }
1180
1240
  ]
1181
1241
  },
@@ -1185,7 +1245,7 @@
1185
1245
  "hashes": [
1186
1246
  {
1187
1247
  "alg": "SHA-256",
1188
- "content": "ff59a5013fd97593f273bfee0de3cc22fb71ad51ad9609c57dc1efb57d35c0d4"
1248
+ "content": "ac7463223c47a36d03e2875995c98624c681bc36f04cd37490aa76616513d5aa"
1189
1249
  }
1190
1250
  ]
1191
1251
  },
@@ -1435,7 +1495,7 @@
1435
1495
  "hashes": [
1436
1496
  {
1437
1497
  "alg": "SHA-256",
1438
- "content": "2d837b3e03c48cb106dd76342c319bc949ff53907baf91ea40102093127290ab"
1498
+ "content": "9a74c9472688a4326b10065f61c9294b473baf232a27cf69f6ae7a74a5ce9bb6"
1439
1499
  }
1440
1500
  ]
1441
1501
  },
@@ -1445,7 +1505,7 @@
1445
1505
  "hashes": [
1446
1506
  {
1447
1507
  "alg": "SHA-256",
1448
- "content": "7b7f0b99bcf1d4d45233f33f059f520107258b71014064058b8f018a16375194"
1508
+ "content": "0631cf526a8aae076d5512bcc75c629ea69830f65aa267ade03028e532a2a923"
1449
1509
  }
1450
1510
  ]
1451
1511
  },
@@ -1455,7 +1515,7 @@
1455
1515
  "hashes": [
1456
1516
  {
1457
1517
  "alg": "SHA-256",
1458
- "content": "db3a0e92b040e83b792ee56f759e036a9019d05b401d65cd366e716f00a08578"
1518
+ "content": "73fa2d3bcedb0158a2860171b66046aa67c7aa1aab80a93502588202f0aed09e"
1459
1519
  }
1460
1520
  ]
1461
1521
  },
@@ -1465,7 +1525,7 @@
1465
1525
  "hashes": [
1466
1526
  {
1467
1527
  "alg": "SHA-256",
1468
- "content": "002462c04676596add4eed874909da0ca4310d927fe9d04d79357a22ff76480a"
1528
+ "content": "abdfa155fca15e8aa950430d201c2e6754872c0b02d0201a10c5f0923210373a"
1469
1529
  }
1470
1530
  ]
1471
1531
  },
@@ -2275,7 +2335,7 @@
2275
2335
  "hashes": [
2276
2336
  {
2277
2337
  "alg": "SHA-256",
2278
- "content": "7e181b3d05e7aac7acaf496a8eb58773abef14bd2e11e2f8aa8bed55ae69326b"
2338
+ "content": "2bc60f782f3b2f9ee179894b88d8b2b9ff487f286c17f3d3dfd7f0ca0d640ffc"
2279
2339
  }
2280
2340
  ]
2281
2341
  },
@@ -2285,7 +2345,7 @@
2285
2345
  "hashes": [
2286
2346
  {
2287
2347
  "alg": "SHA-256",
2288
- "content": "4b70f02d8954195ff16a19df746f5a1cf6f9c00f420621a692fe381221bba081"
2348
+ "content": "2a30a5bd7b8caf0e1cca2587817d25d9b0a366162ca098d5464f9783cdc2311d"
2289
2349
  }
2290
2350
  ]
2291
2351
  },
@@ -2295,7 +2355,7 @@
2295
2355
  "hashes": [
2296
2356
  {
2297
2357
  "alg": "SHA-256",
2298
- "content": "a1076a6870b1cfb1c0fc47525e8bf9357887be062cbd124d6145996ad8b81da7"
2358
+ "content": "c0d917225ced953324609cb086fff6d6a2f31dead7dad470a31ec5d6bb257a32"
2299
2359
  }
2300
2360
  ]
2301
2361
  },
@@ -2305,7 +2365,7 @@
2305
2365
  "hashes": [
2306
2366
  {
2307
2367
  "alg": "SHA-256",
2308
- "content": "82b2a767216bd3688100189a38aa331515e30696310d086ff2a9ea934172f3df"
2368
+ "content": "70e3c78890c71f0bb1cdd66bc2f787ead25c88edc130449d71003275e5adf57b"
2309
2369
  }
2310
2370
  ]
2311
2371
  },
@@ -2355,7 +2415,7 @@
2355
2415
  "hashes": [
2356
2416
  {
2357
2417
  "alg": "SHA-256",
2358
- "content": "37a81e8033886d0b6b7af5fc3297bb05137c558a608b9336b8f88ecd3cc3f516"
2418
+ "content": "df8d2ed464b0d85739f21569fa96bc8ca0f2a908373deb8afb9feebf0c79582d"
2359
2419
  }
2360
2420
  ]
2361
2421
  },
@@ -2375,7 +2435,7 @@
2375
2435
  "hashes": [
2376
2436
  {
2377
2437
  "alg": "SHA-256",
2378
- "content": "3347529bd57799df27e1c209a7a480348b53b511f26f5fd863cc21a39c6d5b53"
2438
+ "content": "91f8d26b81e3262bc9e3b4ca357165eaed5d889660ef60f18b63e483009ea44e"
2379
2439
  }
2380
2440
  ]
2381
2441
  },
@@ -2509,6 +2569,16 @@
2509
2569
  }
2510
2570
  ]
2511
2571
  },
2572
+ {
2573
+ "type": "file",
2574
+ "name": "src/delivery-check.ts",
2575
+ "hashes": [
2576
+ {
2577
+ "alg": "SHA-256",
2578
+ "content": "04db640b8c5d439f4392c9f8dd64fb3433f6f71d07a707cc9058f6baa6cf917c"
2579
+ }
2580
+ ]
2581
+ },
2512
2582
  {
2513
2583
  "type": "file",
2514
2584
  "name": "src/discrimination-gate.ts",
@@ -2565,7 +2635,7 @@
2565
2635
  "hashes": [
2566
2636
  {
2567
2637
  "alg": "SHA-256",
2568
- "content": "106a5e656083eb1c4dcda872b844d2fd3caec811851d3d8b104c1171bcc3767f"
2638
+ "content": "311f4344eed1a43a0a3bd2723cafce141e035078cdcc404509cdf26ee7df4904"
2569
2639
  }
2570
2640
  ]
2571
2641
  },
@@ -2595,7 +2665,7 @@
2595
2665
  "hashes": [
2596
2666
  {
2597
2667
  "alg": "SHA-256",
2598
- "content": "d13a9c5acb29e5ebf4712292ec53b53fc5ab37c26b5699f596d0d52a53e84aec"
2668
+ "content": "5159e876d79bbc30b3d44a54a147d74d92cbb44e87b8568a456ea46f402aa345"
2599
2669
  }
2600
2670
  ]
2601
2671
  },
@@ -2605,7 +2675,7 @@
2605
2675
  "hashes": [
2606
2676
  {
2607
2677
  "alg": "SHA-256",
2608
- "content": "517a2346f10e1331aa9a33a7d24d25fd01bcb9e365b6c153f0631e6cb64208da"
2678
+ "content": "041fea2a00543016e0d2d9c5fc45df0df3bd97744c1705f95f6bb73725f03aee"
2609
2679
  }
2610
2680
  ]
2611
2681
  },
@@ -2635,7 +2705,7 @@
2635
2705
  "hashes": [
2636
2706
  {
2637
2707
  "alg": "SHA-256",
2638
- "content": "9e234f1ef90cb42ac47eb9df916600fe2d06ec8445b664c4ab672bdee08caa20"
2708
+ "content": "1be63dfdf90a75456fa1e726cd9b6faecbf86f2420e5786722999a8b67b4dea1"
2639
2709
  }
2640
2710
  ]
2641
2711
  },
@@ -2645,7 +2715,7 @@
2645
2715
  "hashes": [
2646
2716
  {
2647
2717
  "alg": "SHA-256",
2648
- "content": "55cfcd5cd45a8bec20c10ea0c7f40ccd3a57bce84783e9d7fa563eac4ba7f347"
2718
+ "content": "dba61149547898122304b11d4be377aed17ad822b0f4a017d76815ddb295eb0a"
2649
2719
  }
2650
2720
  ]
2651
2721
  },
@@ -2705,7 +2775,7 @@
2705
2775
  "hashes": [
2706
2776
  {
2707
2777
  "alg": "SHA-256",
2708
- "content": "b7fa9bd88206c40c6e8e8c1cc42bfdb409595cb86db1769e6597d2315bd65b23"
2778
+ "content": "b4a3c6b3fc2e8338efeee729038a01e3881dc578b65427ffbb03c236e160b470"
2709
2779
  }
2710
2780
  ]
2711
2781
  },
@@ -2915,7 +2985,7 @@
2915
2985
  "hashes": [
2916
2986
  {
2917
2987
  "alg": "SHA-256",
2918
- "content": "5d1189cca886a9e34112e74706e2610eaf7449a83268c13d005cdd84f5bf77a9"
2988
+ "content": "9707fa46b1f92cfa75e45c6619e01ef8f74bb5f50a913b778edfe6143d818d8a"
2919
2989
  }
2920
2990
  ]
2921
2991
  },
@@ -3109,6 +3179,16 @@
3109
3179
  }
3110
3180
  ]
3111
3181
  },
3182
+ {
3183
+ "type": "file",
3184
+ "name": "test/delivery-check.test.ts",
3185
+ "hashes": [
3186
+ {
3187
+ "alg": "SHA-256",
3188
+ "content": "11a3af1048f1143fdd8e238efe5dba299e29400c6b9d3a227291622088be9446"
3189
+ }
3190
+ ]
3191
+ },
3112
3192
  {
3113
3193
  "type": "file",
3114
3194
  "name": "test/delta-rerank.test.ts",
@@ -3215,7 +3295,7 @@
3215
3295
  "hashes": [
3216
3296
  {
3217
3297
  "alg": "SHA-256",
3218
- "content": "963f2b88ec37e531099ea7dd115ea8bab6f74ecb5528a2353c0692d498db20d5"
3298
+ "content": "747d208998f731300f409c1a434a10eac8cb5dd9380769b8552006c6ca68d076"
3219
3299
  }
3220
3300
  ]
3221
3301
  },
@@ -3339,6 +3419,16 @@
3339
3419
  }
3340
3420
  ]
3341
3421
  },
3422
+ {
3423
+ "type": "file",
3424
+ "name": "test/lesson-quarantine.test.ts",
3425
+ "hashes": [
3426
+ {
3427
+ "alg": "SHA-256",
3428
+ "content": "61931781195ab6093482060120f537a047223c6f345ce8c1809a81655ffb74d6"
3429
+ }
3430
+ ]
3431
+ },
3342
3432
  {
3343
3433
  "type": "file",
3344
3434
  "name": "test/mcp-scan.test.ts",
@@ -3375,7 +3465,7 @@
3375
3465
  "hashes": [
3376
3466
  {
3377
3467
  "alg": "SHA-256",
3378
- "content": "30e4fcfdb436840c9d658badbff95953022cf97c8549d1b2297415e771ef4e07"
3468
+ "content": "dc8ac24be0d77884cdedfa291d881ab1f59e75e99c7d36a21291302896520c40"
3379
3469
  }
3380
3470
  ]
3381
3471
  },
@@ -484,6 +484,52 @@ export async function importVectorsToAgentdb(
484
484
  }
485
485
  }
486
486
 
487
+ /**
488
+ * lesson-quarantine: clear the `qStatus` marker from mirrored rows after a promotion — the hook
489
+ * daemon reads ONLY this mirror's metadata, so a promoted lesson must stop being excluded there
490
+ * too. Best-effort, same custody model as {@link bumpAgentdbUses} (missing db/deps ⇒ no-op).
491
+ */
492
+ export function clearAgentdbQuarantine(
493
+ projectRoot: string,
494
+ dzIds: readonly string[],
495
+ opts: { dbPath?: string } = {},
496
+ ): { cleared: number; error?: string } {
497
+ if (dzIds.length === 0) return { cleared: 0 };
498
+ const dbFile = resolveAgentdbPath(projectRoot, opts.dbPath);
499
+ if (!existsSync(dbFile)) return { cleared: 0 };
500
+ let Database: new (p: string) => UpsertDb;
501
+ try {
502
+ const req = createRequire(join(projectRoot, 'package.json'));
503
+ Database = req('better-sqlite3') as new (p: string) => UpsertDb;
504
+ } catch {
505
+ return { cleared: 0, error: DEPS_MISSING };
506
+ }
507
+ try {
508
+ const db = new Database(dbFile);
509
+ try {
510
+ db.pragma('journal_mode = WAL');
511
+ db.pragma('busy_timeout = 5000');
512
+ db.exec(REASONING_BANK_SCHEMA);
513
+ const stmt = db.prepare(
514
+ "UPDATE reasoning_patterns SET metadata = json_remove(metadata, '$.qStatus', '$.quarantinedAt') WHERE json_extract(metadata, '$.dzId') = ? AND json_extract(metadata, '$.qStatus') = 'quarantined'",
515
+ );
516
+ const tx = db.transaction(() => {
517
+ let cleared = 0;
518
+ for (const dzId of dzIds) {
519
+ const r = stmt.run(dzId);
520
+ cleared += Number((r as unknown as { changes?: number }).changes ?? 0);
521
+ }
522
+ return cleared;
523
+ });
524
+ return { cleared: tx() };
525
+ } finally {
526
+ db.close();
527
+ }
528
+ } catch (err) {
529
+ return { cleared: 0, error: `quarantine clear failed: ${err instanceof Error ? err.message : String(err)}` };
530
+ }
531
+ }
532
+
487
533
  export function bumpAgentdbUses(
488
534
  projectRoot: string,
489
535
  dzIds: readonly string[],