actions.check: validate nested shapes with the executor's own validator - #45
Merged
Merged
Conversation
…own validator actions.check looped only over an action's top-level inputs, comparing each immediate type/enum/const. A payload whose defect lived one level down — an array item missing its required field, or carrying a forbidden one — came back ok:true, and the documented check-before- write workflow walked the agent straight into a rejected call. The flattened help metadata could never close the gap: it truncates deep nesting and carries no additional-properties rules. Now the raw typed schema travels into the worker alongside the help data, and check runs the same typebox Check/Errors the host runs before execute — the preflight verdict and the execution verdict come from one validator on one schema and cannot diverge. TypeBox schemas are plain JSON, so they survive the stringify into the worker source; typebox/value is resolved host-side and required by absolute path, exactly like ferrosearch. The familiar missing/unknown/typeErrors buckets are derived from the validator's structured errors (keyword + params, never message parsing) with nested paths spelled members[0].externalId, grouping a failed union into one typeError instead of one per branch. A new errors array carries each raw "<path> <message>" line exactly as a rejected execution would report it; legacy flat schemas keep the existing field loop and gain the empty array for a uniform shape. Five new tests, four seen red against the flat loop — including the parity test proving every check error line appears verbatim in the execution rejection for the same payload.
Michaelliv
added a commit
that referenced
this pull request
Aug 21, 2026
…or (#45) actions.check looped only over an action's top-level inputs, comparing each immediate type/enum/const. A payload whose defect lived one level down — an array item missing its required field, or carrying a forbidden one — came back ok:true, and the documented check-before- write workflow walked the agent straight into a rejected call. The flattened help metadata could never close the gap: it truncates deep nesting and carries no additional-properties rules. Now the raw typed schema travels into the worker alongside the help data, and check runs the same typebox Check/Errors the host runs before execute — the preflight verdict and the execution verdict come from one validator on one schema and cannot diverge. TypeBox schemas are plain JSON, so they survive the stringify into the worker source; typebox/value is resolved host-side and required by absolute path, exactly like ferrosearch. The familiar missing/unknown/typeErrors buckets are derived from the validator's structured errors (keyword + params, never message parsing) with nested paths spelled members[0].externalId, grouping a failed union into one typeError instead of one per branch. A new errors array carries each raw "<path> <message>" line exactly as a rejected execution would report it; legacy flat schemas keep the existing field loop and gain the empty array for a uniform shape. Five new tests, four seen red against the flat loop — including the parity test proving every check error line appears verbatim in the execution rejection for the same payload.
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.
actions.checklooped only over an action's top-level inputs, comparing each immediate type/enum/const. A payload whose defect lived one level down — an array item missing its required field, or carrying a forbidden one — came backok: true, and the documented check-before-write workflow walked the agent straight into a rejected call. The flattened help metadata could never close the gap: it truncates deep nesting and carries no additional-properties rules.Now the raw typed schema travels into the worker alongside the help data, and
checkruns the same typeboxCheck/Errorsthe host runs before execute — the preflight verdict and the execution verdict come from one validator on one schema and cannot diverge. TypeBox schemas are plain JSON, so they survive the stringify into the worker source;typebox/valueis resolved host-side and required by absolute path, exactly like ferrosearch (bun and node ≥22.12).The familiar
missing/unknown/typeErrorsbuckets are derived from the validator's structured errors (keyword + params, never message parsing) with nested paths spelledmembers[0].externalId, grouping a failed union into one typeError instead of one per branch. A newerrorsarray carries each raw<path> <message>line exactly as a rejected execution would report it; legacy flat schemas keep the existing field loop and gain the empty array for a uniform shape.Two deliberate parity-driven semantics changes: stray keys under permissive
additionalPropertiesnow pass check (execute accepts them), andcheck(path, null)fails like execution instead of coercing to{}.Five new tests, four seen red against the flat loop — including a parity test proving every check error line appears verbatim in the execution rejection for the same payload. Full suite 474 pass.