test(router-eval): assert regression reasons instead of counting entries

The test named 'captures AIQ and cost regressions' only asserted
regressions.length > 0, which re-implements a condition the production
comparison owns and passes even if either regression stops being
reported. Assert the actual AIQ and cost reasons instead — strictly
stronger and clears the weakened-assert gate.
This commit is contained in:
Diego Rodrigues de Sa e Souza
2026-07-19 13:04:35 -03:00
parent a856e3dd20
commit 6360b2514e
2 changed files with 9 additions and 1 deletions

View File

@@ -0,0 +1 @@
- Strengthen the `compareRouterEvalRuns` regression test to assert the actual AIQ and cost regression reasons instead of counting entries, clearing the weakened-assert (test-masking) gate on the release tip.

View File

@@ -73,7 +73,14 @@ test("compareRouterEvalRuns captures AIQ and cost regressions", () => {
relativeCostIncrease: 1.2,
});
assert.equal(comparison.regressions.length > 0, true);
assert.ok(
comparison.regressions.some((reason) => reason.startsWith("AIQ dropped by")),
"expected an AIQ regression to be reported"
);
assert.ok(
comparison.regressions.some((reason) => reason.startsWith("cost increased by")),
"expected a cost regression to be reported"
);
assert.equal(comparison.delta.aiq <= 0, true);
assert.equal(comparison.delta.costUsd > 0, true);
});