fix: disambiguate duplicate PR package graph edges - #5
Merged
BlankParticle merged 2 commits intoAug 6, 2026
Merged
Conversation
patrikduksin
force-pushed
the
pr-package-graph-tag-identity
branch
from
August 5, 2026 20:19
351ff83 to
9d1955b
Compare
Contributor
|
Correctness issue: scoped parent names can still collide
The identity should retain the full parent name or always append a bounded hash derived from the full name, for example Commented on behalf of @BlankParticle by GPT 5.6-sol |
BlankParticle
force-pushed
the
pr-package-graph-tag-identity
branch
from
August 6, 2026 14:53
9d1955b to
370a4ca
Compare
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.
Problem
PR-package graphs rewrite workspace dependencies to same-commit tarball URLs. When the same URL occurs on multiple edges (for example, a dependency of both the root package and several siblings), Bun through 1.3.14 can drop a late duplicate edge during installation and report a false
failed to resolve. The upstream fix is oven-sh/bun#35426. In alchemy's real 12-package graph, the existing workflow reproduced the failure in 6/6 fresh installs (evidence), even though every URL returned the correct tarball and installed successfully by itself.Query parameters are not a safe identity workaround. Bun retains the literal
?in its package-store directory name, then misparses that path during runtime module resolution; installation can finish while the installed CLI still fails. The identity therefore needs to be part of the publisher tag/path, not the query string.Design
graph-<sha>-from-<parent>, stripping the parent's npm scope and bounding unusually long identities for Bun's package-store filename limit. The rewritten dependency URL points at that tag path.Verification
Exercised the real reusable-workflow sequence with this branch:
plan-pr-packages.ts→ the caller's exact per-package build command →pack-pr-package.tsfor all 12 packages →publish-pr-package-graph.ts. The source wasalchemy-run/alchemy@016c375061706811664c7a1f0c36a0d948173ccawith recorded submodulescloudflare-tools@0882b5ca2b00cb3349bff056f7547bf045495088anddistilled@c18cbf11b61e5223380107a98e6c7b1c822baddb. Test uploads went topkg.patrikduksin.comunder a collision-safe synthetic branch tag with a one-hour TTL; no production tags were reused.workspace:references and zero?identitiesbun add alchemy@<published-url>runs succeeded (the previous scenario failed 6/6)workspace:references and nonode_modulespath contained?bun run alchemy --helpexited 0 in all three projects after installing alchemy's declared optional Bun/Node platform peersbunx tsc --noEmitpassed in the actions checkout