Skip to content

Rectify: Recipe Validation Envelope Hides Semantic Errors Behind "unknown structural error"#4065

Merged
Trecek merged 2 commits into
developfrom
recipe-validation-envelope-hides-semantic-errors-behind-unkn/4060
Jun 11, 2026
Merged

Rectify: Recipe Validation Envelope Hides Semantic Errors Behind "unknown structural error"#4065
Trecek merged 2 commits into
developfrom
recipe-validation-envelope-hides-semantic-errors-behind-unkn/4060

Conversation

@Trecek

@Trecek Trecek commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

_recipe_validation_error_response in server/tools/tools_kitchen.py:100-115 constructs its user_visible_message and error fields exclusively from result["errors"] (the structural error list). When valid=False is driven by ERROR-severity semantic or contract findings — which live in result["suggestions"], never in result["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) derives valid from 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.md

Closes #4060

🤖 Generated with Claude Code via AutoSkillit

Token Usage Summary

Step Model count uncached output cache_read peak_ctx turns cache_write time
run_bem* sonnet 1 45.1k 48.1k 677.2k 130.5k 35 112.5k 17m 18s
dispatch:bf3ba4d0-338f-46e2-b744-1cc5af0cb74f* sonnet 1 66 6.1k 324.1k 48.4k 17 29.4k 18m 48s
plan* opus[1m] 2 1.8k 32.0k 2.9M 103.4k 84 163.6k 20m 43s
verify* sonnet 1 799 10.1k 596.8k 55.8k 33 34.9k 5m 15s
implement* MiniMax-M3 1 1.4M 12.1k 532.7k 64.8k 86 0 9m 43s
audit_impl* sonnet 1 190 9.1k 248.7k 45.8k 18 34.9k 4m 50s
prepare_pr* MiniMax-M3 1 110.2k 2.7k 85.0k 44.1k 13 0 1m 39s
compose_pr* MiniMax-M3 1 177.3k 1.7k 0 0 11 0 1m 5s
review_pr* sonnet 1 156 24.6k 948.4k 75.1k 44 98.7k 7m 31s
resolve_review* sonnet 1 133 9.9k 833.6k 66.4k 37 46.2k 5m 37s
dispatch:a43619bc-64d1-412e-9f66-144a95109fd1* sonnet 1 330 10.2k 3.0M 83.5k 86 137.5k 1h 5m
Total 1.8M 166.5k 10.1M 130.5k 657.5k 2h 38m

* Step used a non-Anthropic provider; caching behavior may differ.

Token Efficiency

Step LoC Changed cache_read/LoC cache_write/LoC output/LoC
run_bem 0
dispatch:bf3ba4d0-338f-46e2-b744-1cc5af0cb74f 0
plan 0
verify 0
implement 68 7833.8 0.0 177.4
audit_impl 0
prepare_pr 0
compose_pr 0
review_pr 0
resolve_review 0
dispatch:a43619bc-64d1-412e-9f66-144a95109fd1 0
Total 68 148700.6 9669.3 2448.9

Model Usage Breakdown

Model steps uncached output cache_read cache_write time
sonnet 7 46.8k 118.1k 6.6M 493.9k 2h 4m
opus[1m] 1 1.8k 32.0k 2.9M 163.6k 20m 43s
MiniMax-M3 3 1.7M 16.4k 617.7k 0 12m 28s

Trecek and others added 2 commits June 11, 2026 07:13
…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>
@Trecek Trecek added this pull request to the merge queue Jun 11, 2026
Merged via the queue into develop with commit fc97982 Jun 11, 2026
3 checks passed
@Trecek Trecek deleted the recipe-validation-envelope-hides-semantic-errors-behind-unkn/4060 branch June 11, 2026 14:48
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