rea-agents 6.2.0 → 6.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (636) hide show
  1. package/README.md +24 -23
  2. package/bridge/ghidra/ReaGhidraApplySeeds.java +151 -0
  3. package/bridge/ghidra/ReaGhidraBridge.java +597 -209
  4. package/bridge/ghidra/ReaGhidraNoReturnFix.java +123 -0
  5. package/bridge/hopper_bridge.py +2 -0
  6. package/dist/adb/AdbConfiguration.js +88 -0
  7. package/dist/adb/AdbDeviceOutput.js +186 -0
  8. package/dist/adb/AdbProvider.js +1190 -0
  9. package/dist/adb/AdbShellOutput.js +309 -0
  10. package/dist/android/AndroidTargetSnapshot.js +104 -22
  11. package/dist/android/JadxConfiguration.js +44 -24
  12. package/dist/android/JadxProvider.js +59 -21
  13. package/dist/android/JadxSession.js +51 -9
  14. package/dist/apktool/ApktoolConfiguration.js +84 -0
  15. package/dist/apktool/ApktoolDecodeOutput.js +59 -0
  16. package/dist/apktool/ApktoolProvider.js +506 -0
  17. package/dist/application/AnalysisProvider.js +8 -2
  18. package/dist/application/AppBundleExecutable.js +27 -22
  19. package/dist/application/BinaryTargetResolver.js +85 -19
  20. package/dist/application/BrowserScenarioEvidence.js +2 -2
  21. package/dist/application/CapabilityInventory.js +11 -1
  22. package/dist/application/ClientConfigurationDocument.js +98 -0
  23. package/dist/application/ClientConfigurationFiles.js +91 -0
  24. package/dist/application/ClientRegistrationEnvironment.js +35 -0
  25. package/dist/application/ClientRegistrationStatus.js +75 -27
  26. package/dist/application/DirectAnalysis.js +14 -8
  27. package/dist/application/DirectAnalysisCleanup.js +1 -2
  28. package/dist/application/DirectAnalysisStatus.js +3 -6
  29. package/dist/application/Doctor.js +27 -34
  30. package/dist/application/DoctorDiagnostics.js +1 -1
  31. package/dist/application/EvidenceBundleCommands.js +6 -12
  32. package/dist/application/EvidenceBundleFiles.js +1 -1
  33. package/dist/application/GeminiClientSettings.js +139 -0
  34. package/dist/application/HermesClientHome.js +115 -0
  35. package/dist/application/HopperDownload.js +39 -0
  36. package/dist/application/InvestigationProviders.js +10 -4
  37. package/dist/application/JsonFiles.js +16 -15
  38. package/dist/application/JsonInputFile.js +252 -0
  39. package/dist/application/LinuxHopper.js +6 -13
  40. package/dist/application/MacHopper.js +172 -149
  41. package/dist/application/MipsElfAbiFlags.js +140 -0
  42. package/dist/application/ProviderOperationExecution.js +31 -0
  43. package/dist/application/ReconstructionObligationCandidates.js +16 -3
  44. package/dist/application/ReconstructionObligationLedgerProjection.js +3 -1
  45. package/dist/application/ReferenceSourceImport.js +76 -29
  46. package/dist/application/ReferenceSourceImportEntries.js +18 -9
  47. package/dist/application/ReferenceSourceImportPolicy.js +99 -23
  48. package/dist/application/ReferenceSourceImportTypes.js +30 -22
  49. package/dist/application/ReferenceSourceVcsAdapter.js +145 -30
  50. package/dist/application/RegularFileRead.js +103 -0
  51. package/dist/application/Setup.js +69 -10
  52. package/dist/application/SetupClientConfiguration.js +134 -23
  53. package/dist/application/SetupHost.js +102 -22
  54. package/dist/application/SetupPlan.js +18 -17
  55. package/dist/application/SetupSkill.js +81 -13
  56. package/dist/application/SupportedClients.js +305 -37
  57. package/dist/application/Uninstall.js +172 -8
  58. package/dist/application/UpdateMaintenance.js +23 -23
  59. package/dist/application/Utf8JsonInput.js +71 -0
  60. package/dist/application/WebScriptExportService.js +130 -57
  61. package/dist/application/WebSourceLocationService.js +3 -0
  62. package/dist/application/adb/AdbDeviceAnalysisPort.js +1 -0
  63. package/dist/application/adb/AdbDeviceAnalysisService.js +13 -0
  64. package/dist/application/analysisView/AnalysisViewService.js +40 -2
  65. package/dist/application/android/AndroidAnalysisService.js +1 -1
  66. package/dist/application/apktool/ApktoolResourceAnalysisPort.js +1 -0
  67. package/dist/application/apktool/ApktoolResourceAnalysisService.js +13 -0
  68. package/dist/application/binary/AnalysisClientCleanup.js +0 -24
  69. package/dist/application/binary/AnalysisSnapshotCache.js +5 -4
  70. package/dist/application/binary/BinarySession.js +18 -1
  71. package/dist/application/binary/BinarySessionOpen.js +9 -1
  72. package/dist/application/binaryDiagnostics/BinaryLayoutService.js +2 -1
  73. package/dist/application/binaryDiagnostics/PeResourcesPort.js +1 -0
  74. package/dist/application/binaryDiagnostics/PeResourcesService.js +111 -0
  75. package/dist/application/binaryDiagnostics/RecordedCrashService.js +2 -1
  76. package/dist/application/evm/EvmInterfaceService.js +3 -0
  77. package/dist/application/firmware/FirmwareAnalysisService.js +3 -0
  78. package/dist/application/investigation/InspectEvidenceBundle.js +18 -0
  79. package/dist/application/javascript/ElectronActiveEvidence.js +2 -2
  80. package/dist/application/javascript/ElectronBoundaryAnalysis.js +2 -2
  81. package/dist/application/javascript/ElectronBoundaryGraphContext.js +3 -2
  82. package/dist/application/javascript/ElectronBoundaryGraphIpc.js +2 -2
  83. package/dist/application/javascript/ElectronBoundaryGraphNative.js +20 -3
  84. package/dist/application/javascript/ElectronBoundaryGraphWindows.js +3 -3
  85. package/dist/application/javascript/JavaScriptApplicationEvidence.js +1 -0
  86. package/dist/application/javascript/JavaScriptApplicationEvidenceGraph.js +107 -46
  87. package/dist/application/javascript/JavaScriptApplicationService.js +23 -11
  88. package/dist/application/javascript/JavaScriptApplicationWorkflowEvidence.js +5 -6
  89. package/dist/application/javascript/JavaScriptApplicationWorkflowService.js +59 -45
  90. package/dist/application/javascript/JavaScriptArtifactAnalysis.js +171 -36
  91. package/dist/application/javascript/JavaScriptArtifactGraphAccumulator.js +14 -16
  92. package/dist/application/javascript/JavaScriptArtifactGraphBuilder.js +74 -36
  93. package/dist/application/javascript/JavaScriptArtifactGraphBundlers.js +4 -3
  94. package/dist/application/javascript/JavaScriptArtifactGraphContext.js +11 -5
  95. package/dist/application/javascript/JavaScriptArtifactGraphFindings.js +53 -42
  96. package/dist/application/javascript/JavaScriptArtifactGraphStructure.js +92 -10
  97. package/dist/application/javascript/JavaScriptArtifactPathResolution.js +293 -238
  98. package/dist/application/javascript/JavaScriptArtifactReconstruction.js +120 -28
  99. package/dist/application/javascript/JavaScriptArtifactReconstructionInput.js +4 -0
  100. package/dist/application/javascript/JavaScriptJsonModules.js +2 -2
  101. package/dist/application/javascript/JavaScriptModuleRelationships.js +10 -20
  102. package/dist/application/javascript/JavaScriptRecoveryService.js +3 -0
  103. package/dist/application/javascript/JavaScriptRuntimeReconciliationService.js +11 -27
  104. package/dist/application/javascript/JavaScriptSemanticGraphAsyncProjection.js +11 -5
  105. package/dist/application/javascript/JavaScriptSemanticGraphBuilder.js +206 -66
  106. package/dist/application/javascript/JavaScriptSemanticGraphChildProcessProjection.js +1 -1
  107. package/dist/application/javascript/JavaScriptSemanticGraphConstruction.js +18 -23
  108. package/dist/application/javascript/JavaScriptSemanticGraphDataProjection.js +5 -2
  109. package/dist/application/javascript/JavaScriptSemanticGraphEvidence.js +1 -1
  110. package/dist/application/javascript/JavaScriptSemanticGraphFingerprintProjection.js +2 -2
  111. package/dist/application/javascript/JavaScriptSemanticGraphFlowProjection.js +7 -5
  112. package/dist/application/javascript/JavaScriptSemanticGraphObjectProjection.js +6 -4
  113. package/dist/application/javascript/JavaScriptSemanticGraphProjection.js +4 -4
  114. package/dist/application/javascript/JavaScriptSemanticGraphResourceProjection.js +1 -1
  115. package/dist/application/javascript/JavaScriptSemanticGraphValueProjection.js +29 -15
  116. package/dist/application/javascript/JavaScriptSemanticTraceService.js +15 -10
  117. package/dist/application/jeb/JebAnalysisPort.js +1 -0
  118. package/dist/application/jeb/JebAnalysisService.js +13 -0
  119. package/dist/application/managed/ManagedApplicationGraphService.js +1 -1
  120. package/dist/application/native/NativeCallRoutes.js +2 -4
  121. package/dist/application/native/NativeUiActionTrace.js +16 -8
  122. package/dist/application/native/NativeValueTrace.js +23 -6
  123. package/dist/application/process/ProcessCli.js +25 -20
  124. package/dist/artifacts/ArtifactPaths.js +129 -8
  125. package/dist/artifacts/ArtifactProvider.js +34 -31
  126. package/dist/artifacts/ArtifactProviderMetadata.js +1 -4
  127. package/dist/artifacts/ArtifactReader.js +23 -0
  128. package/dist/artifacts/ArtifactResourceScope.js +100 -0
  129. package/dist/artifacts/AsarArtifactReader.js +218 -80
  130. package/dist/artifacts/AsarHeader.js +24 -0
  131. package/dist/artifacts/DirectoryArtifactReader.js +168 -65
  132. package/dist/artifacts/MachOSliceArtifactReader.js +116 -39
  133. package/dist/artifacts/NativeDmgArtifactReader.js +179 -87
  134. package/dist/artifacts/NativeDmgOwnership.js +109 -0
  135. package/dist/artifacts/SafeOutputTree.js +245 -70
  136. package/dist/artifacts/SafeOutputTreeCleanup.js +45 -0
  137. package/dist/artifacts/SafeOutputTreeCreationFailure.js +20 -0
  138. package/dist/artifacts/SafeOutputTreeIdentity.js +42 -0
  139. package/dist/artifacts/SafeOutputTreeReadback.js +33 -0
  140. package/dist/artifacts/ZipArtifactReader.js +77 -27
  141. package/dist/artifacts/apple/InterfaceBuilderAnalysis.js +58 -18
  142. package/dist/artifacts/apple/InterfaceBuilderDecodeBudget.js +62 -24
  143. package/dist/artifacts/apple/KeyedArchiveReader.js +76 -49
  144. package/dist/artifacts/apple/MachoLoadCommandReader.js +36 -6
  145. package/dist/artifacts/extraction/ArtifactExtraction.js +134 -92
  146. package/dist/artifacts/inventory/ArtifactGraphConstruction.js +116 -50
  147. package/dist/artifacts/inventory/ArtifactInventory.js +5 -4
  148. package/dist/artifacts/inventory/classify.js +87 -25
  149. package/dist/artifacts/inventory/hashStableRootArtifact.js +70 -0
  150. package/dist/artifacts/inventory/reader.js +13 -5
  151. package/dist/artifacts/inventory/scanCanonical.js +73 -30
  152. package/dist/artifacts/inventory/scanReader.js +43 -20
  153. package/dist/artifacts/javascript/JavaScriptArtifactFiles.js +72 -28
  154. package/dist/artifacts/javascript/JavaScriptSourceAnalysis.js +3 -0
  155. package/dist/browser/BrowserScenarioPartialObservation.js +8 -2
  156. package/dist/browser/BrowserScenarioSecrets.js +52 -37
  157. package/dist/browser/CdpBrowserProvider.js +9 -3
  158. package/dist/browser/CdpCaptureDocuments.js +40 -6
  159. package/dist/browser/CdpCaptureDomSvg.js +210 -0
  160. package/dist/browser/CdpCaptureEventBodyShapes.js +4 -8
  161. package/dist/browser/CdpCaptureEventHandlers.js +26 -9
  162. package/dist/browser/CdpCaptureEvents.js +4 -9
  163. package/dist/browser/CdpCaptureStorageFingerprints.js +3 -3
  164. package/dist/browser/CdpConnection.js +22 -5
  165. package/dist/browser/CdpElectronInspection.js +2 -2
  166. package/dist/browser/CdpElectronProvider.js +4 -3
  167. package/dist/browser/CdpElectronScripts.js +2 -2
  168. package/dist/browser/CdpPageCapture.js +1 -1
  169. package/dist/browser/CdpTargetSession.js +30 -34
  170. package/dist/browser/CdpWebMcpDiscovery.js +48 -23
  171. package/dist/browser/ElectronFileScope.js +99 -9
  172. package/dist/browser/PlaywrightBrowserScenarioProvider.js +63 -7
  173. package/dist/browser/PlaywrightElectronActiveProvider.js +11 -6
  174. package/dist/browser/PlaywrightScenarioArtifacts.js +5 -5
  175. package/dist/browser/PlaywrightScenarioBrowser.js +208 -43
  176. package/dist/browser/PlaywrightScenarioSession.js +130 -65
  177. package/dist/browser/PlaywrightScenarioStorage.js +507 -0
  178. package/dist/browser/PngVisualDiff.js +198 -29
  179. package/dist/browser/WebSourceMapFetcher.js +35 -9
  180. package/dist/browser/assets/LocalWebScriptArtifacts.js +3 -1
  181. package/dist/browser/assets/PublishWebScripts.js +75 -20
  182. package/dist/browser/assets/ScenarioScriptCapture.js +8 -12
  183. package/dist/browser/assets/WebArtifactReads.js +23 -1
  184. package/dist/browser/assets/WebSourceLocationArtifacts.js +1 -0
  185. package/dist/browser/execution/CdpExecutionCapture.js +3 -3
  186. package/dist/browser/execution/CdpPreciseCoverage.js +5 -8
  187. package/dist/browser/history/HarCapture.js +14 -0
  188. package/dist/browser/history/HarCaptureProcess.js +2 -10
  189. package/dist/browser/history/MitmproxyCaptureAdapter.js +3 -1
  190. package/dist/browser/modules/WebModuleArtifacts.js +1 -0
  191. package/dist/cli/adbCommands.js +337 -0
  192. package/dist/cli/analysisViewCommands.js +39 -1
  193. package/dist/cli/apktoolCommands.js +53 -0
  194. package/dist/cli/artifactCommands.js +8 -11
  195. package/dist/cli/binaryDiagnosticsCommands.js +19 -1
  196. package/dist/cli/browserAdvancedCommands.js +65 -36
  197. package/dist/cli/coreAnalysisCommands.js +2 -2
  198. package/dist/cli/coreBinaryCommands.js +12 -13
  199. package/dist/cli/coreNativeCommands.js +1 -14
  200. package/dist/cli/electronCommands.js +14 -10
  201. package/dist/cli/evmCommands.js +13 -4
  202. package/dist/cli/firmwareCommands.js +7 -2
  203. package/dist/cli/javascriptApplicationAnalysis.js +19 -13
  204. package/dist/cli/javascriptRecoveryCommands.js +22 -15
  205. package/dist/cli/jebCommands.js +99 -0
  206. package/dist/cli/jsonOutput.js +12 -4
  207. package/dist/cli/referenceSourceImportStatus.js +7 -0
  208. package/dist/cli/setupCommands.js +15 -3
  209. package/dist/cli/streamedJsonOutput.js +83 -4
  210. package/dist/cli/utilityCommands.js +68 -22
  211. package/dist/cli/webScriptCommands.js +20 -1
  212. package/dist/cli/webSourceLocationCommands.js +21 -9
  213. package/dist/cli.js +11 -2
  214. package/dist/cliBrowserScenarioCommands.js +2 -1
  215. package/dist/cliCommandNames.js +32 -0
  216. package/dist/cliJsonInput.js +47 -34
  217. package/dist/cliObservationOptions.js +7 -0
  218. package/dist/composition/adb.js +3 -0
  219. package/dist/composition/apktool.js +3 -0
  220. package/dist/composition/auxiliaryAnalysisProviders.js +5 -4
  221. package/dist/composition/binaryDiagnostics.js +4 -0
  222. package/dist/composition/browserScenario.js +2 -2
  223. package/dist/composition/directAnalysis.js +14 -7
  224. package/dist/composition/javascriptAnalysisWorkerProcess.js +48 -0
  225. package/dist/composition/jeb.js +6 -0
  226. package/dist/config/environment.js +10 -0
  227. package/dist/config/ghidraLanguageOverride.js +9 -0
  228. package/dist/config/mcpInputSchemaProfile.js +27 -0
  229. package/dist/config/parseConfig.js +28 -1
  230. package/dist/contracts/adb/adbToolContracts.js +353 -0
  231. package/dist/contracts/advertisedInputExamples.js +48 -0
  232. package/dist/contracts/analysisDetail.js +10 -0
  233. package/dist/contracts/analysisViewToolContracts.js +17 -2
  234. package/dist/contracts/apktool/apktoolToolContracts.js +33 -0
  235. package/dist/contracts/artifactComparisonExample.js +5 -5
  236. package/dist/contracts/artifactToolContracts.js +8 -5
  237. package/dist/contracts/browserToolContracts.js +1 -1
  238. package/dist/contracts/compactInputSchema.js +256 -0
  239. package/dist/contracts/errorSchemas.js +3 -1
  240. package/dist/contracts/functionComparisonExample.js +8 -0
  241. package/dist/contracts/functionWorkflowToolContracts.js +1 -1
  242. package/dist/contracts/inputSchemaPresentation.js +104 -13
  243. package/dist/contracts/javascript/electronToolContracts.js +16 -3
  244. package/dist/contracts/javascript/javascriptApplicationWorkflowExamples.js +3 -2
  245. package/dist/contracts/javascript/javascriptExportShapeComparisonExample.js +6 -3
  246. package/dist/contracts/javascript/javascriptRecoveryToolContracts.js +1 -1
  247. package/dist/contracts/javascript/javascriptRuntimeReconciliationExample.js +8 -7
  248. package/dist/contracts/jeb/jebToolContracts.js +64 -0
  249. package/dist/contracts/managed/managedToolContracts.js +3 -2
  250. package/dist/contracts/mobileApplicationGraphExamples.js +5 -5
  251. package/dist/contracts/native/binaryDiagnosticsToolContracts.js +25 -3
  252. package/dist/contracts/native/nativeToolContracts.js +1 -1
  253. package/dist/contracts/officialToolContracts.js +5 -5
  254. package/dist/contracts/sessionLifecycleInputs.js +4 -3
  255. package/dist/contracts/sessionStatusContract.js +3 -2
  256. package/dist/contracts/sessionToolContracts.js +5 -4
  257. package/dist/contracts/sessionToolSchemas.js +9 -4
  258. package/dist/contracts/toolContractExamples.js +6 -0
  259. package/dist/contracts/toolContractTypes.js +3 -0
  260. package/dist/contracts/toolContracts.js +6 -0
  261. package/dist/contracts/toolEffects.js +167 -0
  262. package/dist/contracts/toolOutputSchemaGroups.js +7 -5
  263. package/dist/contracts/toolOutputSchemaPrimitives.js +2 -5
  264. package/dist/contracts/toolSchemaMetadata.js +82 -7
  265. package/dist/domain/adb/adbDeviceAnalysis.js +583 -0
  266. package/dist/domain/analysisErrorBase.js +5 -0
  267. package/dist/domain/analysisErrorCleanup.js +29 -0
  268. package/dist/domain/analysisErrorPresentation.js +18 -4
  269. package/dist/domain/analysisErrorProjection.js +4 -1
  270. package/dist/domain/analysisSnapshot.js +5 -2
  271. package/dist/domain/analysisView/analysisView.js +53 -5
  272. package/dist/domain/analysisView/binaryLayoutView.js +2 -0
  273. package/dist/domain/analysisView/javascriptApplicationView.js +2 -0
  274. package/dist/domain/analysisView/nativeFunctionView.js +155 -0
  275. package/dist/domain/android/androidApplication.js +25 -20
  276. package/dist/domain/android/androidPartialObservation.js +36 -0
  277. package/dist/domain/apktool/apktoolResourceAnalysis.js +77 -0
  278. package/dist/domain/apple/appleApplication.js +40 -23
  279. package/dist/domain/apple/appleBundleAnatomy.js +95 -28
  280. package/dist/domain/apple/dyldPaths.js +9 -1
  281. package/dist/domain/apple/dylibResolution.js +3 -3
  282. package/dist/domain/apple/interfaceBuilderGraph.js +22 -19
  283. package/dist/domain/apple/interfaceBuilderKeyedArchive.js +10 -1
  284. package/dist/domain/artifactComparison.js +39 -11
  285. package/dist/domain/artifactGraph.js +6 -4
  286. package/dist/domain/artifactIdentity.js +37 -9
  287. package/dist/domain/artifactInspection.js +10 -50
  288. package/dist/domain/artifactIntegrityPolicy.js +10 -0
  289. package/dist/domain/artifactInventoryEvidence.js +16 -17
  290. package/dist/domain/artifactPathSyntax.js +1 -1
  291. package/dist/domain/binaryTarget.js +16 -0
  292. package/dist/domain/binaryTargetTypes.js +8 -1
  293. package/dist/domain/browserCompleteness.js +3 -2
  294. package/dist/domain/browserObservationSchemas.js +8 -4
  295. package/dist/domain/browserScenarioCaptureValues.js +2 -2
  296. package/dist/domain/browserScenarioNormalization.js +3 -3
  297. package/dist/domain/browserScenarioValues.js +3 -2
  298. package/dist/domain/callPath.js +8 -10
  299. package/dist/domain/canonicalDigest.js +7 -1
  300. package/dist/domain/canonicalJsonDigestSteps.js +34 -12
  301. package/dist/domain/canonicalOrdering.js +1 -13
  302. package/dist/domain/changedBehavior.js +2 -3
  303. package/dist/domain/compactStringIdentity.js +9 -0
  304. package/dist/domain/comparisonSemantics.js +0 -5
  305. package/dist/domain/digests.js +0 -3
  306. package/dist/domain/evidence.js +12 -6
  307. package/dist/domain/evidenceBundle.js +51 -33
  308. package/dist/domain/evidenceRecordSummary.js +144 -0
  309. package/dist/domain/firmware/firmwareAnalysis.js +4 -3
  310. package/dist/domain/functionComparison.js +2 -1
  311. package/dist/domain/functionComparisonNormalization.js +4 -3
  312. package/dist/domain/functionComparisonResults.js +2 -2
  313. package/dist/domain/functionDossierEvidence.js +2 -1
  314. package/dist/domain/hopperValues.js +11 -15
  315. package/dist/domain/inputIssueProjection.js +16 -1
  316. package/dist/domain/javascript/electronActiveObservation.js +4 -3
  317. package/dist/domain/javascript/electronStaticAnalysisBrowser.js +14 -15
  318. package/dist/domain/javascript/electronStaticAnalysisIpc.js +20 -21
  319. package/dist/domain/javascript/electronStaticAnalysisNative.js +73 -41
  320. package/dist/domain/javascript/electronStaticAnalysisValues.js +24 -4
  321. package/dist/domain/javascript/javascriptAnalysisResourceControls.js +45 -0
  322. package/dist/domain/javascript/javascriptApplicationAnalysis.js +6 -1
  323. package/dist/domain/javascript/javascriptApplicationChangeGraph.js +18 -14
  324. package/dist/domain/javascript/javascriptApplicationEvidenceSchemas.js +4 -0
  325. package/dist/domain/javascript/javascriptApplicationGraph.js +91 -28
  326. package/dist/domain/javascript/javascriptApplicationProjectionResources.js +35 -0
  327. package/dist/domain/javascript/javascriptApplicationVersionComparison.js +4 -4
  328. package/dist/domain/javascript/javascriptApplicationVersionComparisonSchemas.js +37 -22
  329. package/dist/domain/javascript/javascriptApplicationVersionItems.js +72 -45
  330. package/dist/domain/javascript/javascriptApplicationVersionKeys.js +16 -8
  331. package/dist/domain/javascript/javascriptAstFingerprint.js +60 -33
  332. package/dist/domain/javascript/javascriptAstValues.js +54 -0
  333. package/dist/domain/javascript/javascriptElectronMemberWrites.js +50 -0
  334. package/dist/domain/javascript/javascriptExportShapeComparison.js +3 -2
  335. package/dist/domain/javascript/javascriptExportShapeComparisonSchemas.js +31 -23
  336. package/dist/domain/javascript/javascriptExportShapeSelection.js +2 -2
  337. package/dist/domain/javascript/javascriptExportShapeVariants.js +3 -2
  338. package/dist/domain/javascript/javascriptFeatureSeed.js +5 -3
  339. package/dist/domain/javascript/javascriptFeatureTrace.js +7 -6
  340. package/dist/domain/javascript/javascriptFeatureTraceSchemas.js +17 -9
  341. package/dist/domain/javascript/javascriptFeatureTraversal.js +4 -4
  342. package/dist/domain/javascript/javascriptModuleSemanticIr.js +15 -0
  343. package/dist/domain/javascript/javascriptNativeHandoff.js +12 -7
  344. package/dist/domain/javascript/javascriptRpcEndpoints.js +253 -0
  345. package/dist/domain/javascript/javascriptRuntimeLoadState.js +1 -3
  346. package/dist/domain/javascript/javascriptRuntimeObservation.js +8 -5
  347. package/dist/domain/javascript/javascriptRuntimeReconciliation.js +12 -6
  348. package/dist/domain/javascript/javascriptRuntimeReconciliationActive.js +9 -8
  349. package/dist/domain/javascript/javascriptRuntimeReconciliationCaptureParsing.js +212 -0
  350. package/dist/domain/javascript/javascriptRuntimeReconciliationGraph.js +12 -6
  351. package/dist/domain/javascript/javascriptRuntimeReconciliationInputValidation.js +28 -0
  352. package/dist/domain/javascript/javascriptRuntimeReconciliationMatching.js +5 -5
  353. package/dist/domain/javascript/javascriptRuntimeReconciliationParsing.js +12 -223
  354. package/dist/domain/javascript/javascriptRuntimeReconciliationResult.js +2 -2
  355. package/dist/domain/javascript/javascriptRuntimeReconciliationRuntime.js +15 -4
  356. package/dist/domain/javascript/javascriptRuntimeReconciliationSchemas.js +2 -2
  357. package/dist/domain/javascript/javascriptRuntimeStaticCandidates.js +15 -17
  358. package/dist/domain/javascript/javascriptSemanticAnalysis.js +379 -30
  359. package/dist/domain/javascript/javascriptSemanticCallResolution.js +9 -7
  360. package/dist/domain/javascript/javascriptSemanticCallableResults.js +42 -0
  361. package/dist/domain/javascript/javascriptSemanticCalls.js +8 -1
  362. package/dist/domain/javascript/javascriptSemanticChildProcesses.js +2 -2
  363. package/dist/domain/javascript/javascriptSemanticCoverage.js +20 -0
  364. package/dist/domain/javascript/javascriptSemanticDataEffectHelpers.js +7 -9
  365. package/dist/domain/javascript/javascriptSemanticDataEffects.js +4 -11
  366. package/dist/domain/javascript/javascriptSemanticDerivedAnalysis.js +15 -4
  367. package/dist/domain/javascript/javascriptSemanticFileProjection.js +1 -0
  368. package/dist/domain/javascript/javascriptSemanticFingerprints.js +43 -42
  369. package/dist/domain/javascript/javascriptSemanticGraph.js +205 -52
  370. package/dist/domain/javascript/javascriptSemanticGraphSchemas.js +21 -11
  371. package/dist/domain/javascript/javascriptSemanticIr.js +0 -4
  372. package/dist/domain/javascript/javascriptSemanticIterationSources.js +139 -0
  373. package/dist/domain/javascript/javascriptSemanticMemberMutations.js +774 -136
  374. package/dist/domain/javascript/javascriptSemanticMutationInitializers.js +190 -0
  375. package/dist/domain/javascript/javascriptSemanticMutationValues.js +98 -41
  376. package/dist/domain/javascript/javascriptSemanticObjectReferences.js +381 -0
  377. package/dist/domain/javascript/javascriptSemanticObjects.js +9 -7
  378. package/dist/domain/javascript/javascriptSemanticPrimitives.js +7 -2
  379. package/dist/domain/javascript/javascriptSemanticProjection.js +72 -28
  380. package/dist/domain/javascript/javascriptSemanticPromises.js +15 -21
  381. package/dist/domain/javascript/javascriptSemanticPropertyPaths.js +100 -0
  382. package/dist/domain/javascript/javascriptSemanticProvenance.js +3 -3
  383. package/dist/domain/javascript/javascriptSemanticQuery.js +33 -29
  384. package/dist/domain/javascript/javascriptSemanticQueryIdentity.js +4 -5
  385. package/dist/domain/javascript/javascriptSemanticQuerySchemas.js +8 -9
  386. package/dist/domain/javascript/javascriptSemanticRequireOrigin.js +16 -10
  387. package/dist/domain/javascript/javascriptSemanticReturnedReferences.js +219 -0
  388. package/dist/domain/javascript/javascriptSemanticReturns.js +34 -48
  389. package/dist/domain/javascript/javascriptSemanticState.js +22 -2
  390. package/dist/domain/javascript/javascriptSemanticTraversal.js +25 -2
  391. package/dist/domain/javascript/javascriptSemanticValues.js +169 -30
  392. package/dist/domain/javascript/javascriptSourceAnalysis.js +1 -0
  393. package/dist/domain/javascript/javascriptSourceMapPaths.js +11 -1
  394. package/dist/domain/javascript/javascriptSourceParser.js +34 -9
  395. package/dist/domain/javascript/javascriptStaticAnalysis.js +29 -17
  396. package/dist/domain/javascript/javascriptStaticAnalysisBundler.js +13 -12
  397. package/dist/domain/javascript/javascriptStaticAnalysisCalls.js +49 -5
  398. package/dist/domain/javascript/javascriptStaticAnalysisFindings.js +8 -4
  399. package/dist/domain/javascript/javascriptStaticAnalysisHelpers.js +26 -15
  400. package/dist/domain/javascript/javascriptStaticAnalysisState.js +1 -0
  401. package/dist/domain/javascript/sourceToBundleComparison.js +7 -5
  402. package/dist/domain/javascript/sourceToBundleSignals.js +7 -7
  403. package/dist/domain/jeb/jebAnalysis.js +114 -0
  404. package/dist/domain/jsonSerialization.js +109 -55
  405. package/dist/domain/jsonShape.js +69 -31
  406. package/dist/domain/jsonValue.js +3 -0
  407. package/dist/domain/localPath.js +10 -4
  408. package/dist/domain/managed/managedApplicationGraph.js +47 -6
  409. package/dist/domain/managed/managedApplicationGraphCoverage.js +8 -2
  410. package/dist/domain/managed/managedApplicationGraphNodes.js +94 -59
  411. package/dist/domain/managed/managedArtifact.js +1 -0
  412. package/dist/domain/managed/managedInspectionEvidence.js +13 -0
  413. package/dist/domain/managed/managedMemberComparisonMatch.js +6 -7
  414. package/dist/domain/native/nativeAotPe.js +1408 -0
  415. package/dist/domain/native/nativeCallObservation.js +2 -4
  416. package/dist/domain/native/nativeInstruction.js +21 -0
  417. package/dist/domain/native/nativeMetadataRecovery.js +79 -6
  418. package/dist/domain/native/nativeValueFlow.js +5 -11
  419. package/dist/domain/native/objcSwiftMetadata.js +15 -17
  420. package/dist/domain/native/peResources.js +94 -0
  421. package/dist/domain/nativeConvention.js +33 -0
  422. package/dist/domain/process/processCapture.js +102 -11
  423. package/dist/domain/process/processCaptureCoverage.js +8 -5
  424. package/dist/domain/process/processCaptureExample.js +67 -0
  425. package/dist/domain/process/processCaptureValidation.js +83 -3
  426. package/dist/domain/process/processComparison.js +0 -23
  427. package/dist/domain/process/processScenario.js +62 -10
  428. package/dist/domain/process/processTraceEvaluation.js +4 -4
  429. package/dist/domain/process/processTraceSpecification.js +1 -3
  430. package/dist/domain/propertyListKeys.js +3 -1
  431. package/dist/domain/providerCleanupError.js +6 -2
  432. package/dist/domain/reconstructionCoverage.js +2 -1
  433. package/dist/domain/reconstructionUnknowns.js +4 -3
  434. package/dist/domain/reconstructionVerification.js +3 -2
  435. package/dist/domain/referenceSourceGraph.js +32 -23
  436. package/dist/domain/referenceSourceImportParsing.js +40 -48
  437. package/dist/domain/referenceSourcePathIdentity.js +22 -0
  438. package/dist/domain/referenceSourceRequireBindings.js +137 -0
  439. package/dist/domain/residualUnknown.js +3 -2
  440. package/dist/domain/staticRuntimeCorrelation.js +2 -1
  441. package/dist/domain/swiftSymbolClassification.js +6 -1
  442. package/dist/domain/symbolAnalysis.js +17 -2
  443. package/dist/domain/unicodeCodePointOrder.js +6 -0
  444. package/dist/domain/webBundleAnalyzerInspection.js +23 -3
  445. package/dist/domain/webCaptureDiff.js +170 -30
  446. package/dist/domain/webCaptureDiffSchemas.js +2 -8
  447. package/dist/domain/webInventory.js +3 -2
  448. package/dist/domain/webMcpDiscovery.js +4 -3
  449. package/dist/domain/webScriptExport.js +1 -1
  450. package/dist/domain/webScriptExportError.js +10 -4
  451. package/dist/domain/webScriptExportPlan.js +7 -13
  452. package/dist/domain/zipPackageFormat.js +4 -1
  453. package/dist/domain/zodCollectionSteps.js +24 -0
  454. package/dist/dotnet/ManagedArtifactInspector.js +55 -43
  455. package/dist/dotnet/ManagedDecodeBudget.js +80 -0
  456. package/dist/dotnet/ManagedMemberInspector.js +13 -6
  457. package/dist/dotnet/ManagedMemberInspectorCore.js +2 -2
  458. package/dist/dotnet/ManagedMemberInstructionDecoder.js +5 -4
  459. package/dist/dotnet/ManagedMemberRows.js +9 -4
  460. package/dist/dotnet/ManagedMetadataHeaps.js +15 -5
  461. package/dist/dotnet/ManagedMetadataInventoryRows.js +20 -11
  462. package/dist/dotnet/ManagedMetadataLayout.js +10 -4
  463. package/dist/dotnet/ManagedMethodBodyReader.js +8 -3
  464. package/dist/dotnet/ManagedNativeBoundaryHelpers.js +3 -2
  465. package/dist/dotnet/ManagedNativeBoundaryInspector.js +49 -34
  466. package/dist/dotnet/ManagedPeReader.js +41 -25
  467. package/dist/dotnet/ManagedReaderFailure.js +2 -1
  468. package/dist/dotnet/ManagedStaticProvider.js +65 -31
  469. package/dist/dotnet/ManagedStaticProviderMetadata.js +1 -4
  470. package/dist/evaluation/AgentEvaluationReport.js +9 -5
  471. package/dist/evaluation/CodexAgentEval.js +43 -13
  472. package/dist/evm/EvmoleFailures.js +0 -2
  473. package/dist/evm/EvmoleInterfaceProvider.js +67 -2
  474. package/dist/filesystem/OwnedDirectoryHandle.js +29 -0
  475. package/dist/filesystem/OwnedFileHandle.js +36 -0
  476. package/dist/filesystem/RegularFile.js +73 -0
  477. package/dist/filesystem/StableFileHash.js +46 -0
  478. package/dist/filesystem/readFileHandleChunks.js +26 -0
  479. package/dist/firmware/FirmwareCommand.js +25 -3
  480. package/dist/firmware/FirmwareFiles.js +23 -8
  481. package/dist/firmware/FirmwareProvider.js +156 -32
  482. package/dist/firmware/FirmwarePublication.js +24 -3
  483. package/dist/firmware/FirmwareRelease.js +1 -0
  484. package/dist/generatedPackageMetadata.js +2 -2
  485. package/dist/ghidra/GhidraAnalysisProfile.js +55 -4
  486. package/dist/ghidra/GhidraAnalysisSeeds.js +211 -0
  487. package/dist/ghidra/GhidraClient.js +90 -8
  488. package/dist/ghidra/GhidraDiagnostics.js +11 -8
  489. package/dist/ghidra/GhidraFunctionValues.js +26 -2
  490. package/dist/ghidra/GhidraInstallation.js +111 -10
  491. package/dist/ghidra/GhidraInventoryValues.js +23 -1
  492. package/dist/ghidra/GhidraLanguageCatalog.js +99 -0
  493. package/dist/ghidra/GhidraLauncher.js +123 -58
  494. package/dist/ghidra/GhidraLoadImageAttest.js +49 -2
  495. package/dist/ghidra/GhidraMipsProfile.js +79 -0
  496. package/dist/ghidra/GhidraProvider.js +57 -9
  497. package/dist/ghidra/GhidraProviderCapabilities.js +18 -8
  498. package/dist/ghidra/GhidraProviderClient.js +282 -21
  499. package/dist/ghidra/GhidraSessionValues.js +9 -2
  500. package/dist/hopper/HopperAnalysisProfile.js +2 -0
  501. package/dist/hopper/HopperCleanup.js +1 -1
  502. package/dist/hopper/HopperClient.js +15 -6
  503. package/dist/hopper/HopperMachOImage.js +2 -0
  504. package/dist/hopper/HopperProvider.js +13 -2
  505. package/dist/ida/IdaOperationRunner.js +10 -2
  506. package/dist/ida/IdaProvider.js +7 -0
  507. package/dist/ida/IdaSessionClient.js +7 -3
  508. package/dist/ida/IdaWorkspace.js +4 -2
  509. package/dist/inspector/JavaScriptRuntimeScope.js +9 -5
  510. package/dist/inspector/V8InspectorCaptureProjection.js +46 -13
  511. package/dist/inspector/V8InspectorProvider.js +60 -8
  512. package/dist/javascript/analysis/JavaScriptAnalysisTransfer.js +326 -0
  513. package/dist/javascript/analysis/JavaScriptAnalysisWorker.js +520 -0
  514. package/dist/javascript/analysis/JavaScriptAnalysisWorkerProtocol.js +63 -0
  515. package/dist/javascript/analysis/JavaScriptAnalysisWorkerSchemas.js +521 -0
  516. package/dist/javascript/analysis/JavaScriptAnalysisWorkerServer.js +116 -0
  517. package/dist/javascript/recovery/RecoveryFiles.js +18 -7
  518. package/dist/javascript/recovery/WakaruCommand.js +22 -9
  519. package/dist/javascript/recovery/WakaruExecution.js +11 -7
  520. package/dist/javascript/recovery/WakaruProvider.js +139 -16
  521. package/dist/javascript/recovery/WakaruPublication.js +14 -4
  522. package/dist/javascript/recovery/WakaruRelease.js +10 -3
  523. package/dist/javascript/recovery/WakaruReport.js +12 -7
  524. package/dist/javascript/recovery/WakaruVersion.js +24 -0
  525. package/dist/javascript/sourceMaps/SourceMapCommand.js +16 -3
  526. package/dist/javascript/sourceMaps/SourceMapDecoder.js +63 -7
  527. package/dist/javascript/sourceMaps/SourceMapFormat.js +15 -4
  528. package/dist/jeb/JebMcpConnection.js +179 -0
  529. package/dist/jeb/JebMcpEndpoint.js +40 -0
  530. package/dist/jeb/JebProvider.js +299 -0
  531. package/dist/main/shutdown.js +76 -32
  532. package/dist/main/transport.js +1 -1
  533. package/dist/mcpDoctor.js +15 -6
  534. package/dist/native/AppleDispatchCoverage.js +25 -12
  535. package/dist/native/AppleDispatchMetadata.js +14 -7
  536. package/dist/native/AppleMachoFixups.js +71 -15
  537. package/dist/native/AppleMachoSelection.js +23 -3
  538. package/dist/native/AppleObjcDispatchFacets.js +3 -3
  539. package/dist/native/AppleObjcProperties.js +17 -7
  540. package/dist/native/LldbCallTracer.js +241 -75
  541. package/dist/native/NativeMacOSProvider.js +100 -20
  542. package/dist/native/NativeMacOSProviderMetadata.js +1 -2
  543. package/dist/native/NativeMachoInspection.js +11 -7
  544. package/dist/native/NativeUiHelperRuntime.js +6 -1
  545. package/dist/native/NativeUiObservation.js +4 -3
  546. package/dist/native/pe/PeResourceLayout.js +120 -0
  547. package/dist/native/pe/PeResourceParser.js +286 -0
  548. package/dist/native/pe/PeResourcesProvider.js +63 -0
  549. package/dist/process/BoundedFileBytes.js +30 -7
  550. package/dist/process/DarwinProcessRunTokenReader.js +8 -3
  551. package/dist/process/OwnedCommand.js +4 -3
  552. package/dist/process/ProcessOwnership.js +104 -112
  553. package/dist/process/ProcessOwnershipObservation.js +104 -51
  554. package/dist/process/ProcessOwnershipProcessTree.js +4 -4
  555. package/dist/process/ProcessRunTokenObservations.js +48 -0
  556. package/dist/process/ProviderDiagnosticRedaction.js +17 -0
  557. package/dist/process/ProviderProcess.js +4 -3
  558. package/dist/process/capture/FilesystemSnapshot.js +116 -22
  559. package/dist/process/capture/ProcessCaptureLifecycle.js +363 -86
  560. package/dist/process/capture/ProcessCaptureProgress.js +62 -0
  561. package/dist/process/capture/ProcessFilesystemEffects.js +19 -4
  562. package/dist/process/capture/ProcessHarness.js +202 -47
  563. package/dist/process/capture/ProcessNormalization.js +3 -1
  564. package/dist/process/capture/ProcessScenarioRuntimeValidation.js +5 -2
  565. package/dist/process/capture/TerminalRenderer.js +24 -7
  566. package/dist/reference/ReferenceSourceReader.js +22 -5
  567. package/dist/reference/ReferenceSourceReaderEntries.js +114 -51
  568. package/dist/reference/ReferenceSourceReaderErrors.js +12 -0
  569. package/dist/reference/ReferenceSourceReaderFile.js +50 -10
  570. package/dist/reference/ReferenceSourceReaderValidate.js +4 -4
  571. package/dist/server/EvidenceMcpServer.js +36 -1
  572. package/dist/server/admittedToolOperation.js +9 -0
  573. package/dist/server/analysisAdmission.js +8 -0
  574. package/dist/server/contractToolHandler.js +21 -0
  575. package/dist/server/createServer.js +118 -47
  576. package/dist/server/registerAdbTools.js +36 -0
  577. package/dist/server/registerAnalysisViewTool.js +4 -9
  578. package/dist/server/registerAndroidTools.js +3 -12
  579. package/dist/server/registerApktoolTools.js +14 -0
  580. package/dist/server/registerApplicationTools/compareExportShapes.js +6 -7
  581. package/dist/server/registerApplicationTools/compareSourceToBundle.js +4 -5
  582. package/dist/server/registerApplicationTools/compareVersions.js +3 -2
  583. package/dist/server/registerApplicationTools/coverage.js +3 -2
  584. package/dist/server/registerApplicationTools/helpers.js +3 -2
  585. package/dist/server/registerApplicationTools/obligationLedger.js +3 -2
  586. package/dist/server/registerApplicationTools/projectMobileApplicationGraph.js +3 -2
  587. package/dist/server/registerApplicationTools/traceFeature.js +3 -2
  588. package/dist/server/registerApplicationTools/traceSemantics.js +4 -5
  589. package/dist/server/registerArtifactComparisonTool.js +5 -2
  590. package/dist/server/registerArtifactTools.js +2 -2
  591. package/dist/server/registerBinaryDiagnosticsTools.js +16 -4
  592. package/dist/server/registerBrowserScenarioTool.js +10 -7
  593. package/dist/server/registerBrowserTools.js +12 -9
  594. package/dist/server/registerBundleComparisonTool.js +16 -2
  595. package/dist/server/registerCloseLifecycleTool.js +36 -5
  596. package/dist/server/registerElectronTools.js +28 -10
  597. package/dist/server/registerEnhancedTools.js +78 -73
  598. package/dist/server/registerEvidenceTools.js +54 -46
  599. package/dist/server/registerEvmTools.js +4 -9
  600. package/dist/server/registerFirmwareTools.js +3 -11
  601. package/dist/server/registerFunctionComparisonTool.js +5 -2
  602. package/dist/server/registerJavaScriptRecoveryTool.js +4 -9
  603. package/dist/server/registerJavaScriptRuntimeObservationTools.js +9 -6
  604. package/dist/server/registerJebTools.js +16 -0
  605. package/dist/server/registerManagedTools.js +7 -4
  606. package/dist/server/registerManagedWorkflowTools/compareManagedMembers.js +4 -6
  607. package/dist/server/registerManagedWorkflowTools/importManagedReconstruction.js +3 -2
  608. package/dist/server/registerManagedWorkflowTools/projectManagedApplicationGraph.js +3 -2
  609. package/dist/server/registerManagedWorkflowTools/verifyManagedNativeBoundaries.js +3 -2
  610. package/dist/server/registerOfficialTools.js +31 -25
  611. package/dist/server/registerPeResourcesTool.js +9 -0
  612. package/dist/server/registerProcessComparisonTool.js +5 -2
  613. package/dist/server/registerRecordedCrashTools.js +4 -9
  614. package/dist/server/registerSessionRecordTools.js +2 -1
  615. package/dist/server/registerSessionTools.js +58 -21
  616. package/dist/server/registerWebModuleTool.js +4 -9
  617. package/dist/server/registerWebNetworkCaptureTool.js +4 -9
  618. package/dist/server/registerWebRuntimeTools.js +6 -5
  619. package/dist/server/registerWebScriptTool.js +6 -3
  620. package/dist/server/registerWebSourceLocationTool.js +4 -9
  621. package/dist/server/toolResult.js +21 -2
  622. package/dist/windows/WindowsPrivateRuntime.js +12 -5
  623. package/install.sh +7 -4
  624. package/licenses/nativeaot-parser-MIT.txt +28 -0
  625. package/native/windows/build/manifest.json +2 -2
  626. package/native/windows/build/rea-windows-x64.node +0 -0
  627. package/package.json +38 -7
  628. package/scripts/rea.mjs +16 -1
  629. package/skills/reverse-engineer-anything/SKILL.md +52 -51
  630. package/skills/reverse-engineer-anything/references/connection-and-recovery.md +127 -0
  631. package/skills/reverse-engineer-anything/references/evidence-workflows.md +8 -0
  632. package/skills/reverse-engineer-anything/references/javascript-applications.md +92 -13
  633. package/skills/reverse-engineer-anything/references/native-and-artifacts.md +31 -1
  634. package/dist/artifacts/inventory/policy.js +0 -2
  635. package/dist/domain/managed/managedApplicationGraphNodeCoverage.js +0 -6
  636. package/dist/server/registerNativeTools.js +0 -6
