Skip to content

fix(windows-health): accept UTF-8 BOM in cleanup selection JSON#2

Open
Pitchfork-and-Torch wants to merge 1 commit into
CodeAlive-AI:mainfrom
Pitchfork-and-Torch:fix/windows-cleanup-selection-utf8-bom
Open

fix(windows-health): accept UTF-8 BOM in cleanup selection JSON#2
Pitchfork-and-Torch wants to merge 1 commit into
CodeAlive-AI:mainfrom
Pitchfork-and-Torch:fix/windows-cleanup-selection-utf8-bom

Conversation

@Pitchfork-and-Torch

Copy link
Copy Markdown

Summary

Windows PowerShell Set-Content -Encoding UTF8 (and several editors) write a UTF-8 BOM. apply-cleanup-selection.py used encoding=utf-8, so json.loads rejected BOM-prefixed selection files before validation or dry-run.

Changes

  • Load selection JSON via load_selection_json using utf-8-sig (BOM-safe; no-op for BOM-less files)
  • Same encoding for render-cleanup-plan.py scan data input (same PowerShell footgun)
  • Regression tests: BOM + BOM-less load, and --dry-run on a BOM-prefixed selection

Test plan

  • python test_validate_command.py → 56 passed, 0 failed (includes 2 BOM checks)
  • Manually confirmed dry-run path accepts BOM selection on Windows

Fixes #1

Windows PowerShell Set-Content -Encoding UTF8 writes a BOM that made
apply-cleanup-selection.py fail before dry-run/apply. Load selection
files with utf-8-sig (and the scan data path in render-cleanup-plan)
and cover BOM + BOM-less inputs in the validator regression suite.

Fixes CodeAlive-AI#1
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows cleanup apply rejects UTF-8 BOM selection JSON

1 participant