mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-10 12:37:55 +01:00
fix(evals): bind cached-build restrictions to their artifact
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
06f6c86f18
commit
75a82cbd1f
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);
|
||||
}));
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user