GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||
GeezerVison is showing github.com — Fix workspace-member refusal for vlt and brace/class globs (#1071, #942) by mikolalysenko · Pull Request #1073 · SocketDev/socket-patch Conversation
|
| Issue | Test | Before fix | After |
|---|---|---|---|
| #1071 | in_process_redirect_pnpm::hosted_scan_from_brace_or_class_glob_workspace_member_refuses (packages/{a,b}, packages/[a-c], {apps,packages}/*, packages/[!b]) |
fail: exit 0, status: success, redirected: 0, redirect_npm_no_lockfile |
pass |
| #1071 | governing_root::tests::workspaces_patterns_expand_braces_and_match_classes |
n/a (new grammar) | pass |
| #942 | in_process_redirect_pnpm::hosted_scan_from_vlt_workspace_member_refuses (string, array and object-of-groups workspaces) |
fail: exit 0, status: success, redirected: 0 |
pass |
| #942 | governing_root::tests::{vlt_workspace_member_is_refused, vlt_workspace_patterns_read_every_shape, vlt_and_package_json_workspaces_need_their_own_lock, nearer_of_vlt_and_package_json_roots_is_named} |
n/a (new code) | pass |
Commands run locally (Linux, as root):
cargo clippy --workspace --all-features -- -D warnings: clean.rustfmt --check on the changed Rust files: clean. CI has no fmt gate, and cargo fmt --all on this toolchain rewrites ~120 files on main, so I didn't run it repo-wide.cargo test -p socket-patch-core --all-features --no-fail-fast: 36/36 integration suites pass. The lib has 5619 passed and 4 failed; the 4 (copy_tree::relax_loop_must_not_traverse_symlinked_root, vlt_heal::an_unremovable_hidden_lock_keeps_every_store_entry, pypi_poetry::wire_write_failure_…, pypi_requirements::wire_failure_rolls_back_…) inject write failures through read-only dirs, which root bypasses. They don't touch this change.cargo test -p socket-patch-cli --all-features for in_process_redirect_pnpm (22/22), in_process_get_hosted_ecosystems, covgap_commands_scan_hosted, hosted_memory_{engine,parity,rollout} and e2e_redirect_rush_sim: all pass. in_process_redirect has 115 passed and 3 failed; the 3 are the same root-only write-failure injections.cargo test --workspace here because linking every CLI test binary ran out of the session's disk. CI runs it.CI on a739151 (contains current main 05ecc6e): 335 success, 5 skipped, 0 failing, ci-ok green. One job, the gradle 6.9.4/jdk11 vendored e2e, failed first time on an infra error: Maven Central cut off a commons-lang3-3.8.1.jar download ("Premature end of Content-Length delimited message body"). This PR doesn't touch JVM code. It passed on one rerun.
🤖 Generated with Claude Code
Note
Medium Risk
Changes hosted-mode preflight behavior for workspace layout detection; incorrect matches could still allow silent no-op pins, though the change moves toward stricter refusal.
Overview
Hosted runs from workspace members now fail closed with redirect_workspace_lockfile_elsewhere in cases that previously matched no root, pinned nothing, and still exited successfully.
Workspace membership matching in governing_root.rs now follows the minimatch-style workspaces grammar npm/yarn/Bun use: brace expansion (including {1..3} / {a..c} sequences, capped at 4096 alternatives) and character classes ([a-c], [!a]), so patterns like packages/{a,b} and packages/[a-c] correctly identify members (#1071).
vlt layouts are handled separately: the nearest ancestor vlt.json whose workspaces (string, array, or grouped object) includes the member, with install governed by root vlt-lock.json, triggers the same refusal and names that root; when both package.json and vlt.json roots apply, the nearer one wins, including vlt’s fallback to package.json workspaces when vlt.json has no workspaces field (#942).
CLI_CONTRACT.md documents the vlt case and glob rules; new integration and unit tests cover brace/class globs and vlt workspace shapes.
Reviewed by Cursor Bugbot for commit a739151. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Assisted-by: Claude Code:claude-opus-5-5
A hosted scan or get run from a workspace member must refuse when the
workspace's lock lives at an ancestor root, or it pins nothing, prints
"Switched 0 packages" and exits 0 while the next install brings in the
unpatched package. Two layouts slipped through that check:
- npm, yarn and Bun roots whose workspaces patterns use brace sets or
character classes (packages/{a,b}, packages/[a-c]). The member
matcher only knew *, ? and **, so it never recognised the member
(#1071).
- vlt workspaces, declared in vlt.json and locked by the root's
vlt-lock.json. Only package.json workspaces were checked (#942).
The member matcher now expands braces (nested sets, {1..3} and {a..c}
sequences) and matches [abc], [a-c], [!a] and [^a] classes, and a vlt
walk refuses a member listed by the nearest matching vlt.json whose
root holds vlt-lock.json. When both a package.json root and a vlt.json
root match, the nearer one is named.
Fixes #1071
Fixes #942
Assisted-by: Claude Code:claude-opus-5-5
05b757e to
2b0d677
Compare
Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
vlt reads the root package.json "workspaces" field when the root vlt.json declares none, and installs those members from the root vlt-lock.json. A hosted run from such a member still pinned nothing and exited 0, because the package.json walk only counted npm, yarn and Bun locks. It now also counts vlt-lock.json when vlt.json has no "workspaces" field (or no vlt.json exists), matching vlt's resolveWSConfig precedence. Refs #942 Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
✅ 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 a739151. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
[agent] One CI failure on a739151, and it isn't from this PR's change:
Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
[agent] Ready for review at
Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Resolve conflicts with #978 (yarn nodeLinker-aware PnP detection) and #1073 (vlt package.json workspaces fallback): - npm_flavor.rs: the single ProjectView router keeps main's stale-loader rule (#975) through live_pnp_marker_with, with the configured linker supplied by the new ProjectView::yarn_node_linker (disk probe on disk, the repository's own .yarnrc.yml chain in memory, as main's in-memory copy did). main's in-memory router copy in view.rs stays deleted. - governing_root.rs: workspace-root locks still come from the governing table's Npm/Yarn/Bun families, plus main's vlt-lock.json fallback when vlt.json declares no workspaces. - hosted/memory tests import detect_npm_lock_flavor_in from npm_flavor. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
main's #1073 taught the npm/yarn/Bun workspaces matcher brace sets, sequences and character classes, inline in governing_root.rs. This branch had moved that matcher into utils/workspace_globs.rs so pnpm's packages: check could share it. The merge keeps the shared module and moves #1073's grammar and its test into it, keeping pnpm's no-dot rule. pnpm still treats brace and class patterns as listing the project (fail closed), as before. CLI_CONTRACT.md keeps both sides: main's vlt and glob wording for the lockfile-elsewhere row and the .socket symlink row, and this branch's pnpm settings rows. Assisted-by: Claude Code:claude-opus-5-5
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Hosted scan/get from an npm workspace member still pins nothing and exits 0 when the root's workspaces glob uses braces or a character class (packages/{a,b}, packages/[a-c]), because the #884 refusal's matcher doesn't support them Hosted scan/get run from a vlt workspace member reports success while pinning nothing: the #598 / #901 member refusal has no vlt.json case
There was an error while loading. Please reload this page.