refactor: remove forwarding exports and redundant aliases

This commit is contained in:
morluto
2026-10-09 22:46:09 +08:00
parent 69c3b32a21
commit ad59531a96
416 changed files with 855 additions and 1208 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
import { createAnalysisProfile } from "./analysisProfile.js";
import type { BinaryTarget } from "./binaryTarget.js";
import type { BinaryTarget } from "./binaryTargetTypes.js";
/** Immutable target shared by analysis-snapshot contract tests. */
export const ANALYSIS_SNAPSHOT_TARGET: BinaryTarget = {
+1 -1
View File
@@ -9,7 +9,7 @@ import {
committedProviderSchema,
type AnalysisProfileCommitment,
} from "./analysisProfile.js";
import type { BinaryTarget } from "./binaryTarget.js";
import type { BinaryTarget } from "./binaryTargetTypes.js";
import {
evidenceBundleForTarget,
evidenceBundleSchema,
+5 -3
View File
@@ -20,13 +20,15 @@ import {
} from "../javascript/javascriptSemanticGraph.js";
import {
completeWithinViewCoverage,
inspectAnalysisViewInputSchema,
pageViewCoverage,
} from "./analysisViewCoverage.js";
import { javascriptModulePath } from "./javascriptApplicationView.js";
import {
inspectAnalysisViewInputSchema,
projectAnalysisView,
type AnalysisViewParent,
} from "./analysisView.js";
import { javascriptModulePath } from "./javascriptApplicationView.js";
const layoutParent = (): AnalysisViewParent => {
const evidence = analysisViewLayoutEvidence();
return {
-5
View File
@@ -202,11 +202,6 @@ export interface AnalysisViewParent {
readonly limitations: readonly string[];
}
export {
completeWithinViewCoverage,
pageViewCoverage,
} from "./analysisViewCoverage.js";
/** Construct a typed input failure for one selected-view constraint. */
export const analysisViewInputError = (
issues: readonly AnalysisInputIssue[],
@@ -1,5 +1,4 @@
import type { AnalysisViewCoverage } from "./analysisView.js";
/** Coverage for a summary, facet, or single selected object. */
export const completeWithinViewCoverage = (
examined: number,
@@ -4,8 +4,8 @@ import { buildBinary, parseBinary } from "plist";
import {
buildInterfaceBuilderAnalysis,
interfaceBuilderLimitsSchema,
parseInterfaceBuilderRecords,
} from "./interfaceBuilderGraph.js";
import { parseInterfaceBuilderRecords } from "./interfaceBuilderKeyedArchive.js";
const hash = "a".repeat(64);
@@ -12,8 +12,6 @@ import {
nativeInvestigationTraceLimitsSchema,
} from "../native/nativeInvestigationGraph.js";
export { parseInterfaceBuilderRecords } from "./interfaceBuilderKeyedArchive.js";
/** One compiled Interface Builder document projected from ibtool output. */
export const interfaceBuilderDocumentSchema = z.strictObject({
relative_path: z.string().min(1),
-2
View File
@@ -2,8 +2,6 @@ import type { BinaryArchitecture } from "./binaryTargetTypes.js";
import { err, ok, type Result } from "./result.js";
import { mzWindowsHeaderOffset, parseDosMzHeader } from "./dosMz.js";
export type { BinaryArchitecture, BinaryTarget } from "./binaryTargetTypes.js";
/** Format and architecture facts recovered from an executable header. */
export type ExecutableMetadata =
| {
+4 -4
View File
@@ -1,17 +1,17 @@
import { z } from "zod";
import { compareBrowserScenarios } from "./browserScenarioDiff.js";
import { compareWebCaptures } from "./webCaptureDiff.js";
import {
browserScenarioDiffSchema,
compareBrowserScenarios,
compareBrowserScenariosInputSchema,
type BrowserScenarioDiff,
} from "./browserScenarioDiff.js";
} from "./browserScenarioDiffValues.js";
import {
compareWebCaptures,
compareWebCapturesInputSchema,
webCaptureDiffSchema,
type WebCaptureDiff,
} from "./webCaptureDiff.js";
} from "./webCaptureDiffSchemas.js";
/** Mutually exclusive passive and scenario capture comparison inputs. */
export const browserCaptureComparisonInputSchema = z.union(
-7
View File
@@ -1,12 +1,5 @@
import { z } from "zod";
export {
browserTargetListSchema,
webPageInspectionSchema,
type BrowserTargetList,
type WebPageInspection,
} from "./browserObservationSchemas.js";
const parseExactOrigin = (value: string): string | undefined => {
let url: URL;
try {
-6
View File
@@ -13,12 +13,6 @@ import {
type BrowserScenarioValue,
} from "./browserScenarioValues.js";
export {
type BrowserScenarioAction,
type BrowserScenarioUrl,
type BrowserScenarioValue,
} from "./browserScenarioValues.js";
export const browserScenarioInputSchema = z.strictObject({
browser: browserScenarioBrowserSchema.describe(
"Required launch/connect selection. Launch uses the selected executable and an owned temporary profile; connect uses one loopback CDP endpoint and target.",
-13
View File
@@ -7,19 +7,6 @@ import {
browserScenarioStepSchema,
} from "./browserScenarioCaptureValues.js";
export {
classifyBrowserScenarioCompleteness,
browserScenarioEventSchema,
browserScenarioStepSchema,
browserStepArtifactsSchema,
type BrowserScenarioCompleteness,
type BrowserScenarioCompletenessSection,
type BrowserScenarioEvent,
type BrowserScenarioStep,
type BrowserScenarioStepOutcome,
type BrowserStepArtifacts,
} from "./browserScenarioCaptureValues.js";
/** Step-indexed browser scenario observation. */
export const browserScenarioCaptureSchema = z
.strictObject({
+2 -2
View File
@@ -2,11 +2,11 @@ import { createHash } from "node:crypto";
import { describe, expect, it } from "vitest";
import { compareBrowserScenarios } from "./browserScenarioDiff.js";
import {
compareBrowserScenarios,
compareBrowserScenariosInputSchema,
browserScenarioDiffSchema,
} from "./browserScenarioDiff.js";
} from "./browserScenarioDiffValues.js";
import {
browserScenarioCaptureSchema,
type BrowserScenarioCapture,
+2 -11
View File
@@ -1,7 +1,5 @@
import {
type BrowserScenarioCapture,
type BrowserScenarioStep,
} from "./browserScenarioCapture.js";
import type { BrowserScenarioCapture } from "./browserScenarioCapture.js";
import type { BrowserScenarioStep } from "./browserScenarioCaptureValues.js";
import {
actionState,
artifactEvidenceState,
@@ -27,13 +25,6 @@ import {
digestNormalizedScenarioValue,
} from "./browserScenarioNormalization.js";
export {
browserScenarioDiffSchema,
compareBrowserScenariosInputSchema,
type BrowserScenarioDiff,
type CompareBrowserScenariosInput,
} from "./browserScenarioDiffValues.js";
type ComparableArtifact = {
readonly artifact: BrowserScenarioArtifactKind;
} & (
+2 -2
View File
@@ -1,10 +1,10 @@
import type {
BrowserScenarioCapture,
BrowserScenarioCompleteness,
BrowserScenarioCompletenessSection,
BrowserScenarioStep,
BrowserStepArtifacts,
} from "./browserScenarioCapture.js";
} from "./browserScenarioCaptureValues.js";
import type { BrowserScenarioCapture } from "./browserScenarioCapture.js";
import type {
BrowserScenarioArtifactKind,
BrowserScenarioEvidenceState,
+2 -2
View File
@@ -1,11 +1,11 @@
import { describe, expect, it } from "vitest";
import { enhancedInputSchemas } from "../contracts/enhancedInputs.js";
import { buildCallPath } from "./callPath.js";
import {
buildCallPath,
callPathInputSchema,
callPathResultSchema,
} from "./callPath.js";
} from "./callPathSchemas.js";
import { createEvidence, type Evidence } from "./evidence.js";
import { functionDossierSchema } from "./hopperValues.js";
import { jsonValueSchema } from "./jsonValue.js";
-3
View File
@@ -11,9 +11,6 @@ import {
type FunctionSnapshot,
} from "./functionDossierEvidence.js";
export { callPathInputSchema, callPathResultSchema };
export type { CallPathInput, CallPathResult };
/** Minimal directed caller-to-callee adjacency for call-path search. */
class CallGraph {
private readonly successors = new Map<string, Set<string>>();
+2 -2
View File
@@ -4,7 +4,7 @@ import { artifactComparisonResultSchema } from "./artifactComparison.js";
import { uniqueSorted } from "./canonicalOrdering.js";
import { comparisonSourceEvidenceIds } from "./comparisonSourceEvidence.js";
import { evidenceSchema, parseEvidence, type Evidence } from "./evidence.js";
import { functionComparisonResultSchema } from "./functionComparison.js";
import { functionComparisonResultSchema } from "./functionComparisonSchemas.js";
import {
PROCESS_PROVIDER,
isProcessEvidenceProvider,
@@ -14,7 +14,7 @@ import {
deriveProcessComparisonStatus,
PROCESS_COMPARISON_DIMENSIONS,
processCaptureComparisonSchema,
} from "./process/processCapture.js";
} from "./process/processComparison.js";
import { prefixedDigestSchema } from "./../domain/digests.js";
const evidenceIdSchema = prefixedDigestSchema("ev");
+1 -1
View File
@@ -2,7 +2,7 @@ import { fc, it } from "@fast-check/vitest";
import { describe, expect } from "vitest";
import { createAnalysisProfile } from "./analysisProfile.js";
import type { BinaryTarget } from "./binaryTarget.js";
import type { BinaryTarget } from "./binaryTargetTypes.js";
import { createEvidence, evidenceSchema, parseEvidence } from "./evidence.js";
import { MAX_JSON_DEPTH, type JsonValue } from "./jsonValue.js";
import { createEvidenceBundle } from "./evidenceBundle.js";
+1 -1
View File
@@ -7,7 +7,7 @@ import {
analysisProfileSchema,
type AnalysisProfileCommitment,
} from "./analysisProfile.js";
import type { BinaryTarget } from "./binaryTarget.js";
import type { BinaryTarget } from "./binaryTargetTypes.js";
import {
jsonObjectSchema,
jsonValueSchema,
+2 -4
View File
@@ -2,16 +2,14 @@ import { describe, expect, it } from "vitest";
import { FUNCTION_COMPARISON_EXAMPLE } from "../contracts/functionComparisonExample.js";
import { enhancedInputSchemas } from "../contracts/enhancedInputs.js";
import {
compareFunctions,
functionComparisonResultSchema,
} from "./functionComparison.js";
import { functionComparisonResultSchema } from "./functionComparisonSchemas.js";
import { createEvidence, type Evidence } from "./evidence.js";
import { functionDossierSchema } from "./hopperValues.js";
import { canonicalDigest, canonicalJson } from "./comparisonSemantics.js";
import { compareCodePoints } from "./canonicalOrdering.js";
import { jsonValueSchema } from "./jsonValue.js";
import { compareFunctions } from "./functionComparison.js";
const dossier = (
text: string,
base: "0x1000" | "0x2000",
-5
View File
@@ -8,11 +8,6 @@ import {
import { overallStatus, summarize } from "./functionComparisonResults.js";
import { compareDimensions } from "./functionComparisonDimensions.js";
export {
functionComparisonInputSchema,
functionComparisonResultSchema,
} from "./functionComparisonSchemas.js";
/** Compare two complete function Evidence records without fuzzy matching. */
export const compareFunctions = (
leftInput: unknown,
@@ -15,8 +15,8 @@ import {
argumentNode,
calleeName,
range,
semanticStaticPropertyName,
} from "./javascriptStaticAnalysisHelpers.js";
import { semanticStaticPropertyName } from "./javascriptAstValues.js";
import type { JavaScriptFindingContext } from "./javascriptStaticAnalysisState.js";
/** Inspect Electron IPC operations and validation candidates. */
@@ -7,11 +7,13 @@ import { addLocatedFinding } from "./javascriptStaticAnalysisFindings.js";
import {
argumentNode,
calleeName,
propertyName,
range,
semanticStaticPropertyName,
stringValue,
} from "./javascriptStaticAnalysisHelpers.js";
import {
propertyName,
semanticStaticPropertyName,
} from "./javascriptAstValues.js";
import type { JavaScriptFindingContext } from "./javascriptStaticAnalysisState.js";
interface NativeBindingInput {
@@ -2,11 +2,13 @@ import {
createJavaScriptApplicationEdge,
createJavaScriptApplicationGraph,
createJavaScriptApplicationNode,
type ApplicationEdge,
type ApplicationGraphEvidence,
type ApplicationNode,
type JavaScriptApplicationGraph,
} from "./javascriptApplicationGraph.js";
import type {
ApplicationEdge,
ApplicationNode,
} from "./javascriptApplicationGraphSchemas.js";
import type { ApplicationGraphEvidence } from "./javascriptApplicationEvidenceSchemas.js";
import { compareCodePoints, uniqueSorted } from "../canonicalOrdering.js";
import type { ApplicationVersionComparisonItem } from "./javascriptApplicationVersionComparisonSchemas.js";
@@ -2,10 +2,10 @@ import {
createJavaScriptApplicationEdge,
createJavaScriptApplicationGraph,
createJavaScriptApplicationNode,
type ApplicationGraphEvidence,
type ApplicationNode,
type JavaScriptApplicationGraph,
} from "./javascriptApplicationGraph.js";
import type { ApplicationNode } from "./javascriptApplicationGraphSchemas.js";
import type { ApplicationGraphEvidence } from "./javascriptApplicationEvidenceSchemas.js";
export const APPLICATION_GRAPH_DIGESTS = {
package: "1".repeat(64),
@@ -528,5 +528,3 @@ export const serializeJavaScriptApplicationGraph = (input: unknown): string =>
parseJavaScriptApplicationGraph(input),
"JavaScript Application Graph",
);
export type { ApplicationEdge, ApplicationGraphEvidence, ApplicationNode };
@@ -5,11 +5,11 @@ import {
} from "../comparisonSemantics.js";
import { compareCodePoints } from "../canonicalOrdering.js";
import type { Evidence } from "../evidence.js";
import {
type ApplicationEdge,
type ApplicationNode,
type JavaScriptApplicationGraph,
} from "./javascriptApplicationGraph.js";
import type {
ApplicationEdge,
ApplicationNode,
} from "./javascriptApplicationGraphSchemas.js";
import type { JavaScriptApplicationGraph } from "./javascriptApplicationGraph.js";
import type { ApplicationVersionComparisonItem } from "./javascriptApplicationVersionComparisonSchemas.js";
import type {
ApplicationVersionMatchingProjection,
@@ -1,6 +1,6 @@
import { canonicalJson } from "../comparisonSemantics.js";
import { compareCodePoints } from "../canonicalOrdering.js";
import type { ApplicationNode } from "./javascriptApplicationGraph.js";
import type { ApplicationNode } from "./javascriptApplicationGraphSchemas.js";
import type { JsonValue } from "../jsonValue.js";
/** One deterministic one-to-one match between two graph versions. */
@@ -1,7 +1,5 @@
import type {
ApplicationNode,
JavaScriptApplicationGraph,
} from "./javascriptApplicationGraph.js";
import type { ApplicationNode } from "./javascriptApplicationGraphSchemas.js";
import type { JavaScriptApplicationGraph } from "./javascriptApplicationGraph.js";
import {
projectedExportReturnShapesSchema,
type JavaScriptExportShapeComparisonResult,
@@ -3,8 +3,8 @@ import { describe, expect, it } from "vitest";
import {
createJavaScriptApplicationGraph,
createJavaScriptApplicationNode,
type ApplicationNode,
} from "./javascriptApplicationGraph.js";
import type { ApplicationNode } from "./javascriptApplicationGraphSchemas.js";
import {
artifactEvidence,
completeCoverage,
@@ -1,5 +1,5 @@
import { compareCodePoints } from "../canonicalOrdering.js";
import type { ApplicationNode } from "./javascriptApplicationGraph.js";
import type { ApplicationNode } from "./javascriptApplicationGraphSchemas.js";
import {
featureSeedMatchMode,
type ApplicationFeatureSeed,
@@ -3,10 +3,12 @@ import { compareCodePoints, uniqueSorted } from "../canonicalOrdering.js";
import type { Evidence } from "../evidence.js";
import {
createJavaScriptApplicationGraph,
type ApplicationEdge,
type ApplicationNode,
type JavaScriptApplicationGraph,
} from "./javascriptApplicationGraph.js";
import type {
ApplicationEdge,
ApplicationNode,
} from "./javascriptApplicationGraphSchemas.js";
import {
applicationFeatureTraceResultSchema,
type ApplicationFeatureTraceResult,
@@ -1,8 +1,8 @@
import {
type ApplicationEdge,
type ApplicationNode,
type JavaScriptApplicationGraph,
} from "./javascriptApplicationGraph.js";
import type {
ApplicationEdge,
ApplicationNode,
} from "./javascriptApplicationGraphSchemas.js";
import type { JavaScriptApplicationGraph } from "./javascriptApplicationGraph.js";
import { compareCodePoints } from "../canonicalOrdering.js";
interface AdjacencyEntry {
@@ -3,7 +3,7 @@ import type { Evidence } from "../evidence.js";
import {
type ApplicationEdge,
type ApplicationNode,
} from "./javascriptApplicationGraph.js";
} from "./javascriptApplicationGraphSchemas.js";
import type { ApplicationFeatureTraceResult } from "./javascriptFeatureTraceSchemas.js";
type NativeHandoff = ApplicationFeatureTraceResult["native_handoffs"][number];
@@ -1,4 +1,4 @@
import { type ApplicationNode } from "./javascriptApplicationGraph.js";
import type { ApplicationNode } from "./javascriptApplicationGraphSchemas.js";
import { uniqueSorted } from "../canonicalOrdering.js";
import type { ParsedStaticLayer } from "./javascriptRuntimeReconciliationParsing.js";
import type {
@@ -1,10 +1,12 @@
import {
createJavaScriptApplicationGraph,
createJavaScriptApplicationNode,
type ApplicationEdge,
type ApplicationNode,
type JavaScriptApplicationGraph,
} from "./javascriptApplicationGraph.js";
import type {
ApplicationEdge,
ApplicationNode,
} from "./javascriptApplicationGraphSchemas.js";
import type {
ParsedRuntimeCapture,
ParsedStaticLayer,
@@ -1,8 +1,6 @@
import {
createJavaScriptApplicationEdge,
type ApplicationEdge,
type ApplicationGraphEvidence,
} from "./javascriptApplicationGraph.js";
import { createJavaScriptApplicationEdge } from "./javascriptApplicationGraph.js";
import type { ApplicationEdge } from "./javascriptApplicationGraphSchemas.js";
import type { ApplicationGraphEvidence } from "./javascriptApplicationEvidenceSchemas.js";
import { canonicalDigest } from "../comparisonSemantics.js";
import type { ParsedStaticLayer } from "./javascriptRuntimeReconciliationParsing.js";
import { compareCodePoints } from "../canonicalOrdering.js";
@@ -3,9 +3,11 @@ import { z } from "zod";
import {
browserAllowedOriginsSchema,
browserEndpointSchema,
} from "../browserObservation.js";
import {
webPageInspectionSchema,
type WebPageInspection,
} from "../browserObservation.js";
} from "../browserObservationSchemas.js";
import {
classifyBrowserCompleteness,
type BrowserCompleteness,
@@ -2,10 +2,12 @@ import type { JsonValue } from "../jsonValue.js";
import {
createJavaScriptApplicationEdge,
createJavaScriptApplicationNode,
type ApplicationEdge,
type ApplicationGraphEvidence,
type ApplicationNode,
} from "./javascriptApplicationGraph.js";
import type {
ApplicationEdge,
ApplicationNode,
} from "./javascriptApplicationGraphSchemas.js";
import type { ApplicationGraphEvidence } from "./javascriptApplicationEvidenceSchemas.js";
import type { ParsedRuntimeCapture } from "./javascriptRuntimeReconciliationParsing.js";
export interface RuntimeReconciliationEntity {
@@ -1,9 +1,7 @@
import { posix, relative, win32 } from "node:path";
import {
type ApplicationNode,
type JavaScriptApplicationGraph,
} from "./javascriptApplicationGraph.js";
import type { ApplicationNode } from "./javascriptApplicationGraphSchemas.js";
import type { JavaScriptApplicationGraph } from "./javascriptApplicationGraph.js";
import { compareCodePoints, uniqueSorted } from "../canonicalOrdering.js";
import type { ParsedStaticLayer } from "./javascriptRuntimeReconciliationParsing.js";
import type { RuntimeReconciliationEntity } from "./javascriptRuntimeReconciliationRuntime.js";
@@ -12,7 +12,7 @@ import {
collectJavaScriptExports,
fingerprintJavaScriptAst,
} from "./javascriptAstFingerprint.js";
import type { JavaScriptSemanticValue } from "./javascriptSemanticIr.js";
import type { JavaScriptSemanticValue } from "./javascriptSemanticValueTypes.js";
import {
onlyCallable,
topLevelBinding,
@@ -7,10 +7,8 @@ import type {
JavaScriptSemanticEventOperation,
JavaScriptSemanticTimerOperation,
} from "./javascriptSemanticIr.js";
import {
semanticCallableIdForNode,
semanticStaticPropertyName,
} from "./javascriptSemanticProjection.js";
import { semanticCallableIdForNode } from "./javascriptSemanticProjection.js";
import { semanticStaticPropertyName } from "./javascriptAstValues.js";
import {
resolveSemanticBindingState,
semanticResolutionBlocked,
@@ -12,8 +12,8 @@ import type {
import {
semanticCallableIdForNode,
semanticReferenceRole,
semanticStaticPropertyKey,
} from "./javascriptSemanticProjection.js";
import { semanticStaticPropertyKey } from "./javascriptAstValues.js";
import {
resolveSemanticBindingState,
isUnshadowedGlobal,
@@ -7,10 +7,8 @@ import type {
JavaScriptSemanticChildProcessInteraction,
JavaScriptSemanticChildProcessSpawn,
} from "./javascriptSemanticIr.js";
import {
semanticCallableIdForNode,
semanticStaticPropertyName,
} from "./javascriptSemanticProjection.js";
import { semanticCallableIdForNode } from "./javascriptSemanticProjection.js";
import { semanticStaticPropertyName } from "./javascriptAstValues.js";
import {
resolveSemanticBindingState,
type JavaScriptSemanticAnalysisState,
@@ -12,7 +12,7 @@ import { compareCodePoints } from "../canonicalOrdering.js";
import {
semanticStaticPropertyKey,
semanticStaticPropertyName,
} from "./javascriptSemanticProjection.js";
} from "./javascriptAstValues.js";
import {
resolveSemanticBindingState,
semanticResolutionBlocked,
@@ -627,5 +627,3 @@ export const isValidatedImmutableJavaScriptSemanticGraph = (
typeof value === "object" &&
value !== null &&
validatedImmutableSemanticGraphs.has(value);
export type { JavaScriptSemanticGraphNode, JavaScriptSemanticGraphRelation };
@@ -17,8 +17,8 @@ import {
createImmutableJavaScriptSemanticGraphSteps,
isValidatedImmutableJavaScriptSemanticGraph,
type JavaScriptSemanticGraph,
type JavaScriptSemanticGraphNode,
} from "./javascriptSemanticGraph.js";
import type { JavaScriptSemanticGraphNode } from "./javascriptSemanticGraphSchemas.js";
import {
parseJavaScriptSemanticGraph,
serializeJavaScriptSemanticGraph,
@@ -13,9 +13,11 @@ import {
createJavaScriptSemanticGraphRelation,
createJavaScriptSemanticGraphUnknown,
type JavaScriptSemanticGraph,
type JavaScriptSemanticGraphNode,
type JavaScriptSemanticGraphRelation,
} from "./javascriptSemanticGraph.js";
import type {
JavaScriptSemanticGraphNode,
JavaScriptSemanticGraphRelation,
} from "./javascriptSemanticGraphSchemas.js";
import { queryJavaScriptSemanticGraph } from "./javascriptSemanticQuery.js";
import type { JsonValue } from "../jsonValue.js";
@@ -5,13 +5,6 @@ import type {
JavaScriptSemanticReturnCoverage,
} from "./javascriptSemanticCoverage.js";
export type {
JavaScriptSemanticPrimitive,
JavaScriptSemanticProperty,
JavaScriptSemanticResourceLimit,
JavaScriptSemanticValue,
} from "./javascriptSemanticValueTypes.js";
/** One exact module origin followed through imports, requires, or aliases. */
export interface JavaScriptModuleOrigin {
readonly specifier: string;
@@ -1,4 +1,4 @@
import type { JavaScriptSemanticValue } from "./javascriptSemanticIr.js";
import type { JavaScriptSemanticValue } from "./javascriptSemanticValueTypes.js";
/** Invalidate only slots that an explicit mutation can affect. */
export const invalidateSemanticMutationPath = (
@@ -7,8 +7,8 @@ import type {
import {
semanticCallableIdForNode,
semanticReadsBeforeWrite,
semanticStaticPropertyKey,
} from "./javascriptSemanticProjection.js";
import { semanticStaticPropertyKey } from "./javascriptAstValues.js";
import {
resolveSemanticBindingState,
type JavaScriptSemanticAnalysisState,
@@ -1,25 +1,15 @@
import * as t from "@babel/types";
import type {
JavaScriptSemanticPrimitive,
JavaScriptSemanticValue,
} from "./javascriptSemanticIr.js";
} from "./javascriptSemanticValueTypes.js";
import { compareCodePoints } from "../canonicalOrdering.js";
import { semanticPrimitiveKey } from "./javascriptSemanticProvenance.js";
import { readExactJavaScriptLiteral } from "./javascriptAstValues.js";
import {
SEMANTIC_PRIMITIVE_CANDIDATE_LIMIT,
exceedsSemanticPrimitiveStringByteBudget,
semanticResourceLimitUnknown,
} from "./javascriptSemanticResourceLimits.js";
/**
* Keep eight independent binary choices exact, while bounding the next
* exponential expansion before it allocates hundreds more alternatives.
*/
export const MAX_SEMANTIC_PRIMITIVE_CANDIDATES =
SEMANTIC_PRIMITIVE_CANDIDATE_LIMIT;
/** Normalize one bounded collection of possible primitive values. */
export const semanticPrimitiveSet = (
values: readonly JavaScriptSemanticPrimitive[],
@@ -32,7 +22,7 @@ export const semanticPrimitiveSet = (
reason: "Nonfinite numbers are outside the JSON primitive lattice.",
};
uniqueValues.add(value);
if (uniqueValues.size > MAX_SEMANTIC_PRIMITIVE_CANDIDATES)
if (uniqueValues.size > SEMANTIC_PRIMITIVE_CANDIDATE_LIMIT)
return semanticResourceLimitUnknown("primitive-candidates");
}
if (
@@ -62,12 +52,3 @@ export const semanticPrimitiveCandidates = (
: value.status === "union"
? value.values
: null;
/** Parse one Babel primitive literal without evaluating code. */
export const semanticPrimitiveValue = (
node: t.Node,
):
| { readonly found: true; readonly value: JavaScriptSemanticPrimitive }
| { readonly found: false } => {
return readExactJavaScriptLiteral(node);
};
@@ -20,12 +20,11 @@ import {
evaluateSemanticBinding,
evaluateSemanticProvenance,
} from "./javascriptSemanticValues.js";
import { range, stringValue } from "./javascriptStaticAnalysisHelpers.js";
import {
propertyName,
range,
stringValue,
} from "./javascriptStaticAnalysisHelpers.js";
import { semanticStaticPropertyKey } from "./javascriptAstValues.js";
semanticStaticPropertyKey,
} from "./javascriptAstValues.js";
interface CollectCallableInput {
readonly node: t.Node;
@@ -181,11 +180,6 @@ export const immutableSemanticBindings = (
}))
.sort((left, right) => compareCodePoints(left.bindingId, right.bindingId));
export {
semanticStaticPropertyKey,
semanticStaticPropertyName,
} from "./javascriptAstValues.js";
const callableKind = (
node: t.Node,
): "function" | "class" | "method" | undefined => {
@@ -4,10 +4,8 @@ import type {
JavaScriptSemanticCallable,
JavaScriptSemanticPromiseOperation,
} from "./javascriptSemanticIr.js";
import {
semanticCallableIdForNode,
semanticStaticPropertyName,
} from "./javascriptSemanticProjection.js";
import { semanticCallableIdForNode } from "./javascriptSemanticProjection.js";
import { semanticStaticPropertyName } from "./javascriptAstValues.js";
import {
resolveSemanticBindingState,
semanticResolutionBlocked,
@@ -1,8 +1,8 @@
import type {
JavaScriptBindingProvenance,
JavaScriptModuleOrigin,
JavaScriptSemanticPrimitive,
} from "./javascriptSemanticIr.js";
import type { JavaScriptSemanticPrimitive } from "./javascriptSemanticValueTypes.js";
import { compareCodePoints } from "../canonicalOrdering.js";
/** Construct exact local provenance without inventing module origins. */
@@ -1,8 +1,8 @@
import type { JavaScriptSemanticGraph } from "./javascriptSemanticGraph.js";
import type {
JavaScriptSemanticGraph,
JavaScriptSemanticGraphNode,
JavaScriptSemanticGraphRelation,
} from "./javascriptSemanticGraph.js";
} from "./javascriptSemanticGraphSchemas.js";
import { compareCodePoints } from "../canonicalOrdering.js";
import type { JavaScriptSemanticGraphUnknown } from "./javascriptSemanticGraphSchemas.js";
import { isJavaScriptSemanticOwnershipRelation as ownershipRelation } from "./javascriptSemanticQueryRelations.js";
@@ -2,10 +2,8 @@ import { createHash } from "node:crypto";
import canonicalize from "canonicalize";
import type {
JavaScriptSemanticGraph,
JavaScriptSemanticGraphNode,
} from "./javascriptSemanticGraph.js";
import type { JavaScriptSemanticGraph } from "./javascriptSemanticGraph.js";
import type { JavaScriptSemanticGraphNode } from "./javascriptSemanticGraphSchemas.js";
import { compareCodePoints, uniqueSorted } from "../canonicalOrdering.js";
import type { JavaScriptSemanticQueryInput } from "./javascriptSemanticQuerySchemas.js";
@@ -1,4 +1,4 @@
import type { JavaScriptSemanticGraphRelation } from "./javascriptSemanticGraph.js";
import type { JavaScriptSemanticGraphRelation } from "./javascriptSemanticGraphSchemas.js";
const OWNERSHIP_RELATIONS = new Set<
JavaScriptSemanticGraphRelation["relation"]
@@ -6,7 +6,7 @@ import type {
JavaScriptSemanticCallable,
JavaScriptSemanticResourceOperation,
} from "./javascriptSemanticIr.js";
import { semanticStaticPropertyName } from "./javascriptSemanticProjection.js";
import { semanticStaticPropertyName } from "./javascriptAstValues.js";
import {
resolveSemanticBindingState,
type JavaScriptSemanticAnalysisState,
@@ -9,8 +9,8 @@ import type {
JavaScriptSemanticCallable,
JavaScriptSemanticModuleLink,
JavaScriptSemanticReturnSite,
JavaScriptSemanticValue,
} from "./javascriptSemanticIr.js";
import type { JavaScriptSemanticValue } from "./javascriptSemanticValueTypes.js";
import type {
ProjectedPropertyCoverage,
ProjectedReturnField,
@@ -11,7 +11,6 @@ import {
calleeName,
endpointArgument as endpointArgumentHelper,
prefixedArgument,
semanticStaticPropertyName,
range,
rangeForOffsets,
sourceSlice,
@@ -20,6 +19,7 @@ import {
storageKind,
stringValue,
} from "./javascriptStaticAnalysisHelpers.js";
import { semanticStaticPropertyName } from "./javascriptAstValues.js";
import type {
JavaScriptAnalysisAccumulator as AnalysisAccumulator,
JavaScriptEndpointInput as EndpointInput,
@@ -17,11 +17,6 @@ import {
} from "./javascriptAstValues.js";
import { compareCodePoints } from "../canonicalOrdering.js";
export {
propertyName,
semanticStaticPropertyName,
} from "./javascriptAstValues.js";
/** Explicit result for source text that Babel cannot parse. */
export const failedJavaScriptStaticAnalysis = (): JavaScriptStaticAnalysis => ({
parse_status: "failed",
@@ -7,9 +7,11 @@ import { evidenceSchema, type Evidence } from "../evidence.js";
import {
createJavaScriptApplicationGraph,
javascriptApplicationGraphSchema,
type ApplicationEdge,
type ApplicationNode,
} from "../javascript/javascriptApplicationGraph.js";
import type {
ApplicationEdge,
ApplicationNode,
} from "../javascript/javascriptApplicationGraphSchemas.js";
import {
managedArtifactInspectionSchema,
managedMemberInspectionSchema,
@@ -1,4 +1,4 @@
import type { ApplicationGraphEvidence } from "../javascript/javascriptApplicationGraph.js";
import type { ApplicationGraphEvidence } from "../javascript/javascriptApplicationEvidenceSchemas.js";
import type {
ManagedArtifactInspection,
ManagedMemberInspection,
@@ -2,9 +2,9 @@ import { basename } from "node:path";
import {
createJavaScriptApplicationEdge,
createJavaScriptApplicationNode,
type ApplicationGraphEvidence,
type ApplicationNode,
} from "../javascript/javascriptApplicationGraph.js";
import type { ApplicationGraphEvidence } from "../javascript/javascriptApplicationEvidenceSchemas.js";
import type { ApplicationNode } from "../javascript/javascriptApplicationGraphSchemas.js";
import { managedSourceCoverage } from "./managedApplicationGraphCoverage.js";
import {
type ManagedMemberInspection,
@@ -259,5 +259,3 @@ export const compareManagedMembers = (
} satisfies ManagedMemberComparisonResult;
return managedMemberComparisonResultSchema.parse(result);
};
export { parseManagedMemberEvidence } from "./managedMemberComparisonMatch.js";
@@ -20,13 +20,6 @@ import {
verifyPinvoke,
} from "./managedNativeVerificationMatch.js";
export {
managedNativeVerificationInputSchema,
type ManagedNativeVerificationInput,
type ManagedNativeVerificationResult,
} from "./managedNativeVerificationSchemas.js";
export { managedNativeVerificationResultSchema };
const sha256 = (value: JsonValue): string => {
const serialized = canonicalize(value);
if (serialized === undefined)
+4 -6
View File
@@ -1,13 +1,11 @@
import { compareProcessCaptures } from "./processComparison.js";
import { parseProcessCapture } from "./processCaptureParsing.js";
import { EMPTY_PROCESS_CAPTURE_EXAMPLE } from "./processCaptureExample.js";
import {
compareProcessCaptures,
parseProcessCapture,
processCaptureSchema,
type UnverifiedProcessCapture,
} from "./processCapture.js";
import { EMPTY_PROCESS_CAPTURE_EXAMPLE } from "./processCaptureExample.js";
export { EMPTY_PROCESS_CAPTURE_EXAMPLE } from "./processCaptureExample.js";
/** Parse a detached valid empty capture for tests that need trusted evidence. */
export const emptyProcessCapture = () =>
parseProcessCapture(EMPTY_PROCESS_CAPTURE_EXAMPLE);
-13
View File
@@ -8,8 +8,6 @@ import {
type ProcessCaptureTruncationDetails,
} from "./processCaptureCoverage.js";
export * from "./processScenario.js";
/** Normalized raw PTY chunk, preserving transport-level output differences. */
export interface TerminalFrame {
readonly sequence: number;
@@ -675,14 +673,3 @@ export const processCaptureSchema = processCaptureShapeSchema
.describe(
"The capture must preserve its canonical scenario, comparison, and normalization SHA-256 commitments; ordered capture timestamps and contiguous sequence numbers; before and final filesystem snapshots with truncation propagated; and exit-code consistency with deadline termination. The event journal is required; empty journals are valid. A non-empty journal must reference every captured observation exactly once with unique in-range references. These cross-field invariants are checked by REA after capture.",
);
export { parseProcessCapture } from "./processCaptureParsing.js";
export type { ProcessCapture } from "./processCaptureParsing.js";
export {
compareProcessCaptures,
comparisonStatusSchema,
deriveProcessComparisonStatus,
PROCESS_COMPARISON_DIMENSIONS,
processCaptureComparisonSchema,
} from "./processComparison.js";
@@ -1,9 +1,7 @@
import { expect, it } from "vitest";
import {
digestProcessCommitment,
parseProcessCapture,
} from "./processCapture.js";
import { digestProcessCommitment } from "./processScenario.js";
import { parseProcessCapture } from "./processCaptureParsing.js";
import {
compareUnverifiedProcessCaptures as compareProcessCaptures,
emptyUnverifiedProcessCapture as emptyCapture,
+1 -1
View File
@@ -1,5 +1,5 @@
import type { JsonValue } from "../jsonValue.js";
import { digestProcessCommitment } from "./processCapture.js";
import { digestProcessCommitment } from "./processScenario.js";
const normalization = {
paths: true,
@@ -1,7 +1,7 @@
import type { UnverifiedProcessCapture } from "./processCapture.js";
import { digestProcessCommitment } from "./processScenario.js";
import { hasCaptureTruncation } from "./processCaptureCoverage.js";
import type { UnverifiedProcessCapture } from "./processCapture.js";
/** One pure semantic validation failure in a shaped process capture. */
export interface ProcessCaptureValidationIssue {
readonly path: string;
+7 -7
View File
@@ -3,21 +3,21 @@ import { z } from "zod";
import { processSourceTruncated } from "./processCaptureCoverage.js";
import type { ProcessObservationSource } from "./processObservation.js";
import type { ProcessCapture } from "./processCapture.js";
import type { ProcessCapture } from "./processCaptureParsing.js";
import { comparableTerminalFrame } from "./processObservation.js";
import { AnalysisInputError } from "../analysisErrorCore.js";
import { jsonValueSchema } from "../jsonValue.js";
import {
compareProcessTraces,
processTraceOutcomesDiffer,
processTraceComparisonResultSchema,
type ProcessTraceSpecification,
} from "./processTraceComparison.js";
import { type ProcessTraceSpecification } from "./processTraceSpecification.js";
import { processTraceComparisonResultSchema } from "./processTraceEvaluation.js";
import {
dimensionsForTraceSources,
traceCoversObservedDimension,
} from "./processTraceDimensionProjection.js";
import {
compareProcessTraces,
processTraceOutcomesDiffer,
} from "./processTraceComparison.js";
const OPERATION = "compare_process_captures";
/** Comparison classification that never equates incomplete evidence. */
@@ -1,11 +1,9 @@
import { describe, expect, it } from "vitest";
import { EMPTY_PROCESS_CAPTURE_EXAMPLE } from "./processCapture.fixture.js";
import {
compareProcessCaptures,
parseProcessCapture,
} from "./processCapture.js";
import type { ProcessTraceSpecification } from "./processTraceComparison.js";
import { EMPTY_PROCESS_CAPTURE_EXAMPLE } from "./processCaptureExample.js";
import { compareProcessCaptures } from "./processComparison.js";
import { parseProcessCapture } from "./processCaptureParsing.js";
import type { ProcessTraceSpecification } from "./processTraceSpecification.js";
const beforeCheckpoint = {
name: "before",
at_ms: 0,
@@ -1,6 +1,9 @@
import { EMPTY_PROCESS_CAPTURE_EXAMPLE } from "./processCapture.fixture.js";
import { parseProcessCapture, type ProcessCapture } from "./processCapture.js";
import { type ProcessTraceSpecification } from "./processTraceComparison.js";
import { EMPTY_PROCESS_CAPTURE_EXAMPLE } from "./processCaptureExample.js";
import {
parseProcessCapture,
type ProcessCapture,
} from "./processCaptureParsing.js";
import { type ProcessTraceSpecification } from "./processTraceSpecification.js";
export const emptyCapture = parseProcessCapture(EMPTY_PROCESS_CAPTURE_EXAMPLE);
export const terminal = { sequence: 0, at_ms: 900, data: "Ready" };
@@ -1,10 +1,7 @@
import { describe, expect, it } from "vitest";
import { parseProcessCapture } from "./processCapture.js";
import {
compareProcessTraces,
processTraceComparisonResultSchema,
type ProcessTraceSpecification,
} from "./processTraceComparison.js";
import { parseProcessCapture } from "./processCaptureParsing.js";
import { type ProcessTraceSpecification } from "./processTraceSpecification.js";
import { processTraceComparisonResultSchema } from "./processTraceEvaluation.js";
import {
capture,
partialSpecification,
@@ -13,6 +10,7 @@ import {
values,
} from "./processTraceComparison.fixture.js";
import { compareProcessTraces } from "./processTraceComparison.js";
describe("generic capture trace comparison", () => {
it("requires explicit partial ordering and never infers causality from timestamps", () => {
const specification = partialSpecification();
+1 -10
View File
@@ -1,4 +1,4 @@
import type { ProcessCapture } from "./processCapture.js";
import type { ProcessCapture } from "./processCaptureParsing.js";
import {
evaluateProcessTraceSide,
processTraceComparisonResultSchema,
@@ -9,15 +9,6 @@ import {
type ProcessTraceSpecification,
} from "./processTraceSpecification.js";
export {
processTraceComparisonResultSchema,
type ProcessTraceComparisonResult,
} from "./processTraceEvaluation.js";
export {
processTraceSpecificationSchema,
type ProcessTraceSpecification,
} from "./processTraceSpecification.js";
/** Compare two captures against an explicit finite trace language. */
export const compareProcessTraces = (
left: ProcessCapture,
@@ -1,5 +1,5 @@
import type { ProcessCapture } from "./processCapture.js";
import type { ProcessTraceSource } from "./processTraceSpecification.js";
import type { ProcessCapture } from "./processCaptureParsing.js";
import type { ProcessObservationSource } from "./processObservation.js";
export type ProcessComparisonDimension =
| "terminal"
@@ -8,9 +8,9 @@ export type ProcessComparisonDimension =
| "filesystem"
| "process";
/** Map declared trace sources to legacy process-comparison dimensions. */
/** Map declared trace sources to process-comparison dimensions. */
export const dimensionsForTraceSources = (
sources: ReadonlySet<ProcessTraceSource>,
sources: ReadonlySet<ProcessObservationSource>,
): ReadonlySet<ProcessComparisonDimension> => {
const dimensions = new Set<ProcessComparisonDimension>();
for (const source of sources) {
@@ -26,7 +26,7 @@ export const dimensionsForTraceSources = (
/** Whether a trace specification covers every observed source in a dimension. */
export const traceCoversObservedDimension = (
dimension: ProcessComparisonDimension,
sources: ReadonlySet<ProcessTraceSource>,
sources: ReadonlySet<ProcessObservationSource>,
left: ProcessCapture,
right: ProcessCapture,
): boolean => {
+12 -16
View File
@@ -1,30 +1,26 @@
import { z } from "zod";
import type { JsonValue } from "../jsonValue.js";
import type { ProcessCapture } from "./processCapture.js";
import type { ProcessCapture } from "./processCaptureParsing.js";
import { processSourceTruncated } from "./processCaptureCoverage.js";
import {
processObservationLocationSchema,
projectProcessObservation,
type ProcessObservationLocation,
type ProcessObservationSource,
} from "./processObservation.js";
import {
canonicalTraceJson,
comparableTracePayload,
processTraceCardinalityBounds,
type ProcessTraceSource,
type ProcessTraceSpecification,
} from "./processTraceSpecification.js";
const identifierSchema = z.string().regex(/^[A-Za-z][A-Za-z0-9._\x2d]{0,63}$/u);
export type ProcessTraceLocation = ProcessObservationLocation;
const locationSchema = processObservationLocationSchema;
const matchedEventSchema = z.strictObject({
event_id: identifierSchema,
location: locationSchema,
location: processObservationLocationSchema,
});
const sideResultShape = {
@@ -58,7 +54,7 @@ const diagnosticSchema = z.strictObject({
side: z.enum(["left", "right"]),
message: z.string(),
event_ids: z.array(identifierSchema),
locations: z.array(locationSchema),
locations: z.array(processObservationLocationSchema),
});
/** Structured verdict for one declared process trace language. */
@@ -73,13 +69,13 @@ export type ProcessTraceComparisonResult = z.infer<
>;
type TraceRecord = {
readonly source: ProcessTraceSource;
readonly source: ProcessObservationSource;
readonly payload: JsonValue;
readonly location: ProcessTraceLocation;
readonly location: ProcessObservationLocation;
};
const scopesFor = (
sources: ReadonlySet<ProcessTraceSource>,
sources: ReadonlySet<ProcessObservationSource>,
): ReadonlySet<string> =>
new Set(
[...sources].map((source) => {
@@ -109,7 +105,7 @@ type FailureInput = {
readonly kind: z.infer<typeof diagnosticSchema>["kind"];
readonly message: string;
readonly eventIds: readonly string[];
readonly locations: readonly ProcessTraceLocation[];
readonly locations: readonly ProcessObservationLocation[];
readonly rawTrace: z.infer<typeof matchedEventSchema>[];
};
@@ -155,12 +151,12 @@ const evaluateFiniteTrace = (
type MatchedTrace = {
readonly rawTrace: z.infer<typeof matchedEventSchema>[];
readonly locationsById: ReadonlyMap<string, ProcessTraceLocation[]>;
readonly locationsById: ReadonlyMap<string, ProcessObservationLocation[]>;
};
const collectRecords = (
capture: ProcessCapture,
sources: ReadonlySet<ProcessTraceSource>,
sources: ReadonlySet<ProcessObservationSource>,
): readonly TraceRecord[] => {
const records: TraceRecord[] = [];
for (const location of capture.event_journal) {
@@ -180,9 +176,9 @@ const matchRecords = (
specification: ProcessTraceSpecification,
): MatchedTrace | EvaluatedSide => {
const rawTrace: z.infer<typeof matchedEventSchema>[] = [];
const locationsById = new Map<string, ProcessTraceLocation[]>();
const locationsById = new Map<string, ProcessObservationLocation[]>();
const ignoredFieldsBySource = new Map<
ProcessTraceSource,
ProcessObservationSource,
readonly string[]
>();
const eventsByKey = new Map<
@@ -2,7 +2,7 @@ import { describe, expect, it } from "vitest";
import {
processTraceSpecificationSchema,
type ProcessTraceSpecification,
} from "./processTraceComparison.js";
} from "./processTraceSpecification.js";
const ready = { sequence: 0, at_ms: 10, data: "ready" };
const worker = {
@@ -12,10 +12,6 @@ import {
const identifierSchema = z.string().regex(IDENTIFIER_PATTERN);
/** Process observation families admitted by a declared trace specification. */
export const processTraceSourceSchema = processObservationSourceSchema;
export type ProcessTraceSource = ProcessObservationSource;
const cardinalitySchema = z.discriminatedUnion("kind", [
z.strictObject({ kind: z.literal("required") }),
z.strictObject({ kind: z.literal("optional") }),
@@ -37,7 +33,7 @@ const cardinalitySchema = z.discriminatedUnion("kind", [
const eventDeclarationSchema = z.strictObject({
id: identifierSchema,
source: processTraceSourceSchema,
source: processObservationSourceSchema,
exact: jsonValueSchema,
ignore_fields: z
.array(
@@ -9,16 +9,16 @@ import {
type EvidenceSubjectTarget,
} from "./evidence.js";
import { createEvidenceBundle, parseEvidenceBundle } from "./evidenceBundle.js";
import { compareFunctions } from "./functionComparison.js";
import { functionDossierSchema } from "./hopperValues.js";
import {
jsonObjectSchema,
jsonValueSchema,
type JsonValue,
} from "./jsonValue.js";
import { verifyReconstruction } from "./reconstructionVerification.js";
import { createResidualUnknown } from "./residualUnknown.js";
import { compareFunctions } from "./functionComparison.js";
import { verifyReconstruction } from "./reconstructionVerification.js";
const dossier = jsonValueSchema.parse(
functionDossierSchema.parse({
procedure: {
@@ -2,16 +2,14 @@ import { describe, expect, it } from "vitest";
import { createEvidence, type Evidence } from "./evidence.js";
import { createEvidenceBundle } from "./evidenceBundle.js";
import {
reconstructionVerificationResultSchema,
verifyReconstruction,
} from "./reconstructionVerification.js";
import { reconstructionVerificationResultSchema } from "./reconstructionVerificationSchemas.js";
import type { JsonValue } from "./jsonValue.js";
import { EMPTY_PROCESS_CAPTURE_EXAMPLE } from "./process/processCapture.fixture.js";
import { EMPTY_PROCESS_CAPTURE_EXAMPLE } from "./process/processCaptureExample.js";
import { reconstructionSpecificationSchema } from "./reconstructionVerificationSchemas.js";
import { ARTIFACT_COMPARISON_EXAMPLE } from "../contracts/artifactComparisonExample.js";
import { createResidualUnknown } from "./residualUnknown.js";
import { verifyReconstruction } from "./reconstructionVerification.js";
const environment = {
id: "fixture-linux",
platform: "linux",
+3 -9
View File
@@ -9,7 +9,7 @@ import { uniqueSorted } from "./canonicalOrdering.js";
import { comparisonSourceEvidenceSides } from "./comparisonSourceEvidence.js";
import { parseEvidence, type Evidence } from "./evidence.js";
import { parseEvidenceBundle } from "./evidenceBundle.js";
import { functionComparisonResultSchema } from "./functionComparison.js";
import { functionComparisonResultSchema } from "./functionComparisonSchemas.js";
import {
PROCESS_PROVIDER,
isProcessEvidenceProvider,
@@ -19,8 +19,8 @@ import {
deriveProcessComparisonStatus,
PROCESS_COMPARISON_DIMENSIONS,
processCaptureComparisonSchema,
parseProcessCapture,
} from "./process/processCapture.js";
} from "./process/processComparison.js";
import { parseProcessCapture } from "./process/processCaptureParsing.js";
import {
reconstructionClaimResultSchema,
reconstructionSpecificationSchema,
@@ -37,12 +37,6 @@ import {
} from "./reconstructionUnknowns.js";
import type { ResidualUnknown } from "./residualUnknown.js";
export {
reconstructionVerificationInputSchema,
reconstructionVerificationResultSchema,
} from "./reconstructionVerificationSchemas.js";
export type { ReconstructionVerificationResult } from "./reconstructionVerificationSchemas.js";
const providers = {
behavioral: {
operation: "compare_process_captures",
+2 -2
View File
@@ -7,7 +7,7 @@ import { artifactComparisonResultSchema } from "./artifactComparison.js";
import { uniqueSorted } from "./canonicalOrdering.js";
import { comparisonSourceEvidenceIds } from "./comparisonSourceEvidence.js";
import { evidenceSchema, parseEvidence, type Evidence } from "./evidence.js";
import { functionComparisonResultSchema } from "./functionComparison.js";
import { functionComparisonResultSchema } from "./functionComparisonSchemas.js";
import {
PROCESS_PROVIDER,
isProcessEvidenceProvider,
@@ -16,7 +16,7 @@ import type { JsonValue } from "./jsonValue.js";
import {
comparisonStatusSchema,
processCaptureComparisonSchema,
} from "./process/processCapture.js";
} from "./process/processComparison.js";
import { PROCESS_COMPARISON_DIMENSIONS } from "./process/processComparison.js";
import { prefixedDigestSchema } from "./../domain/digests.js";
+1 -1
View File
@@ -1,6 +1,6 @@
import { describe, expect, it } from "vitest";
import { webPageInspectionSchema } from "./browserObservation.js";
import { webPageInspectionSchema } from "./browserObservationSchemas.js";
import { analyzeJavaScriptStaticSource } from "./javascript/javascriptStaticAnalysis.js";
import { analyzeCapturedWebBundle } from "./webBundleAnalyzer.js";
import { webBundleAnalysisSchema } from "./webBundleAnalysis.js";
+1 -1
View File
@@ -1,4 +1,4 @@
import type { WebPageInspection } from "./browserObservation.js";
import type { WebPageInspection } from "./browserObservationSchemas.js";
import {
analyzeScript,
emptyAccumulator,
+1 -1
View File
@@ -2,7 +2,7 @@ import { parse } from "@babel/parser";
import * as t from "@babel/types";
import { sanitizeEndpointCandidate } from "./browserObservation.js";
import type { WebPageInspection } from "./browserObservation.js";
import type { WebPageInspection } from "./browserObservationSchemas.js";
import type { WebBundleAnalysis } from "./webBundleAnalysis.js";
import { traverseJavaScriptAst } from "./javascript/javascriptSemanticTraversal.js";
import { classifyParsedJavaScriptOpenReceivers } from "./javascript/javascriptSemanticAnalysis.js";
+1 -1
View File
@@ -1,4 +1,4 @@
import type { WebPageInspection } from "./browserObservation.js";
import type { WebPageInspection } from "./browserObservationSchemas.js";
import {
webBundleAnalysisSchema,
type WebBundleAnalysis,
+1 -7
View File
@@ -1,5 +1,5 @@
import { canonicalDigest } from "./comparisonSemantics.js";
import type { WebPageInspection } from "./browserObservation.js";
import type { WebPageInspection } from "./browserObservationSchemas.js";
import {
webCaptureDiffSchema,
type CompareWebCapturesInput,
@@ -9,12 +9,6 @@ import {
} from "./webCaptureDiffSchemas.js";
import type { WebMcpDiscovery } from "./webMcpDiscovery.js";
export {
compareWebCapturesInputSchema,
webCaptureDiffSchema,
} from "./webCaptureDiffSchemas.js";
export type { CompareWebCapturesInput, WebCaptureDiff };
type Dimension = WebCaptureDimension;
type Change = WebCaptureChange;
+1 -1
View File
@@ -1,7 +1,7 @@
import { z } from "zod";
import { emptyArraySchema } from "./emptyArraySchema.js";
import { webPageInspectionSchema } from "./browserObservation.js";
import { webPageInspectionSchema } from "./browserObservationSchemas.js";
import { webMcpDiscoverySchema } from "./webMcpDiscovery.js";
/** One normalized passive page snapshot accepted by capture comparison. */
+2 -2
View File
@@ -1,11 +1,11 @@
import { z } from "zod";
import {
webRuntimeBrowserSchema,
webRuntimeLocationSchema,
webRuntimeScopeSchema,
webRuntimeSourceSchema,
webRuntimeTargetSchema,
} from "./webRuntime.js";
import { browserVersionSchema } from "./browserObservationSchemas.js";
/** Inspect listeners registered directly on the first main-document CSS match. */
export const inspectWebEventListenersInputSchema = webRuntimeScopeSchema.extend(
@@ -19,7 +19,7 @@ export type InspectWebEventListenersInput = z.infer<
/** A listener declaration and its source location do not establish that it ran. */
export const webEventListenersSchema = z.object({
browser: webRuntimeBrowserSchema,
browser: browserVersionSchema,
target: webRuntimeTargetSchema,
inspected_at: z.iso.datetime(),
selected_node: z.object({
+2 -2
View File
@@ -1,12 +1,12 @@
import { z } from "zod";
import { jsonObjectSchema } from "./jsonValue.js";
import {
webRuntimeBrowserSchema,
webRuntimeLocationSchema,
webRuntimeScopeSchema,
webRuntimeSourceSchema,
webRuntimeTargetSchema,
} from "./webRuntime.js";
import { browserVersionSchema } from "./browserObservationSchemas.js";
/** Explicit instrumentation request for one finite, externally driven execution window. */
export const observeWebExecutionInputSchema = webRuntimeScopeSchema.extend({
@@ -30,7 +30,7 @@ const functionSchema = z.object({
/** Precise V8 ranges retain their nested structure and counts without summing them. */
export const webExecutionSchema = z.object({
browser: webRuntimeBrowserSchema,
browser: browserVersionSchema,
target: webRuntimeTargetSchema,
window: z.object({
armed_at: z.iso.datetime(),
-3
View File
@@ -86,9 +86,6 @@ export const webRuntimeTargetSchema = z.object({
loader_id: z.string().nullable(),
});
/** Producer product identity is observed separately from the unknown host platform. */
export const webRuntimeBrowserSchema = browserVersionSchema;
/** Complete runtime evidence has explicit byte budgets rather than silent item truncation. */
export const WEB_RUNTIME_LIMITS = {
protocolBytes: 64 * 1024 * 1024,