feat(FN-4485): stabilize verification gates for delivery
Commits merged: - fix(FN-4485): stabilize verification gates for delivery Files changed: packages/core/src/__tests__/db-migrate.test.ts | 2 +- packages/engine/src/executor.ts | 82 -------------------------- 2 files changed, 1 insertion(+), 83 deletions(-) Fusion-Task-Id: FN-4485 Fusion-Task-Lineage: 034088dc-ebc4-4e12-8314-39419d41b23f
This commit is contained in:
@@ -715,7 +715,7 @@ describe("schema migration", () => {
|
||||
const rows = db.prepare("SELECT id, mode, gateMode FROM workflow_steps ORDER BY id ASC").all() as Array<{ id: string; mode: string; gateMode: string }>;
|
||||
expect(rows).toEqual([
|
||||
{ id: "WS-001", mode: "prompt", gateMode: "advisory" },
|
||||
{ id: "WS-002", mode: "script", gateMode: "advisory" },
|
||||
{ id: "WS-002", mode: "script", gateMode: "gate" },
|
||||
]);
|
||||
expect(db.getSchemaVersion()).toBe(77);
|
||||
|
||||
|
||||
@@ -6575,88 +6575,6 @@ ${failureFeedback}
|
||||
return { output: trimmed, malformed: true };
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse structured JSON verdict from workflow step output.
|
||||
*
|
||||
* Looks for a trailing JSON block of the form:
|
||||
* ```json-workflow-verdict
|
||||
* {"verdict":"PASS"|"FAIL","notes":"..."}
|
||||
* ```
|
||||
*
|
||||
* If found, extracts verdict/notes and returns the prose before the block
|
||||
* as `output`.
|
||||
*
|
||||
* Falls back to prose-only parsing (REQUEST REVISION) for backward compat.
|
||||
*/
|
||||
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.
|
||||
*
|
||||
* Looks for a trailing JSON block of the form:
|
||||
* ```json-workflow-verdict
|
||||
* {"verdict":"PASS"|"FAIL","notes":"..."}
|
||||
* ```
|
||||
*
|
||||
* If found, extracts verdict/notes and returns the prose before the block
|
||||
* as `output`.
|
||||
*
|
||||
* Falls back to prose-only parsing (REQUEST REVISION) for backward compat.
|
||||
*/
|
||||
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 };
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute a single workflow step by spawning an agent with the step's prompt.
|
||||
* Returns structured outcome with support for revision requests.
|
||||
|
||||
Reference in New Issue
Block a user