Repository navigation
fix(gate): recognise every spelling of a repo argument, and correct the pip maintainer probe - #508
Merged
Merged
Conversation
…he pip maintainer probe #507 — the install-gate recognised one argument form and the tool publishes two. `ownerRepoArg` matched ^[\w.-]+/[\w.-]+$ — one slash, no scheme — so a repo-fetching installer's payload was triaged only when the argument happened to be written as owner/repo. Measured against 6.7.0, with `npm install left-pad` still blocking as a control: npx skills add cursor/plugins → BLOCKED npx skills add https://github.com/cursor/plugins --skill unslop → allowed npx skills add github.com/cursor/plugins → allowed npx skills add git@github.com:cursor/plugins.git → allowed The measurement that decided the priority: `skills add --help` documents BOTH `vercel-labs/agent-skills` and `https://github.com/vercel-labs/agent-skills`, so the bypass ran through the invocation the tool's own help recommends — not a latent edge case. The argument is normalised BEFORE matching rather than the pattern widened: any scheme, an optional user@, a host segment, scp-style git@host:owner/repo, a trailing .git and a deeper …/tree/main/sub path all reduce to owner/repo. A looser regex would have started matching npm scopes and file paths, and the defect was never strictness — one form was implemented and its equivalents were not. The table test caught a flaw in the first pass: ./local/path/file.txt reduced to ./local, so filesystem paths are now refused outright. #489 — the pip maintainer probe was declared unavailable on a claim that was wrong. It said PyPI publishes no maintainer list; measured, requests carries maintainer_email = "Ian Stapleton Cordasco <…>, Nate Prewitt <…>", which is countable. Two things still keep it from being npm's number, and both are now in the OUTPUT rather than in a comment: PEP 621 leaves `maintainer` null so the value hides in maintainer_email (opensandbox-server had it only in author_email), and PyPI's list is self-declared package metadata while npm's is the registry's record of who may publish. So the probe runs and says what the number IS, warns with "not registry publish rights … not comparable to npm's maintainer count", and still declares itself unavailable — with an accurate reason — for a package that names nobody. Counting is bracket-aware, so "Cordasco, Ian <one@example>" is one maintainer. Measured: pip opensandbox-server 100/100 → 88/100, the same reason npm's packages scored 88. Two existing tests asserted the old answer and were updated with the reasoning in place. Closes #507 Refs #489 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
✅ Docker image built successfully
|
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.
Closes #507. Also corrects the maintainer half of #489, which was closed by #493 on a claim that turned out to be wrong — details below.
#507 — the gap is not latent, and the measurement says why
The one line that could not be run from a web session, run here:
The CLI documents both forms. So the gate was blocking the short form while letting through the invocation the tool's own help recommends — not an edge case waiting to matter.
(The package itself was triaged before being executed:
skills1.5.23,vercel-labs/skills, 2 maintainers,TRIAGE PASSED.)The fix normalises, it does not widen
ownerRepoArgmatched^[\w.-]+/[\w.-]+$— one slash, no scheme. Widening that pattern would have started matching npm scopes and file paths; the defect was never strictness, it was that one form was implemented and its equivalents were not. So the token is reduced first: any scheme (https,http,ssh,git+https), an optionaluser@, a host segment (dotted host orlocalhost, optional port), scp-stylegit@host:owner/repo, a trailing.git, and a deeper…/tree/main/subpath all collapse toowner/repo.Verified through the real parser — every form now yields the same
github:cursor/pluginsref:cursor/pluginscursor/plugins --skill unslophttps://github.com/cursor/plugins --skill unslopgithub.com/cursor/pluginsgit@github.com:cursor/plugins.gitssh://git@github.com/cursor/plugins.githttps://github.com/cursor/plugins/tree/main/unslop@scope/nameThe table test caught a flaw in my own first pass:
./local/path/file.txtreduced to./local. Filesystem paths are now refused outright (.,..,~,/prefixes and./..segments), which is the over-eager matching a looser regex would have produced everywhere.Not bundled, as you asked: the gate triages the whole repo while
--skill unslopinstalls one subtree of a monorepo. Repo-level is a superset answer,kit triage skillexists for the module question, and nothing connects them on this path. That is a separate decision, not a line in this diff.#489 — the maintainer probe, corrected
#493 shipped the newness probe, the
author_emailfallback and the make-absence-visible reporting. It also declared the maintainer probe unavailable with this reason:Your correction is right, and it measures out:
So the probe now runs, and reports what the number is rather than implying npm's:
Two properties worth naming:
maintainernull; a package that names nobody at all keeps theNOT CHECKEDrow, now with an accurate reason (this package names nobody) rather than a false claim about the API."Cordasco, Ian <one@example.test>"is one maintainer, not two — display names contain commas.Measured consequence:
pip opensandbox-servermoves from100/100with a partial-coverage note to88/100with a single-maintainer warning — the same reason npm's packages scored 88, and now with the caveat attached instead of implied.Two existing tests asserted the old (wrong) answer —
100/100for that fixture, and88/100for the very-new one that now also warns on a single maintainer (76/100). Both were updated with the reasoning in the test body, since the correction changes what the right answer is.Tests
install-gate.test.ts— a 12-row table over every equivalent spelling, a refusal table (npm scope, bare name, host-only, single segment, flags, four path shapes), the same forms throughparseInstallCommand, and an npm scope that must not become a repo ref. 102 tests in the file, all green.triage-ecosystem-parity.test.ts— four new cases against the local registry fixture: two comma-separated maintainers counted,author_emailfallback with the caveat asserted verbatim, a comma inside a display name counted as one, and a package naming nobody declaring the probe unavailable with the corrected wording (and explicitly not the old "publishes no maintainer list" text).#470 — already shipped, verified again here
kit audit verify --alllanded in #492 and works on this machine:missingandstalledare distinct outcomes: a vanished temp-dir log never fails the verdict, an unsealed tail warns and fails under--strict. Part 2 (elevation.tsthreadingcwd) needed no change — it was already correct at the version the report measured:Verification
npm test: 4415 tests, 0 fail, 0 skipped (macOS, non-root). 0 skipped rather than 1: semgrep is installed here, so the scanner-subprocess test runs too — the two chmod guards ran and passed, which is what the report asked to confirm.eslint src: 0 errors ·prettier --check "src/**/*.ts"clean ·kit self-audit: 16 rules, 0 failnpx skills add --helpand all five argument forms exercised against the built CLI🤖 Generated with Claude Code