rea-agents 3.2.1 → 4.0.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 +183 -332
- package/bridge/ghidra/ReaGhidraBridge.java +561 -74
- package/bridge/hopper_bridge.py +70 -27
- package/bridge/native/ReaNativeUI.swift +157 -0
- package/dist/application/AnalysisContextQueries.js +19 -5
- package/dist/application/AnalysisSnapshotCache.js +30 -11
- package/dist/application/AppleAssetCatalogAnalysis.js +171 -0
- package/dist/application/ArtifactExtractionDestination.js +0 -12
- package/dist/application/ArtifactGraphConstruction.js +44 -11
- package/dist/application/ArtifactInventory/classify.js +7 -15
- package/dist/application/ArtifactInventory/hash.js +4 -2
- package/dist/application/ArtifactInventory/policy.js +2 -17
- package/dist/application/ArtifactInventory/reader.js +3 -3
- package/dist/application/ArtifactInventory/scanCanonical.js +2 -2
- package/dist/application/ArtifactInventory/scanReader.js +12 -4
- package/dist/application/ArtifactInventory/types.js +0 -3
- package/dist/application/BinarySession.js +28 -43
- package/dist/application/BinarySessionExecution.js +37 -1
- package/dist/application/BinaryTargetResolver.js +50 -4
- package/dist/application/BrowserEvidence.js +36 -7
- package/dist/application/BrowserObservationService.js +17 -44
- package/dist/application/BrowserScenarioCaptureService.js +2 -35
- package/dist/application/BrowserScenarioEvidence.js +13 -9
- package/dist/application/CapabilityClientRequirements.js +2 -11
- package/dist/application/CapabilityInventory.js +21 -35
- package/dist/application/ClientConfigurationDocument.js +84 -7
- package/dist/application/ClientRegistrationIdentity.js +32 -0
- package/dist/application/ClientRegistrationStatus.js +59 -6
- package/dist/application/DirectAnalysis.js +37 -58
- package/dist/application/DirectAnalysisStatus.js +4 -4
- package/dist/application/Doctor.js +89 -80
- package/dist/application/DoctorDiagnostics.js +2 -26
- package/dist/application/DoctorScope.js +8 -14
- package/dist/application/ElectronActiveEvidence.js +10 -27
- package/dist/application/ElectronActiveObservationService.js +9 -36
- package/dist/application/ElectronBoundaryAnalysis.js +2 -0
- package/dist/application/ElectronBoundaryGraphNative.js +1 -1
- package/dist/application/ElectronEvidence.js +8 -3
- package/dist/application/ElectronObservationService.js +9 -25
- package/dist/application/EnhancedLiteralTracing.js +4 -8
- package/dist/application/EnhancedTools.js +15 -35
- package/dist/application/FilesystemSnapshot.js +7 -8
- package/dist/application/JavaScriptApplicationEvidenceGraph.js +2 -1
- package/dist/application/JavaScriptApplicationWorkflowService.js +31 -7
- package/dist/application/JavaScriptArtifactAnalysis.js +6 -4
- package/dist/application/JavaScriptArtifactFiles.js +5 -0
- package/dist/application/JavaScriptArtifactPathResolution.js +179 -47
- package/dist/application/JavaScriptRuntimeObservationEvidence.js +6 -3
- package/dist/application/JavaScriptRuntimeObservationService.js +9 -25
- package/dist/application/JavaScriptRuntimeReconciliationService.js +45 -4
- package/dist/application/JavaScriptSemanticGraphAsyncProjection.js +11 -0
- package/dist/application/JavaScriptSemanticGraphChildProcessProjection.js +11 -0
- package/dist/application/JavaScriptSemanticGraphDataProjection.js +11 -0
- package/dist/application/JavaScriptSemanticGraphFlowProjection.js +14 -5
- package/dist/application/JsonFiles.js +1 -1
- package/dist/application/LazyAnalysisProvider.js +27 -6
- package/dist/application/ManagedMemberComparisonService.js +19 -6
- package/dist/application/NativeApiInspection.js +2 -0
- package/dist/application/NativeCallRoutes.js +72 -0
- package/dist/application/NativeDispatchMetadataInspection.js +33 -0
- package/dist/application/NativeUiActionTrace.js +73 -49
- package/dist/application/NativeValueTrace.js +320 -0
- package/dist/application/ProcessCaptureCapability.js +32 -5
- package/dist/application/ProcessCaptureEnvironment.js +9 -26
- package/dist/application/ProcessCaptureError.js +1 -5
- package/dist/application/ProcessCaptureJournal.js +3 -40
- package/dist/application/ProcessCaptureLifecycle.js +102 -111
- package/dist/application/ProcessCli.js +18 -25
- package/dist/application/ProcessEvidence.js +5 -7
- package/dist/application/ProcessFilesystemEffects.js +36 -0
- package/dist/application/ProcessHarness.js +41 -120
- package/dist/application/ProcessNormalization.js +2 -17
- package/dist/application/ProcessScenarioRuntimeValidation.js +76 -0
- package/dist/application/ReferenceSourceImport.js +3 -4
- package/dist/application/Setup.js +236 -84
- package/dist/application/SetupClientConfiguration.js +14 -9
- package/dist/application/SetupPlan.js +138 -86
- package/dist/application/SetupSkill.js +0 -1
- package/dist/application/SupportedClients.js +102 -21
- package/dist/application/Uninstall.js +31 -20
- package/dist/application/Update.js +93 -0
- package/dist/application/UpdateMaintenance.js +108 -0
- package/dist/application/UpdateRuntime.js +126 -0
- package/dist/application/runtime.js +13 -2
- package/dist/artifacts/ArtifactPaths.js +6 -8
- package/dist/artifacts/ArtifactProvider.js +94 -41
- package/dist/artifacts/AsarArtifactReader.js +19 -4
- package/dist/artifacts/KeyedArchiveReader.js +110 -0
- package/dist/artifacts/MachOSliceArtifactReader.js +53 -5
- package/dist/artifacts/ZipArtifactReader.js +18 -1
- package/dist/browser/BrowserScenarioSecrets.js +28 -1
- package/dist/browser/CdpBrowserProvider.js +36 -15
- package/dist/browser/CdpCaptureDocuments.js +22 -8
- package/dist/browser/CdpCaptureEventHandlers.js +14 -5
- package/dist/browser/CdpCaptureEventHelpers.js +13 -0
- package/dist/browser/CdpCaptureEvents.js +10 -1
- package/dist/browser/CdpElectronInspection.js +5 -10
- package/dist/browser/CdpElectronProvider.js +1 -5
- package/dist/browser/CdpElectronScripts.js +1 -1
- package/dist/browser/CdpEndpoint.js +3 -2
- package/dist/browser/CdpObservationSession.js +14 -10
- package/dist/browser/CdpPageCapture.js +1 -1
- package/dist/browser/CdpPageCaptureScripts.js +1 -1
- package/dist/browser/CdpSafeMetadata.js +5 -4
- package/dist/browser/CdpScreenshot.js +16 -5
- package/dist/browser/CdpTargetSession.js +25 -4
- package/dist/browser/CdpWebMcpDiscovery.js +93 -20
- package/dist/browser/JavaScriptRuntimeScope.js +28 -2
- package/dist/browser/PlaywrightBrowserScenarioProvider.js +9 -8
- package/dist/browser/PlaywrightElectronActiveActions.js +3 -10
- package/dist/browser/PlaywrightElectronActiveProvider.js +5 -5
- package/dist/browser/PlaywrightScenarioActions.js +1 -1
- package/dist/browser/PlaywrightScenarioArtifacts.js +13 -25
- package/dist/browser/PlaywrightScenarioBrowser.js +28 -25
- package/dist/browser/PlaywrightScenarioEvents.js +82 -93
- package/dist/browser/PlaywrightScenarioSession.js +27 -123
- package/dist/browser/PngVisualDiff.js +22 -3
- package/dist/browser/V8InspectorCaptureProjection.js +7 -1
- package/dist/browser/V8InspectorProvider.js +60 -7
- package/dist/browser/WebSourceMapFetcher.js +99 -53
- package/dist/cli/artifactCommands.js +56 -12
- package/dist/cli/coreAnalysisCommands.js +110 -0
- package/dist/cli/managedCommands.js +1 -31
- package/dist/cli/setupCommands.js +16 -14
- package/dist/cli/utilityCommands.js +61 -4
- package/dist/cli.js +5 -7
- package/dist/cliApplicationCommands.js +0 -83
- package/dist/cliBrowserAdvancedCommands.js +7 -11
- package/dist/cliBrowserCommands.js +15 -23
- package/dist/cliBrowserContext.js +3 -24
- package/dist/cliBrowserScenarioCommands.js +2 -10
- package/dist/cliCommandNames.js +82 -7
- package/dist/cliElectronCommands.js +10 -36
- package/dist/cliJavaScriptRuntimeCommands.js +6 -30
- package/dist/cliJsonInput.js +4 -2
- package/dist/cliLogging.js +16 -7
- package/dist/cliObservationOptions.js +1 -1
- package/dist/cliOutput.js +2 -4
- package/dist/cliProcessCommands.js +6 -33
- package/dist/cliSetup.js +90 -160
- package/dist/config/environment.js +2 -78
- package/dist/config/parseConfig.js +18 -109
- package/dist/config/parsers.js +0 -23
- package/dist/contracts/applicationToolContracts.js +1 -118
- package/dist/contracts/artifactToolContracts.js +11 -19
- package/dist/contracts/browserScenarioToolContracts.js +1 -5
- package/dist/contracts/browserToolContracts.js +9 -16
- package/dist/contracts/electronToolContracts.js +5 -6
- package/dist/contracts/enhancedInputs.js +3 -2
- package/dist/contracts/errorSchemas.js +16 -40
- package/dist/contracts/functionWorkflowToolContracts.js +2 -2
- package/dist/contracts/javascriptApplicationWorkflowExamples.js +2 -2
- package/dist/contracts/javascriptRuntimeObservationToolContracts.js +4 -4
- package/dist/contracts/javascriptRuntimeReconciliationExample.js +1 -1
- package/dist/contracts/managedToolContracts.js +7 -4
- package/dist/contracts/managedWorkflowExamples.js +0 -22
- package/dist/contracts/managedWorkflowToolContracts.js +16 -31
- package/dist/contracts/nativeToolContracts.js +9 -0
- package/dist/contracts/promptContracts.js +6 -6
- package/dist/contracts/sessionToolSchemas.js +3 -3
- package/dist/contracts/toolContractExamples.js +4 -3
- package/dist/contracts/toolContracts.js +18 -7
- package/dist/contracts/toolEffects.js +34 -21
- package/dist/contracts/toolOutputSchemaGroups.js +18 -5
- package/dist/contracts/toolOutputSchemaPrimitives.js +9 -6
- package/dist/contracts/toolSchemaMetadata.js +5 -8
- package/dist/doctorRuntime.js +0 -41
- package/dist/domain/analysisErrorPresentation.js +4 -28
- package/dist/domain/analysisErrorProjection.js +33 -50
- package/dist/domain/analysisProfile.js +1 -1
- package/dist/domain/analysisSnapshot.js +77 -3
- package/dist/domain/androidApplication.js +5 -4
- package/dist/domain/appleApplication.js +5 -4
- package/dist/domain/appleAssetCatalog.js +127 -0
- package/dist/domain/artifactComparison.js +7 -11
- package/dist/domain/artifactGraph.js +8 -6
- package/dist/domain/artifactInspection.js +13 -12
- package/dist/domain/binaryTarget.js +23 -9
- package/dist/domain/browserObservation.js +43 -24
- package/dist/domain/browserObservationSchemas.js +2 -1
- package/dist/domain/browserScenario.js +7 -107
- package/dist/domain/browserScenarioCapture.js +0 -1
- package/dist/domain/browserScenarioCaptureValues.js +5 -4
- package/dist/domain/browserScenarioDiff.js +1 -3
- package/dist/domain/browserScenarioValues.js +16 -107
- package/dist/domain/bundleComparison.js +18 -17
- package/dist/domain/callPathSchemas.js +17 -7
- package/dist/domain/changedBehavior.js +2 -3
- package/dist/domain/comparisonSemantics.js +19 -0
- package/dist/domain/completionLedgerGeneration.js +3 -2
- package/dist/domain/conformancePackage.js +2 -1
- package/dist/domain/conformanceTrustGate.js +3 -5
- package/dist/domain/customProtocolCapture.js +2 -2
- package/dist/domain/digests.js +30 -0
- package/dist/domain/dosMz.js +83 -0
- package/dist/domain/electronActiveObservation.js +7 -5
- package/dist/domain/electronObservation.js +3 -2
- package/dist/domain/electronStaticAnalysisNative.js +15 -6
- package/dist/domain/emptyArraySchema.js +3 -0
- package/dist/domain/errors.js +10 -28
- package/dist/domain/evidence.js +5 -3
- package/dist/domain/evidenceCompletionLedger.js +3 -2
- package/dist/domain/functionComparisonNormalization.js +24 -18
- package/dist/domain/functionComparisonResults.js +3 -7
- package/dist/domain/functionComparisonSchemas.js +3 -2
- package/dist/domain/hopperValues.js +108 -8
- package/dist/domain/javascriptApplicationAnalysis.js +4 -7
- package/dist/domain/javascriptApplicationEvidenceSchemas.js +4 -3
- package/dist/domain/javascriptApplicationGraphSchemas.js +8 -7
- package/dist/domain/javascriptApplicationVersionComparisonSchemas.js +9 -7
- package/dist/domain/javascriptApplicationVersionItems.js +12 -18
- package/dist/domain/javascriptAstValues.js +4 -0
- package/dist/domain/javascriptExportShapeComparison.js +1 -6
- package/dist/domain/javascriptExportShapeComparisonSchemas.js +6 -10
- package/dist/domain/javascriptExportShapeVariants.js +15 -2
- package/dist/domain/javascriptFeatureTraceSchemas.js +8 -7
- package/dist/domain/javascriptRuntimeObservation.js +14 -2
- package/dist/domain/javascriptRuntimeReconciliationMatching.js +8 -0
- package/dist/domain/javascriptRuntimeReconciliationParsing.js +4 -2
- package/dist/domain/javascriptRuntimeReconciliationResult.js +6 -4
- package/dist/domain/javascriptRuntimeReconciliationRuntime.js +15 -4
- package/dist/domain/javascriptRuntimeReconciliationSchemas.js +19 -18
- package/dist/domain/javascriptRuntimeStaticCandidates.js +18 -6
- package/dist/domain/javascriptSemanticAnalysis.js +57 -19
- package/dist/domain/javascriptSemanticAsyncEffects.js +39 -40
- package/dist/domain/javascriptSemanticCalls.js +46 -27
- package/dist/domain/javascriptSemanticChildProcesses.js +43 -50
- package/dist/domain/javascriptSemanticDataEffectHelpers.js +91 -18
- package/dist/domain/javascriptSemanticDataEffects.js +22 -10
- package/dist/domain/javascriptSemanticGraphSchemas.js +8 -6
- package/dist/domain/javascriptSemanticObjects.js +13 -3
- package/dist/domain/javascriptSemanticProjection.js +144 -38
- package/dist/domain/javascriptSemanticPromises.js +14 -27
- package/dist/domain/javascriptSemanticQuerySchemas.js +6 -9
- package/dist/domain/javascriptSemanticResources.js +2 -5
- package/dist/domain/javascriptSemanticState.js +4 -0
- package/dist/domain/javascriptSemanticTraceSchemas.js +2 -1
- package/dist/domain/javascriptSemanticTraversal.js +13 -5
- package/dist/domain/javascriptSemanticValues.js +10 -9
- package/dist/domain/javascriptSourceParser.js +5 -1
- package/dist/domain/javascriptStaticAnalysisCalls.js +8 -5
- package/dist/domain/javascriptStaticAnalysisHelpers.js +16 -7
- package/dist/domain/keyedArchive.js +181 -0
- package/dist/domain/managedApplicationGraph.js +4 -3
- package/dist/domain/managedArtifact.js +2 -1
- package/dist/domain/managedMemberComparison.js +18 -13
- package/dist/domain/managedMemberComparisonCoverage.js +2 -1
- package/dist/domain/managedMemberComparisonItems.js +27 -7
- package/dist/domain/managedMemberComparisonMatch.js +22 -6
- package/dist/domain/managedNativeVerificationMatch.js +2 -2
- package/dist/domain/managedNativeVerificationSchemas.js +7 -5
- package/dist/domain/managedReconstruction.js +6 -5
- package/dist/domain/nativeApiBoundary.js +7 -0
- package/dist/domain/nativeDataType.js +51 -0
- package/dist/domain/nativeInspection.js +0 -1
- package/dist/domain/nativeInstruction.js +82 -0
- package/dist/domain/nativeInvestigationGraph.js +9 -5
- package/dist/domain/nativeUiObservation.js +123 -0
- package/dist/domain/nativeValueFlow.js +17 -0
- package/dist/domain/nativeValueTrace.js +64 -0
- package/dist/domain/objcSwiftMetadata.js +39 -0
- package/dist/domain/peInspection.js +1 -0
- package/dist/domain/processCapture.js +5 -55
- package/dist/domain/processCaptureExample.js +0 -9
- package/dist/domain/processCaptureValidation.js +13 -144
- package/dist/domain/processComparison.js +3 -25
- package/dist/domain/processObservation.js +0 -29
- package/dist/domain/processScenario.js +28 -228
- package/dist/domain/processTraceDimensionProjection.js +0 -15
- package/dist/domain/processTraceEvaluation.js +0 -6
- package/dist/domain/protocolCapture.js +8 -36
- package/dist/domain/reconstructionCoverage.js +3 -2
- package/dist/domain/reconstructionObligationLedgerSchemas.js +4 -12
- package/dist/domain/reconstructionReadinessSchemas.js +4 -3
- package/dist/domain/reconstructionVerification.js +2 -1
- package/dist/domain/reconstructionVerificationSchemas.js +6 -13
- package/dist/domain/referenceSourceClassification.js +0 -110
- package/dist/domain/referenceSourceGraph.js +15 -5
- package/dist/domain/residualUnknown.js +3 -2
- package/dist/domain/runtimeIdentification.js +6 -5
- package/dist/domain/sourceMapContents.js +5 -0
- package/dist/domain/sourceToBundleComparison.js +3 -10
- package/dist/domain/sourceToBundleComparisonSchemas.js +7 -6
- package/dist/domain/sourceToBundleSignals.js +9 -3
- package/dist/domain/staticRuntimeCorrelation.js +5 -11
- package/dist/domain/webBundleAnalysis.js +17 -9
- package/dist/domain/webBundleAnalyzer.js +1 -1
- package/dist/domain/webCaptureDiff.js +5 -11
- package/dist/domain/webCaptureDiffSchemas.js +2 -1
- package/dist/domain/webMcpDiscovery.js +2 -1
- package/dist/dotnet/ManagedMemberInspectorCore.js +15 -7
- package/dist/dotnet/ManagedMemberInstructionDecoder.js +57 -40
- package/dist/dotnet/ManagedMemberRows.js +2 -0
- package/dist/dotnet/ManagedMethodBodyReader.js +15 -8
- package/dist/dotnet/ManagedPeReader.js +2 -0
- package/dist/generatedMcpToolCatalog.js +1 -1
- package/dist/generatedPackageMetadata.js +2 -2
- package/dist/ghidra/GhidraAnalysisProfile.js +15 -5
- package/dist/ghidra/GhidraClient.js +38 -8
- package/dist/ghidra/GhidraFunctionValues.js +56 -20
- package/dist/ghidra/GhidraInstallation.js +7 -4
- package/dist/ghidra/GhidraInventoryValues.js +44 -9
- package/dist/ghidra/GhidraLauncher.js +18 -3
- package/dist/ghidra/GhidraProvider.js +23 -2
- package/dist/ghidra/GhidraRequestQueue.js +45 -4
- package/dist/ghidra/GhidraSessionValues.js +5 -0
- package/dist/hopper/HopperAnalysisProfile.js +2 -0
- package/dist/hopper/HopperProvider.js +29 -6
- package/dist/hopper/HopperTargetLease.js +18 -4
- package/dist/logger.js +0 -13
- package/dist/main/messages.js +0 -1
- package/dist/main/reload.js +3 -32
- package/dist/main/shutdown.js +1 -2
- package/dist/main/transport.js +0 -17
- package/dist/main.js +0 -10
- package/dist/native/AppleDispatchMetadata.js +582 -0
- package/dist/native/AppleObjcProtocols.js +88 -0
- package/dist/native/AppleSwiftVtables.js +86 -0
- package/dist/native/CommandRunner.js +1 -1
- package/dist/native/NativeHostCapabilities.js +23 -0
- package/dist/native/NativeMacOSProvider.js +61 -9
- package/dist/native/NativeMachoInspection.js +39 -6
- package/dist/native/NativeUiHelperRuntime.js +42 -0
- package/dist/native/NativeUiObservation.js +174 -0
- package/dist/native/parsers/codesign.js +4 -1
- package/dist/native/parsers/dyldInfo.js +51 -25
- package/dist/native/parsers/lipo.js +13 -4
- package/dist/native/parsers/otool.js +84 -39
- package/dist/native/parsers/plist.js +2 -1
- package/dist/process/ExecFileOutput.js +5 -1
- package/dist/process/ProcessOwnership.js +69 -33
- package/dist/process/ProcessOwnershipObservation.js +31 -12
- package/dist/process/ProviderProcess.js +4 -2
- package/dist/reference/ReferenceSourceReaderEntries.js +48 -31
- package/dist/reference/ReferenceSourceReaderErrors.js +24 -0
- package/dist/reference/ReferenceSourceReaderFile.js +11 -5
- package/dist/reference/ReferenceSourceReaderValidate.js +22 -8
- package/dist/server/createServer.js +7 -62
- package/dist/server/registerApplicationTools/helpers.js +2 -9
- package/dist/server/registerApplicationTools.js +0 -4
- package/dist/server/registerArtifactComparisonTool.js +1 -1
- package/dist/server/registerBrowserScenarioTool.js +4 -2
- package/dist/server/registerBrowserTools.js +7 -7
- package/dist/server/registerBundleComparisonTool.js +1 -1
- package/dist/server/registerCloseLifecycleTool.js +1 -1
- package/dist/server/registerElectronTools.js +10 -4
- package/dist/server/registerEnhancedTools.js +20 -12
- package/dist/server/registerEvidenceTools.js +4 -28
- package/dist/server/registerFunctionComparisonTool.js +1 -1
- package/dist/server/registerInvestigationTools.js +6 -6
- package/dist/server/registerJavaScriptRuntimeObservationTools.js +2 -2
- package/dist/server/registerManagedTools.js +28 -14
- package/dist/server/registerManagedWorkflowTools.js +0 -2
- package/dist/server/registerProcessComparisonTool.js +1 -3
- package/dist/server/registerSessionRecordTools.js +9 -9
- package/dist/server/registerSessionStatusTool.js +1 -1
- package/dist/server/registerSessionTools.js +28 -57
- package/dist/server/sessionAvailabilityPolicy.js +2 -3
- package/dist/server/sessionToolPolicies.js +0 -4
- package/dist/server/toolResult.js +8 -10
- package/package.json +32 -22
- package/skills/reverse-engineer-anything/SKILL.md +15 -11
- package/skills/reverse-engineer-anything/references/evidence-workflows.md +3 -2
- package/skills/reverse-engineer-anything/references/javascript-applications.md +3 -2
- package/skills/reverse-engineer-anything/references/native-and-artifacts.md +8 -6
- package/skills/reverse-engineer-anything/references/runtime-observation.md +15 -11
- package/dist/application/CommandShimReplay.js +0 -152
- package/dist/application/ConfiguredRoots.js +0 -19
- package/dist/application/InstrumentedJavaScriptReplayHost.js +0 -36
- package/dist/application/JavaScriptReplayPermission.js +0 -16
- package/dist/application/JavaScriptReplayPlanning.js +0 -207
- package/dist/application/JavaScriptReplayService.js +0 -274
- package/dist/application/LoopbackReplay.js +0 -389
- package/dist/application/LoopbackReplayRecorder.js +0 -129
- package/dist/application/ManagedRuntimeCorrelationService.js +0 -104
- package/dist/application/NodeRuntimeCharacterizationService.js +0 -191
- package/dist/application/PermissionAuthority.js +0 -268
- package/dist/application/PermissionConfiguration.js +0 -26
- package/dist/application/PermissionFailure.js +0 -5
- package/dist/application/ProcessCaptureAuthority.js +0 -24
- package/dist/application/ProcessCapturePermission.js +0 -13
- package/dist/application/ProcessCheckpoints.js +0 -178
- package/dist/application/ProcessReactiveCoordinator.js +0 -223
- package/dist/application/ProcessReactiveEffects.js +0 -153
- package/dist/application/ProcessReactiveHarness.js +0 -106
- package/dist/application/ProcessReactiveObservations.js +0 -105
- package/dist/application/ProjectPermissionStore.js +0 -199
- package/dist/application/RuntimeExecutableDiagnostics.js +0 -198
- package/dist/application/Upgrade.js +0 -134
- package/dist/browser/SensitiveTextCapture.js +0 -8
- package/dist/cliPolicyCommands.js +0 -185
- package/dist/config/browserScenario.js +0 -77
- package/dist/config/electronAutomation.js +0 -35
- package/dist/config/javascriptReplay.js +0 -41
- package/dist/config/managedRuntime.js +0 -25
- package/dist/config/passiveObservation.js +0 -87
- package/dist/config/permissions.js +0 -23
- package/dist/config/processCapture.js +0 -47
- package/dist/contracts/replayMachineExample.js +0 -37
- package/dist/domain/javascriptExportInstrumentation.js +0 -95
- package/dist/domain/javascriptReplay.js +0 -360
- package/dist/domain/managedRuntimeCorrelation.js +0 -181
- package/dist/domain/nodeRuntimeCharacterization.js +0 -63
- package/dist/domain/permissionPolicy.js +0 -176
- package/dist/domain/processCaptureReactiveSchema.js +0 -68
- package/dist/domain/processCaptureReactiveValidation.js +0 -180
- package/dist/domain/processReactiveCheckpointDataflow.js +0 -32
- package/dist/domain/processReactiveMatching.js +0 -196
- package/dist/domain/processReactiveRuntime.js +0 -116
- package/dist/domain/processReactiveScenario.js +0 -296
- package/dist/domain/processReactiveScenarioPreflight.js +0 -95
- package/dist/domain/processReactiveTransition.js +0 -187
- package/dist/domain/replayMachine.js +0 -320
- package/dist/domain/replayMachineRun.js +0 -168
- package/dist/domain/replayMachineRuntime.js +0 -296
- package/dist/domain/replayMachineValues.js +0 -84
- package/dist/domain/runtimeCharacterization.js +0 -84
- package/dist/replay/JavaScriptReplayWorker.js +0 -382
- package/dist/replay/JavaScriptReplayWorkerTypes.js +0 -1
- package/dist/replay/LinuxJavaScriptReplayRunner.js +0 -216
- package/dist/replay/LinuxJavaScriptReplaySandbox.js +0 -121
- package/dist/replay/LinuxRuntimeClosure.js +0 -44
- package/dist/replay/LinuxSeccompPolicy.js +0 -40
- package/dist/replay/ReplayOutcome.js +0 -104
- package/dist/replay/ReplayProcessLifecycle.js +0 -96
- package/dist/replay/ReplaySeccompFile.js +0 -29
- package/dist/replay/ReplayWorkerProtocol.js +0 -58
- package/dist/replay/SystemJavaScriptReplayHost.js +0 -153
- package/dist/server/ProcessCaptureElicitation.js +0 -153
- package/dist/server/registerApplicationTools/characterization.js +0 -46
- package/dist/server/registerApplicationTools/controlledReplay.js +0 -31
- package/dist/server/registerManagedWorkflowTools/planManagedRuntimeCorrelation.js +0 -29
- package/dist/server/registerReplayMachineTool.js +0 -14
- package/skills/reverse-engineer-anything/references/controlled-replay.md +0 -12
|
@@ -1,94 +1,128 @@
|
|
|
1
1
|
import { createHash, randomUUID } from "node:crypto";
|
|
2
2
|
import { createReadStream } from "node:fs";
|
|
3
|
-
import {
|
|
3
|
+
import { mkdtemp, rm } from "node:fs/promises";
|
|
4
4
|
import { tmpdir } from "node:os";
|
|
5
5
|
import { join } from "node:path";
|
|
6
|
-
import {
|
|
6
|
+
import { digestProcessCommitment, processComparisonContract, processScenarioCommitment, } from "../domain/processCapture.js";
|
|
7
7
|
import { PRODUCT_IDENTITY } from "../identity.js";
|
|
8
8
|
import { snapshotRoots } from "./FilesystemSnapshot.js";
|
|
9
|
+
import { classifyFilesystemEffects } from "./ProcessFilesystemEffects.js";
|
|
9
10
|
import { cleanupOwnedProcessGroup, observeOwnedProcessGroup, } from "../process/ProcessOwnership.js";
|
|
10
|
-
import { classifyFilesystemEffects, ProcessCheckpoints, } from "./ProcessCheckpoints.js";
|
|
11
11
|
import { ProcessCaptureError } from "./ProcessCaptureError.js";
|
|
12
|
-
import { assertNotCancelled
|
|
13
|
-
import { normalizeProcessElapsedTime, normalizeProcessSamples, normalizeProcessText,
|
|
12
|
+
import { assertNotCancelled } from "./ProcessScenarioRuntimeValidation.js";
|
|
13
|
+
import { normalizeProcessElapsedTime, normalizeProcessSamples, normalizeProcessText, } from "./ProcessNormalization.js";
|
|
14
14
|
import { PROCESS_PROVIDER } from "./ProcessEvidence.js";
|
|
15
15
|
import { TerminalRenderer } from "./TerminalRenderer.js";
|
|
16
16
|
import { scheduleProcessInterval } from "./ProcessTimer.js";
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
residual_unknowns: [
|
|
50
|
-
{
|
|
51
|
-
scope: "process",
|
|
52
|
-
reason: "Process trees are sampled and may omit short-lived descendants.",
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
scope: "network",
|
|
56
|
-
reason: "External network isolation is not enforced by this adapter.",
|
|
17
|
+
/** Wait for trailing PTY callbacks before the capture becomes immutable. */
|
|
18
|
+
export const settleProcessCaptureJournal = async (journal, quietMs = 25, maxWaitMs = 500) => {
|
|
19
|
+
const deadline = Date.now() + maxWaitMs;
|
|
20
|
+
let observed = journal.length;
|
|
21
|
+
let lastChangeAt = Date.now();
|
|
22
|
+
while (Date.now() < deadline) {
|
|
23
|
+
await new Promise((resolve) => setTimeout(resolve, 4));
|
|
24
|
+
if (journal.length !== observed) {
|
|
25
|
+
observed = journal.length;
|
|
26
|
+
lastChangeAt = Date.now();
|
|
27
|
+
}
|
|
28
|
+
else if (Date.now() - lastChangeAt >= quietMs)
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
export const buildCaptureResult = (options) => {
|
|
33
|
+
const hasSensitiveScriptedInput = options.scenario.events.some((event) => event.type === "input" && event.sensitive);
|
|
34
|
+
const sensitiveInputUnknown = "Sensitive scripted input values are redacted from process capture Evidence.";
|
|
35
|
+
const filesystemObservationUnknown = "No filesystem observation paths were selected; filesystem effects remain unknown.";
|
|
36
|
+
const hasFilesystemObservations = options.scenario.filesystem_observation_paths.length > 0;
|
|
37
|
+
return {
|
|
38
|
+
manifest: options.manifest,
|
|
39
|
+
normalization: options.scenario.normalization,
|
|
40
|
+
frames: options.frames,
|
|
41
|
+
rendered_frames: options.renderedFrames,
|
|
42
|
+
interaction_events: options.interactions,
|
|
43
|
+
exit: {
|
|
44
|
+
code: options.exit.reason === "exited" && options.exit.exitCode >= 0
|
|
45
|
+
? options.exit.exitCode
|
|
46
|
+
: null,
|
|
47
|
+
signal: options.exit.signal ?? null,
|
|
48
|
+
reason: options.exit.reason,
|
|
57
49
|
},
|
|
58
|
-
|
|
59
|
-
|
|
50
|
+
settlement: options.settlement,
|
|
51
|
+
process_samples: normalizeProcessSamples(options.samples, options.scenario, options.rootPid),
|
|
52
|
+
filesystem_checkpoints: options.checkpoints,
|
|
53
|
+
event_journal: options.eventJournal,
|
|
54
|
+
files_before: options.before.files,
|
|
55
|
+
files_after: options.after.files,
|
|
56
|
+
filesystem_effects: classifyFilesystemEffects(options.before.files, options.after.files),
|
|
57
|
+
truncated: options.truncated,
|
|
58
|
+
limitations: [
|
|
59
|
+
"Process trees are sampled and may omit short-lived descendants.",
|
|
60
|
+
...(options.samplingPartial
|
|
61
|
+
? ["Process-tree sampling ended with an incomplete observation."]
|
|
62
|
+
: []),
|
|
63
|
+
"Filesystem observations are before/after snapshots, not syscall traces.",
|
|
64
|
+
"Inherited host environment variables are not recorded and may affect results.",
|
|
65
|
+
...(!hasFilesystemObservations ? [filesystemObservationUnknown] : []),
|
|
66
|
+
...(hasSensitiveScriptedInput ? [sensitiveInputUnknown] : []),
|
|
67
|
+
],
|
|
68
|
+
residual_unknowns: [
|
|
69
|
+
{
|
|
70
|
+
scope: "process",
|
|
71
|
+
reason: "Process trees are sampled and may omit short-lived descendants.",
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
scope: "environment",
|
|
75
|
+
reason: "Inherited host environment variables are not recorded.",
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
scope: "network",
|
|
79
|
+
reason: "Network activity is not observed by this capture.",
|
|
80
|
+
},
|
|
81
|
+
...(!hasFilesystemObservations
|
|
82
|
+
? [
|
|
83
|
+
{
|
|
84
|
+
scope: "filesystem",
|
|
85
|
+
reason: filesystemObservationUnknown,
|
|
86
|
+
},
|
|
87
|
+
]
|
|
88
|
+
: []),
|
|
89
|
+
...(hasSensitiveScriptedInput
|
|
90
|
+
? [{ scope: "interaction", reason: sensitiveInputUnknown }]
|
|
91
|
+
: []),
|
|
92
|
+
],
|
|
93
|
+
};
|
|
94
|
+
};
|
|
60
95
|
const hashFile = async (path) => {
|
|
61
96
|
const hash = createHash("sha256");
|
|
62
97
|
for await (const chunk of createReadStream(path))
|
|
63
98
|
hash.update(chunk);
|
|
64
99
|
return hash.digest("hex");
|
|
65
100
|
};
|
|
66
|
-
export const createRunManifest = async (scenario, startedAt, completedAt
|
|
101
|
+
export const createRunManifest = async (scenario, startedAt, completedAt, host = {
|
|
102
|
+
platform: process.platform,
|
|
103
|
+
architecture: process.arch,
|
|
104
|
+
}) => {
|
|
67
105
|
const executableSha256 = await hashFile(scenario.executable);
|
|
68
106
|
const scenarioCommitment = processScenarioCommitment(scenario, executableSha256);
|
|
69
107
|
const comparisonContract = processComparisonContract(scenario);
|
|
70
108
|
return {
|
|
71
109
|
rea_version: PRODUCT_IDENTITY.packageVersion,
|
|
72
110
|
provider_version: PROCESS_PROVIDER.version,
|
|
73
|
-
platform:
|
|
74
|
-
architecture:
|
|
111
|
+
platform: host.platform,
|
|
112
|
+
architecture: host.architecture,
|
|
75
113
|
pty_backend: "node-pty",
|
|
76
114
|
started_at: startedAt.toISOString(),
|
|
77
115
|
completed_at: completedAt.toISOString(),
|
|
78
116
|
scenario: scenarioCommitment,
|
|
79
117
|
comparison_contract: comparisonContract,
|
|
80
|
-
shim_plan: scenario.command_shims,
|
|
81
|
-
replay_plan: scenario.replay,
|
|
82
118
|
full_scenario_sha256: digestProcessCommitment(scenarioCommitment),
|
|
83
119
|
comparison_contract_sha256: digestProcessCommitment(comparisonContract),
|
|
84
120
|
executable_sha256: executableSha256,
|
|
85
121
|
normalization_sha256: digestProcessCommitment(scenario.normalization),
|
|
86
|
-
shim_plan_sha256: digestProcessCommitment(scenario.command_shims),
|
|
87
|
-
replay_plan_sha256: digestProcessCommitment(scenario.replay),
|
|
88
122
|
};
|
|
89
123
|
};
|
|
90
|
-
export const observeSettlement = async (runId, processGroupIds, settleMs, recordEvent = () => undefined) => {
|
|
91
|
-
if (
|
|
124
|
+
export const observeSettlement = async (runId, processGroupIds, settleMs, recordEvent = () => undefined, platform = process.platform) => {
|
|
125
|
+
if (platform === "win32") {
|
|
92
126
|
recordEvent("lifecycle", 1);
|
|
93
127
|
return { state: "unverifiable", elapsed_ms: 0 };
|
|
94
128
|
}
|
|
@@ -169,37 +203,25 @@ export const awaitTerminalExit = async ({ terminal, scenario, started, lastOutpu
|
|
|
169
203
|
}, 20);
|
|
170
204
|
timers.add(timeout);
|
|
171
205
|
});
|
|
206
|
+
const processCaptureCleanupHost = {
|
|
207
|
+
platform: process.platform,
|
|
208
|
+
cleanupProcessGroup: cleanupOwnedProcessGroup,
|
|
209
|
+
removeTemporaryRoot: (path) => rm(path, { recursive: true, force: true }),
|
|
210
|
+
};
|
|
172
211
|
export const releaseProcessResources = async (options) => {
|
|
212
|
+
const host = options.host ?? processCaptureCleanupHost;
|
|
173
213
|
for (const timer of options.timers)
|
|
174
214
|
timer.cancel();
|
|
175
215
|
let failure;
|
|
176
|
-
try {
|
|
177
|
-
await options.replay?.close();
|
|
178
|
-
}
|
|
179
|
-
catch {
|
|
180
|
-
failure = "loopback replay cleanup failed";
|
|
181
|
-
}
|
|
182
|
-
try {
|
|
183
|
-
await options.shimReplay?.close();
|
|
184
|
-
}
|
|
185
|
-
catch {
|
|
186
|
-
failure ??= "command shim replay cleanup failed";
|
|
187
|
-
}
|
|
188
216
|
try {
|
|
189
217
|
await options.renderer?.dispose();
|
|
190
218
|
}
|
|
191
219
|
catch {
|
|
192
220
|
failure ??= "terminal renderer cleanup failed";
|
|
193
221
|
}
|
|
194
|
-
|
|
195
|
-
await options.checkpoints?.dispose();
|
|
196
|
-
}
|
|
197
|
-
catch {
|
|
198
|
-
failure ??= "filesystem checkpoint cleanup failed";
|
|
199
|
-
}
|
|
200
|
-
if (options.terminal !== undefined && process.platform !== "win32") {
|
|
222
|
+
if (options.terminal !== undefined && host.platform !== "win32") {
|
|
201
223
|
for (const processGroupId of new Set(options.capturedProcessGroupIds)) {
|
|
202
|
-
const cleaned = await
|
|
224
|
+
const cleaned = await host.cleanupProcessGroup({
|
|
203
225
|
runId: options.runId,
|
|
204
226
|
leaderPid: processGroupId,
|
|
205
227
|
processGroupId,
|
|
@@ -209,7 +231,7 @@ export const releaseProcessResources = async (options) => {
|
|
|
209
231
|
}
|
|
210
232
|
}
|
|
211
233
|
try {
|
|
212
|
-
await
|
|
234
|
+
await host.removeTemporaryRoot(options.temporaryRoot);
|
|
213
235
|
}
|
|
214
236
|
catch {
|
|
215
237
|
failure ??= "temporary process root cleanup failed";
|
|
@@ -235,9 +257,8 @@ export const captureTerminalFrames = (options) => {
|
|
|
235
257
|
at_ms: atMs,
|
|
236
258
|
data: normalized,
|
|
237
259
|
});
|
|
238
|
-
options.recordEvent("frames", sequence);
|
|
239
260
|
options.renderer.write(data, atMs);
|
|
240
|
-
options.
|
|
261
|
+
options.recordEvent("frames", sequence);
|
|
241
262
|
});
|
|
242
263
|
return () => truncated;
|
|
243
264
|
};
|
|
@@ -256,27 +277,13 @@ export const resolveProcessResult = (capture, executionFailure, cleanupFailure)
|
|
|
256
277
|
throw new ProcessCaptureError("process capture produced no result");
|
|
257
278
|
return capture;
|
|
258
279
|
};
|
|
259
|
-
export const prepareProcessCapture = async (scenario,
|
|
260
|
-
if (policy.status === "disabled")
|
|
261
|
-
throw new ProcessCaptureError("process capture is disabled", {
|
|
262
|
-
userCategory: "permission_required",
|
|
263
|
-
userMessage: processPolicyMessage("process capture is disabled"),
|
|
264
|
-
});
|
|
265
|
-
const decision = authorizeProcessScenario(scenario, policy);
|
|
266
|
-
if (!decision.allowed)
|
|
267
|
-
throw new ProcessCaptureError(decision.reason, {
|
|
268
|
-
userCategory: "permission_required",
|
|
269
|
-
userMessage: processPolicyMessage(decision.reason),
|
|
270
|
-
});
|
|
271
|
-
await assertRealPathAuthority(scenario, policy);
|
|
280
|
+
export const prepareProcessCapture = async (scenario, signal, host = systemProcessPreparationHost) => {
|
|
272
281
|
assertNotCancelled(signal);
|
|
273
282
|
const before = await snapshotRoots(scenario, signal);
|
|
274
283
|
const temporaryRoot = await host.createTemporaryRoot();
|
|
275
284
|
try {
|
|
276
285
|
const runId = randomUUID();
|
|
277
|
-
|
|
278
|
-
await host.createHome(home);
|
|
279
|
-
return { temporaryRoot, runId, home, before };
|
|
286
|
+
return { temporaryRoot, runId, before };
|
|
280
287
|
}
|
|
281
288
|
catch (cause) {
|
|
282
289
|
await host.cleanup(temporaryRoot);
|
|
@@ -285,21 +292,5 @@ export const prepareProcessCapture = async (scenario, policy, signal, host = sys
|
|
|
285
292
|
};
|
|
286
293
|
const systemProcessPreparationHost = {
|
|
287
294
|
createTemporaryRoot: () => mkdtemp(join(tmpdir(), "rea-process-")),
|
|
288
|
-
createHome: (path) => mkdir(path),
|
|
289
295
|
cleanup: (path) => rm(path, { recursive: true, force: true }),
|
|
290
296
|
};
|
|
291
|
-
const processPolicyMessage = (reason) => {
|
|
292
|
-
if (reason === "process capture is disabled")
|
|
293
|
-
return "Process capture is disabled. Set `REA_PROCESS_CAPTURE_ENABLED=true`, configure approved roots, then restart REA.";
|
|
294
|
-
if (reason === "host network access is not approved by operator policy")
|
|
295
|
-
return "This capture requests host network access, but policy does not allow it. Use replayed network access or ask the operator to enable external network capture.";
|
|
296
|
-
if (reason === "executable is outside approved roots")
|
|
297
|
-
return "The executable is outside the approved capture directories. Choose an approved executable or add its directory to `REA_PROCESS_EXECUTABLE_ROOTS_JSON`.";
|
|
298
|
-
if (reason === "working directory is outside approved roots")
|
|
299
|
-
return "The working directory is outside the approved capture directories. Choose an approved directory or add it to `REA_PROCESS_WORKING_ROOTS_JSON`.";
|
|
300
|
-
if (reason === "filesystem root is outside approved roots")
|
|
301
|
-
return "A requested filesystem root is outside the approved capture directories. Remove it or add its directory to `REA_PROCESS_WORKING_ROOTS_JSON`.";
|
|
302
|
-
if (reason === "scenario requests an environment variable not allowed by policy")
|
|
303
|
-
return "The capture requests an environment variable that policy does not allow. Remove it or add its name to `REA_PROCESS_ALLOWED_ENV_JSON`.";
|
|
304
|
-
return reason;
|
|
305
|
-
};
|
|
@@ -1,40 +1,33 @@
|
|
|
1
|
-
import { projectPermissionFailure } from "./PermissionFailure.js";
|
|
2
1
|
import { readFile } from "node:fs/promises";
|
|
3
|
-
import { parseConfig } from "../config.js";
|
|
4
2
|
import { AnalysisError, AnalysisInputError, projectAnalysisError, } from "../domain/errors.js";
|
|
5
3
|
import { createEvidence, parseEvidence } from "../domain/evidence.js";
|
|
6
4
|
import { jsonValueSchema } from "../domain/jsonValue.js";
|
|
7
5
|
import { projectInputIssues } from "../domain/inputIssueProjection.js";
|
|
8
6
|
import { processTraceSpecificationSchema } from "../domain/processTraceComparison.js";
|
|
9
|
-
import {
|
|
7
|
+
import { processScenarioSchema } from "../domain/processScenario.js";
|
|
8
|
+
import { compareProcessCaptures, parseProcessCapture, } from "../domain/processCapture.js";
|
|
10
9
|
import { captureProcessScenario } from "./ProcessHarness.js";
|
|
11
|
-
import { processCapturePermissionRequest } from "./ProcessCapturePermission.js";
|
|
12
10
|
import { PROCESS_PROVIDER, createProcessCaptureEvidence, } from "./ProcessEvidence.js";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
/** Identify the process workflow's typed diagnostic result for CLI exit status. */
|
|
12
|
+
export const isProcessCliFailure = (value) => typeof value === "object" &&
|
|
13
|
+
value !== null &&
|
|
14
|
+
"error" in value &&
|
|
15
|
+
value.error === "Process command failed" &&
|
|
16
|
+
"category" in value &&
|
|
17
|
+
typeof value.category === "string" &&
|
|
18
|
+
"message" in value &&
|
|
19
|
+
typeof value.message === "string";
|
|
20
|
+
/** Capture one JSON scenario through the shared process harness and Evidence contract. */
|
|
21
|
+
export const captureProcessScenarioFile = async (path, environment = process.env) => {
|
|
16
22
|
try {
|
|
17
23
|
const input = await readJson(path);
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
catch {
|
|
23
|
-
throw new ProcessCliFailure("invalid_input", "Process scenario is invalid. Check its required fields and limits, then try again.");
|
|
24
|
-
}
|
|
25
|
-
const config = parseConfig(process.env);
|
|
26
|
-
if (!config.ok)
|
|
27
|
-
return cliAnalysisError(config.error);
|
|
28
|
-
const authority = await loadConfiguredPermissionAuthority(config.value);
|
|
29
|
-
if (!authority.ok)
|
|
30
|
-
return cliAnalysisError(authority.error);
|
|
31
|
-
const authorized = await authority.value.authorize(processCapturePermissionRequest(scenario), "read");
|
|
32
|
-
if (!authorized.ok)
|
|
33
|
-
return cliAnalysisError(projectPermissionFailure(authorized.error));
|
|
34
|
-
const captured = await captureProcessScenario(scenario, config.value.processExecutionPolicy);
|
|
24
|
+
const parsed = processScenarioSchema.safeParse(input);
|
|
25
|
+
if (!parsed.success)
|
|
26
|
+
throw new AnalysisInputError("capture_process_scenario", { cause: parsed.error }, projectInputIssues(parsed.error.issues, input));
|
|
27
|
+
const captured = await captureProcessScenario(parsed.data, undefined, process.platform, environment);
|
|
35
28
|
if (!captured.ok)
|
|
36
29
|
return cliAnalysisError(captured.error);
|
|
37
|
-
return createProcessCaptureEvidence(
|
|
30
|
+
return createProcessCaptureEvidence(parsed.data, captured.value);
|
|
38
31
|
}
|
|
39
32
|
catch (cause) {
|
|
40
33
|
return projectProcessCliError(cause);
|
|
@@ -3,7 +3,7 @@ import { jsonValueSchema } from "../domain/jsonValue.js";
|
|
|
3
3
|
/** Provider identity for controlled process capture evidence. */
|
|
4
4
|
export const PROCESS_PROVIDER = {
|
|
5
5
|
id: "rea-process",
|
|
6
|
-
name: "REA
|
|
6
|
+
name: "REA process capture",
|
|
7
7
|
version: "3",
|
|
8
8
|
};
|
|
9
9
|
/** Project one process scenario into secret-free Evidence parameters. */
|
|
@@ -11,9 +11,7 @@ const processEvidenceParameters = (scenario) => ({
|
|
|
11
11
|
executable_name: scenario.executable.split("/").at(-1) ?? scenario.executable,
|
|
12
12
|
argument_count: scenario.arguments.length,
|
|
13
13
|
event_count: scenario.events.length,
|
|
14
|
-
|
|
15
|
-
checkpoint_count: scenario.checkpoints.length,
|
|
16
|
-
command_shim_count: scenario.command_shims.length,
|
|
14
|
+
filesystem_observation_path_count: scenario.filesystem_observation_paths.length,
|
|
17
15
|
normalization: scenario.normalization,
|
|
18
16
|
});
|
|
19
17
|
/** Create one canonical observed process capture Evidence record. */
|
|
@@ -26,9 +24,9 @@ export const createProcessCaptureEvidence = (scenario, capture) => {
|
|
|
26
24
|
confidence: "observed",
|
|
27
25
|
authority: "controlled-replay",
|
|
28
26
|
environment: {
|
|
29
|
-
id: `${
|
|
30
|
-
platform:
|
|
31
|
-
architecture:
|
|
27
|
+
id: `${capture.manifest.platform}-${capture.manifest.architecture}`,
|
|
28
|
+
platform: capture.manifest.platform,
|
|
29
|
+
architecture: capture.manifest.architecture,
|
|
32
30
|
isolation: "process",
|
|
33
31
|
},
|
|
34
32
|
limitations: capture.limitations,
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** Classify path-stable filesystem effects between two bounded states. */
|
|
2
|
+
export const classifyFilesystemEffects = (before, after) => {
|
|
3
|
+
const beforeByPath = new Map(before.map((file) => [file.path, file]));
|
|
4
|
+
const afterByPath = new Map(after.map((file) => [file.path, file]));
|
|
5
|
+
return [...new Set([...beforeByPath.keys(), ...afterByPath.keys()])]
|
|
6
|
+
.sort()
|
|
7
|
+
.map((path) => {
|
|
8
|
+
const beforeFile = beforeByPath.get(path) ?? null;
|
|
9
|
+
const afterFile = afterByPath.get(path) ?? null;
|
|
10
|
+
if (beforeFile === null) {
|
|
11
|
+
if (afterFile === null)
|
|
12
|
+
throw new TypeError(`Filesystem effect ${path} has no file state`);
|
|
13
|
+
return {
|
|
14
|
+
path,
|
|
15
|
+
status: "created",
|
|
16
|
+
before: null,
|
|
17
|
+
after: afterFile,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
if (afterFile === null)
|
|
21
|
+
return {
|
|
22
|
+
path,
|
|
23
|
+
status: "deleted",
|
|
24
|
+
before: beforeFile,
|
|
25
|
+
after: null,
|
|
26
|
+
};
|
|
27
|
+
return {
|
|
28
|
+
path,
|
|
29
|
+
status: JSON.stringify(beforeFile) === JSON.stringify(afterFile)
|
|
30
|
+
? "unchanged"
|
|
31
|
+
: "modified",
|
|
32
|
+
before: beforeFile,
|
|
33
|
+
after: afterFile,
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
};
|