Skip to content

Microsoft Agent Package Manager: Parent Package Nodes Duplicated #1377

Closed

Description

@rcollette

Microsoft Agent Package Manager (APM) behaves in a similar manner to other package managers, allowing packages to declare dependencies on other packages. Below are the apm.yml files for a parent core language agnostic coding standards package and a dependent language specific package. In some cases a child package will show linkage to the core package. In other cases, the core package is represented as a duplicate node in the graph.

Core package apm.yml file

name: coding-standards-core
version: 1.0.4
description: General code standards and clean code evaluation standards applicable to all languages.

Package with dependency on core apm.yml file

name: coding-standards-csharp
version: 1.1.0
description:
  C# and .NET coding standards including services, repositories, HTTP clients, cross-cutting concerns, and unit testing.
dependencies:
  apm:
    - MyPrivateGithubOrg/apm-internal-marketplace/packages/coding-standards-core

Notably, the first two path segments are the github org and repo and the remaining path portion is the path within the repo.

The directed graph was constructed using GPT 5.4 and root cause analyzed using the same


Root cause: the extractor has no canonical rule for APM package dependencies, so coding-standards-core gets materialized as whatever local node a chunk happened to invent first. That fragments one real dependency target into multiple graph nodes, and some package edges end up pointing at different stand-ins.

In the fresh graph there are already three different core-related nodes:

  • coding-standards-core package from packages/coding-standards-core/apm.yml
  • coding-standards-core from packages/coding-standards-python/apm.yml
  • coding-standards-core dependency from packages/coding-standards-python-fastapi/SKILL.md

The key tell is that some edges point to a node whose ID is anchored to the wrong source file. For example, several Go standards docs reference target ID coding_standards_python_apm_coding_standards_core, which is a node sourced from Python’s apm.yml, not from Go. That means the semantic subagent created one shared “coding-standards-core” concept inside a mixed chunk and anchored it to an arbitrary file in that chunk, then reused that ID for unrelated files.

So the failure is:

  1. Dependencies are being extracted semantically from YAML/docs instead of structurally canonicalized to the actual package node in packages/coding-standards-core/apm.yml.
  2. Node IDs are file-anchored by design ({parent}_{file}_{entity}), which is fine for file-local concepts but wrong for a global package identity.
  3. Cross-file chunk extraction reuses whichever local core node was created first, so one chunk can anchor core to Python, another to FastAPI prose, while another correctly points to the real core package node.

That is why packages that truly depend on the same core package do not all connect through one hub: the graph has multiple semantically equivalent but structurally different targets for “coding-standards-core.”

Activity

  1. safishamsi commented on Jun 19, 2026

    @safishamsi
    Member

    Fixed on v8 in 8e6ba9d.

    Root cause (verified on current code): apm.yml is a .yml document, so it was handled by the LLM semantic path, and there's no package-manifest parser. Each apm.yml was extracted independently and the LLM assigned file-anchored node ids, so the core package got a different id from its own manifest than from each dependent's dependency: reference — and nothing collapsed them (build's id-dedup needs exact-id matches; the #1145 ghost-merge only merges LLM→AST, and there's no AST node for .yml). The "intermittent" behavior was LLM id nondeterminism.

    Fix: a new deterministic manifest_ingest module parses apm.yml (plus pyproject.toml, go.mod, pom.xml) into one canonical package node per package, keyed by name (pkg_<name> via the shared ids.make_id recipe), with depends_on edges. Manifests are classified as CODE so they take the deterministic path and the LLM never sees them (no competing file-anchored nodes), and package nodes are exempt from the file-stem prefix remap so the canonical id stays stable across manifests.

    Verified on your example: coding-standards-core referenced by both the C# and Python packages is now a single node (pkg_coding_standards_core) with two depends_on edges pointing at it — no duplicate. External dependencies (not in the corpus) leave a dangling edge that build prunes, rather than fabricating a node. 8 regression tests added; full suite green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions