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,20 +1,12 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
-
import { isPathWithinRoot } from "./localPath.js";
|
|
3
2
|
import canonicalize from "canonicalize";
|
|
4
3
|
import { z } from "zod";
|
|
5
|
-
import { processReactiveScenarioSchema, } from "./processReactiveScenario.js";
|
|
6
|
-
import { replayMachineSchema } from "./replayMachine.js";
|
|
7
4
|
const positiveBudget = z.number().int().safe().positive();
|
|
8
5
|
const timedEventBase = { at_ms: z.number().int().safe().nonnegative() };
|
|
9
|
-
const environmentName = z
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
"REA_PROCESS_RUN_ID",
|
|
14
|
-
"REA_REPLAY_HTTP_URL",
|
|
15
|
-
"REA_REPLAY_WEBSOCKET_URL",
|
|
16
|
-
"REA_SHIM_LEDGER_URL",
|
|
17
|
-
]);
|
|
6
|
+
const environmentName = z
|
|
7
|
+
.string()
|
|
8
|
+
.regex(/^[^=\0]+$/u, "Environment names cannot contain '=' or NUL");
|
|
9
|
+
const reservedEnvironment = new Set(["REA_PROCESS_RUN_ID"]);
|
|
18
10
|
export const normalizationSchema = z.object({
|
|
19
11
|
paths: z.boolean(),
|
|
20
12
|
pids: z.boolean(),
|
|
@@ -25,13 +17,6 @@ export const normalizationSchema = z.object({
|
|
|
25
17
|
replacement: z.string(),
|
|
26
18
|
})),
|
|
27
19
|
});
|
|
28
|
-
const checkpointNameSchema = z.string().regex(/^[A-Za-z0-9][A-Za-z0-9_-]*$/u);
|
|
29
|
-
const commandNameSchema = z.string().regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/u);
|
|
30
|
-
const outputChunkSchema = z.object({
|
|
31
|
-
at_ms: z.number().int().safe().nonnegative(),
|
|
32
|
-
stream: z.enum(["stdout", "stderr"]),
|
|
33
|
-
data: z.string(),
|
|
34
|
-
});
|
|
35
20
|
/** Compute a canonical SHA-256 commitment independent of object key order. */
|
|
36
21
|
export const digestProcessCommitment = (value) => {
|
|
37
22
|
const serialized = canonicalize(value);
|
|
@@ -39,51 +24,36 @@ export const digestProcessCommitment = (value) => {
|
|
|
39
24
|
throw new TypeError("Process capture commitment is not canonical JSON");
|
|
40
25
|
return createHash("sha256").update(serialized).digest("hex");
|
|
41
26
|
};
|
|
42
|
-
const
|
|
43
|
-
?
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
? {
|
|
52
|
-
...action,
|
|
53
|
-
data: `<redacted-input:${String(Buffer.byteLength(action.data))}-bytes>`,
|
|
54
|
-
}
|
|
55
|
-
: action),
|
|
56
|
-
})),
|
|
57
|
-
})),
|
|
58
|
-
};
|
|
59
|
-
/** Build the secret-safe scenario projection committed by process-capture Evidence. */
|
|
27
|
+
const committedScenarioEvents = (events, includeSensitiveInputLength) => events.map((event) => event.type === "input" && event.sensitive
|
|
28
|
+
? {
|
|
29
|
+
...event,
|
|
30
|
+
data: includeSensitiveInputLength
|
|
31
|
+
? `<redacted-input:${String(Buffer.byteLength(event.data))}-bytes>`
|
|
32
|
+
: "<redacted-input>",
|
|
33
|
+
}
|
|
34
|
+
: event);
|
|
35
|
+
/** Build the caller-selected scenario projection committed by process-capture Evidence. */
|
|
60
36
|
export const processScenarioCommitment = (scenario, executableSha256) => ({
|
|
61
37
|
...scenario,
|
|
62
|
-
|
|
63
|
-
name,
|
|
64
|
-
scenario.secret_aliases.includes(name) ? "<redacted-secret>" : value,
|
|
65
|
-
])),
|
|
66
|
-
reactive: reactiveScenarioCommitment(scenario.reactive),
|
|
38
|
+
events: committedScenarioEvents(scenario.events, true),
|
|
67
39
|
executable_sha256: executableSha256 ?? null,
|
|
68
40
|
});
|
|
69
|
-
/** Project observation settings shared by
|
|
41
|
+
/** Project observation settings shared by capture and reconstruction. */
|
|
70
42
|
export const processComparisonContract = (scenario) => ({
|
|
71
43
|
working_directory: scenario.working_directory,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
filesystem_roots: scenario.filesystem_roots,
|
|
44
|
+
environment: scenario.environment,
|
|
45
|
+
ambient_environment: "unknown",
|
|
46
|
+
filesystem_observation_paths: scenario.filesystem_observation_paths,
|
|
76
47
|
terminal: scenario.terminal,
|
|
77
|
-
|
|
78
|
-
|
|
48
|
+
// Input bytes are intentionally absent from compatibility identity. Their
|
|
49
|
+
// redacted observations remain unknown, so equal commitments never imply
|
|
50
|
+
// that two secret values were the same.
|
|
51
|
+
events: committedScenarioEvents(scenario.events, false),
|
|
79
52
|
timeout_ms: scenario.timeout_ms,
|
|
80
53
|
idle_timeout_ms: scenario.idle_timeout_ms,
|
|
81
54
|
settle_ms: scenario.settle_ms,
|
|
82
55
|
limits: scenario.limits,
|
|
83
56
|
normalization: scenario.normalization,
|
|
84
|
-
command_shims: scenario.command_shims,
|
|
85
|
-
replay: scenario.replay,
|
|
86
|
-
reactive: reactiveScenarioCommitment(scenario.reactive),
|
|
87
57
|
});
|
|
88
58
|
/**
|
|
89
59
|
* Boundary schema for one bounded process experiment.
|
|
@@ -91,14 +61,11 @@ export const processComparisonContract = (scenario) => ({
|
|
|
91
61
|
*/
|
|
92
62
|
export const processScenarioSchema = z
|
|
93
63
|
.object({
|
|
94
|
-
executable: z.string().
|
|
64
|
+
executable: z.string().min(1),
|
|
95
65
|
arguments: z.array(z.string()).default([]),
|
|
96
|
-
working_directory: z.string().
|
|
66
|
+
working_directory: z.string().default("."),
|
|
97
67
|
environment: z.record(environmentName, z.string()).default({}),
|
|
98
|
-
|
|
99
|
-
secret_aliases: z.array(environmentName).default([]),
|
|
100
|
-
network_access: z.literal("host").default("host"),
|
|
101
|
-
filesystem_roots: z.array(z.string().startsWith("/")).default([]),
|
|
68
|
+
filesystem_observation_paths: z.array(z.string().min(1)).default([]),
|
|
102
69
|
terminal: z
|
|
103
70
|
.object({
|
|
104
71
|
columns: z.number().int().min(1).max(65_535).default(80),
|
|
@@ -106,46 +73,6 @@ export const processScenarioSchema = z
|
|
|
106
73
|
scrollback: z.number().int().min(0).default(1_000),
|
|
107
74
|
})
|
|
108
75
|
.default({ columns: 80, rows: 24, scrollback: 1_000 }),
|
|
109
|
-
checkpoints: z
|
|
110
|
-
.array(z.object({
|
|
111
|
-
name: checkpointNameSchema,
|
|
112
|
-
trigger: z.discriminatedUnion("type", [
|
|
113
|
-
z.object({
|
|
114
|
-
type: z.literal("time"),
|
|
115
|
-
at_ms: z.number().int().safe().nonnegative(),
|
|
116
|
-
}),
|
|
117
|
-
z.object({
|
|
118
|
-
type: z.literal("terminal_literal"),
|
|
119
|
-
value: z.string().min(1),
|
|
120
|
-
occurrence: positiveBudget.default(1),
|
|
121
|
-
}),
|
|
122
|
-
z.object({ type: z.literal("root_exit") }),
|
|
123
|
-
z.object({ type: z.literal("settled") }),
|
|
124
|
-
]),
|
|
125
|
-
}))
|
|
126
|
-
.default([]),
|
|
127
|
-
command_shims: z
|
|
128
|
-
.array(z.object({
|
|
129
|
-
name: commandNameSchema,
|
|
130
|
-
routes: z
|
|
131
|
-
.array(z.object({
|
|
132
|
-
arguments: z.array(z.string()),
|
|
133
|
-
outputs: z.array(outputChunkSchema).default([]),
|
|
134
|
-
termination: z.discriminatedUnion("type", [
|
|
135
|
-
z.object({
|
|
136
|
-
type: z.literal("exit"),
|
|
137
|
-
code: z.number().int().min(0).max(255),
|
|
138
|
-
}),
|
|
139
|
-
z.object({
|
|
140
|
-
type: z.literal("signal"),
|
|
141
|
-
signal: z.enum(["SIGINT", "SIGTERM", "SIGKILL"]),
|
|
142
|
-
}),
|
|
143
|
-
]),
|
|
144
|
-
max_calls: positiveBudget.default(1),
|
|
145
|
-
}))
|
|
146
|
-
.min(1),
|
|
147
|
-
}))
|
|
148
|
-
.default([]),
|
|
149
76
|
events: z
|
|
150
77
|
.array(z.discriminatedUnion("type", [
|
|
151
78
|
z.object({
|
|
@@ -176,9 +103,6 @@ export const processScenarioSchema = z
|
|
|
176
103
|
files: positiveBudget.default(10_000),
|
|
177
104
|
file_bytes: positiveBudget.default(10_000_000),
|
|
178
105
|
processes: positiveBudget.default(1_000),
|
|
179
|
-
protocol_events: positiveBudget.default(10_000),
|
|
180
|
-
protocol_body_bytes: positiveBudget.default(1_000_000),
|
|
181
|
-
connections: positiveBudget.default(100),
|
|
182
106
|
filesystem_depth: z.number().int().safe().nonnegative().default(16),
|
|
183
107
|
})
|
|
184
108
|
.strict()
|
|
@@ -187,14 +111,11 @@ export const processScenarioSchema = z
|
|
|
187
111
|
files: 10_000,
|
|
188
112
|
file_bytes: 10_000_000,
|
|
189
113
|
processes: 1_000,
|
|
190
|
-
protocol_events: 10_000,
|
|
191
|
-
protocol_body_bytes: 1_000_000,
|
|
192
|
-
connections: 100,
|
|
193
114
|
filesystem_depth: 16,
|
|
194
115
|
}),
|
|
195
116
|
normalization: z
|
|
196
117
|
.object({
|
|
197
|
-
paths: z.boolean().default(
|
|
118
|
+
paths: z.boolean().default(false),
|
|
198
119
|
pids: z.boolean().default(true),
|
|
199
120
|
ports: z.boolean().default(true),
|
|
200
121
|
time_bucket_ms: positiveBudget.default(10),
|
|
@@ -206,47 +127,12 @@ export const processScenarioSchema = z
|
|
|
206
127
|
.default([]),
|
|
207
128
|
})
|
|
208
129
|
.default({
|
|
209
|
-
paths:
|
|
130
|
+
paths: false,
|
|
210
131
|
pids: true,
|
|
211
132
|
ports: true,
|
|
212
133
|
time_bucket_ms: 10,
|
|
213
134
|
patterns: [],
|
|
214
135
|
}),
|
|
215
|
-
replay: z
|
|
216
|
-
.object({
|
|
217
|
-
machine: replayMachineSchema.nullable().default(null),
|
|
218
|
-
http: z
|
|
219
|
-
.array(z.object({
|
|
220
|
-
method: z.string(),
|
|
221
|
-
path: z.string().startsWith("/"),
|
|
222
|
-
status: z.number().int().min(100).max(599),
|
|
223
|
-
body: z.string(),
|
|
224
|
-
request_headers: z.record(z.string(), z.string()).default({}),
|
|
225
|
-
request_body: z.string().optional(),
|
|
226
|
-
response_headers: z.record(z.string(), z.string()).default({}),
|
|
227
|
-
delay_ms: z.number().int().safe().nonnegative().default(0),
|
|
228
|
-
disconnect: z.boolean().default(false),
|
|
229
|
-
max_calls: positiveBudget.default(1),
|
|
230
|
-
}))
|
|
231
|
-
.default([]),
|
|
232
|
-
websocket_messages: z.array(z.string()).default([]),
|
|
233
|
-
websocket_connections: z
|
|
234
|
-
.array(z.object({
|
|
235
|
-
messages: z.array(z.object({
|
|
236
|
-
data: z.string(),
|
|
237
|
-
delay_ms: z.number().int().safe().nonnegative().default(0),
|
|
238
|
-
})),
|
|
239
|
-
disconnect_after: z.boolean().default(false),
|
|
240
|
-
}))
|
|
241
|
-
.default([]),
|
|
242
|
-
})
|
|
243
|
-
.default({
|
|
244
|
-
machine: null,
|
|
245
|
-
http: [],
|
|
246
|
-
websocket_messages: [],
|
|
247
|
-
websocket_connections: [],
|
|
248
|
-
}),
|
|
249
|
-
reactive: processReactiveScenarioSchema.nullable().default(null),
|
|
250
136
|
})
|
|
251
137
|
.strict()
|
|
252
138
|
.superRefine((scenario, context) => {
|
|
@@ -261,18 +147,8 @@ export const processScenarioSchema = z
|
|
|
261
147
|
});
|
|
262
148
|
}
|
|
263
149
|
}
|
|
264
|
-
const secrets = new Set(scenario.secret_aliases);
|
|
265
|
-
for (const alias of secrets) {
|
|
266
|
-
if (!(alias in scenario.environment)) {
|
|
267
|
-
context.addIssue({
|
|
268
|
-
code: "custom",
|
|
269
|
-
message: "secret alias has no environment value",
|
|
270
|
-
path: ["secret_aliases"],
|
|
271
|
-
});
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
150
|
const explicit = new Set(Object.keys(scenario.environment));
|
|
275
|
-
for (const name of
|
|
151
|
+
for (const name of explicit) {
|
|
276
152
|
if (reservedEnvironment.has(name)) {
|
|
277
153
|
context.addIssue({
|
|
278
154
|
code: "custom",
|
|
@@ -281,15 +157,6 @@ export const processScenarioSchema = z
|
|
|
281
157
|
});
|
|
282
158
|
}
|
|
283
159
|
}
|
|
284
|
-
for (const name of scenario.inherit_environment) {
|
|
285
|
-
if (explicit.has(name)) {
|
|
286
|
-
context.addIssue({
|
|
287
|
-
code: "custom",
|
|
288
|
-
message: "an environment name cannot be explicit and inherited",
|
|
289
|
-
path: ["inherit_environment"],
|
|
290
|
-
});
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
160
|
for (const event of scenario.events) {
|
|
294
161
|
if (event.at_ms > scenario.timeout_ms) {
|
|
295
162
|
context.addIssue({
|
|
@@ -299,74 +166,7 @@ export const processScenarioSchema = z
|
|
|
299
166
|
});
|
|
300
167
|
}
|
|
301
168
|
}
|
|
302
|
-
const checkpointNames = scenario.checkpoints.map(({ name }) => name);
|
|
303
|
-
for (const [index, name] of checkpointNames.entries()) {
|
|
304
|
-
if (name === "before" || name === "after_settlement")
|
|
305
|
-
context.addIssue({
|
|
306
|
-
code: "custom",
|
|
307
|
-
message: "checkpoint name is reserved by the capture lifecycle",
|
|
308
|
-
path: ["checkpoints", index, "name"],
|
|
309
|
-
});
|
|
310
|
-
}
|
|
311
|
-
if (new Set(checkpointNames).size !== checkpointNames.length)
|
|
312
|
-
context.addIssue({
|
|
313
|
-
code: "custom",
|
|
314
|
-
message: "checkpoint names must be unique",
|
|
315
|
-
path: ["checkpoints"],
|
|
316
|
-
});
|
|
317
|
-
const shimNames = scenario.command_shims.map(({ name }) => name);
|
|
318
|
-
if (new Set(shimNames).size !== shimNames.length)
|
|
319
|
-
context.addIssue({
|
|
320
|
-
code: "custom",
|
|
321
|
-
message: "command shim names must be unique",
|
|
322
|
-
path: ["command_shims"],
|
|
323
|
-
});
|
|
324
|
-
if (scenario.replay.machine !== null &&
|
|
325
|
-
(scenario.replay.http.length > 0 ||
|
|
326
|
-
scenario.replay.websocket_messages.length > 0 ||
|
|
327
|
-
scenario.replay.websocket_connections.length > 0))
|
|
328
|
-
context.addIssue({
|
|
329
|
-
code: "custom",
|
|
330
|
-
message: "a replay machine cannot be combined with static HTTP or WebSocket scripts",
|
|
331
|
-
path: ["replay"],
|
|
332
|
-
});
|
|
333
169
|
});
|
|
334
170
|
const eventsOutOfOrder = (event, previous) => event !== undefined && previous !== undefined && event.at_ms < previous.at_ms;
|
|
335
171
|
/** Parse untrusted process scenario input and apply safe default budgets. */
|
|
336
172
|
export const parseProcessScenario = (input) => processScenarioSchema.parse(input);
|
|
337
|
-
/** Evaluate scenario authority before any process or filesystem side effect occurs. */
|
|
338
|
-
export const authorizeProcessScenario = (scenario, policy) => {
|
|
339
|
-
if (policy.status === "disabled")
|
|
340
|
-
return { allowed: false, reason: "process capture is disabled" };
|
|
341
|
-
if (scenario.network_access === "host" && policy.networkAccess === "none")
|
|
342
|
-
return {
|
|
343
|
-
allowed: false,
|
|
344
|
-
reason: "host network access is not approved by operator policy",
|
|
345
|
-
};
|
|
346
|
-
if (!policy.executableRoots.some((root) => isPathWithinRoot(root, scenario.executable))) {
|
|
347
|
-
return { allowed: false, reason: "executable is outside approved roots" };
|
|
348
|
-
}
|
|
349
|
-
if (!policy.workingRoots.some((root) => isPathWithinRoot(root, scenario.working_directory))) {
|
|
350
|
-
return {
|
|
351
|
-
allowed: false,
|
|
352
|
-
reason: "working directory is outside approved roots",
|
|
353
|
-
};
|
|
354
|
-
}
|
|
355
|
-
const requestedNames = [
|
|
356
|
-
...Object.keys(scenario.environment),
|
|
357
|
-
...scenario.inherit_environment,
|
|
358
|
-
];
|
|
359
|
-
if (requestedNames.some((name) => !policy.allowedEnvironment.includes(name))) {
|
|
360
|
-
return {
|
|
361
|
-
allowed: false,
|
|
362
|
-
reason: "scenario requests an environment variable not allowed by policy",
|
|
363
|
-
};
|
|
364
|
-
}
|
|
365
|
-
if (scenario.filesystem_roots.some((path) => !policy.workingRoots.some((root) => isPathWithinRoot(root, path)))) {
|
|
366
|
-
return {
|
|
367
|
-
allowed: false,
|
|
368
|
-
reason: "filesystem root is outside approved roots",
|
|
369
|
-
};
|
|
370
|
-
}
|
|
371
|
-
return { allowed: true };
|
|
372
|
-
};
|
|
@@ -10,14 +10,8 @@ export const dimensionsForTraceSources = (sources) => {
|
|
|
10
10
|
dimensions.add("exit");
|
|
11
11
|
else if (source === "filesystem")
|
|
12
12
|
dimensions.add("filesystem");
|
|
13
|
-
else if (source === "http" ||
|
|
14
|
-
source === "websocket" ||
|
|
15
|
-
source === "replay_transition")
|
|
16
|
-
dimensions.add("protocol");
|
|
17
13
|
else if (source === "process")
|
|
18
14
|
dimensions.add("process");
|
|
19
|
-
else if (source === "shim")
|
|
20
|
-
dimensions.add("shim");
|
|
21
15
|
}
|
|
22
16
|
return dimensions;
|
|
23
17
|
};
|
|
@@ -35,16 +29,7 @@ export const traceCoversObservedDimension = (dimension, sources, left, right) =>
|
|
|
35
29
|
return sources.has("lifecycle");
|
|
36
30
|
case "filesystem":
|
|
37
31
|
return false;
|
|
38
|
-
case "protocol":
|
|
39
|
-
return ((![...left.protocol_events, ...right.protocol_events].some(({ protocol }) => protocol === "http") ||
|
|
40
|
-
sources.has("http")) &&
|
|
41
|
-
(![...left.protocol_events, ...right.protocol_events].some(({ protocol }) => protocol === "websocket") ||
|
|
42
|
-
sources.has("websocket")) &&
|
|
43
|
-
(!any(left.replay_transitions, right.replay_transitions) ||
|
|
44
|
-
sources.has("replay_transition")));
|
|
45
32
|
case "process":
|
|
46
33
|
return sources.has("process");
|
|
47
|
-
case "shim":
|
|
48
|
-
return sources.has("shim");
|
|
49
34
|
}
|
|
50
35
|
};
|
|
@@ -50,16 +50,10 @@ const scopesFor = (sources) => new Set([...sources].map((source) => {
|
|
|
50
50
|
return "terminal";
|
|
51
51
|
if (source === "lifecycle")
|
|
52
52
|
return "exit";
|
|
53
|
-
if (source === "http" ||
|
|
54
|
-
source === "websocket" ||
|
|
55
|
-
source === "replay_transition")
|
|
56
|
-
return "protocol";
|
|
57
53
|
if (source === "filesystem")
|
|
58
54
|
return "filesystem";
|
|
59
55
|
if (source === "process")
|
|
60
56
|
return "process";
|
|
61
|
-
if (source === "shim")
|
|
62
|
-
return "shim";
|
|
63
57
|
return "interaction";
|
|
64
58
|
}));
|
|
65
59
|
const unknownSide = () => ({
|
|
@@ -51,7 +51,7 @@ export const protocolMessageSchema = z.strictObject({
|
|
|
51
51
|
schema_hypotheses: z.array(schemaHypothesisSchema).default([]),
|
|
52
52
|
/** Whether decoding was truncated. */
|
|
53
53
|
truncated: z.boolean().default(false),
|
|
54
|
-
/** Whether
|
|
54
|
+
/** Whether the capture producer marked credentials as redacted. */
|
|
55
55
|
credentials_redacted: z.boolean().default(false),
|
|
56
56
|
});
|
|
57
57
|
/** A captured protocol session with messages and inferred schemas. */
|
|
@@ -64,7 +64,7 @@ export const protocolCaptureSchema = z.strictObject({
|
|
|
64
64
|
inferred_schema: z.array(schemaHypothesisSchema).default([]),
|
|
65
65
|
/** Whether any message was truncated. */
|
|
66
66
|
has_truncated: z.boolean().default(false),
|
|
67
|
-
/** Whether
|
|
67
|
+
/** Whether the capture producer marked credential content as redacted. */
|
|
68
68
|
credentials_detected: z.boolean().default(false),
|
|
69
69
|
});
|
|
70
70
|
/** Classification of a byte sequence as a known protocol family. */
|
|
@@ -88,24 +88,6 @@ export function classifyProtocolFamily(contentType, path) {
|
|
|
88
88
|
}
|
|
89
89
|
return null;
|
|
90
90
|
}
|
|
91
|
-
/** Credential-like field names that should be redacted. */
|
|
92
|
-
const CREDENTIAL_PATTERNS = [
|
|
93
|
-
"password",
|
|
94
|
-
"passwd",
|
|
95
|
-
"secret",
|
|
96
|
-
"token",
|
|
97
|
-
"api_key",
|
|
98
|
-
"apikey",
|
|
99
|
-
"authorization",
|
|
100
|
-
"auth",
|
|
101
|
-
"credential",
|
|
102
|
-
"private_key",
|
|
103
|
-
];
|
|
104
|
-
/** Check if a field path looks like it may contain credentials. */
|
|
105
|
-
export function looksLikeCredential(path) {
|
|
106
|
-
const lower = path.toLowerCase();
|
|
107
|
-
return CREDENTIAL_PATTERNS.some((p) => lower.includes(p));
|
|
108
|
-
}
|
|
109
91
|
/** Decode a JSON-RPC message from raw payload bytes. */
|
|
110
92
|
export function decodeJsonRpc(rawPayload) {
|
|
111
93
|
const text = new TextDecoder().decode(rawPayload);
|
|
@@ -113,22 +95,12 @@ export function decodeJsonRpc(rawPayload) {
|
|
|
113
95
|
const fields = [];
|
|
114
96
|
if (typeof parsed === "object" && parsed !== null) {
|
|
115
97
|
for (const [key, value] of Object.entries(parsed)) {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
fields.push({
|
|
126
|
-
path: key,
|
|
127
|
-
wire_type: "json",
|
|
128
|
-
value,
|
|
129
|
-
inferred: false,
|
|
130
|
-
});
|
|
131
|
-
}
|
|
98
|
+
fields.push({
|
|
99
|
+
path: key,
|
|
100
|
+
wire_type: "json",
|
|
101
|
+
value,
|
|
102
|
+
inferred: false,
|
|
103
|
+
});
|
|
132
104
|
}
|
|
133
105
|
}
|
|
134
106
|
return { decoded_fields: fields, truncated: false };
|
|
@@ -3,8 +3,9 @@ import canonicalize from "canonicalize";
|
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import { evidenceBundleSchema, parseEvidenceBundle } from "./evidenceBundle.js";
|
|
5
5
|
import { evaluateReconstructionClaims, evaluateReconstructionPackageProofs, evaluateReconstructionSurfaces, evaluateReconstructionCoverageRisks, recommendedReconstructionProbes, } from "./reconstructionCoverageEvaluation.js";
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
import { digestSchema } from "./../domain/digests.js";
|
|
7
|
+
import { prefixedDigestSchema } from "./../domain/digests.js";
|
|
8
|
+
const evidenceIdSchema = prefixedDigestSchema("ev");
|
|
8
9
|
const stableIdSchema = z.string().regex(/^[A-Za-z][A-Za-z0-9._:/-]{0,199}$/u);
|
|
9
10
|
const boundedTextSchema = z.string().trim().min(1);
|
|
10
11
|
const authoritySchema = z.enum([
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import canonicalize from "canonicalize";
|
|
2
1
|
import { z } from "zod";
|
|
3
2
|
import { evidenceBundleSchema } from "./evidenceBundle.js";
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { digestSchema } from "./../domain/digests.js";
|
|
4
|
+
import { prefixedDigestSchema } from "./../domain/digests.js";
|
|
5
|
+
const evidenceIdSchema = prefixedDigestSchema("ev");
|
|
6
6
|
const stableIdSchema = z.string().regex(/^[A-Za-z][A-Za-z0-9._:/-]*$/u);
|
|
7
7
|
const textSchema = z.string().trim().min(1);
|
|
8
8
|
export const obligationStatusSchema = z.enum([
|
|
@@ -202,7 +202,7 @@ const countBySchema = (key) => z.array(z.strictObject({
|
|
|
202
202
|
}));
|
|
203
203
|
export const reconstructionObligationLedgerSchema = z.strictObject({
|
|
204
204
|
schema: z.literal("ReconstructionObligationLedger"),
|
|
205
|
-
ledger_id:
|
|
205
|
+
ledger_id: prefixedDigestSchema("rol"),
|
|
206
206
|
closure_digest: digestSchema,
|
|
207
207
|
status: z.enum(["ready", "open", "failed", "unknown"]),
|
|
208
208
|
coverage: z.strictObject({
|
|
@@ -241,11 +241,3 @@ export const reconstructionObligationLedgerInputSchema = z.strictObject({
|
|
|
241
241
|
reviewed_obligations: z.array(reviewedReconstructionObligationSchema),
|
|
242
242
|
manifest: reconstructionObligationManifestSchema,
|
|
243
243
|
});
|
|
244
|
-
/** Parse and canonically serialize one complete reconstruction obligation ledger. */
|
|
245
|
-
export const serializeReconstructionObligationLedger = (input) => {
|
|
246
|
-
const ledger = reconstructionObligationLedgerSchema.parse(input);
|
|
247
|
-
const encoded = canonicalize(ledger);
|
|
248
|
-
if (encoded === undefined)
|
|
249
|
-
throw new TypeError("Reconstruction obligation ledger is not canonical JSON");
|
|
250
|
-
return encoded;
|
|
251
|
-
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { evidenceBundleSchema } from "./evidenceBundle.js";
|
|
3
3
|
import { reconstructionObligationLedgerSchema } from "./reconstructionObligationLedgerSchemas.js";
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
import { digestSchema } from "./../domain/digests.js";
|
|
5
|
+
import { prefixedDigestSchema } from "./../domain/digests.js";
|
|
6
|
+
const evidenceIdSchema = prefixedDigestSchema("ev");
|
|
6
7
|
const stableIdSchema = z.string().regex(/^[A-Za-z][A-Za-z0-9._:/-]*$/u);
|
|
7
8
|
const boundedTextSchema = z.string().trim().min(1);
|
|
8
9
|
export const readinessStatusSchema = z.enum([
|
|
@@ -221,7 +222,7 @@ const findingSchema = z.strictObject({
|
|
|
221
222
|
});
|
|
222
223
|
export const reconstructionReadinessReportSchema = z.strictObject({
|
|
223
224
|
schema: z.literal("ReconstructionReadinessReport"),
|
|
224
|
-
report_id:
|
|
225
|
+
report_id: prefixedDigestSchema("rr"),
|
|
225
226
|
source_digest: digestSchema,
|
|
226
227
|
report_digest: digestSchema,
|
|
227
228
|
status: readinessStatusSchema,
|
|
@@ -10,8 +10,9 @@ import { functionDossierSchema } from "./hopperValues.js";
|
|
|
10
10
|
import { deriveProcessComparisonStatus, PROCESS_COMPARISON_DIMENSIONS, processCaptureComparisonSchema, processCaptureSchema, } from "./processCapture.js";
|
|
11
11
|
import { reconstructionClaimResultSchema, reconstructionSpecificationSchema, reconstructionVerificationResultSchema, } from "./reconstructionVerificationSchemas.js";
|
|
12
12
|
import { reconstructionClaimUnknowns, reconstructionProbes, reconstructionUnknownHeads, } from "./reconstructionUnknowns.js";
|
|
13
|
-
const evidenceIdSchema =
|
|
13
|
+
const evidenceIdSchema = prefixedDigestSchema("ev");
|
|
14
14
|
export { reconstructionVerificationInputSchema, reconstructionVerificationResultSchema, } from "./reconstructionVerificationSchemas.js";
|
|
15
|
+
import { prefixedDigestSchema } from "./../domain/digests.js";
|
|
15
16
|
const providers = {
|
|
16
17
|
behavioral: {
|
|
17
18
|
operation: "compare_process_captures",
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { digestSchema } from "./../domain/digests.js";
|
|
3
|
+
import { prefixedDigestSchema } from "./../domain/digests.js";
|
|
4
|
+
import { PROCESS_COMPARISON_DIMENSIONS } from "./processComparison.js";
|
|
5
|
+
const evidenceIdSchema = prefixedDigestSchema("ev");
|
|
6
|
+
const unknownIdSchema = prefixedDigestSchema("unk");
|
|
5
7
|
const claimIdSchema = z.string().regex(/^[A-Za-z][A-Za-z0-9._-]*$/u);
|
|
6
8
|
const titleSchema = z.string().trim().min(1);
|
|
7
9
|
const verificationStatusSchema = z.enum(["pass", "fail", "unknown"]);
|
|
@@ -13,16 +15,7 @@ const commonClaim = {
|
|
|
13
15
|
const behavioralClaimSchema = z.object({
|
|
14
16
|
...commonClaim,
|
|
15
17
|
kind: z.literal("behavioral"),
|
|
16
|
-
dimension: z.enum([
|
|
17
|
-
"overall",
|
|
18
|
-
"terminal",
|
|
19
|
-
"interaction",
|
|
20
|
-
"exit",
|
|
21
|
-
"filesystem",
|
|
22
|
-
"protocol",
|
|
23
|
-
"process",
|
|
24
|
-
"shim",
|
|
25
|
-
]),
|
|
18
|
+
dimension: z.enum(["overall", ...PROCESS_COMPARISON_DIMENSIONS]),
|
|
26
19
|
});
|
|
27
20
|
const functionClaimSchema = z.object({
|
|
28
21
|
...commonClaim,
|