Treat nonzero child JSON as failed stages - #6
Merged
Conversation
MandateBound writes {ok:false} to stdout and exits nonzero on CLI
errors. Parsing that payload keeps the proof as a failed stage with
an artifact instead of an opaque child-process error. Decide now uses
the same logged-JSON parser on nonzero exits.
Comment on lines
208
to
+209
| if (result.status !== 0) { | ||
| const payload = (result.stdout || "").trim(); | ||
| if (payload.startsWith("{")) { | ||
| return { ok: false, raw: parseJsonOutput(payload, "decide"), status: result.status }; | ||
| } | ||
| throw childProcessError("decide", result); | ||
| return { ok: false, raw: evaluation, status: result.status }; |
There was a problem hiding this comment.
🟡 Nonzero decision checks report success
When runDecide receives JSON with a nonzero status, it returns a normal policy rejection. The demo exits zero, so automation accepts a failed child process.
Prompt for agents
Nonzero decide results now preserve structured stdout but flow through runDemo's ordinary policy-rejection branch, which deliberately leaves exitCode at zero for valid policy denials. Distinguish a child process's nonzero status from a zero-status policy rejection while retaining the stage artifact. Update bin/aas.mjs so a structured nonzero decide result records the failed stage and bundle but produces a nonzero run/CLI/GUI result. Add an integration test covering runDemo with a real runDecide result whose runner returns parseable stdout and a nonzero status.
Was this helpful? React with 👍 or 👎 to provide feedback.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
{ok:false}proof payloads as a failed stage (and keep the artifact) instead of an opaque child-process errorok: trueMandateBound writes
{ok:false, error}to stdout and exits nonzero on CLI errors. That used to skip artifact capture and mark prove aserror.Tests
npm test(26/26)node --checkon orchestrator, GUI, and bootstrapnpm run gui:smoke