[PR #1997] tools/ps_helper_probe: validate --json upfront and write atomically (PS-HELPER-PROBE-ATOMIC-JSON) #2004

Open
opened 2026-11-26 21:19:42 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1997
Author: @Ch1mpleo
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: fix/ps-helper-probe-atomic-json


📝 Commits (2)

  • c7e1ec6 tools/ps_helper_probe: validate --json upfront and write atomically (PS-HELPER-PROBE-ATOMIC-JSON)
  • d198dd5 tools/ps_helper_probe: delegate write_json_report to _write_json_atomic to preserve symlinks

📊 Changes

2 files changed (+67 additions, -4 deletions)

View changed files

📝 tests/test_ps_helper_probe.py (+29 -0)
📝 tools/ps_helper_probe.py (+38 -4)

📄 Description

Claimed in the coordination issue as: PS-HELPER-PROBE-ATOMIC-JSON (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7170082835)

What and why

Adds \ alidate_json_path\ and atomic \write_json_report\ (with \NamedTemporaryFile(..., newline="\n")\ +
eplace_retry\ and temp-file cleanup on failure) to \ ools/ps_helper_probe.py, validating --json\ upfront before \measure(), plus regression tests in \ ests/test_ps_helper_probe.py.

Tested

  • \python -m compileall -q tools/ps_helper_probe.py tests/test_ps_helper_probe.py\ — exit 0.
  • \python -I tests/test_ps_helper_probe.py\ — 12 tests (10 passed, 2 hardware tests skipped; Windows 11 x64, Python 3.14.7).
  • \python -I scripts/check_no_game_data.py tools/ps_helper_probe.py tests/test_ps_helper_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)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1997 **Author:** [@Ch1mpleo](https://github.com/Ch1mpleo) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/ps-helper-probe-atomic-json` --- ### 📝 Commits (2) - [`c7e1ec6`](https://github.com/ubiquitarianism/leonida/commit/c7e1ec63af16cd2a7eec41ffab3552e31c259c71) tools/ps_helper_probe: validate --json upfront and write atomically (PS-HELPER-PROBE-ATOMIC-JSON) - [`d198dd5`](https://github.com/ubiquitarianism/leonida/commit/d198dd508ecf9cb9e64ca6141d5fe5efc38272b8) tools/ps_helper_probe: delegate write_json_report to _write_json_atomic to preserve symlinks ### 📊 Changes **2 files changed** (+67 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_ps_helper_probe.py` (+29 -0) 📝 `tools/ps_helper_probe.py` (+38 -4) </details> ### 📄 Description Claimed in the coordination issue as: PS-HELPER-PROBE-ATOMIC-JSON (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7170082835) ### What and why Adds \ alidate_json_path\ and atomic \write_json_report\ (with \NamedTemporaryFile(..., newline="\n")\ + \ eplace_retry\ and temp-file cleanup on failure) to \ ools/ps_helper_probe.py\, validating \--json\ upfront before \measure()\, plus regression tests in \ ests/test_ps_helper_probe.py\. ### Tested - \python -m compileall -q tools/ps_helper_probe.py tests/test_ps_helper_probe.py\ — exit 0. - \python -I tests/test_ps_helper_probe.py\ — 12 tests (10 passed, 2 hardware tests skipped; Windows 11 x64, Python 3.14.7). - \python -I scripts/check_no_game_data.py tools/ps_helper_probe.py tests/test_ps_helper_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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#2004
No description provided.