@sanity/ailf 4.0.1 → 4.0.2
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.
|
@@ -1224,8 +1224,11 @@ export interface ComparisonReport {
|
|
|
1224
1224
|
deltas: {
|
|
1225
1225
|
/** Overall score delta (experiment.avgScore − baseline.avgScore) */
|
|
1226
1226
|
overall: number;
|
|
1227
|
-
/** Per-area total score deltas */
|
|
1228
|
-
perArea:
|
|
1227
|
+
/** Per-area total score deltas (array shape — W0137 / D0041) */
|
|
1228
|
+
perArea: {
|
|
1229
|
+
area: string;
|
|
1230
|
+
delta: number;
|
|
1231
|
+
}[];
|
|
1229
1232
|
/** Per-dimension average deltas (across all areas) */
|
|
1230
1233
|
perDimension: Record<string, number>;
|
|
1231
1234
|
/** Doc Lift average delta */
|
package/dist/pipeline/compare.js
CHANGED
|
@@ -71,11 +71,13 @@ export function compare(baseline, experiment, options) {
|
|
|
71
71
|
const notEvaluated = areas
|
|
72
72
|
.filter((a) => a.change === "not-evaluated")
|
|
73
73
|
.map((a) => a.area);
|
|
74
|
-
// Per-area deltas as
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
74
|
+
// Per-area deltas as an array (W0137 / D0041) — keyed-map shapes are
|
|
75
|
+
// capped by the Sanity attribute limit because each new feature area
|
|
76
|
+
// mints a permanent attribute path.
|
|
77
|
+
const perArea = areas.map((a) => ({
|
|
78
|
+
area: a.area,
|
|
79
|
+
delta: a.delta,
|
|
80
|
+
}));
|
|
79
81
|
// Per-dimension average deltas (only for areas present in both summaries)
|
|
80
82
|
const commonAreas = areas.filter((a) => baselineAreas.has(a.area) && experimentAreas.has(a.area));
|
|
81
83
|
const commonCount = commonAreas.length || 1;
|