fix(pak): verify installed version matches pak's resolution before reporting OK#151
Merged
eliotmcintire merged 1 commit intoMay 16, 2026
Merged
Conversation
…porting OK
On binary-lag platforms (e.g. Mac with reproducible 3.1.0 in source but only
3.0.0 in binary), pak's pkg_deps resolved to 3.1.0 while pak::pak() kept the
3.0.0 binary. The post-install reconciliation in pakInstallFiltered fell back
to pakResolvedVersionMap without checking that pak's resolution matched what
actually landed on disk -- so Install("reproducible (>= 3.1.0)") reported
"Installed 1 packages" while packageVersion("reproducible") was still 3.0.0.
Extract the predicate into pakConstraintSatisfied() (testable), require
identical(pakResolvedVer, installedVer) before trusting pak's resolution, and
emit an explicit "binary-lag" warning when pak resolved newer than disk has.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
reproducible 3.1.0is in source but only3.0.0is in binary),pak::pkg_deps()resolves to 3.1.0 whilepak::pak()keeps the 3.0.0 binary.pakInstallFilteredthen fell back topakResolvedVersionMapwithout checking what actually landed on disk — soInstall(\"reproducible (>= 3.1.0)\")printedInstalled 1 packagesandpackageVersion(\"reproducible\")was still'3.0.0'.pakConstraintSatisfied()(testable) and requiredidentical(pakResolvedVer, installedVer)before trusting pak's resolution.pakResolvedNewerbranch that emits an explicitcould not be installed: pkg >= X; pak resolved Y but only Z is available as a binary on this platformwarning, so the user actually sees the no-op instead of a silent failure.Test plan
test-16installFailureMetadata_testthat.Rcovering the binary-lag scenario, the all-satisfied case, the pak-chose-installed case, and missing/blankpakResolvedVerfallback. All pass locally.reproducible 3.1.0only in source,Require::Install(\"reproducible (>= 3.1.0)\")should now warn rather than reportInstalled 1 packages.🤖 Generated with Claude Code