refactor!: enforce canonical evidence and provider boundaries

Deliver complete Evidence directly through MCP with required nullable analysis profiles and immutable per-server delivery settings. Bind selected environments at construction and require typed cleanup outcomes with retained retry ownership.

Remove test-only routing, duplicate session and snapshot metadata, producer-field repairs, and ambiguous provider arguments. Separate artifact byte identity from occurrence classification and retain typed source-map and partial native facts across CLI, MCP, and verifier consumers.

BREAKING CHANGE: obsolete Evidence envelopes, session aliases, incomplete snapshots, and missing normalized producer facts are no longer accepted.
This commit is contained in:
morluto
2026-10-09 20:18:52 +08:00
parent 2a7746998d
commit 63bf91405c
514 changed files with 9296 additions and 5825 deletions
+5 -11
View File
@@ -3,15 +3,16 @@ import { CdpCaptureCompleteness } from "./CdpCaptureCompleteness.js";
import {
numberValue,
recordValue,
scriptMetadataValues,
cdpStringValue,
} from "./CdpCaptureValues.js";
export interface ElectronScriptDraft {
readonly scriptId: string;
readonly rawUrl: string;
readonly hash: string;
readonly length: number;
readonly isModule: boolean;
readonly hash: string | null;
readonly length: number | null;
readonly isModule: boolean | null;
readonly language: string | null;
readonly executionContextKey: string | null;
}
@@ -52,9 +53,7 @@ export const ingestElectronScriptEvent = (input: {
input.scripts.push({
scriptId,
rawUrl,
hash: cdpStringValue(value?.hash) ?? "",
length: nonnegativeInteger(value?.length),
isModule: value?.isModule === true,
...scriptMetadataValues(value),
language: cdpStringValue(value?.scriptLanguage) ?? null,
executionContextKey: executionContextKey(value?.executionContextId),
});
@@ -72,11 +71,6 @@ const retainExecutionContext = (
frames.set(contextKey, frameId);
};
const nonnegativeInteger = (value: unknown): number => {
const number = numberValue(value);
return number === undefined ? 0 : Math.max(0, Math.trunc(number));
};
const executionContextKey = (value: unknown): string | null => {
const identifier = numberValue(value);
return identifier !== undefined && Number.isSafeInteger(identifier)