fix(web): validate library manifest target and identity #12351

Merged
StoneDC merged 4 commits from upstream-pr/12351 into main 2026-11-02 13:37:33 +00:00
StoneDC commented 2026-10-28 10:31:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by StoneDC on 2026-10-28T10:31:03Z.


What

Validates browser library-manifest target and module identity before downloads. The main integration keeps the shared ZIP environment setup and all archive root, Windows-path and reserved-name test steps, together with this PR's worker-manifest test. Both main's tools/test_web.py archive invocations and the manifest test remain registered.

Tested

Updated head 20e26d034d623099ce35ed984c600a3d53b15ea4 integrates recorded main ba627802e2210187d417deb64c8f2fed8e33011f. Windows and Linux: executed the current workflow's Node helper/manifest/directory-writer tests and all three archive scripts against the source archive module, using its pinned ZIP URL. Six browser module syntax checks and tools/test_web.py compilation pass. This validates the actual workflow commands and source modules; it is not a full WebAssembly converter build or browser conversion run. Current-main conventions, whitespace, script registration and main ancestry pass. New hosted runs remain pending until complete.

Earlier implementation evidence and validation (historical revisions)

What

Validate the requested platform and release manifest before downloading a system-library archive. Require the target/hash-addressed archive path and bounded integer sizes to agree with the manifest producer. Keep the existing download, checksum and cancellation checks.

Update both pre-existing archive fixtures to derive their paths from the computed digest. Register worker-manifest.test.mjs in a dedicated step of the existing path-filtered PR Web tests job, as well as the release-time tools/test_web.py command. The PR workflow now executes the manifest regressions without requiring generated WASM artifacts.

Tested

Exact tested head: 24fbd54aa5bf5edcdf662c01b50900c23b94b67f; rebased onto current main 785f7b35d9d26fbf09dc52f225b9d36ec83812b6. This is the explicit main snapshot observed for the final sync; subsequent upstream merges are not included in this claim.

Windows: Python 3.14.3, Node 24.14.1, WinLibs GCC 15.2, CMake 4.3.1. WSL Ubuntu 26.04: Python 3.14.4, Node 22.22.1, GCC 15.2, CMake 4.2.3. Exact committed source archives were tested on the native Linux filesystem. All results below are local results at this head.

  • Execute both actual node --test commands extracted from this head's .github/workflows/web-tests.yml: the existing 15 helper cases plus worker-manifest.test.mjs pass (16 total, no failures/skips) on both OSes. All six production browser modules pass node --check.
  • Build this exact head's real relinker_web target in WSL with Emscripten 6.0.3, Ninja Release and ANYPS5_BUILD_WASM=ON, then run the complete python3 tools/test_web.py --build BUILD command: passed on Linux and Windows. Windows runs the same WSL-built WASM/JavaScript artifacts under native Windows Node; this is not a Windows-host Emscripten build.
  • The complete command runs the 16 Node cases, real ZIP-library archive-root and Windows-path tests, and actual WASM conversion integration. It uses repository-generated ELF/module fixtures and controlled library/network/filesystem endpoints, not a game dump.
  • Current-main conventions with this complete body, whitespace, Python 3.9 grammar and production script-registration audits pass.

The final heads of #12351 (24fbd54aa5bf5edcdf662c01b50900c23b94b67f) and #12353 (0e9dba02ccdea1a4cd2dd58efabbe820ffb03a75) merge cleanly. Their PR-workflow additions occupy separate steps and both registrations survive the merge; neither PR requires the other first. Previous combined-run evidence belongs to its original snapshot and is not substituted for these exact-head runs.

