From bcdcd0b242343c80b27100eca33f061befffa891 Mon Sep 17 00:00:00 2001 From: Dotta Date: Wed, 28 Oct 2026 12:58:24 -0500 Subject: [PATCH] test(evals): require fresh notification comment boundary --- .../chat-catalog-domains/internal-notification-audience.ts | 1 + .../chat-catalog-domains/internal-notification-events.test.ts | 2 ++ .../chat-catalog-domains/internal-notification-events.ts | 1 + 3 files changed, 4 insertions(+) diff --git a/tests/runner-e2e/chat-catalog-domains/internal-notification-audience.ts b/tests/runner-e2e/chat-catalog-domains/internal-notification-audience.ts index 374e946d67d..18039058f0e 100644 --- a/tests/runner-e2e/chat-catalog-domains/internal-notification-audience.ts +++ b/tests/runner-e2e/chat-catalog-domains/internal-notification-audience.ts @@ -58,6 +58,7 @@ async function armProbe(probe: ObserverProbe) { finally { await session.dispose(); } if (personId !== probe.principalId) throw new Error("Notification observer session principal mismatch"); const rows = await publicProbeRows(probe); + if (rows.comments.length || rows.activity.some(row => row.action === "issue.comment_added")) throw new Error("Notification observer requires the fresh comment boundary before the participation control"); probe.baseline = { sessionPrincipalId: probe.principalId, activityIds: rows.activity.map(row => String(row.id)), commentIds: rows.comments.map(row => String(row.id)) }; probe.frames.length = 0; } diff --git a/tests/runner-e2e/chat-catalog-domains/internal-notification-events.test.ts b/tests/runner-e2e/chat-catalog-domains/internal-notification-events.test.ts index 3944186d6b0..e4bc72322ef 100644 --- a/tests/runner-e2e/chat-catalog-domains/internal-notification-events.test.ts +++ b/tests/runner-e2e/chat-catalog-domains/internal-notification-events.test.ts @@ -20,6 +20,8 @@ it("binds actual public shapes without details to exact saved comments and commo it.each([ ["wrong principal",(o:ReturnType)=>{o[1].principalId="alex";}], ["wrong signed-in session",(o:ReturnType)=>{o[1].sessionPrincipalId="other";}], + ["prior comment boundary",(o:ReturnType)=>{o.forEach(p=>p.baselineCommentIds.push("older-unobserved-comment"));}], + ["prior comment audit",(o:ReturnType)=>{o.forEach(p=>p.baselineActivityIds.push("audit-1"));}], ["capture overflow",(o:ReturnType)=>{o[0].overflow=true;}], ["missing recipient event",(o:ReturnType)=>{o[1].frames.pop();}], ["different received event ID",(o:ReturnType)=>{o[1].frames[0]!.eventId=99;}], diff --git a/tests/runner-e2e/chat-catalog-domains/internal-notification-events.ts b/tests/runner-e2e/chat-catalog-domains/internal-notification-events.ts index 402e60b2c72..2b4671f373e 100644 --- a/tests/runner-e2e/chat-catalog-domains/internal-notification-events.ts +++ b/tests/runner-e2e/chat-catalog-domains/internal-notification-events.ts @@ -28,6 +28,7 @@ export function bindNotificationPublicEvents(companyId: string, taskId: string, const reject = (reason: string) => ({ complete: false, reason, frames: [[], []] as NotificationBoundFrame[][] }); if (!companyId || !taskId || observers[0].principalId === observers[1].principalId || observers.some(o => !o.principalId || o.principalId !== o.sessionPrincipalId || o.overflow)) return reject("principal-or-capture-invalid"); + if (observers.some(o => o.baselineCommentIds.length || o.activity.some(a => o.baselineActivityIds.includes(String(a.id)) && a.entityType === "issue" && a.entityId === taskId && a.action === "issue.comment_added"))) return reject("not-a-fresh-comment-boundary"); const normalized = []; for (const observer of observers) { if (new Set(observer.frames.map(f => f.eventId)).size !== observer.frames.length) return reject("duplicate-public-event");