mirror of
https://github.com/morluto/rea.git
synced 2026-11-15 11:13:21 +00:00
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:
1 parent
55b6d2ca20
commit
cb4e5cfbff
515 files changed
+21066
-3637
No files matched your search
@@ -1,3 +1,7 @@
|
||||
import {
|
||||
resolveJavaScriptSemanticPrecision,
|
||||
type JavaScriptSemanticPrecisionInput,
|
||||
} from "./javascriptSemanticPrecision.js";
|
||||
import { semanticPatternPropertyReadSources } from "./javascriptSemanticIterationSources.js";
|
||||
import {
|
||||
createSemanticOpaqueGlobalObserver,
|
||||
@@ -182,11 +186,12 @@ interface AddBindingInput {
|
||||
/** Recover lexical bindings, aliases, constants, and module links. */
|
||||
export const analyzeJavaScriptSemantics = (
|
||||
source: string,
|
||||
precision?: JavaScriptSemanticPrecisionInput,
|
||||
): JavaScriptSemanticIr => {
|
||||
const file = parseJavaScriptSource(source);
|
||||
return file === null
|
||||
? failedJavaScriptSemanticIr()
|
||||
: analyzeParsedJavaScriptSemantics(file);
|
||||
: analyzeParsedJavaScriptSemantics(file, "import", precision);
|
||||
};
|
||||
|
||||
/** Recover lexical references, optionally for one name, without evaluating values or provenance. */
|
||||
@@ -406,8 +411,9 @@ const semanticPathsOverlap = (
|
||||
/** Share the lexical index with bounded, demand-driven boundary analyses. */
|
||||
export function* indexJavaScriptBindingsSteps(
|
||||
program: t.Program,
|
||||
precision?: JavaScriptSemanticPrecisionInput,
|
||||
): Generator<void, JavaScriptSemanticAnalysisState> {
|
||||
const state = createState(program);
|
||||
const state = createState(program, "import", precision);
|
||||
yield* collectDefinitionsSteps(program, state);
|
||||
yield* indexSemanticAmbientWritesSteps(state);
|
||||
return state;
|
||||
@@ -417,9 +423,15 @@ export function* indexJavaScriptBindingsSteps(
|
||||
export const analyzeParsedJavaScriptSemantics = (
|
||||
file: ParsedJavaScriptSource,
|
||||
staticImportResolutionMode: JavaScriptModuleResolutionMode = "import",
|
||||
precision?: JavaScriptSemanticPrecisionInput,
|
||||
): JavaScriptSemanticIr =>
|
||||
completeSemanticSteps(
|
||||
analyzeParsedJavaScriptSemanticsSteps(file, staticImportResolutionMode),
|
||||
analyzeParsedJavaScriptSemanticsSteps(
|
||||
file,
|
||||
staticImportResolutionMode,
|
||||
undefined,
|
||||
precision,
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
@@ -432,8 +444,13 @@ export function* analyzeParsedJavaScriptSemanticsSteps(
|
||||
file: ParsedJavaScriptSource,
|
||||
staticImportResolutionMode: JavaScriptModuleResolutionMode = "import",
|
||||
expressionNodeBudget?: number,
|
||||
precision?: JavaScriptSemanticPrecisionInput,
|
||||
): Generator<void, JavaScriptSemanticIr> {
|
||||
const state = createState(file.program, staticImportResolutionMode);
|
||||
const state = createState(
|
||||
file.program,
|
||||
staticImportResolutionMode,
|
||||
precision,
|
||||
);
|
||||
yield* collectDefinitionsSteps(file.program, state);
|
||||
yield* indexSemanticAmbientWritesSteps(state);
|
||||
yield* indexSemanticMemberMutationFactsSteps(state);
|
||||
@@ -467,6 +484,7 @@ export function* analyzeParsedJavaScriptSemanticsSteps(
|
||||
...new Set([...state.valueResourceLimits, ...state.getterResourceLimits]),
|
||||
].sort(),
|
||||
[...state.returnedReferenceWidenings].map(range),
|
||||
state.precision,
|
||||
);
|
||||
return {
|
||||
schema: "JavaScriptSemanticIR",
|
||||
@@ -486,14 +504,14 @@ export function* analyzeParsedJavaScriptSemanticsSteps(
|
||||
]
|
||||
: []),
|
||||
...(state.valueResourceLimits.has("alias-selections")
|
||||
? [semanticResourceLimitReason("alias-selections")]
|
||||
? [semanticResourceLimitReason("alias-selections", state.precision)]
|
||||
: []),
|
||||
...(state.returnedReferenceWidenings.size > 0
|
||||
? [RETURNED_REFERENCE_WIDENING_LIMITATION]
|
||||
: []),
|
||||
...[...state.getterResourceLimits]
|
||||
.sort()
|
||||
.map(semanticResourceLimitReason),
|
||||
.map((limit) => semanticResourceLimitReason(limit, state.precision)),
|
||||
...(parserPartial
|
||||
? [
|
||||
"The parser recovered from syntax errors; affected bindings are partial.",
|
||||
@@ -537,8 +555,9 @@ export interface JavaScriptReceiverIndex extends JavaScriptBindingIndex {
|
||||
export function* indexJavaScriptBindingsWithReceiversSteps(
|
||||
program: t.Program,
|
||||
hostContext?: "commonjs-wrapper",
|
||||
precision?: JavaScriptSemanticPrecisionInput,
|
||||
): Generator<void, JavaScriptReceiverIndex> {
|
||||
const state = createState(program);
|
||||
const state = createState(program, "import", precision);
|
||||
if (hostContext === "commonjs-wrapper") {
|
||||
const scope = currentSemanticScope(state.scopes);
|
||||
const binding: JavaScriptSemanticBindingState = {
|
||||
@@ -1154,6 +1173,7 @@ const bindingOrigin = (
|
||||
const createState = (
|
||||
program: t.Program,
|
||||
staticImportResolutionMode: JavaScriptModuleResolutionMode = "import",
|
||||
precision?: JavaScriptSemanticPrecisionInput,
|
||||
): JavaScriptSemanticAnalysisState => {
|
||||
const root: JavaScriptSemanticScopeState = {
|
||||
scopeId: semanticScopeId("program", program),
|
||||
@@ -1164,6 +1184,7 @@ const createState = (
|
||||
bindings: new Map(),
|
||||
};
|
||||
return {
|
||||
precision: resolveJavaScriptSemanticPrecision(precision),
|
||||
arrayIterationUnknown: false,
|
||||
memberMutationFactsComplete: false,
|
||||
program,
|
||||
|
||||
Reference in new issue
Block a user