mirror of
https://github.com/morluto/rea.git
synced 2026-10-26 17:35:11 +00:00
Await installation inspection through one shared helper with a real resource scope at all 13 verifier call sites. Retain exact close owners, complete cleanup, and preserve primary plus cleanup failures. Keep compiler-only loading lazy and use the namespace workflow's selected environment. Add admission contract and native-file lifecycle controls, plus a real script prerequisite rejection check. Controlled Java/header observations do not qualify a real Ghidra engine. Combined verification selection: 122 tests passed across five files; static/format/discovery passed; two scoped source reviews clear. Refs #4912
29 lines
1.0 KiB
JavaScript
29 lines
1.0 KiB
JavaScript
import { ArtifactResourceScope } from "../../dist/artifacts/ArtifactResourceScope.js";
|
|
import { AnalysisCleanupLease } from "../../dist/artifacts/AnalysisCleanupLease.js";
|
|
import { inspectGhidraInstallation } from "../../dist/ghidra/GhidraInstallation.js";
|
|
import { closeVerifierResources } from "./verifier-cleanup.mjs";
|
|
|
|
/** Complete one prerequisite inspection and release its exact retained owners. */
|
|
export async function inspectVerifierGhidraInstallation(options, host) {
|
|
const resources = new ArtifactResourceScope();
|
|
const resourceOwner = {
|
|
retain(owner, resource) {
|
|
resources.retain({
|
|
kind: "lease",
|
|
resource,
|
|
lease: AnalysisCleanupLease.forCloseOwner(owner, resource),
|
|
});
|
|
},
|
|
run: (operation) => resources.run(operation),
|
|
};
|
|
let primaryError;
|
|
try {
|
|
return await inspectGhidraInstallation({ ...options, resourceOwner }, host);
|
|
} catch (cause) {
|
|
primaryError = cause;
|
|
throw cause;
|
|
} finally {
|
|
await closeVerifierResources([() => resources.close()], primaryError);
|
|
}
|
|
}
|