@@ -1,5 +1,5 @@
1
- import { createJavaScriptSemanticGraph, createImmutableJavaScriptSemanticGraphSteps, } from "../../domain/javascript/javascriptSemanticGraph.js";
2
- import { JAVASCRIPT_SEMANTIC_RELATION_FAMILIES, JAVASCRIPT_SEMANTIC_RELATION_FAMILY, } from "../../domain/javascript/javascriptSemanticGraphSchemas.js";
1
+ import { createJavaScriptSemanticGraph, createJavaScriptSemanticGraphUnknown, sealTransferredJavaScriptSemanticGraphSteps, } from "../../domain/javascript/javascriptSemanticGraph.js";
2
+ import { JAVASCRIPT_SEMANTIC_RELATION_FAMILIES, JAVASCRIPT_SEMANTIC_RELATION_FAMILY, JAVASCRIPT_SEMANTIC_RELATIONS, } from "../../domain/javascript/javascriptSemanticGraphSchemas.js";
3
3
  import { sourceRangesEqual as rangesEqual } from "../../domain/javascript/javascriptStaticAnalysisHelpers.js";
4
4
  import { projectSemanticEvents, projectSemanticTimers, } from "./JavaScriptSemanticGraphAsyncProjection.js";
5
5
  import { projectSemanticChildProcesses } from "./JavaScriptSemanticGraphChildProcessProjection.js";
