MCPcopy
hub / github.com/garrytan/gstack / verifyAgainstMockup

Function verifyAgainstMockup

design/src/diff.ts:93–104  ·  view source on GitHub ↗
(
  mockupPath: string,
  screenshotPath: string,
)

Source from the content-addressed store, hash-verified

91 * Combines diff with a pass/fail gate.
92 */
93export async function verifyAgainstMockup(
94 mockupPath: string,
95 screenshotPath: string,
96): Promise<{ pass: boolean; matchScore: number; diff: DiffResult }> {
97 const diff = await diffMockups(mockupPath, screenshotPath);
98
99 // Pass if matchScore >= 70 and no high-severity differences
100 const highSeverity = diff.differences.filter(d => d.severity === "high");
101 const pass = diff.matchScore >= 70 && highSeverity.length === 0;
102
103 return { pass, matchScore: diff.matchScore, diff };
104}

Callers 1

mainFunction · 0.90

Calls 1

diffMockupsFunction · 0.85

Tested by

no test coverage detected