fix(evals): name refusals from dispatch authority and chat admission too

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
DottaandClaude Opus 5.5 committed 2026-11-07 14:32:36 -06:00
1 parent 1892ba16ad
commit c80393e966
2 files changed
+11

No files matched your search

@@ -1,3 +1,4 @@
import { readFileSync } from "node:fs";
import { expect, it } from "vitest";
import { fixedRefusalMessages, privateRefusalCode } from "./private-refusal-code.js";
@@ -16,3 +17,12 @@ it("never returns the text of a dynamic or system message", () => {
expect(privateRefusalCode(leaked)).toBe("non-error-thrown");
for (const value of [new Error(`x ${leaked}`), new TypeError(leaked), leaked]) expect(privateRefusalCode(value)).not.toContain("secret");
});
it("names refusals from the dispatch-authority and admission modules the transfer calls", () => {
const fixed = fixedRefusalMessages();
for (const file of ["manual-dispatch-authority.ts", "testops-chat-admission.ts"]) {
const literals = [...readFileSync(new URL(`./${file}`, import.meta.url), "utf8").matchAll(/new Error\("([^"$`\\]+)"\)/g)].map(match => match[1]!);
expect(literals.length, file).toBeGreaterThan(0);
for (const message of literals) expect(privateRefusalCode(new Error(message), fixed), message).not.toBe("dynamic");
}
});
+1
View File
@@ -4,6 +4,7 @@ import { readFileSync } from "node:fs";
export const PRIVATE_REFUSAL_MODULES = [
"manual-private-transfer.ts", "manual-private-handoff.ts", "manual-private-retention.ts", "manual-private-report-assets.ts",
"private-history.ts", "private-framework-report.ts", "history-budget.ts", "evidence.ts", "redaction.ts",
"manual-dispatch-authority.ts", "testops-chat-admission.ts",
] as const;
let known: ReadonlySet<string> | undefined;