[BUG] prune marks a declared GitHub package orphaned after a casing-only manifest change
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.
Thanks for the detailed, well-sourced reproduction -- pinpointing that apm prune --dry-run compares materialization paths (which preserve source casing) against a lowercase-normalized identity is exactly the kind of root-cause evidence that speeds up review. This looks like a genuine bug: a casing-only change to an already-installed GitHub dependency shouldn't make prune think the package is orphaned. Suggested next step: a responsible maintainer should confirm scope (likely: compare by normalized identity rather than raw materialization path) and record acceptance criteria before implementation begins. Recommendation only, not scope approval -- a maintainer must confirm scope and review contact first.
Generated by Triage Panel · copilot · auto · 96 AIC · ⌖ 5 AIC · ⊞ 12K · ◷
Decision: approve Area: project Scope: Correct host-aware identity matching in prune so a still-declared GitHub package is not treated as an orphan after a casing-only manifest change. Done when: A regression fixture preserves the declared package under casing-equivalent GitHub references; actual orphan cleanup still works; identity comparison retains case-sensitive behavior on hosts where required; affected documentation describes the behavior. Out of scope: Global lowercasing, changing dependency identity on case-sensitive hosts, unrelated prune redesign, or removal of user-managed files. Review contact: @danielmeppiel
Repair an existing dependency-preservation promise before adding product surface.
Recorded by Copilot on behalf of @danielmeppiel following the direct product decisions confirmed on 2026-09-30 and explicit authorization to update the issues on 2026-10-01. Daniel separately confirmed that he is the review contact for accepted scopes. This records a human decision, not an autonomous triage recommendation. It does not promise a release, assign implementation, approve a merge, or bypass review.
I'd like to take this within the approved scope: host-aware prune identity matching, regressions for casing-equivalent GitHub references and genuinely orphaned packages, preservation of case-sensitive host behavior, and directly related documentation. I'll link the approval record in the PR and keep unrelated prune behavior out of scope.
Decision: approve Area: project Scope: Correct host-aware identity matching in prune so a still-declared GitHub package is not treated as an orphan after a casing-only manifest change. Done when: A regression fixture preserves the declared package under casing-equivalent GitHub references; actual orphan cleanup still works; identity comparison retains case-sensitive behavior on hosts where required; affected documentation describes the behavior. Out of scope: Global lowercasing, changing dependency identity on case-sensitive hosts, unrelated prune redesign, or removal of user-managed files. Review contact: @danielmeppiel