Move npm-family workspace resolution out of hosted::governing_root: vendor, vex, scan and the crawler all import it
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Start in crates/socket-patch-core/src/hosted/governing_root.rs and list which functions are used outside refusal: member_stray_lock, nested_npm_project, workspace_patterns and the package.json/vlt/Bun root walks. Check their callers in vendor/npm_flavor.rs, vex/discover/mod.rs, crawlers/npm_crawler.rs, patch/redirect/yarnrc.rs and the CLI's scan/discovery.rs. Wait for #1928 and #1971 to land before moving code, since they change these signatures. Done means the moved tests pass unchanged apart from paths and those four modules no longer import crate::hosted::governing_root.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
[agent] Filed by the scheduled architecture audit (audit-core). Register: register.
Kind: refactor. Register ID: A74.
Problem
crates/socket-patch-core/src/hosted/governing_root.rs (3,580 lines, ~1,265 of them production code) holds the npm-family workspace-membership model, but most of it has nothing to do with hosted mode:
member_stray_lock:`` its own doc says it is "shared by the hosted refusal, the vendored refusal (vendor_lockfile_missing) and VEX discovery". It is called from `vendor/npm_flavor.rs` and `vex/discover/mod.rs` (with `member_stray_lock_own_files`).nested_npm_projectandhas_own_npm_family_lock: called only by the CLI'scommands/scan/discovery.rs, for both modes.workspace_patterns:```` called bycrawlers/npm_crawler.rsand `patch/redirect/yarnrc.rs`.- The machinery they all depend on:
package_json_workspace_root,vlt_workspace_root/vlt_workspace_groups/vlt_lists_member,vlt_project_root, the Bun dialect sniff (lock_dialect,bun_workspace_dirs,bun_lockb_config_version) andlisting_workspace/lockless_npm_project.
Only refusal and its message builders (pnpm_settings_elsewhere, cargo_member_refusal, the *_refusal wrappers, HOSTED_CARGO_ROOT_HINT) are hosted policy. Open PRs are pushing more callers into it: #1928 makes vendor call a new public npm_family_governing_root, and #1971 changes workspace_patterns for the crawler and yarnrc. So the vendored flow now depends on hosted::, and vex and the crawler depend on it too.
Proposed change
Once #1928 and #1971 have landed, move the membership model into a module named for what it is, for example formats/npm_workspace.rs (beside #1971's formats::package_json::Workspaces) or utils/npm_workspace.rs (beside utils::pnpm_workspace). That covers member_stray_lock (+ MemberStrayLock, member_stray_lock_own_files), nested_npm_project, has_own_npm_family_lock, the package.json/vlt/Bun root walks and dialect sniffs, and npm_family_governing_root from #1928. Keep hosted/governing_root.rs as the refusal: it maps a governing root to a Refusal and does the cargo, uv and pnpm-settings checks. Update the imports in vendor/npm_flavor.rs, vex/discover/mod.rs, crawlers/npm_crawler.rs, patch/redirect/yarnrc.rs and the CLI's scan/discovery.rs. While moving the code, fold the small copies inside the module:
- the deeper-root-wins choice is written twice (
nearer_rootand thematchinvlt_lock_root); - "path components to
Vec<String>" is written 3× (L644, L739, L997); - the
/-split normalize is written 2× (L842, L1142); canonicalize(..).unwrap_or_else(|_| root.to_path_buf())appears 5× besidecanonical_or_absolute.
Size
3–7 files; mostly moved lines, about +60/−60 net once the copies are folded. The tests (~2,300 lines) move with the code.
Acceptance criteria
- Behavior is unchanged. The moved tests (
nested_npm_project_*,*_stray_*,vlt_*,bun_*,package_json_workspace*) and the remainingrefusaltests (pnpm_*,cargo_workspace_member_is_refused) pass unmodified apart from their paths. vendor,vexandcrawlersno longer import anything fromcrate::hosted::governing_root.
- Ngôn ngữ chính
- Rust
- Star
- 9
- Fork
- 2
- Merge trung bình
- 1 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 309
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của SocketDev/socket-patch
-
Windows unit tests fail on main: pnpm-registry-overrides fixtures are checked out as CRLF (mixes CRLF and LF line endings)Có thể đã có người làm @mikolalysenko đã nhận hôm nay. Đang mởagent:claimed agent:triaged ci-janitor priority:p1
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 85/100
SocketDev/socket-patch#2238 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agent:triaged arch-audit priority:p3 refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
SocketDev/socket-patch#1860 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agent:triaged arch-audit priority:p3 refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
SocketDev/socket-patch#1838 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Nightly: pnpm11_registry_route_is_cleaned_up_when_a_patch_is_not_needed fails on Windows (pnpm records the RUNNER~1 short path as a second importer)Có thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởagent:triaged ci-janitor priority:p1
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 42/100
SocketDev/socket-patch#2235 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Agent mode reports a gem whose installed file was edited as "not installed on this host" / "not found on disk", `apply --check` says to run `apply`, and `rollback` exits 1 with "modified after patching" on every runCó thể đã có người làm @mikolalysenko đã nhận hôm nay. Đang mởagent:claimed agent:triaged bug bughunt pm:bundler priority:p1 ux
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 18/100
SocketDev/socket-patch#2231 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của SocketDev/socket-patch
Issue tương tự
-
area: cli good first issue type: feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
[Bug] Windows Ghidra provider rejects a PATH-only JDK: bare `java.exe` probe fails with Win32 87Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
renaming a provider to a taken name fails with a raw sql errorCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởarea:storage kind:bug priority:p3 ready
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug bugfix
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
storytold/photocraft#16975 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
expo/exact#1716 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày