mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-01 06:24:41 +01:00
test(plan-design-review): count design terms the review wrote into the plan
This commit is contained in:
1 parent
db91607a7f
commit
d603a636c1
1 file changed
+6
-4
@@ -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') ||
|
||||
|
||||
Reference in new issue
Block a user