diff --git a/tests/runner-e2e/chat-catalog-domains/internal-timeline-narrative.test.ts b/tests/runner-e2e/chat-catalog-domains/internal-timeline-narrative.test.ts index 1731e579035..c907eb2e21d 100644 --- a/tests/runner-e2e/chat-catalog-domains/internal-timeline-narrative.test.ts +++ b/tests/runner-e2e/chat-catalog-domains/internal-timeline-narrative.test.ts @@ -25,6 +25,11 @@ it("does not infer the initial worker over a contrary possessive within the comm .replace("The verification command failed", "The verification command failed on Riley's attempt"); expect(grade(reply)).toBe(false); }); +it("does not credit a different worker's execution as the first failed attempt", () => { + const reply = account.replace("**First attempt (Morgan)**\nMorgan built the page. ", "") + .replace("command failed", "command failed during Riley's execution"); + expect(grade(reply)).toBe(false); +}); it("keeps a contrary worker heading as invalidation across blank lines", () => { const reply = account.replace("First attempt (Morgan)", "Initial attempt (Riley)") .replace("Morgan built the page. ", "Riley built the page.\n\n"); diff --git a/tests/runner-e2e/chat-catalog-domains/internal-timeline-narrative.ts b/tests/runner-e2e/chat-catalog-domains/internal-timeline-narrative.ts index 6f7bd31e294..49a75bfd5c8 100644 --- a/tests/runner-e2e/chat-catalog-domains/internal-timeline-narrative.ts +++ b/tests/runner-e2e/chat-catalog-domains/internal-timeline-narrative.ts @@ -15,9 +15,9 @@ export function truthfulTimelineAccount(input: { const mentions = (text: string, name: string) => new RegExp(`\\b${escape(name)}\\b`, "i").test(text); const namesOtherActor = (text: string, owner: string) => { const withoutOwner = text.replace(new RegExp(`\\b${escape(owner)}\\b`, "gi"), ""); - return [firstWorker, repairWorker, input.personName].some(name => !!name && name !== owner && new RegExp(`\\b${escape(name)}['’]s\\s+(?:[a-z][a-z0-9_-]*\\s+){0,3}(?:attempt|run|verification|check|test|command|build|implementation|artifact|output|file|page|prototype)\\b`, "i").test(withoutOwner)) + return [firstWorker, repairWorker, input.personName].some(name => !!name && name !== owner && new RegExp(`\\b${escape(name)}['’]s\\s+(?:[a-z][a-z0-9_-]*\\s+){0,3}(?:attempt|run|execution|verification|check|test|command|build|implementation|artifact|output|file|page|prototype)\\b`, "i").test(withoutOwner)) || /\b(?:human|operator|person|user|board|CEO)\b/i.test(withoutOwner) - || [...withoutOwner.matchAll(/\b([A-Z][\p{L}'-]+)['’]s\s+(?:[a-z][a-z0-9_-]*\s+){0,3}(?:attempt|run|verification|check|test|command)\b/gu)].some(match => + || [...withoutOwner.matchAll(/\b([A-Z][\p{L}'-]+)['’]s\s+(?:[a-z][a-z0-9_-]*\s+){0,3}(?:attempt|run|execution|verification|check|test|command)\b/gu)].some(match => !calendarWords.has(match[1]!.toLowerCase()) && !/^(?:today|tomorrow|yesterday)$/i.test(match[1]!)) || /\b(?:another|different|other)\s+(?:worker|agent|person|engineer|reviewer|operator)\b/i.test(withoutOwner) || /\b(?:run|ran|executed|performed)\s+by\s+[A-Z][a-z]+\b|\b[A-Z][a-z]+(?:\s+[A-Z][a-z]+)*\s+(?:ran|executed|performed)\b/.test(withoutOwner)