No local macOS/older-Python runtime, full native system-library build, GPU, PS5 or game execution was performed. The archive boundary fixtures do not establish browser filesystem behavior on a real title. Hosted jobs for this new head will be evaluated after publication and are not counted as local passes.

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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5048978101 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12351). Originally posted by [StoneDC](https://github.com/StoneDC) on 2026-10-28T10:31:03Z. --- ### What Validates browser library-manifest target and module identity before downloads. The main integration keeps the shared ZIP environment setup and all archive root, Windows-path and reserved-name test steps, together with this PR's worker-manifest test. Both main's tools/test_web.py archive invocations and the manifest test remain registered. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Updated head `20e26d034d623099ce35ed984c600a3d53b15ea4` integrates recorded main `ba627802e2210187d417deb64c8f2fed8e33011f`. Windows and Linux: executed the current workflow's Node helper/manifest/directory-writer tests and all three archive scripts against the source archive module, using its pinned ZIP URL. Six browser module syntax checks and tools/test_web.py compilation pass. This validates the actual workflow commands and source modules; it is not a full WebAssembly converter build or browser conversion run. Current-main conventions, whitespace, script registration and main ancestry pass. New hosted runs remain pending until complete. <details><summary>Earlier implementation evidence and validation (historical revisions)</summary> ### What Validate the requested platform and release manifest before downloading a system-library archive. Require the target/hash-addressed archive path and bounded integer sizes to agree with the manifest producer. Keep the existing download, checksum and cancellation checks. Update both pre-existing archive fixtures to derive their paths from the computed digest. Register `worker-manifest.test.mjs` in a dedicated step of the existing path-filtered PR Web tests job, as well as the release-time `tools/test_web.py` command. The PR workflow now executes the manifest regressions without requiring generated WASM artifacts. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Exact tested head: `24fbd54aa5bf5edcdf662c01b50900c23b94b67f`; rebased onto current main `785f7b35d9d26fbf09dc52f225b9d36ec83812b6`. This is the explicit main snapshot observed for the final sync; subsequent upstream merges are not included in this claim. Windows: Python 3.14.3, Node 24.14.1, WinLibs GCC 15.2, CMake 4.3.1. WSL Ubuntu 26.04: Python 3.14.4, Node 22.22.1, GCC 15.2, CMake 4.2.3. Exact committed source archives were tested on the native Linux filesystem. All results below are local results at this head. - Execute both actual `node --test` commands extracted from this head's `.github/workflows/web-tests.yml`: the existing 15 helper cases plus `worker-manifest.test.mjs` pass (16 total, no failures/skips) on both OSes. All six production browser modules pass `node --check`. - Build this exact head's real `relinker_web` target in WSL with Emscripten 6.0.3, Ninja Release and `ANYPS5_BUILD_WASM=ON`, then run the complete `python3 tools/test_web.py --build BUILD` command: passed on Linux and Windows. Windows runs the same WSL-built WASM/JavaScript artifacts under native Windows Node; this is not a Windows-host Emscripten build. - The complete command runs the 16 Node cases, real ZIP-library archive-root and Windows-path tests, and actual WASM conversion integration. It uses repository-generated ELF/module fixtures and controlled library/network/filesystem endpoints, not a game dump. - Current-main conventions with this complete body, whitespace, Python 3.9 grammar and production script-registration audits pass. The final heads of #12351 (`24fbd54aa5bf5edcdf662c01b50900c23b94b67f`) and #12353 (`0e9dba02ccdea1a4cd2dd58efabbe820ffb03a75`) merge cleanly. Their PR-workflow additions occupy separate steps and both registrations survive the merge; neither PR requires the other first. Previous combined-run evidence belongs to its original snapshot and is not substituted for these exact-head runs. No local macOS/older-Python runtime, full native system-library build, GPU, PS5 or game execution was performed. The archive boundary fixtures do not establish browser filesystem behavior on a real title. Hosted jobs for this new head will be evaluated after publication and are not counted as local passes. </details> ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: <!-- #PR, or none --> none - [x] Fixes: <!-- issue it closes as Fixes #N, or none --> none - [x] Unblocks: <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> none - [x] GPUs tested: <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> n/a - [x] AI-assisted: <!-- yes / no --> yes
MarcZX10 commented 2026-10-28 11:10:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T11:10:11Z.

Review: APPROVED


Reviewed exact head f0e88751b94a5e9533c7fdaf5fe23573b0c53758. The stricter manifest validation is paired with checksum-addressed fixtures in the pre-existing archive tests, and the new fixture covers malformed manifests, unsupported targets, valid downloads, checksum mismatch, size mismatch, and cancellation. I ran the exact five-file Node suite locally on Node 20.19.2: 16/16 passed. The hosted output-directory test and Ubuntu/Windows relinker plus ASan checks pass; macOS relinker jobs remain queued.

The full tools/test_web.py integration command reached the archive integration step but could not load the generated relinker_wasm.mjs, which is absent from this checkout; the 16 Node tests had already passed. I previously observed three intermittent child-process exits with null code and empty output, followed by 20 successful repetitions. I have not reproduced that failure in the current exact-head run, and I’m recording it as a test-stability follow-up rather than a blocker.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5681671613 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12351#pullrequestreview-5681671613). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-28T11:10:11Z. **Review:** APPROVED --- Reviewed exact head `f0e88751b94a5e9533c7fdaf5fe23573b0c53758`. The stricter manifest validation is paired with checksum-addressed fixtures in the pre-existing archive tests, and the new fixture covers malformed manifests, unsupported targets, valid downloads, checksum mismatch, size mismatch, and cancellation. I ran the exact five-file Node suite locally on Node 20.19.2: 16/16 passed. The hosted output-directory test and Ubuntu/Windows relinker plus ASan checks pass; macOS relinker jobs remain queued. The full `tools/test_web.py` integration command reached the archive integration step but could not load the generated `relinker_wasm.mjs`, which is absent from this checkout; the 16 Node tests had already passed. I previously observed three intermittent child-process exits with null code and empty output, followed by 20 successful repetitions. I have not reproduced that failure in the current exact-head run, and I’m recording it as a test-stability follow-up rather than a blocker.
MarcZX10 commented 2026-10-28 11:37:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T11:37:36Z.

Review: COMMENTED


Re-reviewed exact head 24fbd54aa5bf5edcdf662c01b50900c23b94b67f. The updated fixtures now derive archive paths from their SHA-256 digests, and the workflow contains a dedicated node --test demo/web/tests/worker-manifest.test.mjs step; the regression is therefore included in PR CI independently of the WASM integration job. Locally on Node 20.19.2, that exact command passed 1/1; the existing four-file Web workflow command passed 15/15. node --check demo/web/worker.mjs, git diff --check upstream/main...HEAD, and python3 tools/check_conventions.py --base upstream/main also passed. The refreshed hosted conventions, eligibility, and output-directory jobs are still pending, so I have not submitted a final approval on this head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5681982355 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12351#pullrequestreview-5681982355). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-28T11:37:36Z. **Review:** COMMENTED --- Re-reviewed exact head `24fbd54aa5bf5edcdf662c01b50900c23b94b67f`. The updated fixtures now derive archive paths from their SHA-256 digests, and the workflow contains a dedicated `node --test demo/web/tests/worker-manifest.test.mjs` step; the regression is therefore included in PR CI independently of the WASM integration job. Locally on Node 20.19.2, that exact command passed 1/1; the existing four-file Web workflow command passed 15/15. `node --check demo/web/worker.mjs`, `git diff --check upstream/main...HEAD`, and `python3 tools/check_conventions.py --base upstream/main` also passed. The refreshed hosted conventions, eligibility, and output-directory jobs are still pending, so I have not submitted a final approval on this head.
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
boykopovar/AnyPS5!12351
No description provided.