[BUG] Claude compilation omits CLAUDE.md from three-level dependencies
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.8k
- Forks
- 362
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 132
Description
Describe the bug
apm compile --target claude does not import dependency CLAUDE.md files when the dependency is materialized more than two directory levels below apm_modules.
Azure DevOps dependencies use paths such as apm_modules/<org>/<project>/<repo>, but Claude compilation only checks apm_modules/<owner>/<package>/CLAUDE.md.
To Reproduce
Steps to reproduce the behavior:
- Install an Azure DevOps dependency that contains a root
CLAUDE.md. - Confirm the dependency is materialized at
apm_modules/org/project/repo/CLAUDE.md. - Run
apm compile --target claude. - Inspect the generated root
CLAUDE.md. - Observe that it does not contain
@apm_modules/org/project/repo/CLAUDE.md.
A minimal filesystem probe containing both two-level and three-level dependencies returns only:
['@apm_modules/owner/package/CLAUDE.md']
Expected behavior
The generated root CLAUDE.md should include an import for every installed dependency containing a root CLAUDE.md, including:
@apm_modules/org/project/repo/CLAUDE.md
Environment (please complete the following information):
- OS: Windows
- Python Version: 3.12.13
- APM Version: 0.30.0
Logs
No error is reported. The dependency import is silently omitted from the generated root CLAUDE.md.
Additional context
src/apm_cli/compilation/claude_formatter.py method _collect_dependencies scans exactly two directory levels below apm_modules and checks only <owner>/<package>/CLAUDE.md.
src/apm_cli/models/dependency/materialization.py materializes Azure DevOps dependencies at <org>/<project>/<repo> and supports deeper repository paths for other hosts.
Dependency imports should be derived from installed package roots or lockfile/materialization records instead of assuming exactly two path components.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/apm_cli/compilation/claude_formatter.py at _collect_dependencies and compare its two-level scan with the paths produced by src/apm_cli/models/dependency/materialization.py. Reproduce with two-level and three-level installed dependencies, then run the relevant compilation tests or probe. Done means the generated root CLAUDE.md imports every installed dependency root that contains CLAUDE.md, including @apm_modules/org/project/repo/CLAUDE.md.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system, cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100