Skip to content

fix(gate): recognise every spelling of a repo argument, and correct the pip maintainer probe - #508

Merged
sandstream merged 1 commit into
mainfrom
fix/507-repo-arg-forms
Aug 21, 2026
Merged

sandstream merged 1 commit into
mainfrom
fix/507-repo-arg-forms

Conversation

@sandstream

Copy link
Copy Markdown
Owner

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:

$ npx skills add --help
add <package>        Add a skill package (alias: a)
                     e.g. vercel-labs/agent-skills
                          https://github.com/vercel-labs/agent-skills

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: skills 1.5.23, vercel-labs/skills, 2 maintainers, TRIAGE PASSED.)

The fix normalises, it does not widen

ownerRepoArg matched ^[\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 optional user@, a host segment (dotted host or localhost, optional port), scp-style git@host:owner/repo, a trailing .git, and a deeper …/tree/main/sub path all collapse to owner/repo.

Verified through the real parser — every form now yields the same github:cursor/plugins ref:

argument ref extracted
cursor/plugins ✓
cursor/plugins --skill unslop ✓
https://github.com/cursor/plugins --skill unslop ✓
github.com/cursor/plugins ✓
git@github.com:cursor/plugins.git ✓
ssh://git@github.com/cursor/plugins.git ✓
https://github.com/cursor/plugins/tree/main/unslop ✓
@scope/name — (npm scope, not a repo)

The table test caught a flaw in my own first pass: ./local/path/file.txt reduced 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 unslop installs one subtree of a monorepo. Repo-level is a superset answer, kit triage skill exists 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_email fallback and the make-absence-visible reporting. It also declared the maintainer probe unavailable with this reason:

PyPI's JSON API publishes no maintainer list

Your correction is right, and it measures out:

requests            maintainer_email = "Ian Stapleton Cordasco <…>, Nate Prewitt <…>"   → countable
opensandbox-server  maintainer_email = null, author_email = one entry                   → countable, other field
deepsec (pypi)      all four fields null                                                 → nothing to count

So the probe now runs, and reports what the number is rather than implying npm's:

. 2 declared maintainer(s) in maintainer_email (self-declared package metadata)

! WARNING: single declared maintainer in author_email -- bus-factor risk. NOTE: this is
  self-declared metadata, not registry publish rights; PyPI does not expose who may publish,
  so it is not comparable to npm's maintainer count

Two properties worth naming:

  • It weighs both fields and can still answer "don't know". PEP 621 leaves maintainer null; a package that names nobody at all keeps the NOT CHECKED row, now with an accurate reason (this package names nobody) rather than a false claim about the API.
  • Counting is bracket-aware. "Cordasco, Ian <one@example.test>" is one maintainer, not two — display names contain commas.

Measured consequence: pip opensandbox-server moves from 100/100 with a partial-coverage note to 88/100 with 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/100 for that fixture, and 88/100 for 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 through parseInstallCommand, 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_email fallback 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 --all landed in #492 and works on this machine:

$ kit audit verify --all
✓ 4 anchored log(s): 3 verified · 0 stalled · 1 missing · 0 failed

missing and stalled are distinct outcomes: a vanished temp-dir log never fails the verdict, an unsealed tail warns and fails under --strict. Part 2 (elevation.ts threading cwd) needed no change — it was already correct at the version the report measured:

$ git show v6.6.3:src/elevation.ts | grep -A2 'appendAuditEventDirect'
  return appendAuditEventDirect(
    { operation: "elevation-check", … },
    { cwd },

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 fail
  • npx skills add --help and all five argument forms exercised against the built CLI

🤖 Generated with Claude Code

…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>
@github-actions

Copy link
Copy Markdown

✅ Docker image built successfully

  • CLI image: docker.io/sandstream/kit:test

@sandstream
sandstream merged commit 3d2834b into main Aug 21, 2026
19 checks passed
@sandstream
sandstream deleted the fix/507-repo-arg-forms branch August 21, 2026 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

install-gate: the skill repo-fetcher check only recognises owner/repo, so the URL form installs ungated

1 participant