You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 57923a3
Browse filesBrowse the repository at this point in the historyBrowse files
Keep vendored artifacts a lock references through escaped paths (#2022)
* Keep vendored artifacts a lock references through escaped paths
The vendored revert's keep-check (`any_live_file_references`) did a plain
text match of `.socket/vendor/<eco>/<uuid>` against the live wiring files.
An older composer.lock writes `.socket\/vendor\/composer\/...`, a Windows
checkout may write single or doubled backslashes, and either spelling
missed the match: the check read "unreferenced" and the revert deleted an
artifact the lock still installs from.
Discovery's identity sweep already folds every one of those spellings
(`\uXXXX` / XML-entity decode, then `\/`, `\\` and `\` to `/`). Move that
fold into a pure util, `utils::path_spelling` (`fold_path_spellings`,
plus `mentions_path` for "does this text name this path"), have the sweep
call it unchanged, and route every vendored deletion gate that matched a
vendor path as raw text through it:
- `vendor::common::any_live_file_references` (composer / Maven / NuGet
drift-keep in `revert::finish`)
- `vendor::npm_flavor::lock_text_mentions_uuid` (npm unwired and
post-restore guards, yarn classic and berry post-restore guards)
- `vendor::pypi::pypi_reference_clause` (pypi unwired / post-restore keep)
- `vendor::nuget_feed::config_references` (keeps the lock pin while a
config still routes at the feed)
- the CLI's `scan_vendor_references`, which the orphan sweep (`vendor
--revert`, `scan --prune`, `rollback`, `remove`) uses to decide which
un-ledgered dirs are still wired. It folded `\` to `/` only, so
`\/` became `//` and the reference was lost.
`mentions_path` also matches ASCII case-insensitively. Every change only
widens what counts as a reference, so the failure mode is a kept
artifact, never a deleted one.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Fold every spelling of vendor paths in all keep and refusal checks
Review fixes for #2022:
- One matcher, `utils::path_spelling::PathNeedle`: escapes decoded, every
run of `/` and `\` collapsed to one `/` (so `\\\\` and `\\\/` match), an
exact `contains` fast path, then a single KMP pass over the folded byte
stream with the needle folded once. No copy of the scanned file.
- Keep-vs-delete checks fold ASCII case (`PathNeedle::keep`). Checks that
REFUSE fold case only where the project's file system does
(`vendor::common::refusal_needle`, probed via `utils::fs::folds_case`),
so a differently-cased path on a case-sensitive disk no longer blocks
`vendor --revert`.
- pypi: `unwire_superseded`'s residual check and `superseded_entry` read
through the refusal needle (a `\/` or backslashed leftover was missed and
the old uuid dir then swept as stale); `still_references_artifact`
takes the caller's needle (broad for the pypi-lock drift keep, refusal
for Hatch); `pypi_reference_clause` is broad for the post-restore keep
and refusal-mode for the unwired guard and `vendor --check`; the
requirements residual warning and the uv converged/drift checks use the
broad needle.
- npm: `lock_text_mentions_uuid` uses the refusal needle; its
"textual and EXACT" doc is corrected.
- CLI scan: `canonical_path_text` collapses separator runs; the orphan
sweep reads `scan_vendor_references_any_case` (ASCII case-insensitive,
like the revert keep-checks) while the refusing callers fold case only
on a case-insensitive disk.
- Test doc placement fixed; a different-uuid assertion added.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Fold case in every check whose miss deletes an artifact
Second review round. Round 1 made the "refusal" checks fold ASCII case
only where the project's disk does. Several of them are also deletion
gates: a miss lets the revert delete the artifact. A committed lock or
config is installed on case-folding disks (macOS, Windows) too, where a
re-cased `.Socket/Vendor/...` path does resolve to the artifact, so a
case-sensitive CI run deleted (and committed the deletion of) an
artifact teammates still install from.
These now use `PathNeedle::keep` (every spelling, any case):
- the npm / yarn classic / yarn berry post-restore check
(`lock_text_mentions_uuid`);
- the unwired pypi revert guard;
- the Hatch revert's leftover-reference check (now the same as the
pylock revert's);
- the superseded pypi entry's residual check before the old uuid dir is
swept.
`refusal_needle` remains only where a miss is safe (lifting another
refusal; the `vendor --check` report). The module docs and the
discovery identity-sweep comment say so.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
0 commit comments