Skip to content

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

Merged
rodion-m merged 1 commit into
CodeAlive-AI:mainfrom
Pitchfork-and-Torch:fix/windows-cleanup-selection-utf8-bom
Jul 28, 2026
Merged

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

Conversation

@Pitchfork-and-Torch

Copy link
Copy Markdown
Contributor

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
@rodion-m rodion-m closed this Jul 28, 2026
@rodion-m rodion-m reopened this Jul 28, 2026
@rodion-m
rodion-m merged commit d7c8608 into CodeAlive-AI:main Jul 28, 2026
rodion-m added a commit that referenced this pull request Jul 28, 2026
…lection-utf8-bom

fix(windows-health): accept UTF-8 BOM in cleanup selection JSON
@CodeAlive-AI CodeAlive-AI deleted a comment from gemini-code-assist Bot Jul 28, 2026
@rodion-m

rodion-m commented Jul 28, 2026

Copy link
Copy Markdown
Member

Hi @Pitchfork-and-Torch , thanks for the contribution! Merged.

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

2 participants