Repository navigation
Fix hidden npm workspace members left unpatched (#1827) - #1829
Mikola Lysenko (mikolalysenko) wants to merge 4 commits into
Conversation
Assisted-by: Claude Code:claude-opus-5-5
A workspace member declared under a hidden directory, such as a GitHub Action kept at .github/actions/<name> or an explicit .config/tool entry, was never crawled in agent mode. Its nested node_modules copy stayed unpatched while apply --check reported in sync and vex attested not_affected. The member walk that adds back declared members the project walk prunes now descends into hidden dirs and keeps members whose path crosses a hidden name, as it already did for build-dir names. Each package manager's glob reading still decides whether a wildcard matches a dot component. Fixes #1827 Assisted-by: Claude Code:claude-opus-5-5
The previous commit let wildcards walk into every hidden dir. A ** pattern could then spend its walk budget inside .git or .next and drop real members, and build output such as .output/server could be crawled as a member that no package manager installed. A hidden dir now counts only where the workspaces pattern spells its dot (.github/actions/*, .config/tool), the way pnpm, Bun and vlt read patterns. The walk and the member check also share one pruned-name rule with the main walk, and run the cheap listing checks before the glob match. Refs #1827 Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
1 similar comment
|
BugBot review Generated by Claude Code |
A pattern such as {.github,packages}/** has a dot only in one brace
alternative, but the walk treated the whole pattern as spelling a
dot and descended into every hidden dir, .git and .next included.
That could use up the walk's dir budget and drop real members.
Each brace alternative now walks from its own literal prefix, and
only an alternative that spells a dot descends into hidden dirs.
The alternatives of one pattern share its dir budget.
Refs #1827
Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit a1eb7df. Configure here.
|
Burn-down agent: labeled Ready for review at
Generated by Claude Code |
Final review briefWhat it does. Agent-mode crawls of npm, yarn and Bun projects now include declared workspace members that sit in a hidden directory, such as Risk: low. The change is in one function ( Look here
Verified
Changes I made: none. Open questions: none blocking. The PR body lists two limits it leaves out on purpose: Auto-merge is armed, so approving sends this straight to the merge queue. Generated by Claude Code |
LLM Description written by Claude Code:claude-opus-5-5
Fixes #1827
Summary
Agent mode now crawls a declared npm/yarn/Bun workspace member that lives
in a hidden directory, for example a JavaScript GitHub Action kept at
.github/actions/<name>or an explicit.config/toolentry. Beforethis change,
scan --mode agent/applyleft that member'snode_modulescopy unpatched,apply --checksaid "in sync", andvexattestednot_affected. Hosted vex's installed-copy check missedthe same copy.
Root cause
The project walk prunes hidden and build dirs. #1627 added
skipped_members_of(crates/socket-patch-core/src/crawlers/npm_crawler.rs)to add back declared members the walk prunes, but only members whose
path crosses a
SKIP_DIRSname, and its own walk refused everydot-named dir. So a hidden member was never added back.
Fix
dot, either in the literal prefix (
.github/actions/*,.config/tool) or in the glob part (build/.*,{.github/actions,tools}/*). A path through a hidden dir is matchedwith no wildcard matching a dot component, which is how pnpm, Bun and
vlt read patterns.
SKIP_DIRSname. Both rules now come from onewalk_prunes_namehelper that the main walk's
workspace_childrenalso uses, so thetwo can't drift apart again.
docs/ecosystems.mddescribes the rule.No changes to the npm/PyPI/gem wrappers: the crawl runs only in the
Rust core.
Test evidence
Each new test fails on main and passes with the fix:
crawler_npm_e2e::crawl_all_finds_declared_members_in_hidden_dirsin_process_alternate_installers::apply_patches_workspace_member_in_a_hidden_dir(.github/actions/xglob,.config/toolliteral)in_process_alternate_installers::apply_check_and_vex_see_unpatched_member_in_a_hidden_dircrawler_npm_e2e::crawl_all_still_skips_undeclared_hidden_dirs(control)cargo fmt --all -- --check: clean.cargo clippy --workspace --all-features -- -D warnings: clean.crawler_npm_e2e125/125, corecrawlers::unit tests 780/780,in_process_alternate_installers42/42.cargo test --workspace --all-features --no-fail-fast: everythingpasses except 11 tests that need things this sandbox doesn't have. Some
need a non-root user (chmod-based "unremovable"/write-failure tests in
repair,in_process_redirect, and corevendor::pypi_*,vlt_heal,copy_tree). The other two aree2e_bun_lockbtests,one of which needs patches-api.socket.dev. None of them touch the npm
crawler. CI is the authority on these.
packages/*+.github/actions/*, hand-staged manifest forleft-pad@1.2.0):before
apply,apply --checkexits 1 andvexwrites nonot_affected.applypatches bothpackages/yand.github/actions/xcopies, andapply --checkthen exits 0.Per-issue checklist
.github/actions/*glob member is patched by agent apply:apply_patches_workspace_member_in_a_hidden_dir,crawl_all_finds_declared_members_in_hidden_dirs.config/toolmember: same two testsapply --check/vexdo not report in-sync /not_affectedwhile the hidden copy is unpatched (agent and hosted vex share this crawl):apply_check_and_vex_see_unpatched_member_in_a_hidden_dir/code-review high findings
Fixed in 3b0c72a:
**pattern spend its 20k-dirbudget in
.git/.nextand drop real members. Build output suchas
.output/serverand hidden worktrees could also become "members",and Bun/pnpm projects were read with npm's dot rule. Now a hidden dir
counts only where a pattern spells its dot.
walk_prunes_name.Bugbot (fixed in a1eb7df): a brace pattern such as
{.github,packages}/**let the walk descend into every hidden dir because the unexpanded remainder
contained a dot. Braces are now expanded before the walk, each alternative
walks from its own literal prefix, and only an alternative that spells a dot
descends into hidden dirs, with one shared budget per pattern.
Not fixed (on purpose):
dot: true) would also treatpackages/.hiddenas amember through plain
packages/*. That case is still not crawled.It's rare, and picking it up would mean walking every hidden tree
under every wildcard, which brings back the budget and build-output
problems above. Main never crawled it either. I can follow up if a
maintainer wants it.
its own members crawled. This is the same existing limit that
Agent-mode npm apply, apply --check and vex skip a declared workspace member whose directory is named build, dist, vendor, tmp, temp or coverage, so its nested copy stays unpatched while VEX attests not_affected #1627's
SKIP_DIRSmembers have, so it isn't new here.Generated by Claude Code