fix: report malformed application evidence as input errors

This commit is contained in:
morluto
2026-10-10 03:52:35 +08:00
parent 55a46f7c71
commit 218c13160e
15 changed files with 613 additions and 165 deletions
@@ -232,7 +232,9 @@ const analyzeReturn = async (root: string, properties: string) => {
await writeFixtureFiles(root, { "parser.mjs": `${prefix}${expression});\n` });
const analyzed = await analyzeJavaScriptApplication({ input_path: root });
if (!analyzed.ok) throw analyzed.error;
const source = parseApplicationGraphEvidence(analyzed.value);
const parsed = parseApplicationGraphEvidence(analyzed.value);
if (!parsed.ok) throw new Error("Analysis Evidence must parse");
const source = parsed.value;
const observation = source.graph.nodes
.flatMap(({ observations }) => observations)
.find(