Skip to content

Add Web export preset and CI coverage for localStorage persistence path - #327

Merged
joryirving merged 1 commit into
mainfrom
foreman/wl-misospace-windowstead-316/issue-316
Aug 12, 2026
Merged

Add Web export preset and CI coverage for localStorage persistence path#327
joryirving merged 1 commit into
mainfrom
foreman/wl-misospace-windowstead-316/issue-316

Conversation

@itsmiso-ai

Copy link
Copy Markdown
Contributor

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).

@itsmiso-ai
itsmiso-ai requested a review from joryirving as a code owner August 11, 2026 20:46
its-saffron[bot]

This comment was marked as outdated.

@itsmiso-ai
itsmiso-ai force-pushed the foreman/wl-misospace-windowstead-316/issue-316 branch from c891bbb to 10259a6 Compare August 11, 2026 21:26
@its-saffron
its-saffron Bot dismissed their stale review August 11, 2026 21:30

Superseded by a newer automated review for this pull request.

its-saffron[bot]

This comment was marked as outdated.

@itsmiso-ai
itsmiso-ai force-pushed the foreman/wl-misospace-windowstead-316/issue-316 branch from 10259a6 to a8ad89f Compare August 12, 2026 01:20
its-saffron[bot]

This comment was marked as outdated.

@itsmiso-ai
itsmiso-ai force-pushed the foreman/wl-misospace-windowstead-316/issue-316 branch from a8ad89f to a483720 Compare August 12, 2026 03:25
its-saffron[bot]

This comment was marked as outdated.

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
itsmiso-ai force-pushed the foreman/wl-misospace-windowstead-316/issue-316 branch from a483720 to 20cf829 Compare August 12, 2026 03:50

@its-saffron its-saffron Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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: New web job 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: New export-validation-web job 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: Extracts build_local_storage_write_eval, build_local_storage_read_eval, and build_local_storage_remove_eval static helpers, and routes JavaScriptBridge.eval calls through them. The JSON.stringify encoding 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 old JSON.stringify assertions into the same harness. All assert_eq/assert_ne calls use the required 3-arg form.
  • .uid files: 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_ne calls pass the required name argument.
  • 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.cfg and an export-validation-web CI 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.yml web 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.yml job graph was not visible in the provided diff; the new web job's needs: validate dependency should be confirmed by running the manual release workflow once (the CI checks above validate test.yml, not release.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_path in 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.

@joryirving
joryirving merged commit c35a666 into main Aug 12, 2026
8 checks passed
@joryirving
joryirving deleted the foreman/wl-misospace-windowstead-316/issue-316 branch August 12, 2026 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P3] No Web export preset or CI coverage for the localStorage/JavaScriptBridge persistence path

2 participants