Repository navigation
Commit 73c0c4f
WS3: one lockfile model per ecosystem (#281)
* Drop never-read fields from the rollback covgap fixture
clippy -D warnings rejects the dead before_hash/after_hash fields.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018BYsX2VfVNKHvfFAJnFryc
* Read pnpm-lock.yaml through one format model
formats::pnpm owns the pnpm lock grammar in every generation (shrinkwrap,
5.x block, 5.4/6.0/9.0 flow, Rush nested locks): PnpmLock::parse once, then
entries(), resolves(), wired_refs(), wired_integrity(), vendored_in_use(),
plan_hosted() and the restore_upstream() hook. The redirect rewriter's pnpm
leg, the lock inventory, lockfile discovery, repair's integrity anchor and
flavor sniff, the vendored v9/legacy planners and get's pnpm-PnP probe all
read through it instead of their own walkers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018BYsX2VfVNKHvfFAJnFryc
* Derive every wiring-file list from formats::registry()
The hosted candidate list, repair's vendored-reference search space,
lockfile discovery's vendored-liveness probe, the in-memory engine's root
markers and file ecosystems, the npm flavor probe guard and pnpm detection
now filter one table instead of keeping five parallel lists. The hosted
candidate order is pinned by value.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018BYsX2VfVNKHvfFAJnFryc
* Read Cargo.lock through one format model
formats::cargo owns the lock read model (LockedPackage, v1 [metadata]
checksums, [[patch.unused]], dependency references) behind CargoLock:
entries() for the inventory, packages() for lockfile discovery and the
vendor probes, dependents() for the hosted planner's unpinnable-dependents
refusal (which re-parsed the lock with its own walker), vendored_in_use()
for the vendored-copy claim, and the restore_upstream() hook.
The hosted planner's Cargo.lock splice moves to formats::cargo::hosted with
the line-grammar probes the rewriter reads with (is_locked,
locked_versions), replacing three copies of the header probe.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018BYsX2VfVNKHvfFAJnFryc
* Read composer.lock through one format model
formats::composer owns the entry walk (ComposerLockPackage, now with its
ownership gate wired_to) behind ComposerLock: entries() for the inventory
and packages() for lockfile discovery and the vendored backend. The
vendored backend's entry_is_wired and repair's recorded-fragment reader,
which read dist fields straight off the JSON, go through the entry model.
The hosted planner's byte scanner moves verbatim to
formats::composer::hosted; its equivalence oracle stays green.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018BYsX2VfVNKHvfFAJnFryc
* Read Bundler locks through one format model
vendor::gemfile_lock becomes formats::gem: GemfileLock::parse plus
entries() for the inventory (moved out of lock_inventory::gem, which keeps
only its view I/O and ledger recovery's remote set), the restore_upstream()
hook, and gem_download_url. The hosted planner's lock-source convergence
moves verbatim to formats::gem::hosted.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018BYsX2VfVNKHvfFAJnFryc
* Keep the rollback fixture's hashes for the macOS-only test
The blob-retention test that reads before_hash/after_hash is
#[cfg(target_os = "macos")]; allow the fields as dead elsewhere instead of
dropping them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018BYsX2VfVNKHvfFAJnFryc
* Route the yarn grammar split and bun.lock prelude through formats
formats::yarn owns the one yarn.lock grammar decision: sniff_grammar (the
head sniff the vendor flavor probe, the lock-inventory view and repair's
reference flavor each re-derived) and is_berry_lock (the whole-file check
the hosted rewriters and discovery share; the classic vendored backend's
refusal gate now uses it too, so a BOM'd berry lock no longer slips past
it). formats::bun::BunTextLock is the gate + split + packages parse five
bun.lock readers copied; each keeps its own refusal wording.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018BYsX2VfVNKHvfFAJnFryc
* Read repair's yarn/bun trust anchor through the entry models
wired_vendor_integrity scanned yarn.lock and bun.lock with a six-line
forward window from any line naming the artifact. It now reads the entry
models lockfile discovery uses: live classic blocks' integrity, berry
checksum (yarn 4.0.x bare hex promoted under cacheKey 10c0), and bun's
tarball tuple. That fixes a berry block whose carried dependencies pushed
checksum out of the window (no anchor), a bare-hex checksum (no anchor), a
shadowed classic block being read, and bun's digest-less re-save borrowing
the next package's sha512 (a wrong anchor). Entries that disagree yield no
anchor.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018BYsX2VfVNKHvfFAJnFryc
* Pin gem CHECKSUMS through the shared entry grammar
The hosted writer found the dep's CHECKSUMS row with a regex that only
matched a lowercase terminal sha256, while the discovery reader accepts
uppercase digests, extra digest tokens and bare entries. Any of those fell
through to the insert branch and added a second, conflicting row (which
the reader then treats as no pin). The writer now locates the entry with
formats::gem's split_checksum_entry inside the CHECKSUMS section and
replaces that row in place, keeping its line ending and recording the old
row verbatim for revert.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018BYsX2VfVNKHvfFAJnFryc
* Answer pnpm in-use from the model's parse; drop the placeholder hook
PnpmLock computes its vendored-uuid set at parse time with one walk over
the packages/snapshots block keys (the vendored planners' key grammar,
each line's \r dropped). pnpm_entry_in_use memoizes the same set per lock
bytes instead of keeping LockIndex's copy and the LF-only
vendored_in_use_lines scan. A CRLF lock now answers like its LF twin (in
use) instead of undeterminable; the unwired-revert guard still refuses.
formats::LockModel with its default-unsupported restore_upstream() is
removed: hosted upstream restoration belongs to the ledger-free hosted
workstream and should land on these models, not beside them as a
placeholder.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018BYsX2VfVNKHvfFAJnFryc
* Move the maven pom and nuget config readers into formats
vendor::maven_pom becomes formats::maven and nuget_config's routing reader
becomes formats::nuget; the NuGet config file names and the stat-only
same-file check stay in vendor::nuget_config with the callers' I/O.
Lockfile discovery, their only reader, imports the models directly; the
purity guards follow the files.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018BYsX2VfVNKHvfFAJnFryc
* Splice Cargo.lock at the spans of its one parse
CargoLock::parse now reads the lock with toml_edit's spanned Document and
records each [[package]]'s header, version/source/checksum value spans and
string values, every table header, the [root] strings and the [metadata]
lines. The hosted planner (CargoLock::plan_hosted) splices at those spans,
and the rewriter's is_locked / locked_versions probes answer from the same
parse, so the separate `[[package]]\nname = ...` text grammar, its regexes
and block walkers are gone.
The previous line-grammar planner is kept test-only as the oracle:
randomized v1 and v3/v4 locks (plus twins, [root], sourceless v1, bare
blocks, 1.2k-block locks) plan to identical bytes and FileEdits for every
package, a re-run, and a second package over the result. The one allowed
difference is a lock the old grammar could not read (a final block with no
newline after `version`), which the span planner now finds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018BYsX2VfVNKHvfFAJnFryc
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 28cebf7 commit 73c0c4f
63 files changed
Lines changed: 4532 additions & 3386 deletions
File tree
- crates
- socket-patch-cli/src
- commands
- scan
- vendored_backend
- hosted_memory
- socket-patch-core/src
- formats
- bun
- cargo
- composer
- gem
- maven
- nuget
- pnpm
- yarn
- package_json
- patch/redirect
- upstream
- vendor
- lock_inventory
- vex/discover
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
1498 | 1499 | | |
1499 | 1500 | | |
1500 | 1501 | | |
1501 | | - | |
1502 | | - | |
1503 | | - | |
1504 | | - | |
1505 | | - | |
1506 | | - | |
1507 | | - | |
1508 | | - | |
1509 | | - | |
1510 | | - | |
1511 | | - | |
1512 | | - | |
1513 | | - | |
1514 | | - | |
1515 | | - | |
1516 | | - | |
1517 | | - | |
1518 | | - | |
1519 | | - | |
1520 | | - | |
1521 | | - | |
1522 | | - | |
1523 | | - | |
1524 | | - | |
1525 | | - | |
1526 | | - | |
1527 | | - | |
1528 | | - | |
1529 | | - | |
1530 | | - | |
1531 | | - | |
1532 | | - | |
1533 | | - | |
1534 | | - | |
1535 | | - | |
1536 | | - | |
1537 | | - | |
1538 | | - | |
1539 | | - | |
1540 | | - | |
1541 | | - | |
1542 | 1502 | | |
1543 | 1503 | | |
1544 | 1504 | | |
| |||
1576 | 1536 | | |
1577 | 1537 | | |
1578 | 1538 | | |
1579 | | - | |
| 1539 | + | |
1580 | 1540 | | |
1581 | 1541 | | |
1582 | 1542 | | |
| |||
1645 | 1605 | | |
1646 | 1606 | | |
1647 | 1607 | | |
| 1608 | + | |
1648 | 1609 | | |
1649 | 1610 | | |
1650 | 1611 | | |
| |||
1674 | 1635 | | |
1675 | 1636 | | |
1676 | 1637 | | |
1677 | | - | |
1678 | | - | |
| 1638 | + | |
| 1639 | + | |
1679 | 1640 | | |
1680 | 1641 | | |
1681 | 1642 | | |
| |||
1684 | 1645 | | |
1685 | 1646 | | |
1686 | 1647 | | |
1687 | | - | |
1688 | | - | |
1689 | | - | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
1690 | 1651 | | |
1691 | 1652 | | |
1692 | 1653 | | |
| |||
3983 | 3944 | | |
3984 | 3945 | | |
3985 | 3946 | | |
3986 | | - | |
3987 | | - | |
3988 | | - | |
3989 | | - | |
3990 | | - | |
3991 | | - | |
3992 | | - | |
3993 | | - | |
3994 | | - | |
3995 | | - | |
3996 | | - | |
3997 | | - | |
3998 | | - | |
3999 | | - | |
4000 | | - | |
4001 | | - | |
4002 | | - | |
4003 | | - | |
4004 | | - | |
4005 | | - | |
4006 | | - | |
4007 | | - | |
4008 | | - | |
4009 | | - | |
4010 | | - | |
4011 | | - | |
4012 | | - | |
4013 | | - | |
4014 | | - | |
4015 | | - | |
4016 | | - | |
4017 | | - | |
4018 | | - | |
4019 | | - | |
4020 | | - | |
4021 | | - | |
4022 | | - | |
4023 | | - | |
4024 | | - | |
4025 | | - | |
4026 | | - | |
4027 | | - | |
4028 | | - | |
4029 | | - | |
4030 | | - | |
4031 | | - | |
4032 | | - | |
4033 | | - | |
4034 | | - | |
4035 | | - | |
4036 | | - | |
4037 | | - | |
4038 | | - | |
4039 | | - | |
4040 | | - | |
4041 | | - | |
4042 | | - | |
4043 | | - | |
4044 | | - | |
4045 | | - | |
4046 | | - | |
4047 | | - | |
4048 | | - | |
4049 | | - | |
4050 | | - | |
4051 | | - | |
4052 | | - | |
4053 | | - | |
4054 | | - | |
4055 | | - | |
4056 | | - | |
4057 | 3947 | | |
4058 | 3948 | | |
4059 | 3949 | | |
| |||
5032 | 4922 | | |
5033 | 4923 | | |
5034 | 4924 | | |
5035 | | - | |
5036 | | - | |
5037 | | - | |
5038 | | - | |
5039 | | - | |
5040 | | - | |
5041 | | - | |
5042 | | - | |
5043 | | - | |
5044 | | - | |
5045 | | - | |
5046 | | - | |
5047 | | - | |
5048 | | - | |
5049 | | - | |
5050 | | - | |
5051 | | - | |
5052 | | - | |
5053 | | - | |
5054 | | - | |
5055 | | - | |
5056 | | - | |
5057 | | - | |
5058 | | - | |
5059 | | - | |
5060 | | - | |
5061 | | - | |
5062 | | - | |
5063 | | - | |
5064 | | - | |
5065 | 4925 | | |
5066 | 4926 | | |
5067 | 4927 | | |
| |||
0 commit comments