Add Web export preset and CI coverage for localStorage persistence path - #327
Merged
Merged
Conversation
itsmiso-ai
force-pushed
the
foreman/wl-misospace-windowstead-316/issue-316
branch
from
August 11, 2026 21:26
c891bbb to
10259a6
Compare
its-saffron
Bot
dismissed
their stale review
August 11, 2026 21:30
Superseded by a newer automated review for this pull request.
itsmiso-ai
force-pushed
the
foreman/wl-misospace-windowstead-316/issue-316
branch
from
August 12, 2026 01:20
10259a6 to
a8ad89f
Compare
itsmiso-ai
force-pushed
the
foreman/wl-misospace-windowstead-316/issue-316
branch
from
August 12, 2026 03:25
a8ad89f to
a483720
Compare
Fixes #316 by adding first-class Web export support so the localStorage/JavaScriptBridge persistence path is exercised by CI the same way the Linux/Windows/macOS paths already are. export_presets.cfg * Add [preset.3] "Web" with the standard HTML5 export options (extensions/thread support off, desktop VRAM compression, PWA off, canvas resize policy 2). export_path defaults to build/windowstead.html; CI overrides this with explicit per-job paths so each workflow's export and verification target the same location (closing the path-mismatch blocker the prior PR review flagged between test.yml and release.yml). .github/workflows/test.yml * New export-validation-web job mirrors the existing Linux/Windows/ macOS validation jobs (load-godot-toolchain → download Godot → verify SHA256 → install export templates → headless export). * Exports to ./build/export-validation/web/windowstead.html. * Verifies windowstead.{html,pck,wasm,js} are all present and non-empty, addressing the review's "info" finding that the prior attempt only checked .html/.pck. .github/workflows/release.yml * New web job (runs on ubuntu-latest, needs: validate) follows the same Godot setup pattern as the existing platform jobs. * Exports to ./build/release/web/windowstead.html. * Asserts all four expected artifacts (.html/.pck/.wasm/.js) exist before zipping — addressing the review's "minor" finding that the prior release.yml would happily ship whatever happened to land in build/web. Uses Python's zipfile to package only the expected artifacts. * Uploads build/windowstead-web.zip via softprops/action-gh-release@3d0d988 # v3, the action SHA already pinned by the existing linux/windows/macos release jobs (not the fabricated actions/upload-artifact SHA the prior attempt used, which is what blew up CI). scripts/game_state.gd * Hoist the three localStorage eval-string templates (write/read/remove) into static build_local_storage_*_eval helpers and route every JavaScriptBridge.eval call site through them. Same JSON.stringify-based escaping as before — just centralized so tests can assert on the exact eval'd strings without invoking JavaScriptBridge. tests/test_local_storage_xss.gd * Extend the XSS coverage to the actual eval'd statements, not just JSON.stringify in isolation (the optional second half of the issue's acceptance criteria). New flow_* tests build the eval strings via the new game_state.gd helpers for XSS-flavored keys and payloads (single/double quotes, backticks, backslashes, newlines, '; alert(1); //, etc.) and assert that the embedded JSON args round-trip back to the original values via JSON.parse_string — the property that prevents a future #291-style regression from shipping undetected. Fixes #316 Signed-off-by: Saffron <263493777+itsmiso-ai@users.noreply.github.com>
itsmiso-ai
force-pushed
the
foreman/wl-misospace-windowstead-316/issue-316
branch
from
August 12, 2026 03:50
a483720 to
20cf829
Compare
There was a problem hiding this comment.
AI Automated Review
Full PR review.
Analysis engine: dsv4f@https://litellm.jory.dev/v1 (openai) — primary route
Recommendation
Approve. This PR satisfies issue PR 316's acceptance criteria: it adds a Web export preset, an export-validation-web CI job, and extends the localStorage XSS tests to build and assert the exact eval'd statements. CI reports all checks green, including "Export validation (Web)".
Change-by-Change Findings
.github/workflows/release.yml: Newwebjob mirrors the existing export jobs (checksum-verified Godot and template download, headless Web export, artifact verification, zip, and release asset upload). Consistent with the repo's release pattern..github/workflows/test.yml: Newexport-validation-webjob performs a headless Web export and requires all four artifacts (.html,.pck,.wasm,.js) to be present and non-empty. This matches the issue's requested artifact-presence check.export_presets.cfg: Adds[preset.3]named "Web"; the CI--export-release "Web"matches the preset name. No user-controlled paths are introduced.scripts/game_state.gd: Extractsbuild_local_storage_write_eval,build_local_storage_read_eval, andbuild_local_storage_remove_evalstatic helpers, and routesJavaScriptBridge.evalcalls through them. TheJSON.stringifyencoding is preserved, so the quote/backslash/backtick breakout protection from PR 306/PR 320 remains intact.tests/test_local_storage_xss.gd: Adds round-trip and single-call-shape assertions for the generated eval statements and refactors the oldJSON.stringifyassertions into the same harness. Allassert_eq/assert_necalls use the required 3-arg form..uidfiles: Auto-generated Godot 4.7.1 UID sidecar files; expected with the recent toolchain bump.
Sources
- PR PR 327 metadata and body ("Fixes PR 316")
- Linked issue PR 316 and its acceptance criteria
- PR diff
- CI status: Headless smoke test, Script test suite, Export validation (Linux/Windows/macOS/Web), macOS validation — all success
- AGENTS.md / CLAUDE.md repository standards
Standards Compliance
- New tests comply with the AGENTS.md testing trap: all
assert_eq/assert_necalls pass the requirednameargument. - The persistence change includes a corresponding test, satisfying CONTRIBUTING.md.
- The release workflow changes follow the existing tag-driven, checksum-verified pattern used by the Linux/Windows/macOS jobs.
- No deviation from documented repository conventions was detected.
Linked Issue Fit
- Acceptance: "Add a Web export preset to
export_presets.cfgand anexport-validation-webCI job (headless export + artifact presence check, mirroring the existing platform jobs)" — done. - Acceptance (optional): "extend the XSS test to build and assert the exact eval'd statement strings produced by
_local_storage_write/_local_storage_read/clear_game" — done via the new static helper functions and additional test flows. - The extra
release.ymlweb artifact upload addresses the problem statement's "release.yml uploads no web artifact" and is consistent with the issue.
Tool Harness Findings
- The tool harness section contains only a placeholder ("Tool harness planning pending") and produced no actionable findings. CI status from the commit API was used instead and is green.
Unknowns or Needs Verification
- The full
release.ymljob graph was not visible in the provided diff; the newwebjob'sneeds: validatedependency should be confirmed by running the manual release workflow once (the CI checks above validatetest.yml, notrelease.yml). - CI validates that Web artifacts are produced, but does not run the game in a browser; the localStorage/JavaScriptBridge runtime path remains unexercised in CI. This matches the issue's requested artifact-presence check and is not a blocker.
Must-Check Notes
- Path traversal: no user-controlled path handling is introduced in this diff; all file paths are fixed CI output paths and the static
export_pathin the preset. - Edge-case paths (null bytes, symlinks): not applicable here — this PR does not add filesystem path construction from user input or modify desktop save-path handling.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No Web export preset or CI coverage for localStorage/JavaScriptBridge persistence path
Fixes #316
Opened by foreman on review GO (workload wl-misospace-windowstead-316).