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 6f05577d403..325ffd6ac9f 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 @@ -91,3 +91,10 @@ it.each(["2:51:50 PM —", "14:51:50:", "14:51:50"])("reads an equivalent displa it.each(["## Repair (Riley)\n\n", "**Repair (Riley)** "])("reads an adjacent heading layout %s", heading => { expect(grade(account.replace("**Repair (Riley)**\n", heading))).toBe(true); }); + +it.each(["on Monday's run", "during Today's run"])("does not turn a possessive day into the command actor: %s", day => { + expect(grade(account.replace("failed with exit 1", `failed ${day} with exit 1`))).toBe(true); +}); +it.each(["engineer", "reviewer"])("rejects an explicit %s runner without assigning that role to the heading", role => { + expect(grade(account.replace("The verification command failed", `The verification command that the ${role} ran failed`))).toBe(false); +}); 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 c5d67711b2d..4717c2eafb4 100644 --- a/tests/runner-e2e/chat-catalog-domains/internal-timeline-narrative.ts +++ b/tests/runner-e2e/chat-catalog-domains/internal-timeline-narrative.ts @@ -8,8 +8,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 /\b(?:human|operator|person|user|board|CEO|engineer)\b/i.test(withoutOwner) - || /\b[A-Z][a-z]+['’]s\b/.test(withoutOwner) + return /\b(?:human|operator|person|user|board|CEO)\b/i.test(withoutOwner) + || /^\s*[A-Z][a-z]+['’]s\b/.test(withoutOwner) + || /\b(?:the|a|an)\s+[a-z]+(?:\s+[a-z]+){0,2}\s+(?:ran|executed|performed)\b|\b(?:run|ran|executed|performed)\s+by\s+(?:the|a|an)\s+[a-z]+\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) || /(?:^|[.!?]\s+|\b(?:that|which|while|when)\s+)(?!(?:The|A|An|Then|Next|Later|Finally|He|She|They|You)\b)[A-Z][a-z]+(?:\s+[A-Z][a-z]+)*\s+(?:[a-z]+(?:ed|s)|ran|built|made|did|had|was|is)\b/.test(withoutOwner); };