Repository navigation
Move BOM handling in 4 more files onto formats::text (#905) - #1191
Merged
Mikola Lysenko (mikolalysenko) merged 2 commits intoOct 9, 2026
Merged
Conversation
Assisted-by: Claude Code:claude-opus-5-5
5 tasks
The vlt.json modifiers probe, the read-only go.mod normalizer, the vendored Gradle settings editor (appended lines and the pluginManagement insertion point) and the shared Pipfile.lock parser spelled out "skip a leading UTF-8 BOM" inline. They now call strip_bom or split_bom, so one leading BOM is encoding everywhere (#905). Zero or one leading BOM behaves as before. A Pipfile.lock that starts with two BOMs is now unparseable (the second is content), the same rule every other reader follows since #1160; it parsed before. PENDING_INLINE_BOMS drops these four files (11 remain, all in files open PRs change). Each former caller gets a 0/1/2-BOM test. Assisted-by: Claude Code:claude-opus-5-5
Mikola Lysenko (mikolalysenko)
marked this pull request as ready for review
October 9, 2026 00:12
Collaborator
Author
|
BugBot review Generated by Claude Code |
Mikola Lysenko (mikolalysenko)
pushed a commit
that referenced
this pull request
Oct 9, 2026
There was a problem hiding this comment.
✅ 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 2f5cd77. Configure here.
Tanmay Singla (Tanmay182003)
approved these changes
Oct 9, 2026
Collaborator
Author
|
Ready for review at head
Slack announcement: not sent this run (Slack send tool unavailable); the next run will retry. Generated by Claude Code |
Mikola Lysenko (mikolalysenko)
deleted the
arch-refactor/905-bom-sites-3
branch
October 9, 2026 02:12
Mikola Lysenko (mikolalysenko)
pushed a commit
that referenced
this pull request
Oct 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
LLM Description written by Claude Code:claude-opus-5-5
Refs #905 (step 3, slice 3). This PR doesn't close the issue: 11 files stay on
PENDING_INLINE_BOMS, and open PRs change every one of them.Summary
Four production files still handled a leading UTF-8 BOM with their own inline code. They now call
formats::text::{split_bom, strip_bom}, and the guard's pending list drops them.patch/redirect/vlt.rsvlt.jsonmodifiersprobestrip_bomvendor/go_mod_edit.rsnormalize_for_read(go.mod / go.work read-only parsers)strip_bomvendor/jvm/gradle.rsappend_line(BOM-only file check),first_statement_offset(never insert before a BOM)strip_bom,split_bom(..).0.len()vendor/lock_inventory/pypi.rsparse_pipfile_lock, the shared reader for the inventory, the hosted Pipenv rewriter, upstream restore and discoverystrip_bom(wastrim_start_matches)Why
doc/04-js-lockfiles.md, the E64 bullet.arch-refactor/*oragent/fix-*PR changes.Behavior
Pipfile.lockthat starts with two BOMs now fails to parse: the second BOM counts as content, which is the rule every other reader has followed since Move BOM handling in 11 more files onto formats::text (#905) #1160. Before this PR,trim_start_matchesdropped both. Consolidate remaining BOM stripping after the pnpm reader failures were fixed #905 asks that any site keeping "any number of BOMs" justify it, and nothing justified it here. The vlt, go.mod and Gradle sites already stripped exactly one BOM, so this is a pure move for them.Deleted
git diff --statover the 5 files).Tests
Each former caller gets a 0/1/2-BOM test:
vlt::tests::modifiers_probe_reads_past_one_vlt_json_bom_onlygo_mod_edit::tests::normalize_for_read_drops_one_leading_bom_onlyjvm::gradle::tests::appended_and_inserted_lines_skip_one_leading_bomlock_inventory::pypi::tests::pipfile_lock_reads_past_one_bom_only. Its two-BOM assertion fails onmain, becausetrim_start_matchesparses the lock; it pins the behavior change above.Results:
cargo clippy --workspace --all-features -- -D warnings: clean.cargo test -p socket-patch-core --lib: 5839 passed and 4 failed. All 4 failures need root, also fail onmainin this sandbox, and pass in CI: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.e2e_vex_lockfile: 343 passed.e2e_vlt: 27 passed.gradle_agent_cli: 52 passed.in_process_redirect_pipenv: 11 passed.Risk
Low. The change is mechanical, and only the double-BOM
Pipfile.lockcase behaves differently.🤖 Generated with Claude Code
https://claude.ai/code/session_01NRDjSfGgExpXELjwUSeZwi
Note
Low Risk
Mechanical refactor with one edge-case behavior change: double-BOM Pipfile.lock files now fail to parse instead of being accepted.
Overview
Continues #905 by routing four call sites through
formats::text::{strip_bom, split_bom}instead of ad hoc UTF-8 BOM handling, and removes those paths fromPENDING_INLINE_BOMS.vlt (
modifiersprobe onvlt.json), go.mod read normalization, Gradle (append_line/first_statement_offset), and Pipfile.lock parsing now share the one leading BOM = encoding rule. vlt, Go, and Gradle behavior is unchanged in practice; Pipfile.lock parsing no longer strips every leading BOM viatrim_start_matches—a second leading BOM is treated as content and parse fails, matching other readers.Each migrated area gets a small test pinning 0/1/2-BOM behavior.
Reviewed by Cursor Bugbot for commit 2f5cd77. Configure here.
Generated by Claude Code