Skip to content

Treat nonzero child JSON as failed stages - #6

Merged
EauDoon merged 1 commit into
mainfrom
devloop/cycle-01-nonzero-stage-json
Aug 29, 2026
Merged

Treat nonzero child JSON as failed stages#6
EauDoon merged 1 commit into
mainfrom
devloop/cycle-01-nonzero-stage-json

Conversation

@EauDoon

@EauDoon EauDoon commented Aug 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • parse decide and prove stdout with the existing logged-JSON helper on nonzero exits
  • record structured {ok:false} proof payloads as a failed stage (and keep the artifact) instead of an opaque child-process error
  • fail closed if a nonzero prove payload claims ok: true
  • still throw when a nonzero child produces no JSON

MandateBound writes {ok:false, error} to stdout and exits nonzero on CLI errors. That used to skip artifact capture and mark prove as error.

Tests

  • npm test (26/26)
  • node --check on orchestrator, GUI, and bootstrap
  • npm run gui:smoke

Devin Review

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.
@EauDoon
EauDoon merged commit 8be48b1 into main Aug 29, 2026
4 of 5 checks passed
@EauDoon
EauDoon deleted the devloop/cycle-01-nonzero-stage-json branch August 29, 2026 19:27

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Devin Review

Comment thread bin/aas.mjs
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 };

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.
Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant