@dzhechkov/harness-core 0.3.143 → 0.3.145
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 +65 -17
- package/dist/compounding.d.ts +22 -0
- package/dist/compounding.d.ts.map +1 -1
- package/dist/compounding.js +29 -10
- package/dist/compounding.js.map +1 -1
- package/dist/epoch-replay.d.ts +399 -0
- package/dist/epoch-replay.d.ts.map +1 -0
- package/dist/epoch-replay.js +695 -0
- package/dist/epoch-replay.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 +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/sbom.json +136 -16
- package/src/compounding.ts +45 -8
- package/src/epoch-replay.ts +955 -0
- package/src/guard-promotion.ts +958 -0
- package/src/guard.ts +76 -3
- package/src/index.ts +56 -0
package/sbom.json
CHANGED
|
@@ -615,7 +615,7 @@
|
|
|
615
615
|
"hashes": [
|
|
616
616
|
{
|
|
617
617
|
"alg": "SHA-256",
|
|
618
|
-
"content": "
|
|
618
|
+
"content": "34eb7f1754a631ebe5f390dee53f1ea276a85e6cabd25806c384aeef23f64d3c"
|
|
619
619
|
}
|
|
620
620
|
]
|
|
621
621
|
},
|
|
@@ -625,7 +625,7 @@
|
|
|
625
625
|
"hashes": [
|
|
626
626
|
{
|
|
627
627
|
"alg": "SHA-256",
|
|
628
|
-
"content": "
|
|
628
|
+
"content": "22cddbd67b5a6204cccc2bf100735c33e138f7400769ad073dc694df4fb0f2b2"
|
|
629
629
|
}
|
|
630
630
|
]
|
|
631
631
|
},
|
|
@@ -635,7 +635,7 @@
|
|
|
635
635
|
"hashes": [
|
|
636
636
|
{
|
|
637
637
|
"alg": "SHA-256",
|
|
638
|
-
"content": "
|
|
638
|
+
"content": "dc8d3d48e8387391828175bff981016dfa449b19aa1a55e6420adbd688a112fb"
|
|
639
639
|
}
|
|
640
640
|
]
|
|
641
641
|
},
|
|
@@ -645,7 +645,7 @@
|
|
|
645
645
|
"hashes": [
|
|
646
646
|
{
|
|
647
647
|
"alg": "SHA-256",
|
|
648
|
-
"content": "
|
|
648
|
+
"content": "afc564287b7a548b15051e64151c05687b8a45b66df7c964e7168591bb93414c"
|
|
649
649
|
}
|
|
650
650
|
]
|
|
651
651
|
},
|
|
@@ -889,6 +889,46 @@
|
|
|
889
889
|
}
|
|
890
890
|
]
|
|
891
891
|
},
|
|
892
|
+
{
|
|
893
|
+
"type": "file",
|
|
894
|
+
"name": "dist/epoch-replay.d.ts",
|
|
895
|
+
"hashes": [
|
|
896
|
+
{
|
|
897
|
+
"alg": "SHA-256",
|
|
898
|
+
"content": "7b45f33f2948d102e09204dec03bdff93c70571d79c9466faf014126139cd0b9"
|
|
899
|
+
}
|
|
900
|
+
]
|
|
901
|
+
},
|
|
902
|
+
{
|
|
903
|
+
"type": "file",
|
|
904
|
+
"name": "dist/epoch-replay.d.ts.map",
|
|
905
|
+
"hashes": [
|
|
906
|
+
{
|
|
907
|
+
"alg": "SHA-256",
|
|
908
|
+
"content": "155f1584c236ef7d805522377e20d651c01bd07ad96a6dcc17847d9f6b3885e2"
|
|
909
|
+
}
|
|
910
|
+
]
|
|
911
|
+
},
|
|
912
|
+
{
|
|
913
|
+
"type": "file",
|
|
914
|
+
"name": "dist/epoch-replay.js",
|
|
915
|
+
"hashes": [
|
|
916
|
+
{
|
|
917
|
+
"alg": "SHA-256",
|
|
918
|
+
"content": "fbed667f04a07975915a35ed78d582c05a6669e744d457b3ac38a0cbb35d4539"
|
|
919
|
+
}
|
|
920
|
+
]
|
|
921
|
+
},
|
|
922
|
+
{
|
|
923
|
+
"type": "file",
|
|
924
|
+
"name": "dist/epoch-replay.js.map",
|
|
925
|
+
"hashes": [
|
|
926
|
+
{
|
|
927
|
+
"alg": "SHA-256",
|
|
928
|
+
"content": "f0c5eb87cdc3727e7eb857e5d07f8fd376902c66c48a23af61998677ea48acda"
|
|
929
|
+
}
|
|
930
|
+
]
|
|
931
|
+
},
|
|
892
932
|
{
|
|
893
933
|
"type": "file",
|
|
894
934
|
"name": "dist/feature-adr-claim-gate.d.ts",
|
|
@@ -1009,13 +1049,53 @@
|
|
|
1009
1049
|
}
|
|
1010
1050
|
]
|
|
1011
1051
|
},
|
|
1052
|
+
{
|
|
1053
|
+
"type": "file",
|
|
1054
|
+
"name": "dist/guard-promotion.d.ts",
|
|
1055
|
+
"hashes": [
|
|
1056
|
+
{
|
|
1057
|
+
"alg": "SHA-256",
|
|
1058
|
+
"content": "eba21256fa7ed8082acf9571c0606aa2926c0a13635fd994aa74f44d7f3db1d4"
|
|
1059
|
+
}
|
|
1060
|
+
]
|
|
1061
|
+
},
|
|
1062
|
+
{
|
|
1063
|
+
"type": "file",
|
|
1064
|
+
"name": "dist/guard-promotion.d.ts.map",
|
|
1065
|
+
"hashes": [
|
|
1066
|
+
{
|
|
1067
|
+
"alg": "SHA-256",
|
|
1068
|
+
"content": "6da389f6fbdae2b886d526db90b09ca7fabac88f26ff96e73cdfd98d1a6a90d4"
|
|
1069
|
+
}
|
|
1070
|
+
]
|
|
1071
|
+
},
|
|
1072
|
+
{
|
|
1073
|
+
"type": "file",
|
|
1074
|
+
"name": "dist/guard-promotion.js",
|
|
1075
|
+
"hashes": [
|
|
1076
|
+
{
|
|
1077
|
+
"alg": "SHA-256",
|
|
1078
|
+
"content": "a03bf0166ac3056d93c67a2571c6300cc92941424cc5a8aecce529a6879e4a47"
|
|
1079
|
+
}
|
|
1080
|
+
]
|
|
1081
|
+
},
|
|
1082
|
+
{
|
|
1083
|
+
"type": "file",
|
|
1084
|
+
"name": "dist/guard-promotion.js.map",
|
|
1085
|
+
"hashes": [
|
|
1086
|
+
{
|
|
1087
|
+
"alg": "SHA-256",
|
|
1088
|
+
"content": "858b3ad88b0c2fdf3a66a89075df493e3592cbf8c12f3df880be93a0e446ad8e"
|
|
1089
|
+
}
|
|
1090
|
+
]
|
|
1091
|
+
},
|
|
1012
1092
|
{
|
|
1013
1093
|
"type": "file",
|
|
1014
1094
|
"name": "dist/guard.d.ts",
|
|
1015
1095
|
"hashes": [
|
|
1016
1096
|
{
|
|
1017
1097
|
"alg": "SHA-256",
|
|
1018
|
-
"content": "
|
|
1098
|
+
"content": "5ac5bd9b2d927117d124861c5532a0618c5f3f4859b8a91a6b62203475db047e"
|
|
1019
1099
|
}
|
|
1020
1100
|
]
|
|
1021
1101
|
},
|
|
@@ -1025,7 +1105,7 @@
|
|
|
1025
1105
|
"hashes": [
|
|
1026
1106
|
{
|
|
1027
1107
|
"alg": "SHA-256",
|
|
1028
|
-
"content": "
|
|
1108
|
+
"content": "f56619488145d4ccdac45298cb76647ea670d5b37d210f30972b602d3fad5f24"
|
|
1029
1109
|
}
|
|
1030
1110
|
]
|
|
1031
1111
|
},
|
|
@@ -1035,7 +1115,7 @@
|
|
|
1035
1115
|
"hashes": [
|
|
1036
1116
|
{
|
|
1037
1117
|
"alg": "SHA-256",
|
|
1038
|
-
"content": "
|
|
1118
|
+
"content": "7dc53438c377aa007264384fc30f34764fcb969fd6d0bfae15a0b976bafd0e17"
|
|
1039
1119
|
}
|
|
1040
1120
|
]
|
|
1041
1121
|
},
|
|
@@ -1045,7 +1125,7 @@
|
|
|
1045
1125
|
"hashes": [
|
|
1046
1126
|
{
|
|
1047
1127
|
"alg": "SHA-256",
|
|
1048
|
-
"content": "
|
|
1128
|
+
"content": "389544fa42d0010f48ae1bccdd81170053fbd56d5131c1479db87535c9a34662"
|
|
1049
1129
|
}
|
|
1050
1130
|
]
|
|
1051
1131
|
},
|
|
@@ -1095,7 +1175,7 @@
|
|
|
1095
1175
|
"hashes": [
|
|
1096
1176
|
{
|
|
1097
1177
|
"alg": "SHA-256",
|
|
1098
|
-
"content": "
|
|
1178
|
+
"content": "88d54740d8b19ff5dd759810459d8484c2fa5b428f5d2bf56fcbc431b439eb47"
|
|
1099
1179
|
}
|
|
1100
1180
|
]
|
|
1101
1181
|
},
|
|
@@ -1105,7 +1185,7 @@
|
|
|
1105
1185
|
"hashes": [
|
|
1106
1186
|
{
|
|
1107
1187
|
"alg": "SHA-256",
|
|
1108
|
-
"content": "
|
|
1188
|
+
"content": "8538e8daa8b84ad85e961062b78a25ded82cbb575fd8a60d5ad1a01d3d924396"
|
|
1109
1189
|
}
|
|
1110
1190
|
]
|
|
1111
1191
|
},
|
|
@@ -1115,7 +1195,7 @@
|
|
|
1115
1195
|
"hashes": [
|
|
1116
1196
|
{
|
|
1117
1197
|
"alg": "SHA-256",
|
|
1118
|
-
"content": "
|
|
1198
|
+
"content": "6d90d71faff6629442c9f553be6da1e8b3b1bf29c36c04ebd28b63b24cb63e67"
|
|
1119
1199
|
}
|
|
1120
1200
|
]
|
|
1121
1201
|
},
|
|
@@ -1125,7 +1205,7 @@
|
|
|
1125
1205
|
"hashes": [
|
|
1126
1206
|
{
|
|
1127
1207
|
"alg": "SHA-256",
|
|
1128
|
-
"content": "
|
|
1208
|
+
"content": "a31f03dd37db8ddc701ddb181aaf46ec11259ea099924a03e91fdc2bb59ee125"
|
|
1129
1209
|
}
|
|
1130
1210
|
]
|
|
1131
1211
|
},
|
|
@@ -2575,7 +2655,7 @@
|
|
|
2575
2655
|
"hashes": [
|
|
2576
2656
|
{
|
|
2577
2657
|
"alg": "SHA-256",
|
|
2578
|
-
"content": "
|
|
2658
|
+
"content": "97904a633c24b3de454752e7d3d5f3b0bb8904d18b64ed90787d6963a3103087"
|
|
2579
2659
|
}
|
|
2580
2660
|
]
|
|
2581
2661
|
},
|
|
@@ -2725,7 +2805,7 @@
|
|
|
2725
2805
|
"hashes": [
|
|
2726
2806
|
{
|
|
2727
2807
|
"alg": "SHA-256",
|
|
2728
|
-
"content": "
|
|
2808
|
+
"content": "7ccb87beb02047e78c192e544e5aa893eb4c95ab21542fc38fdd1e123e8fc2cd"
|
|
2729
2809
|
}
|
|
2730
2810
|
]
|
|
2731
2811
|
},
|
|
@@ -2789,6 +2869,16 @@
|
|
|
2789
2869
|
}
|
|
2790
2870
|
]
|
|
2791
2871
|
},
|
|
2872
|
+
{
|
|
2873
|
+
"type": "file",
|
|
2874
|
+
"name": "src/epoch-replay.ts",
|
|
2875
|
+
"hashes": [
|
|
2876
|
+
{
|
|
2877
|
+
"alg": "SHA-256",
|
|
2878
|
+
"content": "031c838e16e30617e5149ff16af75d8b4058922525d1851682323ba0bc0bb85f"
|
|
2879
|
+
}
|
|
2880
|
+
]
|
|
2881
|
+
},
|
|
2792
2882
|
{
|
|
2793
2883
|
"type": "file",
|
|
2794
2884
|
"name": "src/feature-adr-claim-gate.ts",
|
|
@@ -2819,13 +2909,23 @@
|
|
|
2819
2909
|
}
|
|
2820
2910
|
]
|
|
2821
2911
|
},
|
|
2912
|
+
{
|
|
2913
|
+
"type": "file",
|
|
2914
|
+
"name": "src/guard-promotion.ts",
|
|
2915
|
+
"hashes": [
|
|
2916
|
+
{
|
|
2917
|
+
"alg": "SHA-256",
|
|
2918
|
+
"content": "45e05ef83ac730442760a55f9859f36b2b2a56db53465ca0267f517024646026"
|
|
2919
|
+
}
|
|
2920
|
+
]
|
|
2921
|
+
},
|
|
2822
2922
|
{
|
|
2823
2923
|
"type": "file",
|
|
2824
2924
|
"name": "src/guard.ts",
|
|
2825
2925
|
"hashes": [
|
|
2826
2926
|
{
|
|
2827
2927
|
"alg": "SHA-256",
|
|
2828
|
-
"content": "
|
|
2928
|
+
"content": "e7559a9f42448374ae133a323f8d9e4fa21625b15853d544e1c077ae9331a2ce"
|
|
2829
2929
|
}
|
|
2830
2930
|
]
|
|
2831
2931
|
},
|
|
@@ -2845,7 +2945,7 @@
|
|
|
2845
2945
|
"hashes": [
|
|
2846
2946
|
{
|
|
2847
2947
|
"alg": "SHA-256",
|
|
2848
|
-
"content": "
|
|
2948
|
+
"content": "30f96c27c2f364d5a3aac7311167dba0f154adea3295a182f9b1cfcc28d6f3a6"
|
|
2849
2949
|
}
|
|
2850
2950
|
]
|
|
2851
2951
|
},
|
|
@@ -3459,6 +3559,16 @@
|
|
|
3459
3559
|
}
|
|
3460
3560
|
]
|
|
3461
3561
|
},
|
|
3562
|
+
{
|
|
3563
|
+
"type": "file",
|
|
3564
|
+
"name": "test/epoch-replay.test.ts",
|
|
3565
|
+
"hashes": [
|
|
3566
|
+
{
|
|
3567
|
+
"alg": "SHA-256",
|
|
3568
|
+
"content": "5f1f87608f41587f54f0b071b49ec19e1242ef94edc5c2a9be191534661f8ec9"
|
|
3569
|
+
}
|
|
3570
|
+
]
|
|
3571
|
+
},
|
|
3462
3572
|
{
|
|
3463
3573
|
"type": "file",
|
|
3464
3574
|
"name": "test/feature-adr-abs-paths.test.ts",
|
|
@@ -3559,6 +3669,16 @@
|
|
|
3559
3669
|
}
|
|
3560
3670
|
]
|
|
3561
3671
|
},
|
|
3672
|
+
{
|
|
3673
|
+
"type": "file",
|
|
3674
|
+
"name": "test/guard-promotion.test.ts",
|
|
3675
|
+
"hashes": [
|
|
3676
|
+
{
|
|
3677
|
+
"alg": "SHA-256",
|
|
3678
|
+
"content": "c7d38f9ba7d2a1a1d5e40b9422eeef0ffc7784b015adb41a9c8d89893f529c9e"
|
|
3679
|
+
}
|
|
3680
|
+
]
|
|
3681
|
+
},
|
|
3562
3682
|
{
|
|
3563
3683
|
"type": "file",
|
|
3564
3684
|
"name": "test/guard.test.ts",
|
package/src/compounding.ts
CHANGED
|
@@ -106,6 +106,47 @@ export interface UsageEvent {
|
|
|
106
106
|
readonly queryTruncated?: boolean;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
+
export interface ReplayInstance {
|
|
110
|
+
/** Stable per-PROMPT key — one prompt is one instance, however many lessons it injected. */
|
|
111
|
+
readonly id: string;
|
|
112
|
+
readonly query: string;
|
|
113
|
+
/** Exactly the lesson texts the apply leg injected for this prompt — the WARM arm's only delta. */
|
|
114
|
+
readonly lessons: readonly string[];
|
|
115
|
+
/**
|
|
116
|
+
* Pre-registered slice label (e.g. `task` / `conversational`). `null` until a human assigns it —
|
|
117
|
+
* nothing here invents a classification, because a class assigned AFTER outcomes are known is
|
|
118
|
+
* not a pre-registration.
|
|
119
|
+
*/
|
|
120
|
+
readonly class: string | null;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* The ONE definition of "a replayable pair": the readiness gate below COUNTS these and
|
|
125
|
+
* `dz epoch-replay --emit` EMITS these. A second copy would let readiness say 12 while the runner
|
|
126
|
+
* emits 9, silently — the drift class this repo keeps catching.
|
|
127
|
+
*
|
|
128
|
+
* Rules: a prompt with no query cannot be replayed; a TRUNCATED query is a prefix, not the prompt;
|
|
129
|
+
* one prompt = one instance (the hook writes one row per injected hit, up to 3 per prompt).
|
|
130
|
+
*/
|
|
131
|
+
export function replayableInstances(
|
|
132
|
+
usage: readonly UsageEvent[],
|
|
133
|
+
lessonText: ReadonlyMap<string, string> = new Map(),
|
|
134
|
+
): ReplayInstance[] {
|
|
135
|
+
const byKey = new Map<string, { query: string; lessons: string[] }>();
|
|
136
|
+
for (const u of usage) {
|
|
137
|
+
if (typeof u.query !== 'string' || u.query.trim() === '') continue;
|
|
138
|
+
if (u.queryTruncated === true) continue; // a prefix is not the prompt
|
|
139
|
+
const key = u.eventId ?? `${u.runId ?? ''}|${u.ts}|${u.query}`;
|
|
140
|
+
const entry = byKey.get(key) ?? { query: u.query, lessons: [] };
|
|
141
|
+
const text = lessonText.get(u.dzId);
|
|
142
|
+
if (typeof text === 'string' && text.trim() !== '' && !entry.lessons.includes(text)) {
|
|
143
|
+
entry.lessons.push(text);
|
|
144
|
+
}
|
|
145
|
+
byKey.set(key, entry);
|
|
146
|
+
}
|
|
147
|
+
return [...byKey.entries()].map(([id, e]) => ({ id, query: e.query, lessons: e.lessons, class: null }));
|
|
148
|
+
}
|
|
149
|
+
|
|
109
150
|
export interface GuardEvent {
|
|
110
151
|
readonly ts: string;
|
|
111
152
|
readonly verdict: string;
|
|
@@ -238,14 +279,10 @@ export function assembleCompoundingReport(facts: CompoundingFacts): CompoundingR
|
|
|
238
279
|
|
|
239
280
|
// 3. Replay readiness — cold-vs-warm needs (query -> injected lesson) pairs. They were never
|
|
240
281
|
// recorded before 2026-07-28, so this gate REPORTS accrual instead of faking a verdict.
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
// one prompt = one pair, however many hits it injected
|
|
246
|
-
replayKeys.add(u.eventId ?? `${u.runId ?? ''}|${u.ts}|${u.query}`);
|
|
247
|
-
}
|
|
248
|
-
const replayablePairs = replayKeys.size;
|
|
282
|
+
// The rule ("no query / truncated query / one prompt = one pair") has exactly ONE definition,
|
|
283
|
+
// in epoch-replay.ts, and the RUNNER emits precisely what this gate counts — a second copy
|
|
284
|
+
// would let readiness say 12 while the runner emits 9, silently.
|
|
285
|
+
const replayablePairs = replayableInstances(usage).length;
|
|
249
286
|
const replay: ReplayReadiness = {
|
|
250
287
|
replayablePairs,
|
|
251
288
|
minNeeded: MIN_SAMPLES_PER_ARM,
|