From dd8ba841063ebc3ac30e5bce6334921bfd4e36d0 Mon Sep 17 00:00:00 2001 From: zhyongrui Date: Tue, 17 Mar 2026 16:52:17 +0000 Subject: [PATCH] feat: implement issue #131 --- src/commands/openclawcode.test.ts | 26 +++++++++++++++++++++++++- src/commands/openclawcode.ts | 3 ++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/commands/openclawcode.test.ts b/src/commands/openclawcode.test.ts index 618044fe31..8576f7fd0f 100644 --- a/src/commands/openclawcode.test.ts +++ b/src/commands/openclawcode.test.ts @@ -1615,12 +1615,35 @@ describe("openclawCodeRunCommand", () => { expect(payload.verificationSummaryPresent).toBe(true); }); - it("reports verificationSummaryPresent as false when the verifier summary is empty", async () => { + it("reports verificationHasSignals as true when only the verifier summary is present", async () => { + mocks.runIssueWorkflow.mockResolvedValue( + createRun({ + verificationReport: { + ...createRun().verificationReport!, + findings: [], + missingCoverage: [], + followUps: [], + summary: "Verification completed without additional findings.", + }, + }), + ); + + await openclawCodeRunCommand({ issue: "2", repoRoot: "/repo", json: true }, runtime); + + const payload = JSON.parse(runtime.log.mock.calls[0]?.[0] ?? "null"); + expect(payload.verificationSummaryPresent).toBe(true); + expect(payload.verificationHasSignals).toBe(true); + }); + + it("reports verificationSummaryPresent and verificationHasSignals as false when the verifier summary is empty", async () => { mocks.runIssueWorkflow.mockResolvedValue( createRun({ verificationReport: { ...createRun().verificationReport!, summary: "", + findings: [], + missingCoverage: [], + followUps: [], }, }), ); @@ -1630,6 +1653,7 @@ describe("openclawCodeRunCommand", () => { const payload = JSON.parse(runtime.log.mock.calls[0]?.[0] ?? "null"); expect(payload.verificationSummary).toBe(""); expect(payload.verificationSummaryPresent).toBe(false); + expect(payload.verificationHasSignals).toBe(false); }); it("reports suitabilityDecisionIsEscalate when suitability escalates before branch mutation", async () => { diff --git a/src/commands/openclawcode.ts b/src/commands/openclawcode.ts index 70999dfed2..5f88adda71 100644 --- a/src/commands/openclawcode.ts +++ b/src/commands/openclawcode.ts @@ -2190,7 +2190,8 @@ function toWorkflowRunJson(run: WorkflowRun) { verificationHasSignals: run.verificationReport == null ? false - : run.verificationReport.findings.length > 0 || + : (run.verificationReport.summary?.length ?? 0) > 0 || + run.verificationReport.findings.length > 0 || run.verificationReport.missingCoverage.length > 0 || run.verificationReport.followUps.length > 0, verificationHasFollowUps: