-
Notifications
You must be signed in to change notification settings - Fork 2
test(chat): add visual qa artifact reports #414
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
DeliciousBuding
merged 1 commit into
dev/delicious233
from
task/390-visual-qa-artifact-loop
Jun 29, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| #!/usr/bin/env node | ||
|
|
||
| import fs from 'node:fs'; | ||
| import path from 'node:path'; | ||
| import process from 'node:process'; | ||
|
|
||
| const repoRoot = path.resolve(parseRepoRoot(process.argv.slice(2))); | ||
| const desktopScriptPath = path.join(repoRoot, 'app', 'desktop', 'scripts', 'manual-chat-flow-check.mjs'); | ||
| const webScriptPath = path.join(repoRoot, 'app', 'web', 'scripts', 'manual-chat-flow-check.mjs'); | ||
| const acceptancePath = path.join(repoRoot, 'scripts', 'verify', 'chat-acceptance.mjs'); | ||
| let failed = 0; | ||
|
|
||
| assertVisualScriptContract('Desktop', desktopScriptPath, { | ||
| surface: 'desktop', | ||
| screenshot: 'desktop-1440x810-chat-flow.png', | ||
| metrics: 'desktop-1440x810-chat-flow.metrics.json', | ||
| report: 'desktop-chat-flow-visual-qa.json', | ||
| }); | ||
|
|
||
| assertVisualScriptContract('Web', webScriptPath, { | ||
| surface: 'web', | ||
| screenshot: 'web-1440x810-chat-flow.png', | ||
| metrics: 'web-1440x810-chat-flow.metrics.json', | ||
| report: 'web-chat-flow-visual-qa.json', | ||
| }); | ||
|
|
||
| assertAcceptanceContract(acceptancePath); | ||
|
|
||
| process.exit(failed > 0 ? 1 : 0); | ||
|
|
||
| function assertVisualScriptContract(label, scriptPath, expected) { | ||
| assert(fs.existsSync(scriptPath), `${label} Visual QA script exists`); | ||
| if (!fs.existsSync(scriptPath)) return; | ||
|
|
||
| const script = fs.readFileSync(scriptPath, 'utf8'); | ||
| assert(script.includes(expected.screenshot), `${label} script keeps stable screenshot path`); | ||
| assert(script.includes(expected.metrics), `${label} script writes stable metrics path`); | ||
| assert(script.includes(expected.report), `${label} script writes stable report path`); | ||
| assert(script.includes('agenthub.chat_visual_qa.v1'), `${label} script writes stable report schema`); | ||
| assert(script.includes(`surface: '${expected.surface}'`), `${label} report records ${expected.surface} surface`); | ||
| assert(script.includes('metricsPath'), `${label} report includes metricsPath`); | ||
| assert(script.includes('reportPath'), `${label} report includes reportPath`); | ||
| assert(script.includes('inspection'), `${label} report includes concise inspection instructions`); | ||
| assert(script.includes('real_tested: false'), `${label} report records real_tested=false`); | ||
| assert(script.includes('evidence_level: \'visual-qa\''), `${label} report records visual-qa evidence level`); | ||
| assert(script.includes('fs.writeFileSync(metricsPath'), `${label} script persists metrics JSON`); | ||
| assert(script.includes('fs.writeFileSync(reportPath'), `${label} script persists report JSON`); | ||
| assert(script.includes('Visual QA screenshot:'), `${label} stdout prints screenshot path`); | ||
| assert(script.includes('Visual QA metrics:'), `${label} stdout prints metrics path`); | ||
| assert(script.includes('Visual QA report:'), `${label} stdout prints report path`); | ||
| assert(!/real_tested:\s*true|approved-real.+real_tested:\s*true|pnpm\s+tauri\s+build/i.test(script), `${label} script does not claim approved-real or packaged Desktop evidence`); | ||
| } | ||
|
|
||
| function assertAcceptanceContract(scriptPath) { | ||
| assert(fs.existsSync(scriptPath), 'chat acceptance runner exists'); | ||
| if (!fs.existsSync(scriptPath)) return; | ||
|
|
||
| const script = fs.readFileSync(scriptPath, 'utf8'); | ||
| for (const artifact of [ | ||
| 'desktop-1440x810-chat-flow.png', | ||
| 'desktop-1440x810-chat-flow.metrics.json', | ||
| 'desktop-chat-flow-visual-qa.json', | ||
| 'web-1440x810-chat-flow.png', | ||
| 'web-1440x810-chat-flow.metrics.json', | ||
| 'web-chat-flow-visual-qa.json', | ||
| ]) { | ||
| assert(script.includes(artifact), `chat acceptance manifest includes ${artifact}`); | ||
| } | ||
| } | ||
|
|
||
| function assert(condition, message) { | ||
| if (condition) { | ||
| console.log(`PASS: ${message}`); | ||
| return; | ||
| } | ||
| failed += 1; | ||
| console.error(`FAIL: ${message}`); | ||
| } | ||
|
|
||
| function parseRepoRoot(args) { | ||
| for (let i = 0; i < args.length; i += 1) { | ||
| if (args[i] === '--repo-root' || args[i] === '-RepoRoot') { | ||
| return args[i + 1]; | ||
| } | ||
| } | ||
| return '.'; | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Block
approved-realexplicitly.This regex still passes if the script starts emitting
approved-realwhile keepingreal_tested: false, so it does not actually enforce the stated scope restriction.Suggested fix
📝 Committable suggestion
🤖 Prompt for AI Agents