test(kuna): preserve caller and producer graph failure context

Align malformed call-graph retry assertions with caller-attributed errors while retaining the parser operation in diagnostics and the cause. Keep all malformed shapes, corrected-response retry, exact native-command count and owned-client cleanup coverage.

Validation: clean main reproduces 3 failed / 14 passed; corrected complete Kuna boundary selection passes 266 tests across 26 files; full check:ci and complete current-head CI passed. Greptile 5/5; human owner reviewed the diff/evidence and explicitly declared readiness. Codex review remains unavailable due repository usage limits. Test-only; no production/schema/authority change or real-engine qualification.

Fixes #4701.
This commit is contained in:
Ysopwnable authored and GitHub committed 2026-10-17 06:47:06 +00:00
1 parent 5927937179
commit 5b24399387
1 file changed
+12 -3
@@ -268,16 +268,25 @@ it.each(["not-json", "miscounted", "with-bodies"] as const)(
async (graph) => {
const { open, kuna } = await session("rea-kuna-bad-graph-", { graph });
const client = open();
const operation = "procedure_callees";
try {
expect(
await client.execute("procedure_callees", { procedure: "main" }),
await client.execute(operation, { procedure: "main" }),
).toMatchObject({
ok: false,
error: { _tag: "AnalysisOutputError", operation: "kuna:call-graph" },
error: {
_tag: "AnalysisOutputError",
operation,
diagnostics: { producer_operation: "kuna:call-graph" },
cause: expect.objectContaining({
_tag: "AnalysisOutputError",
operation: "kuna:call-graph",
}),
},
});
await setFakeKunaBehavior(kuna, { functions: FUNCTIONS });
expect(
(await run(client, "procedure_callees", { procedure: "main" })).result,
(await run(client, operation, { procedure: "main" })).result,
).toEqual(["0x1040"]);
expect(
(await fakeKunaCalls(kuna)).filter(