fix(rectification): close round A/2 tail gaps in tests, CI, and stale-score reuse
Window_scan assertions now match the public from_sign/to_sign contract, the staging quick gate runs the rectification Python suite, and compare-candidates rescores when stored policy lags the live engine identity. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -11,6 +11,10 @@ import {
|
||||
} from "../src/lib/rectification-agentic/core/snapshot-source.ts";
|
||||
import type { ConflictProbe } from "../src/lib/rectification-agentic/core/types.ts";
|
||||
import { contrastPacketFromLatestResult } from "../src/lib/rectification-agentic/v9/decision-from-dossier.ts";
|
||||
import {
|
||||
cachedEngineScoreIsReusable,
|
||||
liveEngineScoringIdentityFromEnv,
|
||||
} from "../src/lib/rectification-agentic/v9/engine-client.ts";
|
||||
import {
|
||||
parseDiscriminatingEventProbes,
|
||||
parseProspectiveProbes,
|
||||
@@ -84,6 +88,39 @@ test("scoring policy version changes stale stored snapshots", () => {
|
||||
assert.equal(storedSnapshotIsCurrent(current, current), true);
|
||||
});
|
||||
|
||||
test("matching fingerprints still rescore when stored policy lags the live engine", () => {
|
||||
const fingerprints = {
|
||||
evidenceLedgerFingerprint: "b".repeat(64),
|
||||
candidateRangeFingerprint: "c".repeat(64),
|
||||
};
|
||||
const stored = {
|
||||
...fingerprints,
|
||||
algorithmVersion: "rectification-v5-matrix-scoring-6",
|
||||
policyVersion: "rectification-candidate-policy-v2",
|
||||
};
|
||||
assert.equal(
|
||||
cachedEngineScoreIsReusable(stored, fingerprints, {
|
||||
algorithmVersion: "rectification-v5-matrix-scoring-6",
|
||||
policyVersion: "rectification-candidate-policy-v2",
|
||||
}),
|
||||
true,
|
||||
);
|
||||
assert.equal(
|
||||
cachedEngineScoreIsReusable(stored, fingerprints, {
|
||||
algorithmVersion: "rectification-v5-matrix-scoring-7",
|
||||
policyVersion: "rectification-candidate-policy-v3",
|
||||
}),
|
||||
false,
|
||||
);
|
||||
const fromEnv = liveEngineScoringIdentityFromEnv({
|
||||
RECTIFICATION_ENGINE_VERSION: "rectification-v5",
|
||||
RECTIFICATION_DECISION_POLICY_VERSION: "rectification-candidate-policy-v3",
|
||||
});
|
||||
assert.equal(fromEnv.algorithmVersion, null);
|
||||
assert.equal(fromEnv.policyVersion, "rectification-candidate-policy-v3");
|
||||
assert.equal(cachedEngineScoreIsReusable(stored, fingerprints, fromEnv), false);
|
||||
});
|
||||
|
||||
test("anchored known_event_quality distinguish probes stay in the public packet", () => {
|
||||
const parsed = parseDiscriminatingEventProbes([qualityProbe()]);
|
||||
assert.equal(parsed.length, 1);
|
||||
|
||||
Reference in New Issue
Block a user