@@ -8,6 +8,9 @@ import { projectSemanticResources } from "./JavaScriptSemanticGraphResourceProje
8
8
  import { projectSemanticObjects } from "./JavaScriptSemanticGraphObjectProjection.js";
9
9
  import { projectSemanticValues } from "./JavaScriptSemanticGraphValueProjection.js";
10
10
  import { inferredSemanticEvidenceAt } from "./JavaScriptSemanticGraphEvidence.js";
11
+ import { observedSemanticEvidence } from "./JavaScriptSemanticGraphEvidence.js";
12
+ import { partialApplicationCoverage, } from "../../domain/javascript/javascriptApplicationEvidenceSchemas.js";
13
+ import { javaScriptAnalysisCoverageLimits } from "../../domain/javascript/javascriptAnalysisResourceControls.js";
11
14
  import { projectSemanticFunctionFingerprints } from "./JavaScriptSemanticGraphFingerprintProjection.js";
12
15
  import { projectSemanticClosureCaptures, projectSemanticFrontiers, projectSemanticPromises, projectSemanticReturnValues, } from "./JavaScriptSemanticGraphFlowProjection.js";
13
16
  import { createSemanticCallableOwnerLookup, createSemanticCallSiteLookup, createSemanticNodeRangeLookup, semanticFamilyStatus, } from "./JavaScriptSemanticGraphProjection.js";
