Composer crawler ignores a vendor-dir set in the global Composer config, so scan -g and agent scans report "No packages found" and leave installs unpatched
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 72/100
Línea de trabajo
Start in crates/socket-patch-core/src/crawlers/composer_crawler.rs, reading get_vendor_paths at lines 52-64 and resolve_local_vendor_dir at lines 473-492. Reproduce the global and local cases from the issue with Composer and the listed socket-patch scan commands, then verify scans discover packages installed through global, project, and COMPOSER_HOME configuration. Done means configured vendor directories are found and no longer produce empty successful scans.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
[agent] Found by the scheduled Composer bug-hunt routine (ledger #321).
Summary
Composer resolves vendor-dir through its config cascade: COMPOSER_VENDOR_DIR, then the project's composer.json config.vendor-dir, then the user-level $COMPOSER_HOME/config.json. The socket-patch Composer crawler follows only part of that cascade, so real installs go undiscovered:
- Global (
-g):get_vendor_pathshardcodes$COMPOSER_HOME/vendor(crates/socket-patch-core/src/crawlers/composer_crawler.rs:52-64). If the global project setsconfig.vendor-dir(composer global config vendor-dir deps, or"config":{"vendor-dir":"deps"}in$COMPOSER_HOME/composer.json), orCOMPOSER_VENDOR_DIRis exported,composer global requireinstalls to$COMPOSER_HOME/deps.scan -gthen finds 0 packages, andscan -g --mode agentprintsNo global packages found.with exit 0. - Local (agent mode):
resolve_local_vendor_dir(composer_crawler.rs:473-492) readsCOMPOSER_VENDOR_DIRand the projectcomposer.json, but not the user-level$COMPOSER_HOME/config.json. Aftercomposer config -g vendor-dir lib, every project'scomposer installwrites tolib/, andsocket-patch scan --mode agentreportsNo composer packages found.(exit 0) while the package stays unpatched.
In both cases the failure is silent, with exit 0 and nothing patched or attested.
Repro (Linux; Composer 2.8.12, mock patch API, local path-repo package acme/[email protected])
# 1. global
export COMPOSER_HOME=$PWD/ch
composer global config repositories.local '{"type":"path","url":"/abs/pkgs/tool","options":{"symlink":false}}'
composer global config vendor-dir deps
composer global require acme/tool:1.0.0 # -> $COMPOSER_HOME/deps/acme/tool
socket-patch scan -g --json --ecosystems composer # packagesWithPatches 0, scannedPackages 0
socket-patch scan -g --mode agent --yes --ecosystems composer # "No global packages found." exit 0
socket-patch scan --global-prefix "$COMPOSER_HOME/deps" --json --ecosystems composer # finds 1 (workaround)
# 2. local, user-level config
composer config -g vendor-dir lib # writes $COMPOSER_HOME/config.json
composer install # -> ./lib/acme/tool
socket-patch scan --mode agent --yes --ecosystems composer # "No composer packages found."
COMPOSER_VENDOR_DIR=gdeps composer global require … followed by COMPOSER_VENDOR_DIR=gdeps socket-patch scan -g also finds nothing. Composer resolves the variable against the global home, while the global branch never reads it.
Expected vs actual
- Expected: CLI_CONTRACT.md
--global: "Operate on globally-installed packages". The crawler's local-mode doc promisesCOMPOSER_VENDOR_DIR/config.vendor-dirsupport, and Composer applies the same cascade (includingconfig.json) to the global project and to every local one. The maintainer requirement for-gis that none may be missing. - Actual: packages installed under a configured vendor-dir are invisible, and the commands exit 0.
OS × version
| OS | Composer | global vendor-dir → scan -g / apply -g |
user config.json vendor-dir → local agent scan |
|---|---|---|---|
| Linux (local) | 1.10.28, 2.2.30, 2.8.12, 2.10.3 (PHP 8.3) | fail (each run twice) | fail (2.8.12, twice) |
| ubuntu-latest | 1.10.28, 2.2.30, 2.10.3 | fail | untested |
| macos-latest | 1.10.28, 2.2.30, 2.10.3 | fail | untested |
| windows-latest | 1.10.28, 2.2.30, 2.10.3 | fail | untested |
The default vendor/ layout passes everywhere except Windows, where default-home discovery is broken separately (#438).
Probe runs: https://github.com/SocketDev/socket-patch/actions/runs/36823671080 and https://github.com/SocketDev/socket-patch/actions/runs/36827949605
First bad version
Not a regression. It reproduces identically with the v4.0.0 release binary (both cases: 0 scanned).
Suspect code
crates/socket-patch-core/src/crawlers/composer_crawler.rs:52-64(global:composer_home.join("vendor"))crates/socket-patch-core/src/crawlers/composer_crawler.rs:473-492(local: no$COMPOSER_HOME/config.jsonlayer)
- Lenguaje dominante
- Rust
- Estrellas
- 8
- Forks
- 0
- Merge medio
- 15 h 39 min
- PR fusionados (30 d)
- 104
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de SocketDev/socket-patch
-
agent:triaged bug bughunt pm:cargo priority:p2
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
SocketDev/socket-patch#651 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Vendored Hatch runs a `hatch` executable planted in the scanned projectPosiblemente ocupada @mikolalysenko la tomó hace 1 día. Abiertoagent:claimed agent:triaged arch-audit bug pm:hatch priority:p1
Dificultad 2/5 Medio día Aptitud para principiantes 88/100
SocketDev/socket-patch#613 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Patch blob and diff downloads buffer the whole response body with no size capPosiblemente ocupada @mikolalysenko la tomó hace 1 día. Abiertoagent:claimed agent:triaged arch-audit bug priority:p3
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
SocketDev/socket-patch#571 · 5 comentarios ·
Los mantenedores suelen responder en 1 día
-
agent:triaged bug bughunt pm:composer priority:p2
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
SocketDev/socket-patch#515 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
agent:triaged bug bughunt pm:npm priority:p1
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
SocketDev/socket-patch#464 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de SocketDev/socket-patch
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 92/100
Los mantenedores suelen responder en 1 día
-
Outdated docs on front pageAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
rust-windowing/winit#4731 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
area:cli bug priority:high
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
rtk-ai/rtk#4439 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Anthropic streamed blocks without a content_block_stop are discardedPosiblemente ocupada @Frun1na la tomó hoy. Abiertocomponent:sight
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
agentic-os-org/ANOLISA#4622 · 1 comentario ·
Los mantenedores suelen responder en 1 día