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 }}
Repository navigation
PnpmLock::parse inventories a pnpm 11 env-lockfile document's configDependencies as project packages, while InstalledPackages and the upstream evidence reader drop it #1949
[agent] Filed by the scheduled architecture audit (audit-core). Register: #1830 (comment).
Kind: bug. Register ID: A64.
Problem. pnpm 11+ writes the env lockfile (configDependencies / packageManagerDependencies) as a first YAML document ahead of the project lock. grammar::main_document exists to drop it (grammar.rs L91-L109),`` but only some readers call it:
InstalledPackages drops it (mod.rs L534), and so does pnpm_lock_tarball_evidence (upstream/npm.rs L1514-L1517).````
PnpmLock::parse scans the whole text (mod.rs L386-L394). The lock inventory reads PnpmLock::parse(text).entries() (lock_inventory/pnpm.rs L95-L97).`````
Executed (a scratch test on cbbbdb9). The lock's env document locks cfg@1.0.0 and its main document locks a@1.0.0. The readers disagree:
So scan inventories, and sends to the API, a config dependency that the project's install never links. Patching paths that use InstalledPackages then disagree with the inventory about the same package.
Proposed change.PnpmLock::parse applies main_document itself. The callers that need the env document (none today, as far as grep shows) can read it explicitly. Add a unit test in formats/pnpm/mod.rs with a two-document lock that asserts entries() omits the env-document packages.
Size. 1–2 files, about 15 lines plus the test.
Acceptance criteria.
Single-document locks behave exactly as before; the existing formats::pnpm and lock_inventory tests pass.
The new two-document test asserts entries(), InstalledPackages and vendored_npm_uuids agree.
[agent] Triage: priority:p1 (pnpm). Confirmed on main: PnpmLock::parse (formats/pnpm/mod.rs) calls pnpm_packages(text) / vendored_npm_uuids(text) on the whole text, while InstalledPackages and upstream/npm.rs go through grammar::main_document first. No open PR covers it. Related but separate defect: #1952 (the importers-member predicate).
[agent] Shares root cause with #1952: pnpm lock readers scan the whole lock text with their own line rules instead of the main document through the formats::pnpm grammar, so the pnpm 11 env document and comment lines read differently per caller. Will be fixed together.
[agent] Claiming this issue (with #1952; shared root cause: pnpm lock readers bypass grammar::main_document and the shared key-line grammar). Branch: agent/fix-pnpm-lock-main-document. Claim-ID: 2026-11-01T22:21:15Z-216d13
Activity
mikolalysenko commentedon Nov 1, 2026
[agent] Triage:
priority:p1(pnpm). Confirmed onmain:PnpmLock::parse(formats/pnpm/mod.rs) callspnpm_packages(text)/vendored_npm_uuids(text)on the whole text, whileInstalledPackagesandupstream/npm.rsgo throughgrammar::main_documentfirst. No open PR covers it. Related but separate defect: #1952 (the importers-member predicate).Generated by Claude Code
mikolalysenko commentedon Nov 1, 2026
[agent] Shares root cause with #1952: pnpm lock readers scan the whole lock text with their own line rules instead of the main document through the
formats::pnpmgrammar, so the pnpm 11 env document and comment lines read differently per caller. Will be fixed together.[agent] Claiming this issue (with #1952; shared root cause: pnpm lock readers bypass
grammar::main_documentand the shared key-line grammar). Branch: agent/fix-pnpm-lock-main-document. Claim-ID: 2026-11-01T22:21:15Z-216d13Generated by Claude Code
mikolalysenko commentedon Nov 1, 2026
[agent] Draft PR: #1960
Generated by Claude Code
Read pnpm locks' project document in every reader
Read every pnpm lock document, the env lockfile as its own tree