mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-13 06:36:26 +03:00
Keep full completion and current visual evidence distinct from setup routing. Add opt-in preflighted browser tools and explicit failure outcomes. AI assistance: Codex, under maintainer direction.
18 lines
808 B
JavaScript
18 lines
808 B
JavaScript
import assert from 'node:assert/strict';
|
|
import { sourceHash } from './source-hash.mjs';
|
|
|
|
export function assertCompleted(result) {
|
|
assert.equal(result.outcome, 'complete', `workflow did not finish: ${result.outcome} after ${result.steps} steps`);
|
|
}
|
|
|
|
export function assertFreshCaptures(trace, workspace, target) {
|
|
const calls = trace.toolCalls;
|
|
const lastEdit = calls.findLastIndex((call) => (call.mutatedPaths || []).includes(target));
|
|
const hash = sourceHash(workspace);
|
|
for (const viewport of ['desktop', 'mobile']) {
|
|
assert.ok(calls.some((call, index) => index > lastEdit && call.capture?.target === target
|
|
&& call.capture.viewport === viewport && call.capture.sourceHash === hash),
|
|
`missing ${viewport} screenshot of the final ${target}; pre-edit captures do not count`);
|
|
}
|
|
}
|