diff --git a/src/application/javascript/ElectronCallPathIdentity.ts b/src/application/javascript/ElectronCallPathIdentity.ts index 6c70ea3995..0422591a3d 100644 --- a/src/application/javascript/ElectronCallPathIdentity.ts +++ b/src/application/javascript/ElectronCallPathIdentity.ts @@ -1,8 +1,8 @@ import type { ElectronCallPath } from "../../domain/javascript/electronStaticAnalysisTypes.js"; -import { sha256Text } from "../../domain/javascript/javascriptStaticAnalysisHelpers.js"; +import { digestCanonicalValue } from "../../domain/canonicalDigest.js"; /** Keep wrapper-path identity source-scoped across both graph projections. */ export const electronCallPathId = ( filePath: string, path: ElectronCallPath, -): string => sha256Text(JSON.stringify([filePath, path])); +): string => digestCanonicalValue([filePath, path], "Electron call path"); diff --git a/src/javascript/analysis/JavaScriptAnalysisWorkerSchemas.ts b/src/javascript/analysis/JavaScriptAnalysisWorkerSchemas.ts index 797f39ee03..c5235a56ba 100644 --- a/src/javascript/analysis/JavaScriptAnalysisWorkerSchemas.ts +++ b/src/javascript/analysis/JavaScriptAnalysisWorkerSchemas.ts @@ -184,7 +184,7 @@ const electron = z loader_authority: z.literal("candidate").exactOptional(), entry_kind: z.enum(["bridge-member", "ipc-handler"]), entry: z.string(), - entry_path: strings.optional(), + entry_path: strings.exactOptional(), channel: z.string().nullable(), terminal: z.string(), resolution: z.literal("candidate"), @@ -209,13 +209,6 @@ const electron = z ), }), ) - .transform((paths) => - paths.map(({ entry_kind, entry, entry_path, ...rest }) => - entry_path === undefined - ? { entry_kind, entry, ...rest } - : { entry_kind, entry, entry_path, ...rest }, - ), - ) .optional(), browser_windows: z.array( z.union([ diff --git a/tests/boundary/filesystem/javascript-applications/javascriptApplicationEmptyLiterals.test.ts b/tests/boundary/filesystem/javascript-applications/javascriptApplicationEmptyLiterals.test.ts index 3923c2acbb..36cc81bb18 100644 --- a/tests/boundary/filesystem/javascript-applications/javascriptApplicationEmptyLiterals.test.ts +++ b/tests/boundary/filesystem/javascript-applications/javascriptApplicationEmptyLiterals.test.ts @@ -115,11 +115,13 @@ it("keeps bridge entry paths stable through worker validation and API seed match const expectedPaths = [ expect.objectContaining({ path_id: expect.any(String), + loader_authority: "candidate", entry_path: ["desktop", "nested.write"], channel: "literal", }), expect.objectContaining({ path_id: expect.any(String), + loader_authority: "candidate", entry_path: ["desktop", "nested", "write"], channel: "nested", }),