Collect references from the complete owned function body and exact entry, including instruction-interior destinations and embedded-data sources. Bind the corrected semantics to the analysis profile so legacy snapshots cannot replay incomplete results. Preserve snapshot mismatch reasons and recovery advice through CLI and MCP without disturbing live sessions. Return exact entry candidates for ambiguous function names. Expand the real-provider regression workflow and replace redundant parser assertions with malformed-output coverage through the pinned MCP client. Verified with Ghidra 12.1.4 on macOS arm64: full host-native lane, real CLI/MCP boundary probes, 30 focused tests, and typecheck/lint.
55 lines
1.7 KiB
TypeScript
55 lines
1.7 KiB
TypeScript
import {
|
|
AnalysisError,
|
|
type AnalysisErrorOptions,
|
|
} from "./analysisErrorBase.js";
|
|
|
|
/** Evidence identity, schema, or bundle manifests failed integrity checks. */
|
|
export class EvidenceIntegrityError extends AnalysisError {
|
|
readonly _tag = "EvidenceIntegrityError";
|
|
override readonly userMessage: string | undefined;
|
|
|
|
constructor(
|
|
message: string,
|
|
options?: AnalysisErrorOptions & { readonly userMessage?: string },
|
|
) {
|
|
super(message, options);
|
|
this.userMessage = options?.userMessage;
|
|
}
|
|
}
|
|
|
|
/** A valid snapshot belongs to a different target, provider, or analysis profile. */
|
|
export class AnalysisSnapshotMismatchError extends EvidenceIntegrityError {}
|
|
|
|
/** A session Evidence reference is missing or has the wrong semantic identity. */
|
|
export class EvidenceReferenceError extends EvidenceIntegrityError {
|
|
constructor(
|
|
readonly evidenceId: string,
|
|
readonly reason:
|
|
| "missing"
|
|
| "wrong_operation"
|
|
| "wrong_predicate"
|
|
| "identity_mismatch",
|
|
readonly expected: string,
|
|
readonly actual: string | null,
|
|
) {
|
|
super(`Evidence reference ${reason}: ${evidenceId}`);
|
|
}
|
|
}
|
|
|
|
/** Evidence bundle filesystem access failed within the configured policy. */
|
|
export class EvidenceFileError extends AnalysisError {
|
|
readonly _tag = "EvidenceFileError";
|
|
|
|
/** Caller-selected path that failed, resolved against the working directory. */
|
|
readonly path: string | undefined;
|
|
|
|
constructor(
|
|
readonly operation: "read" | "write",
|
|
readonly reason: "not-file" | "exists" | "invalid-json" | "missing" | "io",
|
|
options?: ErrorOptions & { readonly path?: string },
|
|
) {
|
|
super(`Evidence bundle ${operation} failed: ${reason}`, options);
|
|
this.path = options?.path;
|
|
}
|
|
}
|