[BUG] prune marks a declared GitHub package orphaned after a casing-only manifest change
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
In APM 0.31.0, changing only the GitHub owner/repository casing in a dependency declaration causes apm prune --dry-run to classify the installed package as orphaned.
To Reproduce
-
With APM 0.31.0, create this manifest and run
apm install:name: prune-fixture version: 1.0.0 targets: - agent-skills dependencies: apm: - microsoft/apm#v0.31.0 mcp: [] -
Confirm that the package is materialized at
apm_modules/microsoft/apm. -
Change only
microsoft/apmtoMicrosoft/APMin the dependency declaration:dependencies: apm: - Microsoft/APM#v0.31.0 -
Run
apm prune --dry-runwithout reinstalling:[>] Analyzing installed packages vs apm.yml... [!] Found 1 orphaned package(s): [!] - microsoft/apm (would be removed) [*] Dry run complete - no changes made
Expected behavior
The existing package is recognized as the declared GitHub dependency. Changing GitHub owner/repository casing does not change package identity or make the package orphaned.
Environment (please complete the following information):
- OS: macOS
- Python Version: 3.14.7
- APM Version: 0.31.0 (Homebrew); also reproduced with current
main - VSCode Version (if relevant): Not applicable
Logs
The complete relevant output is included in the reproduction above.
Additional context
GitHub package identity is normalized to lowercase, while materialization paths preserve source casing. Prune compares expected and scanned materialization paths directly.
This is distinct from #3015: that report concerns a genuine orphan not being detected; this report concerns a declared package being falsely detected as orphaned.
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/commands/prune.py at the expected-versus-scanned materialization path comparison, then read the normalization logic in src/apm_cli/models/dependency/identity.py and path handling in src/apm_cli/models/dependency/materialization.py. Reproduce the casing-only manifest change and verify that apm prune --dry-run recognizes the existing package rather than reporting it as orphaned.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100