Fix: compilation.exclude does not filter primitive discovery#477
Draft
Fix: compilation.exclude does not filter primitive discovery#477
Conversation
Agent-Logs-Url: https://github.com/microsoft/apm/sessions/6aae940e-6c6a-40f5-9f06-994570e01fa7 Co-authored-by: danielmeppiel <51440732+danielmeppiel@users.noreply.github.com>
Propagate exclude patterns from CompilationConfig to the primitive discovery phase so that .instructions.md files (and other primitives) inside excluded directories are never discovered or compiled. Fixes #464 Agent-Logs-Url: https://github.com/microsoft/apm/sessions/6aae940e-6c6a-40f5-9f06-994570e01fa7 Co-authored-by: danielmeppiel <51440732+danielmeppiel@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix compilation.exclude to filter primitive discovery
Fix: compilation.exclude does not filter primitive discovery
Mar 27, 2026
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.
Description
compilation.excludepatterns were only applied during context optimization (directory scanning/placement), not during primitive discovery. This caused.instructions.mdfiles in excluded directories to leak into compiled output.Files under
docs/were still discovered, parsed, and compiled into AGENTS.md/CLAUDE.md.Changes:
discovery.py: Addedexclude_patternsparameter todiscover_primitives(),discover_primitives_with_dependencies(), andscan_local_primitives()with glob matching helpers (**support, cross-platform path normalization)agents_compiler.py: Passesconfig.excludeto both discovery code pathsType of change
Testing
⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.