Skip to content

[BUG] On macOS and Windows, apm update after a case-only rename in a package deletes the renamed files and drops them from the lockfile #3684

Closed

Description

Describe the bug

On case-insensitive file systems (macOS default, Windows default), when a package renames primitives only by case (Guide.instructions.md to guide.instructions.md, Helper.agent.md to helper.agent.md), apm update treats the old APM-owned spelling as a user file ("Kept user-edited file .claude/rules/Guide.md"), then stale cleanup deletes the old spelling, which is the same directory entry as the new file. All renamed agents, commands, prompts and instructions disappear from disk and from apm.lock.yaml, and apm audit --ci then fails.

To reproduce

  1. Install a package that ships .apm/instructions/Guide.instructions.md, .apm/agents/Helper.agent.md, .apm/prompts/Run.prompt.md (targets claude, copilot, cursor).
  2. Upstream renames them by case only and changes content.
  3. apm update --yes, then list the target directories and run apm audit --ci.

Expected behavior

The files end up with the new spelling and content, the lockfile records them, and audit is clean.

Actual behavior

Exit 0, "Cleaned 7 stale deployed files"; the new files are gone.

Found by the 0.36.0 pre-release lifecycle sweep, round 2 (#3649). Same behavior on v0.35.1, so this is not a 0.36 regression.

Activity

  1. added
    area/multi-target
    area/lockfile
    type/bug
    pillar/consume
    on Nov 12, 2026
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

    area/lockfilearea/multi-targetpillar/consumetype/bug

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions