Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,22 @@ jobs:
if-no-files-found: ignore
retention-days: 7

# Issue #124: the interiors went flat twice, once per renderer surface,
# and nothing caught either. This is the guard, and unlike the Pixi one it
# enforces hand-set thresholds rather than recorded frames — see the header
# of the script for why recording them would defeat the purpose.
- name: Interior optics check
run: npm run interior:check

- name: Upload interior optics diff frames
if: failure()
uses: actions/upload-artifact@v7
with:
name: interior-optics-actual-frames
path: tests/fixtures/reference-frames/interior-optics/*.actual.png
if-no-files-found: ignore
retention-days: 7

- name: Run migration client unit tests
run: npm run test:unit

Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,22 @@ jobs:
if-no-files-found: ignore
retention-days: 7

# Issue #124: the interiors went flat twice, once per renderer surface,
# and nothing caught either. This is the guard, and unlike the Pixi one it
# enforces hand-set thresholds rather than recorded frames — see the header
# of the script for why recording them would defeat the purpose.
- name: Interior optics check
run: npm run interior:check

- name: Upload interior optics diff frames
if: failure()
uses: actions/upload-artifact@v7
with:
name: interior-optics-actual-frames
path: tests/fixtures/reference-frames/interior-optics/*.actual.png
if-no-files-found: ignore
retention-days: 7

- name: Run migration client unit tests
run: npm run test:unit

Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ your commit will be blocked if lint fails.
| `npm run lint` | ESLint over `src/*.js` |
| `npm test` | Runs the in-browser test suite headless via Playwright |
| `npm run screenshots` | Captures review screenshots to `screenshots/` |
| `npm run interior:check` | Fails if a wreck or cave interior has gone flat (issue #124) |
| `npm run interior:update` | Re-records that guard's reference frames — never its thresholds |
| `npm run license-check` | Fails if any dependency's license isn't in the allowlist below |

### License allowlist (issue #40)
Expand Down
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,29 @@ New TypeScript UI copy is keyed in `src/app/i18n/catalog.ts`; direct user-facing
| `npm run test:e2e` | Builds and tests the migration Worker plus the full legacy Playwright suite |
| `npm run test:perf` | Captures the opt-in performance baseline |
| `npm run screenshots` | Captures review screenshots (phone + desktop, setup + in-dive) to `screenshots/` via `scripts/screenshots.mjs` |
| `npm run interior:check` | Issue #124 optics guard: measures the legacy client's overhead interiors and fails if one has gone flat (CI-gated) |
| `npm run interior:update` | Re-records that guard's reference frames. Deliberately does **not** touch its thresholds — see the note below |

### Interior optics thresholds (issue #124)

`npm run interior:check` enforces per-scene floors on **per-pixel chroma**
(`mean(max(R,G,B) - min(R,G,B))`) for the torch-lit wreck and cave interiors,
plus two open-water control scenes. It exists because those interiors drifted to
near-neutral grey twice — once per renderer surface — and nothing caught either.

Two things about it are deliberate and easy to undo by accident:

- **The thresholds live in `scripts/interior-optics-check.mjs`, not in a
recorded manifest.** `--update` re-records the reference *frames* only.
Thresholds derived from whatever is currently on screen describe the current
state, and if the current state is the shortfall, recording it locks the
shortfall in — which is the sequencing trap #124 explicitly warns about. If a
change to the interiors is intended, move the specific band and say why.
- **The reference frames are review artefacts, not a pixel diff.** Playwright's
frames are deterministic per platform but not across them, and there is no
linux reference set here. The enforced half is the statistics — which do
travel: the same scenes measured on Windows and on `ubuntu-latest` agree
exactly on every interior, while their pixels do not agree at all.

**CI pipelines** (GitHub Actions):

Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
"prepixi:visual-check": "npm run build",
"pixi:visual-check": "node scripts/pixi-visual-check.mjs",
"prepixi:visual-update": "npm run build",
"pixi:visual-update": "node scripts/pixi-visual-check.mjs --update"
"pixi:visual-update": "node scripts/pixi-visual-check.mjs --update",
"interior:check": "node scripts/interior-optics-check.mjs",
"interior:update": "node scripts/interior-optics-check.mjs --update"
},
"devDependencies": {
"@playwright/test": "^1.62.0",
Expand Down
Loading