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 — Move BOM handling in 8 more files onto formats::text (#905) by mikolalysenko · Pull Request #1277 · SocketDev/socket-patch Conversation
|
| Site | Before | After |
|---|---|---|
npm_crawler::parse_yarnrc_modules_folder (.yarnrc) |
trim_start_matches (any number) |
strip_bom |
npm_crawler::bun_workspace_pattern_members_sync |
strip_prefix |
strip_bom |
governing_root::{vlt_workspace_patterns, workspace_patterns} |
strip_prefix ×2 |
strip_bom |
npmrc::plan_npmrc_allow_remote_with |
private BOM const + hand-rolled split |
split_bom; is_js_ws uses formats::text::BOM (npm's JS trim treats U+FEFF as whitespace anywhere) |
upstream::npm::restore_berry (package.json) |
strip_prefix |
strip_bom |
upstream::npm::berry_lookup_registry (npmScopes) |
strip_prefix, then top_level_key strips again |
top_level_key only |
pnpm::workspace::yaml_top_level_value |
strip_bom, then top_level_key strips again |
top_level_key only |
vex::discover::npm (pnpm file: directory package.json) |
trim_start_matches |
strip_bom |
vex::discover::pypi_other::read_toml (Hatch) |
trim_start_matches, then the TOML lexer strips again |
the TOML lexer only |
formats::text gains pub const BOM. PENDING_INLINE_BOMS drops 7 files: these 6, plus formats/pnpm/lines.rs, which was a stale entry (its only BOMs are in tests).
git diff --stat origin/main: 8 files, +186/−38. Production +29/−31, tests +157/−7.
Zero or one leading BOM: no change. A file that starts with two BOMs now reads the second one as content. That is the rule every other reader has followed since #1160 and #1191. Concretely:
.yarnrc first key is no longer read;package.json has unreadable workspaces;file: directory manifest is unreadable, so the copy is left alone like any other unreadable copy;pyproject.toml / hatch.toml are reported unparseable;.yarnrc.yml first key is no longer read.yarnrc_and_bun_workspaces_read_past_one_bom_onlyworkspace_readers_read_past_one_bom_onlynpmrc_splice_keeps_one_bom_and_reads_a_second_as_whitespaceberry_scopes_probe_reads_past_one_bom_only (it also covers yaml_top_level_value)pnpm_file_directory_manifest_reads_past_one_bom_onlyhatch_toml_reads_past_one_bom_onlymain by construction: main strips every BOM, or strips twice. I did not run them against main.cargo clippy --workspace --all-features -- -D warnings: clean.cargo test -p socket-patch-core --lib: 6044 passed. The 4 failures are the known root-only sandbox tests (relax_loop_must_not_traverse_symlinked_root, an_unremovable_hidden_lock_keeps_every_store_entry, wire_write_failure_maps_error_and_leaves_lock_untouched, wire_failure_rolls_back_already_written_files), and they fail on main too.e2e_vex 38, e2e_vex_redirect 33, e2e_redirect_yarn_berry_build 34 and e2e_redirect_bun_build 35 all pass.production_bom_handling_goes_through_the_helpers passes with the shorter allowlist.L. These are line-local swaps. The only behavior change is for double-BOM inputs, which no package manager writes.
🤖 Generated with Claude Code
https://claude.ai/code/session_01JzD96p5wGbQt6V2yfhWEV8
Note
Low Risk
Line-local reader refactors; the only intentional behavior shift is for rare double-BOM inputs, which package managers do not emit.
Overview
Consolidates UTF-8 BOM handling across npm/yarn/pnpm/Hatch readers onto formats::text (strip_bom, split_bom, and a shared BOM constant), replacing ad hoc strip_prefix / trim_start_matches and removing double-strips where a caller and top_level_key or the TOML lexer both peeled a BOM.
Behavior change: only one leading BOM is treated as encoding; a second leading BOM is left as content (so JSON/YAML/TOML may fail to parse, .yarnrc keys may not match, etc.). Normal 0- or 1-BOM files behave as before.
Adds 0/1/2-BOM regression tests for each migrated site and trims PENDING_INLINE_BOMS for the files moved in this slice (#905 step 3).
Reviewed by Cursor Bugbot for commit abe79b9. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Assisted-by: Claude Code:claude-opus-5-5
The yarn .yarnrc and Bun workspace readers in the npm crawler, the vlt and package.json workspace readers in governing_root, the .npmrc allow-remote splice, the berry restore's package.json and npmScopes reads, VEX discovery of pnpm file: directories and Hatch TOML spelled out "skip a leading UTF-8 BOM" inline. They now call strip_bom or split_bom (or leave it to a reader that already skips it: top_level_key, the TOML lexer), so one leading BOM is encoding everywhere (#905). yaml_top_level_value skipped it twice and now leaves it to top_level_key. Zero or one leading BOM behaves as before. A file that starts with two BOMs now reads the second as content, the rule every other reader follows since #1160: a .yarnrc's first key, a Bun package.json, a pnpm file: directory manifest, pyproject.toml/hatch.toml and a .yarnrc.yml first key no longer parse past it. PENDING_INLINE_BOMS drops seven files (4 remain, all changed by open PRs); formats/pnpm/lines.rs was a stale entry. Each former caller gets a 0/1/2-BOM test. 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.
Assisted-by: Claude Code:claude-opus-5-5
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 abe79b9. Configure here.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Assisted-by: Claude Code:claude-opus-5-5
Brings in main through #1277 via #1273. Resolutions: - get keeps the envelope's paidRequired status and drops main's legacy {"status": "paid_required"} emitter; contract_paid_required.rs now pins the envelope row instead of the legacy one. - repair: main removed the diff download path, so the created-file blob pass is gone; the download event keeps details.downloadMode, now always "file". - scan: the envelope arms read main's lockfile_only_count; main's hoisted release-variant narrowing replaces the hosted-only copy in get. - CLI_CONTRACT.md: three-way merged per paragraph; main's new hosted warning rows point at the top-level warnings[] like their neighbours. - tests: main's new tests (cargo takeover refusal, #1127 human prune, bun.lockb already-original rollback) read the envelope shapes. - json_envelope contract tests normalize CRLF so they pass on a Windows checkout. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.