merge: consolidate upstream ownership and coverage fixes

This commit is contained in:
morluto committed 2026-10-24 04:43:33 +08:00
commit 7356434202
99 files changed
+8308 -928

No files matched your search

+2
View File
@@ -388,6 +388,7 @@ export class BinarySession
/** External live state cannot be replayed by a direct or composed CLI workflow. */
allowsSnapshotReplay(operation: AnalysisOperation): boolean {
if (operation === "decompile_all") return false;
if (this.#activeBundleResources !== undefined) return false;
const capabilities = this.#active?.route.capabilities;
const descriptor = capabilities?.get(operation);
@@ -1142,6 +1143,7 @@ export class BinarySession
if (!admission.ok) return admission;
return ok(
await operation({
resourceScope: this.resourceScope,
execute: (name, arguments_, options) =>
this.#execute(name, arguments_, options, Promise.resolve()),
}),
@@ -28,6 +28,7 @@ import { err, ok, type Result } from "../../domain/result.js";
import type {
AnalysisExecution,
AnalysisOperation,
RetainedResourceScope,
} from "../AnalysisProvider.js";
import { AnalysisSnapshotCache } from "./AnalysisSnapshotCache.js";
import { InvestigationRecords } from "../investigation/InvestigationRecords.js";
@@ -70,6 +71,16 @@ export abstract class BinarySessionRecords {
readonly #records: InvestigationRecords;
protected readonly fileResources = new ArtifactResourceScope();
readonly resourceScope: RetainedResourceScope = {
retain: (owner, resource) =>
this.fileResources.retain({
kind: "lease",
resource,
lease: { release: () => owner.close() },
}),
run: (operation) => this.fileResources.run(operation),
};
protected get hasPendingFileResources(): boolean {
return this.fileResources.hasPending;
}