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

+18 -11
View File
@@ -2,7 +2,7 @@ import { z } from "incur";
import { createRustBinaryService } from "../composition/rust.js";
import { CLI_COMMANDS } from "../cliCommandNames.js";
import { logCliCommand } from "../cliLogging.js";
import { projectAnalysisError } from "../domain/analysisErrorProjection.js";
import { finishAnalysisCommand } from "./finishAnalysisCommand.js";
import type { Logger } from "pino";
import type { CliInstance } from "./types.js";
import { withCommandCancellation } from "./commandCancellation.js";
@@ -13,7 +13,6 @@ export const registerRustCommands = (
cli: CliInstance,
logger: Logger,
): void => {
const service = createRustBinaryService();
cli.command(CLI_COMMANDS.inspectRustBinary, {
description:
"Inspect an embedded cargo-auditable Rust dependency list without target execution",
@@ -21,14 +20,22 @@ export const registerRustCommands = (
path: z.string().describe("Local ELF, PE or thin Mach-O image"),
}),
run: ({ args }) =>
withCommandCancellation((signal) =>
logCliCommand(logger, CLI_COMMANDS.inspectRustBinary, async () => {
const result = await service.inspect(
{ path: absoluteCallerPath(args.path) },
{ signal },
);
return result.ok ? result.value : projectAnalysisError(result.error);
}),
),
withCommandCancellation((signal) => {
const service = createRustBinaryService();
return logCliCommand(logger, CLI_COMMANDS.inspectRustBinary, () =>
finishAnalysisCommand(
() =>
service.inspect(
{ path: absoluteCallerPath(args.path) },
{ signal },
),
service,
"rust-auditable",
"inspect_rust_binary",
undefined,
signal,
),
);
}),
});
};