test: contract acceptance test missing from #187
Independent Staging Quality Gate / validate-frontend (push) Successful in 5m12s
Independent Staging Quality Gate / validate-python (push) Successful in 6m38s
Independent Staging Quality Gate / publish (push) Successful in 3m12s

The fixed line sits once on contract row 6c and in no product block sent to
the model (TASK-limitation-line brief, acceptance item 7).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DbBXoyn7Hj3LCW3BUs5bZ8
This commit is contained in:
2026-11-09 17:41:19 +08:00
co-authored by Claude Opus 5.5
parent 66ad72ce8b
commit bfd7c30a85
@@ -0,0 +1,35 @@
// #187 / BUG-1834 acceptance addition (Claude, 2026-11-09): brief item 7 was not in Grok's test file.
// The fixed line is written once in the contract's section F 6c note, outside every product block, so no
// text sent to the model contains it.
import assert from "node:assert/strict";
import test from "node:test";
import { CONSULT_VERIFICATION_LIMIT_LINE } from "../src/lib/consult-answer-basis.ts";
import {
productContractBlockRaw,
productRuntimeContractSource,
type ProductContractBlock,
} from "../src/lib/product-runtime-contract.ts";
const BLOCKS: readonly ProductContractBlock[] = [
"runtime-contract",
"chat-method-boundaries",
"natal-instructions",
"mevg-blocked-policy",
"shared-reading",
];
test("the contract carries the line exactly once, on the 6c row", () => {
const source = productRuntimeContractSource();
assert.equal(source.split(CONSULT_VERIFICATION_LIMIT_LINE).length - 1, 1);
const row = source.split("\n").find((line) => line.includes(CONSULT_VERIFICATION_LIMIT_LINE)) ?? "";
assert.match(row, /^6c\. (BUG-1794,产品决定,偏离她的方法裁定)/);
assert.match(row, /产品负责人 2026-11-09 同意(BUG-1834)/);
});
test("no product block sent to the model contains the line", () => {
const source = productRuntimeContractSource();
for (const name of BLOCKS) {
assert.doesNotMatch(productContractBlockRaw(name, source), new RegExp(CONSULT_VERIFICATION_LIMIT_LINE), name);
}
});