fix(process): report denied inspection as typed cleanup failures (#9261)

* fix(process): report denied inspection as typed cleanup failures

Preserve the native ps diagnostic through owned-worker cleanup and finalize one-shot JavaScript analysis before Evidence delivery. Retain mandatory inspection and existing cleanup authority.

Preserve the inspector diagnostic when the initial process-table read succeeds but pre-signal revalidation fails, and remove the unreachable typed-error branch so retained artifact retry failures project through the existing cleanup contract.

* fix(resources): preserve independent close failure ownership

* fix(cli): retain cleanup recovery and nested close evidence

* refactor(providers): classify rejected closes at the shared boundary

* test(cli): preserve bundle metadata and physical inspection failures

* fix(cli): preserve the JavaScript failure envelope after finalization

* test(cli): validate the JavaScript error envelope at its boundary

* fix(providers): preserve unnamed close failure resources

* fix(cli): retain invocation owners through outer cleanup

* test(cli): distinguish reported cleanup failures from uncaught errors

* fix(cli): compose each runtime’s declared cleanup owners

* test(cli): preserve the original cleanup rejection

* test(cli): allow cleanup retry recovery after a reported failure

* fix(cli): report final cleanup after returned results

* fix(cli): preserve launcher executable mode

* test(cli): retain invocation cleanup in file sessions

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
This commit is contained in:
SandivandVincent Koc authored and GitHub committed 2026-11-30 19:38:45 +08:00
1 parent 891a999a12
commit f5055cd2ed
33 files changed
+1501 -111

No files matched your search

+4
View File
@@ -1,6 +1,7 @@
import { HOST_PLATFORM } from "../platform/HostPlatform.js";
import type { FridaInstrumentationPort } from "../ports/frida/FridaInstrumentationPort.js";
import type { CliJavaScriptAnalysisHost } from "./javascriptApplicationAnalysis.js";
import { parseCliGlobalArguments } from "../cliBuiltinArguments.js";
import type { DirectAnalysis } from "../composition/directAnalysis.js";
import { parseLogLevel } from "../config/processStart.js";
@@ -39,6 +40,8 @@ export interface CliShellOptions {
) => DirectAnalysis;
readonly resultOutput?: CliResultOutput | undefined;
readonly fridaInstrumentation?: FridaInstrumentationPort | undefined;
/** Invocation-scoped JavaScript worker owner, when this invocation finalizes it. */
readonly javascriptAnalysis?: CliJavaScriptAnalysisHost | undefined;
}
/** Run each registrar, creating analysis once for those that declare it. */
@@ -91,6 +94,7 @@ export const createCliShell = (options: CliShellOptions): CliInstance => {
environment,
savedDefaults: options.savedDefaults,
fridaInstrumentation: options.fridaInstrumentation,
javascriptAnalysis: options.javascriptAnalysis,
},
options,
);