@dzhechkov/harness-core 0.7.11 → 0.7.12
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 +93 -33
- package/README.md +26 -0
- package/dist/amendment-trace.d.ts +12 -1
- package/dist/amendment-trace.d.ts.map +1 -1
- package/dist/amendment-trace.js +22 -4
- package/dist/amendment-trace.js.map +1 -1
- package/dist/feature-adr-routing.d.ts +69 -12
- package/dist/feature-adr-routing.d.ts.map +1 -1
- package/dist/feature-adr-routing.js +117 -7
- package/dist/feature-adr-routing.js.map +1 -1
- package/dist/index.d.ts +7 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -3
- package/dist/index.js.map +1 -1
- package/dist/learning-backend.d.ts +39 -0
- package/dist/learning-backend.d.ts.map +1 -1
- package/dist/learning-backend.js +31 -11
- package/dist/learning-backend.js.map +1 -1
- package/dist/lesson-bandit.d.ts +116 -0
- package/dist/lesson-bandit.d.ts.map +1 -0
- package/dist/lesson-bandit.js +235 -0
- package/dist/lesson-bandit.js.map +1 -0
- package/dist/lesson-payoff.d.ts +260 -0
- package/dist/lesson-payoff.d.ts.map +1 -0
- package/dist/lesson-payoff.js +597 -0
- package/dist/lesson-payoff.js.map +1 -0
- package/dist/patterns.d.ts +21 -0
- package/dist/patterns.d.ts.map +1 -1
- package/dist/patterns.js +42 -3
- package/dist/patterns.js.map +1 -1
- package/dist/project-skills-root.d.ts +44 -0
- package/dist/project-skills-root.d.ts.map +1 -0
- package/dist/project-skills-root.js +62 -0
- package/dist/project-skills-root.js.map +1 -0
- package/dist/vector-tier.d.ts +30 -0
- package/dist/vector-tier.d.ts.map +1 -1
- package/dist/vector-tier.js +130 -15
- package/dist/vector-tier.js.map +1 -1
- package/package.json +4 -4
- package/sbom.json +182 -32
- package/src/amendment-trace.ts +34 -4
- package/src/feature-adr-routing.ts +146 -7
- package/src/index.ts +16 -2
- package/src/learning-backend.ts +62 -11
- package/src/lesson-bandit.ts +279 -0
- package/src/lesson-payoff.ts +728 -0
- package/src/patterns.ts +66 -5
- package/src/project-skills-root.ts +63 -0
- package/src/vector-tier.ts +182 -16
package/.dz-manifest.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
11
|
"path": "README.md",
|
|
12
|
-
"sha256": "
|
|
12
|
+
"sha256": "6d91220bbf12e856c67a88b5a00f03e5585a116346f32576366192bb65816f52"
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
"path": "dist/__tests__/golden-baseline.test.d.ts",
|
|
@@ -61,19 +61,19 @@
|
|
|
61
61
|
},
|
|
62
62
|
{
|
|
63
63
|
"path": "dist/amendment-trace.d.ts",
|
|
64
|
-
"sha256": "
|
|
64
|
+
"sha256": "0cd1c17e84518dde7b0d1ca9558866d96902e611f9a5f579828d89315a390bcb"
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
67
|
"path": "dist/amendment-trace.d.ts.map",
|
|
68
|
-
"sha256": "
|
|
68
|
+
"sha256": "6e9e2402008672ac2581c97db920eaac9a4b3900ab8885aa049b465ead146ac9"
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
71
|
"path": "dist/amendment-trace.js",
|
|
72
|
-
"sha256": "
|
|
72
|
+
"sha256": "5bdc777e7d265e84431fae39f7331f814ef52a75b09f1482dd7ea26d3f3ccda3"
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
75
|
"path": "dist/amendment-trace.js.map",
|
|
76
|
-
"sha256": "
|
|
76
|
+
"sha256": "6a6ad6be2419f9ae6ee10a3d59a272c325a316becfd69d57f5b40b1ef7534130"
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
79
|
"path": "dist/apply.d.ts",
|
|
@@ -589,19 +589,19 @@
|
|
|
589
589
|
},
|
|
590
590
|
{
|
|
591
591
|
"path": "dist/feature-adr-routing.d.ts",
|
|
592
|
-
"sha256": "
|
|
592
|
+
"sha256": "a1af0f230be9ee3eaccdf24ada9364bc2169905b68efaec35cb6f6844284677c"
|
|
593
593
|
},
|
|
594
594
|
{
|
|
595
595
|
"path": "dist/feature-adr-routing.d.ts.map",
|
|
596
|
-
"sha256": "
|
|
596
|
+
"sha256": "0e74beee5ab13a4762e2219f8f77f65c2403636268682ba6828fd0bbc6fdef99"
|
|
597
597
|
},
|
|
598
598
|
{
|
|
599
599
|
"path": "dist/feature-adr-routing.js",
|
|
600
|
-
"sha256": "
|
|
600
|
+
"sha256": "a213058784464f7ba21be0178324d68fb417da00f3b416726f6acdf9de944b36"
|
|
601
601
|
},
|
|
602
602
|
{
|
|
603
603
|
"path": "dist/feature-adr-routing.js.map",
|
|
604
|
-
"sha256": "
|
|
604
|
+
"sha256": "2c1520e30dba9fad19981c7533edb57ef8be7f4dcf444463f4c00e33826b8663"
|
|
605
605
|
},
|
|
606
606
|
{
|
|
607
607
|
"path": "dist/feature-adr-setup.d.ts",
|
|
@@ -669,35 +669,35 @@
|
|
|
669
669
|
},
|
|
670
670
|
{
|
|
671
671
|
"path": "dist/index.d.ts",
|
|
672
|
-
"sha256": "
|
|
672
|
+
"sha256": "60629799e03201468849e368388b517acf33a809256cdd090ab3b47f6c8722b7"
|
|
673
673
|
},
|
|
674
674
|
{
|
|
675
675
|
"path": "dist/index.d.ts.map",
|
|
676
|
-
"sha256": "
|
|
676
|
+
"sha256": "780d4ace92fa01342a373e380b89f322cb7f6fa3fcc06779e2cae28c0a618170"
|
|
677
677
|
},
|
|
678
678
|
{
|
|
679
679
|
"path": "dist/index.js",
|
|
680
|
-
"sha256": "
|
|
680
|
+
"sha256": "3b1b2bfa5a343fd07b79715845ca3ce887ec614868ba37ae05114444142d1fb9"
|
|
681
681
|
},
|
|
682
682
|
{
|
|
683
683
|
"path": "dist/index.js.map",
|
|
684
|
-
"sha256": "
|
|
684
|
+
"sha256": "b60a401a6b62e2725c3b9419da607ad7d9fcea61de2b94d1b9afe8b3678ea07a"
|
|
685
685
|
},
|
|
686
686
|
{
|
|
687
687
|
"path": "dist/learning-backend.d.ts",
|
|
688
|
-
"sha256": "
|
|
688
|
+
"sha256": "2cb404295e5307cc20e92d6298f7b4184465ccfe4ebec30271720e5896852f10"
|
|
689
689
|
},
|
|
690
690
|
{
|
|
691
691
|
"path": "dist/learning-backend.d.ts.map",
|
|
692
|
-
"sha256": "
|
|
692
|
+
"sha256": "7cac1ab14956ad9b03902135f855d6636f97098d1654121dea5cb10eee3428e1"
|
|
693
693
|
},
|
|
694
694
|
{
|
|
695
695
|
"path": "dist/learning-backend.js",
|
|
696
|
-
"sha256": "
|
|
696
|
+
"sha256": "832e0a36bffa7e426c045b6ce6c70df972288127259e4adbf4abb840bccf5eab"
|
|
697
697
|
},
|
|
698
698
|
{
|
|
699
699
|
"path": "dist/learning-backend.js.map",
|
|
700
|
-
"sha256": "
|
|
700
|
+
"sha256": "12a2e54dacb1f856196cd2d012228fc29ee4c90414e8255fc5ada25e750e4555"
|
|
701
701
|
},
|
|
702
702
|
{
|
|
703
703
|
"path": "dist/ledger-backfill.d.ts",
|
|
@@ -715,6 +715,38 @@
|
|
|
715
715
|
"path": "dist/ledger-backfill.js.map",
|
|
716
716
|
"sha256": "f3d4b2dfaef7cf56542d489bc57a6dcbca97f20181bc1fd2d293341be5dd3706"
|
|
717
717
|
},
|
|
718
|
+
{
|
|
719
|
+
"path": "dist/lesson-bandit.d.ts",
|
|
720
|
+
"sha256": "18050085b5a86c89b8c73445e215d2bc974a42b0fe6d25fcaadfff4edfc84ade"
|
|
721
|
+
},
|
|
722
|
+
{
|
|
723
|
+
"path": "dist/lesson-bandit.d.ts.map",
|
|
724
|
+
"sha256": "d78f25bccf8b1ccb5fe76e6f9684519e8e8b5f312ae3e51bba27dc8d806bf904"
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
"path": "dist/lesson-bandit.js",
|
|
728
|
+
"sha256": "430a62096515a00fa9821312f3826b60b678aabc8fcf8790ed4465a536313e35"
|
|
729
|
+
},
|
|
730
|
+
{
|
|
731
|
+
"path": "dist/lesson-bandit.js.map",
|
|
732
|
+
"sha256": "d7bda1293981673a916e9bf1fdda1c45e88407d6a72572f77bdaddac73ed5f67"
|
|
733
|
+
},
|
|
734
|
+
{
|
|
735
|
+
"path": "dist/lesson-payoff.d.ts",
|
|
736
|
+
"sha256": "a73c7aa9d3aeea7bcc0ce5f32df392a3d4d1f43df2a41e89359d659ba73fc838"
|
|
737
|
+
},
|
|
738
|
+
{
|
|
739
|
+
"path": "dist/lesson-payoff.d.ts.map",
|
|
740
|
+
"sha256": "b4a01fd697d785c473d9b66689c8d140211fc09f8379ca7fa32e41fbd36ca940"
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
"path": "dist/lesson-payoff.js",
|
|
744
|
+
"sha256": "d08d6563fa6f1996701cccaad51896a752cc7a0dea8754fc941be1bc935da22b"
|
|
745
|
+
},
|
|
746
|
+
{
|
|
747
|
+
"path": "dist/lesson-payoff.js.map",
|
|
748
|
+
"sha256": "3cd74a4dbf1dd020e207b4cc5eb00db776c0656177a3d907b150eb536136f1a6"
|
|
749
|
+
},
|
|
718
750
|
{
|
|
719
751
|
"path": "dist/loop-blobs.generated.d.ts",
|
|
720
752
|
"sha256": "8fdf1f745ef4bec29517f455aac2550dabd19cb7b0ee68b3e6f2bb120a54d441"
|
|
@@ -989,19 +1021,19 @@
|
|
|
989
1021
|
},
|
|
990
1022
|
{
|
|
991
1023
|
"path": "dist/patterns.d.ts",
|
|
992
|
-
"sha256": "
|
|
1024
|
+
"sha256": "4f5b24a475a90fb4cf07d0af965300ce5c187206f68c0d497956b7538ee4f494"
|
|
993
1025
|
},
|
|
994
1026
|
{
|
|
995
1027
|
"path": "dist/patterns.d.ts.map",
|
|
996
|
-
"sha256": "
|
|
1028
|
+
"sha256": "4bad5098f61eef6a0f06600cccb1d57e8b137d4eadbf39278664c09bc5e1ba59"
|
|
997
1029
|
},
|
|
998
1030
|
{
|
|
999
1031
|
"path": "dist/patterns.js",
|
|
1000
|
-
"sha256": "
|
|
1032
|
+
"sha256": "edf5a1d5d1618789174d81b101164e161bde1f4441211bcdcb6b32bf5aaaa671"
|
|
1001
1033
|
},
|
|
1002
1034
|
{
|
|
1003
1035
|
"path": "dist/patterns.js.map",
|
|
1004
|
-
"sha256": "
|
|
1036
|
+
"sha256": "a4a57cf5feaf09a9f24ec98ef469d9de1e7dee7aa98db39de7696a9c67e953c7"
|
|
1005
1037
|
},
|
|
1006
1038
|
{
|
|
1007
1039
|
"path": "dist/plugin.d.ts",
|
|
@@ -1035,6 +1067,22 @@
|
|
|
1035
1067
|
"path": "dist/pretrain.js.map",
|
|
1036
1068
|
"sha256": "860e8a981ed7487ea23dd6a0055eb64a177c7fd7edbb6f4cef0aee910457a490"
|
|
1037
1069
|
},
|
|
1070
|
+
{
|
|
1071
|
+
"path": "dist/project-skills-root.d.ts",
|
|
1072
|
+
"sha256": "b813eeb038668ee94f10be30eae66cf22c9ac6372873586f74a308d0160c6dde"
|
|
1073
|
+
},
|
|
1074
|
+
{
|
|
1075
|
+
"path": "dist/project-skills-root.d.ts.map",
|
|
1076
|
+
"sha256": "5bcd786bb55c494c7a3f845dfa397565bc634ae938100b5e61773fb480b36ba0"
|
|
1077
|
+
},
|
|
1078
|
+
{
|
|
1079
|
+
"path": "dist/project-skills-root.js",
|
|
1080
|
+
"sha256": "041fb3db8b4b499e81cae600dac88a7b8f6d9a55b91bb6b0727c91493071c524"
|
|
1081
|
+
},
|
|
1082
|
+
{
|
|
1083
|
+
"path": "dist/project-skills-root.js.map",
|
|
1084
|
+
"sha256": "5c375be964336c926c53298f1230bd1a65c4bd02228b9d7d44bd1d12a0d57827"
|
|
1085
|
+
},
|
|
1038
1086
|
{
|
|
1039
1087
|
"path": "dist/project-skills.d.ts",
|
|
1040
1088
|
"sha256": "6fb31af2db70b4236860ae1a1c890af75e77485f607faf47e9f9dbb9ffd6e7c2"
|
|
@@ -1693,19 +1741,19 @@
|
|
|
1693
1741
|
},
|
|
1694
1742
|
{
|
|
1695
1743
|
"path": "dist/vector-tier.d.ts",
|
|
1696
|
-
"sha256": "
|
|
1744
|
+
"sha256": "97bea125865758822edd100aac5bcee5a82b8ab8a6a872ff891fc5897685e9d4"
|
|
1697
1745
|
},
|
|
1698
1746
|
{
|
|
1699
1747
|
"path": "dist/vector-tier.d.ts.map",
|
|
1700
|
-
"sha256": "
|
|
1748
|
+
"sha256": "711d7708988abc2c9cf3fb4c29d0b22717d839630a6fc90862d1f12d9c36b090"
|
|
1701
1749
|
},
|
|
1702
1750
|
{
|
|
1703
1751
|
"path": "dist/vector-tier.js",
|
|
1704
|
-
"sha256": "
|
|
1752
|
+
"sha256": "9fdd461b079011b92606be5f7007dd188a1942d07d3bf3e3e1ea624006036a13"
|
|
1705
1753
|
},
|
|
1706
1754
|
{
|
|
1707
1755
|
"path": "dist/vector-tier.js.map",
|
|
1708
|
-
"sha256": "
|
|
1756
|
+
"sha256": "06a6f1bea3207ee78f79d8198c90145f1049bba13306bc76515731757645f53f"
|
|
1709
1757
|
},
|
|
1710
1758
|
{
|
|
1711
1759
|
"path": "dist/workflow-run-dispatch.d.ts",
|
|
@@ -1773,7 +1821,7 @@
|
|
|
1773
1821
|
},
|
|
1774
1822
|
{
|
|
1775
1823
|
"path": "package.json",
|
|
1776
|
-
"sha256": "
|
|
1824
|
+
"sha256": "fcb5e9df9919234bb7645c10611cf925eef9901559a9e716a51f5cba2350f80a"
|
|
1777
1825
|
},
|
|
1778
1826
|
{
|
|
1779
1827
|
"path": "src/__tests__/golden-baseline.test.ts",
|
|
@@ -1789,7 +1837,7 @@
|
|
|
1789
1837
|
},
|
|
1790
1838
|
{
|
|
1791
1839
|
"path": "src/amendment-trace.ts",
|
|
1792
|
-
"sha256": "
|
|
1840
|
+
"sha256": "f7a778034f98933d2b423d251ccb945b34b984328f1b19017503a670c6ce4e7a"
|
|
1793
1841
|
},
|
|
1794
1842
|
{
|
|
1795
1843
|
"path": "src/apply.ts",
|
|
@@ -1921,7 +1969,7 @@
|
|
|
1921
1969
|
},
|
|
1922
1970
|
{
|
|
1923
1971
|
"path": "src/feature-adr-routing.ts",
|
|
1924
|
-
"sha256": "
|
|
1972
|
+
"sha256": "d7dcf5340f1a08744ccf362605d4ea6d019e911bc7b436cde236221adfb3ed35"
|
|
1925
1973
|
},
|
|
1926
1974
|
{
|
|
1927
1975
|
"path": "src/feature-adr-setup.ts",
|
|
@@ -1941,16 +1989,24 @@
|
|
|
1941
1989
|
},
|
|
1942
1990
|
{
|
|
1943
1991
|
"path": "src/index.ts",
|
|
1944
|
-
"sha256": "
|
|
1992
|
+
"sha256": "90152128cdfc920f0546819c0986ce4c4423252ee241d51297cfd5f942508e81"
|
|
1945
1993
|
},
|
|
1946
1994
|
{
|
|
1947
1995
|
"path": "src/learning-backend.ts",
|
|
1948
|
-
"sha256": "
|
|
1996
|
+
"sha256": "5548fba2761d7172437dc5ffdacf25ec58009afd98e32c04df396245363e65f4"
|
|
1949
1997
|
},
|
|
1950
1998
|
{
|
|
1951
1999
|
"path": "src/ledger-backfill.ts",
|
|
1952
2000
|
"sha256": "5659ef646baec7a952a4c7bf9eddc1cde24205ae8eb39f43999c5656ace42224"
|
|
1953
2001
|
},
|
|
2002
|
+
{
|
|
2003
|
+
"path": "src/lesson-bandit.ts",
|
|
2004
|
+
"sha256": "115b8af8d91fbaaec5ba10f9f28a05db01682e1a81b2af64f6d6004723f1b5ea"
|
|
2005
|
+
},
|
|
2006
|
+
{
|
|
2007
|
+
"path": "src/lesson-payoff.ts",
|
|
2008
|
+
"sha256": "5d0fff0bcc03b0bc52460bf4a2d1d247607c35650582693344c8b3168188ed75"
|
|
2009
|
+
},
|
|
1954
2010
|
{
|
|
1955
2011
|
"path": "src/loop-blobs.generated.ts",
|
|
1956
2012
|
"sha256": "2b463d35747e9c85ccff726487107ba5ff046b502e1f1384513f237877712963"
|
|
@@ -2021,7 +2077,7 @@
|
|
|
2021
2077
|
},
|
|
2022
2078
|
{
|
|
2023
2079
|
"path": "src/patterns.ts",
|
|
2024
|
-
"sha256": "
|
|
2080
|
+
"sha256": "947a7504ce220bbdcf19972c4dca63840435dcddcb3185c553fbc39a686f9b81"
|
|
2025
2081
|
},
|
|
2026
2082
|
{
|
|
2027
2083
|
"path": "src/plugin.ts",
|
|
@@ -2031,6 +2087,10 @@
|
|
|
2031
2087
|
"path": "src/pretrain.ts",
|
|
2032
2088
|
"sha256": "44c51921670aec06cd58a43d6bdadfa2cb02c9a2be113836d0816d4b95467302"
|
|
2033
2089
|
},
|
|
2090
|
+
{
|
|
2091
|
+
"path": "src/project-skills-root.ts",
|
|
2092
|
+
"sha256": "608b7ce670ce9fa02b115ded4652337ae4b7db6972ede743b7b25e0c18b07cd0"
|
|
2093
|
+
},
|
|
2034
2094
|
{
|
|
2035
2095
|
"path": "src/project-skills.ts",
|
|
2036
2096
|
"sha256": "07c0bfe1149403a2e06ec83271055a1ea441f14dd5ae363503ebfce02c8bc851"
|
|
@@ -2193,7 +2253,7 @@
|
|
|
2193
2253
|
},
|
|
2194
2254
|
{
|
|
2195
2255
|
"path": "src/vector-tier.ts",
|
|
2196
|
-
"sha256": "
|
|
2256
|
+
"sha256": "b1d89b496596be3d788fcb12e84a92716af4b2ee8199e6cc7bebee35e7f66b18"
|
|
2197
2257
|
},
|
|
2198
2258
|
{
|
|
2199
2259
|
"path": "src/workflow-run-dispatch.ts",
|
|
@@ -2213,5 +2273,5 @@
|
|
|
2213
2273
|
}
|
|
2214
2274
|
]
|
|
2215
2275
|
},
|
|
2216
|
-
"signature": "
|
|
2276
|
+
"signature": "TZTZroDpuNcSv0YMMMSGLXosq60F1DsLXlkP+fvW5T8xdbVDsfHIFL8XN7zMGUt+m0/Dg6O/eI4HqIkgNP1iCA=="
|
|
2217
2277
|
}
|
package/README.md
CHANGED
|
@@ -3,6 +3,32 @@
|
|
|
3
3
|
Shared logic for the DZ harness — the engine behind `@dzhechkov/harness-cli`
|
|
4
4
|
and any other consumer.
|
|
5
5
|
|
|
6
|
+
## Lesson payoff (bandit re-rank)
|
|
7
|
+
|
|
8
|
+
`lesson-bandit.ts` / `lesson-payoff.ts` add a **payoff axis** to lesson recall: a Beta posterior per
|
|
9
|
+
`(domain, lesson)` that answers *"has this lesson ever actually helped?"* — the question neither
|
|
10
|
+
cosine similarity nor SAFLA-delta asks.
|
|
11
|
+
|
|
12
|
+
Public surface: `contextKeyFor`, `classifySignal`, `makeRewardEvent`, `recordReward`,
|
|
13
|
+
`recordExposures`, `payoffTermsFor`, `narrowBanditReport`, `banditStats`, `renderBanditHealth`,
|
|
14
|
+
`resolveBanditConfig`, and the vendored `LessonBandit` engine.
|
|
15
|
+
|
|
16
|
+
Load-bearing properties, each pinned by a test that goes RED when the property is mutated out:
|
|
17
|
+
- **Disarmed by default.** `memory.learning.banditRerank` absent ⇒ the module is not even loaded and
|
|
18
|
+
ranking is byte-identical.
|
|
19
|
+
- **A view is not a reward.** `kind:'recall-hit'` is recorded as an EXPOSURE; only an explicit
|
|
20
|
+
confirmation moves the posterior.
|
|
21
|
+
- **Quarantine-closed.** Quarantined lessons never receive trial impressions unless
|
|
22
|
+
`banditExploration` is armed explicitly — that flag weakens an existing guarantee, so it ships off.
|
|
23
|
+
- **Bounded.** The term is added, never assigned, and capped; similarity still selects the candidates.
|
|
24
|
+
- **No lost update.** State writes go through a named lock; the reproducer test asserts both halves.
|
|
25
|
+
- **Unicode-scoped.** Domain keys keep letters in any script — Cyrillic and CJK domains stay distinct
|
|
26
|
+
instead of sharing one posterior.
|
|
27
|
+
|
|
28
|
+
The engine is vendored (215 lines, MIT, zero imports) rather than imported: its upstream path is not
|
|
29
|
+
in `agentdb`'s exports map, and a ranking feature that quietly stops ranking looks exactly like one
|
|
30
|
+
that works.
|
|
31
|
+
|
|
6
32
|
## What it provides
|
|
7
33
|
|
|
8
34
|
| Module | Exports | Purpose |
|
|
@@ -21,7 +21,18 @@ export interface AmendmentRow {
|
|
|
21
21
|
readonly file: string | null;
|
|
22
22
|
readonly raw: string;
|
|
23
23
|
}
|
|
24
|
-
export type AmendmentVerdict = 'resolved' | 'placeholder'
|
|
24
|
+
export type AmendmentVerdict = 'resolved' | 'placeholder'
|
|
25
|
+
/**
|
|
26
|
+
* The plan RETRACTED this amendment and named its successor. A first-class outcome, never a
|
|
27
|
+
* failure: a plan is allowed to change its mind, and until 2026-08-25 this checker had no concept
|
|
28
|
+
* of it at all (`grep superseded` over this file returned nothing), so a legitimately retracted
|
|
29
|
+
* amendment read as `unnamed` and failed the run. C6 has accepted the form since it was written —
|
|
30
|
+
* this is the half of the contract that was missing here.
|
|
31
|
+
*
|
|
32
|
+
* Honest limit, stated in ADR-001: nothing verifies that the named successor EXISTS, or that the
|
|
33
|
+
* retraction was justified. Refusing retraction outright is what produced the false failures.
|
|
34
|
+
*/
|
|
35
|
+
| 'superseded' | 'unnamed' | 'no-file-named' | 'file-missing' | 'name-absent-in-file';
|
|
25
36
|
export interface AmendmentResolution {
|
|
26
37
|
readonly id: string;
|
|
27
38
|
readonly testId: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"amendment-trace.d.ts","sourceRoot":"","sources":["../src/amendment-trace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,iEAAiE;AACjE,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,MAAM,gBAAgB,GACxB,UAAU,GACV,aAAa,
|
|
1
|
+
{"version":3,"file":"amendment-trace.d.ts","sourceRoot":"","sources":["../src/amendment-trace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,iEAAiE;AACjE,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,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S,YAAY,EAAE,GAChC,eAAe,EAAE,CAkBnB"}
|
package/dist/amendment-trace.js
CHANGED
|
@@ -57,7 +57,11 @@ export function normalizeTestId(s) {
|
|
|
57
57
|
* `features/ha-consilium/03.5_ideation_report.md` — is deliberately NOT a row: counting a legend as
|
|
58
58
|
* an amendment would open this feature by falsely accusing a feature that did nothing wrong.
|
|
59
59
|
*/
|
|
60
|
-
|
|
60
|
+
// The bullet is OPTIONAL, and `AM-CP-N` is a row like any other. MEASURED 2026-08-25: requiring a
|
|
61
|
+
// bullet drops 104 of the corpus's 347 real amendment rows out of the check entirely, and a
|
|
62
|
+
// bullet-less row made this tool return `not-established` — which the pipeline's own gate text calls
|
|
63
|
+
// "NEVER a pass". C6 has always treated the bullet as optional; this is that half of the contract.
|
|
64
|
+
const ROW_START = /^(?:[-*|]\s*)?\*{0,2}AM-(?:CP-)?(\d+)/gm;
|
|
61
65
|
/** The `## Amendments` section body, or null when the document has none (acid case A5). */
|
|
62
66
|
export function amendmentSection(md) {
|
|
63
67
|
const m = /^ {0,3}#{2,4}\s+Amendments\b[^\n]*\n/m.exec(md);
|
|
@@ -93,10 +97,14 @@ export function parseAmendments(md) {
|
|
|
93
97
|
}
|
|
94
98
|
return rows;
|
|
95
99
|
}
|
|
100
|
+
/** `superseded by AM-N` / `AM-CP-N` — the retraction form C6 has always accepted. */
|
|
101
|
+
const SUPERSEDED = /superseded by AM-(?:CP-)?\d+/i;
|
|
96
102
|
/** `→ test \`a\`` and the two-id shape `→ tests \`a\` and \`b\`` — both are in the corpus. */
|
|
97
103
|
function extractTestIds(raw) {
|
|
98
104
|
const out = [];
|
|
99
|
-
|
|
105
|
+
// Both arrows. C6 accepted `->` from the start and this file only accepted `→`, so an ASCII row
|
|
106
|
+
// read as `unnamed` here while passing there — an accident of two authors, not a decision.
|
|
107
|
+
const re = /(?:\u2192|->)\s*tests?\s+`([^`]+)`(?:\s*(?:and|и)\s*`([^`]+)`)?/g;
|
|
100
108
|
for (let m = re.exec(raw); m !== null; m = re.exec(raw)) {
|
|
101
109
|
if (m[1])
|
|
102
110
|
out.push(m[1].trim());
|
|
@@ -111,12 +119,18 @@ function extractTestIds(raw) {
|
|
|
111
119
|
* successive shell-written extractors returned 108, 111 and 13 rows over the identical corpus.
|
|
112
120
|
*/
|
|
113
121
|
function extractFile(raw) {
|
|
114
|
-
const m =
|
|
122
|
+
const m = /(?:\u2192|->)\s*tests?\s+`[^`]+`(?:\s*(?:and|и)\s*`[^`]+`)?[\s\S]{0,40}?\bin\s+`([^`]+)`/.exec(raw);
|
|
115
123
|
return m && m[1] ? m[1].trim() : null;
|
|
116
124
|
}
|
|
117
125
|
export function resolveAmendments(rows, opts) {
|
|
118
126
|
const out = [];
|
|
119
127
|
for (const row of rows) {
|
|
128
|
+
// A retraction is checked BEFORE the missing-pointer branch: a row that says it was superseded
|
|
129
|
+
// is not a row that forgot its test.
|
|
130
|
+
if (SUPERSEDED.test(row.raw)) {
|
|
131
|
+
out.push({ id: row.id, testId: null, file: row.file, verdict: 'superseded', detail: 'the plan retracted this amendment and named its successor' });
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
120
134
|
if (row.testIds.length === 0) {
|
|
121
135
|
out.push({
|
|
122
136
|
id: row.id,
|
|
@@ -172,6 +186,7 @@ function resolveOne(row, testId, readFile) {
|
|
|
172
186
|
const ZERO_COUNTS = {
|
|
173
187
|
resolved: 0,
|
|
174
188
|
placeholder: 0,
|
|
189
|
+
superseded: 0,
|
|
175
190
|
unnamed: 0,
|
|
176
191
|
'no-file-named': 0,
|
|
177
192
|
'file-missing': 0,
|
|
@@ -222,7 +237,10 @@ export function decideAmendmentOutcome(input) {
|
|
|
222
237
|
reasons.push(`the ideation report carries ${input.rows.length} amendment row(s) while 06_implementation_plan.md records \`## Amendments: None\` — the amendments were renegotiated away, and an amendment nobody can resolve is one nobody can audit`);
|
|
223
238
|
}
|
|
224
239
|
for (const r of input.resolutions) {
|
|
225
|
-
|
|
240
|
+
// `superseded` is an OUTCOME, not a defect: the plan retracted the amendment and said so. It is
|
|
241
|
+
// reported in the counts and never becomes a reason, which is the whole point — refusing
|
|
242
|
+
// retraction is what produced the false failures this change removes.
|
|
243
|
+
if (r.verdict !== 'resolved' && r.verdict !== 'superseded')
|
|
226
244
|
reasons.push(`${r.id} → ${r.verdict}: ${r.detail}`);
|
|
227
245
|
}
|
|
228
246
|
return { outcome: reasons.length > 0 ? 'fail' : 'pass', exit: reasons.length > 0 ? 1 : 0, reasons, counts };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"amendment-trace.js","sourceRoot":"","sources":["../src/amendment-trace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;
|
|
1
|
+
{"version":3,"file":"amendment-trace.js","sourceRoot":"","sources":["../src/amendment-trace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AA+CH;;;GAGG;AACH,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAE5G;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC;AAEzC,wGAAwG;AACxG;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,mBAAmB,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,qBAAqB,EAAE,IAAI,CAAC,CAAC;IACzF,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,+FAA+F;IAC/F,gGAAgG;IAChG,4FAA4F;IAC5F,0FAA0F;IAC1F,uFAAuF;IACvF,MAAM,EAAE,GAAG,0HAA0H,CAAC;IACtI,KAAK,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,GAAG,EAAE,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gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACvC,MAAM,GAAG,GAAG,gBAAgB,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC1C,8FAA8F;QAC9F,mEAAmE;QACnE,IAAI,IAAI,CAAC,MAAM,IAAI,uBAAuB,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACzF,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC,CAAC;QACrD,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -525,7 +525,26 @@ export declare function isSafeCodexId(id: string): boolean;
|
|
|
525
525
|
* unquoted, so a malformed `args.codexModel` could corrupt or extend the command the agent runs.
|
|
526
526
|
* Reject anything that is not a plain id, and single-quote it anyway.
|
|
527
527
|
*/
|
|
528
|
-
|
|
528
|
+
/**
|
|
529
|
+
* Which binary bounds a dispatched run. `timeout(1)` is GNU coreutils and is NOT on macOS; brew's
|
|
530
|
+
* coreutils installs it as `gtimeout`.
|
|
531
|
+
*
|
|
532
|
+
* An ALLOWLIST rather than a free string, because this value is interpolated into a shell command.
|
|
533
|
+
*
|
|
534
|
+
* MEASURED 2026-08-25 (field report, and reproduced here): with neither binary present the dispatch
|
|
535
|
+
* exits 127 and cross-family QE — a NAMED safety property, that the model which wrote the code must
|
|
536
|
+
* not review it — silently did not happen for a whole run.
|
|
537
|
+
*
|
|
538
|
+
* Deliberately NOT the portable `perl -e 'alarm N; exec @ARGV'` the report proposed: MEASURED on
|
|
539
|
+
* this machine, that form exits **142** (SIGALRM kills the exec'd process) while GNU timeout exits
|
|
540
|
+
* **124**, and `classifyCodexQeOutcome` keys `timeout` on `exit === 124` — a rule its own comment
|
|
541
|
+
* says wins over every content rule. The suggested remedy would have silently reclassified every
|
|
542
|
+
* timeout as a tool error. A remedy that breaks the classifier is worse than the defect.
|
|
543
|
+
*/
|
|
544
|
+
export declare const TIMEOUT_BINS: Readonly<Record<string, true>>;
|
|
545
|
+
/** The requested timeout binary if it is one we allow, else the default. Never a free string. */
|
|
546
|
+
export declare function timeoutBinOrDefault(bin: unknown): string;
|
|
547
|
+
export declare function codexProbeCommand(id: string, timeoutBin?: string): string | null;
|
|
529
548
|
export interface CodexProbeOutput {
|
|
530
549
|
readonly stdout: string;
|
|
531
550
|
readonly exitCode: number;
|
|
@@ -551,6 +570,8 @@ export declare function parseCodexGrade(text: string): string | null;
|
|
|
551
570
|
export declare function parseCodexExecResult(text: string | null | undefined): CodexExecResult;
|
|
552
571
|
/** Mode-A wall-clock bound. Run 3 measured 146 s; 600 s is ~4× headroom and still bounded. */
|
|
553
572
|
export declare const CODEX_REVIEW_TIMEOUT_SECONDS = 600;
|
|
573
|
+
/** The `codex exec` wall-clock bound. Mirrors the workflow's own constant (field report 27). */
|
|
574
|
+
export declare const CODEX_EXEC_TIMEOUT_SECONDS = 280;
|
|
554
575
|
/** MEASURED (probe 0.3): `codex review` accepts and echoes `reasoning effort: high`. */
|
|
555
576
|
export declare const CODEX_REVIEW_DEFAULT_EFFORT = "high";
|
|
556
577
|
/** The sentinel a wrapper returns when the command hit its `timeout` — distinct from CODEX_UNAVAILABLE. */
|
|
@@ -578,6 +599,22 @@ export interface CodexReviewCommandInput {
|
|
|
578
599
|
readonly ref?: string | null;
|
|
579
600
|
readonly modelId?: string | null;
|
|
580
601
|
readonly reasoning?: string | null;
|
|
602
|
+
/**
|
|
603
|
+
* Which binary bounds the run — `timeout` (default) or `gtimeout` on a mac with brew coreutils.
|
|
604
|
+
* An INPUT rather than a platform sniff inside the builder, so the function stays pure and every
|
|
605
|
+
* pinned command string in the tests stays byte-identical when it is omitted.
|
|
606
|
+
*/
|
|
607
|
+
readonly timeoutBin?: string | null;
|
|
608
|
+
/**
|
|
609
|
+
* The repo the review must run IN. Field report 27: `codex review` was dispatched with no working
|
|
610
|
+
* directory at all, so it ran in the SESSION cwd — on a run against an external checkout it read a
|
|
611
|
+
* different tree, resolved `--uncommitted` / `--base` against the wrong git repo, and still exited 0
|
|
612
|
+
* with a `Grade:` line that the pipeline recorded as a verdict. `codex review` has NO `-C` flag
|
|
613
|
+
* (MEASURED on codex-cli 0.149.1: `codex exec --help` carries `-C, --cd <DIR>`, `codex review --help`
|
|
614
|
+
* does not), so the working directory can only be set by a `cd` prefix. Omitted ⇒ no prefix, which
|
|
615
|
+
* keeps every previously pinned command string byte-identical.
|
|
616
|
+
*/
|
|
617
|
+
readonly repo?: string | null;
|
|
581
618
|
/**
|
|
582
619
|
* Accepted and DELIBERATELY IGNORED. MEASURED 2026-08-21: every scope flag refuses a positional
|
|
583
620
|
* prompt — `--commit`, `--base <BRANCH>` and `--uncommitted` each exit 2 with
|
|
@@ -595,17 +632,19 @@ export interface CodexReviewCommandResult {
|
|
|
595
632
|
readonly reason: string | null;
|
|
596
633
|
}
|
|
597
634
|
/**
|
|
598
|
-
*
|
|
599
|
-
*
|
|
600
|
-
*
|
|
601
|
-
*
|
|
602
|
-
*
|
|
603
|
-
* • never emit `-m` — `codex review` rejects it; the model goes through `-c model=`;
|
|
604
|
-
* • never append a positional prompt — no scope flag accepts one.
|
|
605
|
-
*
|
|
606
|
-
* Default scope is `uncommitted` (probe 0.4b: it and `--base HEAD` reviewed the identical uncommitted
|
|
607
|
-
* diff, and `uncommitted` needs no ref, so it has no ref-injection surface at all).
|
|
635
|
+
* The `codex exec` dispatch, built as a pure string so the working directory is pinned by a test
|
|
636
|
+
* rather than by whichever directory the dispatching agent happened to stand in (field report 27).
|
|
637
|
+
* `-C` is real on codex-cli 0.149.1 and MEASURED: `-C <this repo>` answered in 4.6 s exit 0, while
|
|
638
|
+
* `-C /tmp` exited 1 with "Not inside a trusted directory" — so the flag genuinely changes the tree,
|
|
639
|
+
* and a non-git target is a LOUD failure rather than a quiet read of the wrong one.
|
|
608
640
|
*/
|
|
641
|
+
export declare function codexExecCommand(input: {
|
|
642
|
+
readonly modelId?: string | null;
|
|
643
|
+
readonly prompt?: string | null;
|
|
644
|
+
readonly timeoutBin?: string | null;
|
|
645
|
+
readonly timeoutSeconds?: number | null;
|
|
646
|
+
readonly repo?: string | null;
|
|
647
|
+
}): string | null;
|
|
609
648
|
export declare function codexReviewCommand(input: CodexReviewCommandInput): CodexReviewCommandResult;
|
|
610
649
|
export interface ScopedQePromptInput {
|
|
611
650
|
readonly files?: readonly string[] | null;
|
|
@@ -699,7 +738,25 @@ export interface ClassifyCodexQeInput {
|
|
|
699
738
|
* that was never wrapped (a saved fixture, a file on disk), where content is all there is.
|
|
700
739
|
*/
|
|
701
740
|
readonly signalExpected?: boolean;
|
|
741
|
+
/**
|
|
742
|
+
* The files the dispatch DECLARED it would review. Used only by the wrong-tree rule below; absent
|
|
743
|
+
* ⇒ that rule cannot fire and the classifier behaves exactly as it did before field report 27.
|
|
744
|
+
*/
|
|
745
|
+
readonly declaredFiles?: readonly string[] | null;
|
|
702
746
|
}
|
|
747
|
+
/**
|
|
748
|
+
* Did the reviewer fail to FIND the very files it was told to read?
|
|
749
|
+
*
|
|
750
|
+
* A review dispatched into the wrong working directory does not error: the paths simply are not
|
|
751
|
+
* there, the model says so in prose, and the command still exits 0 — often with a `Grade:` line,
|
|
752
|
+
* which the pipeline then records as a verdict about code nobody read.
|
|
753
|
+
*
|
|
754
|
+
* The rule is deliberately narrow, because a review of a file-handling module may legitimately
|
|
755
|
+
* DISCUSS "No such file or directory" — a mention is not a claim. So it fires only when one LINE
|
|
756
|
+
* carries both the not-found phrase and one of the declared paths. With no declared paths there is
|
|
757
|
+
* nothing to discriminate against and the rule stays silent rather than guessing.
|
|
758
|
+
*/
|
|
759
|
+
export declare function codexReviewMissedItsFiles(body: string | null | undefined, declaredFiles?: readonly string[] | null): boolean;
|
|
703
760
|
/**
|
|
704
761
|
* Classify one Codex QE dispatch. The property this whole feature exists to protect lives here:
|
|
705
762
|
* a TIMEOUT and an UNUSABLE OUTPUT must never collapse into the same kind, because the operator's
|
|
@@ -765,7 +822,7 @@ export interface CodexReviewResult {
|
|
|
765
822
|
* wrapper and calls {@link classifyCodexQeOutcome} directly with `signalExpected: true`, so a
|
|
766
823
|
* swallowed sentinel there is a `tool-error` and never a pass. A wiring test pins that.
|
|
767
824
|
*/
|
|
768
|
-
export declare function parseCodexReviewResult(text: string | null | undefined): CodexReviewResult;
|
|
825
|
+
export declare function parseCodexReviewResult(text: string | null | undefined, declaredFiles?: readonly string[] | null): CodexReviewResult;
|
|
769
826
|
/** CX-3: a workflow that names an agent type the harness does not have must fall back, not die. */
|
|
770
827
|
export declare function isAgentTypeMissingError(err: unknown): boolean;
|
|
771
828
|
/**
|