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

+94 -2
View File
@@ -7,6 +7,13 @@ import type {
import {
DEFAULT_ASAR_MAX_HEADER_BYTES,
MAXIMUM_ASAR_MAX_HEADER_BYTES,
DEFAULT_ASAR_MAX_LISTING_BYTES,
MAXIMUM_ASAR_MAX_LISTING_BYTES,
DEFAULT_GHIDRA_VALUE_FLOW_MAX_OPERATIONS,
DEFAULT_GHIDRA_VALUE_FLOW_MAX_INPUTS_PER_OPERATION,
DEFAULT_GHIDRA_VALUE_FLOW_MAX_EDGES,
MAXIMUM_GHIDRA_VALUE_FLOW_RECORDS,
MAXIMUM_GHIDRA_DECOMPILE_PAYLOAD_MIB,
DEFAULT_GHIDRA_STARTUP_TIMEOUT_MS,
DEFAULT_HOPPER_STARTUP_TIMEOUT_MS,
MAX_NODE_TIMER_DELAY_MS,
@@ -37,7 +44,7 @@ interface SettingDefinition {
readonly defaultValue: number | null;
readonly minimum: number;
readonly maximum: number;
readonly unit: "bytes" | "ms" | "seconds" | "MiB";
readonly unit: "bytes" | "ms" | "seconds" | "MiB" | "count";
readonly appliesAt: "next_operation" | "next_worker" | "next_startup";
readonly provider: string;
readonly relatedProviders?: readonly string[];
@@ -52,6 +59,88 @@ const timer = {
} as const;
/** Metadata aggregates existing owner definitions; no environment mutation or engine discovery. */
export const ANALYSIS_SETTINGS = {
"ghidra.decompile_max_payload_mib": {
environment: "REA_GHIDRA_DECOMPILE_MAX_PAYLOAD_MIB",
defaultValue: null,
minimum: 1,
maximum: MAXIMUM_GHIDRA_DECOMPILE_PAYLOAD_MIB,
unit: "MiB",
appliesAt: "next_operation",
provider: "ghidra",
operations: [
"procedure_pseudo_code",
"analyze_function",
"inspect_native_api",
"decompile_all",
"trace_native_values",
"trace_native_ui_action",
],
},
"asar.max_listing_bytes": {
environment: "REA_ASAR_MAX_LISTING_BYTES",
defaultValue: DEFAULT_ASAR_MAX_LISTING_BYTES,
minimum: 1,
maximum: MAXIMUM_ASAR_MAX_LISTING_BYTES,
unit: "bytes",
appliesAt: "next_operation",
provider: "rea-artifact-graph",
relatedProviders: [
"rea-javascript-application",
"rea-cdp-electron",
"rea-v8-inspector",
],
operations: [
"open_binary",
"inspect_artifact",
"inventory_artifact",
"extract_artifact",
"analyze_javascript_application",
"inspect_electron_page",
"observe_javascript_runtime",
],
},
"ghidra.value_flow_max_operations": {
environment: "REA_GHIDRA_VALUE_FLOW_MAX_OPERATIONS",
defaultValue: DEFAULT_GHIDRA_VALUE_FLOW_MAX_OPERATIONS,
minimum: 1,
maximum: MAXIMUM_GHIDRA_VALUE_FLOW_RECORDS,
unit: "count",
appliesAt: "next_operation",
provider: "ghidra",
operations: [
"analyze_function",
"inspect_native_api",
"trace_native_values",
],
},
"ghidra.value_flow_max_inputs_per_operation": {
environment: "REA_GHIDRA_VALUE_FLOW_MAX_INPUTS_PER_OPERATION",
defaultValue: DEFAULT_GHIDRA_VALUE_FLOW_MAX_INPUTS_PER_OPERATION,
minimum: 1,
maximum: MAXIMUM_GHIDRA_VALUE_FLOW_RECORDS,
unit: "count",
appliesAt: "next_operation",
provider: "ghidra",
operations: [
"analyze_function",
"inspect_native_api",
"trace_native_values",
],
},
"ghidra.value_flow_max_edges": {
environment: "REA_GHIDRA_VALUE_FLOW_MAX_EDGES",
defaultValue: DEFAULT_GHIDRA_VALUE_FLOW_MAX_EDGES,
minimum: 1,
maximum: MAXIMUM_GHIDRA_VALUE_FLOW_RECORDS,
unit: "count",
appliesAt: "next_operation",
provider: "ghidra",
operations: [
"analyze_function",
"inspect_native_api",
"trace_native_values",
],
},
"asar.max_header_bytes": {
environment: "REA_ASAR_MAX_HEADER_BYTES",
defaultValue: DEFAULT_ASAR_MAX_HEADER_BYTES,
@@ -223,7 +312,10 @@ export const analysisSettingValueSchema = (id: AnalysisSettingId) => {
.int()
.min(definition.minimum)
.max(definition.maximum);
return id === "ghidra.decompile_timeout_seconds" ? number.nullable() : number;
return id === "ghidra.decompile_timeout_seconds" ||
id === "ghidra.decompile_max_payload_mib"
? number.nullable()
: number;
};
/** Project one owner's accepted budget, including the explicit per-call precedence. */
export const analysisSettingLimit = (