fix(evals): bind cached-build restrictions to their artifact

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-11-04 19:25:59 -06:00
1 parent 22cb59c1c3
commit 91fbaf9eb5
2 files changed
+6 -3

No files matched your search

@@ -96,3 +96,7 @@ it("keeps the required viewport review when a separate restriction forbids testi
it("rejects a universal execution restriction despite a separately stated viewport check", () => {
expect(preservesWebsiteChecklist(`${websiteChecklist.join("\n")}; do not perform the check using any browser.`)).toBe(false);
});
it("keeps a quantified noncurrent artifact restriction separate from a universal review waiver", () => {
expect(preservesWebsiteChecklist(`${websiteChecklist.join("\n")}; do not perform the check on any cached build.`)).toBe(true);
});
@@ -29,9 +29,8 @@ function websiteChecklistChecks(markdown: string): boolean[] {
const overflow = /\boverflow(?:ing)?\b/i.exec(action);
const restriction = /\b(?:on|with|using|against)\s+(.+)$/i.exec(action)?.[1];
const qualified = !!restriction
&& /\b(?:cached|stale|outdated|previous|old|archived)\b/i.test(restriction)
&& /\b(?:build|version|snapshot|artifact|bundle)\b/i.test(restriction)
&& !/\b(?:any|all|every|current|live|selected|375\s*(?:px|pixels?)?|viewport|mobile|width)\b/i.test(restriction);
&& /^(?:(?:a|an|the|any|all|every|this|that|these|those)\s+)?(?:cached|stale|outdated|previous|old|archived)\s+(?:build|version|snapshot|artifact|bundle)s?\b/i.test(restriction)
&& !/\b(?:current|live|selected|375\s*(?:px|pixels?)?|viewport|mobile|width)\b/i.test(restriction);
return !!target && (!overflow || target.index < overflow.index) && !(affirmative && qualified);
}));
};