Import the 2026-10-09 source release, Fastify/SQLite backend, restored source assets, and analytics-enabled server build. Replace files from the previous release while retaining the existing repository history. Make builds portable across Windows and Linux, configure local startup, normalize Windows static asset paths, and fix test fixture cleanup and file URL handling. Exclude local environment settings, databases, dependencies, validation output, and TypeScript build cache from version control. Validation: npm ci, static and server builds, 106 arrival tests, and actual local HTTP checks passed. The full suite passed 467 of 470 tests; three tests still require QA fixtures omitted from the supplied release, documented in README-서버실행.md.
31 lines
2.3 KiB
JavaScript
31 lines
2.3 KiB
JavaScript
import assert from 'node:assert/strict';
|
|
import { readFile } from 'node:fs/promises';
|
|
import * as THREE from 'three';
|
|
import { DEPTH_REFRACTION } from '../src/constants/depth.ts';
|
|
|
|
const shader = await readFile(new URL('../src/shaders/mosaic.frag', import.meta.url), 'utf8');
|
|
const main = await readFile(new URL('../src/main.ts', import.meta.url), 'utf8');
|
|
const media = main.slice(main.indexOf('function applyMedia('), main.indexOf('function setDepth('));
|
|
const ordinaryMedia=media.replace(/if\(incoming&&!video\)\{[^}]*\}else incoming\?\.dispose\(\);/,'');
|
|
assert.doesNotMatch(ordinaryMedia, /photo(?:Zoom|PanX|PanY)\s*=/, 'ordinary media replacement preserves manual framing');
|
|
assert.match(media,/if\(incoming&&!video\)\{[^}]*photoZoom=1;photoPanX=photoPanY=0/,'only explicit experiment acceptance starts its peeking placement');
|
|
assert.match(shader, /sceneHit=refineSceneHit\(gh,normalize\(mix\(i,curvedRay,strength\)\),sceneHit,cellWorld\)/);
|
|
assert.match(shader, /if\(!reconstructScenePoint\(projectUv\(hit\),surface\)\)return artisticHit/);
|
|
assert.match(shader, /confidence=1\.-smoothstep/);
|
|
assert.match(shader, /delta\*=min\(1\.,limit\/max\(length\(delta\),.00001\)\)/);
|
|
// Analytic planar case for the correction's geometry. GPU execution is checked in-browser.
|
|
const camera = new THREE.Vector3(.25, 0, 3), glass = new THREE.Vector3(0, 0, .6);
|
|
const ray = new THREE.Vector3(-.15, 0, -1).normalize(), baseZ = .31;
|
|
const plane = glass.clone().addScaledVector(ray, (baseZ - glass.z) / ray.z);
|
|
function projectedAt(z) {
|
|
const hit = glass.clone().addScaledVector(ray, (z - glass.z) / ray.z);
|
|
const view = hit.clone().sub(camera);
|
|
return camera.clone().addScaledVector(view, (baseZ - camera.z) / view.z);
|
|
}
|
|
assert.ok(projectedAt(baseZ).distanceTo(plane) < 1e-10, 'reference plane introduces no correction');
|
|
assert.ok(projectedAt(.55).distanceTo(plane) > .001, 'near surface changes refracted sample');
|
|
assert.ok(DEPTH_REFRACTION.blend > 0 && DEPTH_REFRACTION.blend <= 1);
|
|
assert.ok(DEPTH_REFRACTION.blend * DEPTH_REFRACTION.maxCellCorrection < .25, 'correction stays below a quarter cell');
|
|
assert.match(shader, /environmentWeight=.*glossStrength.*clamp\(uStrength,0\.,1\.\)/);
|
|
console.log('Depth correction: planar identity, nonzero near correction, bounded shift, framing and reflection gates.');
|