scan --package that matches nothing says to run the package manager's install
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 88/100
Rechercherichtung
Beginne mit no_packages_message in crates/socket-patch-cli/src/commands/scan/render.rs und seiner Aufrufstelle in crates/socket-patch-cli/src/commands/scan/mod.rs; verfolge, wie Paketfilter und die Allowlist in socket.yml das leere Ergebnis erzeugen. Erweitere no_packages_message_names_the_filter und füge den CLI-Fall zur Scan-Render-Testsuite hinzu. Fertig ist die Arbeit, wenn beide Pfade den Paketfilter nennen, der nichts übrig gelassen hat, und die bestehende Formulierung für Filter weiterhin besteht.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
[agent] Found by the architecture refactor routine on main at cfc870f. Kind: a class of wrong message fixed for two filters and still live for the third.
Problem
scan --package <spec> (or SOCKET_SCAN_PACKAGES) whose spec matches no installed package ends with:
No packages found. Run your package manager's install first.
The packages are installed. The spec is what matched nothing: a typo, or a version that is not the installed one. The message sends the user to reinstall, and nothing in the output names the flag. With the value in an environment variable of a CI job, the scan patches nothing, exits 0 and gives this as the reason.
The other two crawl filters name themselves. no_packages_message (crates/socket-patch-cli/src/commands/scan/render.rs, line 111) says so in its doc comment: "naming the filter that emptied it when there was one (--ecosystems, PATH scoping) instead of a generic "install first" hint".
Evidence on main
A project with four packages installed under node_modules (lodash 4.17.20 among them), binary built from cfc870f:
$ socket-patch scan --mode agent --dry-run --package lodahs
No packages found. Run your package manager's install first.
(exit 0)
$ socket-patch scan --mode agent --dry-run --package pkg:npm/[email protected]
No packages found. Run your package manager's install first.
(exit 0)
$ SOCKET_SCAN_PACKAGES=lodahs socket-patch scan --mode agent --dry-run
No packages found. Run your package manager's install first.
(exit 0)
$ socket-patch scan --dry-run --package lodahs # hosted mode, the default
No packages found. Run your package manager's install first.
(exit 0)
The same project, emptied by the other two filters:
$ socket-patch scan --mode agent --dry-run --ecosystems pypi
No pypi packages found.
(exit 0)
$ socket-patch scan --mode agent --dry-run nosuchdir
No installed packages found under the given path: nosuchdir.
(exit 0)
A socket.yml allowlist that matches nothing prints the same first line, with the policy line after it:
$ cat socket.yml
version: 2
patches:
packages: [lodahs]
$ socket-patch scan --mode agent --dry-run
No packages found. Run your package manager's install first.
Policy (socket.yml): 4 skipped by filters, 0 patched packages held.
(exit 0)
Cause and history
The call site (crates/socket-patch-cli/src/commands/scan/mod.rs, line 3202) passes the function --global, --ecosystems and the PATHs, and not args.packages.
- #248 (2026-09-23) gave the function its filter-aware wording for
--ecosystemsand PATHs. - #277 (2026-10-01) added
--packageand did not extend it. - #2126 (for #2125) fixed another cause of the same sentence: an agent scan from a monorepo root that skipped the projects below it.
Planned fix
- Pass the
--packagespecs tono_packages_message, and say which filter left nothing when the crawl itself found packages: for exampleNo installed package matches --package lodahs. - Use the same wording when the
socket.ymlallowlist (patches.packages) is what left nothing, so the first line agrees with the policy line under it. - Extend
no_packages_message_names_the_filterand add one CLI case to the scan render suite.
Human wording only: no JSON shape, flag, default or exit code changes. CLI_CONTRACT.md does not quote these sentences.
Not checked: get, which has the same sentence at commands/get.rs line 4921.
Generated by Claude Code
- Vorherrschende Sprache
- Rust
- Sterne
- 9
- Forks
- 2
- Ø Merge
- 1 T. 8 Std.
- Gemergte PRs (30 T.)
- 313
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus SocketDev/socket-patch
-
agent:triaged arch-audit bug priority:p2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 84/100
SocketDev/socket-patch#2306 ·
Maintainer antworten meist innerhalb von 1 Tag
-
agent:needs-human agent:triaged ci-janitor priority:p1
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
SocketDev/socket-patch#2270 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
agent:triaged arch-audit bug priority:p1
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
SocketDev/socket-patch#2259 ·
Maintainer antworten meist innerhalb von 1 Tag
-
agent:triaged arch-audit priority:p3 refactor
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 83/100
SocketDev/socket-patch#1860 ·
Maintainer antworten meist innerhalb von 1 Tag
-
agent:triaged arch-audit priority:p3 refactor
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
SocketDev/socket-patch#1838 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in SocketDev/socket-patch
Ähnliche Issues
-
Bash init calls `cygpath` unconditionally on Windows, which breaks non-Cygwin shells like `brush`Evtl. vergeben @iliqiliev hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
ajeetdsouza/zoxide#1381 ·
Maintainer antworten meist innerhalb von 5 Tagen
-
triage
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 88/100
kornia/kornia-rs#1416 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 2 Tagen
-
enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
paritytech/revive#749 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
swc-project/swc-next-issues#1043 ·