fix(pi-workflow): reset failed verification on retry

This commit is contained in:
jb
2026-08-25 19:50:22 -04:00
parent 805b8e00d4
commit a54a92ace4
4 changed files with 34 additions and 1 deletions
+19
View File
@@ -4279,6 +4279,10 @@ export class WorkflowEngine {
run.verificationEvidence?.commands.filter(
(command) => command.status === "running" || command.status === "interrupted",
) ?? [];
const failedCommands =
run.verificationEvidence?.commands.filter(
(command) => command.status === "failed",
) ?? [];
run = await this.transition(run, (next) => {
for (const assignment of next.assignments) {
if (
@@ -4309,6 +4313,21 @@ export class WorkflowEngine {
next.script.error = undefined;
}
if (next.verificationEvidence) {
for (const command of failedCommands) {
const persisted = next.verificationEvidence.commands.find(
(candidate) => candidate.id === command.id,
);
if (!persisted) continue;
persisted.status = "pending";
persisted.exitCode = undefined;
persisted.stdout = undefined;
persisted.stderr = undefined;
persisted.error = undefined;
}
if (failedCommands.length > 0) {
next.verificationEvidence.focusedBehavioralTests = false;
next.verificationEvidence.verifierSucceeded = false;
}
for (const command of interruptedCommands) {
const persisted = next.verificationEvidence.commands.find(
(candidate) => candidate.id === command.id,