Skip to content

[BUG] apm update without deployment receipts deletes (0.35.0) or refuses to replace (0.35.1+) the files of the package it updates #3625

Closed

Description

Describe the bug

On a machine without APM's per-user deployment receipts (~/.apm), such as a CI runner or a fresh clone, apm update cannot replace the committed, lock-recorded files of a package that moves to a new version:

  • 0.35.0: the update resolves the new tag and rewrites apm.lock.yaml, then prints Cleaned N stale deployed files for <package> and deletes the updated package's files whose content changed between the versions (plus the files of a transitive claude_skill dependency). It exits 0. A following apm install restores the files with the new content.
  • 0.35.1 and main (e49ba47): the update plan is printed, then every changed file is rejected with no trustworthy local deployment baseline. Move the conflicting file aside and retry; use --force only to intentionally overwrite it. It exits 1 and the lockfile stays at the old version. Despite No install transaction changes were committed, a file that is new in the target version is left behind in the working tree.

The files are unmodified: their hashes match deployed_file_hashes in apm.lock.yaml. A cold apm install of the same checkout succeeds on main (#3391 / #3564), so only the update path is affected.

This is the setup recommended for scheduled updates in CI (microsoft/apm-action with update: true), so every scheduled run starts without receipts. With 0.35.0, the generated pull request deletes skills unless apm install runs afterwards. With 0.35.1, the run fails.

To Reproduce

The package is internal, so the commands below show its structure.

Consumer apm.yml:

name: consumer
version: 1.0.0
targets:
  - copilot
  - opencode
dependencies:
  apm:
    - org/skills-package#>=0.1.0
  mcp: []

org/skills-package is an apm_package with .apm/skills/*, .apm/prompts/* and .apm/instructions/*, and a transitive claude_skill dependency (humanlayer/skills/plugins/show-me/skills/show-me#<sha>). apm.lock.yaml (lockfile_version 2, written by 0.35.0) records v0.4.1. v0.5.0 exists upstream and changes 10 files in two skills and adds one file.

git clone <consumer> fresh && cd fresh
HOME=$(mktemp -d) apm update --yes   # empty HOME: no ~/.apm receipts
git status --short

Results

APM exit lockfile working tree
0.35.0 0 v0.5.0 18 files deleted (Cleaned 18 stale deployed files), 1 added
0.35.1 1 v0.4.1 1 untracked file (new in v0.5.0); 12 × no trustworthy local deployment baseline
main e49ba47 1 v0.4.1 1 untracked file (new in v0.5.0); 10 × no trustworthy local deployment baseline

With 0.35.0, running apm install first (to create receipts) and then apm update still deletes the changed files. Only a second apm install after the update produces the expected result.

Excerpt from main:

[i] Update plan for apm.yml

  [~] org/skills-package
      ref: v0.4.1 -> v0.5.0 (f0b3d07 -> 87dc437)
...
  [x] 1 package failed:
    +- org/skills-package -- Skipped
.agents/skills/<skill>/SKILL.md: no trustworthy local deployment
baseline. Move the conflicting file aside and retry; use --force only to
intentionally overwrite it.
...
[x] Installation failed with 16 error(s). No install transaction changes were
committed.

Expected behavior

apm update replaces the unmodified, lock-recorded files of the updated package with the new version's content, exits 0, and leaves no partial changes when it fails. Files whose on-disk content matches deployed_file_hashes should be a trustworthy baseline even without receipts, as #3564 now does for cold restores.

Environment

  • OS: macOS 27.2.1 (arm64), reproduced in GitHub Actions on ubuntu-latest
  • Python: 3.15.2 (pip installs of 0.35.1 and main); 0.35.0 via Homebrew and microsoft/apm-action@v1
  • APM: 0.35.0, 0.35.1, main at e49ba47

Additional context

Related: #3372 / #3490 and #3391 / #3564 fixed the same missing-receipt problem for apm install and cold restores.

Activity

  1. danielmeppiel commented on Nov 12, 2026

    @danielmeppiel
    Collaborator

    Decision: approve
    Area: project
    Scope: Make apm update work without per-user deployment receipts (CI runners, fresh clones, apm-action scheduled updates). Before replacing a package's deployed files, adopt as a trustworthy baseline the committed files that are byte-identical to the materialized source of the currently locked version, following the #3391 cold-restore rule. Then replace them with the new version's content. Update must be all-or-nothing: on failure, no new files, lockfile changes or partial deployments remain.
    Done when: The reported scenario (receipt-less checkout, locked v0.4.1, upstream v0.5.0 that changes and adds files, plus a transitive claude_skill dependency) exits 0. Files are replaced, the new file is added, and the lockfile moves to v0.5.0. Files modified locally still fail closed with the existing guidance. A failed update leaves the working tree and lockfile exactly as before, with no untracked leftovers. Regression tests run against a local git fixture with two tags, cover project scope, and pass on POSIX and Windows. They fail on main without the fix. The CHANGELOG is updated.
    Out of scope: Trusting lockfile hashes alone as a baseline, new flags, changing --force semantics, receipt storage redesign, and changes to apm-action itself.
    Review contact: Daniel Meppiel (@danielmeppiel)

  2. danielmeppiel commented on Nov 12, 2026

    @danielmeppiel
    Collaborator

    Thanks Alex Kucksdorf (@alex-kuck) for the precise, version-by-version report. Accepted as high priority (Daniel Meppiel (@danielmeppiel), 2026-11-12). Scheduled CI updates must work without receipts.

    The fix extends the rule we applied to cold restores in #3391/#3564 to apm update. Files that are byte-identical to the currently locked package source count as a trustworthy baseline even without receipts, so the update replaces them. The update must also leave nothing behind when it fails. Lockfile hashes alone are still not trusted as a baseline. Files you have changed locally keep failing closed. The record above is the exact scope. Delivery is starting now.


    Posted with AI assistance on behalf of Daniel Meppiel (@danielmeppiel).

  3. added
    type/bug
    status/accepted
    priority/high
    area/lockfile
    on Nov 12, 2026
  4. milkshakeuk commented on Nov 12, 2026

    @milkshakeuk

    Dependabot's APM updater (dependabot/dependabot-core#16792) hits this on every update. Each Dependabot run is a fresh clone with no deployment receipts, and every update changes the package source, so apm install after the manifest edit is this cold-upgrade path.

    On main (3948181, which includes #3564), a bump of a package whose deployed skill files are committed still fails closed unless those files are removed first. Removing each committed file that still matches its recorded sha256 before apm install is the workaround #16792 carries. With it, every scenario we tested passes and the result passes a cold apm install --frozen.

    A related point on the error: when one committed file has been edited, APM refuses every file of the package without saying which one was edited. Naming the edited file (or files) would make this much easier to act on. #16792 checks the digests itself first so it can name them.

    The harness and results are in this gist: https://gist.github.com/milkshakeuk/88dd2d4934c6bac1070de0d40741518f

  5. added
    pillar/consume
    on Nov 12, 2026
  6. added a commit that references this issue on Nov 12, 2026
    cca7219
  7. added a commit that references this issue on Nov 13, 2026
    0d6785e
  8. added 6 commits that reference this issue on Dec 1, 2026
    daff2c3
    f503427
    f72cc41
    5247692
    a7e54dc
    3a9fd8b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area/lockfilepillar/consumepriority/highstatus/acceptedtype/bug

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions