feat(workflow-executor): reject unknown condition executionType instead of coercing to Full AI - #1836
Open
Scra3 wants to merge 1 commit into
Open
feat(workflow-executor): reject unknown condition executionType instead of coercing to Full AI#1836Scra3 wants to merge 1 commit into
Scra3 wants to merge 1 commit into
Conversation
…ad of coercing to Full AI An out-of-enum executionType on a condition step was silently coerced to fully-automated by the schema's .catch, handing the decision to the AI — the exact opposite of the upcoming deterministic mode's intent (PRD-472). The schema now rejects unknown values, and every mapper parse failure is wrapped in InvalidStepDefinitionError so the orchestrator reports the run as malformed instead of logging-and-dropping it on every poll. Part of PRD-472 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 new issue
|
|
Coverage Impact This PR will not change total coverage. Modified Files with Diff Coverage (1)
🛟 Help
|
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.

Why
A condition step whose
executionTypeis outside the schema enum was silently coerced tofully-automatedby the schema's.catch— the AI took the decision without any error or log. With the deterministic decision mode coming in PRD-472, an outdated executor receiving'deterministic'would have silently handed the customer's explicitly-not-AI decision to the AI.What
ConditionStepDefinitionSchema.executionType: dropped.catch(FullyAutomated)(kept.defaultfor missing values) — unknown values now reject loudly, matching the trigger-action/load-related/guidance no-.catchprecedent.InvalidStepDefinitionError: a bare ZodError was only logged bygetAvailableRunsand the run silently re-fetched every poll; it is now reported to the orchestrator as a malformed run.'deterministic'), mapper rejection test, and the mcp missing-mcpServerIdassertion tightened to pin the mapTask wrapping.Part of PRD-472.
'deterministic'is intentionally NOT added toStepExecutionMode: rejection is the correct behaviour until the condition evaluator ships.Tests
Full workflow-executor suite: 1514 passed / 0 failed. Red-check: with src changes stashed, exactly the new behavioral tests fail.
🤖 Generated with Claude Code
Note
Reject unknown
executionTypevalues in condition step definitions instead of coercing to FullyAutomated.catch(FullyAutomated)fromConditionStepDefinitionSchemaso that an unrecognizedexecutionTypenow throws an error rather than silently coercing toFullyAutomated. MissingexecutionTypestill defaults toFullyAutomated.parseStepDefinitionhelper in step-definition-mapper.ts that wrapsschema.safeParseand converts Zod failures intoInvalidStepDefinitionErrorwith formatted issue details..parse()calls across all task and condition handlers with the new helper, so validation errors surface asInvalidStepDefinitionErrorinstead of rawZodError.executionTypevalues were silently accepted; they now cause a hard failure.Macroscope summarized 940a009.