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 hash and cached-install paths, then add a regression test reproducing the second-install failure. Because this concerns integrity verification and package downloads, I’m using the repository’s supply-chain security guidance.
- Assistant
The security guidance requires keeping verification fail-closed; the fix will need to make first-install and cached-install hashing canonical, not weaken or bypass the mismatch check.
- Assistant
The existing
.apm-pinexclusion already covers one historical second-install bug, but this report follows a different path: a virtual single-file dependency is freshly materialized again and compared to its prior lock hash. I’m narrowing the mismatch to how that file is represented across runs, especially on Windows. - Assistant
The reproducible failure is enabled by an identity gap: ADO single-file packages often have no resolved commit, so the pipeline ignores an intact, hash-verified cache and re-downloads the moving
mainref on every ordinary install. I’m changing lockfile replay for this package shape to reuse the cache only when its recorded content hash verifies;--updatewill still fetch remote content, and tampered caches will still be rejected. - Assistant
This fix needs one shared replay rule used by both the parallel-download and sequential-integration phases, so I’m also applying the repository’s Python architecture guidance to avoid two subtly different cache decisions.
- Assistant
The implementation now makes the same hash-locked replay decision before both download stages. I’ve added regressions for ordinary second install and for
--update, which must continue to bypass the cache. - Assistant
The targeted regression suite passes. I’m checking adjacent cache, hash-verification, and branch-drift tests now to ensure the new replay rule doesn’t suppress legitimate updates or tamper detection.
- Assistant
The full unit suite passed, but one test mutated the repository’s root
apm.lock.yamlas a side effect. It was clean before testing, so I’m reverting only that test artifact and preserving the implementation changes.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.