Repository navigation
rfc(pnpr): publish-time manifest verification - #47
Conversation
Split from #44. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 49 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Co-Authored-By: Claude Opus 5.5 <[email protected]>
#44 was split into #47, #48, and #49. Co-Authored-By: Claude Opus 5.5 <[email protected]>
#44 was split into #47, #48, and #49. Co-Authored-By: Claude Opus 5.5 <[email protected]>
npm publish uploads the output of @npmcli/package-json prepare(), not the raw package.json, so a strict comparison would reject ordinary uploads (bin refs, the gypfile install-script injection, bundleDependencies true, version cleaning). Define these as profile normalizations, accept the one benign direction (submitted claims a build the archive cannot run), add name and version to the compared fields, and add evidence from the npm trackers plus a 1,674-package survey of registry metadata vs archives. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Updated in 5eca093.
Written by an agent (Claude Code, claude-opus-5-5). |
Add the latest version of the 5,000 most-downloaded packages and a random older version of each of the top 2,000. 273 of 8,620 versions differ before normalization; all are explained by publisher-side normalization, which adds empty-vs-absent maps, directories.bin expansion, stripped build metadata, and git shorthand expansion to the profile. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Updated in d49aaf6: the survey now also covers the latest version of the 5,000 most-downloaded packages and a random older version of each of the top 2,000: 8,620 versions in total. 273 (about 3%) differ before normalization, and every one is explained by publisher-side normalization. The new rules: empty map versus absent field, Written by an agent (Claude Code, claude-opus-5-5). |
PR Summary by QodoRFC: Verify hosted package manifests at publish time
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
* docs(pnpr): propose atomic workspace publication * docs(pnpr): define publication through SQL transactions * rfc(pnpr): build on the split SQL metadata storage draft #44 was split into #47, #48, and #49. Co-Authored-By: Claude Opus 5.5 <[email protected]> * rfc(pnpr): add evidence, keyless retries, uploads by integrity, and workload batches Add npm tracker evidence for half-published releases and ghost-version conflicts. Name the pnpr gaps the transaction must close: a byte-identical retry returns VersionAlreadyPublished, one 100 MiB body carries every archive, and OIDC workloads can only PUT a single package. Upload archives by integrity before commit, treat content as the idempotency key for keyless clients, let workloads submit transactions, and let staging hold a whole transaction. Co-Authored-By: Claude Opus 5.5 <[email protected]> * rfc(pnpr): record committed publications for clients to read Co-Authored-By: Claude Opus 5.5 <[email protected]> * rfc(pnpr): advance the current reference on commit, backfill publications, keep the policy epoch across replacement Co-Authored-By: Claude Opus 5.5 <[email protected]> * rfc(pnpr): commit publications with releases, match whole keyless requests, recover outcomes after revocation, drain before export Co-Authored-By: Claude Opus 5.5 <[email protected]> * rfc(pnpr): settle transaction scope, ecosystems, keyless batches, and retention Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
* rfc(pnpr): platform variants, one version with many artifacts Let a version carry a primary archive plus platform-tagged variant archives, published together and described in dist.pnpr.variants. pnpm locks every variant in the existing variations resolution and links the matching one as the package, replacing the per-platform optionalDependencies pattern behind npm/cli#4828 and install-script binary downloads. Co-Authored-By: Claude Opus 5.5 <[email protected]> * rfc(pnpr): fit platform variants to packages and tools that would migrate Check the RFC against 32 npm packages that use per-platform optional dependencies and against tools shipped only as GitHub release archives, and adjust it where they would not fit: - a variant lists several platforms (static Linux builds, macOS universal binaries) and is named by a tag carried in the lockfile; - the primary is optional, for tools with no portable implementation; - bundled dependencies are excluded from the dependency-equality check, so wasm32 variants and fallbacks can carry their runtime; - virtual store keys, Node ABI targets, per-archive provenance; - a Migration section with the packages, the tools, and what does not fit. Co-Authored-By: Claude Opus 5.5 <[email protected]> * rfc(pnpr): fold platform variants prototype results into the RFC A prototype on real packages (esbuild, biome, rolldown, lightningcss, tailwind oxide, typst) found that: - global virtual store slots must be keyed by the selected archive; - the installer must record the linked variant to relink on a change; - older pnpm rewrites the lockfile without variants unless frozen; - npm gets a primary that fails, so the compatibility view ships first; - pnpm fetch must fetch every variant supportedArchitectures matches; - archives must be uploaded one per request. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs: rewrap a paragraph Co-Authored-By: Claude Opus 5.5 <[email protected]> * rfc(pnpr): let platform variants declare their own dependencies Variants may now declare different dependencies and optionalDependencies, as platform packages do today. Peer dependencies must still be equal, and a dependency name that more than one archive declares must use the same specifier in each. The lockfile resolves every archive's dependencies and records which archives use each one, so it stays the same on every platform. Co-Authored-By: Claude Opus 5.5 <[email protected]> * rfc(pnpr): declare variant platforms as explicit combinations The os, cpu and libc arrays of package.json match every combination of their values. A variant now lists its platforms one by one, and those arrays never select a variant. The compatibility view gets one reserved name per platform when a variant's platforms are not a full cross product, so npm never installs a variant on a platform it does not serve. Co-Authored-By: Claude Opus 5.5 <[email protected]> * rfc(pnpr): declare a variant's platforms in its own package.json A variant's package.json now declares its tag and platforms in a platformVariant field. pnpr derives dist.pnpr.variants from the verified archive, so the archive's provenance covers where the build claims to run. Variants may no longer declare os, cpu, or libc, so there is one statement of where a variant runs, and the publish command needs no --platform flag. Co-Authored-By: Claude Opus 5.5 <[email protected]> * rfc(pnpr): keep variant integrities out of large packuments Variant integrities do not compress, so inline they make a packument several times larger. Large documents are split under a media type that clients opt into: each version's dist moves to its immutable version document and is marked dist.pnpr.details external, except for the versions a resolution almost always picks. The prototype measured cold resolution 29 to 40 percent faster. A release record covers every archive of a version. Co-Authored-By: Claude Opus 5.5 <[email protected]> * rfc(pnpr): keep split metadata in a cache of its own An older client that shares the metadata cache must never read a split document, whose versions lack their integrity. The prototype hit this with an older pnpm on PATH. Co-Authored-By: Claude Opus 5.5 <[email protected]> * rfc(pnpr): refer to the split packuments RFC Co-Authored-By: Claude Opus 5.5 <[email protected]> * rfc(pnpr): move whole versions of split packuments, with corrected numbers Co-Authored-By: Claude Opus 5.5 <[email protected]> * rfc(pnpr): external versions and release records for split packuments Co-Authored-By: Claude Opus 5.5 <[email protected]> * rfc(pnpr): other versions with recent publish times in split packuments Co-Authored-By: Claude Opus 5.5 <[email protected]> * rfc(pnpr): split packuments in a format of pnpr's own Co-Authored-By: Claude Opus 5.5 <[email protected]> * rfc(pnpr): link the merged split packuments RFC Co-Authored-By: Claude Opus 5.5 <[email protected]> * rfc(pnpr): describe variants only in pnpr's package document Co-Authored-By: Claude Opus 5.5 <[email protected]> * rfc(pnpr): variants as a field of a version's entry Co-Authored-By: Claude Opus 5.5 <[email protected]> * rfc(pnpr): variants reach pnpm only from declared pnpr registries Co-Authored-By: Claude Opus 5.5 <[email protected]> * rfc(pnpr): name the variant declaration field variant Co-Authored-By: Claude Opus 5.5 <[email protected]> * rfc(pnpr): derive a variant's tag from its platforms Co-Authored-By: Claude Opus 5.5 <[email protected]> * rfc(pnpr): clarify primary-less variants, revision in VariationsResolution, and link #47 * rfc(pnpr): use manifest on variant entries, specify route encoding, and drop post-publish variant mutation question * docs(pnpr): use flat variant snapshot keys instead of archiveDependencies * docs(pnpr): derive lockfile variant tag from targets instead of adding tag field * docs(pnpr): use batch publish with integrity-addressed blob uploads instead of stages * rfc(pnpr): deterministic variant tags, per-variant specifiers, manifest overrides, generated primary trust Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs: rewrap paragraphs Co-Authored-By: Claude Opus 5.5 <[email protected]> * rfc(pnpr): one provenance statement from the release job names every archive Co-Authored-By: Claude Opus 5.5 <[email protected]> * rfc(pnpr): show variant manifests in the metadata example Co-Authored-By: Claude Opus 5.5 <[email protected]> * rfc(pnpr): link the merged atomic workspace publication RFC Co-Authored-By: Claude Opus 5.5 <[email protected]> * rfc(pnpr): libc in the generated primary, one generated primary per revision, optional dependencies in variant snapshots Co-Authored-By: Claude Opus 5.5 <[email protected]> * rfc(pnpr): serve the selected revision's generated primary to npm clients Co-Authored-By: Claude Opus 5.5 <[email protected]> * rfc(pnpr): compare variants' external dependencies, without bundled ones Co-Authored-By: Claude Opus 5.5 <[email protected]> * rfc(pnpr): compare variants' resolved dependencies with the version's snapshot Co-Authored-By: Claude Opus 5.5 <[email protected]> * rfc(pnpr): compare and record a variant's complete resolved snapshot Co-Authored-By: Claude Opus 5.5 <[email protected]> * rfc(pnpr): align the lockfile change list with the snapshot rule Co-Authored-By: Claude Opus 5.5 <[email protected]> * rfc(pnpr): unknown tag fields without a primary fail like an unmatched host Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
#44 was split into #47, #48, and #49. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Summary
Split from #44. When a package is published to a pnpr-hosted registry, derive its install-critical metadata from the archive's
package.json, compare it with the submitted manifest, and reject the publish if they disagree. After acceptance, serve only the archive-derived metadata.This closes manifest confusion for hosted packages without any client or protocol change, and doesn't depend on the other drafts split from #44.
Related drafts
🤖 Generated with Claude Code