diff --git a/test/skill-e2e-design.test.ts b/test/skill-e2e-design.test.ts index f0a7ef37c..3f86921e8 100644 --- a/test/skill-e2e-design.test.ts +++ b/test/skill-e2e-design.test.ts @@ -487,13 +487,15 @@ IMPORTANT: Do NOT try to browse any URLs or use a browse binary. This is a plan // Check that the agent produced design ratings (0-10 scale) const output = result.output || ''; const hasRatings = /\d+\/10/.test(output); - const hasDesignContent = output.toLowerCase().includes('information architecture') || - output.toLowerCase().includes('interaction state') || - output.toLowerCase().includes('ai slop') || - output.toLowerCase().includes('hierarchy'); // Check that the plan file was edited (the core new behavior) const planAfter = fs.readFileSync(path.join(reviewDir, 'plan.md'), 'utf-8'); + // The review's design content is what it wrote into the plan; the + // final message may only summarize it (census 37179171083). + // A term counts from the plan only when the review added it. + const count = (text: string, term: string) => text.toLowerCase().split(term).length - 1; + const hasDesignContent = ['information architecture', 'interaction state', 'ai slop', 'hierarchy'].some(term => + output.toLowerCase().includes(term) || count(planAfter, term) > count(planBefore, term)); const planWasEdited = planAfter !== planBefore && planAfter.length > 300; const planHasDesignAdditions = planAfter.toLowerCase().includes('empty') || planAfter.toLowerCase().includes('loading') ||