chore(FN-4492): deduplicate workflow step verdict parser
Fusion-Task-Id: FN-4492 Fusion-Task-Lineage: a358eab9-8491-41ef-9713-75961eb41d5d
This commit is contained in:
@@ -6546,35 +6546,6 @@ ${failureFeedback}
|
||||
});
|
||||
}
|
||||
|
||||
/** Parse structured JSON verdict from workflow step output. */
|
||||
private parseWorkflowStepOutput(rawOutput: string): {
|
||||
output: string;
|
||||
verdict?: "APPROVE" | "APPROVE_WITH_NOTES" | "REVISE";
|
||||
notes?: string;
|
||||
malformed?: boolean;
|
||||
} {
|
||||
const trimmed = rawOutput.trim();
|
||||
const parsed = parseWorkflowStepVerdict(trimmed);
|
||||
if (parsed) {
|
||||
return {
|
||||
output: parsed.notes || "",
|
||||
verdict: parsed.verdict,
|
||||
notes: parsed.notes,
|
||||
};
|
||||
}
|
||||
|
||||
const inferred = inferWorkflowStepVerdictFromProse(trimmed);
|
||||
if (inferred) {
|
||||
return {
|
||||
output: inferred.notes || trimmed,
|
||||
verdict: inferred.verdict,
|
||||
notes: inferred.notes,
|
||||
};
|
||||
}
|
||||
|
||||
return { output: trimmed, malformed: true };
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse structured JSON verdict from workflow step output.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user