Repository navigation
Replies: 1 comment
|
Same on the released line (0.1.7-rc.2), and it comes down to one regex:
const TARBALL_SPEC = /\.(?:tgz|tar\.gz)(?:#.*)?$/i;The extension has to be at the very end, followed only by an optional
So this is not master-only either, and the fix is a single anchored pattern: allow a query string |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Current-version update — 2026-10-07
Rechecked on 2026-10-07 against the newest public release, 0.2.1-alpha.1, and upstream master at
5badb15009ae1756c3afe0ae0cef1faafc290ccc. The query-bearing tarball fix remains applicable. The owning install-spec/manager selection passed 105 cases, registry passed 15, and the assembled Chromium install scenario passed. All five product commits are preserved in the published current-baseline integration; both the full build and full lint passed.Current patch index and verification limits. No all-checks-pass, upstream acceptance or released-fix claim is made. This update is AI-assisted with Codex; the published commits retain its co-author.
The original report and its verification history are preserved below.
Summary
On master at
5badb15009ae1756c3afe0ae0cef1faafc290ccc(0.2.1-alpha.1), Plugin Manager does not recognize an HTTP(S) archive pathname when the URL has a query after the archive extension. Depending on path depth, it either rejects the spec before pnpm runs or reports the archive as a Git repository.This affects archive URLs with download, token, or signature parameters. I identified this during a source audit and did not find an equivalent public report in the Discussions, Issues/PRs, relevant commits, and indexed forks I checked. That describes the public search, not a claim that nobody has encountered it privately.
Reproduction
Call
parseInstallSpecwith these specs on the baseline:With repository dependencies installed, save this as
repro.mjsat the repository root and runnode --import tsx/esm repro.mjs./plugin.tgz?token=probetarballInvalidInstallSpecError/packages/plugin.tgz?token=probetarballgit/x/y/plugin.tar.gz?token=probe&download=1#archivetarballInvalidInstallSpecErrorFor rejected URLs, the Web install flow stops at inspection, before pnpm downloads anything.
As an independent control, pnpm 11.7.0 accepted a real tarball served from a loopback HTTP server at
/plugin.tgz?token=probe.pnpm add --lockfile-only --ignore-scripts <URL>exited 0; the server received the complete query and the resulting manifest retained the complete URL. The archive was generated locally and no downloaded lifecycle scripts were run.The same control passed for
/download?file=plugin.tgz, which the existing parser already accepts. The patch retains that form rather than tightening the accepted URL set.Root cause
In the baseline parser,
TARBALL_SPECchecks the end of the complete spec. A query after.tgzor.tar.gzprevents its suffix match.HOSTED_REPOSITORY_URLruns before HTTP archive handling; a two-segment archive path with a query can therefore match the Git heuristic instead.The problem is in Plugin Manager classification, not archive downloading. Discussion #8294 describes a separate pnpm integrity failure after resolving an archive; this patch does not address that issue.
Patch
url.pathname, before accepting the hosted-repository heuristic.InvalidInstallSpecError.The only production file changed is
install-spec.ts. Public TypeScript types, package exports, dependencies, configuration, profile formats, and wire formats are unchanged. The README and a bilingual Agent Note document the behavior and the decision to retain already accepted URL forms.efb82abedb7641d97b64f852e10e63421ed1ae44c92f3aaf12d29333b0b84c0bc9fa34e42deb9d70codex/fix-tarball-url-queryThe separate fixture-only commit removes a Windows file-symlink privilege dependency from the website test without changing publishing logic or skipping its containment assertion. The complete branch validation includes both commits; the tarball change remains separately cherry-pickable.
In accordance with the current contribution policy, I am sharing the report and fork patch here rather than opening an external PR.
Verification
The parser regression was run before the fix: 4 failed, 6 passed, and 8 other cases were not selected. The failures were the query-bearing archive cases; the existing query-named download endpoints remained accepted.
After the fix:
Result: 3 files and 120 tests passed. The modified production module has 100% statements, branches, functions, and lines coverage. The manager tests use the real Loader-backed entry and verify that archive inspection does not perform a registry package lookup; attribution tests distinguish source-host and registry download failures.
A keyless assembled Web scenario passed in Chromium with:
The test uses the real Host/RPC/Loader/inspection/UI flow and replaces only the external package-manager process. It checks the archive label and ARIA golden, the complete spec in the child process argv, cancellation preserving the manifest, child-process termination, and an empty page-error list. In PowerShell,
DSH_SNAPSHOTwas set and restored explicitly around this command.Additional checks:
corepack pnpm run build— passed.corepack pnpm run doc-sync— the final complete run passed: 42 gates, 0 failed, 0 skipped. An initial WindowsEPERMin the website test's file-symlink setup was independently reproduced and addressed in the separate fixture-only commit. The test now reaches the external file through a real directory junction, verifies its realpath, and retains both containment assertions. A temporary negative control that removed realpath resolution failed at the expected rejection assertion; publishing logic was then restored unchanged. All 151 website tests and two concurrent independent focused runs passed. No test was skipped or weakened and no host privileges were changed.corepack pnpm run lint:contracts-ready— passed for the main patch using freshly generated Host declarations; the additional fixture passedcorepack pnpm exec tsx scripts/run-oxlint.ts scripts/project-doc-site.spec.tsand staged lint.git diff --check, staged whitespace, and committed-diff whitespace checks — passed.Limits
The local runs were on Windows with Node 24.19.0, pnpm 11.7.0, and Chromium 149. I have not claimed a completed platform CI matrix or tested a real CDN's signed-authentication integration. Recognizing an archive URL does not prove that its signature is valid, the remote bytes form an archive, or the installed package is a bundle; fetching and existing post-install validation still decide those matters.
AI-assisted source audit, implementation, and verification with Codex. Both commits include
Co-authored-by: Codex <noreply@openai.com>. Only checks actually run are listed above.All reactions