Implementation Plan: T5-P5-A4-WP1 — Result Validation Helper with Fail-Closed Envelope#4144
Merged
Trecek merged 3 commits intoJun 28, 2026
Conversation
…and load_recipe Implements T5-P5-A4-WP1: adds _validate_result helper to server/tools/_types.py that enforces output shape invariants (required keys, non-None, success==True, non-empty content) before serialization. Wires validator into open_kitchen (named- recipe branch only) and load_recipe (unified exit, gated on result.valid). Returns serialized ToolFailureEnvelope on violation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Bump tools_kitchen.py line-limit exemption 1290→1310 for new validator block - Update _LEGACY_JSON_WRITES allowlist with shifted json.dumps line numbers - Fix open_kitchen fail-closed tests: use correct patch targets (autoskillit.server._get_ctx / autoskillit.server.logger), add _apply_triage_gate mock, fix assertions to match recipe_validation path - Fix load_recipe fail-closed tests: use object-form monkeypatch to avoid arch re-export bypass violation, fix _LOAD_CACHE import to _api_cache, add _apply_triage_gate mock so _validate_result is reached Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… tests test_open_kitchen_fail_closed_empty_content and test_open_kitchen_fail_closed_missing_content previously only checked `kitchen == "failed"` without verifying the error key exists or contains meaningful content. Adding assertions on `parsed["error"]` makes the tests more robust against regressions in the failure response schema. Co-Authored-By: Claude Sonnet 4.6 <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
Add a
_validate_resultfunction tosrc/autoskillit/server/tools/_types.pythat enforces output shape invariants on MCP tool result dicts before serialization. The function checks required-key presence, non-None values,success==Truewhen present, and non-emptycontentwhen present. On violation it returns ajson.dumps-serializedToolFailureEnvelope(fail-closed); on pass it returnsNone. Wire this validator intoopen_kitchen(normal named-recipe branch only — deferred-recall branch exempted per acceptance criteria) andload_recipe(unified exit, gated on result validity) with structured logging at each fail-closed site.Closes #4036
Implementation Plan
Plan file:
/home/talon/projects/autoskillit-runs/impl-20260628-093915-207021/.autoskillit/temp/make-plan/t5-p5-a4-wp1-validate-result-helper_plan_2026-06-28_094800.md🤖 Generated with Claude Code via AutoSkillit
Token Usage Summary
* Step used a non-Anthropic provider; caching behavior may differ.
Token Efficiency
Model Usage Breakdown