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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user