fix(rectification): surface dropped probes and filter tools by the decision
Silent unrenderable discriminators, a missing question-contract golden, and a always-on tool table were hiding fail-closed drops behind the prompt wall. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -261,6 +261,25 @@ test("runV9CandidateScore strictly consumes server candidate decisions and v2 re
|
||||
}
|
||||
});
|
||||
|
||||
test("runV9CandidateScore fails closed on a mismatched question contract version", async () => {
|
||||
const restore = stubEngine({
|
||||
...ENGINE_SCORE_RESPONSE_V2,
|
||||
decision_receipt: { ...DECISION_RECEIPT, question_contract_version: "probe-question-v0" },
|
||||
});
|
||||
try {
|
||||
await assert.rejects(
|
||||
runV9CandidateScore({
|
||||
baselineBirthSnapshot: SNAPSHOT,
|
||||
candidateRange: RANGE,
|
||||
events: toEngineEvents(EVIDENCE),
|
||||
}),
|
||||
(error: unknown) => error instanceof RectificationEngineError && error.code === "engine_invalid_v2_receipt",
|
||||
);
|
||||
} finally {
|
||||
restore();
|
||||
}
|
||||
});
|
||||
|
||||
test("runV9CandidateScore fails closed without a v2 decision receipt", async () => {
|
||||
const missingReceipt = Object.fromEntries(
|
||||
Object.entries(ENGINE_SCORE_RESPONSE_V2).filter(([key]) => key !== "decision_receipt"),
|
||||
|
||||
Reference in New Issue
Block a user