From d7b06792aae44cfaf4c8b01dadefb6fb2390df1f Mon Sep 17 00:00:00 2001 From: nicejames Date: Wed, 27 May 2026 22:46:50 +0900 Subject: [PATCH] test(comments): assert hard-scope sentence text in web and daemon renderers --- apps/daemon/tests/comment-attachments.test.ts | 6 ++++++ apps/web/tests/comments.test.ts | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/apps/daemon/tests/comment-attachments.test.ts b/apps/daemon/tests/comment-attachments.test.ts index 7a17dcefb..ccfdf1a17 100644 --- a/apps/daemon/tests/comment-attachments.test.ts +++ b/apps/daemon/tests/comment-attachments.test.ts @@ -171,6 +171,12 @@ describe('preview comment agent payload', () => { expect(hint).toContain('file: index.html'); expect(hint).toContain('selector: [data-od-id="hero-title"]'); expect(hint).toContain('comment: Make the headline shorter'); + // The hard-scope sentence IS the behavior change. Assert its key phrases + // so a future edit that softens or drops the directive lights the suite + // red instead of silently re-opening the over-broad edit bug. + expect(hint).toContain('Hard scope: change ONLY'); + expect(hint).toContain('Do NOT modify sibling sub-pages, parent layout, global CSS, design tokens, or unrelated rules'); + expect(hint).toContain('ask the user before proceeding'); }); it('renders pod attachments with grouped member context', () => { diff --git a/apps/web/tests/comments.test.ts b/apps/web/tests/comments.test.ts index a7a77a133..cbbff8760 100644 --- a/apps/web/tests/comments.test.ts +++ b/apps/web/tests/comments.test.ts @@ -242,6 +242,12 @@ describe('preview comment attachment helpers', () => { expect(content).toContain(''); expect(content).toContain('selector: [data-od-id="hero-title"]'); expect(content).toContain('comment: Only shorten this title'); + // The hard-scope sentence IS the behavior change. Assert its key phrases + // so a future edit that softens or drops the directive lights the suite + // red instead of silently re-opening the over-broad edit bug. + expect(content).toContain('Hard scope: change ONLY'); + expect(content).toContain('Do NOT modify sibling sub-pages, parent layout, global CSS, design tokens, or unrelated rules'); + expect(content).toContain('ask the user before proceeding'); }); it('adds hidden comment context only to the current user message sent to API providers', () => {