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.
- package/README.md +24 -23
- package/bridge/ghidra/ReaGhidraApplySeeds.java +151 -0
- package/bridge/ghidra/ReaGhidraBridge.java +597 -209
- package/bridge/ghidra/ReaGhidraNoReturnFix.java +123 -0
- package/bridge/hopper_bridge.py +2 -0
- package/dist/adb/AdbConfiguration.js +88 -0
- package/dist/adb/AdbDeviceOutput.js +186 -0
- package/dist/adb/AdbProvider.js +1190 -0
- package/dist/adb/AdbShellOutput.js +309 -0
- package/dist/android/AndroidTargetSnapshot.js +104 -22
- package/dist/android/JadxConfiguration.js +44 -24
- package/dist/android/JadxProvider.js +59 -21
- package/dist/android/JadxSession.js +51 -9
- package/dist/apktool/ApktoolConfiguration.js +84 -0
- package/dist/apktool/ApktoolDecodeOutput.js +59 -0
- package/dist/apktool/ApktoolProvider.js +506 -0
- package/dist/application/AnalysisProvider.js +8 -2
- package/dist/application/AppBundleExecutable.js +27 -22
- package/dist/application/BinaryTargetResolver.js +85 -19
- package/dist/application/BrowserScenarioEvidence.js +2 -2
- package/dist/application/CapabilityInventory.js +11 -1
- package/dist/application/ClientConfigurationDocument.js +98 -0
- package/dist/application/ClientConfigurationFiles.js +91 -0
- package/dist/application/ClientRegistrationEnvironment.js +35 -0
- package/dist/application/ClientRegistrationStatus.js +75 -27
- package/dist/application/DirectAnalysis.js +14 -8
- package/dist/application/DirectAnalysisCleanup.js +1 -2
- package/dist/application/DirectAnalysisStatus.js +3 -6
- package/dist/application/Doctor.js +27 -34
- package/dist/application/DoctorDiagnostics.js +1 -1
- package/dist/application/EvidenceBundleCommands.js +6 -12
- package/dist/application/EvidenceBundleFiles.js +1 -1
- package/dist/application/GeminiClientSettings.js +139 -0
- package/dist/application/HermesClientHome.js +115 -0
- package/dist/application/HopperDownload.js +39 -0
- package/dist/application/InvestigationProviders.js +10 -4
- package/dist/application/JsonFiles.js +16 -15
- package/dist/application/JsonInputFile.js +252 -0
- package/dist/application/LinuxHopper.js +6 -13
- package/dist/application/MacHopper.js +172 -149
- package/dist/application/MipsElfAbiFlags.js +140 -0
- package/dist/application/ProviderOperationExecution.js +31 -0
- package/dist/application/ReconstructionObligationCandidates.js +16 -3
- package/dist/application/ReconstructionObligationLedgerProjection.js +3 -1
- package/dist/application/ReferenceSourceImport.js +76 -29
- package/dist/application/ReferenceSourceImportEntries.js +18 -9
- package/dist/application/ReferenceSourceImportPolicy.js +99 -23
- package/dist/application/ReferenceSourceImportTypes.js +30 -22
- package/dist/application/ReferenceSourceVcsAdapter.js +145 -30
- package/dist/application/RegularFileRead.js +103 -0
- package/dist/application/Setup.js +69 -10
- package/dist/application/SetupClientConfiguration.js +134 -23
- package/dist/application/SetupHost.js +102 -22
- package/dist/application/SetupPlan.js +18 -17
- package/dist/application/SetupSkill.js +81 -13
- package/dist/application/SupportedClients.js +305 -37
- package/dist/application/Uninstall.js +172 -8
- package/dist/application/UpdateMaintenance.js +23 -23
- package/dist/application/Utf8JsonInput.js +71 -0
- package/dist/application/WebScriptExportService.js +130 -57
- package/dist/application/WebSourceLocationService.js +3 -0
- package/dist/application/adb/AdbDeviceAnalysisPort.js +1 -0
- package/dist/application/adb/AdbDeviceAnalysisService.js +13 -0
- package/dist/application/analysisView/AnalysisViewService.js +40 -2
- package/dist/application/android/AndroidAnalysisService.js +1 -1
- package/dist/application/apktool/ApktoolResourceAnalysisPort.js +1 -0
- package/dist/application/apktool/ApktoolResourceAnalysisService.js +13 -0
- package/dist/application/binary/AnalysisClientCleanup.js +0 -24
- package/dist/application/binary/AnalysisSnapshotCache.js +5 -4
- package/dist/application/binary/BinarySession.js +18 -1
- package/dist/application/binary/BinarySessionOpen.js +9 -1
- package/dist/application/binaryDiagnostics/BinaryLayoutService.js +2 -1
- package/dist/application/binaryDiagnostics/PeResourcesPort.js +1 -0
- package/dist/application/binaryDiagnostics/PeResourcesService.js +111 -0
- package/dist/application/binaryDiagnostics/RecordedCrashService.js +2 -1
- package/dist/application/evm/EvmInterfaceService.js +3 -0
- package/dist/application/firmware/FirmwareAnalysisService.js +3 -0
- package/dist/application/investigation/InspectEvidenceBundle.js +18 -0
- package/dist/application/javascript/ElectronActiveEvidence.js +2 -2
- package/dist/application/javascript/ElectronBoundaryAnalysis.js +2 -2
- package/dist/application/javascript/ElectronBoundaryGraphContext.js +3 -2
- package/dist/application/javascript/ElectronBoundaryGraphIpc.js +2 -2
- package/dist/application/javascript/ElectronBoundaryGraphNative.js +20 -3
- package/dist/application/javascript/ElectronBoundaryGraphWindows.js +3 -3
- package/dist/application/javascript/JavaScriptApplicationEvidence.js +1 -0
- package/dist/application/javascript/JavaScriptApplicationEvidenceGraph.js +107 -46
- package/dist/application/javascript/JavaScriptApplicationService.js +23 -11
- package/dist/application/javascript/JavaScriptApplicationWorkflowEvidence.js +5 -6
- package/dist/application/javascript/JavaScriptApplicationWorkflowService.js +59 -45
- package/dist/application/javascript/JavaScriptArtifactAnalysis.js +171 -36
- package/dist/application/javascript/JavaScriptArtifactGraphAccumulator.js +14 -16
- package/dist/application/javascript/JavaScriptArtifactGraphBuilder.js +74 -36
- package/dist/application/javascript/JavaScriptArtifactGraphBundlers.js +4 -3
- package/dist/application/javascript/JavaScriptArtifactGraphContext.js +11 -5
- package/dist/application/javascript/JavaScriptArtifactGraphFindings.js +53 -42
- package/dist/application/javascript/JavaScriptArtifactGraphStructure.js +92 -10
- package/dist/application/javascript/JavaScriptArtifactPathResolution.js +293 -238
- package/dist/application/javascript/JavaScriptArtifactReconstruction.js +120 -28
- package/dist/application/javascript/JavaScriptArtifactReconstructionInput.js +4 -0
- package/dist/application/javascript/JavaScriptJsonModules.js +2 -2
- package/dist/application/javascript/JavaScriptModuleRelationships.js +10 -20
- package/dist/application/javascript/JavaScriptRecoveryService.js +3 -0
- package/dist/application/javascript/JavaScriptRuntimeReconciliationService.js +11 -27
- package/dist/application/javascript/JavaScriptSemanticGraphAsyncProjection.js +11 -5
- package/dist/application/javascript/JavaScriptSemanticGraphBuilder.js +206 -66
- package/dist/application/javascript/JavaScriptSemanticGraphChildProcessProjection.js +1 -1
- package/dist/application/javascript/JavaScriptSemanticGraphConstruction.js +18 -23
- package/dist/application/javascript/JavaScriptSemanticGraphDataProjection.js +5 -2
- package/dist/application/javascript/JavaScriptSemanticGraphEvidence.js +1 -1
- package/dist/application/javascript/JavaScriptSemanticGraphFingerprintProjection.js +2 -2
- package/dist/application/javascript/JavaScriptSemanticGraphFlowProjection.js +7 -5
- package/dist/application/javascript/JavaScriptSemanticGraphObjectProjection.js +6 -4
- package/dist/application/javascript/JavaScriptSemanticGraphProjection.js +4 -4
- package/dist/application/javascript/JavaScriptSemanticGraphResourceProjection.js +1 -1
- package/dist/application/javascript/JavaScriptSemanticGraphValueProjection.js +29 -15
- package/dist/application/javascript/JavaScriptSemanticTraceService.js +15 -10
- package/dist/application/jeb/JebAnalysisPort.js +1 -0
- package/dist/application/jeb/JebAnalysisService.js +13 -0
- package/dist/application/managed/ManagedApplicationGraphService.js +1 -1
- package/dist/application/native/NativeCallRoutes.js +2 -4
- package/dist/application/native/NativeUiActionTrace.js +16 -8
- package/dist/application/native/NativeValueTrace.js +23 -6
- package/dist/application/process/ProcessCli.js +25 -20
- package/dist/artifacts/ArtifactPaths.js +129 -8
- package/dist/artifacts/ArtifactProvider.js +34 -31
- package/dist/artifacts/ArtifactProviderMetadata.js +1 -4
- package/dist/artifacts/ArtifactReader.js +23 -0
- package/dist/artifacts/ArtifactResourceScope.js +100 -0
- package/dist/artifacts/AsarArtifactReader.js +218 -80
- package/dist/artifacts/AsarHeader.js +24 -0
- package/dist/artifacts/DirectoryArtifactReader.js +168 -65
- package/dist/artifacts/MachOSliceArtifactReader.js +116 -39
- package/dist/artifacts/NativeDmgArtifactReader.js +179 -87
- package/dist/artifacts/NativeDmgOwnership.js +109 -0
- package/dist/artifacts/SafeOutputTree.js +245 -70
- package/dist/artifacts/SafeOutputTreeCleanup.js +45 -0
- package/dist/artifacts/SafeOutputTreeCreationFailure.js +20 -0
- package/dist/artifacts/SafeOutputTreeIdentity.js +42 -0
- package/dist/artifacts/SafeOutputTreeReadback.js +33 -0
- package/dist/artifacts/ZipArtifactReader.js +77 -27
- package/dist/artifacts/apple/InterfaceBuilderAnalysis.js +58 -18
- package/dist/artifacts/apple/InterfaceBuilderDecodeBudget.js +62 -24
- package/dist/artifacts/apple/KeyedArchiveReader.js +76 -49
- package/dist/artifacts/apple/MachoLoadCommandReader.js +36 -6
- package/dist/artifacts/extraction/ArtifactExtraction.js +134 -92
- package/dist/artifacts/inventory/ArtifactGraphConstruction.js +116 -50
- package/dist/artifacts/inventory/ArtifactInventory.js +5 -4
- package/dist/artifacts/inventory/classify.js +87 -25
- package/dist/artifacts/inventory/hashStableRootArtifact.js +70 -0
- package/dist/artifacts/inventory/reader.js +13 -5
- package/dist/artifacts/inventory/scanCanonical.js +73 -30
- package/dist/artifacts/inventory/scanReader.js +43 -20
- package/dist/artifacts/javascript/JavaScriptArtifactFiles.js +72 -28
- package/dist/artifacts/javascript/JavaScriptSourceAnalysis.js +3 -0
- package/dist/browser/BrowserScenarioPartialObservation.js +8 -2
- package/dist/browser/BrowserScenarioSecrets.js +52 -37
- package/dist/browser/CdpBrowserProvider.js +9 -3
- package/dist/browser/CdpCaptureDocuments.js +40 -6
- package/dist/browser/CdpCaptureDomSvg.js +210 -0
- package/dist/browser/CdpCaptureEventBodyShapes.js +4 -8
- package/dist/browser/CdpCaptureEventHandlers.js +26 -9
- package/dist/browser/CdpCaptureEvents.js +4 -9
- package/dist/browser/CdpCaptureStorageFingerprints.js +3 -3
- package/dist/browser/CdpConnection.js +22 -5
- package/dist/browser/CdpElectronInspection.js +2 -2
- package/dist/browser/CdpElectronProvider.js +4 -3
- package/dist/browser/CdpElectronScripts.js +2 -2
- package/dist/browser/CdpPageCapture.js +1 -1
- package/dist/browser/CdpTargetSession.js +30 -34
- package/dist/browser/CdpWebMcpDiscovery.js +48 -23
- package/dist/browser/ElectronFileScope.js +99 -9
- package/dist/browser/PlaywrightBrowserScenarioProvider.js +63 -7
- package/dist/browser/PlaywrightElectronActiveProvider.js +11 -6
- package/dist/browser/PlaywrightScenarioArtifacts.js +5 -5
- package/dist/browser/PlaywrightScenarioBrowser.js +208 -43
- package/dist/browser/PlaywrightScenarioSession.js +130 -65
- package/dist/browser/PlaywrightScenarioStorage.js +507 -0
- package/dist/browser/PngVisualDiff.js +198 -29
- package/dist/browser/WebSourceMapFetcher.js +35 -9
- package/dist/browser/assets/LocalWebScriptArtifacts.js +3 -1
- package/dist/browser/assets/PublishWebScripts.js +75 -20
- package/dist/browser/assets/ScenarioScriptCapture.js +8 -12
- package/dist/browser/assets/WebArtifactReads.js +23 -1
- package/dist/browser/assets/WebSourceLocationArtifacts.js +1 -0
- package/dist/browser/execution/CdpExecutionCapture.js +3 -3
- package/dist/browser/execution/CdpPreciseCoverage.js +5 -8
- package/dist/browser/history/HarCapture.js +14 -0
- package/dist/browser/history/HarCaptureProcess.js +2 -10
- package/dist/browser/history/MitmproxyCaptureAdapter.js +3 -1
- package/dist/browser/modules/WebModuleArtifacts.js +1 -0
- package/dist/cli/adbCommands.js +337 -0
- package/dist/cli/analysisViewCommands.js +39 -1
- package/dist/cli/apktoolCommands.js +53 -0
- package/dist/cli/artifactCommands.js +8 -11
- package/dist/cli/binaryDiagnosticsCommands.js +19 -1
- package/dist/cli/browserAdvancedCommands.js +65 -36
- package/dist/cli/coreAnalysisCommands.js +2 -2
- package/dist/cli/coreBinaryCommands.js +12 -13
- package/dist/cli/coreNativeCommands.js +1 -14
- package/dist/cli/electronCommands.js +14 -10
- package/dist/cli/evmCommands.js +13 -4
- package/dist/cli/firmwareCommands.js +7 -2
- package/dist/cli/javascriptApplicationAnalysis.js +19 -13
- package/dist/cli/javascriptRecoveryCommands.js +22 -15
- package/dist/cli/jebCommands.js +99 -0
- package/dist/cli/jsonOutput.js +12 -4
- package/dist/cli/referenceSourceImportStatus.js +7 -0
- package/dist/cli/setupCommands.js +15 -3
- package/dist/cli/streamedJsonOutput.js +83 -4
- package/dist/cli/utilityCommands.js +68 -22
- package/dist/cli/webScriptCommands.js +20 -1
- package/dist/cli/webSourceLocationCommands.js +21 -9
- package/dist/cli.js +11 -2
- package/dist/cliBrowserScenarioCommands.js +2 -1
- package/dist/cliCommandNames.js +32 -0
- package/dist/cliJsonInput.js +47 -34
- package/dist/cliObservationOptions.js +7 -0
- package/dist/composition/adb.js +3 -0
- package/dist/composition/apktool.js +3 -0
- package/dist/composition/auxiliaryAnalysisProviders.js +5 -4
- package/dist/composition/binaryDiagnostics.js +4 -0
- package/dist/composition/browserScenario.js +2 -2
- package/dist/composition/directAnalysis.js +14 -7
- package/dist/composition/javascriptAnalysisWorkerProcess.js +48 -0
- package/dist/composition/jeb.js +6 -0
- package/dist/config/environment.js +10 -0
- package/dist/config/ghidraLanguageOverride.js +9 -0
- package/dist/config/mcpInputSchemaProfile.js +27 -0
- package/dist/config/parseConfig.js +28 -1
- package/dist/contracts/adb/adbToolContracts.js +353 -0
- package/dist/contracts/advertisedInputExamples.js +48 -0
- package/dist/contracts/analysisDetail.js +10 -0
- package/dist/contracts/analysisViewToolContracts.js +17 -2
- package/dist/contracts/apktool/apktoolToolContracts.js +33 -0
- package/dist/contracts/artifactComparisonExample.js +5 -5
- package/dist/contracts/artifactToolContracts.js +8 -5
- package/dist/contracts/browserToolContracts.js +1 -1
- package/dist/contracts/compactInputSchema.js +256 -0
- package/dist/contracts/errorSchemas.js +3 -1
- package/dist/contracts/functionComparisonExample.js +8 -0
- package/dist/contracts/functionWorkflowToolContracts.js +1 -1
- package/dist/contracts/inputSchemaPresentation.js +104 -13
- package/dist/contracts/javascript/electronToolContracts.js +16 -3
- package/dist/contracts/javascript/javascriptApplicationWorkflowExamples.js +3 -2
- package/dist/contracts/javascript/javascriptExportShapeComparisonExample.js +6 -3
- package/dist/contracts/javascript/javascriptRecoveryToolContracts.js +1 -1
- package/dist/contracts/javascript/javascriptRuntimeReconciliationExample.js +8 -7
- package/dist/contracts/jeb/jebToolContracts.js +64 -0
- package/dist/contracts/managed/managedToolContracts.js +3 -2
- package/dist/contracts/mobileApplicationGraphExamples.js +5 -5
- package/dist/contracts/native/binaryDiagnosticsToolContracts.js +25 -3
- package/dist/contracts/native/nativeToolContracts.js +1 -1
- package/dist/contracts/officialToolContracts.js +5 -5
- package/dist/contracts/sessionLifecycleInputs.js +4 -3
- package/dist/contracts/sessionStatusContract.js +3 -2
- package/dist/contracts/sessionToolContracts.js +5 -4
- package/dist/contracts/sessionToolSchemas.js +9 -4
- package/dist/contracts/toolContractExamples.js +6 -0
- package/dist/contracts/toolContractTypes.js +3 -0
- package/dist/contracts/toolContracts.js +6 -0
- package/dist/contracts/toolEffects.js +167 -0
- package/dist/contracts/toolOutputSchemaGroups.js +7 -5
- package/dist/contracts/toolOutputSchemaPrimitives.js +2 -5
- package/dist/contracts/toolSchemaMetadata.js +82 -7
- package/dist/domain/adb/adbDeviceAnalysis.js +583 -0
- package/dist/domain/analysisErrorBase.js +5 -0
- package/dist/domain/analysisErrorCleanup.js +29 -0
- package/dist/domain/analysisErrorPresentation.js +18 -4
- package/dist/domain/analysisErrorProjection.js +4 -1
- package/dist/domain/analysisSnapshot.js +5 -2
- package/dist/domain/analysisView/analysisView.js +53 -5
- package/dist/domain/analysisView/binaryLayoutView.js +2 -0
- package/dist/domain/analysisView/javascriptApplicationView.js +2 -0
- package/dist/domain/analysisView/nativeFunctionView.js +155 -0
- package/dist/domain/android/androidApplication.js +25 -20
- package/dist/domain/android/androidPartialObservation.js +36 -0
- package/dist/domain/apktool/apktoolResourceAnalysis.js +77 -0
- package/dist/domain/apple/appleApplication.js +40 -23
- package/dist/domain/apple/appleBundleAnatomy.js +95 -28
- package/dist/domain/apple/dyldPaths.js +9 -1
- package/dist/domain/apple/dylibResolution.js +3 -3
- package/dist/domain/apple/interfaceBuilderGraph.js +22 -19
- package/dist/domain/apple/interfaceBuilderKeyedArchive.js +10 -1
- package/dist/domain/artifactComparison.js +39 -11
- package/dist/domain/artifactGraph.js +6 -4
- package/dist/domain/artifactIdentity.js +37 -9
- package/dist/domain/artifactInspection.js +10 -50
- package/dist/domain/artifactIntegrityPolicy.js +10 -0
- package/dist/domain/artifactInventoryEvidence.js +16 -17
- package/dist/domain/artifactPathSyntax.js +1 -1
- package/dist/domain/binaryTarget.js +16 -0
- package/dist/domain/binaryTargetTypes.js +8 -1
- package/dist/domain/browserCompleteness.js +3 -2
- package/dist/domain/browserObservationSchemas.js +8 -4
- package/dist/domain/browserScenarioCaptureValues.js +2 -2
- package/dist/domain/browserScenarioNormalization.js +3 -3
- package/dist/domain/browserScenarioValues.js +3 -2
- package/dist/domain/callPath.js +8 -10
- package/dist/domain/canonicalDigest.js +7 -1
- package/dist/domain/canonicalJsonDigestSteps.js +34 -12
- package/dist/domain/canonicalOrdering.js +1 -13
- package/dist/domain/changedBehavior.js +2 -3
- package/dist/domain/compactStringIdentity.js +9 -0
- package/dist/domain/comparisonSemantics.js +0 -5
- package/dist/domain/digests.js +0 -3
- package/dist/domain/evidence.js +12 -6
- package/dist/domain/evidenceBundle.js +51 -33
- package/dist/domain/evidenceRecordSummary.js +144 -0
- package/dist/domain/firmware/firmwareAnalysis.js +4 -3
- package/dist/domain/functionComparison.js +2 -1
- package/dist/domain/functionComparisonNormalization.js +4 -3
- package/dist/domain/functionComparisonResults.js +2 -2
- package/dist/domain/functionDossierEvidence.js +2 -1
- package/dist/domain/hopperValues.js +11 -15
- package/dist/domain/inputIssueProjection.js +16 -1
- package/dist/domain/javascript/electronActiveObservation.js +4 -3
- package/dist/domain/javascript/electronStaticAnalysisBrowser.js +14 -15
- package/dist/domain/javascript/electronStaticAnalysisIpc.js +20 -21
- package/dist/domain/javascript/electronStaticAnalysisNative.js +73 -41
- package/dist/domain/javascript/electronStaticAnalysisValues.js +24 -4
- package/dist/domain/javascript/javascriptAnalysisResourceControls.js +45 -0
- package/dist/domain/javascript/javascriptApplicationAnalysis.js +6 -1
- package/dist/domain/javascript/javascriptApplicationChangeGraph.js +18 -14
- package/dist/domain/javascript/javascriptApplicationEvidenceSchemas.js +4 -0
- package/dist/domain/javascript/javascriptApplicationGraph.js +91 -28
- package/dist/domain/javascript/javascriptApplicationProjectionResources.js +35 -0
- package/dist/domain/javascript/javascriptApplicationVersionComparison.js +4 -4
- package/dist/domain/javascript/javascriptApplicationVersionComparisonSchemas.js +37 -22
- package/dist/domain/javascript/javascriptApplicationVersionItems.js +72 -45
- package/dist/domain/javascript/javascriptApplicationVersionKeys.js +16 -8
- package/dist/domain/javascript/javascriptAstFingerprint.js +60 -33
- package/dist/domain/javascript/javascriptAstValues.js +54 -0
- package/dist/domain/javascript/javascriptElectronMemberWrites.js +50 -0
- package/dist/domain/javascript/javascriptExportShapeComparison.js +3 -2
- package/dist/domain/javascript/javascriptExportShapeComparisonSchemas.js +31 -23
- package/dist/domain/javascript/javascriptExportShapeSelection.js +2 -2
- package/dist/domain/javascript/javascriptExportShapeVariants.js +3 -2
- package/dist/domain/javascript/javascriptFeatureSeed.js +5 -3
- package/dist/domain/javascript/javascriptFeatureTrace.js +7 -6
- package/dist/domain/javascript/javascriptFeatureTraceSchemas.js +17 -9
- package/dist/domain/javascript/javascriptFeatureTraversal.js +4 -4
- package/dist/domain/javascript/javascriptModuleSemanticIr.js +15 -0
- package/dist/domain/javascript/javascriptNativeHandoff.js +12 -7
- package/dist/domain/javascript/javascriptRpcEndpoints.js +253 -0
- package/dist/domain/javascript/javascriptRuntimeLoadState.js +1 -3
- package/dist/domain/javascript/javascriptRuntimeObservation.js +8 -5
- package/dist/domain/javascript/javascriptRuntimeReconciliation.js +12 -6
- package/dist/domain/javascript/javascriptRuntimeReconciliationActive.js +9 -8
- package/dist/domain/javascript/javascriptRuntimeReconciliationCaptureParsing.js +212 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliationGraph.js +12 -6
- package/dist/domain/javascript/javascriptRuntimeReconciliationInputValidation.js +28 -0
- package/dist/domain/javascript/javascriptRuntimeReconciliationMatching.js +5 -5
- package/dist/domain/javascript/javascriptRuntimeReconciliationParsing.js +12 -223
- package/dist/domain/javascript/javascriptRuntimeReconciliationResult.js +2 -2
- package/dist/domain/javascript/javascriptRuntimeReconciliationRuntime.js +15 -4
- package/dist/domain/javascript/javascriptRuntimeReconciliationSchemas.js +2 -2
- package/dist/domain/javascript/javascriptRuntimeStaticCandidates.js +15 -17
- package/dist/domain/javascript/javascriptSemanticAnalysis.js +379 -30
- package/dist/domain/javascript/javascriptSemanticCallResolution.js +9 -7
- package/dist/domain/javascript/javascriptSemanticCallableResults.js +42 -0
- package/dist/domain/javascript/javascriptSemanticCalls.js +8 -1
- package/dist/domain/javascript/javascriptSemanticChildProcesses.js +2 -2
- package/dist/domain/javascript/javascriptSemanticCoverage.js +20 -0
- package/dist/domain/javascript/javascriptSemanticDataEffectHelpers.js +7 -9
- package/dist/domain/javascript/javascriptSemanticDataEffects.js +4 -11
- package/dist/domain/javascript/javascriptSemanticDerivedAnalysis.js +15 -4
- package/dist/domain/javascript/javascriptSemanticFileProjection.js +1 -0
- package/dist/domain/javascript/javascriptSemanticFingerprints.js +43 -42
- package/dist/domain/javascript/javascriptSemanticGraph.js +205 -52
- package/dist/domain/javascript/javascriptSemanticGraphSchemas.js +21 -11
- package/dist/domain/javascript/javascriptSemanticIr.js +0 -4
- package/dist/domain/javascript/javascriptSemanticIterationSources.js +139 -0
- package/dist/domain/javascript/javascriptSemanticMemberMutations.js +774 -136
- package/dist/domain/javascript/javascriptSemanticMutationInitializers.js +190 -0
- package/dist/domain/javascript/javascriptSemanticMutationValues.js +98 -41
- package/dist/domain/javascript/javascriptSemanticObjectReferences.js +381 -0
- package/dist/domain/javascript/javascriptSemanticObjects.js +9 -7
- package/dist/domain/javascript/javascriptSemanticPrimitives.js +7 -2
- package/dist/domain/javascript/javascriptSemanticProjection.js +72 -28
- package/dist/domain/javascript/javascriptSemanticPromises.js +15 -21
- package/dist/domain/javascript/javascriptSemanticPropertyPaths.js +100 -0
- package/dist/domain/javascript/javascriptSemanticProvenance.js +3 -3
- package/dist/domain/javascript/javascriptSemanticQuery.js +33 -29
- package/dist/domain/javascript/javascriptSemanticQueryIdentity.js +4 -5
- package/dist/domain/javascript/javascriptSemanticQuerySchemas.js +8 -9
- package/dist/domain/javascript/javascriptSemanticRequireOrigin.js +16 -10
- package/dist/domain/javascript/javascriptSemanticReturnedReferences.js +219 -0
- package/dist/domain/javascript/javascriptSemanticReturns.js +34 -48
- package/dist/domain/javascript/javascriptSemanticState.js +22 -2
- package/dist/domain/javascript/javascriptSemanticTraversal.js +25 -2
- package/dist/domain/javascript/javascriptSemanticValues.js +169 -30
- package/dist/domain/javascript/javascriptSourceAnalysis.js +1 -0
- package/dist/domain/javascript/javascriptSourceMapPaths.js +11 -1
- package/dist/domain/javascript/javascriptSourceParser.js +34 -9
- package/dist/domain/javascript/javascriptStaticAnalysis.js +29 -17
- package/dist/domain/javascript/javascriptStaticAnalysisBundler.js +13 -12
- package/dist/domain/javascript/javascriptStaticAnalysisCalls.js +49 -5
- package/dist/domain/javascript/javascriptStaticAnalysisFindings.js +8 -4
- package/dist/domain/javascript/javascriptStaticAnalysisHelpers.js +26 -15
- package/dist/domain/javascript/javascriptStaticAnalysisState.js +1 -0
- package/dist/domain/javascript/sourceToBundleComparison.js +7 -5
- package/dist/domain/javascript/sourceToBundleSignals.js +7 -7
- package/dist/domain/jeb/jebAnalysis.js +114 -0
- package/dist/domain/jsonSerialization.js +109 -55
- package/dist/domain/jsonShape.js +69 -31
- package/dist/domain/jsonValue.js +3 -0
- package/dist/domain/localPath.js +10 -4
- package/dist/domain/managed/managedApplicationGraph.js +47 -6
- package/dist/domain/managed/managedApplicationGraphCoverage.js +8 -2
- package/dist/domain/managed/managedApplicationGraphNodes.js +94 -59
- package/dist/domain/managed/managedArtifact.js +1 -0
- package/dist/domain/managed/managedInspectionEvidence.js +13 -0
- package/dist/domain/managed/managedMemberComparisonMatch.js +6 -7
- package/dist/domain/native/nativeAotPe.js +1408 -0
- package/dist/domain/native/nativeCallObservation.js +2 -4
- package/dist/domain/native/nativeInstruction.js +21 -0
- package/dist/domain/native/nativeMetadataRecovery.js +79 -6
- package/dist/domain/native/nativeValueFlow.js +5 -11
- package/dist/domain/native/objcSwiftMetadata.js +15 -17
- package/dist/domain/native/peResources.js +94 -0
- package/dist/domain/nativeConvention.js +33 -0
- package/dist/domain/process/processCapture.js +102 -11
- package/dist/domain/process/processCaptureCoverage.js +8 -5
- package/dist/domain/process/processCaptureExample.js +67 -0
- package/dist/domain/process/processCaptureValidation.js +83 -3
- package/dist/domain/process/processComparison.js +0 -23
- package/dist/domain/process/processScenario.js +62 -10
- package/dist/domain/process/processTraceEvaluation.js +4 -4
- package/dist/domain/process/processTraceSpecification.js +1 -3
- package/dist/domain/propertyListKeys.js +3 -1
- package/dist/domain/providerCleanupError.js +6 -2
- package/dist/domain/reconstructionCoverage.js +2 -1
- package/dist/domain/reconstructionUnknowns.js +4 -3
- package/dist/domain/reconstructionVerification.js +3 -2
- package/dist/domain/referenceSourceGraph.js +32 -23
- package/dist/domain/referenceSourceImportParsing.js +40 -48
- package/dist/domain/referenceSourcePathIdentity.js +22 -0
- package/dist/domain/referenceSourceRequireBindings.js +137 -0
- package/dist/domain/residualUnknown.js +3 -2
- package/dist/domain/staticRuntimeCorrelation.js +2 -1
- package/dist/domain/swiftSymbolClassification.js +6 -1
- package/dist/domain/symbolAnalysis.js +17 -2
- package/dist/domain/unicodeCodePointOrder.js +6 -0
- package/dist/domain/webBundleAnalyzerInspection.js +23 -3
- package/dist/domain/webCaptureDiff.js +170 -30
- package/dist/domain/webCaptureDiffSchemas.js +2 -8
- package/dist/domain/webInventory.js +3 -2
- package/dist/domain/webMcpDiscovery.js +4 -3
- package/dist/domain/webScriptExport.js +1 -1
- package/dist/domain/webScriptExportError.js +10 -4
- package/dist/domain/webScriptExportPlan.js +7 -13
- package/dist/domain/zipPackageFormat.js +4 -1
- package/dist/domain/zodCollectionSteps.js +24 -0
- package/dist/dotnet/ManagedArtifactInspector.js +55 -43
- package/dist/dotnet/ManagedDecodeBudget.js +80 -0
- package/dist/dotnet/ManagedMemberInspector.js +13 -6
- package/dist/dotnet/ManagedMemberInspectorCore.js +2 -2
- package/dist/dotnet/ManagedMemberInstructionDecoder.js +5 -4
- package/dist/dotnet/ManagedMemberRows.js +9 -4
- package/dist/dotnet/ManagedMetadataHeaps.js +15 -5
- package/dist/dotnet/ManagedMetadataInventoryRows.js +20 -11
- package/dist/dotnet/ManagedMetadataLayout.js +10 -4
- package/dist/dotnet/ManagedMethodBodyReader.js +8 -3
- package/dist/dotnet/ManagedNativeBoundaryHelpers.js +3 -2
- package/dist/dotnet/ManagedNativeBoundaryInspector.js +49 -34
- package/dist/dotnet/ManagedPeReader.js +41 -25
- package/dist/dotnet/ManagedReaderFailure.js +2 -1
- package/dist/dotnet/ManagedStaticProvider.js +65 -31
- package/dist/dotnet/ManagedStaticProviderMetadata.js +1 -4
- package/dist/evaluation/AgentEvaluationReport.js +9 -5
- package/dist/evaluation/CodexAgentEval.js +43 -13
- package/dist/evm/EvmoleFailures.js +0 -2
- package/dist/evm/EvmoleInterfaceProvider.js +67 -2
- package/dist/filesystem/OwnedDirectoryHandle.js +29 -0
- package/dist/filesystem/OwnedFileHandle.js +36 -0
- package/dist/filesystem/RegularFile.js +73 -0
- package/dist/filesystem/StableFileHash.js +46 -0
- package/dist/filesystem/readFileHandleChunks.js +26 -0
- package/dist/firmware/FirmwareCommand.js +25 -3
- package/dist/firmware/FirmwareFiles.js +23 -8
- package/dist/firmware/FirmwareProvider.js +156 -32
- package/dist/firmware/FirmwarePublication.js +24 -3
- package/dist/firmware/FirmwareRelease.js +1 -0
- package/dist/generatedPackageMetadata.js +2 -2
- package/dist/ghidra/GhidraAnalysisProfile.js +55 -4
- package/dist/ghidra/GhidraAnalysisSeeds.js +211 -0
- package/dist/ghidra/GhidraClient.js +90 -8
- package/dist/ghidra/GhidraDiagnostics.js +11 -8
- package/dist/ghidra/GhidraFunctionValues.js +26 -2
- package/dist/ghidra/GhidraInstallation.js +111 -10
- package/dist/ghidra/GhidraInventoryValues.js +23 -1
- package/dist/ghidra/GhidraLanguageCatalog.js +99 -0
- package/dist/ghidra/GhidraLauncher.js +123 -58
- package/dist/ghidra/GhidraLoadImageAttest.js +49 -2
- package/dist/ghidra/GhidraMipsProfile.js +79 -0
- package/dist/ghidra/GhidraProvider.js +57 -9
- package/dist/ghidra/GhidraProviderCapabilities.js +18 -8
- package/dist/ghidra/GhidraProviderClient.js +282 -21
- package/dist/ghidra/GhidraSessionValues.js +9 -2
- package/dist/hopper/HopperAnalysisProfile.js +2 -0
- package/dist/hopper/HopperCleanup.js +1 -1
- package/dist/hopper/HopperClient.js +15 -6
- package/dist/hopper/HopperMachOImage.js +2 -0
- package/dist/hopper/HopperProvider.js +13 -2
- package/dist/ida/IdaOperationRunner.js +10 -2
- package/dist/ida/IdaProvider.js +7 -0
- package/dist/ida/IdaSessionClient.js +7 -3
- package/dist/ida/IdaWorkspace.js +4 -2
- package/dist/inspector/JavaScriptRuntimeScope.js +9 -5
- package/dist/inspector/V8InspectorCaptureProjection.js +46 -13
- package/dist/inspector/V8InspectorProvider.js +60 -8
- package/dist/javascript/analysis/JavaScriptAnalysisTransfer.js +326 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorker.js +520 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerProtocol.js +63 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerSchemas.js +521 -0
- package/dist/javascript/analysis/JavaScriptAnalysisWorkerServer.js +116 -0
- package/dist/javascript/recovery/RecoveryFiles.js +18 -7
- package/dist/javascript/recovery/WakaruCommand.js +22 -9
- package/dist/javascript/recovery/WakaruExecution.js +11 -7
- package/dist/javascript/recovery/WakaruProvider.js +139 -16
- package/dist/javascript/recovery/WakaruPublication.js +14 -4
- package/dist/javascript/recovery/WakaruRelease.js +10 -3
- package/dist/javascript/recovery/WakaruReport.js +12 -7
- package/dist/javascript/recovery/WakaruVersion.js +24 -0
- package/dist/javascript/sourceMaps/SourceMapCommand.js +16 -3
- package/dist/javascript/sourceMaps/SourceMapDecoder.js +63 -7
- package/dist/javascript/sourceMaps/SourceMapFormat.js +15 -4
- package/dist/jeb/JebMcpConnection.js +179 -0
- package/dist/jeb/JebMcpEndpoint.js +40 -0
- package/dist/jeb/JebProvider.js +299 -0
- package/dist/main/shutdown.js +76 -32
- package/dist/main/transport.js +1 -1
- package/dist/mcpDoctor.js +15 -6
- package/dist/native/AppleDispatchCoverage.js +25 -12
- package/dist/native/AppleDispatchMetadata.js +14 -7
- package/dist/native/AppleMachoFixups.js +71 -15
- package/dist/native/AppleMachoSelection.js +23 -3
- package/dist/native/AppleObjcDispatchFacets.js +3 -3
- package/dist/native/AppleObjcProperties.js +17 -7
- package/dist/native/LldbCallTracer.js +241 -75
- package/dist/native/NativeMacOSProvider.js +100 -20
- package/dist/native/NativeMacOSProviderMetadata.js +1 -2
- package/dist/native/NativeMachoInspection.js +11 -7
- package/dist/native/NativeUiHelperRuntime.js +6 -1
- package/dist/native/NativeUiObservation.js +4 -3
- package/dist/native/pe/PeResourceLayout.js +120 -0
- package/dist/native/pe/PeResourceParser.js +286 -0
- package/dist/native/pe/PeResourcesProvider.js +63 -0
- package/dist/process/BoundedFileBytes.js +30 -7
- package/dist/process/DarwinProcessRunTokenReader.js +8 -3
- package/dist/process/OwnedCommand.js +4 -3
- package/dist/process/ProcessOwnership.js +104 -112
- package/dist/process/ProcessOwnershipObservation.js +104 -51
- package/dist/process/ProcessOwnershipProcessTree.js +4 -4
- package/dist/process/ProcessRunTokenObservations.js +48 -0
- package/dist/process/ProviderDiagnosticRedaction.js +17 -0
- package/dist/process/ProviderProcess.js +4 -3
- package/dist/process/capture/FilesystemSnapshot.js +116 -22
- package/dist/process/capture/ProcessCaptureLifecycle.js +363 -86
- package/dist/process/capture/ProcessCaptureProgress.js +62 -0
- package/dist/process/capture/ProcessFilesystemEffects.js +19 -4
- package/dist/process/capture/ProcessHarness.js +202 -47
- package/dist/process/capture/ProcessNormalization.js +3 -1
- package/dist/process/capture/ProcessScenarioRuntimeValidation.js +5 -2
- package/dist/process/capture/TerminalRenderer.js +24 -7
- package/dist/reference/ReferenceSourceReader.js +22 -5
- package/dist/reference/ReferenceSourceReaderEntries.js +114 -51
- package/dist/reference/ReferenceSourceReaderErrors.js +12 -0
- package/dist/reference/ReferenceSourceReaderFile.js +50 -10
- package/dist/reference/ReferenceSourceReaderValidate.js +4 -4
- package/dist/server/EvidenceMcpServer.js +36 -1
- package/dist/server/admittedToolOperation.js +9 -0
- package/dist/server/analysisAdmission.js +8 -0
- package/dist/server/contractToolHandler.js +21 -0
- package/dist/server/createServer.js +118 -47
- package/dist/server/registerAdbTools.js +36 -0
- package/dist/server/registerAnalysisViewTool.js +4 -9
- package/dist/server/registerAndroidTools.js +3 -12
- package/dist/server/registerApktoolTools.js +14 -0
- package/dist/server/registerApplicationTools/compareExportShapes.js +6 -7
- package/dist/server/registerApplicationTools/compareSourceToBundle.js +4 -5
- package/dist/server/registerApplicationTools/compareVersions.js +3 -2
- package/dist/server/registerApplicationTools/coverage.js +3 -2
- package/dist/server/registerApplicationTools/helpers.js +3 -2
- package/dist/server/registerApplicationTools/obligationLedger.js +3 -2
- package/dist/server/registerApplicationTools/projectMobileApplicationGraph.js +3 -2
- package/dist/server/registerApplicationTools/traceFeature.js +3 -2
- package/dist/server/registerApplicationTools/traceSemantics.js +4 -5
- package/dist/server/registerArtifactComparisonTool.js +5 -2
- package/dist/server/registerArtifactTools.js +2 -2
- package/dist/server/registerBinaryDiagnosticsTools.js +16 -4
- package/dist/server/registerBrowserScenarioTool.js +10 -7
- package/dist/server/registerBrowserTools.js +12 -9
- package/dist/server/registerBundleComparisonTool.js +16 -2
- package/dist/server/registerCloseLifecycleTool.js +36 -5
- package/dist/server/registerElectronTools.js +28 -10
- package/dist/server/registerEnhancedTools.js +78 -73
- package/dist/server/registerEvidenceTools.js +54 -46
- package/dist/server/registerEvmTools.js +4 -9
- package/dist/server/registerFirmwareTools.js +3 -11
- package/dist/server/registerFunctionComparisonTool.js +5 -2
- package/dist/server/registerJavaScriptRecoveryTool.js +4 -9
- package/dist/server/registerJavaScriptRuntimeObservationTools.js +9 -6
- package/dist/server/registerJebTools.js +16 -0
- package/dist/server/registerManagedTools.js +7 -4
- package/dist/server/registerManagedWorkflowTools/compareManagedMembers.js +4 -6
- package/dist/server/registerManagedWorkflowTools/importManagedReconstruction.js +3 -2
- package/dist/server/registerManagedWorkflowTools/projectManagedApplicationGraph.js +3 -2
- package/dist/server/registerManagedWorkflowTools/verifyManagedNativeBoundaries.js +3 -2
- package/dist/server/registerOfficialTools.js +31 -25
- package/dist/server/registerPeResourcesTool.js +9 -0
- package/dist/server/registerProcessComparisonTool.js +5 -2
- package/dist/server/registerRecordedCrashTools.js +4 -9
- package/dist/server/registerSessionRecordTools.js +2 -1
- package/dist/server/registerSessionTools.js +58 -21
- package/dist/server/registerWebModuleTool.js +4 -9
- package/dist/server/registerWebNetworkCaptureTool.js +4 -9
- package/dist/server/registerWebRuntimeTools.js +6 -5
- package/dist/server/registerWebScriptTool.js +6 -3
- package/dist/server/registerWebSourceLocationTool.js +4 -9
- package/dist/server/toolResult.js +21 -2
- package/dist/windows/WindowsPrivateRuntime.js +12 -5
- package/install.sh +7 -4
- package/licenses/nativeaot-parser-MIT.txt +28 -0
- package/native/windows/build/manifest.json +2 -2
- package/native/windows/build/rea-windows-x64.node +0 -0
- package/package.json +38 -7
- package/scripts/rea.mjs +16 -1
- package/skills/reverse-engineer-anything/SKILL.md +52 -51
- package/skills/reverse-engineer-anything/references/connection-and-recovery.md +127 -0
- package/skills/reverse-engineer-anything/references/evidence-workflows.md +8 -0
- package/skills/reverse-engineer-anything/references/javascript-applications.md +92 -13
- package/skills/reverse-engineer-anything/references/native-and-artifacts.md +31 -1
- package/dist/artifacts/inventory/policy.js +0 -2
- package/dist/domain/managed/managedApplicationGraphNodeCoverage.js +0 -6
- package/dist/server/registerNativeTools.js +0 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createJavaScriptSemanticGraph,
|
|
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
|
|
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(
|
|
55
|
+
const state = emptyState();
|
|
53
56
|
const fingerprints = [];
|
|
54
57
|
let truncatedFiles = 0;
|
|
55
|
-
|
|
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(...
|
|
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
|
|
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
|
|
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:
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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
|
|
102
|
-
retained_relations:
|
|
103
|
-
|
|
104
|
-
|
|
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
|
-
|
|
133
|
-
|
|
134
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
159
|
-
|
|
272
|
+
if (node !== null)
|
|
273
|
+
callableNodes.set(callable.callableId, node);
|
|
274
|
+
}
|
|
160
275
|
const callableOwnerAt = createSemanticCallableOwnerLookup(ir, callableNodes);
|
|
161
|
-
const bindingNodes = new Map(
|
|
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
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
const
|
|
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
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
+
];
|
|
@@ -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
|
|
5
|
-
export const createSemanticGraphProjectionState = (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
|
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
|
-
...(
|
|
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:
|
|
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 ??
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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 {
|
|
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
|
-
:
|
|
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
|
|
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
|
|
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
|
};
|