From c41869f6df1d18183dcbebd2a00db1f1ad41f67e Mon Sep 17 00:00:00 2001 From: Dotta Date: Tue, 3 Nov 2026 09:15:33 -0600 Subject: [PATCH] test(activity): retain equivalent actor-owned repair descriptions Co-Authored-By: Paperclip --- .../internal-timeline-narrative.ts | 9 ++++++++- .../internal-timeline-native-milestone.test.ts | 17 +++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) 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 5ba49cf3fc2..42f867d97ae 100644 --- a/tests/runner-e2e/chat-catalog-domains/internal-timeline-narrative.ts +++ b/tests/runner-e2e/chat-catalog-domains/internal-timeline-narrative.ts @@ -36,7 +36,14 @@ export function truthfulTimelineAccount(input: { return !prefix || ["The", "A", "An", "Then", input.personName].some(name => name?.toLowerCase() === prefix[1]!.toLowerCase()); }).map(match => ({ at: at + match.index })); }); - const repairAction = new RegExp(`\\b${escape(repairWorker)}\\b(?:\\s+(?:then|later|now|personally|explicitly|actually|had|has|have|also|who)){0,3}\\s+\\b(?:repair(?:ed)?|fix(?:ed)?)\\b|\\b(?:was|got|had been|has been)\\s+(?:repaired|fixed)\\b[^.!?\\n]{0,40}\\bby\\s+${escape(repairWorker)}\\b`, "gi"); + const repairGap = "(?:\\s+|\\s*[,:—–-]\\s*)"; + const repairModifier = "(?:then|later|now|personally|explicitly|actually|had|has|have|also|who|successfully|finally|subsequently|after\\s+the\\s+handoff)"; + const repairVerb = [ + "repair(?:ed)?|fix(?:ed)?", + "(?:completed|finished|performed|applied|implemented)\\s+(?:(?:a|the|needed|required|label|accessibility)\\s+){0,4}(?:repairs?|fix(?:es)?)", + "(?:added|inserted|supplied|provided|restored)\\s+(?:(?:a|the|missing|real|email|input|proper|accessible)\\s+){0,5}label", + ].join("|"); + const repairAction = new RegExp(`\\b${escape(repairWorker)}\\b(?:${repairGap}${repairModifier}){0,3}${repairGap}(?:${repairVerb})\\b|\\b(?:was|got|had been|has been)\\s+(?:repaired|fixed|completed|added|inserted|supplied|provided|restored)\\b[^.!?\\n]{0,40}\\bby\\s+${escape(repairWorker)}\\b`, "gi"); const repairSuccess = /\b(?:pass(?:ed)?|succeed(?:ed)?|exit(?:ed)?(?:\s+with)?(?:\s+(?:code|status))?\s*[:=]?\s*0)\b/i; const repairs = clauses.flatMap(({ text, at }) => [...text.matchAll(repairAction)] .filter(match => repairSuccess.test(text.slice(match.index + match[0].length))) 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 4d9db5cb2c6..d566c44fe26 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 @@ -131,6 +131,23 @@ it.each([ const o = fixture(); o.reply = reply; expect(gradeWorkTimeline(o).passed).toBe(false); }); +it.each([ + "Today UTC: Morgan's verification failed and work paused. You reassigned the task to Riley. Riley completed the repair and the check passed.", + "Today UTC: Morgan's verification failed and work paused. You reassigned the task to Riley. Riley added the missing label and the verification passed.", + "Today UTC: Morgan's verification failed and work paused, you reassigned the task to Riley, and Riley, successfully, added the missing email label and the check passed.", + "Today UTC: Morgan's verification failed and work paused; you reassigned the task to Riley; Riley: completed the label repair and the check passed.", + "Today UTC: Morgan's verification failed and work paused, you reassigned the task to Riley, and Riley, after the handoff, supplied the real label and the check passed.", +])("keeps equivalent actor-owned repair descriptions valid: %s", reply => { + const o = fixture(); o.reply = reply; expect(gradeWorkTimeline(o).passed).toBe(true); +}); +it.each([ + "Today UTC: Morgan's verification failed and work paused, you reassigned the task to Riley, and Morgan completed the repair and the check passed.", + "Today UTC: Morgan's verification failed and work paused, you reassigned the task to Riley, and Riley watched while Morgan added the missing label and the check passed.", + "Today UTC: Morgan's verification failed and work paused, Riley added the missing label and the check passed, then you reassigned the task to Riley.", +])("does not turn equivalent repair wording into wrong-actor or reversed-order credit: %s", reply => { + const o = fixture(); o.reply = reply; expect(gradeWorkTimeline(o).passed).toBe(false); +}); + it("admits the selected live timeline metadata without invoking fixture callbacks", async () => { const descriptor = findChatCatalogCase("activity.work-timeline")!; const implementation = workTimelineCases[0]!;