mirror of
https://github.com/morluto/rea.git
synced 2026-11-15 19:23:24 +00:00
* test(mcp): check advertised schemas against a portable dialect in every profile * fix(mcp): re-emit advertised patterns in a portable regex grammar * fix(mcp): present discover_tools input through the selected profile The hot-cold catalog registered discover_tools directly with the SDK, so the default compact input profile still advertised its canonical schema, including page-size defaults clients apply on their own (#5322). Route every listed input schema, transport discovery included, through one server-owned presentation, and pass the selected presentation to the deferred server, which serves recorded tool schemas but not discovery. * fix(mcp): keep the Evidence union on described borrowed inputs borrowEvidenceInput installed its advertised projection on one schema instance. A call site's .describe() rebuilds the schema from its definition, so match_native_functions advertised left and right as unconstrained values in every input profile. Install the projection in the borrowed parser's constructor so derived schemas keep it, for both borrowed inputs and borrowed arrays. * fix(mcp): validate advertised dialect by selected profile * fix(mcp): preserve schema widening through references * feat(mcp): project compact input schemas into the portable advertised dialect One projection (advertisedDialectProjection.ts) owns the compact input advertisement: one type per node, items on every array, string literals as enums, oneOf widened to anyOf, allOf merged, tuples as element unions, exclusive bounds made inclusive, and every keyword outside the dialect dropped. Each rewrite is exact or widening; server validation is unchanged. The root description and sentences for dropped cross-field constraints move to the tool description, which Codex and Zed keep. The compact baseline falls to nullable values only (29), which the dialect cannot express without narrowing an input. The gateway shape repairs (typeArrayItemUnions, hasGatewayIncompatibleShape), the second dependentRequired-to-prose copy and the strict-gateway test denylist are removed; the dialect checker gates the inline presentation instead. * feat(mcp): omit output schemas from tools/list by default No surveyed model API reads an output schema, MCP client validators repeat REA's own result validation, and complete output schemas were about 92% of the default tools/list. REA_MCP_OUTPUT_SCHEMA_PROFILE now resolves to off through one owner (resolveMcpOutputSchemaProfile); compact and full remain selectable. structuredContent is still delivered, and the deferred server serves both off and full from the recorded catalog with the matching recorded identity. Tests and artifact verifiers that validate results against complete advertised output contracts select full explicitly. * docs: describe omitted output schemas as the default in README translations * fix(mcp): select schemas in verification workflows * fix(mcp): refuse zero-padded repeat bounds and record host-specific path patterns * fix(mcp): keep projected schemas permissive * fix(mcp): keep references valid when presentation widens their targets * fix(mcp): keep a single union branch's closure scoped to its properties * fix(mcp): select complete output schemas in the Electron verifier * fix(mcp): select complete output schemas in standalone verifier probes * fix(mcp): keep an allOf member's tuple tail with its own positions * fix(mcp): relax references into negations and conditionals presentation may remove * refactor(contracts): declare root discriminators as typed schema annotations * test(mcp): select the borrowed Evidence contract from its family * fix(mcp): keep astral literals and dynamic references widening in every mode * fix(mcp): omit astral literals and relax untracked references when presentation widens * fix(mcp): select complete output schemas in every verifier transport * fix(mcp): read reference pointers by schema position, not segment spelling * fix(mcp): protect references into collapsing boolean unions and keep referencing branches out of the collapse * fix(mcp): keep reduced schemas open when their root admits names by pattern * test(mcp): keep the reduced-schema pattern case outside the size-limited block * fix(mcp): omit patterns whose classes name astral characters * fix(mcp): decide union collapse and pointer protection from canonical branches * docs(mcp): document non-u astral matching and pin BMP agreement across V8 modes * fix(mcp): keep prototype-named properties as own properties in the dialect projection * test(mcp): select full output schemas in packet and signal schema checks * test(mcp): expect the advertised base64 schema to omit the unbounded pad-bit probe * fix(mcp): protect references into unevaluated keywords lost evaluation removes * fix(mcp): validate the doctor probe reply against the canonical output contract (#10655) * fix(mcp): validate the doctor probe reply against the canonical output contract * test(mcp): replay doctor probe validation under every output profile * test(mcp): accept typed-branch nullable unions in the advertised dialect (#10649) * test(mcp): select full output schemas in HTTP session workflows * fix(mcp): emit stack-safe classes with non-ASCII members and protect draft-07 reference siblings * fix(mcp): protect references into literal siblings of relaxed draft-07 references * feat(mcp): omit output schemas from tools/list by default (#10646) * feat(mcp): omit output schemas from tools/list by default No surveyed model API reads an output schema, MCP client validators repeat REA's own result validation, and complete output schemas were about 92% of the default tools/list. REA_MCP_OUTPUT_SCHEMA_PROFILE now resolves to off through one owner (resolveMcpOutputSchemaProfile); compact and full remain selectable. structuredContent is still delivered, and the deferred server serves both off and full from the recorded catalog with the matching recorded identity. Tests and artifact verifiers that validate results against complete advertised output contracts select full explicitly. * fix(mcp): select schemas in verification workflows * fix(mcp): select complete output schemas in the Electron verifier * fix(mcp): select complete output schemas in standalone verifier probes * fix(mcp): select complete output schemas in every verifier transport * test(mcp): select full output schemas in packet and signal schema checks * fix(mcp): validate the doctor probe reply against the canonical output contract (#10655) * fix(mcp): validate the doctor probe reply against the canonical output contract * test(mcp): replay doctor probe validation under every output profile * test(mcp): accept typed-branch nullable unions in the advertised dialect (#10649) * test(mcp): select full output schemas in HTTP session workflows * fix(mcp): keep the Evidence union on described borrowed inputs (#10597) * fix(mcp): keep the Evidence union on described borrowed inputs borrowEvidenceInput installed its advertised projection on one schema instance. A call site's .describe() rebuilds the schema from its definition, so match_native_functions advertised left and right as unconstrained values in every input profile. Install the projection in the borrowed parser's constructor so derived schemas keep it, for both borrowed inputs and borrowed arrays. * test(mcp): select the borrowed Evidence contract from its family * docs(mcp): admit baseline growth only for restored contract declarations * fix(mcp): state reduced multi-type properties as typed branches, not type lists The reduced fallback derived a property's types and emitted them as a type list, which Gemini, Moonshot and Ark reject. A property whose canonical schema is anyOf string and number therefore traded a typed union for a rejected construct when the inline projection fell back. Emit one type, or anyOf typed branches, so [T, null] becomes the dialect's nullable union. * feat(mcp)!: retire the full schema profiles and declare complete observations as a typed annotation (#10718) * refactor(mcp): declare complete observations as a typed annotation applied only on the wire * test(mcp): compare complete-observation declarations with their owning text * refactor(schema): couple Zod checks with their JSON Schema constraint keywords (#10725) * refactor(schema): couple Zod checks with their JSON Schema constraint keywords * refactor(schema): declare pattern approximations and object output roots as typed annotations (#10754) * refactor(schema): declare pattern approximations and object output roots as typed annotations * fix(schema): refuse pattern declarations JSON Schema cannot state * test(schema): select guided_workflows from its contract family * feat(mcp)!: retire the full input and output schema profiles (#10841) * feat(mcp)!: retire the full input and output schema profiles The compact input presentation is now the only advertised input schema, and output schemas are either omitted (`off`, the default) or bounded (`compact`). Catalog identity, the build-recorded digests and the recorded startup catalog collapse to those presentations: two digest profiles instead of six, one recorded catalog instead of two, and no input dialect baseline. Tests and verifiers that validated replies against listed full output schemas now validate against the canonical output contract, which REA already enforces server-side; tests that asserted canonical input restrictions read the canonical input schema instead of a full listing. BREAKING CHANGE: `REA_MCP_INPUT_SCHEMA_PROFILE=full` and `REA_MCP_OUTPUT_SCHEMA_PROFILE=full` are refused at startup and by `rea setup` with a configuration error naming the setting. Remove the setting from the client registration (or rerun setup with `REA_MCP_INPUT_SCHEMA_PROFILE=compact` / `REA_MCP_OUTPUT_SCHEMA_PROFILE=compact`). `REA_MCP_INPUT_SCHEMA_PROFILE` still accepts `compact`. Server-side validation is unchanged. * test(mcp): validate replies against canonical output contracts at every listed-schema reader tools/list omits output schemas by default, so fixtures, verifiers and the Android analysis runners that read a listed outputSchema now bind the canonical contract instead. connectLocalToolsMcp and advertisedMcpToolSchemas hand the SDK a definition carrying the canonical output schema, so the SDK client and caller-supplied validators check every successful reply. * test(mcp): resolve Android runners' output contracts from the selected repository The Android efficiency runners imported the canonical output-schema helper from the harness checkout while --repository selects the revision under test. Import it from the selected repository, as the runners already do for the SDK and Ajv. * test(mcp): let Android runners compare revisions before the canonical output helper A selected revision without scripts/lib/canonical-output-schema.mjs could not start the Android runners. Choose the output contracts in one harness helper: the selected revision's canonical contracts when it has them, otherwise its listed schemas under the full output profile it still supports. * fix(scripts): keep caller launch settings when the real Hopper verifier builds its server environment The verifier deleted REA_VERIFY_SERVER_COMMAND and REA_VERIFY_SERVER_ARGS_JSON from process.env itself before reading them, so a caller selecting an installed REA command silently ran the checkout's dist/main.js. Copy the environment, as main does, so only the child's environment changes. * test(mcp): validate whole replies against canonical output contracts wherever a listed definition is held tools/list omits output schemas by default and the full output profile is gone, so tests that handed the SDK a listed definition no longer checked complete replies. Attach the canonical output schema with withCanonicalOutputSchema at every held REA tool definition. Environment-served tools (not REA contracts), and the deferred-runtime and doctor tests that exercise per-profile listings, keep their listed definitions. * test(mcp): record the advertised catalog summary without the retired full profiles Retiring the full input and output profiles leaves only the compact input and compact output listings, so the summary drops the full-profile digests and every pattern only the full listings carried. Regenerated with npm run verify:advertised-schemas -- --update-summary.
379 lines
12 KiB
JavaScript
379 lines
12 KiB
JavaScript
#!/usr/bin/env node
|
|
import assert from "node:assert/strict";
|
|
import { writeFile, readFile, copyFile } from "node:fs/promises";
|
|
import { isAbsolute, join } from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
import { VerifierFixture } from "./lib/verifier-fixture.mjs";
|
|
import {
|
|
assertVerifierCleanupComplete,
|
|
createVerifierRun,
|
|
completeVerifierRun,
|
|
} from "./lib/verifier-run.mjs";
|
|
import { verifyCompleteToolCatalog } from "./lib/verify-package-core.mjs";
|
|
import { connectRecordedCrash } from "./verify/recorded-crash/public.mjs";
|
|
import {
|
|
createRecordedCore,
|
|
fixtureCommand,
|
|
startCoreSentinel,
|
|
} from "./verify/recorded-crash/fixtures.mjs";
|
|
import { verifyCoreInspectionTrace } from "./verify/recorded-crash/trace.mjs";
|
|
import { historicalPidTraceContract } from "./verify/recorded-crash/trace-policy.mjs";
|
|
|
|
const environment = Object.fromEntries(
|
|
Object.entries(process.env).filter(([, value]) => typeof value === "string"),
|
|
);
|
|
environment.REA_PWNDBG_GDB ??= "/usr/bin/gdb";
|
|
for (const key of [
|
|
"REA_PWNTOOLS_PYTHON",
|
|
"REA_PWNDBG_GDB",
|
|
"REA_PWNDBG_GDBINIT",
|
|
"REA_PWNDBG_VENV_PATH",
|
|
"REA_VERIFY_STRACE_COMMAND",
|
|
])
|
|
if (!isAbsolute(environment[key] ?? ""))
|
|
throw new Error(
|
|
`verify:recorded:crash requires absolute ${key}; see docs/guides/native/recorded-crashes.md. No dependencies are installed by this verifier.`,
|
|
);
|
|
if (process.platform !== "linux" || process.arch !== "x64")
|
|
throw new Error("verify:recorded:crash requires Linux x64.");
|
|
const run = createVerifierRun();
|
|
environment.REA_PROCESS_RUN_ID = run.run_id;
|
|
const root = await VerifierFixture.open({ prefix: "rea-core-verifier-" });
|
|
const options = { root: root.path, environment, runId: run.run_id };
|
|
const entrypoint =
|
|
process.argv[2] ?? fileURLToPath(new URL("./rea.mjs", import.meta.url));
|
|
const failures = [];
|
|
const sessions = [];
|
|
let sentinel;
|
|
let verifier;
|
|
let cases = 0;
|
|
let trace;
|
|
let catalogTools;
|
|
try {
|
|
for (const [command, args] of [
|
|
["gcc", ["--version"]],
|
|
[environment.REA_PWNDBG_GDB, ["--version"]],
|
|
[environment.REA_VERIFY_STRACE_COMMAND, ["-V"]],
|
|
]) {
|
|
try {
|
|
await fixtureCommand(command, args, options);
|
|
} catch (cause) {
|
|
throw new Error(
|
|
`verify:recorded:crash prerequisite unavailable: ${command}`,
|
|
{ cause },
|
|
);
|
|
}
|
|
}
|
|
const core = await createRecordedCore(options);
|
|
sentinel = await startCoreSentinel(options);
|
|
sentinel.assertAlive();
|
|
// Valid signed ELF PID, outside this Linux host's assignable PID range.
|
|
const unlistedPid = 2 ** 31 - 1;
|
|
const pidMaximum = Number(await readFile("/proc/sys/kernel/pid_max", "utf8"));
|
|
assert.ok(Number.isSafeInteger(pidMaximum) && pidMaximum < unlistedPid);
|
|
const fixtures = JSON.parse(
|
|
await fixtureCommand(
|
|
environment.REA_PWNTOOLS_PYTHON,
|
|
[
|
|
"-I",
|
|
fileURLToPath(
|
|
new URL("./lib/recorded-core-fixtures.py", import.meta.url),
|
|
),
|
|
core,
|
|
root.path,
|
|
String(sentinel.pid),
|
|
String(unlistedPid),
|
|
],
|
|
options,
|
|
),
|
|
);
|
|
const spaced = join(root.path, "recording with spaces.core");
|
|
await copyFile(core, spaced);
|
|
const basic = await connectRecordedCrash({ entrypoint, environment });
|
|
sessions.push(basic);
|
|
const advertised = (await basic.client.listTools()).tools;
|
|
assert.equal(
|
|
advertised.filter((tool) => tool.name === "inspect_recorded_crash").length,
|
|
1,
|
|
);
|
|
const catalog = await verifyCompleteToolCatalog(basic.client, {
|
|
timeout: 90_000,
|
|
});
|
|
for (const name of [
|
|
"inspect_binary_layout",
|
|
"inspect_recorded_crash",
|
|
"inspect_evm_interface",
|
|
])
|
|
assert.ok(catalog.includes(name));
|
|
catalogTools = catalog.length;
|
|
for (const mode of ["cli", "mcp"]) {
|
|
const report = await basic.inspect(mode, spaced);
|
|
assert.equal(report.threads.length, 2);
|
|
assert.ok(
|
|
report.threads.some((thread) =>
|
|
thread.registers.some(
|
|
(register) =>
|
|
register.name === "rdi" && register.value === "0x1122334455667788",
|
|
),
|
|
),
|
|
);
|
|
assert.ok(
|
|
report.threads.some((thread) =>
|
|
thread.registers.some(
|
|
(register) =>
|
|
register.name === "r12" && register.value === "0xfedcba9876543210",
|
|
),
|
|
),
|
|
);
|
|
assert.ok(
|
|
report.signals.some(
|
|
(signal) =>
|
|
signal.number === 11 &&
|
|
signal.code === 1 &&
|
|
signal.fault_address === "0x123",
|
|
),
|
|
);
|
|
assert.ok(
|
|
report.signals.some(
|
|
(signal) => signal.code === -6 && signal.fault_address === null,
|
|
),
|
|
);
|
|
cases++;
|
|
const enriched = await basic.inspect(mode, spaced, {
|
|
debuggerContext: true,
|
|
});
|
|
assert.deepEqual(enriched.threads, report.threads);
|
|
assert.deepEqual(enriched.notes, report.notes);
|
|
assert.ok(enriched.debugger.pwndbg_version.startsWith("2026.09.15"));
|
|
assert.equal(enriched.debugger.connection, "core");
|
|
assert.equal(enriched.debugger.executable, null);
|
|
assert.ok(enriched.debugger.maps.length > 0);
|
|
assert.ok(
|
|
enriched.debugger.maps.every(
|
|
(map) => map.reported_flags !== 0 || map.permissions === null,
|
|
),
|
|
);
|
|
assert.ok(
|
|
enriched.debugger.maps.every(
|
|
(map) => map.current_file_identity === "unknown",
|
|
),
|
|
);
|
|
assert.ok(
|
|
enriched.debugger.reported_limits.address_space_bytes <= 3 * 1024 ** 3,
|
|
);
|
|
assert.ok(enriched.debugger.reported_limits.cpu_seconds <= 30);
|
|
assert.ok(
|
|
enriched.debugger.reported_limits.file_size_bytes <= 64 * 1024 ** 2,
|
|
);
|
|
assert.ok(enriched.diagnostics.stdout.includes("[core decoder]"));
|
|
assert.equal(enriched.decoder_diagnostics.truncated, false);
|
|
cases++;
|
|
for (const name of [
|
|
"truncated-header",
|
|
"truncated-status",
|
|
"truncated-owner",
|
|
"nonzero-note-tail",
|
|
]) {
|
|
await basic.inspect(mode, fixtures[name], { category: "invalid_input" });
|
|
cases++;
|
|
}
|
|
const opaque = await basic.inspect(mode, fixtures["opaque-owner"]);
|
|
assert.ok(
|
|
opaque.notes.some(
|
|
(note) => Buffer.from(note.owner_bytes_base64, "base64")[0] === 255,
|
|
),
|
|
);
|
|
assert.equal(opaque.threads.length, 1);
|
|
cases++;
|
|
for (const [name, kind] of [
|
|
["gnu-type3", 3],
|
|
["gnu-file-collision", 0x46494c45],
|
|
]) {
|
|
const value = await basic.inspect(mode, fixtures[name]);
|
|
assert.ok(
|
|
value.notes.some(
|
|
(note) =>
|
|
note.owner_display === "GNU" &&
|
|
note.type === kind &&
|
|
note.type_id === kind,
|
|
),
|
|
);
|
|
assert.equal(value.threads.length, 1);
|
|
cases++;
|
|
}
|
|
const noSignals = await basic.inspect(mode, fixtures["unknown-signals"]);
|
|
assert.equal(noSignals.signals.length, 0);
|
|
assert.equal(noSignals.threads.length, 2);
|
|
cases++;
|
|
const noNotes = await basic.inspect(mode, fixtures["missing-notes"]);
|
|
assert.equal(noNotes.notes.length, 0);
|
|
assert.equal(noNotes.threads.length, 0);
|
|
assert.equal(noNotes.note_interpretation_completeness, "unknown");
|
|
cases++;
|
|
for (const [name, architecture, type, typeId] of [
|
|
[
|
|
"aarch64-archext",
|
|
"aarch64-little-endian",
|
|
"PT_AARCH64_ARCHEXT",
|
|
0x70000000,
|
|
],
|
|
[
|
|
"aarch64-unwind",
|
|
"aarch64-little-endian",
|
|
"PT_AARCH64_UNWIND",
|
|
0x70000001,
|
|
],
|
|
["aarch64-mte-opaque", "aarch64-little-endian", 0x70000002],
|
|
["amd64-processor-opaque", "x86_64-little-endian", 0x70000001],
|
|
]) {
|
|
const auxiliary = await basic.inspect(mode, fixtures[name]);
|
|
assert.equal(auxiliary.architecture, architecture);
|
|
assert.equal(auxiliary.segments.length, 1);
|
|
assert.equal(auxiliary.segments[0].type, type);
|
|
if (typeId !== undefined)
|
|
assert.equal(auxiliary.segments[0].type_id, typeId);
|
|
assert.equal(auxiliary.notes.length, 0);
|
|
assert.equal(auxiliary.threads.length, 0);
|
|
assert.equal(auxiliary.note_interpretation_completeness, "unknown");
|
|
assert.equal(auxiliary.live_process_identity, "unknown");
|
|
cases++;
|
|
}
|
|
const negative = await basic.inspect(mode, fixtures["negative-pid"]);
|
|
assert.ok(negative.threads.some((thread) => thread.historical_pid === -2));
|
|
cases++;
|
|
const linux = await basic.inspect(mode, fixtures["linux-osabi"]);
|
|
assert.deepEqual(linux.threads, report.threads);
|
|
assert.deepEqual(linux.signals, report.signals);
|
|
cases++;
|
|
const extended = await basic.inspect(
|
|
mode,
|
|
fixtures["extended-program-count"],
|
|
);
|
|
assert.deepEqual(extended.threads, report.threads);
|
|
assert.deepEqual(extended.signals, report.signals);
|
|
cases++;
|
|
const padded = await basic.inspect(mode, fixtures["zero-note-tail"]);
|
|
assert.equal(padded.threads.length, 2);
|
|
assert.ok(
|
|
padded.note_padding.some((padding) => padding.bytes_base64 === "AAAA"),
|
|
);
|
|
cases++;
|
|
for (const name of [
|
|
"solaris-osabi",
|
|
"freebsd-osabi",
|
|
"unsupported-abi-version",
|
|
]) {
|
|
await basic.inspect(mode, fixtures[name], {
|
|
category: "unsupported_target",
|
|
});
|
|
cases++;
|
|
}
|
|
const collision = await basic.inspect(
|
|
mode,
|
|
fixtures["historical-pid-collision"],
|
|
{ debuggerContext: true },
|
|
);
|
|
assert.ok(
|
|
collision.threads.some(
|
|
(thread) => thread.historical_pid === sentinel.pid,
|
|
),
|
|
);
|
|
sentinel.assertAlive();
|
|
cases++;
|
|
}
|
|
for (const [name, changes] of [
|
|
["missing", { REA_PWNDBG_GDBINIT: join(root.path, "missing-plugin.py") }],
|
|
[
|
|
"wrong-profile",
|
|
{ REA_PWNDBG_GDBINIT: join(root.path, "wrong-profile.py") },
|
|
],
|
|
]) {
|
|
if (name === "wrong-profile") {
|
|
// Source-owned failure injection changes only the in-memory reported version.
|
|
// The selected upstream checkout and its installed files remain unchanged.
|
|
await writeFile(
|
|
changes.REA_PWNDBG_GDBINIT,
|
|
`from pathlib import Path\nentry = ${JSON.stringify(environment.REA_PWNDBG_GDBINIT)}\nexec(compile(Path(entry).read_bytes(), entry, 'exec'), {'__name__': '__main__', '__file__': entry})\nimport pwndbg.lib.version\npwndbg.lib.version.__version__ = '0.0.0-source-owned'\n`,
|
|
);
|
|
}
|
|
const session = await connectRecordedCrash({
|
|
entrypoint,
|
|
environment: { ...environment, ...changes },
|
|
});
|
|
sessions.push(session);
|
|
for (const mode of ["cli", "mcp"]) {
|
|
const error = await session.inspect(mode, core, {
|
|
debuggerContext: true,
|
|
category: "unsupported_provider",
|
|
});
|
|
assert.ok(
|
|
JSON.stringify(error).includes(
|
|
name === "missing" ? "REA_PWNDBG_GDBINIT" : "source-owned",
|
|
),
|
|
);
|
|
cases++;
|
|
}
|
|
}
|
|
const executableCarrier = join(root.path, "executable-as-core");
|
|
const executableBytes = Buffer.from(await readFile(core));
|
|
executableBytes.writeUInt16LE(2, 16);
|
|
await writeFile(executableCarrier, executableBytes);
|
|
for (const mode of ["cli", "mcp"]) {
|
|
const error = await basic.inspect(mode, executableCarrier, {
|
|
category: "unsupported_target",
|
|
});
|
|
assert.ok(JSON.stringify(error).includes("ET_CORE"));
|
|
cases++;
|
|
}
|
|
trace = await verifyCoreInspectionTrace({
|
|
...options,
|
|
entrypoint,
|
|
core: fixtures["historical-pid-collision"],
|
|
sentinel,
|
|
});
|
|
trace.push(
|
|
...(await verifyCoreInspectionTrace({
|
|
...options,
|
|
entrypoint,
|
|
core: fixtures["historical-pid-unlisted"],
|
|
historicalPid: unlistedPid,
|
|
sentinel,
|
|
})),
|
|
);
|
|
cases += trace.length;
|
|
assert.ok((await readFile(core)).length > 0);
|
|
} catch (cause) {
|
|
failures.push(cause);
|
|
} finally {
|
|
// Sessions, the sentinel and any surviving descendant may still use files
|
|
// under the root, so it is released only after all of them are proven gone.
|
|
for (const session of sessions) root.releaseAfter(() => session.close());
|
|
if (sentinel) root.releaseAfter(() => sentinel.close());
|
|
root.releaseAfter(async () => {
|
|
verifier = await completeVerifierRun(run);
|
|
assertVerifierCleanupComplete(verifier.process_lineage);
|
|
});
|
|
try {
|
|
await root.release();
|
|
} catch (cause) {
|
|
failures.push(cause);
|
|
}
|
|
}
|
|
const result = {
|
|
status: failures.length === 0 ? "passed" : "failed",
|
|
public_cases: cases,
|
|
catalog_tools: catalogTools,
|
|
profile:
|
|
"Linux x64; pwntools4.15.0/pyelftools0.33/Unicorn2.1.2; core-only BYO GDB/pwndbg2026.09.15",
|
|
fixture_generation: "owned test program executed",
|
|
inspection_trace: trace,
|
|
historical_pid_access_coverage: historicalPidTraceContract,
|
|
verifier,
|
|
};
|
|
console.log(JSON.stringify(result, null, 2));
|
|
if (failures.length > 0)
|
|
throw new AggregateError(
|
|
failures,
|
|
"Recorded crash verification failed; cleanup failures are retained.",
|
|
);
|