microsoft / microsoft/apm

[BUG] incompatible immutable dependency refs are silently collapsed

Open
#3,027 0 comments 0 reactions 0 assignees View on GitHub

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 silently collapses incompatible immutable dependency refs for the same package identity.

A consumer declares both:

  • a direct dependency on shared-package#v1, and
  • parent-package#v1, which transitively requires shared-package#v2.

Both refs are immutable. APM installs and locks only shared-package#v1, emits no conflict warning or error, and accepts the resulting graph in frozen mode. The installed parent therefore receives a different immutable version than its manifest requires.

To Reproduce

  1. Create shared-package tags v1 and v2.
  2. Create parent-package#v1 with a dependency on shared-package#v2.
  3. Create a consumer with direct dependencies on shared-package#v1 and parent-package#v1.
  4. Run a normal install.
  5. Inspect the lockfile and installed packages: only shared-package#v1 is present.
  6. Run the equivalent frozen install. It succeeds without reporting the incompatible transitive requirement.

Expected behavior

Different immutable refs for one package identity should either:

  1. fail resolution with a clear conflict listing the parents and requested refs, or
  2. install isolated versions when the deployment model supports that safely.

Frozen replay should not accept a graph in which an immutable transitive requirement was replaced by a different ref.

Environment (please complete the following information):

  • OS: macOS
  • Python Version: 3.14.7
  • APM Version: 0.31.0 installed with Homebrew
  • VSCode Version (if relevant): Not applicable

Logs

No warning or error is emitted. The lockfile contains only the directly pinned immutable ref.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the dependency graph with shared-package#v1, shared-package#v2, and parent-package#v1, then inspect the lockfile and frozen-install path. Trace how immutable refs are resolved and collapsed for one package identity. Done means the incompatible transitive ref is rejected with a clear conflict or safely isolated, and frozen replay cannot accept the substituted graph.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.