fix(rectification): surface dropped probes and filter tools by the decision
Independent Staging Quality Gate / validate (push) Failing after 17m9s
Independent Staging Quality Gate / publish (push) Has been skipped

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:
Jesse_Chen
2026-08-28 20:31:15 +08:00
co-authored by Cursor
parent 69c3e94920
commit 63b4591aae
25 changed files with 856 additions and 274 deletions
@@ -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"),