Skip to content

Commit d8e5096

Browse files
committed
test(scoring): cover activeModelWarnings both-saturation-and-density branch
Exercises the "both present" branch of activeModelWarnings end-to-end through refreshScoringModelSnapshot, mirroring the existing "neither present" test pattern.
1 parent aad3f93 commit d8e5096

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

test/unit/scoring.test.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,26 @@ NOVELTY_BONUS_SCALAR = 3
352352
expect(refreshed.warnings.join(" ")).toMatch(/recognized active-model indicator/i);
353353
});
354354

355+
it("warns when fetched constants include both saturation and density indicators", async () => {
356+
const env = createTestEnv();
357+
vi.stubGlobal("fetch", async (input: RequestInfo | URL) => {
358+
const url = input.toString();
359+
if (url.includes("constants.py")) {
360+
return new Response(
361+
VALID_CONSTANTS_PY + "SRC_TOK_SATURATION_SCALE = 58.0\nMIN_TOKEN_SCORE_FOR_BASE_SCORE = 5\nMAX_CODE_DENSITY_MULTIPLIER = 1.15\n",
362+
);
363+
}
364+
if (url.includes("programming_languages.json")) return Response.json({});
365+
return new Response("not found", { status: 404 });
366+
});
367+
368+
const refreshed = await refreshScoringModelSnapshot(env);
369+
370+
expect(refreshed.warnings).toContain(
371+
"Scoring constants include both exponential saturation and density-era indicators; using exponential saturation as the active model.",
372+
);
373+
});
374+
355375
it("flags upstream scoring constants loopover does not model (staleness visibility)", () => {
356376
// SRC_TOK_SATURATION_SCALE and the TIME_DECAY_* constants are now modeled (#703); a hypothetical new
357377
// upstream dimension is NOT — so only that surfaces as unmodeled drift.

0 commit comments

Comments
 (0)