fix(domain): preserve structured cleanup failure reasons

This commit is contained in:
morluto committed 2026-10-24 08:22:13 +08:00
1 parent 4d22c83b07
commit 396dcb2b0f
2 files changed
+9 -2

No files matched your search

+8 -1
View File
@@ -165,13 +165,20 @@ it.each([
"fixture",
["owned-input"],
{ reason: "close denied" },
{ operation: "inspect" },
{
operation: "inspect",
cleanup: { reason: "close denied", resources: ["owned-input"] },
},
);
const composed = analysisErrorWithCleanupFailure(
primary,
cleanup,
"inspect",
).bindCleanupDependencies([primary, cleanup]);
expect(composed.cleanup?.reason).toBe("close denied");
expect(composed.cleanup?.reason).not.toBe(
projectAnalysisError(cleanup).message,
);
const pending = projectAnalysisError(composed);
expect(pending.code).toBe("cleanup_incomplete");
expect(pending.category).toBe(original.category);
+1 -1
View File
@@ -31,7 +31,7 @@ export const analysisErrorWithCleanupFailure = (
? {}
: { partialObservation: primary.partialObservation }),
cleanup: {
reason: projected.message,
reason: cleanup.cleanup?.reason ?? projected.message,
resources: [
...new Set([
...(primary.cleanupIncomplete ? primary.cleanupResources : []),