chore: merge main and resolve PR #902 conflicts

This commit is contained in:
morluto
2026-10-07 17:28:56 +08:00
329 changed files with 7481 additions and 690 deletions
+99
View File
@@ -130,7 +130,106 @@ describe("call path reconstruction", () => {
"0x3000",
]);
});
});
describe("call path topology and capacity", () => {
it("retains every shortest path through merging branches and cycles", () => {
const result = run([
observe("0x1000", ["0x3000", "0x2000", "0x1000"]),
observe("0x2000", ["0x3000", "0x5000", "0x6000"]),
observe("0x3000", ["0x6000", "0x5000"]),
observe("0x5000", ["0x4000", "0x1000"]),
observe("0x6000", ["0x4000"]),
]);
expect(
result.paths.map(({ nodes }) => nodes.map(({ address }) => address)),
).toEqual([
["0x1000", "0x2000", "0x5000", "0x4000"],
["0x1000", "0x2000", "0x6000", "0x4000"],
["0x1000", "0x3000", "0x5000", "0x4000"],
["0x1000", "0x3000", "0x6000", "0x4000"],
]);
});
it("keeps uncovered dead ends in search limitations when a path is found", () => {
const result = run([
observe("0x1000", ["0x2000", "0x5000"]),
observe("0x2000", ["0x4000"]),
]);
expect(result).toMatchObject({
status: "found",
shortest_hops: 2,
search_scope: { exhaustive: false },
explored: { nodes: 4, edges: 3, depth_reached: 2 },
});
expect(result.limitations).toContain(
"No analyze_function Evidence covers reachable function 0x5000",
);
});
it("returns a zero-hop path when start and goal are the same function", () => {
const result = run([observe("0x1000", ["0x2000"])], {
goal: { address: "0x1000" },
});
expect(result).toMatchObject({
status: "found",
shortest_hops: 0,
search_scope: { exhaustive: true },
});
expect(
result.paths.map(({ nodes }) => nodes.map(({ address }) => address)),
).toEqual([["0x1000"]]);
});
it("reconstructs a deep function chain without exhausting the call stack", () => {
const length = 20_000;
const address = (index: number) => `0x${index.toString(16)}`;
const functions = Array.from({ length }, (_, index) =>
observe(address(index + 1), [address(index + 2)]),
);
const result = run(functions, {
start: { address: address(1) },
goal: { address: address(length + 1) },
});
expect(result).toMatchObject({ status: "found", shortest_hops: length });
expect(result.paths).toHaveLength(1);
expect(result.paths[0]?.nodes).toHaveLength(length + 1);
expect(result.paths[0]?.edges).toHaveLength(length);
expect(result.paths[0]?.nodes.at(-1)?.address).toBe(address(length + 1));
});
it("returns the sole shortest path alongside a deep merging dead-end graph", () => {
const stages = 28;
const address = (index: number) => `0x${index.toString(16)}`;
const functions = [observe("0x1", ["0x2", "0x1000"])];
for (let index = 2; index < stages + 2; index += 1)
functions.push(observe(address(index), [address(index + 1)]));
for (let index = 0; index < stages; index += 1) {
const base = 0x1000 + index * 2;
const next = [address(base + 2), address(base + 3)];
functions.push(observe(address(base), next));
functions.push(observe(address(base + 1), next));
}
functions.push(observe(address(0x1000 + stages * 2), []));
functions.push(observe(address(0x1001 + stages * 2), []));
const result = run(functions, {
start: { address: "0x1" },
goal: { address: address(stages + 2) },
});
expect(result).toMatchObject({
status: "found",
shortest_hops: stages + 1,
search_scope: { exhaustive: true },
});
expect(
result.paths.map(({ nodes }) => nodes.map(({ address }) => address)),
).toEqual([
Array.from({ length: stages + 2 }, (_, index) => address(index + 1)),
]);
});
});
describe("call path evidence admission", () => {
it("normalizes hex addresses and rejects duplicates and mixed providers", () => {
expect(
run([observe("0x001000", [])], {
+64 -52
View File
@@ -17,15 +17,18 @@ export type { CallPathInput, CallPathResult };
/** Minimal directed caller-to-callee adjacency for call-path search. */
class CallGraph {
private readonly successors = new Map<string, Set<string>>();
private readonly predecessors = new Map<string, Set<string>>();
mergeNode(node: string): void {
if (!this.successors.has(node)) this.successors.set(node, new Set());
if (!this.predecessors.has(node)) this.predecessors.set(node, new Set());
}
mergeDirectedEdge(source: string, target: string): void {
this.mergeNode(source);
this.mergeNode(target);
this.successors.get(source)?.add(target);
this.predecessors.get(target)?.add(source);
}
hasNode(node: string): boolean {
@@ -39,29 +42,31 @@ class CallGraph {
outNeighbors(node: string): string[] {
return [...(this.successors.get(node) ?? [])];
}
inNeighbors(node: string): string[] {
return [...(this.predecessors.get(node) ?? [])];
}
}
/** Breadth-first shortest depth from start to goal, or null when unreachable. */
const shortestPathDepth = (
/** Shortest remaining distance for every node that can reach the goal. */
const distancesToGoal = (
graph: CallGraph,
start: string,
goal: string,
): number | null => {
if (start === goal) return 0;
const depth = new Map<string, number>([[start, 0]]);
const queue = [start];
): ReadonlyMap<string, number> => {
if (!graph.hasNode(goal)) return new Map();
const depth = new Map<string, number>([[goal, 0]]);
const queue = [goal];
for (let index = 0; index < queue.length; index += 1) {
const node = queue[index] ?? "";
const next = (depth.get(node) ?? 0) + 1;
for (const neighbor of graph.outNeighbors(node)) {
if (neighbor === goal) return next;
for (const neighbor of graph.inNeighbors(node)) {
if (!depth.has(neighbor)) {
depth.set(neighbor, next);
queue.push(neighbor);
}
}
}
return null;
return depth;
};
interface SearchState {
@@ -82,10 +87,8 @@ export const buildCallPath = (input: CallPathInput): CallPathResult => {
start: parsed.start.address,
goal: parsed.goal.address,
});
const shortestDepth =
graph.hasNode(parsed.start.address) && graph.hasNode(parsed.goal.address)
? shortestPathDepth(graph, parsed.start.address, parsed.goal.address)
: null;
const goalDistances = distancesToGoal(graph, parsed.goal.address);
const shortestDepth = goalDistances.get(parsed.start.address) ?? null;
const paths =
shortestDepth === null
? []
@@ -93,7 +96,7 @@ export const buildCallPath = (input: CallPathInput): CallPathResult => {
graph,
start: parsed.start.address,
goal: parsed.goal.address,
shortestDepth,
goalDistances,
}).paths.map((path) => citePath(path, snapshots));
const shortestHops = paths[0]?.hops;
const found = shortestHops !== undefined;
@@ -135,7 +138,10 @@ const summarizeSearch = (
(count, node) => count + (graph.hasNode(node) ? graph.outDegree(node) : 0),
0,
),
depth_reached: Math.max(0, ...reached.values()),
depth_reached: [...reached.values()].reduce(
(maximum, depth) => Math.max(maximum, depth),
0,
),
});
const prepareCallGraph = (input: CallPathInput) => {
@@ -261,58 +267,64 @@ interface EnumerationInput {
readonly graph: CallGraph;
readonly start: string;
readonly goal: string;
readonly shortestDepth: number;
readonly goalDistances: ReadonlyMap<string, number>;
}
const enumeratePaths = ({
graph,
start,
goal,
shortestDepth,
goalDistances,
}: EnumerationInput): {
readonly paths: string[][];
} => {
const output: string[][] = [];
const state: EnumerationState = {
graph,
goal,
path: [start],
visited: new Set([start]),
output,
const path = [start];
const neighbors = new Map<string, readonly string[]>();
const frame = (node: string): EnumerationFrame => {
let candidates = neighbors.get(node);
if (candidates === undefined) {
const distance = goalDistances.get(node);
candidates = graph
.outNeighbors(node)
.filter(
(neighbor) =>
distance !== undefined &&
goalDistances.get(neighbor) === distance - 1,
)
.sort((left, right) => left.localeCompare(right));
neighbors.set(node, candidates);
}
return { neighbors: candidates, nextIndex: 0 };
};
enumerateAtDepth(state, shortestDepth);
const pending = [frame(start)];
while (pending.length > 0) {
const current = pending.at(-1);
if (current === undefined) break;
if (path.at(-1) === goal) {
output.push([...path]);
pending.pop();
path.pop();
continue;
}
const neighbor = current.neighbors[current.nextIndex];
if (neighbor === undefined) {
pending.pop();
path.pop();
continue;
}
current.nextIndex += 1;
path.push(neighbor);
pending.push(frame(neighbor));
}
return { paths: output };
};
interface EnumerationState {
readonly graph: CallGraph;
readonly goal: string;
readonly path: string[];
readonly visited: Set<string>;
readonly output: string[][];
interface EnumerationFrame {
readonly neighbors: readonly string[];
nextIndex: number;
}
const enumerateAtDepth = (state: EnumerationState, remaining: number): void => {
const { graph, goal, path, visited, output } = state;
const current = path.at(-1);
if (current === undefined) return;
if (remaining === 0) {
if (current === goal) output.push([...path]);
return;
}
if (current === goal) return;
for (const neighbor of graph
.outNeighbors(current)
.sort((left, right) => left.localeCompare(right))) {
if (visited.has(neighbor)) continue;
visited.add(neighbor);
path.push(neighbor);
enumerateAtDepth(state, remaining - 1);
path.pop();
visited.delete(neighbor);
}
};
const citePath = (
addresses: readonly string[],
snapshots: ReadonlyMap<string, FunctionSnapshot>,
@@ -1,10 +1,10 @@
import { z } from "zod";
import { browserCompletenessSchema } from "./browserCompleteness.js";
import { browserEndpointSchema } from "./browserObservation.js";
import { browserVersionSchema } from "./browserObservationSchemas.js";
import { webTextArtifactSchema } from "./webContentArtifact.js";
import { prefixedDigestSchema } from "./../domain/digests.js";
import { browserCompletenessSchema } from "../browserCompleteness.js";
import { browserEndpointSchema } from "../browserObservation.js";
import { browserVersionSchema } from "../browserObservationSchemas.js";
import { webTextArtifactSchema } from "../webContentArtifact.js";
import { prefixedDigestSchema } from "../digests.js";
const approvedElectronInput = {
cdp_endpoint: browserEndpointSchema,
@@ -15,7 +15,7 @@ import {
electronStaticValue,
objectProperty,
} from "./electronStaticAnalysisValues.js";
import { compareCodePoints } from "./canonicalOrdering.js";
import { compareCodePoints } from "../canonicalOrdering.js";
import { addLocatedFinding } from "./javascriptStaticAnalysisFindings.js";
import {
argumentNode,
@@ -1,7 +1,7 @@
import * as t from "@babel/types";
import { compareCodePoints } from "./canonicalOrdering.js";
import { stripQueryAndFragment } from "./artifactPathSyntax.js";
import { compareCodePoints } from "../canonicalOrdering.js";
import { stripQueryAndFragment } from "../artifactPathSyntax.js";
import type { ElectronNativeAddonBindingFinding } from "./electronStaticAnalysisTypes.js";
import { addLocatedFinding } from "./javascriptStaticAnalysisFindings.js";
import {
@@ -1,6 +1,6 @@
import * as t from "@babel/types";
import { compareCodePoints } from "./canonicalOrdering.js";
import { compareCodePoints } from "../canonicalOrdering.js";
import type { ElectronStaticValue } from "./electronStaticAnalysisTypes.js";
import { semanticStaticPropertyName } from "./javascriptAstValues.js";
import { sourceSlice } from "./javascriptStaticAnalysisHelpers.js";
@@ -3,11 +3,11 @@ import { z } from "zod";
import {
artifactIntegrityPolicySchema,
integrityContradictionSchema,
} from "./artifactGraph.js";
} from "../artifactGraph.js";
import { javascriptApplicationGraphSchema } from "./javascriptApplicationGraph.js";
import { javaScriptSemanticGraphSchema } from "./javascriptSemanticGraph.js";
import { digestSchema } from "./../domain/digests.js";
import { prefixedDigestSchema } from "./../domain/digests.js";
import { digestSchema } from "../digests.js";
import { prefixedDigestSchema } from "../digests.js";
const countSchema = z.number().int().min(0);
@@ -7,7 +7,7 @@ import {
type ApplicationNode,
type JavaScriptApplicationGraph,
} from "./javascriptApplicationGraph.js";
import { compareCodePoints, uniqueSorted } from "./canonicalOrdering.js";
import { compareCodePoints, uniqueSorted } from "../canonicalOrdering.js";
import type { ApplicationVersionComparisonItem } from "./javascriptApplicationVersionComparisonSchemas.js";
interface ChangeGraphInput {
@@ -1,6 +1,6 @@
import { z } from "zod";
import { digestSchema } from "./../domain/digests.js";
import { prefixedDigestSchema } from "./../domain/digests.js";
import { digestSchema } from "../digests.js";
import { prefixedDigestSchema } from "../digests.js";
const boundedTextSchema = z.string().min(1);
const boundedKeySchema = z.string().min(1);
@@ -1,6 +1,6 @@
import { z } from "zod";
import { canonicalDigest, canonicalJson } from "./comparisonSemantics.js";
import { compareCodePoints, uniqueSorted } from "./canonicalOrdering.js";
import { canonicalDigest, canonicalJson } from "../comparisonSemantics.js";
import { compareCodePoints, uniqueSorted } from "../canonicalOrdering.js";
import type {
ApplicationGraphEvidence,
@@ -5,8 +5,8 @@ import {
applicationGraphEvidenceSchema,
applicationNodeIdentitySchema,
} from "./javascriptApplicationEvidenceSchemas.js";
import { jsonValueSchema } from "./jsonValue.js";
import { prefixedDigestSchema } from "./../domain/digests.js";
import { jsonValueSchema } from "../jsonValue.js";
import { prefixedDigestSchema } from "../digests.js";
const boundedTextSchema = z.string().min(1);
@@ -1,6 +1,6 @@
import { canonicalDigest } from "./comparisonSemantics.js";
import { uniqueSorted } from "./canonicalOrdering.js";
import type { Evidence } from "./evidence.js";
import { canonicalDigest } from "../comparisonSemantics.js";
import { uniqueSorted } from "../canonicalOrdering.js";
import type { Evidence } from "../evidence.js";
import { buildJavaScriptApplicationChangeGraph } from "./javascriptApplicationChangeGraph.js";
import {
applicationVersionComparisonResultSchema,
@@ -1,10 +1,10 @@
import { z } from "zod";
import { emptyArraySchema } from "./emptyArraySchema.js";
import { evidenceSchema } from "./evidence.js";
import { emptyArraySchema } from "../emptyArraySchema.js";
import { evidenceSchema } from "../evidence.js";
import { javascriptApplicationGraphSchema } from "./javascriptApplicationGraph.js";
import { JAVASCRIPT_APPLICATION_NODE_KINDS } from "./javascriptApplicationGraphSchemas.js";
import { prefixedDigestSchema } from "./../domain/digests.js";
import { prefixedDigestSchema } from "../digests.js";
const evidenceIdSchema = prefixedDigestSchema("ev");
const nodeIdSchema = prefixedDigestSchema("jag_node");
@@ -2,9 +2,9 @@ import {
absenceClaimable,
canonicalDigest,
canonicalJson,
} from "./comparisonSemantics.js";
import { compareCodePoints } from "./canonicalOrdering.js";
import type { Evidence } from "./evidence.js";
} from "../comparisonSemantics.js";
import { compareCodePoints } from "../canonicalOrdering.js";
import type { Evidence } from "../evidence.js";
import {
type ApplicationEdge,
type ApplicationNode,
@@ -1,6 +1,6 @@
import { compareCodePoints } from "./canonicalOrdering.js";
import { compareCodePoints } from "../canonicalOrdering.js";
import type { ApplicationNode } from "./javascriptApplicationGraph.js";
import type { JsonValue } from "./jsonValue.js";
import type { JsonValue } from "../jsonValue.js";
/** One deterministic one-to-one match between two graph versions. */
type ApplicationVersionPairMatch =
@@ -1,7 +1,7 @@
import { parse } from "@babel/parser";
import { describe, expect, it } from "vitest";
import { fingerprintJavaScriptAst } from "../../src/domain/javascriptAstFingerprint.js";
import { fingerprintJavaScriptAst } from "./javascriptAstFingerprint.js";
describe("JavaScript AST fingerprints", () => {
it("includes complete literal values in the fingerprint", () => {
@@ -2,7 +2,7 @@ import { createHash } from "node:crypto";
import * as t from "@babel/types";
import { compareCodePoints } from "./canonicalOrdering.js";
import { compareCodePoints } from "../canonicalOrdering.js";
import { propertyName } from "./javascriptAstValues.js";
import { stringValue } from "./javascriptStaticAnalysisHelpers.js";
@@ -1,4 +1,4 @@
import { uniqueSorted } from "./canonicalOrdering.js";
import { uniqueSorted } from "../canonicalOrdering.js";
import { digestExportShapeValue } from "./javascriptExportShapeComparisonIdentity.js";
import {
javaScriptExportShapeComparisonResultSchema,
@@ -1,7 +1,7 @@
import { z } from "zod";
import { evidenceSchema } from "./evidence.js";
import { prefixedDigestSchema } from "./../domain/digests.js";
import { evidenceSchema } from "../evidence.js";
import { prefixedDigestSchema } from "../digests.js";
const evidenceIdSchema = prefixedDigestSchema("ev");
const graphIdSchema = prefixedDigestSchema("jag");
@@ -7,7 +7,7 @@ import {
type JavaScriptExportShapeComparisonResult,
type ProjectedExportReturnShapes,
} from "./javascriptExportShapeComparisonSchemas.js";
import { compareCodePoints } from "./canonicalOrdering.js";
import { compareCodePoints } from "../canonicalOrdering.js";
type Shape = ProjectedExportReturnShapes["static_return_shapes"][number];
type SelectorResult = JavaScriptExportShapeComparisonResult["left"];
@@ -7,7 +7,7 @@ import type {
JavaScriptExportShapeComparisonResult,
ProjectedExportReturnShapes,
} from "./javascriptExportShapeComparisonSchemas.js";
import { compareCodePoints, uniqueSorted } from "./canonicalOrdering.js";
import { compareCodePoints, uniqueSorted } from "../canonicalOrdering.js";
import type { SelectedJavaScriptExport } from "./javascriptExportShapeSelection.js";
type Primitive = string | number | boolean | null;
@@ -13,7 +13,7 @@ import { findApplicationFeatureSeeds } from "./javascriptFeatureSeed.js";
import { traceApplicationFeature } from "./javascriptFeatureTrace.js";
import type { ApplicationFeatureSeed } from "./javascriptFeatureTraceSchemas.js";
import { analyzeJavaScriptStaticSource } from "./javascriptStaticAnalysis.js";
import type { JsonValue } from "./jsonValue.js";
import type { JsonValue } from "../jsonValue.js";
const memberFields = [
{ kind: "api", nodeKind: "context-bridge-api", field: "members" },
@@ -1,7 +1,7 @@
import { describe, expect, it } from "vitest";
import { buildSyntheticJavaScriptApplicationGraph } from "./javascriptApplicationGraph.fixture.js";
import type { JsonValue } from "./jsonValue.js";
import type { JsonValue } from "../jsonValue.js";
import { findApplicationFeatureSeeds } from "./javascriptFeatureSeed.js";
describe("application feature seed property matching", () => {
@@ -1,10 +1,10 @@
import { compareCodePoints } from "./canonicalOrdering.js";
import { compareCodePoints } from "../canonicalOrdering.js";
import type { ApplicationNode } from "./javascriptApplicationGraph.js";
import {
featureSeedMatchMode,
type ApplicationFeatureSeed,
} from "./javascriptFeatureTraceSchemas.js";
import type { JsonValue } from "./jsonValue.js";
import type { JsonValue } from "../jsonValue.js";
/** One explicit field that matched a feature seed. */
export interface ApplicationFeatureSeedMatch {
@@ -1,6 +1,6 @@
import { canonicalDigest } from "./comparisonSemantics.js";
import { compareCodePoints, uniqueSorted } from "./canonicalOrdering.js";
import type { Evidence } from "./evidence.js";
import { canonicalDigest } from "../comparisonSemantics.js";
import { compareCodePoints, uniqueSorted } from "../canonicalOrdering.js";
import type { Evidence } from "../evidence.js";
import {
createJavaScriptApplicationGraph,
type ApplicationEdge,
@@ -1,9 +1,9 @@
import { z } from "zod";
import { evidenceSchema, providerSchema } from "./evidence.js";
import { evidenceSchema, providerSchema } from "../evidence.js";
import { javascriptApplicationGraphSchema } from "./javascriptApplicationGraph.js";
import { digestSchema } from "./../domain/digests.js";
import { prefixedDigestSchema } from "./../domain/digests.js";
import { digestSchema } from "../digests.js";
import { prefixedDigestSchema } from "../digests.js";
const evidenceIdSchema = prefixedDigestSchema("ev");
const nodeIdSchema = prefixedDigestSchema("jag_node");
@@ -3,7 +3,7 @@ import {
type ApplicationNode,
type JavaScriptApplicationGraph,
} from "./javascriptApplicationGraph.js";
import { compareCodePoints } from "./canonicalOrdering.js";
import { compareCodePoints } from "../canonicalOrdering.js";
interface AdjacencyEntry {
readonly edge: ApplicationEdge;
@@ -93,5 +93,7 @@ const addAdjacency = (
nodeId: string,
entry: AdjacencyEntry,
): void => {
adjacency.set(nodeId, [...(adjacency.get(nodeId) ?? []), entry]);
const entries = adjacency.get(nodeId);
if (entries === undefined) adjacency.set(nodeId, [entry]);
else entries.push(entry);
};
@@ -1,5 +1,5 @@
import { compareCodePoints } from "./canonicalOrdering.js";
import type { Evidence } from "./evidence.js";
import { compareCodePoints } from "../canonicalOrdering.js";
import type { Evidence } from "../evidence.js";
import {
type ApplicationEdge,
type ApplicationNode,
@@ -1,5 +1,5 @@
import { z } from "zod";
import { digestSchema } from "./digests.js";
import { digestSchema } from "../digests.js";
import { analyzeJavaScriptApplicationInputSchema } from "./javascriptApplicationAnalysis.js";
/** Recover derived readable modules from one explicitly selected local script. */
@@ -1,5 +1,5 @@
import { type ApplicationNode } from "./javascriptApplicationGraph.js";
import { uniqueSorted } from "./canonicalOrdering.js";
import { uniqueSorted } from "../canonicalOrdering.js";
import type { ParsedStaticLayer } from "./javascriptRuntimeReconciliationParsing.js";
import type {
JavaScriptRuntimeReconciliationItem,
@@ -1,7 +1,7 @@
import { z } from "zod";
import { browserEndpointSchema } from "./browserObservation.js";
import { prefixedDigestSchema } from "./../domain/digests.js";
import { browserEndpointSchema } from "../browserObservation.js";
import { prefixedDigestSchema } from "../digests.js";
const observationTextSchema = z.string().min(1);
@@ -1,18 +1,18 @@
import { isAbsolute } from "node:path";
import { canonicalDigest } from "./comparisonSemantics.js";
import { isPathWithinRoot } from "./localPath.js";
import { canonicalDigest } from "../comparisonSemantics.js";
import { isPathWithinRoot } from "../localPath.js";
import { z } from "zod";
import {
classifyBrowserCompleteness,
type BrowserCompleteness,
} from "./browserCompleteness.js";
} from "../browserCompleteness.js";
import {
electronActiveObservationResultSchema,
type ElectronActiveObservationResult,
} from "./electronActiveObservation.js";
import type { Evidence } from "./evidence.js";
import type { Evidence } from "../evidence.js";
import type { ParsedRuntimeCapture } from "./javascriptRuntimeReconciliationParsing.js";
/** Parse active Electron Evidence as a bounded, target-only runtime capture. */
@@ -9,7 +9,7 @@ import type {
ParsedRuntimeCapture,
ParsedStaticLayer,
} from "./javascriptRuntimeReconciliationParsing.js";
import { compareCodePoints, uniqueSorted } from "./canonicalOrdering.js";
import { compareCodePoints, uniqueSorted } from "../canonicalOrdering.js";
import type { RuntimeProjection } from "./javascriptRuntimeReconciliationRuntime.js";
interface ReconciledGraphInput {
@@ -3,9 +3,9 @@ import {
type ApplicationEdge,
type ApplicationGraphEvidence,
} from "./javascriptApplicationGraph.js";
import { canonicalDigest } from "./comparisonSemantics.js";
import { canonicalDigest } from "../comparisonSemantics.js";
import type { ParsedStaticLayer } from "./javascriptRuntimeReconciliationParsing.js";
import { compareCodePoints } from "./canonicalOrdering.js";
import { compareCodePoints } from "../canonicalOrdering.js";
import type { JavaScriptRuntimeReconciliationItem } from "./javascriptRuntimeReconciliationSchemas.js";
import type { RuntimeReconciliationEntity } from "./javascriptRuntimeReconciliationRuntime.js";
import {
@@ -5,11 +5,11 @@ import {
browserEndpointSchema,
webPageInspectionSchema,
type WebPageInspection,
} from "./browserObservation.js";
} from "../browserObservation.js";
import {
classifyBrowserCompleteness,
type BrowserCompleteness,
} from "./browserCompleteness.js";
} from "../browserCompleteness.js";
import {
electronPageInspectionSchema,
type ElectronPageInspection,
@@ -20,9 +20,9 @@ import {
type JavaScriptRuntimeObservation,
type JavaScriptRuntimeLocation,
} from "./javascriptRuntimeObservation.js";
import { canonicalDigest } from "./comparisonSemantics.js";
import { compareCodePoints } from "./canonicalOrdering.js";
import { parseEvidence, type Evidence } from "./evidence.js";
import { canonicalDigest } from "../comparisonSemantics.js";
import { compareCodePoints } from "../canonicalOrdering.js";
import { parseEvidence, type Evidence } from "../evidence.js";
import {
javascriptApplicationAnalysisResultSchema,
type JavaScriptApplicationAnalysisResult,
@@ -1,6 +1,6 @@
import { type JavaScriptApplicationGraph } from "./javascriptApplicationGraph.js";
import { canonicalDigest } from "./comparisonSemantics.js";
import { uniqueSorted } from "./canonicalOrdering.js";
import { canonicalDigest } from "../comparisonSemantics.js";
import { uniqueSorted } from "../canonicalOrdering.js";
import type { StaticLoadStateProjection } from "./javascriptRuntimeLoadState.js";
import type { RuntimeMatchingProjection } from "./javascriptRuntimeReconciliationMatching.js";
import type {
@@ -1,4 +1,4 @@
import type { JsonValue } from "./jsonValue.js";
import type { JsonValue } from "../jsonValue.js";
import {
createJavaScriptApplicationEdge,
createJavaScriptApplicationNode,
@@ -1,11 +1,11 @@
import { z } from "zod";
import { compareCodePoints } from "./canonicalOrdering.js";
import { evidenceSchema } from "./evidence.js";
import { compareCodePoints } from "../canonicalOrdering.js";
import { evidenceSchema } from "../evidence.js";
import { javascriptRuntimeUnresolvedLocationSchema } from "./javascriptRuntimeObservation.js";
import { javascriptApplicationGraphSchema } from "./javascriptApplicationGraph.js";
import { digestSchema } from "./../domain/digests.js";
import { prefixedDigestSchema } from "./../domain/digests.js";
import { digestSchema } from "../digests.js";
import { prefixedDigestSchema } from "../digests.js";
const evidenceIdSchema = prefixedDigestSchema("ev");
const nodeIdSchema = prefixedDigestSchema("jag_node");
@@ -4,7 +4,7 @@ import {
type ApplicationNode,
type JavaScriptApplicationGraph,
} from "./javascriptApplicationGraph.js";
import { compareCodePoints, uniqueSorted } from "./canonicalOrdering.js";
import { compareCodePoints, uniqueSorted } from "../canonicalOrdering.js";
import type { ParsedStaticLayer } from "./javascriptRuntimeReconciliationParsing.js";
import type { RuntimeReconciliationEntity } from "./javascriptRuntimeReconciliationRuntime.js";
@@ -4,7 +4,7 @@ import type {
JavaScriptSemanticArgumentFlow,
JavaScriptSemanticCallable,
} from "./javascriptSemanticIr.js";
import { compareCodePoints } from "./canonicalOrdering.js";
import { compareCodePoints } from "../canonicalOrdering.js";
import { semanticCallableIdForNode } from "./javascriptSemanticProjection.js";
import {
resolveSemanticBindingState,
@@ -16,7 +16,7 @@ import {
type JavaScriptSemanticAnalysisState,
type JavaScriptSemanticBindingState,
} from "./javascriptSemanticState.js";
import { compareCodePoints } from "./canonicalOrdering.js";
import { compareCodePoints } from "../canonicalOrdering.js";
import { traverseJavaScriptAst } from "./javascriptSemanticTraversal.js";
import { range } from "./javascriptStaticAnalysisHelpers.js";
import {
@@ -8,7 +8,7 @@ import type {
JavaScriptSemanticConfigurationOperation,
JavaScriptSemanticRequestOperation,
} from "./javascriptSemanticIr.js";
import { compareCodePoints } from "./canonicalOrdering.js";
import { compareCodePoints } from "../canonicalOrdering.js";
import {
semanticStaticPropertyKey,
semanticStaticPropertyName,
@@ -2,7 +2,7 @@ import { createHash } from "node:crypto";
import * as t from "@babel/types";
import { compareCodePoints } from "./canonicalOrdering.js";
import { compareCodePoints } from "../canonicalOrdering.js";
import type { JavaScriptSemanticCallAnalysis } from "./javascriptSemanticCalls.js";
import type {
JavaScriptSemanticCallable,
@@ -1,7 +1,7 @@
import { z } from "zod";
import { canonicalDigest, canonicalJson } from "./comparisonSemantics.js";
import { compareCodePoints, uniqueSorted } from "./canonicalOrdering.js";
import { canonicalDigest, canonicalJson } from "../comparisonSemantics.js";
import { compareCodePoints, uniqueSorted } from "../canonicalOrdering.js";
import type { ApplicationGraphEvidence } from "./javascriptApplicationEvidenceSchemas.js";
import {
JAVASCRIPT_SEMANTIC_RELATION_FAMILIES,
@@ -1,9 +1,9 @@
import { z } from "zod";
import { applicationGraphEvidenceSchema } from "./javascriptApplicationEvidenceSchemas.js";
import { jsonValueSchema } from "./jsonValue.js";
import { digestSchema } from "./../domain/digests.js";
import { prefixedDigestSchema } from "./../domain/digests.js";
import { jsonValueSchema } from "../jsonValue.js";
import { digestSchema } from "../digests.js";
import { prefixedDigestSchema } from "../digests.js";
const boundedTextSchema = z.string().min(1);
const semanticNodeIdSchema = prefixedDigestSchema("jsrg_node");
@@ -17,7 +17,7 @@ import {
type JavaScriptSemanticGraphRelation,
} from "./javascriptSemanticGraph.js";
import { queryJavaScriptSemanticGraph } from "./javascriptSemanticQuery.js";
import type { JsonValue } from "./jsonValue.js";
import type { JsonValue } from "../jsonValue.js";
const SHA = "a".repeat(64);
const JAG_ID = `jag_${"b".repeat(64)}`;
@@ -4,7 +4,7 @@ import type {
JavaScriptSemanticPrimitive,
JavaScriptSemanticValue,
} from "./javascriptSemanticIr.js";
import { compareCodePoints } from "./canonicalOrdering.js";
import { compareCodePoints } from "../canonicalOrdering.js";
import { semanticPrimitiveKey } from "./javascriptSemanticProvenance.js";
/** Normalize one bounded collection of possible primitive values. */
@@ -14,7 +14,7 @@ import {
type JavaScriptSemanticAnalysisState,
type JavaScriptSemanticScopeState,
} from "./javascriptSemanticState.js";
import { compareCodePoints } from "./canonicalOrdering.js";
import { compareCodePoints } from "../canonicalOrdering.js";
import { traverseJavaScriptAst } from "./javascriptSemanticTraversal.js";
import {
evaluateSemanticBinding,
@@ -13,7 +13,7 @@ import {
semanticResolutionBlocked,
type JavaScriptSemanticAnalysisState,
} from "./javascriptSemanticState.js";
import { compareCodePoints } from "./canonicalOrdering.js";
import { compareCodePoints } from "../canonicalOrdering.js";
import { traverseJavaScriptAst } from "./javascriptSemanticTraversal.js";
import { range, sourceRangesEqual } from "./javascriptStaticAnalysisHelpers.js";
import {
@@ -3,7 +3,7 @@ import type {
JavaScriptModuleOrigin,
JavaScriptSemanticPrimitive,
} from "./javascriptSemanticIr.js";
import { compareCodePoints } from "./canonicalOrdering.js";
import { compareCodePoints } from "../canonicalOrdering.js";
/** Construct exact local provenance without inventing module origins. */
export const semanticLocalProvenance = (): JavaScriptBindingProvenance => ({
@@ -3,7 +3,7 @@ import type {
JavaScriptSemanticGraphNode,
JavaScriptSemanticGraphRelation,
} from "./javascriptSemanticGraph.js";
import { compareCodePoints } from "./canonicalOrdering.js";
import { compareCodePoints } from "../canonicalOrdering.js";
import type { JavaScriptSemanticGraphUnknown } from "./javascriptSemanticGraphSchemas.js";
import { isJavaScriptSemanticOwnershipRelation as ownershipRelation } from "./javascriptSemanticQueryRelations.js";
import {
@@ -1,4 +1,4 @@
import { uniqueSorted } from "./canonicalOrdering.js";
import { uniqueSorted } from "../canonicalOrdering.js";
import type { JavaScriptSemanticGraph } from "./javascriptSemanticGraph.js";
import type { JavaScriptSemanticGraphUnknown } from "./javascriptSemanticGraphSchemas.js";
import type { JavaScriptSemanticQueryResult } from "./javascriptSemanticQuerySchemas.js";
@@ -6,7 +6,7 @@ import type {
JavaScriptSemanticGraph,
JavaScriptSemanticGraphNode,
} from "./javascriptSemanticGraph.js";
import { compareCodePoints, uniqueSorted } from "./canonicalOrdering.js";
import { compareCodePoints, uniqueSorted } from "../canonicalOrdering.js";
import type { JavaScriptSemanticQueryInput } from "./javascriptSemanticQuerySchemas.js";
/** Canonical JSON used by semantic query commitments and ordering. */
@@ -7,9 +7,9 @@ import {
javaScriptSemanticRelationSchema,
javaScriptSemanticUnknownSchema,
} from "./javascriptSemanticGraphSchemas.js";
import { jsonValueSchema } from "./jsonValue.js";
import { digestSchema } from "./../domain/digests.js";
import { prefixedDigestSchema } from "./../domain/digests.js";
import { jsonValueSchema } from "../jsonValue.js";
import { digestSchema } from "../digests.js";
import { prefixedDigestSchema } from "../digests.js";
const semanticNodeIdSchema = prefixedDigestSchema("jsrg_node");
const literalSeedSchema = z.strictObject({
@@ -10,7 +10,7 @@ import type {
ProjectedPropertyCoverage,
ProjectedReturnField,
} from "./javascriptExportShapeComparisonSchemas.js";
import { compareCodePoints } from "./canonicalOrdering.js";
import { compareCodePoints } from "../canonicalOrdering.js";
import { semanticCallableIdForNode } from "./javascriptSemanticProjection.js";
import {
resolveSemanticBindingState,
@@ -1,11 +1,11 @@
import { z } from "zod";
import { evidenceSchema } from "./evidence.js";
import { evidenceSchema } from "../evidence.js";
import {
javaScriptSemanticQueryInputSchema,
javaScriptSemanticQueryResultSchema,
} from "./javascriptSemanticQuerySchemas.js";
import { prefixedDigestSchema } from "./../domain/digests.js";
import { prefixedDigestSchema } from "../digests.js";
const evidenceIdSchema = prefixedDigestSchema("ev");

Some files were not shown because too many files have changed in this diff Show More