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 f7bcbdaad40..b3486c6d019 100644 --- a/tests/runner-e2e/chat-catalog-domains/internal-timeline-narrative.ts +++ b/tests/runner-e2e/chat-catalog-domains/internal-timeline-narrative.ts @@ -31,10 +31,10 @@ export function truthfulTimelineAccount(input: { }; const handoffMatches = (text: string) => { if (differentNamedPerson(text) || /\b(?:not|never|no)\b[^.!?]{0,50}\b(?:reassign|assign|hand|handoff)/i.test(text)) return []; - const actorUnspecified = [...text.matchAll(passiveHandoffToRepairWorker)].filter(match => + const actorUnspecified = [...text.matchAll(passiveHandoffToRepairWorker), ...text.matchAll(successorOwnership)].filter(match => !/\bby\b/i.test(text.slice(match.index + match[0].length)) && !/\b(?:automatically|autonomously|self-assigned)\b/i.test(text)); - return [...text.matchAll(new RegExp(handoffToRepairWorker.source, "gi")), ...actorUnspecified, ...text.matchAll(successorOwnership)].filter(match => { + return [...text.matchAll(new RegExp(handoffToRepairWorker.source, "gi")), ...actorUnspecified].filter(match => { // An explicit other person's role must not become the current human just // because earlier milestones share this sentence. if (!/^(?:human|person|user|operator|board)\b/i.test(match[0])) return true; diff --git a/tests/runner-e2e/chat-catalog-domains/internal-timeline-native-milestone.test.ts b/tests/runner-e2e/chat-catalog-domains/internal-timeline-native-milestone.test.ts index c029bd77469..5eee89d72d2 100644 --- a/tests/runner-e2e/chat-catalog-domains/internal-timeline-native-milestone.test.ts +++ b/tests/runner-e2e/chat-catalog-domains/internal-timeline-native-milestone.test.ts @@ -47,6 +47,11 @@ it("accepts the successor's natural ownership transition in the ordered account" o.reply = o.reply.replace("Then a human reassigned the task to Riley.", "Then Riley took over the task."); expect(gradeWorkTimeline(o).passed).toBe(true); }); +it.each(["automatically", "by Morgan"])("keeps unspecified takeover provenance truthful: %s", provenance => { + const o = fixture(); + o.reply = o.reply.replace("Then a human reassigned the task to Riley.", `Then Riley took over the task ${provenance}.`); + expect(gradeWorkTimeline(o).passed).toBe(false); +}); it.each([ "Then the task was reassigned to Riley by Morgan.", "Then the task was reassigned to Riley by Jordan.",