From 1849a828b2c87837cd383e7e5326fa046fd3bb34 Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Sat, 24 Oct 2026 04:53:54 +0800 Subject: [PATCH] test(evidence): retain structured input issues through cleanup owners --- src/domain/analysisErrorCleanup.test.ts | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/domain/analysisErrorCleanup.test.ts b/src/domain/analysisErrorCleanup.test.ts index c14f73ab3f..71388d7af3 100644 --- a/src/domain/analysisErrorCleanup.test.ts +++ b/src/domain/analysisErrorCleanup.test.ts @@ -208,7 +208,9 @@ it.each([ it.each(["inner", "outer"] as const)( "waits for both nested cleanup owners when %s resolves first", (first) => { - const primary = new AnalysisInputError("inspect"); + const primary = new AnalysisInputError("inspect", undefined, [ + { path: ["path"], reason: "missing_argument" }, + ]); const innerCleanup = new ProviderCleanupError("fixture", ["input"], {}); const outerCleanup = new ProviderCleanupError("fixture", ["workspace"], {}); const inner = analysisErrorWithCleanupFailure( @@ -224,7 +226,11 @@ it.each(["inner", "outer"] as const)( expect(projectAnalysisError(outer)).toMatchObject({ code: "cleanup_incomplete", category: "invalid_input", - details: { operation: "inspect", execution_failure: "invalid_request" }, + details: { + operation: "inspect", + issues: primary.issues, + execution_failure: "invalid_request", + }, }); released.resolveCleanup(); expect(outer.cleanupIncomplete).toBe(true); @@ -328,7 +334,9 @@ it("retains an owner's finalization report independently of pending primary sema class ReportedCleanup extends ProviderCleanupError { override readonly cleanupReport = report; } - const primary = new AnalysisInputError("inspect"); + const primary = new AnalysisInputError("inspect", undefined, [ + { path: ["path"], reason: "missing_argument" }, + ]); const finalized = new ReportedCleanup( "fixture", ["input"], @@ -345,7 +353,11 @@ it("retains an owner's finalization report independently of pending primary sema const assertReport = (error: typeof outer) => { expect(projectAnalysisError(error)).toMatchObject({ category: "invalid_input", - details: { operation: "inspect", cleanup_report: report }, + details: { + operation: "inspect", + issues: primary.issues, + cleanup_report: report, + }, }); }; assertReport(finalized);