Skip to content

[BUG] apm.lock.yaml still non-deterministic when MCP dependencies are present #1532

@marclefrancois

Description

@marclefrancois

Describe the bug

Follow-up to #450 — the generated_at timestamp rewrite was fixed for regular APM dependencies, but the lockfile still changes on every apm install when MCP dependencies are declared in apm.yml. The only diff is the generated_at field, meaning the actual resolved state hasn't changed.

To Reproduce

  1. Add an MCP dependency to apm.yml:
mcp:
    - name: atlassian
      registry: false
      transport: http
      url: https://mcp.atlassian.com/v1/mcp
  1. Run apm install and commit apm.lock.yaml
  2. Run apm install again without changing apm.yml
  3. Run git diff apm.lock.yaml
  -generated_at: '2026-05-28T15:16:00.000000+00:00'
  +generated_at: '2026-05-28T15:18:00.000000+00:00'

Only the timestamp changes — no dependency content is different.

Expected behavior

apm install should be fully idempotent: if neither apm.yml nor any resolved dependency has changed, apm.lock.yaml must not be modified. This should hold regardless of dependency type (APM packages, MCP servers, etc.).

Environment

  • OS: macOS
  • Python Version: 3.12
  • APM Version: 0.8.5

Additional context

The original fix for #450 likely only addressed the APM dependency resolution path. The MCP dependency resolution appears to follow a separate code path that still unconditionally rewrites generated_at. The fix should apply the same determinism logic to MCP nodes.

See my comments on #450:

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/lockfileLockfile schema, per-file provenance, integrity hashes, drift detection.priority/highShips in current or next milestonestatus/acceptedDirection approved, safe to start work.status/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).theme/governanceGoverned by policy. apm-policy, audit, enforcement, enterprise rollout.type/bugSomething does not work as documented.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Todo

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions