mirror of
https://github.com/morluto/rea.git
synced 2026-11-16 19:53:50 +00:00
refactor: consolidate shared analysis boundaries (#10293)
This commit is contained in:
1 parent
6878a84796
commit
c836f57b7d
70 files changed
+1240
-1131
No files matched your search
@@ -20,6 +20,7 @@ import { processScenarioSchema } from "../../domain/process/processScenario.js";
|
||||
import {
|
||||
compareParsedProcessEvidence,
|
||||
readProcessComparisonSource,
|
||||
unsupportedProcessCaptureProvider,
|
||||
} from "./ProcessComparisonService.js";
|
||||
import { createProgressReporter } from "../ProgressReporter.js";
|
||||
import { captureProcessScenario } from "../../process/capture/ProcessHarness.js";
|
||||
@@ -287,13 +288,7 @@ const projectCaptureFileFailure = (
|
||||
"invalid_value",
|
||||
);
|
||||
case "unsupported-provider":
|
||||
return new AnalysisInputError("compare_process_captures", undefined, [
|
||||
{
|
||||
path: [side, "provider"],
|
||||
reason: "invalid_value",
|
||||
message: `The ${side} Evidence provider ${failure.provider.id} v${failure.provider.version} (${failure.provider.name}) is not the current or supported legacy ${PROCESS_PROVIDER.id} v${PROCESS_PROVIDER.version} process capture provider.`,
|
||||
},
|
||||
]);
|
||||
return unsupportedProcessCaptureProvider(side, failure);
|
||||
case "invalid-capture":
|
||||
return invalidCaptureEvidence(failure.cause, side);
|
||||
}
|
||||
|
||||
@@ -124,15 +124,7 @@ export const readProcessComparisonSource = (
|
||||
]),
|
||||
);
|
||||
case "unsupported-provider":
|
||||
return err(
|
||||
new AnalysisInputError(operation, undefined, [
|
||||
{
|
||||
path: [side, "provider"],
|
||||
reason: "invalid_value",
|
||||
message: `The ${side} Evidence provider ${failure.provider.id} v${failure.provider.version} (${failure.provider.name}) is not the current or supported legacy ${PROCESS_PROVIDER.id} v${PROCESS_PROVIDER.version} process capture provider.`,
|
||||
},
|
||||
]),
|
||||
);
|
||||
return err(unsupportedProcessCaptureProvider(side, failure));
|
||||
case "invalid-capture":
|
||||
return err(
|
||||
new EvidenceIntegrityError(
|
||||
@@ -146,6 +138,22 @@ export const readProcessComparisonSource = (
|
||||
}
|
||||
};
|
||||
|
||||
/** Report the same provider admission failure at both public adapters. */
|
||||
export const unsupportedProcessCaptureProvider = (
|
||||
side: "left" | "right",
|
||||
failure: Extract<
|
||||
ProcessCaptureEvidenceFailure,
|
||||
{ kind: "unsupported-provider" }
|
||||
>,
|
||||
): AnalysisInputError =>
|
||||
new AnalysisInputError("compare_process_captures", undefined, [
|
||||
{
|
||||
path: [side, "provider"],
|
||||
reason: "invalid_value",
|
||||
message: `The ${side} Evidence provider ${failure.provider.id} v${failure.provider.version} (${failure.provider.name}) is not the current or supported legacy ${PROCESS_PROVIDER.id} v${PROCESS_PROVIDER.version} process capture provider.`,
|
||||
},
|
||||
]);
|
||||
|
||||
const comparisonUnknownInput = (
|
||||
parsed: {
|
||||
readonly left_evidence_id: string;
|
||||
|
||||
Reference in new issue
Block a user