Skip to content

fix(e2e): set webServer.cwd to repo root (refs #118)#121

Merged
hyperpolymath merged 1 commit into
mainfrom
fix/118-playwright-webserver-cwd
Jun 1, 2026
Merged

fix(e2e): set webServer.cwd to repo root (refs #118)#121
hyperpolymath merged 1 commit into
mainfrom
fix/118-playwright-webserver-cwd

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Root cause

The Playwright workflow runs tests with working-directory: tools/compat-testing (see .github/workflows/e2e-playwright.yml:70). The webServer.command: 'deno task dev:vite' spawns vite from that same cwd. Vite uses process.cwd() as its project root by default — so it served files from tools/compat-testing/ (which has no index.html, no public/, no assets) rather than the repo root.

The smoking gun in the failed-run logs:

+ Failed to load http://localhost:1984/assets/main/ui.webp.json
+ TypeError: Failed to fetch
    at chunk-QIAJ6TT7.js (vite-bundled PixiJS Loader)
    at async Module.showScreen (Navigation.res.mjs:94)
    at async startApp (Main.res.mjs:101)

The assets exist at the correct paths (public/assets/main/ui.webp.json is checked in) — vite just couldn't serve them because its static-serve root was wrong. Subsequent Connection refused errors in the logs suggest vite then died from the avalanche of 404s.

Fix

Add cwd: '../..' to tools/compat-testing/playwright.config.js so vite starts at the repo root and serves public/, src/, index.html, and vite.config.js correctly.

Also added stdout/stderr: 'pipe' so vite startup logs surface in Playwright's output for future debugging.

What this doesn't fix (yet)

The Firefox-specific CanvasRenderer is not yet implemented error remains. PixiJS v8 has no Canvas2D fallback — Firefox in CI may need WebGL2 enabled explicitly or its WebKit/Firefox versions skipped until headless WebGL2 is reliable. Tracked alongside #118; this PR makes that the only remaining canvas-mount failure mode.

Test plan

  • CI Playwright run on this branch boots vite from repo root.
  • Chromium matrix loads /assets/main/ui.webp.json successfully.
  • tests/game-loads.spec.js:47:3 › page loads without JavaScript errors reports a clean errors array (the asset-404 + chained Connection refused errors should be gone).
  • Canvas-attach test for chromium-1080p / chromium-1440p passes; webkit/firefox WebGL issues remain as a separate sub-issue.

Refs #118.

🤖 Generated with Claude Code

)

When Playwright is invoked with `working-directory: tools/compat-testing`
(per .github/workflows/e2e-playwright.yml), the webServer command spawns
`deno task dev:vite` from that same directory. Vite uses process.cwd() as
its project root by default — without an explicit cwd setting, it serves
files from tools/compat-testing/ instead of the repo root.

The smoking gun in the failed run logs:

  Failed to load http://localhost:1984/assets/main/ui.webp.json
  TypeError: Failed to fetch
    at chunk-QIAJ6TT7.js (vite-bundled PixiJS Loader)
    at async Module.showScreen (Navigation.res.mjs:94)
    at async startApp (Main.res.mjs:101)

The asset files exist at the correct paths in public/assets/main/ — they
just can't be served because vite's static-serve root is wrong.

This commit adds `cwd: '../..'` to webServer config so vite resolves
public/, src/, index.html, and vite.config.js from the actual repo root.
Also adds stdout/stderr: 'pipe' so vite startup logs are visible in
Playwright's output for future debugging.

The Firefox-specific "CanvasRenderer is not yet implemented" error
(PixiJS v8 has no Canvas2D fallback) is a separate WebGL-availability
issue tracked alongside this in #118.

Refs #118.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: hyperpolymath <6759885+hyperpolymath@users.noreply.github.com>
@hyperpolymath hyperpolymath enabled auto-merge (squash) June 1, 2026 18:47
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 1, 2026

🔍 Hypatia Security Scan

Findings: 71 issues detected

Severity Count
🔴 Critical 11
🟠 High 18
🟡 Medium 42

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Issue in boj-build.yml",
    "type": "missing_timeout_minutes",
    "file": "boj-build.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in build-validation.yml",
    "type": "missing_timeout_minutes",
    "file": "build-validation.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in cflite-pr.yml",
    "type": "missing_timeout_minutes",
    "file": "cflite-pr.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in codeql.yml",
    "type": "missing_timeout_minutes",
    "file": "codeql.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in containers.yml",
    "type": "missing_timeout_minutes",
    "file": "containers.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in containers.yml",
    "type": "missing_timeout_minutes",
    "file": "containers.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dco.yml",
    "type": "missing_timeout_minutes",
    "file": "dco.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Issue in dogfood-gate.yml",
    "type": "missing_timeout_minutes",
    "file": "dogfood-gate.yml",
    "action": "flag",
    "rule_module": "workflow_audit",
    "severity": "medium"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

@hyperpolymath hyperpolymath merged commit e9fb346 into main Jun 1, 2026
28 of 31 checks passed
@hyperpolymath hyperpolymath deleted the fix/118-playwright-webserver-cwd branch June 1, 2026 18:53
hyperpolymath added a commit that referenced this pull request Jun 1, 2026
…s already wired (#123)

## Summary

The 2026-03-29 ROADMAP listed 10 \"Near-Term (code ready to build)\"
items. An audit of the actual codebase on 2026-06-01 finds **8 of those
10 items already fully wired** across `src/app/`. The ROADMAP has
drifted from reality — this PR realigns the doc with the code.

No source-code changes. Documentation truthfulness only.

## Changes

- **Current State date** 2026-03-29 → 2026-06-01
- **Current State narrative** refreshed (Jessica + Q gameplay loops,
dual-alert HUD, editor cleanup #116#120, E2E suite operational again
#118#121, #122 follow-up)
- **Near-Term** trimmed from 10 items to 4:
  - Apply balance analyser recommendations (genuinely pending)
  - bestpractices.dev registration (external action)
  - 6 residual Playwright failures (tracks #122)
- editor surface rewrite gated on AS user-module codegen (tracks #116 +
affinescript#228)
- **New \"Completed (2026-06-01 audit)\" section** with the 8 moved
items, each annotated with file:line citations
- **Long-Term** gains a ReScript→AffineScript migration line (parallel
to the existing ReScript 13 line — both tracked separately)

## The 8 audited-as-done items, with citations

| Item | Citation |
|---|---|
| `QPrograms.res` 13 programs, 4-slot deck | `GameLoop.res:27,94` +
`PlayerState.res:57,83,145-149` + `LoadoutScreen.res:191-192` +
`QViewScreen.res:431-438` |
| `JessicaClass` → `PlayerAttributes` | renamed to
`JessicaBackground.background`; `PlayerAttributes.makeWithClass` at
`PlayerAttributes.res:41-51` |
| `MoletaireHunger` gravity | `Moletaire.res:1052-1092` (in `update`) |
| `MoletaireCoprocessors` multipliers |
`Moletaire.res:229,276,441,457,467,476,485,520,555,1034,1051` |
| `JessicaLoadout` 3-slot, 20 items | `GameLoop.res:35,100` +
`PlayerState.res:56,82,117-138` + `LoadoutScreen.res:153,161` — 6
weapons + 8 tools + 6 consumables verified |
| Dual alert HUD | `DualAlertBridge.res` (full bridge) + `HUD.res:76,86`
+ `GameLoop.res:25,93,886-894` |
| Jessica customisation | `JessicaCustomiseScreen.res` (hair, colour,
preview); reachable from `CharacterSelectScreen.res:343` |
| Critical success/failure | `CriticalRoll.res`; applied at
`WorldBuilder.res:1453+` (Jessica) + `QPrograms.res:376-379` (Q) |

## Why this matters

Truthful roadmaps are load-bearing for: (a) prioritisation (don't
re-implement what's already there), (b) contributor onboarding (knowing
what's already wired), (c) cross-estate planning (idaptik's surface is
referenced by issue threads in affinescript / standards / proven for
migration sequencing). The estate has a documented preference for
one-line truthful entries over aspirational lists (see panll#60 ROADMAP
truthfulness pattern).

## Test plan

- [x] Each \"moved-to-done\" claim verified by `grep -rn` over `src/`
- [x] No source-code changes — diff is `ROADMAP.md` only
- [x] DCO sign-off + GPG signature

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: hyperpolymath <6759885+hyperpolymath@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
hyperpolymath added a commit that referenced this pull request Jun 1, 2026
…on (#125)

## Summary

Lands the smallest tractable slice of the #122 a11y follow-up — closes 3
of 4 chromium-1080p accessibility failures unmasked once #121 made the
page actually load.

- `index.html`:
  - `#app` → `role="main"` (lands landmark check)
- `#pixi-container` → `role="application"` + `aria-label="IDApTIK game"`
(canvas inherits via `.closest('[role="application"]')`)
- new `#aria-status` div with `role="status"` + `aria-live="polite"` +
`aria-atomic="true"` (lands live-region check)
- `public/style.css`: standard `.visually-hidden` recipe so the status
region announces without affecting layout

## Test plan

- [ ] `cd tools/compat-testing && pnpm playwright test
tests/accessibility.spec.js --project=chromium-1080p`
- [ ] `accessibility.spec.js:33` (ARIA landmarks are present) → pass
- [ ] `accessibility.spec.js:75` (canvas has accessible name or label) →
pass
- [ ] `accessibility.spec.js:155` (screen reader announcements via
aria-live regions) → pass
- [ ] `accessibility.spec.js:222` (high contrast mode does not break
rendering) → still **fails** (depends on the
5-console-errors-during-load issue tracked in #122 Group C)

## Out of scope

- Wiring `DualAlertBridge.res` to dispatch dual-alert level transitions
into `#aria-status.textContent`. The spec only asserts the live region's
*presence*, not that it carries content. Follow-up tracked in #122.
- Group B (perf threshold) and Group C (console errors) — separate
slices of #122.

Refs #122

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Signed-off-by: hyperpolymath <6759885+hyperpolymath@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant