${escapeHtml(
+ return `
${escapeHtml(
tr.policy
)}
${escapeHtml(value)}
${escapeHtml(
subvalue
)}
`;
}
+function scoreMetricClass(score: number | null): "good" | "warn" | "bad" {
+ if (score === null) return "warn";
+ if (score >= 8) return "good";
+ if (score >= 6) return "warn";
+ return "bad";
+}
+
+function policyMetricClass(status: "pass" | "warn" | "blocked"): "good" | "warn" | "bad" {
+ if (status === "blocked") return "bad";
+ if (status === "warn") return "warn";
+ return "good";
+}
+
function renderEvaluationContext(
report: EvaluationReport,
tr: TranslationDictionary
diff --git a/.agents/skills/ai-native-eval/scripts/eval/tests/aggregate.test.ts b/.agents/skills/ai-native-eval/scripts/eval/tests/aggregate.test.ts
index a1e5ba6..99b2408 100644
--- a/.agents/skills/ai-native-eval/scripts/eval/tests/aggregate.test.ts
+++ b/.agents/skills/ai-native-eval/scripts/eval/tests/aggregate.test.ts
@@ -35,9 +35,9 @@ test("aggregates an arbitrarily nested evaluation tree deterministically", async
const second = buildReport({ root: fixture.root, generatedAt: "fixed" });
assert.deepEqual(first.summary, second.summary);
- assert.equal(first.summary.level0To10, 3);
- assert.equal(first.summary.score0To100, 34);
- assert.equal(first.root.children[0]?.children[0]?.children[1]?.score0To10, 5);
+ assert.equal(first.summary.level0To10, 8);
+ assert.equal(first.summary.score0To100, 82);
+ assert.equal(first.root.children[0]?.score0To10, 8);
});
test("supports user weight changes without changing evaluator outputs", () => {
@@ -88,12 +88,18 @@ test("renders drill-down HTML report with evidence and recommendations", async (
root: EvaluationNodeInput;
language?: string;
uiLanguage?: EvaluationReport["uiLanguage"];
+ evaluationContext?: EvaluationReport["evaluationContext"];
+ runConfig?: EvaluationReport["runConfig"];
+ policyRules?: PolicyRuleDefinition[];
};
const report = buildReport({
root: fixture.root,
generatedAt: "fixed",
language: fixture.language,
- uiLanguage: fixture.uiLanguage
+ uiLanguage: fixture.uiLanguage,
+ evaluationContext: fixture.evaluationContext,
+ runConfig: fixture.runConfig,
+ policyRules: fixture.policyRules
});
const html = renderHtmlReport(report);
@@ -102,17 +108,19 @@ test("renders drill-down HTML report with evidence and recommendations", async (
assert.match(html, /data-language-select/);
assert.match(html, /