tools/game_run_summary: guard stdout encoding, BOM ints, OSError and RecursionError (reprend #1837) #2746

Merged
leonida/mandy
OreoFR merged 4 commits from reprise-1837 into main 2026-11-30 16:03:00 +00:00

Pull request successfully merged and closed

OreoFR commented 2026-11-30 14:38:32 +00:00

Takes over #1837 (kirigayakazima), whose author has not answered since the request on 2026-11-29 to merge the current main. The original commit e76cabc17 is kept as is, with its author.

What

  • #1837's change to tools/game_run_summary.py: guard the stdout encoding, ints with a BOM, OSError and RecursionError (unchanged).
  • main merged in. After #2028, a run that reached its time limit says so with the seconds at the limit, so the test that expected 45 seconds now writes and expects 60 (tests/test_game_run_summary.py). That is the only new change.

Tests

  • macOS 27.2.1, Apple M5, Python 3.12.16, main b17b22d33 merged: tests/test_game_run_summary.py 12 passed, 15 subtests passed.
  • python -I scripts/check_no_game_data.py on both changed files: clean.
  • Earlier red/green on #1837 itself: see the verification comment there (red 5 failures on main before the fix).

Co-authored with kirigayakazima (original commit kept).

🤖 Generated with Claude Code

Takes over #1837 (kirigayakazima), whose author has not answered since the request on 2026-11-29 to merge the current `main`. The original commit `e76cabc17` is kept as is, with its author. ## What - #1837's change to `tools/game_run_summary.py`: guard the stdout encoding, ints with a BOM, `OSError` and `RecursionError` (unchanged). - `main` merged in. After #2028, a run that reached its time limit says so with the seconds at the limit, so the test that expected 45 seconds now writes and expects 60 (`tests/test_game_run_summary.py`). That is the only new change. ## Tests - macOS 27.2.1, Apple M5, Python 3.12.16, `main` `b17b22d33` merged: `tests/test_game_run_summary.py` 12 passed, 15 subtests passed. - `python -I scripts/check_no_game_data.py` on both changed files: clean. - Earlier red/green on #1837 itself: see the verification comment there (red 5 failures on `main` before the fix). Co-authored with kirigayakazima (original commit kept). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
merzleckeier commented 2026-11-30 14:48:29 +00:00

Independent Linux red/green and CLI timing-boundary check

CachyOS x86-64, Python 3.14.10. I merged a70a976cd onto main b17b22d33 (tree ee6a7553d) and ran the carry's tests/test_game_run_summary.py against both versions of the tool.

  • MEASURED, unit suite. The PR passed all 12 tests. On main, there were three assertion failures (BOM metadata and two invalid-limit subtests) and two errors (the mocked failed reopen and nested JSON cases).
  • MEASURED, actual python -I CLI. I exercised exit codes 124 and 137 at elapsed times 59, 60 and 61 seconds with a 60-second limit. Each metadata file independently used plain UTF-8 or UTF-8 with BOM. main passed 6/24 cases, all with plain UTF-8. The PR passed 24/24. With a BOM in seconds alone and an exit at 59 s, main reported a timeout for both codes. The PR retained the recorded guest exit at 59 s and reported a timeout at and above 60 s.
  • MEASURED, controls. Both negative or zero limits now return usage status 2 (previously status 0). Redirected text with a synthetic Unicode method name worked on both revisions under strict ASCII and UTF-8. The pre-existing stdout guard therefore also works on this main.

A second agent recomputed the CLI results from independent synthetic inputs. AI-assisted with OpenAI Codex.

**Independent Linux red/green and CLI timing-boundary check** CachyOS x86-64, Python 3.14.10. I merged `a70a976cd` onto `main` `b17b22d33` (tree `ee6a7553d`) and ran the carry's `tests/test_game_run_summary.py` against both versions of the tool. - **MEASURED, unit suite.** The PR passed all 12 tests. On `main`, there were three assertion failures (BOM metadata and two invalid-limit subtests) and two errors (the mocked failed reopen and nested JSON cases). - **MEASURED, actual `python -I` CLI.** I exercised exit codes 124 and 137 at elapsed times 59, 60 and 61 seconds with a 60-second limit. Each metadata file independently used plain UTF-8 or UTF-8 with BOM. `main` passed 6/24 cases, all with plain UTF-8. The PR passed 24/24. With a BOM in `seconds` alone and an exit at 59 s, `main` reported a timeout for both codes. The PR retained the recorded guest exit at 59 s and reported a timeout at and above 60 s. - **MEASURED, controls.** Both negative or zero limits now return usage status 2 (previously status 0). Redirected text with a synthetic Unicode method name worked on both revisions under strict ASCII and UTF-8. The pre-existing stdout guard therefore also works on this `main`. A second agent recomputed the CLI results from independent synthetic inputs. AI-assisted with OpenAI Codex.
KelboLive commented 2026-11-30 15:03:26 +00:00

Independent check on Windows (not the author), at a70a976cd.

  • python -I tests/test_game_run_summary.py: 12 tests passed in 0.08 s.

The change is tool-only; the new guard cases (stdout encoding, BOM integers, OSError, RecursionError) run under the standard library on Python 3.12.10. No game files needed.

Environment: Windows 11 Pro 10.0.26200.9711, Python 3.12.10.

AI-assisted: yes (opencode).

Independent check on Windows (not the author), at `a70a976cd`. - `python -I tests/test_game_run_summary.py`: **12 tests passed** in 0.08 s. The change is tool-only; the new guard cases (stdout encoding, BOM integers, OSError, RecursionError) run under the standard library on Python 3.12.10. No game files needed. Environment: Windows 11 Pro 10.0.26200.9711, Python 3.12.10. AI-assisted: yes (opencode).
MoonEyes commented 2026-11-30 15:43:54 +00:00

Verified by MoonEyes (another owner than OreoFR) on head a70a976cd merged with main b17b22d33: Windows 11, Python 3.14.

  • Green: tests/test_game_run_summary.py 12 OK; test_tool_stdout_encoding, test_text_write_line_endings and test_ci_registration OK.
  • Red, tools/game_run_summary.py of main with this test file: 3 failures and 2 errors. The non-ASCII stdout test passes on main already.

AI-assisted (Claude Code).

Verified by MoonEyes (another owner than OreoFR) on head `a70a976cd` merged with `main` `b17b22d33`: Windows 11, Python 3.14. - Green: `tests/test_game_run_summary.py` 12 OK; `test_tool_stdout_encoding`, `test_text_write_line_endings` and `test_ci_registration` OK. - Red, `tools/game_run_summary.py` of `main` with this test file: 3 failures and 2 errors. The non-ASCII stdout test passes on `main` already. AI-assisted (Claude Code).
MoonEyes commented 2026-11-30 16:02:56 +00:00

Merging. Head a70a976cd merges cleanly with main e324ad55e and does not force a rebase of #2566. Red/green on Windows 11 and Linux by two other people. Merged by MoonEyes.

AI-assisted (Claude Code).

Merging. Head `a70a976cd` merges cleanly with `main` `e324ad55e` and does not force a rebase of #2566. Red/green on Windows 11 and Linux by two other people. Merged by MoonEyes. AI-assisted (Claude Code).
Sign in to join this conversation.
No description provided.