diff --git a/scripts/verify/architecture-guard-baselines.json b/scripts/verify/architecture-guard-baselines.json index dbce645ddd..9ace0c1b26 100644 --- a/scripts/verify/architecture-guard-baselines.json +++ b/scripts/verify/architecture-guard-baselines.json @@ -394,5 +394,158 @@ }, "wall-clock-deadline": { "src/browser/PlaywrightScenarioRequest.ts": 1 + }, + "cleanup-resolve-push": { + "src/android/JadxProvider.ts": 2, + "src/application/binary/AnalysisProviderRegistry.ts": 1, + "src/application/binary/BinarySession.ts": 1, + "src/application/desktop/DesktopBuildComputers.ts": 1, + "src/application/desktop/DesktopRemoteTaskReaders.ts": 1, + "src/application/desktop/DesktopTaskReaderCleanup.ts": 1, + "src/application/reverse/ReverseEngineeringService.ts": 1, + "src/browser/WebSourceMapFetcher.ts": 2, + "src/cutter/CutterBridgeService.ts": 1, + "src/desktop/AgentEnvSolveHelper.ts": 2, + "src/desktop/BuildComputerLongRuns.ts": 1, + "src/desktop/ScreenJudgeProcess.ts": 1, + "src/ghidra/GhidraCheckpoint.ts": 1, + "src/ghidra/GhidraClient.ts": 1, + "src/ida/IdaSessionClient.ts": 1, + "src/javascript/sourceMaps/SourceMapCommand.ts": 1, + "src/kuna/KunaProjectCache.ts": 1, + "src/native/CommandRunner.ts": 1, + "src/native/LldbCallTracer.ts": 1, + "src/pcap/PcapProvider.ts": 3, + "src/pcap/PcapSnapshot.ts": 1, + "src/process/DarwinHelperCache.ts": 1, + "src/process/DarwinProcessRunTokenReader.ts": 1, + "src/process/OwnedDebuggerSessionRegistry.ts": 1, + "src/process/OwnedWorkerRuntime.ts": 4, + "src/providers/AnalysisClientFailure.ts": 1, + "src/server/environment/serveEnvironment.ts": 1, + "src/sqlite/SqliteDatabaseProvider.ts": 2 + }, + "cleanup-dependency-binding": { + "src/android/JadxConfiguration.ts": 1, + "src/android/JadxJavaProbe.ts": 1, + "src/android/JadxProvider.ts": 2, + "src/apktool/ApktoolCommandCleanup.ts": 1, + "src/apktool/ApktoolProvider.ts": 3, + "src/application/AnalysisContextQueries.ts": 1, + "src/application/DirectAnalysisCleanup.ts": 2, + "src/application/Doctor.ts": 1, + "src/application/EvidenceBundleCommands.ts": 1, + "src/application/EvidenceBundleFiles.ts": 1, + "src/application/JsonFiles.ts": 1, + "src/application/McpRegistrationGit.ts": 1, + "src/application/Setup.ts": 2, + "src/application/SetupCleanupOwner.ts": 2, + "src/application/Uninstall.ts": 1, + "src/application/WebNetworkCaptureService.ts": 1, + "src/application/analysisView/AnalysisViewService.ts": 1, + "src/application/binary/AnalysisProviderRegistry.ts": 2, + "src/application/binary/BinarySession.ts": 6, + "src/application/binary/BundleResourceSession.ts": 1, + "src/application/binary/CompositeProvider.ts": 1, + "src/application/binaryDiagnostics/ByteEntropyService.ts": 1, + "src/application/closeOwnedWebResources.ts": 1, + "src/application/decompileDirectory/decompileAll.ts": 1, + "src/application/decompileDirectory/exportResources.ts": 1, + "src/application/decompileDirectory/exportTree.ts": 1, + "src/application/desktop/DesktopApplicationExport.ts": 2, + "src/application/desktop/DesktopApplicationState.ts": 1, + "src/application/desktop/DesktopCaptureFailure.ts": 1, + "src/application/desktop/DesktopRetainedContent.ts": 1, + "src/application/environment/environmentExport.ts": 1, + "src/application/frida/FridaInstrumentationService.ts": 3, + "src/application/il2cpp/Il2cppMetadataService.ts": 1, + "src/application/javascript/JavaScriptArtifactReconstruction.ts": 1, + "src/application/managed/ManagedMemberComparisonService.ts": 1, + "src/application/native/NativeUiActionTrace.ts": 1, + "src/application/process/ProcessCli.ts": 1, + "src/application/releaseExposure/ReleaseExposureService.ts": 1, + "src/application/runOwned.ts": 1, + "src/artifacts/apple/AppleAssetCatalogAnalysis.ts": 2, + "src/artifacts/apple/KeyedArchiveReader.ts": 1, + "src/browser/BrowserScenarioPartialObservation.ts": 1, + "src/browser/CdpBrowserProvider.ts": 1, + "src/browser/CdpElectronProvider.ts": 1, + "src/browser/CdpTargetSessionOwner.ts": 2, + "src/browser/ElectronFileScope.ts": 1, + "src/browser/IsolatedWebBundleAnalyzer.ts": 3, + "src/browser/PlaywrightBrowserScenarioProvider.ts": 3, + "src/browser/PlaywrightElectronActiveActions.ts": 1, + "src/browser/PlaywrightElectronActiveProvider.ts": 1, + "src/browser/PlaywrightScenarioBrowser.ts": 1, + "src/browser/WebBundleAnalysisWorker.ts": 1, + "src/browser/WebSourceMapFetcher.ts": 2, + "src/browser/assets/WebArtifactReads.ts": 1, + "src/browser/history/CaptureFailures.ts": 1, + "src/browser/history/HistoricalCaptureDecoder.ts": 1, + "src/browser/modules/NativeModuleResolver.ts": 1, + "src/cli/desktopCaptureCommands.ts": 1, + "src/cli/environmentCommands.ts": 1, + "src/cutter/CutterBridgeClient.ts": 2, + "src/cutter/CutterBridgeService.ts": 2, + "src/desktop/DesktopBuildSetupHost.ts": 1, + "src/desktop/ScreenJudgeProcess.ts": 1, + "src/domain/explicitSensitiveFailure.ts": 1, + "src/dotnet/ManagedSnapshot.ts": 2, + "src/electron/ElectronFuseFailures.ts": 1, + "src/evm/EvmoleInterfaceProvider.ts": 6, + "src/firmware/FirmwareFailures.ts": 2, + "src/firmware/FirmwareProvider.ts": 3, + "src/firmware/FirmwarePublication.ts": 1, + "src/flutter/FlutterBuildProvider.ts": 2, + "src/frida/FridaInstrumentationManager.ts": 1, + "src/gdb/GdbSessionManager.ts": 3, + "src/ghidra/GhidraFileArtifacts.ts": 1, + "src/ghidra/GhidraJavaProbe.ts": 1, + "src/ghidra/GhidraNativeAotSnapshotOwner.ts": 2, + "src/ghidra/GhidraProviderClient.ts": 3, + "src/ghidra/GhidraSessionError.ts": 1, + "src/hopper/BridgeLauncher.ts": 3, + "src/hopper/HopperAnalysisProfile.ts": 1, + "src/hopper/HopperClient.ts": 1, + "src/hopper/HopperFileOffset.ts": 1, + "src/hopper/HopperImageCopy.ts": 1, + "src/hopper/HopperProvider.ts": 1, + "src/ida/IdaSessionClient.ts": 2, + "src/inspector/V8InspectorProvider.ts": 1, + "src/javascript/analysis/JavaScriptAnalysisWorker.ts": 1, + "src/javascript/sourceMaps/SourceMapCommand.ts": 5, + "src/jeb/JebMcpConnectionOwner.ts": 1, + "src/jeb/JebProvider.ts": 2, + "src/kuna/KunaProjectCache.ts": 2, + "src/kuna/KunaProjectExport.ts": 1, + "src/kuna/KunaProjectReader.ts": 2, + "src/kuna/KunaSessionClient.ts": 1, + "src/kuna/KunaTargetCommands.ts": 2, + "src/native/LldbCallTracer.ts": 6, + "src/native/NativeCommandAnalysisError.ts": 1, + "src/native/NativeMacOSProvider.ts": 5, + "src/native/NativeUiObservation.ts": 1, + "src/native/SignatureTargetBinding.ts": 1, + "src/native/pwndbg/PwndbgCoreContext.ts": 1, + "src/native/pwntools/PwntoolsDecoder.ts": 6, + "src/pcap/PcapProvider.ts": 7, + "src/pcap/PcapSnapshot.ts": 1, + "src/process/ArtifactAnalysisResources.ts": 4, + "src/process/DarwinHelperCache.ts": 1, + "src/process/DarwinProcessRunTokenReader.ts": 3, + "src/process/capture/FilesystemSnapshot.ts": 1, + "src/process/capture/ProcessCaptureError.ts": 3, + "src/process/capture/ProcessCaptureLifecycle.ts": 1, + "src/process/capture/ProcessHarness.ts": 2, + "src/providers/AnalysisClientCreation.ts": 3, + "src/providers/AnalysisClientFailure.ts": 1, + "src/providers/OwnedCommandCleanup.ts": 1, + "src/rizin/RizinDebugSessionManager.ts": 1, + "src/server/registerCloseLifecycleTool.ts": 1, + "src/server/registerResetInvestigationTool.ts": 1, + "src/server/registerSessionStatusTool.ts": 1, + "src/sqlite/SqliteDatabaseProvider.ts": 8, + "src/sqlite/SqliteDatabaseWorkerExecution.ts": 2, + "src/wasm/WabtArtifactProvider.ts": 1 } } diff --git a/scripts/verify/architecture-guards.mjs b/scripts/verify/architecture-guards.mjs index caaa0e83ec..bfd8e68df4 100644 --- a/scripts/verify/architecture-guards.mjs +++ b/scripts/verify/architecture-guards.mjs @@ -336,6 +336,24 @@ checkCounted( ["src/domain/parseFailure.ts"], ); +// Cleanup completion is recorded by the owning lease and read by errors when +// asked. Pushing it with resolveCleanup() and composing dependency sets with +// bindCleanupDependencies() are being replaced, so neither may spread. +checkCounted( + "resolveCleanup() push outside the error base (release the owning AnalysisCleanupLease instead)", + "cleanup-resolve-push", + files, + /\.resolveCleanup\(/gu, + ["src/domain/analysisErrorBase.ts"], +); +checkCounted( + "bindCleanupDependencies() composition outside the error base (compose through runOwned or copy lease claims)", + "cleanup-dependency-binding", + files, + /\.bindCleanupDependencies\(/gu, + ["src/domain/analysisErrorBase.ts"], +); + if (baselinesShrunk) { const sorted = Object.fromEntries( Object.entries(baselines).map(([key, counts]) => [ diff --git a/src/artifacts/AnalysisCleanupLease.test.ts b/src/artifacts/AnalysisCleanupLease.test.ts index 5c82c19c06..6bf04f690b 100644 --- a/src/artifacts/AnalysisCleanupLease.test.ts +++ b/src/artifacts/AnalysisCleanupLease.test.ts @@ -1,4 +1,4 @@ -import { expect, it } from "vitest"; +import { expect, it, vi } from "vitest"; import { ProviderCleanupError } from "../domain/providerCleanupError.js"; import { @@ -70,6 +70,25 @@ it("resolves an aggregate only after every bound owner releases", async () => { expect(error.cleanupIncomplete).toBe(false); }); +it("lets errors read a group's release instead of having it pushed to them", async () => { + const error = new ProviderCleanupError("fixture", ["owned resource"], {}); + const resolveCleanup = vi.spyOn(error, "resolveCleanup"); + const lease = new AnalysisCleanupLease( + async () => undefined, + ["owned resource"], + ); + const group = new AnalysisCleanupLeaseGroup(error, [lease]); + expect(group.cleanupReleased).toBe(false); + await lease.release(); + expect(group.cleanupReleased).toBe(true); + expect(resolveCleanup).not.toHaveBeenCalled(); + // A dependency bound after the release, before any read, cannot reopen it. + error.bindCleanupDependencies([ + new ProviderCleanupError("fixture", ["later"], {}), + ]); + expect(error.cleanupIncomplete).toBe(false); +}); + it("deduplicates owners and accounts for owners already released at binding time", async () => { const error = new ProviderCleanupError("fixture", ["owned resource"], {}); const alreadyReleased = new AnalysisCleanupLease(async () => undefined); diff --git a/src/artifacts/AnalysisCleanupLease.ts b/src/artifacts/AnalysisCleanupLease.ts index df79a6c85f..88d9ee1e4a 100644 --- a/src/artifacts/AnalysisCleanupLease.ts +++ b/src/artifacts/AnalysisCleanupLease.ts @@ -1,5 +1,6 @@ import type { AnalysisError, + AnalysisCleanupReleaseClaim, AnalysisCleanupResourceOwner, } from "../domain/analysisErrorBase.js"; @@ -92,8 +93,11 @@ export class AnalysisCleanupLease { } } -/** Conjunctive cleanup binding for an error covering multiple exact owners. */ -export class AnalysisCleanupLeaseGroup { +/** + * Conjunctive cleanup binding for an error covering multiple exact owners. + * The error reads `cleanupReleased` when asked; release is never pushed to it. + */ +export class AnalysisCleanupLeaseGroup implements AnalysisCleanupReleaseClaim { readonly #error: WeakRef; readonly #pending: Set; @@ -105,6 +109,7 @@ export class AnalysisCleanupLeaseGroup { this.#error = new WeakRef(error); this.#pending = new Set(owners); if (this.#pending.size === 0) return; + error.bindCleanupReleaseClaim(this); if (options.preserveResourceAttribution === true) error.bindCleanupCompletionOwner(this); else error.bindCleanupResourceOwner(this); @@ -128,9 +133,12 @@ export class AnalysisCleanupLeaseGroup { return this.#error.deref() !== undefined; } + /** Every owner in the set confirmed release. */ + get cleanupReleased(): boolean { + return this.#pending.size === 0; + } + ownerReleased(owner: AnalysisCleanupLease): void { - if (!this.#pending.delete(owner) || this.#pending.size > 0) return; - this.#error.deref()?.resolveCleanup(); - this.#pending.clear(); + this.#pending.delete(owner); } } diff --git a/src/domain/analysisErrorBase.ts b/src/domain/analysisErrorBase.ts index 933ce136fd..22fb064d9b 100644 --- a/src/domain/analysisErrorBase.ts +++ b/src/domain/analysisErrorBase.ts @@ -121,6 +121,11 @@ export interface AnalysisCleanupResourceOwner { readonly cleanupResources: readonly string[] | undefined; } +/** A lease-backed claim whose owner records the confirmed release. */ +export interface AnalysisCleanupReleaseClaim { + readonly cleanupReleased: boolean; +} + /** Result completed before its source Evidence could be published. */ export type SourcePublicationCompletion = | { @@ -172,7 +177,6 @@ export abstract class AnalysisError extends Error { #cleanupResourceProjection: | { readonly cleanupResources: readonly string[] } | undefined; - #cleanupDependents: WeakRef[] = []; readonly diagnostics: Readonly> | undefined; readonly continuingCallerGuidance: | Readonly @@ -185,10 +189,15 @@ export abstract class AnalysisError extends Error { return this.#capturedOutput; } readonly cleanup: AnalysisCleanupObservation | undefined; - cleanupIncomplete: boolean; + /** + * This error's own unresolved cleanup. With bound dependencies, completion + * is read from them when asked instead of being pushed to each dependent. + */ + #cleanupIncomplete: boolean; #ownedCleanupResources: readonly string[]; #cleanupResourceOwner: AnalysisCleanupResourceOwner | undefined; #cleanupCompletionOwner: AnalysisCleanupResourceOwner | undefined; + readonly #cleanupReleaseClaims: AnalysisCleanupReleaseClaim[] = []; #cleanupRetry: AnalysisCleanupRetry | undefined; #secondaryFailures: AnalysisError[] = []; constructor(message: string, options?: AnalysisErrorOptions) { @@ -212,7 +221,7 @@ export abstract class AnalysisError extends Error { ? undefined : { ...options.capturedOutput }; this.cleanup = options?.cleanup; - this.cleanupIncomplete = options?.cleanup !== undefined; + this.#cleanupIncomplete = options?.cleanup !== undefined; this.#ownedCleanupResources = [...(options?.cleanup?.resources ?? [])]; this.partialObservation = options?.partialObservation; } @@ -237,6 +246,38 @@ export abstract class AnalysisError extends Error { get cleanupPrimary(): AnalysisError | undefined { return this.#cleanupPrimary; } + + /** + * Whether owned resources remain unreleased, read from the owners when + * asked. Bound dependencies decide it once bound; otherwise a released + * lease claim completes it. Completion is monotonic, so a later binding + * cannot reopen it. + */ + get cleanupIncomplete(): boolean { + if (!this.#cleanupIncomplete) return false; + const dependencies = this.#cleanupDependencies; + if (dependencies === undefined) { + if (!this.#cleanupReleaseClaims.some((claim) => claim.cleanupReleased)) + return true; + } else + for (const dependency of dependencies) + if (dependency.cleanupIncomplete) return true; + this.#cleanupIncomplete = false; + dependencies?.clear(); + this.#cleanupReleaseClaims.length = 0; + return false; + } + + /** Read completion from a lease owner instead of having it pushed here. */ + bindCleanupReleaseClaim(claim: AnalysisCleanupReleaseClaim): this { + this.#cleanupReleaseClaims.push(claim); + return this; + } + + /** A subclass whose own resources are unreleased when it is constructed. */ + protected markCleanupIncomplete(incomplete: boolean): void { + this.#cleanupIncomplete = incomplete; + } /** Later typed failures retained without changing the primary error cause. */ get secondaryFailures(): readonly AnalysisError[] { return [...this.#secondaryFailures]; @@ -352,24 +393,22 @@ export abstract class AnalysisError extends Error { dependencies: readonly AnalysisError[], resourceProjection?: { readonly cleanupResources: readonly string[] }, ): this { + // Settle the dependencies already bound before adding more: completion is + // monotonic, so a dependency bound after they released cannot reopen it. + if (!this.cleanupIncomplete) this.#cleanupDependencies?.clear(); const pending = (this.#cleanupDependencies ??= new Set()); if (resourceProjection !== undefined) this.#cleanupResourceProjection = resourceProjection; - for (const dependency of dependencies) { - if (!dependency.cleanupIncomplete || pending.has(dependency)) continue; - pending.add(dependency); - dependency.#cleanupDependents = [ - ...dependency.#cleanupDependents.filter( - (reference) => reference.deref() !== undefined, - ), - new WeakRef(this), - ]; - } + for (const dependency of dependencies) + if (dependency.cleanupIncomplete) pending.add(dependency); if (pending.size === 0) this.resolveCleanup(); return this; } - /** Clear live cleanup status only after its owning resource confirms retry success. */ + /** + * Clear live cleanup status only after its owning resource confirms retry + * success. Errors composed from this one read the change on their next check. + */ resolveCleanup(): this { if ( [...(this.#cleanupDependencies ?? [])].some( @@ -378,10 +417,7 @@ export abstract class AnalysisError extends Error { ) return this; this.#cleanupDependencies?.clear(); - this.cleanupIncomplete = false; - for (const reference of this.#cleanupDependents) - reference.deref()?.resolveCleanup(); - this.#cleanupDependents = []; + this.#cleanupIncomplete = false; return this; } diff --git a/src/domain/analysisErrorCleanup.test.ts b/src/domain/analysisErrorCleanup.test.ts index 470ec568c4..9e86f68226 100644 --- a/src/domain/analysisErrorCleanup.test.ts +++ b/src/domain/analysisErrorCleanup.test.ts @@ -95,6 +95,45 @@ it("keeps dependency-owned resources empty after the final owner releases", () = ); }); +it("reads completion through nested compositions from the releasing owner only", () => { + const owner = new ProviderCleanupError("fixture", ["owned-worker"], {}); + const inner = new ProviderCleanupError( + "fixture", + ["owned-worker"], + {}, + ).bindCleanupDependencies([owner]); + const outer = new ProviderCleanupError( + "fixture", + ["owned-worker"], + {}, + ).bindCleanupDependencies([inner]); + // Cleanup state is not writable state of an error value. + expect(Reflect.set(outer, "cleanupIncomplete", false)).toBe(false); + expect(outer.cleanupIncomplete).toBe(true); + owner.resolveCleanup(); + expect(outer.cleanupIncomplete).toBe(false); + expect(inner.cleanupIncomplete).toBe(false); + // Completion is monotonic: a later binding cannot reopen it. + outer.bindCleanupDependencies([ + new ProviderCleanupError("fixture", ["later"], {}), + ]); + expect(outer.cleanupIncomplete).toBe(false); +}); + +it("keeps completion when a dependency is bound after release without an intermediate read", () => { + const owner = new ProviderCleanupError("fixture", ["owned-worker"], {}); + const outer = new ProviderCleanupError( + "fixture", + ["owned-worker"], + {}, + ).bindCleanupDependencies([owner]); + owner.resolveCleanup(); + outer.bindCleanupDependencies([ + new ProviderCleanupError("fixture", ["later"], {}), + ]); + expect(outer.cleanupIncomplete).toBe(false); +}); + it("keeps primary diagnostics separate from historical cleanup diagnostics with the same keys", () => { const primary = new AnalysisInputError("inspect", { diagnostics: { diff --git a/src/domain/browserObservationError.ts b/src/domain/browserObservationError.ts index b6f76c26af..720a84a5b8 100644 --- a/src/domain/browserObservationError.ts +++ b/src/domain/browserObservationError.ts @@ -26,7 +26,6 @@ export const browserCleanupObservation = ( /** A bounded passive browser observation failed at its CDP boundary. */ export class BrowserObservationError extends AnalysisError { readonly _tag = "BrowserObservationError"; - override cleanupIncomplete: boolean; override readonly userCategory: "cancelled" | undefined; override readonly userMessage: string | undefined; /** Producer-supplied explanation; undefined selects the operation default. */ @@ -46,8 +45,9 @@ export class BrowserObservationError extends AnalysisError { this.userMessage = options?.detail ?? observationFailureMessage(operation, reason); this.remediationAction = options?.remediationAction; - this.cleanupIncomplete = - this.cleanup !== undefined || reason === "cleanup_failed"; + this.markCleanupIncomplete( + this.cleanup !== undefined || reason === "cleanup_failed", + ); this.setCleanupResources( this.cleanup?.resources ?? (reason === "cleanup_failed" ? ["browser_transport"] : []), diff --git a/src/domain/providerCleanupError.ts b/src/domain/providerCleanupError.ts index 1b2200a019..36ca5fadab 100644 --- a/src/domain/providerCleanupError.ts +++ b/src/domain/providerCleanupError.ts @@ -7,7 +7,6 @@ import type { /** Provider resources could not be proven closed after bounded cleanup. */ export class ProviderCleanupError extends ProviderAdapterError { - override cleanupIncomplete = true; override readonly userMessage = "Provider cleanup could not be fully confirmed. Review the reported local resources before opening another target."; @@ -35,6 +34,7 @@ export class ProviderCleanupError extends ProviderAdapterError { diagnostics, }); this.completedObservation = completedObservation; + this.markCleanupIncomplete(true); this.setCleanupResources(resources); } } diff --git a/src/domain/webScriptExportError.ts b/src/domain/webScriptExportError.ts index dc970b9b23..3e9f20a1d7 100644 --- a/src/domain/webScriptExportError.ts +++ b/src/domain/webScriptExportError.ts @@ -4,7 +4,6 @@ import type { AnalysisErrorOptions } from "./analysisErrorBase.js"; /** Publication failure retaining its input/output target and cleanup state. */ export class WebScriptExportError extends ArtifactOperationError { override readonly userMessage: string; - override cleanupIncomplete: boolean; constructor( reason: ArtifactOperationError["reason"], @@ -22,7 +21,8 @@ export class WebScriptExportError extends ArtifactOperationError { ...(options.residualPaths ?? []), ]), ]); - this.cleanupIncomplete = - options.cleanup !== undefined || (options.residualPaths?.length ?? 0) > 0; + this.markCleanupIncomplete( + options.cleanup !== undefined || (options.residualPaths?.length ?? 0) > 0, + ); } } diff --git a/src/process/capture/ProcessCaptureError.ts b/src/process/capture/ProcessCaptureError.ts index 23769413f7..bb15bc4505 100644 --- a/src/process/capture/ProcessCaptureError.ts +++ b/src/process/capture/ProcessCaptureError.ts @@ -62,7 +62,7 @@ export class ProcessCaptureError extends AnalysisError { this.reason = options?.reason ?? (options?.userCategory === "cancelled" ? "cancelled" : "capture_failed"); - this.cleanupIncomplete ||= this.reason === "cleanup_incomplete"; + if (this.reason === "cleanup_incomplete") this.markCleanupIncomplete(true); this.executionFailure = options?.executionFailure ?? message; this.partialObservation = options?.partialObservation; this.cleanupReport = options?.cleanupReport;