| 1 | import { describe, expect, it } from 'vitest' |
| 2 | import { |
| 3 | buildDesignContractUserPrompt, |
| 4 | buildPlanningUserPrompt |
| 5 | } from '../../../src/main/agent-runtime/prompt' |
| 6 | |
| 7 | // Markers that only ever come from formatAnimationPreferencesForPageWriting. |
| 8 | // Their absence in upstream prompts proves animation preferences never leak |
| 9 | // into outline planning or the design contract (the feature's core boundary). |
| 10 | const ANIMATION_PREFERENCE_MARKERS = [ |
| 11 | 'Animation preferences for page writing only', |
| 12 | 'data-anim-stagger', |
| 13 | 'pulse-soft', |
| 14 | 'animate the chart container only' |
| 15 | ] as const |
| 16 | |
| 17 | describe('animation preferences do not leak into planning or design prompts', () => { |
| 18 | it('buildPlanningUserPrompt omits animation-preference guidance', () => { |
| 19 | const prompt = buildPlanningUserPrompt({ |
| 20 | topic: 'Quarterly report', |
| 21 | totalPages: 6, |
| 22 | userMessage: 'Keep it concise and visually clear.', |
| 23 | hasSourceMaterials: false |
| 24 | }) |
| 25 | |
| 26 | for (const marker of ANIMATION_PREFERENCE_MARKERS) { |
| 27 | expect(prompt).not.toContain(marker) |
| 28 | } |
| 29 | }) |
| 30 | |
| 31 | it('buildDesignContractUserPrompt omits animation-preference guidance', () => { |
| 32 | const prompt = buildDesignContractUserPrompt() |
| 33 | |
| 34 | for (const marker of ANIMATION_PREFERENCE_MARKERS) { |
| 35 | expect(prompt).not.toContain(marker) |
| 36 | } |
| 37 | }) |
| 38 | }) |
| 39 |