test(ghidra): check regex recovery at its owning boundary (#8578)

This commit is contained in:
morluto authored and GitHub committed 2026-11-05 17:36:02 +08:00
1 parent ab9f7235a3
commit 2be2d006b8
1 file changed
+5 -6
+5 -6
View File
@@ -10,6 +10,7 @@ import { access, readFile, readdir, stat } from "node:fs/promises";
import { dirname, join } from "node:path";
import { setTimeout as delay } from "node:timers/promises";
import { promisify } from "node:util";
import { GHIDRA_ANNOTATIONS_RETAINED } from "../../dist/ghidra/GhidraProviderClient.js";
import Ajv from "ajv/dist/2020.js";
import addFormats from "ajv-formats";
@@ -547,12 +548,10 @@ export async function verifyGhidraBoundaries(
regexError.remediation.action,
/literal mode or simplify the regex/u,
);
// The retry advice lives in the remediation; the reason states that the
// session survived the overflow.
assert.match(
regexError.details.reason,
/exhausted its stack.*session and annotations remain available/u,
);
// The producer reason describes the failure; continuing-session guidance
// is projected separately and the following live calls verify it.
assert.match(regexError.details.reason, /stack while matching pattern/u);
assert.ok(regexError.message.includes(GHIDRA_ANNOTATIONS_RETAINED));
rejectedCalls++;
const nestedPattern = "(".repeat(12000) + "a" + ")".repeat(12000);
const compileFailure = await client.callTool(