Rectify: Recipe Validation Envelope Hides Semantic Errors Behind "unknown structural error"#4065
Merged
Trecek merged 2 commits intoJun 11, 2026
Conversation
…pe (#4060) Fix _recipe_validation_error_response to merge error-severity suggestions from result["suggestions"] into the user-visible message, preventing the "unknown structural error" fallback when valid=False is driven by semantic or contract findings (not structural errors). Changes: - tools_kitchen.py: merge errors + error-severity findings into error_parts; use generic "validation" label when semantic findings are present - tests/contracts/test_validation_error_envelope_coverage.py: contract test asserting both channels are surfaced in the envelope - tests/server/test_tools_kitchen_envelope.py: direct unit test, parametrized invariant, end-to-end open_kitchen test, and malformed-suggestion resilience - tests/contracts/AGENTS.md: register new contract test (REQ-ENVELOPE-001) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…hen.py The prior commit shifted 5 json.dumps call sites by +9 lines. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
_recipe_validation_error_responseinserver/tools/tools_kitchen.py:100-115constructs itsuser_visible_messageanderrorfields exclusively fromresult["errors"](the structural error list). Whenvalid=Falseis driven by ERROR-severity semantic or contract findings — which live inresult["suggestions"], never inresult["errors"]— the envelope falls back to the literal string"unknown structural error", hiding every real error message from the user.The architectural weakness is a split-channel error model with no consumer-side merge:
compute_recipe_validity(registry.py:245-254) derivesvalidfrom three independent sources (errors, semantic findings, contract findings), but the envelope builder reads only one source. The fleet dispatch path (fleet/_api.py:374-388) already handles this correctly by merging both channels — the open_kitchen envelope is the sole consumer that doesn't.Implementation Plan
Plan file:
/home/talon/projects/autoskillit-runs/remediation-20260611-063512-882312/.autoskillit/temp/rectify/rectify_envelope_hides_semantic_errors_2026-06-11_064500.mdCloses #4060
🤖 Generated with Claude Code via AutoSkillit
Token Usage Summary
* Step used a non-Anthropic provider; caching behavior may differ.
Token Efficiency
Model Usage Breakdown