diff --git a/bin/aas.mjs b/bin/aas.mjs index b6ddc43..7f80208 100644 --- a/bin/aas.mjs +++ b/bin/aas.mjs @@ -451,6 +451,7 @@ export async function runDemo(args = [], options = {}) { proveStarted = true; const prove = await (options.runProveFn ?? runProve)(scenario, { depsDir: paths.deps, runner: options.runner }); stages.prove = stageRecord(prove.ok ? "passed" : "failed", { raw: prove.raw }); + if (!prove.ok) exitCode = 1; report.stages.prove = { status: stages.prove.status, scenario, diff --git a/test/stack.test.mjs b/test/stack.test.mjs index 25d274f..ebbb419 100644 --- a/test/stack.test.mjs +++ b/test/stack.test.mjs @@ -183,6 +183,17 @@ test("an unresolved act outcome is sent to proof", async () => { assert.equal(result.report.stages.prove.triggered_by, "act_outcome=null"); }); +test("an unsuccessful proof fails the run", async () => { + const outputRoot = tempRoot(); + const result = await runDemo(["--response", "pass", "--dispute"], stubOptions(outputRoot, { + runId: "failed-proof-run", + runProveFn: async () => ({ ok: false, raw: { ok: false, result: {} }, status: 0 }), + })); + assert.equal(result.exitCode, 1); + assert.equal(result.manifest.exit_code, 1); + assert.equal(result.manifest.stages.prove.status, "failed"); +}); + test("child-process errors are visible as safe stage errors and downstream skips", async () => { const outputRoot = tempRoot(); const result = await runDemo(["--response", "pass"], stubOptions(outputRoot, {