From 88ea706508bc36e6c4ebb0c469582095fa607530 Mon Sep 17 00:00:00 2001 From: Fusion Date: Thu, 14 May 2026 12:03:20 -0700 Subject: [PATCH] =?UTF-8?q?test(FN-4493):=20complete=20Step=203=20?= =?UTF-8?q?=E2=80=94=20add=20template=20verdict=20contract=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fusion-Task-Id: FN-4493 Fusion-Task-Lineage: 966c7c55-fd51-4263-9d4e-87e9d06bfb6f --- .../workflow-step-templates-verdict.test.ts | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 packages/core/src/__tests__/workflow-step-templates-verdict.test.ts diff --git a/packages/core/src/__tests__/workflow-step-templates-verdict.test.ts b/packages/core/src/__tests__/workflow-step-templates-verdict.test.ts new file mode 100644 index 000000000..3a22821f2 --- /dev/null +++ b/packages/core/src/__tests__/workflow-step-templates-verdict.test.ts @@ -0,0 +1,27 @@ +import { describe, expect, it } from "vitest"; +import { WORKFLOW_STEP_TEMPLATES } from "../types"; + +const TARGET_IDS = [ + "documentation-review", + "qa-check", + "security-audit", + "performance-review", + "accessibility-check", + "browser-verification", + "frontend-ux-design", +] as const; + +describe("workflow step template verdict contracts", () => { + it.each(TARGET_IDS)("%s uses canonical structured verdict output", (id) => { + const template = WORKFLOW_STEP_TEMPLATES.find((entry) => entry.id === id); + expect(template).toBeTruthy(); + + const prompt = template!.prompt; + expect(prompt).toMatch(/"verdict":"APPROVE\|APPROVE_WITH_NOTES\|REVISE"/); + expect(prompt).not.toContain('"verdict":"PASS"'); + expect(prompt).not.toContain('"verdict":"FAIL"'); + expect(prompt).not.toContain("task_done("); + expect(prompt).not.toContain("task_log("); + expect(prompt).toMatch(/Diff Scope|out of scope/i); + }); +});