fix: validate remaining child JSON and demo input fields - #10
Merged
Conversation
Cap child stdout before parse, type-check remaining report-facing payload fields, allowlist MandateBound prove scenarios, and reject unsupported --fault values as usage errors.
There was a problem hiding this comment.
Devin Review found 1 potential issue.
1 flag not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
Comment on lines
+425
to
+426
| optionalField(evaluation, "policy_id", ["string"], "decide"); | ||
| optionalField(evaluation, "rule_results", ["array"], "decide"); |
There was a problem hiding this comment.
🟡 Nonzero child JSON bypasses validation
On nonzero child exits, runDecide and runProve return before validating optional fields. Malformed decision metadata enters reports, while malformed proof results enter bundles.
Prompt for agents
In bin/aas.mjs, runDecide and runProve validate optional payload fields only after returning early for a nonzero child status. Reorder payload-shape validation so policy_id/rule_results and result are checked for every successfully parsed child payload, while preserving the existing behavior that nonzero valid JSON produces a failed stage rather than a child-process error.
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.
What
Fail closed on remaining unvalidated demo inputs and child JSON before those values enter the run report.
policy_id/rule_results, actstate/fault/action_id/assurance_mode/bundle_verification, proveresult.all, path-like, and injection-shaped ids before spawn).--faultvalues other thannone|duplicateas a usage error (exit 2), matching help text and the GUI.Boolean gate flags and act
outcomewere already covered.Why
Non-boolean gates and invalid act outcomes already fail closed, but oversized stdout, mistyped copied fields, unknown prove scenarios, and arbitrary
--faultstrings could still leak into reports or reach child CLIs.How tested
npm test(37 passing)node --checkonbin/aas.mjs,bin/aas-gui.mjs, andscripts/bootstrap.mjs