You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 14, 2026. It is now read-only.
PkgIdWithPatchHash is a branded string type in upstream pnpm — type PkgIdWithPatchHash = string & { __brand: 'PkgIdWithPatchHash' }. Per CLAUDE.md's "Porting branded string types" section (rule 3 — non-validating brand → infallible newtype), pacquet should have a wrapper.
Today pacquet uses plain String for this value in:
Background
PkgIdWithPatchHashis a branded string type in upstream pnpm —type PkgIdWithPatchHash = string & { __brand: 'PkgIdWithPatchHash' }. Per CLAUDE.md's "Porting branded string types" section (rule 3 — non-validating brand → infallible newtype), pacquet should have a wrapper.Today pacquet uses plain
Stringfor this value in:crates/package-manager/src/virtual_store_layout.rs(since feat:.modules.yaml#332 / earlier)crates/package-manager/src/hoisted_dep_graph.rs(since feat(package-manager): hoisted dep-graph type skeleton (#438 slice 4a) #478)Both call sites need the same type, so introducing the newtype in just one is intra-pacquet inconsistency — Coderabbit flagged it on #478.
What to do
PkgIdWithPatchHashas a non-validating newtype (model on the existingpacquet_modules_yaml::DepPath:#[derive(Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize, Deserialize, From, Into)] #[serde(transparent)] pub struct PkgIdWithPatchHash(String);).pacquet-lockfile— alongside the other branded types ported from@pnpm/types(PkgName,PkgNameVer,PkgNameVerPeer,PkgVer).pacquet-modules-yaml— alongsideDepPath, which is the closest existing peer.crates/package-manager/src/virtual_store_layout.rsandcrates/package-manager/src/hoisted_dep_graph.rsto use the newtype.grep "pkg_id_with_patch_hash") and migrate any remainingString-typed slots.Out of scope
<pkg_id>:<integrity>or<pkg_id>:<resolution-hash>percreateFullPkgId).Written by an agent (Claude Code, claude-opus-4-7).