Skip to content

feature_scan: stage --out so a write failure keeps the previous report - #8939

Open
Grimkeh wants to merge 1 commit into
ItsNotRexed:mainfrom
Grimkeh:fix/feature-scan-preserve-json
Open

Grimkeh wants to merge 1 commit into
ItsNotRexed:mainfrom
Grimkeh:fix/feature-scan-preserve-json

Conversation

@Grimkeh

@Grimkeh Grimkeh commented Nov 23, 2026

Copy link
Copy Markdown

Summary

Claim: #8504 (comment)

Synthetic; no game files. AI-assisted (Cursor / Composer).

Test plan

  • python3 -I tests/test_feature_scan.py — OK
  • python3 -I tests/test_feature_scan_bad_index.py — 6 OK
  • python3 -I tests/test_feature_scan_order.py — 1 OK

Made with Cursor

Publish through a temp file + replace so a mid-write OSError leaves any prior complete JSON intact.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Grimkeh

Grimkeh commented Nov 23, 2026

Copy link
Copy Markdown
Author

Overlap note: #8984 also edits tools/feature_scan.py (boolean code-base flags). Whichever lands second will need a rebase.

@ne1i

ne1i commented Nov 23, 2026

Copy link
Copy Markdown

Tested e069d05f on Linux, CPython 3.14, CPU only, synthetic inputs, merged onto main 867d922f: pass

  • python -I tests/test_feature_scan.py: WITHOUT tests/test_feature_scan.py rc=1. With only the non-test files reverted to main: , so the new tests exercise the change.
  • compileall and scripts/check_no_game_data.py on the changed files: clean.

The "without" result here is an AttributeError rather than a failed assertion: the new test patches replace_retry, which does not exist on main, so the test proves the helper is imported as much as that the previous report survives. A failed publish driven through the CLI would be the stronger control.

Independent check (not the author). Run by an AI agent (DeepSeek V4.1 Flash) and re-run by the orchestrating session (Claude Code) before posting.

@RAINighty

Copy link
Copy Markdown

Tested e069d05fc merged with main 867d922f0 (clean merge) on Windows 11 (10.0.26300), Python 3.13.15 in UTF-8 mode (PYTHONUTF8=1; venv with the pinned tests/requirements.txt), with llvm-mc 21.1.8 (AMDGPU) and SPIRV-Tools v2026.4 on PATH: pass.

  • tests/test_feature_scan.py with this PR: passes (OK (0 failed checks, 0 failed tests), 0 failed checks, 0 failed tests)). On main: passes (OK (0 failed checks, 0 failed tests), 0 failed checks, 0 failed tests)).
  • Negative control: this PR's test with main's version of tools/feature_scan.py fails (exit code 1), so the new test does catch the problem.
  • Code not reviewed beyond running it. No GPU or game files.

AI-assisted (Claude Code).

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.

3 participants