MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / classifyVisionAnswer

Function classifyVisionAnswer

src/artifacts/review.ts:65–75  ·  view source on GitHub ↗
(answer: string)

Source from the content-addressed store, hash-verified

63
64/** Classify the vision model's free-text answer into a verdict using its leading token. */
65export function classifyVisionAnswer(answer: string): ReviewVerdict {
66 const head = (answer || '').trim().toUpperCase();
67 if (/^BROKEN\b/.test(head)) return 'broken';
68 if (/^NEEDS_WORK\b/.test(head)) return 'needs_work';
69 if (/^LOOKS_GOOD\b/.test(head)) return 'looks_good';
70 // No explicit token — infer conservatively from wording.
71 if (/\b(blank|empty|error|nothing renders|failed to render|white screen)\b/i.test(answer)) return 'broken';
72 if (/\b(overlap|cut off|cut-off|unreadable|misalign|too small|off-screen|broken layout)\b/i.test(answer)) return 'needs_work';
73 if (/\b(looks good|renders correctly|no issues|correct)\b/i.test(answer)) return 'looks_good';
74 return 'unverified';
75}
76
77/** Pull bulleted/■ issue lines out of the vision answer (everything after the verdict token). */
78export function extractIssues(answer: string): string[] {

Callers 2

buildReviewReportFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected