Skip to content

Delete the dead hosted-vlt redirect-ledger helpers (#782) - #1141

Merged
Mikola Lysenko (mikolalysenko) merged 3 commits into
mainfrom
arch-refactor/782-dead-vlt-ledger-helpers
Oct 8, 2026
Merged

Mikola Lysenko (mikolalysenko) merged 3 commits into
mainfrom
arch-refactor/782-dead-vlt-ledger-helpers

Conversation

@mikolalysenko

@mikolalysenko Mikola Lysenko (mikolalysenko) commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

LLM Description written by Claude Code:claude-opus-5-5

Refs #782 (slice 1; the issue stays open for the items whose files open PRs change).

Summary

Deletes the hosted-vlt helpers that merged and healed from the pre-v5 redirect ledger. #277 removed their last production callers (rebase_vlt_edits and the ledger heal), and v5 never writes that ledger. Also gates the test-only jvm::apply::read_project_file behind #[cfg(test)].

Why

  • Issue #782, register row E58 (register), living document part 3 (hosted, "vlt hosted" row and the E58 bullet).
  • These pub functions read as if hosted vlt still heals from the redirect ledger. That misleads anyone working on hosted rollback (E33/E45).
  • Leverage: B 0, U 0, D ≈1 (194 dead production lines), R L. After Make the vendored-to-hosted takeover atomic #1039 merged, this was the only backlog item whose files no open arch-refactor/* or agent/fix-* PR changes.

What changed

  • patch/redirect/vlt.rs: deleted edit_dep_id, lock_node_ids, claims_key, carried_pin_original, carried_pin_ids, carried_pin_lines, same_slots, slot_value and recorded (the whole former "revert" section), along with their tests (claims_stop_at_the_version_boundary, a_superseding_edit_keeps_the_pristine_slots_of_a_carried_pin, the carried-brotli tail of the 1.3 brotli test and the claims_key loop) and the vlt_edit test helper.
  • patch/redirect/vlt_heal.rs: deleted ledger_targets and its three tests. LedgerTarget's docs now describe lock_targets, the only constructor left, and say that record is always None. Removing that field means editing commands/scan/hosted/vlt.rs, which open PRs change, so it is left for a follow-up.
  • New test lock_targets_name_every_owned_instance_of_the_purls. It covers what the deleted ledger_targets tests used to: peer contexts, slot [0] flags, the purl filter and the absent record. lock_targets had no unit test of its own.
  • vendor/jvm/apply.rs: read_project_file is now #[cfg(test)] pub(crate). All of its callers are tests in jvm/{mod,gradle,scala_cli}.rs.

Deleted

git diff --stat origin/main: 3 files, +49 / −344.

  • Production: +13 / −194.
  • Tests: +36 / −150.

Behavior

None. Every deleted item had no production caller, which the build and clippy confirm. Wrappers (npm/, pypi/, gem/) are unaffected.

Test evidence

  • cargo clippy --workspace --all-features -- -D warnings: clean.
  • cargo test -p socket-patch-core --all-features --lib: 5772 passed, 4 failed. The failures are the known root-sandbox ones that also fail on main (copy_tree::relax_loop_must_not_traverse_symlinked_root, vlt_heal::an_unremovable_hidden_lock_keeps_every_store_entry, pypi_poetry::wire_write_failure_maps_error_and_leaves_lock_untouched, pypi_requirements::wire_failure_rolls_back_already_written_files). They chmod files, so they pass in CI.
  • cargo test -p socket-patch-cli --all-features --test mode_migration_vlt --test in_process_rollback_hosted --test e2e_vlt --test e2e_redirect_vlt_build: 26 + 28 + 27 + 27 passed, 0 failed (the ignored real-vlt e2e tests run in CI).
  • rustfmt was run on the three touched files only; all three were rustfmt-clean on main.
  • CI on 948939c: 98 of 100 checks green. The two red ones are coverage-docker (sbt), which failed with a transient Maven Central 404 while building its Docker image, before any test ran, and the ci-ok aggregate it fed. Those jobs have been re-run once.

Risk

Low: only deletions and a cfg(test) gate.

Remaining in #782

VendorEntry::committed_artifact_intact (vendor/state.rs), go_sum_edit::remove_lines (#1103), UpstreamClient::seed_rubygems_sha256 and cargo_tag::copy_manifest_tag, plus the folded #746, #800 and #801 items. Each is in a file that an open PR changes.

🤖 Generated with Claude Code


Note

Low Risk
Deletion-only and a test-only visibility gate; no production callers of removed APIs.

Overview
Removes dead hosted-vlt redirect-ledger code left over after v5 stopped writing that ledger and #277 dropped its merge/heal callers. Hosted vlt rewrite/heal paths now rely on the lock itself (lock_targets), not ledger edits.

In patch/redirect/vlt.rs, deletes ledger/revert helpers (edit_dep_id, lock_node_ids, claims_key, carried_pin_*, recorded, slot comparison helpers) and their unit tests; trims unused vlt_lock_text imports. The hosted rewriter behavior is unchanged.

In patch/redirect/vlt_heal.rs, removes ledger_targets and three ledger-focused tests; documents that LedgerTarget is only built via lock_targets with record always None. Adds lock_targets_name_every_owned_instance_of_the_purls to cover peer contexts, flags, and purl filtering.

In vendor/jvm/apply.rs, read_project_file is #[cfg(test)] pub(crate) because only JVM planner tests call it.

Reviewed by Cursor Bugbot for commit 948939c. Configure here.


Generated by Claude Code

Assisted-by: Claude Code:claude-opus-5-5
@mikolalysenko Mikola Lysenko (mikolalysenko) added refactor Structural change: duplicated code or logic, missing abstraction, layering, dead code arch-refactor PR opened by the scheduled architecture refactor routine labels Oct 8, 2026
The v5 consolidation stopped writing the hosted redirect ledger, so
the vlt helpers that merged and healed from it lost every production
caller: edit_dep_id, lock_node_ids, carried_pin_original,
carried_pin_ids, carried_pin_lines, same_slots, recorded, claims_key
and vlt_heal::ledger_targets. They read as if hosted vlt still heals
from that ledger, which misleads work on hosted rollback. The rollback
heal goes through lock_targets only.

read_project_file is only called from tests; gate it with cfg(test)
so it no longer ships in release builds. No behavior change.

Refs #782.

Assisted-by: Claude Code:claude-opus-5-5
With ledger_targets gone, lock_targets is the only source of vlt heal
targets, and it had no unit test of its own. Cover peer contexts, the
slot [0] flags, the purl filter and the absent record, which the
deleted ledger_targets tests used to exercise.

Refs #782.

Assisted-by: Claude Code:claude-opus-5-5
@mikolalysenko
Mikola Lysenko (mikolalysenko) marked this pull request as ready for review October 8, 2026 15:16
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

BugBot review


Generated by Claude Code

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

[agent] coverage-docker (sbt) failed while building tests/docker/Dockerfile.sbt: curl got a 404 from Maven Central for mill-dist-0.12.17-mill.sh before any test ran. This PR doesn't touch the Dockerfile or anything sbt/Mill, and the same job on main (823810a) passed at 15:18Z with the same pinned URL, so it is a transient registry miss. No fix to port. I'll re-run the failed job once when the workflow run completes.


Generated by Claude Code

@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

bugbot run


Generated by Claude Code

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for 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 948939c. Configure here.

@mikolalysenko Mikola Lysenko (mikolalysenko) added the Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review label Oct 8, 2026
@mikolalysenko

Copy link
Copy Markdown
Collaborator Author

Burn-down agent: labeled Ready for review at 948939c.

  • CI: all non-skipped checks green on this head (ci-ok success).
  • Bugbot: re-reviewed 948939c on request, no findings; no unresolved review threads.
  • Mergeable: yes (merges cleanly with current main).

Generated by Claude Code

@mikolalysenko
Mikola Lysenko (mikolalysenko) added this pull request to the merge queue Oct 8, 2026
Merged via the queue into main with commit c777437 Oct 8, 2026
635 of 637 checks passed
@mikolalysenko
Mikola Lysenko (mikolalysenko) deleted the arch-refactor/782-dead-vlt-ledger-helpers branch October 8, 2026 20:36
Mikola Lysenko (mikolalysenko) pushed a commit that referenced this pull request Oct 9, 2026
Resolve conflicts with #1031 (scan --apply/--vendor, get --no-apply and
download/gc alias removal):
- docs/migrating-to-v5.md: keep both removal tables' rows (#1031's
  spellings plus --download-mode/SOCKET_DOWNLOAD_MODE) and the
  blobs-only archive note.
- CLI_CONTRACT.md: keep the --download-mode removal paragraph, take
  main's --mode agent/vendored wording, drop diff-strategy text; repair
  events row renamed to `repair` with the file-only Downloaded details.
- tests/cli_parse_repair.rs: keep the --download-mode rejection test,
  drop the gc alias tests main removed; header covers both removals.

Fix merge fallout: drop the uuid argument from a new schema.rs test's
apply_package_patch call (the PR removed that parameter), and remove an
unused FileEdit import in vlt_heal.rs tests left by #1141.

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch-refactor PR opened by the scheduled architecture refactor routine Ready for review Agent-verified: mergeable, CI green, Bugbot clean — awaiting human review refactor Structural change: duplicated code or logic, missing abstraction, layering, dead code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants