fix(uat): treat ASSESSMENT file with verdict as completed UAT result

checkNeedsRunUat only checked for UAT_RESULT file, but the autonomous
runner writes ASSESSMENT files. This caused run-uat to dispatch 5x with
no verdict when only an ASSESSMENT (with verdict: PASS) existed.

Now ASSESSMENT file with any verdict counts as a completed UAT result,
stopping the infinite dispatch loop.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Mikael Hugo 2026-05-10 08:32:21 +02:00
parent d8c687702b
commit 6c113be473

View file

@ -119,6 +119,17 @@ export async function checkNeedsRunUat(base, mid, _state, prefs) {
"UAT_RESULT",
);
if (resultFile && existsSync(resultFile)) return null;
// Also treat an ASSESSMENT file with a verdict as a completed UAT result.
const assessmentFile = resolveSliceFile(
base,
mid,
lastCompleted.id,
"ASSESSMENT",
);
if (assessmentFile && existsSync(assessmentFile)) {
const assessContent = await loadFile(assessmentFile);
if (assessContent && hasVerdict(assessContent)) return null;
}
const uatContent = await loadFile(uatFile);
const uatType = hasVerdict(uatContent) ? "verdict" : "narrative";
return { sliceId: lastCompleted.id, uatType };