fix(providers): preserve bounded artifact reads and cleanup owners

Refs #4373, #4455, #4457, #4458.

Use canonical artifact ownership in Go, Rust, SQLite and PE readers and their failure consumers. Admit PE read budgets before allocation and ignore zero-extent sections in interval ownership. Close Rust resources through CLI and MCP lifecycles.
This commit is contained in:
morluto committed 2026-10-17 00:44:02 +08:00
1 parent 542fa84957
commit effb71f59c
23 files changed
+1068 -231

No files matched your search

+6 -1
View File
@@ -310,6 +310,7 @@ export const createServer = (
const webModuleTrace =
options.webModuleTrace ?? createWebModuleTraceService(environment);
const goBinary = options.goBinary ?? createGoBinaryService();
const rustBinary = options.rustBinary ?? createRustBinaryService();
const peResources = createPeResourcesService();
const webNetworkCapture =
options.webNetworkCapture ?? createWebNetworkCaptureService(environment);
@@ -387,6 +388,7 @@ export const createServer = (
webSourceLocation.close(),
webModuleTrace.close(),
goBinary.close(),
rustBinary.close(),
peResources.close(),
webNetworkCapture.close(),
javascriptRecovery.close?.() ?? Promise.resolve(),
@@ -444,6 +446,7 @@ export const createServer = (
withAdmittedAnalysis: analysisAdmission,
artifactResources,
goBinary,
rustBinary,
peResources,
webNetworkCapture,
};
@@ -642,6 +645,7 @@ const registerConfiguredAnalysisTools = (
recordEvidence,
withAdmittedAnalysis,
goBinary,
rustBinary,
peResources,
webNetworkCapture,
}: ServerToolContext,
@@ -698,7 +702,7 @@ const registerConfiguredAnalysisTools = (
);
registerRustTools(
server,
options.rustBinary ?? createRustBinaryService(),
rustBinary,
toolLogger,
recordEvidence,
withAdmittedAnalysis,
@@ -809,6 +813,7 @@ const createSessionRecorders = (
interface ServerToolContext extends ReturnType<typeof createSessionRecorders> {
readonly goBinary: GoBinaryService;
readonly rustBinary: RustBinaryService;
readonly peResources: PeResourcesService;
readonly webNetworkCapture: WebNetworkCaptureService;
readonly artifactResources: ArtifactResourceScope;