feat(FN-4367): finalize structured workflow verdict contract

Fusion-Task-Id: FN-4367
Fusion-Task-Lineage: adbfac60-5cfe-4ae9-9706-1094dfe7d676
This commit is contained in:
Fusion
2026-05-14 11:08:10 -07:00
committed by gsxdsm
parent db78679758
commit 09ad2b4edf
12 changed files with 206 additions and 347 deletions

View File

@@ -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: "gate" },
{ id: "WS-002", mode: "script", gateMode: "advisory" },
]);
expect(db.getSchemaVersion()).toBe(77);

View File

@@ -7476,7 +7476,6 @@ ${stepsSection}`;
if (updates.gateMode !== undefined) step.gateMode = updates.gateMode;
if (updates.prompt !== undefined && step.mode === "prompt") step.prompt = updates.prompt;
if (updates.toolMode !== undefined && step.mode === "prompt") step.toolMode = updates.toolMode;
if (updates.gateMode !== undefined) step.gateMode = updates.gateMode;
if (updates.scriptName !== undefined && step.mode === "script") step.scriptName = updates.scriptName;
if (updates.enabled !== undefined) step.enabled = updates.enabled;
if (updates.defaultOn !== undefined) step.defaultOn = updates.defaultOn;
@@ -7498,7 +7497,6 @@ ${stepsSection}`;
phase = ?,
gateMode = ?,
prompt = ?,
gateMode = ?,
toolMode = ?,
scriptName = ?,
enabled = ?,
@@ -7515,7 +7513,6 @@ ${stepsSection}`;
step.phase || "pre-merge",
step.gateMode,
step.prompt,
step.gateMode ?? (step.mode === "script" ? "gate" : "advisory"),
step.toolMode ?? null,
step.scriptName ?? null,
step.enabled ? 1 : 0,

View File

@@ -388,9 +388,15 @@ export interface WorkflowStepResult {
status: "passed" | "failed" | "advisory_failure" | "skipped" | "pending";
/** Output from the workflow step agent (findings, errors, etc.) */
output?: string;
/** Machine-readable verdict from the workflow step agent. */
verdict?: "PASS" | "FAIL";
/** Optional non-blocking notes for advisory findings surfaced in task detail UI. */
/**
* Machine-readable verdict from prompt-mode structured output.
* Absent for script-mode steps and legacy prose-only prompt outputs.
*/
verdict?: "APPROVE" | "APPROVE_WITH_NOTES" | "REVISE";
/**
* Optional notes from prompt-mode structured output.
* Absent for script-mode steps and legacy prose-only prompt outputs.
*/
notes?: string;
/** ISO-8601 timestamp when the step started */
startedAt?: string;