Decide: should socket.yml refuse a bare package name with a version ([email protected]), as the selection filter does?
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 35/100
Direção de pesquisa
Read CLI_CONTRACT.md and the validation for socket.yml and the selection filter to compare their handling of versioned bare package names. The issue presents three options and recommends refusing these entries in both patches.ignorePackages and patches.packages; a maintainer decision is needed before implementation. Done means the chosen behavior is applied consistently and documented.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
[agent] A decision for a maintainer, from the architecture refactor routine. Found on main at cfc870f while running the socket.yml patch policy. Related: #2294 (the same validator).
The question
Should socket.yml refuse a bare package name written with a version ([email protected]) in patches.ignorePackages and patches.packages, as the selection filter does?
What happens today
A bare name is compared with package names whole, so [email protected] can never match. In a denylist that is a deny that does nothing, with no warning:
$ cat socket.yml
version: 2
patches:
ignorePackages:
- [email protected]
$ socket-patch scan --mode agent
Applied 6 patches.
CRITICAL [email protected] CVE-2026-0001
…
(exit 0)
policy.filtered[] has no entry for lodash, warnings[] has nothing about the spec, and node_modules/lodash/index.js holds the patched content afterwards. In patches.packages the same entry selects nothing, which at least fails closed.
The selection filter refuses the same entry:
$ socket-patch scan --mode agent --dry-run --selection-filter filter.json
Error: selection filter filter.json: skip.packages[0]: a bare name takes no version; write a purl (`pkg:npm/[email protected]`): `[email protected]`
(exit 2)
Why the contract does not settle it
CLI_CONTRACT.md lists what is invalid in socket.yml ("Invalid: empty, or pkg: without a type and a name"), and says of the selection filter that it also refuses an entry "that could never match: a bare package name with a version". So today's behavior is the documented one in both places. The same section says "Because the file only narrows, a file that cannot be honored never means "no policy"", which is the case for refusing it.
Refusing it makes a socket.yml that is accepted today fail every scan with socket_yml_invalid (exit 1) until the entry is rewritten as a purl.
Options
- Refuse it in
socket.ymlwith the selection filter's message. Fail closed, one rule in both files. A file that holds such an entry today starts failing scans. - Warn and continue: a run-level warning that the entry can never match (beside
socket_yml_ignored_value). No scan starts failing; the deny still does nothing until someone reads the warning. - Leave it, and say in
docs/configuration.mdthat a bare name takes no version.
The routine recommends option 1 for ignorePackages and packages alike: a deny that silently does nothing is the outcome the validation section exists to prevent.
scan --package [email protected] has the same reading (it matches nothing); #2296 covers what that run prints.
Generated by Claude Code
- Linguagem predominante
- Rust
- Estrelas
- 9
- Forks
- 2
- Merge médio
- 1d 8h
- PRs com merge (30d)
- 313
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de SocketDev/socket-patch
-
agent:triaged arch-audit bug priority:p2
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
SocketDev/socket-patch#2306 ·
Mantenedores costumam responder em até 1 dia
-
agent:triaged arch-audit bug priority:p3
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
SocketDev/socket-patch#2296 ·
Mantenedores costumam responder em até 1 dia
-
agent:needs-human agent:triaged ci-janitor priority:p1
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
SocketDev/socket-patch#2270 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
-
agent:triaged arch-audit bug priority:p1
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
SocketDev/socket-patch#2259 ·
Mantenedores costumam responder em até 1 dia
-
agent:triaged arch-audit priority:p3 refactor
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 83/100
SocketDev/socket-patch#1860 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de SocketDev/socket-patch
Issues semelhantes
-
Tighten observation-contract prose for trailing-archive fallback and spent-scan coverage noteAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Mantenedores costumam responder em até 3 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
storytold/craft-launcher#1671 ·
Mantenedores costumam responder em até 1 dia
-
Find/Replace panel: "Previous/Next occurrence" labels overlap and overflow their buttons (French)Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 63/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100