From ef68f816d1b2fb2109d6572891a083034ef2b602 Mon Sep 17 00:00:00 2001 From: Suliman Abdulrazzaq Date: Mon, 10 Aug 2026 23:00:59 +0300 Subject: [PATCH] fix(gan): grant evaluator Playwright tools --- agents/gan-evaluator.md | 16 ++++++++++++- tests/ci/gan-evaluator-tools.test.js | 34 ++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 tests/ci/gan-evaluator-tools.test.js diff --git a/agents/gan-evaluator.md b/agents/gan-evaluator.md index 95060e711..363e0972b 100644 --- a/agents/gan-evaluator.md +++ b/agents/gan-evaluator.md @@ -1,7 +1,7 @@ --- name: gan-evaluator description: "GAN Harness — Evaluator agent. Tests the live running application via Playwright, scores against rubric, and provides actionable feedback to the Generator." -tools: Read, Write, Bash, Grep, Glob +tools: Read, Write, Bash, Grep, Glob, mcp__playwright__browser_navigate, mcp__playwright__browser_click, mcp__playwright__browser_take_screenshot, mcp__playwright__browser_snapshot, mcp__playwright__browser_type, mcp__playwright__browser_fill_form model: sonnet color: red --- @@ -35,6 +35,12 @@ You are the QA Engineer and Design Critic. You test the **live running applicati ## Evaluation Workflow +Before testing, record the mode that is actually available. The requested mode +is not proof that its tools were available: if the Playwright MCP tools cannot +be called, switch to the documented `screenshot` or `code-only` fallback and +report that degradation instead of silently scoring a static review as a live +browser evaluation. + ### Step 1: Read the Rubric ``` Read gan-harness/eval-rubric.md for project-specific criteria @@ -129,6 +135,14 @@ Write feedback to `gan-harness/feedback/feedback-NNN.md`: ## Scores +## Evaluation Mode + +**Achieved:** `playwright` | `screenshot` | `code-only` + +State the mode that was actually completed (not merely the mode requested by +the harness). If the requested mode was unavailable, briefly explain why and +which fallback was used. + | Criterion | Score | Weight | Weighted | |-----------|-------|--------|----------| | Design Quality | X/10 | 0.3 | X.X | diff --git a/tests/ci/gan-evaluator-tools.test.js b/tests/ci/gan-evaluator-tools.test.js new file mode 100644 index 000000000..2c51922e0 --- /dev/null +++ b/tests/ci/gan-evaluator-tools.test.js @@ -0,0 +1,34 @@ +/** + * Regression coverage for the GAN evaluator's live-browser capability. + * + * Run with: node tests/ci/gan-evaluator-tools.test.js + */ + +const assert = require('assert'); +const fs = require('fs'); +const path = require('path'); + +const evaluatorPath = path.join(__dirname, '..', '..', 'agents', 'gan-evaluator.md'); +const content = fs.readFileSync(evaluatorPath, 'utf8'); +const frontmatter = content.match(/^---\r?\n([\s\S]*?)\r?\n---/); + +assert.ok(frontmatter, 'gan-evaluator.md should have frontmatter'); +const toolsLine = frontmatter[1].match(/^tools:\s*(.+)$/m); +assert.ok(toolsLine, 'gan-evaluator.md should declare tools'); + +const tools = new Set(toolsLine[1].split(',').map(tool => tool.trim())); +for (const tool of [ + 'mcp__playwright__browser_navigate', + 'mcp__playwright__browser_click', + 'mcp__playwright__browser_take_screenshot', + 'mcp__playwright__browser_snapshot', + 'mcp__playwright__browser_type', + 'mcp__playwright__browser_fill_form', +]) { + assert.ok(tools.has(tool), `gan-evaluator.md should grant ${tool}`); +} + +assert.match(content, /\*\*Achieved:\*\* `playwright` \| `screenshot` \| `code-only`/); +assert.match(content, /mode that was actually completed/); + +console.log('GAN evaluator tools and achieved-mode contract are present.');