diff --git a/tests/runner-e2e/chat-catalog-domains/external-team-conditional.test.ts b/tests/runner-e2e/chat-catalog-domains/external-team-conditional.test.ts index dac5669763e..efcd615386c 100644 --- a/tests/runner-e2e/chat-catalog-domains/external-team-conditional.test.ts +++ b/tests/runner-e2e/chat-catalog-domains/external-team-conditional.test.ts @@ -470,3 +470,22 @@ it("preserves a fronted historical adverb on the named skill assertion", () => { o.phaseReplies[0]!.body = "The existing CTO was preserved and the imported role is CTO 2. Earlier, Launch Checklist was not installed."; expect(gradeTeamConditions(o, "initial").passed).toBe(true); }); + + +it.each([ + "Initially, the Launch Checklist skill could not be installed, but it is now installed under another slug.", + "Earlier, Launch Checklist was unavailable and was not installed. It is now installed under another slug.", +])("preserves the reported fronted or coordinated historical scope: %s", body => { + for (const phase of [0, 1]) { + const { o } = recovered(); + o.phaseReplies[phase]!.body = "The existing CTO was preserved and the imported role is CTO 2. " + body; + expect(gradeTeamConditions(o, phase === 0 ? "initial" : "complete").passed).toBe(true); + } +}); +it("does not inherit history for a coordinated past assertion with a current marker", () => { + for (const phase of [0, 1]) { + const { o } = recovered(); + o.phaseReplies[phase]!.body = "The existing CTO was preserved and the imported role is CTO 2. Earlier, Launch Checklist was unavailable and was still not installed now."; + expect(gradeTeamConditions(o, phase === 0 ? "initial" : "complete").passed).toBe(false); + } +}); diff --git a/tests/runner-e2e/chat-catalog-domains/external-team-conditional.ts b/tests/runner-e2e/chat-catalog-domains/external-team-conditional.ts index cb29b0f1fe0..5d7ab46ccce 100644 --- a/tests/runner-e2e/chat-catalog-domains/external-team-conditional.ts +++ b/tests/runner-e2e/chat-catalog-domains/external-team-conditional.ts @@ -180,7 +180,7 @@ function namedTeamSkillClauses(reply: string, skill: Pick name.toLowerCase()); const bound: string[] = []; for (const paragraph of reply.split(/\n\s*\n/)) { - let previousNamesTarget = false; + let previousNamesTarget = false, previousHistorical = false; for (const rawClause of paragraph.split(/[.!?;\n]+|(?=\bbut\b)|(?=\band\s+(?:(?:it|(?:this|that) skill)\s+)?(?:is|are|was|were|remains?|has|have|could|can)\b)/i).map(text => text.trim()).filter(Boolean)) { const coordinated = /^(?:but|and)\b/i.test(rawClause); const clause = rawClause.replace(/^(?:but|and)\s+/i, ""); @@ -188,7 +188,15 @@ function namedTeamSkillClauses(reply: string, skill: Pick): boolean {