From 2c6d7460150e65e72306637a2f7373bf1694d718 Mon Sep 17 00:00:00 2001 From: Dotta Date: Tue, 27 Oct 2026 23:24:08 -0500 Subject: [PATCH] fix(evals): retain contracted delivery negation in date grading --- .../chat-catalog-domains/internal-artifact-search.test.ts | 4 ++++ .../chat-catalog-domains/internal-artifact-search.ts | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/runner-e2e/chat-catalog-domains/internal-artifact-search.test.ts b/tests/runner-e2e/chat-catalog-domains/internal-artifact-search.test.ts index 195dd101527..810bb958163 100644 --- a/tests/runner-e2e/chat-catalog-domains/internal-artifact-search.test.ts +++ b/tests/runner-e2e/chat-catalog-domains/internal-artifact-search.test.ts @@ -18,6 +18,8 @@ describe("migrated historical website artifact calibration", () => { "The final website was delivered 21 October 2026.", "The approved final was delivered Oct 21.", "The final was delivered 2026-10-21 and imported October 26, 2026.", + "The earlier draft wasn't delivered October 20, 2026; the final website was delivered October 21, 2026.", + "I didn't change the files; the final website was delivered October 21, 2026.", ])("accepts correct source dates without a literal last-week phrase: %s", reply => { const o = valid(); o.reply = reply; expect(gradeArtifactSearch(o).passed).toBe(true); }); @@ -27,6 +29,8 @@ describe("migrated historical website artifact calibration", () => { "The final approved website was delivered last week, on October 26, 2026.", "The final approved website was not delivered last week.", "The final approved website was not delivered on October 21, 2026.", + "The final approved website wasn't delivered on October 21, 2026.", + "The final approved website wasn’t delivered last week.", ])("rejects wrong or contradicted delivery dates: %s", reply => { const o = valid(); o.reply = reply; expect(gradeArtifactSearch(o).passed).toBe(false); }); diff --git a/tests/runner-e2e/chat-catalog-domains/internal-artifact-search.ts b/tests/runner-e2e/chat-catalog-domains/internal-artifact-search.ts index bd1f0f4ae9f..1dbd860c88c 100644 --- a/tests/runner-e2e/chat-catalog-domains/internal-artifact-search.ts +++ b/tests/runner-e2e/chat-catalog-domains/internal-artifact-search.ts @@ -63,7 +63,8 @@ export function describesHistoricalDelivery(reply: string, deliveredAt: string) const months = "(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|Jun(?:e)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)"; const dates = new RegExp(`\\b(?:\\d{4}-\\d{2}-\\d{2}|${months}\\s+\\d{1,2}(?:st|nd|rd|th)?(?:,?\\s+\\d{4})?|\\d{1,2}(?:st|nd|rd|th)?\\s+(?:of\\s+)?${months}(?:,?\\s+\\d{4})?)\\b`, "gi"); let matched = false; - for (const part of reply.split(/\n+|;|(?<=[.!?])\s+/)) { + const prose = reply.replace(/\b(was|were|is|are|has|have|had|did|does|do|could|would|should|must)n['’]t\b/gi, "$1 not"); + for (const part of prose.split(/\n+|;|(?<=[.!?])\s+/)) { // Qualified older history may have a different date; it is not the selected final. if (/\b(?:older|earlier|previous|superseded|outside)\b/i.test(part)) continue; if (/\blast\s+week\b/i.test(part)) {