@@ -45,14 +48,17 @@ export const buildJavaScriptSemanticGraph = ({ rootArtifactSha256, applicationGr
45
48
  if (analyzed.semantic !== null)
46
49
  projection.projectFile(analyzed.file, analyzed.semantic.ir);
47
50
  }
48
- return projection.finish(rootArtifactSha256, applicationGraph, analysis);
51
+ return projection.finish(rootArtifactSha256, applicationGraph);
49
52
  };
50
53
  /** Accumulate semantic nodes while each source IR is still file-local. */
51
54
  export const createJavaScriptSemanticGraphProjection = () => {
52
- const state = emptyState({ nodes: [] });
55
+ const state = emptyState();
53
56
  const fingerprints = [];
54
57
  let truncatedFiles = 0;
55
- const projectSource = (file, ir) => {
58
+ let unavailableFiles = 0;
59
+ let resourceTruncatedFiles = 0;
60
+ const executionLimits = new Map();
61
+ const projectSourceSteps = function* (file, ir) {
56
62
  if (state.nodes.size >= SEMANTIC_GRAPH_NODE_CEILING) {
57
63
  truncatedFiles += 1;
58
64
  return;
@@ -60,7 +66,7 @@ export const createJavaScriptSemanticGraphProjection = () => {
60
66
  const remainingTreeBudget = SEMANTIC_GRAPH_NODE_CEILING - state.nodes.size;
61
67
  state.fileNodeBudget = Math.min(SEMANTIC_GRAPH_FILE_NODE_CEILING, remainingTreeBudget);
62
68
  state.fileNodesDropped = false;
63
- fingerprints.push(...projectFile(file, ir, state));
69
+ fingerprints.push(...(yield* projectFileSteps(file, ir, state)));
64
70
  // Nodes were dropped only if the budget actually blocked creation. A file
65
71
  // that exactly fills its share ends with a zero budget without dropping
66
72
  // anything, so the remaining budget alone cannot decide truncation.
@@ -68,43 +74,59 @@ export const createJavaScriptSemanticGraphProjection = () => {
68
74
  truncatedFiles += 1;
69
75
  state.fileNodeBudget = null;
70
76
  };
71
- const finishWith = (factory, rootArtifactSha256, applicationGraph, analysis) => {
77
+ const finishWith = (factory, rootArtifactSha256, applicationGraph) => {
72
78
  bindSemanticGraphApplicationNodes(state, applicationGraph);
73
79
  if (state.roots.size === 0)
74
80
  addFallbackRoot(rootArtifactSha256, state);
81
+ const relations = [...state.relations.values()];
75
82
  const unknowns = [...state.unknowns.values()];
83
+ const retainedByFamily = new Map();
84
+ const unknownIdsByFamily = new Map();
85
+ for (const relation of relations) {
86
+ const family = JAVASCRIPT_SEMANTIC_RELATION_FAMILY[relation.relation];
87
+ retainedByFamily.set(family, (retainedByFamily.get(family) ?? 0) + 1);
88
+ }
89
+ for (const unknown of unknowns) {
90
+ const identifiers = unknownIdsByFamily.get(unknown.family);
91
+ if (identifiers === undefined)
92
+ unknownIdsByFamily.set(unknown.family, [unknown.unknown_id]);
93
+ else
94
+ identifiers.push(unknown.unknown_id);
95
+ }
76
96
  const graph = factory({
77
97
  schema: "JavaScriptSemanticRelationGraph",
78
98
  root_artifact_sha256: rootArtifactSha256,
79
99
  application_graph_id: applicationGraph.graph_id,
80
100
  root_node_ids: [...state.roots],
101
+ evidence_contexts: state.evidenceContexts.contexts,
81
102
  nodes: [...state.nodes.values()],
82
- relations: [...state.relations.values()],
83
- fingerprints,
103
+ relations,
104
+ // The input is transferred to the factory; `fingerprints` is cleared below.
105
+ fingerprints: [...fingerprints],
84
106
  unknowns,
85
107
  coverage: {
86
- status: truncatedFiles > 0 ? "partial" : "unknown",
87
- truncated: truncatedFiles > 0,
88
- omitted_nodes: truncatedFiles > 0 ? null : 0,
89
- omitted_relations: truncatedFiles > 0 ? null : 0,
90
- limits: truncatedFiles > 0
91
- ? [
92
- {
93
- name: "semantic_graph_node_ceiling",
94
- value: SEMANTIC_GRAPH_NODE_CEILING,
95
- unit: "items",
96
- },
97
- ]
98
- : [],
108
+ status: truncatedFiles > 0 || unavailableFiles > 0 ? "partial" : "unknown",
109
+ truncated: truncatedFiles > 0 || resourceTruncatedFiles > 0,
110
+ omitted_nodes: truncatedFiles > 0 || unavailableFiles > 0 ? null : 0,
111
+ omitted_relations: truncatedFiles > 0 || unavailableFiles > 0 ? null : 0,
112
+ limits: [
113
+ ...executionLimits.values(),
114
+ ...(truncatedFiles > 0
115
+ ? [
116
+ {
117
+ name: "semantic_graph_node_ceiling",
118
+ value: SEMANTIC_GRAPH_NODE_CEILING,
119
+ unit: "items",
120
+ },
121
+ ]
122
+ : []),
123
+ ],
99
124
  families: JAVASCRIPT_SEMANTIC_RELATION_FAMILIES.map((family) => ({
100
125
  family,
101
- status: semanticFamilyStatus(family, analysis),
102
- retained_relations: [...state.relations.values()].filter((relation) => JAVASCRIPT_SEMANTIC_RELATION_FAMILY[relation.relation] ===
103
- family).length,
104
- omitted_relations: truncatedFiles > 0 ? null : 0,
105
- unknown_ids: unknowns
106
- .filter((unknown) => unknown.family === family)
107
- .map(({ unknown_id: identifier }) => identifier),
126
+ status: semanticFamilyStatus(family),
127
+ retained_relations: retainedByFamily.get(family) ?? 0,
128
+ omitted_relations: truncatedFiles > 0 || unavailableFiles > 0 ? null : 0,
129
+ unknown_ids: unknownIdsByFamily.get(family) ?? [],
108
130
  })),
109
131
  },
110
132
  limitations: [
@@ -125,16 +147,103 @@ export const createJavaScriptSemanticGraphProjection = () => {
125
147
  state.relations.clear();
126
148
  state.unknowns.clear();
127
149
  state.roots.clear();
150
+ state.evidenceContexts.clear();
128
151
  fingerprints.length = 0;
129
152
  return graph;
130
153
  };
131
154
  return {
132
- projectFile: projectSource,
133
- finish: (rootArtifactSha256, applicationGraph, analysis) => finishWith(createJavaScriptSemanticGraph, rootArtifactSha256, applicationGraph, analysis),
134
- finishImmutableSteps: (rootArtifactSha256, applicationGraph, analysis) => finishWith(createImmutableJavaScriptSemanticGraphSteps, rootArtifactSha256, applicationGraph, analysis),
155
+ remainingFileNodeBudget: () => Math.min(SEMANTIC_GRAPH_FILE_NODE_CEILING, Math.max(0, SEMANTIC_GRAPH_NODE_CEILING - state.nodes.size)),
156
+ adoptFileProjection: (projection) => {
157
+ const newNodes = projection.nodes.filter(({ node_id }) => !state.nodes.has(node_id));
158
+ if (newNodes.length >
159
+ Math.min(SEMANTIC_GRAPH_FILE_NODE_CEILING, SEMANTIC_GRAPH_NODE_CEILING - state.nodes.size))
160
+ throw new RangeError("Transferred semantic nodes exceed the offered tree capacity");
161
+ for (const context of projection.evidenceContexts)
162
+ state.evidenceContexts.adopt(context);
163
+ for (const node of newNodes)
164
+ state.nodes.set(node.node_id, node);
165
+ for (const relation of projection.relations)
166
+ state.relations.set(relation.relation_id, relation);
167
+ for (const unknown of projection.unknowns)
168
+ state.unknowns.set(unknown.unknown_id, unknown);
169
+ for (const root of projection.roots)
170
+ state.roots.add(root);
171
+ fingerprints.push(...projection.fingerprints);
172
+ if (projection.truncated)
173
+ truncatedFiles += 1;
174
+ },
175
+ recordUnavailableFile: (file, reason, limits, unknownReason) => {
176
+ const retainedLimits = javaScriptAnalysisCoverageLimits(limits);
177
+ for (const limit of retainedLimits) {
178
+ executionLimits.set(JSON.stringify([limit.name, limit.value, limit.unit]), limit);
179
+ }
180
+ state.fileNodeBudget = Math.min(SEMANTIC_GRAPH_FILE_NODE_CEILING, Math.max(0, SEMANTIC_GRAPH_NODE_CEILING - state.nodes.size));
181
+ const module = retainNode(state, file, {
182
+ kind: "module",
183
+ roleKey: "module",
184
+ location: null,
185
+ label: file.path,
186
+ functionNodeId: null,
187
+ });
188
+ state.fileNodeBudget = null;
189
+ if (module !== null)
190
+ state.roots.add(module.node_id);
191
+ const evidence = {
192
+ ...observedSemanticEvidence(file, null),
193
+ authority: "unknown",
194
+ state: "unknown",
195
+ confidence: "unknown",
196
+ coverage: partialApplicationCoverage(retainedLimits, null),
197
+ limitations: [reason],
198
+ };
199
+ for (const family of JAVASCRIPT_SEMANTIC_RELATION_FAMILIES) {
200
+ const unknown = createJavaScriptSemanticGraphUnknown({
201
+ node_id: module?.node_id ?? null,
202
+ family,
203
+ relation_kinds: JAVASCRIPT_SEMANTIC_RELATIONS.filter((relation) => JAVASCRIPT_SEMANTIC_RELATION_FAMILY[relation] === family),
204
+ reason: unknownReason,
205
+ detail: reason,
206
+ candidate_node_ids: [],
207
+ evidence,
208
+ }, state.evidenceContexts);
209
+ state.unknowns.set(unknown.unknown_id, unknown);
210
+ }
211
+ unavailableFiles += 1;
212
+ if (unknownReason === "resource-limit" && retainedLimits.length > 0)
213
+ resourceTruncatedFiles += 1;
214
+ },
215
+ projectFile: (file, ir) => {
216
+ const steps = projectSourceSteps(file, ir);
217
+ while (steps.next().done !== true)
218
+ ;
219
+ },
220
+ projectFileSteps: projectSourceSteps,
221
+ finish: (rootArtifactSha256, applicationGraph) => finishWith(createJavaScriptSemanticGraph, rootArtifactSha256, applicationGraph),
222
+ finishImmutableSteps: (rootArtifactSha256, applicationGraph) => finishWith(sealTransferredJavaScriptSemanticGraphSteps, rootArtifactSha256, applicationGraph),
135
223
  };
136
224
  };
137
- const projectFile = (file, ir, state) => {
225
+ /** Project one source with the parent's remaining node capacity, retaining no full IR. */
226
+ export function* projectJavaScriptSemanticFileSteps(file, ir, nodeBudget) {
227
+ if (!Number.isSafeInteger(nodeBudget) ||
228
+ nodeBudget < 0 ||
229
+ nodeBudget > SEMANTIC_GRAPH_FILE_NODE_CEILING)
230
+ throw new RangeError("File semantic projection requires a valid offered node capacity");
231
+ const state = emptyState();
232
+ state.fileNodeBudget = nodeBudget;
233
+ state.fileNodesDropped = false;
234
+ const fingerprints = yield* projectFileSteps(file, ir, state);
235
+ return {
236
+ roots: [...state.roots],
237
+ evidenceContexts: state.evidenceContexts.contexts,
238
+ nodes: [...state.nodes.values()],
239
+ relations: [...state.relations.values()],
240
+ unknowns: [...state.unknowns.values()],
241
+ fingerprints,
242
+ truncated: Boolean(state.fileNodesDropped),
243
+ };
244
+ }
245
+ function* projectFileSteps(file, ir, state) {
246
+ yield;
138
247
  const moduleNode = retainNode(state, file, {
139
248
  kind: "module",
140
249
  roleKey: "module",
@@ -145,7 +254,12 @@ const projectFile = (file, ir, state) => {
145
254
  if (moduleNode === null)
146
255
  return [];
147
256
  state.roots.add(moduleNode.node_id);
148
- const callableNodes = new Map(ir.callables.flatMap((callable) => {
257
+ // Node creation keeps source order, which the per-file node budget relies
258
+ // on; yields between nodes do not change it.
259
+ const callableNodes = new Map();
260
+ for (const [index, callable] of ir.callables.entries()) {
261
+ if (index % 64 === 0)
262
+ yield;
149
263
  const node = retainNode(state, file, {
150
264
  kind: "function",
151
265
  roleKey: `callable:${callable.callableId}`,
@@ -155,10 +269,14 @@ const projectFile = (file, ir, state) => {
155
269
  // The label is display text; keep the exact name, which may be "".
156
270
  properties: { name: callable.name },
157
271
  });
158
- return node === null ? [] : [[callable.callableId, node]];
159
- }));
272
+ if (node !== null)
273
+ callableNodes.set(callable.callableId, node);
274
+ }
160
275
  const callableOwnerAt = createSemanticCallableOwnerLookup(ir, callableNodes);
161
- const bindingNodes = new Map(ir.bindings.flatMap((binding) => {
276
+ const bindingNodes = new Map();
277
+ for (const [index, binding] of ir.bindings.entries()) {
278
+ if (index % 64 === 0)
279
+ yield;
162
280
  const location = binding.definitions[0]?.location ?? null;
163
281
  const kind = binding.kind === "parameter" ? "parameter" : "binding";
164
282
  const owner = callableOwnerAt(location);
@@ -169,10 +287,11 @@ const projectFile = (file, ir, state) => {
169
287
  label: binding.name,
170
288
  functionNodeId: owner?.node_id ?? null,
171
289
  });
172
- return node === null ? [] : [[binding.bindingId, node]];
173
- }));
174
- const returnSiteNodes = createReturnSiteNodes(file, ir, callableNodes, state);
175
- const callSiteNodes = createCallSiteNodes(file, ir, callableNodes, state);
290
+ if (node !== null)
291
+ bindingNodes.set(binding.bindingId, node);
292
+ }
293
+ const returnSiteNodes = yield* createReturnSiteNodes(file, ir, callableNodes, state);
294
+ const callSiteNodes = yield* createCallSiteNodes(file, ir, callableNodes, state);
176
295
  const definitions = {
177
296
  file,
178
297
  ir,
@@ -191,29 +310,28 @@ const projectFile = (file, ir, state) => {
191
310
  callableOwnerAt,
192
311
  callSiteAt: createSemanticCallSiteLookup(ir, callSiteNodes),
193
312
  };
194
- projectDefinitionsAndReferences(definitions);
313
+ yield* projectDefinitionsAndReferences(definitions);
195
314
  const context = {
196
315
  ...definitions,
197
316
  referenceNodesWithin: createSemanticNodeRangeLookup(definitions.referenceNodes),
198
317
  };
199
- projectSemanticValues(context);
200
- projectSemanticObjects(context);
201
- projectCalls(context);
202
- projectSemanticPromises(context);
203
- projectSemanticEvents(context);
204
- projectSemanticTimers(context);
205
- projectSemanticChildProcesses(context);
206
- projectSemanticConfiguration(context);
207
- projectSemanticRequests(context);
208
- projectSemanticBoundaries(context);
209
- projectSemanticResources(context);
210
- projectSemanticClosureCaptures(context);
211
- projectSemanticFrontiers(context);
212
- return projectSemanticFunctionFingerprints(file, ir, callableNodes);
213
- };
214
- const createReturnSiteNodes = (file, ir, callables, state) => {
318
+ // Each pass completes before the next starts, so yielding between passes
319
+ // keeps projection order and results unchanged.
320
+ for (const project of FILE_PROJECTION_PASSES) {
321
+ yield;
322
+ const steps = project(context);
323
+ if (steps !== undefined)
324
+ while (steps.next().done !== true)
325
+ yield;
326
+ }
327
+ yield;
328
+ return projectSemanticFunctionFingerprints(file, ir, callableNodes, state.evidenceContexts);
329
+ }
330
+ function* createReturnSiteNodes(file, ir, callables, state) {
215
331
  const result = new Map();
216
- for (const callable of ir.callables) {
332
+ for (const [index, callable] of ir.callables.entries()) {
333
+ if (index % 64 === 0)
334
+ yield;
217
335
  const owner = callables.get(callable.callableId);
218
336
  if (owner === undefined)
219
337
  continue;
@@ -231,10 +349,12 @@ const createReturnSiteNodes = (file, ir, callables, state) => {
231
349
  }
232
350
  }
233
351
  return result;
234
- };
235
- const createCallSiteNodes = (file, ir, callables, state) => {
352
+ }
353
+ function* createCallSiteNodes(file, ir, callables, state) {
236
354
  const result = new Map();
237
- for (const call of ir.callSites) {
355
+ for (const [index, call] of ir.callSites.entries()) {
356
+ if (index % 64 === 0)
357
+ yield;
238
358
  const owner = call.callerCallableId === null
239
359
  ? null
240
360
  : (callables.get(call.callerCallableId)?.node_id ?? null);
@@ -249,9 +369,11 @@ const createCallSiteNodes = (file, ir, callables, state) => {
249
369
  result.set(call.callSiteId, node);
250
370
  }
251
371
  return result;
252
- };
253
- const projectDefinitionsAndReferences = (context) => {
254
- for (const binding of context.ir.bindings) {
372
+ }
373
+ function* projectDefinitionsAndReferences(context) {
374
+ for (const [bindingIndex, binding] of context.ir.bindings.entries()) {
375
+ if (bindingIndex % 64 === 0)
376
+ yield;
255
377
  const bindingNode = context.bindingNodes.get(binding.bindingId);
256
378
  if (bindingNode === undefined)
257
379
  continue;
@@ -272,6 +394,8 @@ const projectDefinitionsAndReferences = (context) => {
272
394
  }
273
395
  }
274
396
  for (const [index, reference] of context.ir.references.entries()) {
397
+ if (index % 64 === 0)
398
+ yield;
275
399
  const expression = retainNode(context.state, context.file, {
276
400
  kind: "expression",
277
401
  roleKey: `reference:${String(index)}:${reference.role}:${reference.name}`,
@@ -302,7 +426,7 @@ const projectDefinitionsAndReferences = (context) => {
302
426
  resolution: "resolved",
303
427
  });
304
428
  }
305
- };
429
+ }
306
430
  const projectCalls = (context) => {
307
431
  for (const call of context.ir.callSites) {
308
432
  const callNode = context.callSiteNodes.get(call.callSiteId);
@@ -369,3 +493,19 @@ const createArgumentNode = (context, callNode, callSiteId, argument) => retainNo
369
493
  : `argument ${String(argument.index)}`,
370
494
  functionNodeId: callNode.function_node_id,
371
495
  });
496
+ /** Per-file projection passes, run in this order with a yield between each. */
497
+ const FILE_PROJECTION_PASSES = [
498
+ projectSemanticValues,
499
+ projectSemanticObjects,
500
+ projectCalls,
501
+ projectSemanticPromises,
502
+ projectSemanticEvents,
503
+ projectSemanticTimers,
504
+ projectSemanticChildProcesses,
505
+ projectSemanticConfiguration,
506
+ projectSemanticRequests,
507
+ projectSemanticBoundaries,
508
+ projectSemanticResources,
509
+ projectSemanticClosureCaptures,
510
+ projectSemanticFrontiers,
511
+ ];
@@ -161,5 +161,5 @@ const addChildUnknown = (input) => {
161
161
  detail,
162
162
  candidate_node_ids: candidateNodeIds,
163
163
  evidence: unknownSemanticEvidence(context.file, location),
164
- }));
164
+ }, context.state.evidenceContexts));
165
165
  };
@@ -1,25 +1,22 @@
1
1
  import { javascriptDisplayText } from "../../domain/javascript/javascriptAstValues.js";
2
- import { createJavaScriptSemanticGraphNode, createJavaScriptSemanticGraphRelation, javaScriptSemanticNodeId, } from "../../domain/javascript/javascriptSemanticGraph.js";
2
+ import { createJavaScriptSemanticGraphNode, createJavaScriptSemanticGraphRelation, JavaScriptSemanticEvidenceContextRegistry, javaScriptSemanticNodeId, } from "../../domain/javascript/javascriptSemanticGraph.js";
3
3
  import { inferredSemanticEvidence, observedSemanticEvidence, unavailableSemanticRootEvidence, } from "./JavaScriptSemanticGraphEvidence.js";
4
- /** Create empty projection state with structural application-node mappings. */
5
- export const createSemanticGraphProjectionState = (applicationGraph) => {
6
- const index = indexApplicationNodes(applicationGraph.nodes);
7
- return {
8
- nodes: new Map(),
9
- relations: new Map(),
10
- unknowns: new Map(),
11
- roots: new Set(),
12
- applicationNodeIdsByLocation: index.identifiers,
13
- };
14
- };
4
+ /** Create empty projection state; application-node links are bound at finish. */
5
+ export const createSemanticGraphProjectionState = () => ({
6
+ nodes: new Map(),
7
+ relations: new Map(),
8
+ unknowns: new Map(),
9
+ evidenceContexts: new JavaScriptSemanticEvidenceContextRegistry(),
10
+ roots: new Set(),
11
+ });
15
12
  /** Bind retained semantic identities after all application observations exist. */
16
13
  export const bindSemanticGraphApplicationNodes = (state, applicationGraph) => {
17
- const index = indexApplicationNodes(applicationGraph.nodes).identifiers;
14
+ const applicationNodeIdsByLocation = indexApplicationNodes(applicationGraph.nodes);
18
15
  for (const [identifier, node] of state.nodes) {
19
16
  state.nodes.set(identifier, {
20
17
  ...node,
21
18
  application_node_ids: [
22
- ...(index.get(applicationLocationKey(node.identity.artifact_sha256, node.identity.module_path, node.identity.source_range)) ?? []),
19
+ ...(applicationNodeIdsByLocation.get(applicationLocationKey(node.identity.artifact_sha256, node.identity.module_path, node.identity.source_range)) ?? []),
23
20
  ],
24
21
  });
25
22
  }
@@ -34,11 +31,11 @@ export const constructSemanticGraphNode = (file, input, state) => createJavaScri
34
31
  role_key: input.roleKey,
35
32
  },
36
33
  function_node_id: input.functionNodeId,
37
- application_node_ids: matchingApplicationNodeIds(file, input, state),
34
+ application_node_ids: [],
38
35
  label: input.label === null ? null : javascriptDisplayText(input.label),
39
36
  properties: input.properties ?? {},
40
37
  evidence: observedSemanticEvidence(file, input.location),
41
- });
38
+ }, state.evidenceContexts);
42
39
  /** Reuse retained identities and reject exhausted budgets before allocation. */
43
40
  export const retainSemanticGraphNode = (state, file, input) => {
44
41
  const identifier = javaScriptSemanticNodeId({
@@ -89,8 +86,9 @@ export const addSemanticGraphRelation = (state, input) => {
89
86
  relation: input.relation,
90
87
  resolution: input.resolution ?? "candidate",
91
88
  properties: input.properties ?? {},
92
- evidence: input.evidence ?? inferredSemanticEvidence(input.source),
93
- });
89
+ evidence: input.evidence ??
90
+ inferredSemanticEvidence(state.evidenceContexts.resolve(input.source.evidence)),
91
+ }, state.evidenceContexts);
94
92
  if (state.relations.has(value.relation_id))
95
93
  return;
96
94
  state.relations.set(value.relation_id, value);
@@ -116,7 +114,7 @@ export const addSemanticFallbackRoot = (rootArtifactSha256, state) => {
116
114
  label: "unavailable semantic root",
117
115
  properties: {},
118
116
  evidence: unavailableSemanticRootEvidence(rootArtifactSha256),
119
- }));
117
+ }, state.evidenceContexts));
120
118
  if (node !== null)
121
119
  state.roots.add(node.node_id);
122
120
  };
@@ -142,11 +140,8 @@ const indexApplicationNodes = (nodes) => {
142
140
  const sorted = [...values].sort();
143
141
  return [key, sorted];
144
142
  }));
