feat(analysis): make resource budgets recoverable across CLI and MCP (#9706)

* refactor(analysis): centralize resource budgets and recovery facts

* feat(analysis): expose ASAR and Ghidra runtime admission controls

* feat(artifacts): expose reader admission and preserve limited recognition

* feat(javascript): expose recoverable semantic precision budgets

* feat(web): add recoverable source-map budgets and compact retained views

* feat(web): make historical capture decoding budgets recoverable

* fix(desktop): enforce selected view policies across capture and export

* feat(runtime): make Frida and LLDB retention budgets selectable

* feat(native): expose diagnostic budgets and preserve exhaustion causes

* feat(managed): expose recoverable snapshot and representation budgets

* feat(metadata): make Go and Rust inspection budgets recoverable

* feat(wasm): expose representation and producer admissions

* feat(evm): expose per-call worker resource budgets

* feat(android): make resource and string-pool omissions recoverable

* feat(producers): expose command and recorded-capture budgets

* docs(analysis): record recovery contracts and integrated validation

* fix(docs): link calibration oracle from published verification pages

* fix(docs): restore desktop task anchors and receipt links

* test(analysis): align fixtures with selectable budget contracts

* fix(analysis): remove source-location projector dependency cycle

* test(analysis): refresh budget recovery and verifier regressions

* test(analysis): preserve format and publication recovery expectations

* test(windows): align conformance with owned runtime admission

* fix(desktop): preserve selected alias kinds in exported state

* test(analysis): align provider fixtures with recoverable budgets

* test(desktop): validate emitted alias metadata structurally

* fix(ghidra): classify bounded Windows endpoint refusals

* test(cli): assert selectable artifact admission recovery

* fix(cli): preserve capture provenance in environment builds
This commit is contained in:
morluto authored and GitHub committed 2026-11-10 05:11:20 -05:00
1 parent 55b6d2ca20
commit cb4e5cfbff
515 files changed
+21066 -3637

No files matched your search

+38 -9
View File
@@ -1,4 +1,14 @@
import { projectCliAnalysisResult } from "./projectCliAnalysisResult.js";
import {
localSourceMapLimitCliOptions,
sourceMapLimitsFromCli,
} from "./sourceMapLimits.js";
import {
analysisEvidenceDeliveryOptions,
parseCliAnalysisEvidenceDelivery,
deliverCliAnalysisEvidence,
} from "./analysisEvidenceDelivery.js";
import { webSourceLocationDeliverySchema } from "../domain/analysisView/webSourceLocationView.js";
import { projectAnalysisError } from "../domain/analysisErrorProjection.js";
import { z } from "incur";
import { createWebSourceLocationService } from "../composition/webSourceLocations.js";
import { webSourceLocationInputSchema } from "../domain/webSourceLocation.js";
@@ -8,7 +18,6 @@ import type { Logger } from "pino";
import type { CliInstance } from "./types.js";
import { cliDecimalField, cliIntegerArgument } from "./options.js";
import { withCommandCancellation } from "./commandCancellation.js";
import { finishAnalysisCommand } from "./finishAnalysisCommand.js";
const sourceMapSelection = webSourceLocationInputSchema.shape.source_map;
@@ -35,15 +44,29 @@ export const registerWebSourceLocationCommands = (
),
}),
options: z.object({
...localSourceMapLimitCliOptions,
...analysisEvidenceDeliveryOptions,
view: z
.string()
.optional()
.describe(
"JSON source-location matches/source-text view; requires --detail summary and --evidence_output",
),
decodeTimeoutMs: cliDecimalField(
webSourceLocationInputSchema.shape.decode_timeout_ms,
),
}),
run: ({ args, options }) =>
withCommandCancellation((signal) =>
logCliCommand(logger, CLI_COMMANDS.traceWebSourceLocation, () =>
finishAnalysisCommand(
() =>
logCliCommand(logger, CLI_COMMANDS.traceWebSourceLocation, async () => {
const delivery = parseCliAnalysisEvidenceDelivery(
"trace_web_source_location",
options,
webSourceLocationDeliverySchema,
);
if (!delivery.ok) return projectAnalysisError(delivery.error);
return deliverCliAnalysisEvidence({
run: () =>
service.trace(
{
manifest_path: args.manifestPath,
@@ -53,6 +76,7 @@ export const registerWebSourceLocationCommands = (
url: args.sourceMapUrl,
},
generated_position: { line: args.line, column: args.column },
...sourceMapLimitsFromCli(options),
...(options.decodeTimeoutMs === undefined
? {}
: { decode_timeout_ms: options.decodeTimeoutMs }),
@@ -60,11 +84,16 @@ export const registerWebSourceLocationCommands = (
{ signal },
),
service,
"web-source-location",
"trace_web_source_location",
providerId: "web-source-location",
operation: "trace_web_source_location",
signal,
).then(projectCliAnalysisResult),
),
detail: delivery.value.detail,
evidenceOutput: delivery.value.evidenceOutput,
...(delivery.value.view === undefined
? {}
: { view: delivery.value.view }),
});
}),
),
});
};