Skip to content

feat(tools): emit structured patch catalog validation - #12875

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
StoneDC:b41/catalog-json
Nov 5, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
StoneDC:b41/catalog-json

Conversation

@StoneDC

@StoneDC StoneDC commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

What

Adds validate_patch_catalog.py --json with per-entry validity/errors, patch name, ordinal and aggregate counts. Invalid entries continue to be checked after an earlier failure; catalog-level errors have a distinct error object. Text mode and 0/2 status policy are retained.

Implementation basis: Uses the current catalog/patch metadata validators and duplicate-ID rules. Real index.json and TOML patch files include valid and invalid entries, a missing patch and malformed top-level JSON. The fixture verifies all errors and unchanged catalog bytes.

Known limits: This validates local catalog structure without game files. It does not execute relinker verification, prove target hashes match a title, or show that a patch fixes a game.

Existing implementation/schema: tools/validate_patch_catalog.py

Exact topic head 9d6c035b0d2b06bc8d30313a3c158ff28a48544a is one independent commit on main 5454cd2e455994d992aca39335ce60507eeda1eb. The repository overlap checker against 5454cd2e455994d992aca39335ce60507eeda1eb reported no confirmed overlap. It could not complete shared-file comparisons for older PRs already conflicting with main: #674, #1835, #3786, #5021, #9508, #9539. Scoped file diffs were reviewed separately. 5 file changes projected onto main and then combined with this topic without a new conflict; 1 peer file changes already conflict with main and are not claimed automatically mergeable. They do not provide this feature or test matrix. The new test has its own source and registration, with no required landing order. If shared registration code changes before landing, this branch needs refreshed merge and affected test checks. Depends on: none. The 20 independent topics also merged together into tested integration 81a0f73e5972352ba2b50ce53077921c51112273 on the same main.

Tested

Tested topic head: 9d6c035b0d2b06bc8d30313a3c158ff28a48544a. Final combined integration: 81a0f73e5972352ba2b50ce53077921c51112273, main 5454cd2e455994d992aca39335ce60507eeda1eb. Ubuntu/WSL GCC 15.2, CMake 4.2.3, Python 3.14.4; Windows MinGW GCC 15.2, CMake 4.3.1, Python 3.14.3.

python tools/tests/test_catalog_json.py: 2 tests passed on each platform, no skips. The focused registered CTest tools_catalog_json passed on both platforms. A mutation in the actual tool code was rejected by this fixture.

cmake --build <full-linux-build> --parallel 8: full Linux default product build passed, including a final build at the integration above. Windows used the full configuration and built the affected libc/test targets and relinker with --parallel 8; a complete default Windows build is not claimed. ctest --test-dir <build> -R "^(tools_sanitizer_json|tools_annotation_symbols_json|tools_compile_plan|tools_catalog_json|tools_nid_offline|tools_audit_strict_partial|tools_intervals_complete|tools_pad_preview|tools_release_notes_check|tools_progress_diff_json|guest_memmove_snapshot|guest_memcpy_protected|guest_memcmp_protected|guest_span_protected|guest_substring_protected|guest_tokenizer_protected|guest_strncpy_protected|guest_strncat_protected|guest_wmemmove_snapshot|guest_wide_length_protected)$" -j 8 -V --output-on-failure: 20/20 passed on each platform, zero skips. Conventions, whitespace, script registration and the public-header audit passed. No PS5/title execution or GPU validation protocol was run; macOS and hosted full-build CI are not reported as passed.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1835 CMakeLists.txt
PR 5021 CMakeLists.txt
PR 7642 CMakeLists.txt
PR 9508 CMakeLists.txt
PR 10193 CMakeLists.txt
PR 13486 CMakeLists.txt
PR 13928 CMakeLists.txt
PR 13929 CMakeLists.txt
PR 14212 CMakeLists.txt

@malekaifa malekaifa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed exact head 9d6c035 against current main bb04a4f. The current-main merge-tree and git diff --check are clean. On Windows Python 3.12, test_catalog_json passes 2/2 and the existing test_validate_patch_catalog suite passes 15 tests with one platform skip; WSL Python 3.12 passes the same 2 + 15 tests with no validator skip. I specifically checked the machine-readable boundary that can be tricky here: the NaN catalog fixture emits standard JSON with patch:null, and mutating the safe patch projection back to the raw value makes the strict-JSON regression fail; restoring the exact code returns it green. The use of allow_nan=False is therefore defense-in-depth on top of the safe projection. Hosted eligibility, conventions, intake, labels, Ubuntu/Windows relinker, Windows and ASan are green; only generic macOS relinker jobs are queued. I found no blocking issue in this scoped structured-validation feature.

@oneandonlydean oneandonlydean self-assigned this Oct 29, 2026
@github-actions github-actions Bot added the build label Oct 29, 2026
@oneandonlydean
oneandonlydean merged commit a4a4cb9 into boykopovar:main Nov 5, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants