Files
rea/src/application/wasm/WasmArtifactPort.ts
T
morluto 3c57e1a8b2 fix(artifacts): authenticate file subjects across provider and view boundaries
Narrow WASM and EVM execution ports to file subjects and preserve supplied subject types at the shared execution factory. Authenticate format with path and digest before recording or projecting Evidence, using the existing WASM identity owner in both consumers.

Validation: focused WASM/EVM service and public MCP workflows passed, including malformed provider subjects and self-contained retained Evidence with contradictory format. Global typecheck/lint and documentation checks passed. Real WABT/Evmole execution and the full suite were not run.
2026-10-13 13:23:03 +08:00

24 lines
998 B
TypeScript

import type {
AnalysisExecution,
ExecutionOptions,
} from "../AnalysisProvider.js";
import type { AnalysisError } from "../../domain/analysisErrorBase.js";
import type { InspectWasmArtifactInput } from "../../domain/wasm/wasmArtifact.js";
import type { EvidenceSubjectTarget } from "../../domain/evidence.js";
import type { Result } from "../../domain/result.js";
/** Successful WASM inspection must identify the selected local file. */
export type WasmArtifactExecution = Omit<AnalysisExecution, "subject"> & {
readonly subject: EvidenceSubjectTarget & { readonly format: "file" };
};
/** Replaceable offline WASM inspection engine, independent of target execution and network clients. */
export interface WasmArtifactPort {
/** Retry removal of retained workspaces; failures preserve ownership for another attempt. */
close(): Promise<void>;
inspect(
input: InspectWasmArtifactInput,
options?: ExecutionOptions,
): Promise<Result<WasmArtifactExecution, AnalysisError>>;
}