Implementation Plan: Introduce CI-enforced Structural Tests for BackendCapabilities Drift and Session-Type Typo Prevention#3946
Merged
Trecek merged 3 commits intoJun 8, 2026
Conversation
Introduces tests/arch/test_backend_stdlib_boundaries.py with two AST-based guard tests: 1. test_write_guard_fallback_matches_claude_code_capabilities — parses write_guard.py via AST to extract the effective_tool_names fallback frozenset and asserts equality with CLAUDE_CODE_CAPABILITIES.write_guard_tool_names, preventing silent drift between the two parallel registries. 2. test_session_type_hook_strings_match_enum — scans all hook .py files for string literals compared against AUTOSKILLIT_SESSION_TYPE (across three syntactic patterns) and asserts the union is a subset of SessionType enum values, preventing typo-based session-tier bugs. The two-pass scoped visitor (_SessionTypeStringVisitor) avoids false positives by first discovering which variables carry session type values, then only collecting string literals from Compare nodes and frozenset assignments involving those variables. Updates tests/arch/AGENTS.md to register the new test file (required by test_tests_sub_claude_md_covers_all_py_files). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ch partial scanner regressions
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_backend_stdlib_boundaries.pywith two AST-based structural tests:test_write_guard_fallback_matches_claude_code_capabilities— parseswrite_guard.pyvia AST to extract theeffective_tool_namesfallback frozenset and asserts it equalsCLAUDE_CODE_CAPABILITIES.write_guard_tool_names, preventing silent drift between the two parallel registries.test_session_type_hook_strings_match_enum— scans all.pyfiles underhooks/for string literals compared againstAUTOSKILLIT_SESSION_TYPE(across three syntactic patterns) and asserts the union is a subset ofSessionTypeenum values, preventing typo-based session-tier bugs.Additionally update
tests/arch/AGENTS.mdto register the new test file (required bytest_tests_sub_claude_md_covers_all_py_filescompleteness guard).Implementation Plan
Plan file:
/home/talon/projects/autoskillit-runs/impl-20260608-145234-526272/.autoskillit/temp/make-plan/t4_p2_a4_wp1_backend_stdlib_boundaries_plan_2026-06-08_145600.mdCloses #3921
🤖 Generated with Claude Code via AutoSkillit
Token Usage Summary
* Step used a non-Anthropic provider; caching behavior may differ.
Token Efficiency
Model Usage Breakdown