145
- return { identifiers: indexed };
143
+ return indexed;
146
144
  };
147
- const matchingApplicationNodeIds = (file, input, state) => [
148
- ...(state.applicationNodeIdsByLocation.get(applicationLocationKey(file.sha256, file.path, input.location)) ?? []),
149
- ];
150
145
  const addApplicationNodeIdentifier = (identifiers, key, nodeId) => {
151
146
  const values = identifiers.get(key) ?? new Set();
152
147
  values.add(nodeId);
@@ -97,7 +97,10 @@ const addRequestNode = (context, operation) => retainSemanticGraphNode(context.s
97
97
  kind: operation.kind === "request" ? "request" : "response",
98
98
  roleKey: operation.requestId,
99
99
  location: operation.location,
100
- label: operation.endpoint ?? operation.method,
100
+ label: operation.endpoint !== null &&
101
+ operation.endpoint.length <= operation.method.length
102
+ ? operation.endpoint
103
+ : operation.method,
101
104
  functionNodeId: operation.ownerCallableId === null
102
105
  ? null
103
106
  : (context.callableNodes.get(operation.ownerCallableId)?.node_id ??
@@ -209,5 +212,5 @@ const addDataUnknown = (input) => {
209
212
  detail,
210
213
  candidate_node_ids: candidateNodeIds,
211
214
  evidence: unknownSemanticEvidence(context.file, location),
212
- }));
215
+ }, context.state.evidenceContexts));
213
216
  };
