T5-P5-A13-WP1 Make JSON Contract Card Staleness Detectable#4104
Merged
Trecek merged 3 commits intoJun 13, 2026
Merged
Conversation
Adds tests/arch/test_recipe_contract_freshness.py — parametrized arch test that enforces JSON contract card freshness at CI time. Mirrors the existing diagram staleness enforcement in test_recipe_diagram_freshness.py. Tests: - test_json_card_exists: every .yaml contract must have a .json companion - test_json_card_content_parity: yaml.safe_load == json.loads - test_collection_count_rot_guard: >= 15 stems (silent deletion detector) - test_no_orphan_json_cards: no .json without matching .yaml The basename collision with tests/hooks/test_recipe_contract_freshness.py is benign — different directories, different markers, different purposes. The arch file needs no cascade entry (arch/ is in ALWAYS_RUN_* sets).
Fixes two ruff violations in test_recipe_contract_freshness.py: - F401: `pathlib.Path` imported but unused - TID251: `yaml.safe_load` banned; use `load_yaml()` from autoskillit.core.io Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…MINIMUM_CONTRACT_COUNT Addresses two reviewer warnings: 1. Add test_contracts_dir_exists() to provide direct diagnostic failure when _CONTRACTS_DIR doesn't resolve — clearer than relying solely on the count guard. 2. Add inline comment to MINIMUM_CONTRACT_COUNT explaining it is a shrinkage floor set below current count (17 at creation time). 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
Create
tests/arch/test_recipe_contract_freshness.py— a parametrized architectural test that enforces JSON contract card freshness at CI time. The test discovers all.yamlcontract cards underbuiltin_recipes_dir() / "contracts", verifies each has a matching.jsoncompanion with content parity, guards against collection count rot (>= 15), and detects orphan JSON files. This makes contract card staleness merge-blocking alongside the existing diagram staleness enforcement intest_recipe_diagram_freshness.py.Basename note: A file
tests/hooks/test_recipe_contract_freshness.pyalready exists — it tests the pre-commit hook script (scripts/recipe_contract_freshness.py) and carrieslayer("hooks"). The new arch-layer file tests a different concern (CI-time JSON card parity) and the basename collision is benign: different directories, different markers, different imports, different purpose. The cascade map entry attests/_test_filter.py:741correctly references the hooks file; the arch file needs no cascade entry becausearch/is inALWAYS_RUN_*sets.Closes #4032
Implementation Plan
Plan file:
/home/talon/projects/autoskillit-runs/impl-20260613-005940-568369/.autoskillit/temp/make-plan/t5_p5_a13_wp1_json_contract_card_freshness_plan_2026-06-13_010600.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