Untitled conversation
- User
[BUG] apm install fail second time with Content hash mismatch Describe the bug I can install my repo (see apm.yml further down) via
apm install <org>/<repo>/package/<project>just fine (kinda, see the logs, it looks wonky but maybe it's just a new feature) but the second time I runapm installit will fail consistently withContent hash mismatch.To Reproduce Steps to reproduce the behavior:
- apm install <repo>
- apm install
Expected behavior A clear and concise description of what you expected to happen.
Environment (please complete the following information):
- OS: Windows
- APM Version: 0.16.0
Logs
powershell - Assistant
I’ll trace the lockfile hashing and cached single-file install path, then patch the mismatch and add a regression test. This touches integrity verification, so I’m using the supply-chain-security skill to preserve the intended attack protections.
- Assistant
The mismatch is occurring before deployment, between the prior lock hash and the newly materialized cache. I’m narrowing this specifically around file dependencies, where Windows line-ending conversion or path-dependent hashing can make identical repository content hash differently across fresh and cached paths.
- Assistant
The key defect is now clear: Azure DevOps single-file packages are written to the lockfile without a resolved commit (the repeated
cache-pin ... has no resolved_commitwarnings confirm it). That prevents the verified cache path from being used, so APM re-downloads a synthetic virtual package and then compares it against a hash it cannot reliably replay. I’m fixing commit resolution for this host rather than weakening hash verification. - Assistant
Resolving the ADO commit crosses the authentication path, so I’m also applying the repository’s auth skill constraints: credentials will continue through
AuthResolver, with no token added to URLs or diagnostics. - Assistant
The fix keeps integrity checks fail-closed: ADO virtual files now acquire an exact commit identity on first install, so the second install verifies and reuses that pinned cache. If commit resolution genuinely fails, behavior remains best-effort and the existing content-hash protection still applies. Focused install, resolver, and hashing tests are green; I’m running the broader unit suite now.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.