@@ -32,7 +32,7 @@ export const observedSemanticEvidence = (file, location) => ({
32
32
  });
33
33
  /** Conservative static relationship evidence derived from one syntax node. */
34
34
  export const inferredSemanticEvidence = (source) => ({
35
- ...source.evidence,
35
+ ...source,
36
36
  authority: "static-relationship-inference",
37
37
  state: "inferred",
38
38
  confidence: "high",
@@ -1,7 +1,7 @@
1
1
  import { createJavaScriptSemanticFingerprint, } from "../../domain/javascript/javascriptSemanticGraph.js";
2
2
  import { observedSemanticEvidence } from "./JavaScriptSemanticGraphEvidence.js";
3
3
  /** Bind domain fingerprint components to exact semantic function nodes. */
4
- export const projectSemanticFunctionFingerprints = (file, ir, callableNodes) => ir.functionFingerprints.flatMap((fingerprint) => {
4
+ export const projectSemanticFunctionFingerprints = (file, ir, callableNodes, evidenceContexts) => ir.functionFingerprints.flatMap((fingerprint) => {
5
5
  const callable = callableNodes.get(fingerprint.callableId);
6
6
  if (callable === undefined)
7
7
  return [];
@@ -20,6 +20,6 @@ export const projectSemanticFunctionFingerprints = (file, ir, callableNodes) =>
20
20
  },
21
21
  limitations: fingerprint.limitations,
22
22
  evidence: observedSemanticEvidence(file, callable.identity.source_range),
23
- }),
23
+ }, evidenceContexts),
24
24
  ];
