Skip to content

fix(context): anchor entry-point path exclusions on components, not substrings#94

Open
gadievron wants to merge 1 commit into
masterfrom
fix/context-anchor-entry-point-path-exclusions-on-components
Open

fix(context): anchor entry-point path exclusions on components, not substrings#94
gadievron wants to merge 1 commit into
masterfrom
fix/context-anchor-entry-point-path-exclusions-on-components

Conversation

@gadievron
Copy link
Copy Markdown
Collaborator

detect_entry_points() skipped candidate files via any(token in str(path))
against the full absolute path at two sites (Python branch + JS/TS branch).
Short tokens ('test','tests','venv','dist','build') matched as substrings, so:

  • real entry points whose name merely contains a token were skipped
    (protest_api.py, latest/main.py, redistribute.js, buildings/);
  • worse, a token in any ANCESTOR of repo_path (a CI checkout under
    /build/ or /latest/) suppressed EVERY file -> detect_entry_points
    returned '' -> downstream ApplicationType misclassification.

Fix: match on relative-path COMPONENTS via a shared path_excluded() helper
(set-intersection on relative_to(repo_path).parts) plus anchored test-file
detection (test
*.py / *_test.py). Genuine node_modules/venv/dist/build dirs
and real test files stay excluded.

Tests: tests/test_application_context_entry_points_anchored.py (4 cases:
substring-FP python, parent-path-token, substring-FP js, genuine-exclusions
preserved). RED 4 failed -> GREEN 4 passed.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

…ubstrings

detect_entry_points() skipped candidate files via `any(token in str(path))`
against the full absolute path at two sites (Python branch + JS/TS branch).
Short tokens ('test','tests','venv','dist','build') matched as substrings, so:
  - real entry points whose name merely contains a token were skipped
    (protest_api.py, latest/main.py, redistribute.js, buildings/);
  - worse, a token in any ANCESTOR of repo_path (a CI checkout under
    /build/ or /latest/) suppressed EVERY file -> detect_entry_points
    returned '' -> downstream ApplicationType misclassification.

Fix: match on relative-path COMPONENTS via a shared _path_excluded() helper
(set-intersection on `relative_to(repo_path).parts`) plus anchored test-file
detection (test_*.py / *_test.py). Genuine node_modules/venv/dist/build dirs
and real test files stay excluded.

Tests: tests/test_application_context_entry_points_anchored.py (4 cases:
substring-FP python, parent-path-token, substring-FP js, genuine-exclusions
preserved). RED 4 failed -> GREEN 4 passed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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