Narrow the built-in profile lookup so the branch typechecks

tsc has been red since 9ebf38b: builtInAppProfiles.repixelizer is
Partial-typed, so passing it to isAllowedReturnOrigin and spreading it
into an AppProfile literal both fail under exactOptionalPropertyTypes.
Clean at 827cdee, red at 9ebf38b and after -- the earlier "pre-existing"
reading was taken against a commit inside the same pass rather than
against the last green one.

Narrowed with a throw rather than a cast: a missing built-in should fail
the suite loudly, not be asserted out of existence.

  tsc --noEmit -p tsconfig.json -> no output, exit 0
  vitest run -> Tests 121 passed | 1 skipped (122)

The one failing file remains tests/odin-publication.test.ts
(Cannot find module 'cultcache-ts'), red on origin/main as well.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-09-08 14:54:17 +02:00
commit 5373e339af

View file

@ -275,6 +275,11 @@ describe("attempt-handle binding: the public start route may attach a completion
describe("isAllowedReturnOrigin: origin comparison, not string matching", () => {
const profile = builtInAppProfiles.repixelizer;
// Narrow rather than cast: the lookup is Partial-typed, and a missing
// built-in should fail this suite loudly instead of being asserted away.
if (!profile) {
throw new Error("built-in repixelizer profile is missing");
}
const rejected = [
"https://repixelizer.gamecult.org.evil.com/",
"https://evil.com/?x=https://repixelizer.gamecult.org",