문제: 런타임 설정에 비밀처럼 보이는 키(`CLIENT_SECRET` 등)가 있으면
부팅이 CONFIG_SECRET_NAME_REJECTED로 멈추지만, 안전한 부팅 오류에는
buildId만 있고 어느 키인지가 없다. assertSafeConfigNames가 던진 오류의
message에는 키 이름이 있었지만 loadRuntimeConfig가 그 오류를 버렸다.
같은 파일의 스키마 실패는 키 이름을 invalidKeys로 싣는다.
고른 방법: assertSafeConfigNames가 UnsafeConfigNameError를 던지고 그
`key`에 거절한 키의 점 경로(`CAPABILITY_OVERRIDES.AUTH_TOKEN`,
`FEATURE_OVERRIDES.<id>.CLIENT_SECRET`)를 싣는다. 로더는 그 경로를
스키마 실패와 같은 SAFE_KEY_PATTERN으로 거른 뒤 invalidKeys에 넣는다.
오류 화면은 이미 invalidKeys를 "잘못된 설정 키"로 보인다. 값은 어디에도
싣지 않는다. 버린 대안: message에서 키를 정규식으로 다시 읽는 것.
message 문구가 바뀌면 조용히 빠진다.
위험·한계: 키 이름은 거절된 문서에서 온다. 그래서 길이·문자를 제한하고,
그 밖의 이름은 빼고 코드만 남긴다. 첫 번째로 걸린 키 하나만 싣는다
(검사가 첫 키에서 멈추는 동작은 그대로). assertSafeConfigNames의
시그니처와 message는 바꾸지 않았다. UnsafeConfigNameError는
src/contracts/env.ts에 새로 더한 export다(추가만).
검증: desktop batch에서 확인.
node scripts/run-vitest.ts run tests/runtime-schema/runtime-config.test.ts
Refs: 1103/07-04
Any error the loaders did not classify was shown as BOOT_CONFIG_FAILURE and
dropped. It now shows BOOT_UNEXPECTED_FAILURE with the build id and error class,
logs the original in development, and a schema failure lists the rejected key
names (bounded, never values).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On CONFIG_SCHEMA_INVALID the loader copied the raw RELEASE_ID and
CONFIG_SCHEMA_VERSION strings (up to the 64 KB body limit) into the
"safe" error that BootErrorShell and diagnostics show, contradicting the
file's own contract. The error now carries the schema version only when
it passed the version gate (no validator issue at CONFIG_SCHEMA_VERSION)
and never the release id of a rejected document.
Verified: two cases in tests/runtime-schema/runtime-config.test.ts
(invalid field with a 10 KB RELEASE_ID; unsupported 10 KB version) RED
before, green after; test:runtime-schema and all gates PASS.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
isValidReleaseManifestUrl only rejected `//`, `?`, `#`, `\`, `%2f`/`%5c`
and literal dot segments. The WHATWG URL parser strips tab/CR/LF and
resolves `%2e` dot segments, so "/\t/evil.example/m.json" resolved to
https://evil.example/m.json and "/a/%2e%2e/b.json" to "/b.json". The value
is now also resolved against a fixed base and must keep that origin and
have a pathname identical to the input.
RED: "runtime configuration boundary > rejects invalid config" cases for a
tab, a newline, "/a/%2e%2e/b.json" and "/a/%2E/b.json" failed (validation
succeeded) before the fix. Added accept cases for normal same-origin paths.
Gates: check:architecture, check:types:app/test/node, lint, test:component,
test:runtime-schema, test:contract pass; test:unit passes except the
environment-dependent removal-fixture.test.ts (needs generated
artifacts/release files; unrelated). tests/release, tests/platform/release
and tests/integration also pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
assertSafeConfigNames recursed into every nested object, so the feature
ids that key FEATURE_OVERRIDES were checked as configuration names. The
feature-id grammar allows `cookie-consent`, `password-reset` and
`token-wallet`, so using the runtime kill switch for such a feature made
loadRuntimeConfig throw CONFIG_SECRET_NAME_REJECTED and the app failed to
boot. The keys of FEATURE_OVERRIDES (exact top-level key only) are now
skipped; objects nested below a feature id, other nested maps and the top
level are still checked.
RED: "runtime configuration boundary > loads a config whose
FEATURE_OVERRIDES name a secret-looking feature id" failed with BootConfigError
CONFIG_SECRET_NAME_REJECTED before the fix. Added cases that forbidden names
at top level, in CAPABILITY_OVERRIDES, deeper nesting and below a feature id
are still rejected.
Gates: check:architecture, check:types:app/test/node, lint, test:component,
test:runtime-schema, test:contract pass; test:unit passes except the
environment-dependent removal-fixture.test.ts (needs generated
artifacts/release files; unrelated).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>