tools/ds_permute_probe: write --json report atomically (DS-PERMUTE-PROBE-ATOMIC-JSON) #2000

Open
github-bot wants to merge 1 commit from github-bot/gh-2000 into main AGit
Owner

@⁠Ch1mpleo on GitHub · 2026-11-25 17:55 UTC · original
Ch1mpleo:fix/ds-permute-probe-atomic-json → main · +31 −3 · 2 files · 1 commits · open

Claimed in the coordination issue as: DS-PERMUTE-PROBE-ATOMIC-JSON (#1608)

What and why

Updates \ ools/ds_permute_probe.py::write_json_report\ to write via a sibling \ empfile.NamedTemporaryFile(..., encoding="utf-8", newline="\n")\ and \os.replace\ (with temp-file cleanup on failure), so an existing report is never truncated on error. Updates the OSError test and adds an atomic-replace regression test in \ ests/test_ds_permute_probe.py.

Tested

  • \python -m compileall -q tools/ds_permute_probe.py tests/test_ds_permute_probe.py\ — exit 0.
  • \python -I tests/test_ds_permute_probe.py\ — 8 tests, OK (Windows 11 x64, Python 3.14.7).
  • \python -I scripts/check_no_game_data.py tools/ds_permute_probe.py tests/test_ds_permute_probe.py\ — exit 0.

GPUs tested: n/a (CPU-only Python tool & unit tests)

AI-assisted: yes

Checklist

  • Based on current \main\ and merges cleanly (a conflicting pull request is labeled
    eeds rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of \docs/design.md, with how it was confirmed. (n/a — no translator change)
**@⁠Ch1mpleo** on GitHub · 2026-11-25 17:55 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2000) `Ch1mpleo:fix/ds-permute-probe-atomic-json` → `main` · +31 −3 · 2 files · 1 commits · open Claimed in the coordination issue as: DS-PERMUTE-PROBE-ATOMIC-JSON (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608) ### What and why Updates \ ools/ds_permute_probe.py::write_json_report\ to write via a sibling \ empfile.NamedTemporaryFile(..., encoding="utf-8", newline="\n")\ and \os.replace\ (with temp-file cleanup on failure), so an existing report is never truncated on error. Updates the OSError test and adds an atomic-replace regression test in \ ests/test_ds_permute_probe.py\. ### Tested - \python -m compileall -q tools/ds_permute_probe.py tests/test_ds_permute_probe.py\ — exit 0. - \python -I tests/test_ds_permute_probe.py\ — 8 tests, OK (Windows 11 x64, Python 3.14.7). - \python -I scripts/check_no_game_data.py tools/ds_permute_probe.py tests/test_ds_permute_probe.py\ — exit 0. GPUs tested: n/a (CPU-only Python tool & unit tests) AI-assisted: yes ### Checklist - [x] Based on current \main\ and merges cleanly (a conflicting pull request is labeled \ eeds rebase\). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of \docs/design.md\, with how it was confirmed. (n/a — no translator change)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:14:20 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2000/head:github-bot/gh-2000'
git switch 'github-bot/gh-2000'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2000'
git switch 'github-bot/gh-2000'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2000'
git switch 'github-bot/gh-2000'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2000'
git switch 'main'
git merge --squash 'github-bot/gh-2000'
git switch 'main'
git merge --ff-only 'github-bot/gh-2000'
git switch 'main'
git merge 'github-bot/gh-2000'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.