25
25
  });
@@ -119,7 +119,7 @@ const addPromiseUnknown = (context, operation, promise, promiseNodes) => {
119
119
  return candidate === undefined ? [] : [candidate.node_id];
120
120
  }),
121
121
  evidence: unknownSemanticEvidence(context.file, operation.location),
122
- }));
122
+ }, context.state.evidenceContexts));
123
123
  };
124
124
  /** Link direct return expressions to their retained semantic references. */
125
125
  export const projectSemanticReturnValues = (context) => {
@@ -151,8 +151,10 @@ export const projectSemanticClosureCaptures = (context) => {
151
151
  });
152
152
  };
153
153
  /** Retain bounded unresolved dynamic-call, dynamic-property and dynamic-scope frontiers. */
154
- export const projectSemanticFrontiers = (context) => {
155
- for (const frontier of context.ir.frontiers) {
154
+ export function* projectSemanticFrontiers(context) {
155
+ for (const [index, frontier] of context.ir.frontiers.entries()) {
156
+ if (index % 64 === 0)
157
+ yield;
156
158
  // Dynamic environments leave identifier reads and writes unresolved.
157
159
  const family = frontier.kind === "dynamic-call"
158
160
  ? "call-flow"
@@ -175,7 +177,7 @@ export const projectSemanticFrontiers = (context) => {
175
177
  detail: frontier.reason,
176
178
  candidate_node_ids: [],
177
179
  evidence: unknownSemanticEvidence(context.file, frontier.location),
178
- });
180
+ }, context.state.evidenceContexts);
179
181
  addSemanticGraphUnknown(context.state, unknown);
180
182
  }
181
- };
183
+ }
@@ -4,9 +4,11 @@ import { retainSemanticGraphNode, addSemanticGraphRelation, addSemanticGraphUnkn
4
4
  import { unknownSemanticEvidence } from "./JavaScriptSemanticGraphEvidence.js";
5
5
  import { semanticPropertySlot } from "./JavaScriptSemanticGraphValueProjection.js";
6
6
  /** Project static object reads, writes, spreads, and destructuring. */
7
- export const projectSemanticObjects = (context) => {
7
+ export function* projectSemanticObjects(context) {
8
8
  const values = new Map(context.ir.bindings.map((binding) => [binding.bindingId, binding.value]));
9
- for (const operation of context.ir.objectOperations) {
9
+ for (const [index, operation] of context.ir.objectOperations.entries()) {
10
+ if (index % 64 === 0)
11
+ yield;
10
12
  const occurrence = addObjectOccurrence(context, operation);
11
13
  const target = objectTarget(context, values, operation);
12
14
  const ends = objectRelationEnds(context, operation, occurrence, target);
@@ -22,7 +24,7 @@ export const projectSemanticObjects = (context) => {
22
24
  if (!resolved)
23
25
  addObjectUnknown(context, operation, target.slot ?? occurrence, target);
24
26
  }
25
- };
27
+ }
26
28
  const OBJECT_RELATIONS = {
27
29
  read: "reads-property",
28
30
  write: "writes-property",
@@ -106,5 +108,5 @@ const addObjectUnknown = (context, operation, node, target) => {
106
108
  detail: `Static ${operation.kind} property ${operation.propertyPath === null ? "path is unresolved" : semanticPropertyPointer(operation.propertyPath)} has ${target.presence} presence; its receiver is ${target.receiverResolved ? "a retained container" : "unresolved or not a retained container"}; object identity is ${operation.resolution}.`,
107
109
  candidate_node_ids: [],
108
110
  evidence: unknownSemanticEvidence(context.file, operation.location),
109
- }));
111
+ }, context.state.evidenceContexts));
110
112
  };
@@ -1,4 +1,4 @@
1
- import { compareCodePoints } from "../../domain/canonicalOrdering.js";
1
+ import { compareUnicodeCodePoints } from "../../domain/unicodeCodePointOrder.js";
2
2
  import { JAVASCRIPT_SEMANTIC_RELATION_FAMILIES } from "../../domain/javascript/javascriptSemanticGraphSchemas.js";
3
3
  /** Index one immutable file IR; read retained callable membership at query time. */
4
4
  export const createSemanticCallableOwnerLookup = (ir, nodes) => {
@@ -29,7 +29,7 @@ export const createSemanticCallableOwnerLookup = (ir, nodes) => {
29
29
  const node = nodes.get(candidate.callableId);
30
30
  const rank = best === undefined
31
31
  ? 1
32
- : compareCodePoints(candidate.priority, best.priority) ||
32
+ : compareUnicodeCodePoints(candidate.priority, best.priority) ||
33
33
  best.order - candidate.order;
34
34
  if (node !== undefined && rank > 0) {
35
35
  best = candidate;
@@ -120,7 +120,7 @@ export const createSemanticCallSiteLookup = (ir, nodes) => {
120
120
  };
121
121
  const rangeKey = (range) => `${range.start.line}:${range.start.column}-${range.end.line}:${range.end.column}`;
122
122
  /** Report extractor support without treating missing families as absence. */
123
- export const semanticFamilyStatus = (family, analysis) => {
123
+ export const semanticFamilyStatus = (family) => {
124
124
  if (![
125
125
  "call-flow",
126
126
  "boundary",
@@ -136,7 +136,7 @@ export const semanticFamilyStatus = (family, analysis) => {
136
136
  "timer",
137
137
  ].includes(family))
138
138
  return "unsupported";
139
- return analysis.truncated_scopes === 0 ? "partial" : "unknown";
139
+ return "partial";
140
140
  };
141
141
  const contains = (outer, inner) => pointCompare(outer.start, inner.start) <= 0 &&
142
142
  pointCompare(outer.end, inner.end) >= 0;
@@ -54,5 +54,5 @@ const projectRelease = (context, operation, resourceNodes) => {
54
54
  detail: `Static ${operation.method} resource ownership is ambiguous.`,
55
55
  candidate_node_ids: resources.map(({ node_id: identifier }) => identifier),
56
56
  evidence: unknownSemanticEvidence(context.file, operation.location),
57
- }));
57
+ }, context.state.evidenceContexts));
58
58
  };