fix(rectification): bump scoring identity to scoring-11 after D5/D11 (BUG-1260)

This commit is contained in:
jesse-ux
2026-10-07 17:47:00 +08:00
parent 5eb11e7cd1
commit d46f9675aa
10 changed files with 6978 additions and 33 deletions
@@ -22,13 +22,14 @@ test("dated contract is a generation threshold, not one literal", () => {
}
});
test("receipt default and Python identity agree on scoring-10", (t) => {
test("receipt default and Python identity agree on scoring-11", (t) => {
const saved = process.env.RECTIFICATION_ENGINE_VERSION;
delete process.env.RECTIFICATION_ENGINE_VERSION;
t.after(() => { if (saved === undefined) delete process.env.RECTIFICATION_ENGINE_VERSION; else process.env.RECTIFICATION_ENGINE_VERSION = saved; });
assert.equal(v9EngineVersion(), "rectification-v5-matrix-scoring-10");
// 原值: rectification-v5-matrix-scoring-10;新值: ...-scoring-11;原因: D5/D11 改变同输入分数(BUG-1260)。
assert.equal(v9EngineVersion(), "rectification-v5-matrix-scoring-11");
const python = readFileSync(new URL("../../scripts/rectification/scoring_service.py", import.meta.url), "utf8");
assert.match(python, /^ALGORITHM_VERSION = "rectification-v5-matrix-scoring-10"$/m);
assert.match(python, /^ALGORITHM_VERSION = "rectification-v5-matrix-scoring-11"$/m);
});
test("no source file compares the algorithm identity with a scoring-N literal", () => {
@@ -73,3 +74,16 @@ test("a scoring-9 history opens read-only under scoring-10 and offers a recompar
// Its candidates still parse as dated (generation >= 9), so the opened history keeps civil dates.
assert.ok(dossier.latestResult!.candidates.every((candidate) => typeof candidate.candidate_date === "string"));
});
test("a scoring-10 history opens read-only under scoring-11 and offers a recompare (BUG-621)", () => {
const historical = JSON.parse(readFileSync(new URL("./fixtures/rectification-midnight-date-anchor.delivery.scoring-10.native.json", import.meta.url), "utf8")).response;
assert.equal(historical.algorithm_version, "rectification-v5-matrix-scoring-10");
const latest = { ...historical, candidates: historical.candidate_decisions };
const dossier = parseV9CaseDossier(dossierFixture({ stage: "minute", latestResult: latest }));
assert.ok(dossier);
assert.equal(dossier.latestResult?.algorithmVersion, "rectification-v5-matrix-scoring-10");
const policyVersion = historical.decision_policy_version;
const underEleven = resultIdentityView(dossier, { algorithmVersion: "rectification-v5-matrix-scoring-11", policyVersion });
assert.deepEqual([underEleven.read_only, underEleven.can_recompare, underEleven.algorithm_version], [true, true, "rectification-v5-matrix-scoring-10"]);
assert.ok(dossier.latestResult!.candidates.every((candidate) => typeof candidate.candidate_date === "string"));
});