Skip to content

Route scripts/*.py files through manifest in test filter#3388

Merged
Trecek merged 3 commits into
developfrom
add-scripts-py-manifest-entry-to-test-filter/3369
May 31, 2026
Merged

Route scripts/*.py files through manifest in test filter#3388
Trecek merged 3 commits into
developfrom
add-scripts-py-manifest-entry-to-test-filter/3369

Conversation

@Trecek
Copy link
Copy Markdown
Collaborator

@Trecek Trecek commented May 31, 2026

Summary

Modify build_test_scope() in tests/_test_filter.py so that .py files outside src/ and tests/ consult the manifest before returning UNMAPPED_FILE. Add per-script manifest entries to .autoskillit/test-filter-manifest.yaml mapping each scripts/*.py to its verified test consumer directory. Update the manifest orphan detection test to handle Python-file patterns. Update docstrings and comments that incorrectly restrict the manifest to "non-Python" files.

Motivation

The test filter currently routes scripts/*.py files to UNMAPPED_FILE (causing a full run) because they fall through the .py branch without a manifest lookup. Ten scripts/*.py files have verified test consumers in tests/infra/, tests/docs/, tests/arch/, and tests/hooks/, but the manifest only covered .sh files under scripts/. This change routes those Python scripts through the same manifest mechanism, reducing unnecessary full runs.

Requirements

  • REQ-MANIFEST-001: Modify build_test_scope() line 1330–1331 to attempt manifest lookup for non-src/non-test .py files before returning UNMAPPED_FILE
  • REQ-MANIFEST-002: Add per-script manifest entries to .autoskillit/test-filter-manifest.yaml with correct test directory mappings
  • REQ-MANIFEST-003: Add test assertion(s) verifying scripts/*.py manifest routing works
  • REQ-MANIFEST-004: Verify existing scripts/*.sh and scripts/recipe/*.sh entries remain unaffected

Changes

New Files

  • tests/test_test_filter_script_manifest.py — unit tests for scripts/*.py manifest routing

Modified Files

  • .autoskillit/test-filter-manifest.yaml — added 10 scripts/*.py entries with verified test directory mappings
  • src/autoskillit/_test_filter.pybuild_test_scope() now calls apply_manifest() for non-src/non-test .py files; updated docstrings to remove "non-Python" qualifier
  • tests/_test_filter.py — added TestBuildTestScope cases for script manifest routing
  • tests/CLAUDE.md — updated classification description to reflect that "other Python" also uses manifest lookup
  • tests/infra/test_filter_activation.py — added integration test with real manifest
  • tests/infra/test_manifest_completeness.py — added _tracked_files_for_orphan_check() to include scripts/*.py files in orphan detection; updated docstrings

Test Plan

  • Unit tests in tests/test_test_filter_script_manifest.py pass (4 cases: manifest match, no match, None manifest, mixed with src/*.py)
  • Integration test test_build_test_scope_routes_known_script_via_manifest in tests/infra/test_filter_activation.py passes
  • test_manifest_pattern_matches_real_file passes for all 10 new scripts/*.py patterns
  • test_file_covered_by_manifest continues to parametrize over non-Python files only
  • task test-check passes
  • pre-commit run --all-files passes

Closing Issue

Fixes #3369.


Plan: .autoskillit/temp/make-plan/add_scripts_py_manifest_entry_plan_2026-05-30_210500.md

🤖 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] 1 1.4k 17.9k 2.1M 84.7k 173 124.0k 11m 19s
verify* opus 1 40 14.0k 659.1k 71.1k 127 71.3k 9m 11s
implement* opus 1 813.4k 8.9k 889.7k 61.9k 113 76.4k 5m 55s
audit_impl* opus 1 25 12.6k 208.2k 39.3k 92 35.0k 5m 20s
prepare_pr* opus 1 43.0k 3.3k 194.6k 0 19 0 1m 16s
compose_pr* opus 1 44.4k 2.4k 323.5k 19.3k 28 0 1m 36s
review_pr* opus 2 90 46.8k 1.3M 71.0k 76 126.7k 11m 41s
resolve_review* opus 1 40 4.2k 646.1k 56.2k 29 42.4k 3m 8s
Total 902.4k 110.1k 6.3M 84.7k 475.7k 49m 29s

* 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 147 6052.6 519.5 60.4
audit_impl 0
prepare_pr 0
compose_pr 0
review_pr 0
resolve_review 1 646071.0 42352.0 4227.0
Total 148 42354.9 3214.2 743.9

Model Usage Breakdown

Model steps uncached output cache_read cache_write time
opus[1m] 1 1.4k 17.9k 2.1M 124.0k 11m 19s
opus 7 901.0k 92.2k 4.2M 351.7k 38m 10s

Trecek and others added 3 commits May 30, 2026 21:46
Modify build_test_scope() so .py files outside src/ and tests/
consult the manifest before returning UNMAPPED_FILE, mirroring the
existing non-.py branch. Add per-script manifest entries for all
10 scripts/*.py files, mapping each to its verified test consumer.
Add orphan detection function that includes Python files outside
src/ and tests/ (so the 10 new patterns pass the orphan test).
Update docstrings/comments that incorrectly restricted the manifest
to non-Python files. Add 5 tests: 4 unit tests covering manifest
match/no-match/None-manifest/mixed scenarios, and 1 integration
test using the real manifest file.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move 4 script manifest routing tests from test_test_filter.py (1032 lines)
to test_test_filter_script_manifest.py, bringing the main file to 972 lines
and satisfying the test_test_suite_oversized_files_split arch constraint.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The test_scope_mixed_script_and_src_py test claimed to verify both manifest
and cascade contributions but only asserted 'infra' (manifest half). Add
assertion for 'core' (cascade half) so cascade regression is detected.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Trecek Trecek force-pushed the add-scripts-py-manifest-entry-to-test-filter/3369 branch from 6047410 to 229ab7c Compare May 31, 2026 04:46
@Trecek Trecek added this pull request to the merge queue May 31, 2026
Merged via the queue into develop with commit 0a22a92 May 31, 2026
3 checks passed
@Trecek Trecek deleted the add-scripts-py-manifest-entry-to-test-filter/3369 branch May 31, 2026 04:57
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