fix: local_trainer path matching + type annotation detection#80
Open
fix: local_trainer path matching + type annotation detection#80
Conversation
The train() method's test-file filter used `"test" in str(filepath)`, which matched pytest temp directory paths and silently skipped all fixture files. Changed to `"test" in filepath.name` to check only the filename. Added type annotation detection in _extract_idiom_patterns — the PatternType.TYPING enum and StyleProfile.type_annotations field existed but were never wired into the extraction pipeline. Full suite: 1,561 collected → 1,544 passed, 18 skipped, 0 failed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The secret-scan workflow was matching mock API key patterns in test fixtures (test_safety_integration.py, bank.py) and CI baselines (allow_secret_baseline.txt, baseline_ruff.txt). These are intentional test data, not leaked credentials. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
From P0 atom prompt-1dd4e88daf85 (2025-08-28 ChatGPT "Swarm of AI"). 15K-char architectural synthesis using modular synth metaphor. Gap analysis shows 7/9 recommendations implemented in this codebase. Co-Authored-By: Claude Opus 4.6 (1M context) <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
train()method used"test" in str(filepath)which matched pytest temp directory paths, silently skipping all fixture files during test runs. Changed to"test" in filepath.name.type_annotationspattern detection in_extract_idiom_patterns— thePatternType.TYPINGenum andStyleProfile.type_annotationsfield existed but extraction was never wired in.plans/2026-04-21-dependency-fix-and-cleanup.mdTest Results
Pre-existing issues observed (not addressed)
hashlib,jsonunused imports (lines 16-17)_extract_naming_patternsis a stub (returns[])get_style_context()calls nonexistentStyleAdapter.get_prompt_context()— will raise AttributeErrormax(cases, key=cases.get)(line 210)Test plan
pytest --co -q— 1,561 collected, 0 errorspytest -q— 1,544 passed, 18 skipped, 0 failedpython3 -c "import pydantic"— no SystemError🤖 Generated with Claude Code