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 store-copy fold dropping copy writes (#756, #772) by mikolalysenko · Pull Request #774 · SocketDev/socket-patch Conversation
|
| Issue | Test | Without fix | With fix |
|---|---|---|---|
| #756 (apply) | patch::store_copies::regression_tests::apply_reports_a_write_to_an_unpatched_twin_copy |
FAIL (files_patched is []) |
pass |
| #756 (apply, dry run) | …::apply_dry_run_carries_an_unpatched_twin_verify_record |
FAIL | pass |
| #756 (rollback, from the follow-up comment) | …::rollback_reports_a_restore_of_a_patched_twin_copy |
FAIL (files_rolled_back is []) |
pass |
| #756 (end-to-end through the binary, pnpm and vlt layouts) | apply test binary: in_process_npm_multicopy::apply_and_rollback_report_a_write_to_only_a_store_twin |
FAIL: "applied":0,"skipped":1, event skipped / already_patched (the exact symptom in the issue) |
pass: applied: 1, event applied; rollback rolledBack: 1, alreadyOriginal: 0 |
| #772 (one fold, one advisory rule, both directions) | …::apply_over_patched_twins_stays_already_patched, …::rollback_over_original_twins_stays_already_original, …::apply_force_skip_in_a_twin_keeps_an_already_patched_primary, patch::apply::tests::store_copy_fold_carries_ownership_advisories_and_failures, patch::rollback::tests::store_copy_fold_carries_advisories_and_failures, test_rollback_package_patch_new_file_deleted_in_every_pnpm_peer_variant_copy (now also asserts that the heal is reported) |
— | pass |
cargo clippy --workspace --all-features -- -D warnings: clean.rustfmt --check on every touched file: clean. Running cargo fmt --all on main already reformats ~130 unrelated files, so I formatted only the touched code.cargo test -p socket-patch-core --all-features gives 4847 passed and 4 failed. All 4 are permission-based tests that cannot fail a write when running as root, which the sandbox does. They are in untouched files and are green in CI.cargo test -p socket-patch-cli --all-features --lib --bins --test apply --test rollback --test cli --test scan --test get: all green locally.🤖 Generated with Claude Code
Note
Medium Risk
Touches core npm apply/rollback result merging and CLI-reported outcomes; wrong fold rules could mis-tally or mis-label events while still writing files.
Overview
Fixes #756 / #772: when only a non-primary pnpm or vlt peer-variant store copy was patched or rolled back, the CLI could still report already_patched / applied: 0 or already_original / rolledBack: 0 even though disk work happened on the twin.
Apply and rollback still fan out to every store copy, but folding no longer drops each copy's files_verified, files_patched / files_rolled_back, and applied_via. Those entries are merged with copy-qualified on-disk paths so event classification and summaries match reality. Shared logic lives in new patch/store_copies (fan_out, fold, CopyFold for ApplyResult and RollbackResult), replacing duplicated private folds with one advisory rule (ownership notes only; apply --force NotFound skips stay local to the copy).
CLI_CONTRACT now states that files[].path (and rollback verify lists) may use full twin paths, not just manifest keys. Regression coverage spans core unit tests, an in-process CLI multicopy test for pnpm and vlt, and small resolver test adjustments after #605.
Reviewed by Cursor Bugbot for commit 4727a77. Configure here.
Generated by Claude Code
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Assisted-by: Claude Code:claude-opus-5-5
When a package has more than one pnpm or vlt peer-variant store copy, apply and rollback already patch (or restore) every copy, but they only reported what happened to the first one. A run that fixed only a twin copy said "already patched" (applied: 0), and a rollback that restored only a twin said "already original" (rolledBack: 0). Apply and rollback now share one store-copy fan-out and one fold, which merges each copy's per-file records into the result under the copy's on-disk path. The two private folds, which had drifted on which advisories they kept, are gone; both directions now carry only the ownership advisory from a copy. Fixes #756, #772. Assisted-by: Claude Code:claude-opus-5-5
End-to-end regression for #756 through the real binary, on hand-built pnpm and vlt store layouts: apply that patches only a twin copy reports it as applied, and rollback that restores only a twin counts it as rolled back. Documents the copy-qualified file paths in CLI_CONTRACT. 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.
Under --force, a store twin missing a patched file skips it and still succeeds. The fold already dropped that copy's "all files skipped" note, but it carried the skipped file's NotFound record, so a package whose primary copy was already patched was reported as "applied" with no files instead of "already patched". Those records now stay with the copy, like its note. 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.
|
Ready for review. Head is
Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Conflict in tests/apply/in_process_npm_multicopy.rs: both sides appended new tests at the end of the file (this branch's pnpm twin-reporting test, main's #601 bundled-copy and #626 first-party-link tests). Kept both. Co-Authored-By: Claude <[email protected]>
#605 taught the name-keyed npm resolver to probe bundled store trees, so it now finds aliased copies (node_modules/lp) and a nested host's store peers itself. Two vex_consumed tests from #738 assumed that set never held aliases, so main's CI went red after both merged. The tests now feed the alias-free set explicitly to keep covering alias expansion, and also check the resolver's own set reaches the same copies with no duplicates. No production code changes. Assisted-by: Claude Code:claude-opus-5-5 (cherry picked from commit 40dac07)
|
bugbot run 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 4727a77. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
[agent] CI note for whoever is driving this PR now (the burn-down agent's heartbeat at 14:22 is fresh, so I'm not pushing). Why I don't think this PR causes it: this PR only changes the npm pnpm/vlt store-copy fold used by agent-mode apply and rollback, and PDM hosted mode never runs that code. The same workflow passed on this PR's previous head Next steps: re-run that one job once. If it fails again, compare it against a PDM run on current Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
[agent] Second CI failure on Generated by Claude Code |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Burn-down agent: labeled Ready for 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 an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
Share one pnpm/vlt store-copy fan-out between agent apply and rollback, folding each copy's per-file records Agent-mode apply reportsalready_patched / applied: 0 when it actually patched an unpatched pnpm peer-variant copy (the store-copy pass's writes are never reported)
There was an error while loading. Please reload this page.