fix(evidence): classify derived failures at their owning boundary

Parse caller selections and authenticated Evidence at their owners, reuse the parsed function and comparison facts, and preserve unexpected implementation failures. Remove downstream error guessing and redundant validation wrappers.

Verify with 526 affected tests, source checks, docs conformance, test discovery and duplication checks. Seven public SDK regressions fail on the main baseline. No real-provider execution was performed.
This commit is contained in:
morluto committed 2026-10-23 03:22:34 +08:00
1 parent 7091be291c
commit 93a384db77
46 files changed
+1706 -566

No files matched your search

+3 -20
View File
@@ -1,14 +1,5 @@
import type { AnalysisError } from "../domain/analysisErrorBase.js";
import {
AnalysisInputError,
AnalysisCancelledError,
AnalysisUnsupportedTargetError,
} from "../domain/analysisErrorCore.js";
import { AnalysisError } from "../domain/analysisErrorBase.js";
import { ArtifactOperationError } from "../domain/artifactOperationError.js";
import {
BinaryTargetError,
ConfigurationError,
} from "../domain/configurationErrors.js";
import { ArtifactReaderFailure } from "./ArtifactReader.js";
import {
artifactFileCancellationCause,
@@ -43,15 +34,7 @@ export const translateArtifactFailure = (
bindArtifactFileCleanup(cause, error);
return error;
}
// Caller-selection, target, unsupported-target and configuration failures are already typed;
// keep their correction details instead of reducing them to an I/O failure.
if (
cause instanceof AnalysisInputError ||
cause instanceof AnalysisCancelledError ||
cause instanceof AnalysisUnsupportedTargetError ||
cause instanceof BinaryTargetError ||
cause instanceof ConfigurationError
)
return cause;
// Keep typed Evidence and other analysis failures instead of reducing them to I/O.
if (cause instanceof AnalysisError) return cause;
return new ArtifactOperationError(operation, "io");
};