Skip to content

Implementation Plan: Introduce CI-enforced Structural Tests for BackendCapabilities Drift and Session-Type Typo Prevention#3946

Merged
Trecek merged 3 commits into
developfrom
t4-p2-a4-wp1-introduce-ci-enforced-structural-tests-that-pre/3921
Jun 8, 2026
Merged

Implementation Plan: Introduce CI-enforced Structural Tests for BackendCapabilities Drift and Session-Type Typo Prevention#3946
Trecek merged 3 commits into
developfrom
t4-p2-a4-wp1-introduce-ci-enforced-structural-tests-that-pre/3921

Conversation

@Trecek

@Trecek Trecek commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Create tests/arch/test_backend_stdlib_boundaries.py with two AST-based structural 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 it equals 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 .py files under hooks/ 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.

Additionally update tests/arch/AGENTS.md to register the new test file (required by test_tests_sub_claude_md_covers_all_py_files completeness 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.md

Closes #3921

🤖 Generated with Claude Code via AutoSkillit

Token Usage Summary

Step Model count uncached output cache_read peak_ctx turns cache_write time
plan* opus[1m] 2 102 25.6k 1.9M 91.8k 69 115.2k 15m 9s
verify* sonnet 1 60 9.2k 289.8k 55.9k 21 34.2k 4m 13s
implement* MiniMax-M3 1 71.1k 6.8k 1.9M 68.8k 69 0 9m 20s
audit_impl* sonnet 1 335 6.9k 350.3k 48.0k 27 27.1k 3m 34s
prepare_pr* MiniMax-M3 1 45.8k 3.1k 166.8k 47.9k 12 0 1m 18s
compose_pr* MiniMax-M3 1 37.1k 2.0k 149.6k 39.0k 12 0 59s
review_pr* sonnet 2 268 74.3k 1.8M 90.9k 101 133.0k 15m 16s
resolve_review* sonnet 1 325 18.3k 3.0M 98.2k 89 77.4k 8m 5s
Total 155.0k 146.2k 9.6M 98.2k 386.9k 57m 56s

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

Token Efficiency

Step LoC Changed cache_read/LoC cache_write/LoC output/LoC
plan 0
verify 0
implement 216 8588.5 0.0 31.7
audit_impl 0
prepare_pr 0
compose_pr 0
review_pr 0
resolve_review 21 144026.0 3687.9 871.9
Total 237 40301.3 1632.4 616.9

Model Usage Breakdown

Model steps uncached output cache_read cache_write time
opus[1m] 1 102 25.6k 1.9M 115.2k 15m 9s
sonnet 4 988 108.7k 5.4M 271.7k 31m 8s
MiniMax-M3 3 154.0k 11.9k 2.2M 0 11m 37s

Trecek and others added 3 commits June 8, 2026 15:19
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>
@Trecek Trecek added this pull request to the merge queue Jun 8, 2026
Merged via the queue into develop with commit c85bad2 Jun 8, 2026
3 checks passed
@Trecek Trecek deleted the t4-p2-a4-wp1-introduce-ci-enforced-structural-tests-that-pre/3921 branch June 8, 2026 23:03
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