문제
짝 백엔드는 같은 키의 첫 요청이 아직 실행 중이면 409
IDEMPOTENT_IN_FLIGHT, retryable=true, Retry-After: 2를 준다(백엔드
docs/web/http-contract.md §2). 클라이언트 행동은 "같은 키로 Retry-After 뒤
재전송"이다.
- 같은 키: 0929/03-01이 이 409를 MAYBE_APPLIED로 두어 코디네이터가 intent를
붙든다. 재전송은 같은 키를 쓴다(기존 vertical 테스트가 [K, K, K]를
고정). 이 부분은 이미 맞다.
- Retry-After: 지키지 않는다. V3는 응답 metadata에 retryAfterMs를 읽지만
feature binding이 PROBLEM을 AppFailure로 옮길 때 버린다. V2는 409의
Retry-After를 읽지 않는다. 그래서 결과 불명 화면의 "같은 요청으로 다시
보내기"(또는 같은 입력 다시 저장)를 바로 누르면 즉시 나가서 같은 409를
한 번 더 받는다.
고른 방법
재전송이 그 시각 전이면 기다렸다 보낸다.
- feature binding이 PROBLEM의 metadata.retryAfterMs를 AppFailure에 싣는다.
V2는 409의 Retry-After도 읽는다(409는 여전히 자동 재시도하지 않는다).
- mutation 코디네이터(application-query.ts)가 MAYBE_APPLIED로 남기는
admission에 resendNotBefore = 지금 + min(retryAfterMs, 5초)를 적는다.
같은 intent를 다시 쓰는 submit(재전송 버튼, 같은 입력 저장)이 그 시각까지
기다린 뒤 보낸다. 기다리는 동안 admission이 ACTIVE라 화면은 pending이다.
scope가 바뀌면 기존 mutationFn 검사가 NOT_STARTED로 막는다.
- 상한 5초는 V3 실행기의 Retry-After 상한(RETRY_AFTER_CEILING_MS)과 같다.
더 일찍 보내도 같은 키라 서버가 다시 409를 줄 뿐 두 번 적용하지 않으므로,
긴 Retry-After를 다 기다리게 하지 않는다.
버린 대안
- Retry-After 전에는 버튼을 막기: 화면과 시각 회귀 골든이 바뀌고, 다시
열어 줄 타이머와 문구가 더 든다. 기다렸다 보내는 쪽이 변경이 작다.
- V3 실행기가 키별 "이 시각 전 금지" 표를 들기: 실행기에 키를 기억하는
상태와 정리 규칙이 생긴다. 재전송을 만드는 곳은 코디네이터 하나다.
- 그대로 두기(이른 재전송은 409를 한 번 더 받을 뿐): 서버 문서가 허용하는
동작이지만 사용자는 같은 결과 불명 화면을 한 번 더 본다. 요구는
Retry-After를 지키는 것이다.
위험·한계
- AppFailure.retryAfterMs가 V3 PROBLEM에도 실린다(추가 필드). 이 값을 읽는
곳은 코디네이터뿐이다.
- 기다림은 MAYBE_APPLIED로 남은 admission을 다시 보낼 때만 생긴다. 다른
상태(NOT_APPLIED 등)는 그대로다.
- 시계는 performance.now(), 대기는 setTimeout이다. 탭이 백그라운드면
브라우저가 타이머를 늦출 수 있다(더 늦게 보낼 뿐이다).
검증
- RED: 4행 실패.
- tests/features/reference-feature/reference-production-vertical.test.tsx
처리 중 409(Retry-After: 1) 뒤 재전송 간격 39.7ms(기대 990ms 이상)
- tests/component/application-mutation-admission.test.tsx 재전송이
retryAfterMs 300을 기다리지 않음
- tests/features/reference-feature/reference-http-problem-mapping.test.ts
retryAfterMs 없음
- tests/integration/http-client.test.ts V2 409 retryAfterMs 없음
상한 행은 수정 전에도 통과하고, 상한을 뺀 변이에서 시간 초과로 실패하는
것을 확인했다.
- GREEN: 위 행 모두 통과. tests/component·features·contract/reusable-
capability, tests/integration/http-client·http-diagnostics, tests/unit/
http-execution-v3 62 files 491 tests 통과. tsc app·test 통과, 바꾼 파일
eslint 통과.
Refs: clean-architecture-backend-template docs/reviews/2026-11-01-maturity-review/README.md 14.3, 15
문제
- 93180f6(합친 커밋 d3ddc89)이 초기 JS를 늘렸다. 기능 모양 측정
(scripts/scale/measure-feature-shape-growth.ts) 기준으로 기능 0개가
202,376 → 202,526 B(+150)로, 기능 1개 추가분이 960 → 1,029 B로 늘었다.
tests/unit/feature-shape-growth.test.ts의 1 KiB 상한을 넘는다.
- 원인은 두 가지다.
- 부팅 때 도는 composeContractContributions가 검증기마다 생략 표시를
읽고 목록을 만들었다(feature-platform 청크 +164 B). 이 목록을 쓰는
곳은 플랫폼 개요 화면(lazy 라우트)뿐이다.
- 공유 zod-validator.ts가 기능이 두 개가 되면 lazy 청크 하나로 따로
나왔다. 모든 context-routes·feature-runtime import의 preload 목록에
파일 이름이 하나 늘어 boot·feature-declarations 청크가 각각 약 25 B
커졌다.
고른 방법
- 목록 계산을 src/contracts/unvalidated-payload.ts의
listUnvalidatedPayloads(composed)로 옮긴다. 플랫폼 개요 화면만 이것을
import한다. 결정의 뜻(생략한 operation이 조립 결과에서 목록으로
나온다)은 그대로다. 계산 시점만 화면이 열릴 때로 미룬다.
ComposedContractContributions.unvalidatedPayloads 필드는 뺀다.
- unvalidatedPayload 팩토리도 같은 모듈로 옮긴다.
- 조립기의 표시 검사도 뺀다. 이유가 빈 생략은 unvalidatedPayload가 만들
때 거부한다(TypeError). 손으로 붙인 표시는 값이 "NONE"이 아니거나 이유가
없어도 목록에 나온다(화면에는 "이유 없음"). 그래서 생략이 숨지 않는다.
external-contract-runtime.ts에는 RuntimeValidator의 선택 타입 필드
2개만 남는다.
- vite.config.ts에서 zod-validator.ts를 schema-registry.ts와 같은 lazy
청크로 묶는다. 어댑터를 import하는 곳은 이미 schema-registry 청크를
preload한다. includeDependenciesRecursively: false라서 다른 모듈은
끌려오지 않고, 두 모듈 모두 부팅 그래프 밖이다.
버린 대안
- 조립기에 "NONE + 이유" 검사만 남기기: feature-platform 청크 +57 B gzip.
검사를 팩토리와 목록으로 옮기면 0 B다. 손으로 붙인 잘못된 표시를
부팅 때 거부하지 못하지만, 목록에는 나온다.
- zodValidator를 schema-registry.ts 안에 정의: 빌드 설정 없이 같은 결과가
나오지만 결정한 위치(src/contracts/zod-validator.ts)와 다르고, 다음 단계의
기능 생성 명령이 그 경로를 쓴다.
- 어댑터를 zod.ts에 두기: zod 입구는 초기 청크라 기능 0개 초기 JS가 는다.
위험·한계
- 조립 결과 타입에서 unvalidatedPayloads 필드가 빠진다. 93180f6 뒤 이
필드를 쓴 코드는 listUnvalidatedPayloads로 바꿔야 한다. repo 안에서는
화면과 테스트만 썼다.
- 손으로 만든 잘못된 표시(예: validation: "PARTIAL")는 더 이상 조립에서
거부되지 않는다. 목록에만 나온다. 테스트 2건을 이 동작으로 바꿨다.
- 청크 묶음은 빌드 설정에 두 파일 경로를 적는다. 파일 이름을 바꾸면
정규식도 함께 바꿔야 한다. 놓치면 바이트만 늘고 동작은 같다.
- 플랫폼 개요 화면을 열면 schema-registry 청크에 어댑터(351 B raw)가 같이
온다.
검증
- 기능 모양 측정(0개 / 1개 추가분, gzip B):
- ee81c44(07-03 전): 202,376 / 960
- d3ddc89(07-03 합친 뒤): 202,526 / 1,029
- 목록만 부팅 밖으로: 202,407 / 1,035
- 청크 묶음 추가: 202,424 / 983
- 조립기 검사 제거(이 커밋): 202,371 / 958
- feature-shape-growth.test.ts 6건 통과.
- 07-03 테스트 3파일 33건 통과(zod-validator, external-contract-runtime,
starter-platform-overview-page).
- 회귀: tests/unit·contract·component·runtime-schema·features·platform
270파일 3,203건, tests/integration 12파일 158건(pnpm을 띄우는
security-followup-archive 제외), tests/architecture 7파일 33건 통과.
- tsc app·node·test·recipes·web-worker·service-worker 오류 0. 바꾼 파일
eslint 0. 아키텍처 그래프 검사(pnpm 대신 exec stub) 413 모듈 PASS.
check-registries PASS(compatibility=none).
- 본 빌드 초기 JS gzip 202,371 B(26파일). raw 644,782 B로 ee81c44 측정과
같다.
Refs: docs/reviews/2026-11-01-maturity-review/07-contracts.md 07-03
문제: 라우터는 모든 context gateway를 `AppShell` 하나 아래에 붙이고 플랫폼
`/`를 index로 둔다. 기능이 `APP_HOME`을 선언하면 `composeUniqueRecord`가
throw한다. 그래서 제품 홈이 기능 화면이거나 화면이 `AppShell`이 아닌 자기
셸을 쓰면 제품이 템플릿 라우터와 조립 카탈로그를 고쳐야 한다. memento는
카탈로그 브리지(`APP_HOME` 허용 목록)와 라우터 브리지(`ownsShell`)를 넣고
동기화마다 병합한다. tech-log는 라우터를 PUBLIC/STUDIO 그룹 라우터로 통째로
바꿔 생성기 설치 경로(context gateway)를 쓰지 못한다.
고른 방법: 리뷰 4.3의 (B). 선언 두 개를 연다.
- 홈 대체: 플랫폼이 기능이 대신할 수 있는 라우트 id를 선언한다
(`FEATURE_REPLACEABLE_PLATFORM_ROUTE_IDS = ["APP_HOME"]`,
src/contracts/routes.ts). 그 id를 선언한 기능의 정의가 플랫폼 정의를
대신한다. 둘이 선언하면 카탈로그를 읽을 때 두 기능 id를 담아 throw한다
(`withoutTakenOverPlatformRoutes`). 다른 플랫폼 id는 지금처럼 중복 오류다.
라우터는 대체된 라우트를 소유 context와 함께 그 경로에 붙인다.
- context 레이아웃: `BoundedContextRouteModule.loadLayout`(선택). 생성기는
`src/contexts/<context>/context-layout.tsx`가 있으면 그 `CONTEXT_LAYOUT`을
지연 import로 싣는다. 라우터는 그 context를 `AppShell` 형제인 `/` 레이아웃
라우트 아래, 기능의 등록 경로마다 붙인다. 그래서 모르는 URL은 여전히
`AppShell`의 NOT_FOUND로 간다. 선언이 없으면 지금처럼 `AppShell` 아래 루트에
붙는다. 레이아웃 청크 실패는 라우트 청크와 같은 reload-once 복구를 받는다.
- 09-06 불변식을 레이아웃으로 넓힌다. 레이아웃 라우트는 모두 `/`의
형제라서 루트는 레이아웃과 상관없이 그 아래 URL을 가진다. 그래서 기존
루트 검사가 모든 레이아웃에 걸친다. 한 레이아웃 아래 루트 여럿(같은
컴포넌트를 싣는 context들)은 허용한다. 대체된 플랫폼 라우트는 라우터가
경로에 직접 붙이므로 루트 검사에서 뺀다(09-06 재검토 조건).
- tests/unit/product-features.test.ts의 "플랫폼 라우트는 소유자가 없다"
검사가 대체 가능한 id는 건너뛴다. memento가 고쳤던 템플릿 테스트다.
- `ContextRouteModule`에 `featureIds`가 생겨서, `TEMPLATE_APP_MODULE`을
손으로 mock하며 필수 필드 `features`를 빼먹은 두 테스트
(context-route-gateway, context-boundary-diagnostics)에 `features: []`를
넣었다.
버린 대안:
- (A) 현 상태: 제품마다 브리지를 넣고 동기화마다 병합한다.
- (C) `AppShell` 통째 교체: 레이아웃 그룹이 둘인 tech-log를 담지 못한다.
- 같은 레이아웃을 쓰는 context를 로더 함수로 묶어 레이아웃 라우트 하나에
모으기: 만들었다가 지웠다. React 19는 같은 컴포넌트로 풀린 lazy 타입을 같은
타입으로 맞춰 레이아웃 인스턴스를 그대로 둔다. 묶지 않은 변이로 테스트가
그대로 통과해서 쓸모없는 코드였다.
- `CONTEXT_LAYOUT_ID` 리터럴로 다른 context의 레이아웃을 가리키기: 같은
컴포넌트를 내보내는 파일 두 개로 같은 결과가 나와 선언을 하나 덜 둔다.
- 레이아웃 라우트를 `AppShell`보다 앞에 두기(memento 브리지 순서): 경로가
같으면 기능이 플랫폼 라우트를 조용히 가린다. `AppShell`을 앞에 두어
지금처럼 플랫폼이 이긴다.
위험·한계:
- 레이아웃이 skip link와 `<main id="main-content">` 하나를 그리는 것은
계약(타입 주석, starter-experience.md)과 테스트 fixture로만 지킨다. 실행 중
검사는 없다. 레이아웃 로딩·실패 화면에는 `<main>`이 없다(`AppShell`의
errorElement와 같다).
- 레이아웃 렌더 결함(청크 실패가 아닌 것)은 라우트 errorElement로 가고
진단을 남기지 않는다. `AppShell` 렌더 결함과 같다.
- 홈을 대신한 기능을 실행 중에 끄면 `/`는 비활성 기능 화면이 된다. 빌드에서
빼면(`VITE_PRODUCT_FEATURES`) 플랫폼 홈이 돌아온다.
- tech-log의 PUBLIC 셸 안 NOT_FOUND는 표현하지 않는다. 모르는 URL은
`AppShell`의 NOT_FOUND다. STUDIO의 `/studio/*` 라우트는 STUDIO 레이아웃
아래에서 동작한다. tech-log는 기능 하나를 레이아웃 그룹별 기능 둘(context
둘)로 나눠야 한다.
- 플랫폼 라우트와 기능 라우트의 같은 경로는 여전히 검사하지 않는다(7139c7c
한계). 루트 `*` context에서 `APP_HOME`이 아닌 id로 `/`를 선언하면 플랫폼
홈에 가려진다.
- 초기 JS gzip +349 B(204,586 -> 204,935 B). 예산 204,800 B를 135 B
넘는다(이전 여유 214 B). boot 청크 +228(라우터·앱 모듈),
installed-feature-contracts 청크 +121. 같은 worktree에서 HEAD 파일로
`vite build`를 한 번 더 해서 청크별로 비교했다. 예산은 고치지 않았다.
검증:
- RED: tests/component/context-layouts.test.tsx는 파일 적재에서
"Duplicate route registry key: APP_HOME"으로 실패.
tests/architecture/context-route-roots.test.ts 15건 중 3건 실패(APP_HOME
루트 예외 "not under the route root", 대체 함수가 없어 2건).
tests/scripts/generate-product-feature-index.test.ts 새 1건이 HEAD 생성기로
"expected ... to contain 'loadLayout: async () => (await import…'"로 실패.
- GREEN: 세 파일 37건 통과(생성기 15, 루트 16, context-layouts 6).
- 변이: 라우터가 `loadLayout`을 무시하면 context-layouts 6건 중 5건 실패.
topics 레이아웃을 다른 컴포넌트로 바꾸면 "keeps one layout instance" 실패.
- 회귀: tests/{architecture,unit,features,platform,component,contract,
runtime-schema,integration,scripts,scale}(pnpm을 띄우는 4개 제외)
300 files, 3,451건 통과. check-registries, check-adapter-inventory,
verify-documentation-readiness(PASS_SCOPED) 통과.
- tsc app·test·node 통과. 바꾼 파일 eslint 통과. 생성기 --check 통과.
- check:architecture는 pnpm이 필요해 돌리지 않았다.
Refs: docs/reviews/2026-11-01-maturity-review/09-app-core.md 09-03, 4.3
문제: 기능 하나를 더하면(리뷰 16 실험 E) 기능 밖 테스트 3개가 깨진다.
① installed-context-routing은 context 목록이 정확히
["reference-context"]이고 첫 context가 참조 context라고 단정한다.
② product-feature-switch는 정렬 첫 기능(INSTALLED_PRODUCT_FEATURE_IDS[0])을
끄고 참조 라우트를 본다. 새 기능이 앞에 정렬되면 깨진다.
③ release-manifest fixture가 contractSet.packages: []로 고정이다.
EXTERNAL_PACKAGE를 쓰는 첫 기능에서 반드시 깨진다.
또 시나리오 하네스의 operation ID 타입이 테스트 계약 3개 리터럴이고
시나리오 응답 함수가 /api/test-entities 핸들러 안에 묶여 있다. 새 기능
테스트가 자기 operation에 실패 시나리오를 쓰려면 카탈로그를 고쳐야 한다
(안 고치면 TS2345, 실행하면 catalog.ts:469 TypeError).
방법: 리뷰의 (b) 최소 개선.
① "목록에 reference-context가 있다"로 바꾸고, 라우트 검사는 id로 찾은
context에서 한다.
② REFERENCE_FEATURE_ID를 쓴다.
③ fixture의 packages와 setDigest를 EXPECTED_CONTRACT_SET_PACKAGES에서
만든다.
하네스: HttpScenarioOperationId를 string으로 넓혔다. 시나리오 사실(명령
여부, 응답 상한, 성공 status)은 httpScenarioOperationFacts가 설치된 V3
descriptor에서 읽는다. 시나리오 응답은 tests/mocks/handlers/
http-scenarios.ts의 createHttpScenarioHandler로 옮겼다. 경로와 method도
descriptor에서 만든다. test-entities 핸들러는 이 함수를 쓰고 카탈로그
확인(assertOperationScenario)을 그대로 거친다. 카탈로그 기대값 57개는
계속 테스트 계약 3개에만 있고, 그 타입도 3개로 둔다. 카탈로그에 없는
operation을 assertOperationScenario에 넘기면 TypeError 대신 그 사실을
말하는 오류가 난다. test-entities 핸들러는 요청의 이름·id를 되돌려 주던
응답을 카탈로그 payload로 고정했다(기대값과 같은 값이다).
새 기능 테스트의 MSW 시나리오: server.use(createHttpScenarioHandler(
<자기 설치 계약>, { scenario: "server-terminal-503", payload }))
버린 대안: (a) 현상 유지는 기능마다 4곳을 고친다. (c) 하네스를 기능별로
나누면 변경이 크고 test-evidence.json의 증거 경로가 바뀐다. 기능
operation을 카탈로그에 더하는 방식은 기능 추가를 공유 파일 수정으로
만든다.
test-evidence.json은 바꾸지 않았다(sourceContracts 토큰이 test-entities.ts에
그대로 있다). 제거 드릴의 플랫폼 보존 목록에 http-scenarios.ts를 더했고,
테스트 전략 문서 11절에 사용법을 적었다.
위험·한계:
- 앱 전체를 렌더하는 테스트에서 response-too-large는 끝나지 않는다.
실행기가 MSW가 넘긴 본문을 cancel하는 promise가 끝나지 않는 기존
제약이다. 카탈로그 통합 테스트는 프록시 fetcher로 우회한다.
- 같은 실험에서 기능 밖 테스트가 더 깨진다. 이 발견 범위 밖이라 두었다.
http-operation-v2-v3-parity는 스키마 ID "NoRequest"를 센티널로 고정한다.
스키마 ID는 전역이라 두 번째 기능은 다른 이름을 써야 하고, 그러면 이
테스트가 깨진다. manual-a11y-evidence·documentation-readiness(라우트별
a11y 기록, 16-01)와 second-api-feature-registries(무효화 그래프 추가가
breaking, 16-01)도 깨진다.
- test:sample-removal, test:http-scenario-evidence는 pnpm이 필요해 돌리지
않았다.
검증:
RED: 참조 기능을 토큰 경계로 order로 바꾼 복사본(order-context,
EXTERNAL_PACKAGE 출처 포함, 커밋 안 함)을 넣고 tests/features
tests/component tests/runtime-schema를 돌렸다. 5파일 8개 실패. 기능 밖은
① 2개(["order-context","reference-context"]), ② 2개(order-feature를 꺼서
참조 링크가 남음), ③ 1개(ReleaseManifestError)다. 나머지 3개는 복사한
테스트다. 하네스 probe는 TS2345 2건, 실행 시 TypeError(catalog.ts:469).
새 통합 테스트는 기준 하네스에서 모듈 없음으로 실패하고, 기준
assertOperationScenario는 미등록 operation에 TypeError를 낸다.
GREEN: 같은 복사본으로 같은 폴더와 카탈로그 통합 테스트를 돌렸다. 78파일
중 실패는 출처를 바꾼 복사본 provenance 1파일뿐이고 ①~③은 통과한다.
order 테스트가 createHttpScenarioHandler(LIST_ORDER_RESOURCES_CONTRACT)로
content-type-mismatch·schema-mismatch·server-terminal-503을 화면에서
확인했다(카탈로그 수정 없음).
복사본을 지운 뒤: tests/features·component·runtime-schema·unit·
integration(security-followup-archive 제외)·contract 250파일 3111개 통과,
카탈로그 57/57, check-test-evidence --scenario-only·--source-only PASS,
tsc app·test·node 통과, verify-documentation-readiness PASS_SCOPED,
check-ci-contract PASS, 바꾼 파일 eslint 통과.
Refs: docs/reviews/2026-11-01-maturity-review/16-structure-patterns.md 16-02
문제
- zod 스키마를 RuntimeValidator로 바꾸는 zodValidator가 참조 기능의
reference-schemas.ts 안에만 있다. 기능끼리 import가 금지라 새 기능은
복사하고, 복사본은 이미 갈라졌다(tests/helpers 복사본은 성공 값을
structuredClone하지 않는다). 참조 기능을 지우면 어댑터도 사라진다.
- RuntimeValidator<T>는 schemaId와 safeParse만 요구한다. 아무것도
검증하지 않는 검증기도 조립을 통과하고, 검증을 생략했다는 사실이
타입·이름·조립 결과 어디에도 남지 않는다.
고른 방법 (C: 공유 어댑터 + 생략 표시)
- zodValidator를 src/contracts/zod-validator.ts로 옮긴다. 참조 기능과
tests/helpers/external-contract-fixture.ts가 이것을 import한다. 동작은
참조 기능 쪽 원본 그대로다(성공 값 structuredClone, 경로 배열, code
문자열). tests/helpers도 이제 성공 값을 복사한다.
- unvalidatedPayload(schemaId, reason)를 external-contract-runtime.ts에
둔다. 만든 검증기에는 validation: "NONE"과 unvalidatedReason이 붙는다.
zod가 필요 없어서 검증기 프로토콜 옆에 뒀다.
- composeContractContributions가 이 표시가 붙은 검증기를
unvalidatedPayloads(featureId, contractId, validator, schemaId, reason)로
내놓는다. HTTP의 input·output·problem과 이벤트의 envelope·payload를 모두
본다. 표시가 "NONE"이 아니거나 이유가 비어 있으면 조립을 거부한다.
- 플랫폼 개요 화면(스타터 화면)의 계약 절에 "런타임 검증을 생략한 계약"
표를 둔다. 목록이 비면 그리지 않는다.
버린 대안
- (B) 공유 어댑터만: 검증 생략이 여전히 보이지 않는다.
- (D) 브랜드 타입으로 zodValidator가 만든 검증기만 받기: 외부 패키지의
자체 검증기까지 막아 §4 설계와 충돌한다.
위험·한계
- 표시 없이 손으로 쓴 통과 검증기(리뷰 실험 L5)는 여전히 조립을
통과하고 목록에도 없다. 이 변경은 생략을 막지 않는다. 이름 있는 길을
만들어 그 길로 생략한 것만 드러낸다.
- 공개 계약 추가: RuntimeValidator에 선택 필드 2개,
ComposedContractContributions에 필드 1개, 새 export zodValidator·
unvalidatedPayload·UnvalidatedPayloadEntry. 기존 호출자는 바뀌지 않는다.
ComposedContractContributions를 손으로 만드는 코드는 새 필드를 채워야
한다(repo 안에는 없다).
- 초기 JS gzip 204,586 → 204,745 B(+159). 예산 204,800까지 55 B 남는다.
플랫폼 개요 청크 4,625 → 4,750 B.
- 참조 기능은 모든 검증기가 검증하므로 화면 모양은 그대로다. 시각 회귀는
돌리지 않았다.
- tests/unit/second-api-feature-registries.test.ts의 V2 codec 통과 검증기는
그대로 둔다(16-01이 그 파일을 넓힌다).
검증
- RED(수정 전): zod-validator.test.ts "Cannot find module
'../../src/contracts/zod-validator.ts'", external-contract-runtime.test.ts와
starter-platform-overview-page.test.tsx "unvalidatedPayload is not a
function". 3파일 모두 실패.
- GREEN: 같은 3파일 33건 통과.
- 회귀: tests/unit·contract·component·runtime-schema·features·platform
268파일 3,189건, tests/integration 12파일 158건(pnpm을 띄우는
security-followup-archive 제외), tests/architecture 7파일 33건 통과.
tsc app·node·test·recipes·web-worker·service-worker 오류 0. 바꾼 파일
eslint 0. check-registries PASS(compatibility=none), verify-documentation
PASS_SCOPED, check-adapter-inventory PASS. 아키텍처 그래프 검사(pnpm 대신
exec stub) 383 모듈 PASS.
- 참조 기능 삭제 모의: scripts/test-sample-removal.ts의 삭제 목록(기능
폴더, tests/features, reference-context, SAMPLE_EXTRAS)을 복사본에 적용.
src/contracts/zod-validator.ts가 남고, tsc app·test 오류 0, 어댑터·조립·
플랫폼 개요·HTTP 시나리오 테스트 4파일 35건 통과.
Refs: docs/reviews/2026-11-01-maturity-review/07-contracts.md 07-03, 5.3
문제: 라우터·chunk 복구·render 경계·앱 셸·런타임 트리 테스트가 스타터
화면(`/`의 h1, 홈의 "플랫폼 구성 보기" 링크, /examples/ui·states)을
대상으로 쓴다. 문서는 스타터 화면을 "페이지 단위로 교체 가능"하다고 하는데,
제품이 화면을 바꾸면 스타터와 무관한 플랫폼 테스트가 깨지고 동기화 때마다
같은 파일이 충돌한다(두 제품 기록).
방법: tests/helpers/fixture-feature.tsx에 테스트 전용 public 페이지 4개를
더했다. 메뉴에 나오는 지연 로드 페이지 2개(제목 h1, 런타임 릴리스 표시),
chunk 로드 실패 페이지, render 결함 페이지다. 플랫폼 테스트는 이미 쓰던
방식대로 생성 인덱스를 mock해 이 기능을 설치하고 그 페이지를 쓴다.
스타터 화면 자체를 검사하던 것(홈 시작 링크, 홈·플랫폼 구성의 릴리스 로딩
실패, 인증 예제의 복귀 URL, 상태 갤러리 제목 구조, 플랫폼 구성 화면)은
starter-pages.test.tsx와 starter-platform-overview-page.test.tsx로
모았다. 제품은 스타터 화면과 함께 starter-* 파일을 지우면 된다.
fixture는 design-system 배럴 대신 page-header.tsx를 직접 import한다.
배럴이 설치 카탈로그를 거쳐 mock된 생성 인덱스를 다시 불러 mock 팩토리가
자기 자신을 기다린다.
버린 대안: README에 "함께 사라지는 검사" 목록만 적는다. 비용은 0이지만
화면을 바꾸면 검사는 여전히 깨지거나 사라진다.
위험: 플랫폼 경로(createRegisteredRoutes의 platformChildren)를 지나는
화면 이동 테스트가 줄고 context 라우트 경로로 옮겨 갔다. `/`와 not-found는
여전히 플랫폼 경로로 돈다. ui-gallery-page는 이제 component 테스트에서
렌더되지 않는다(e2e·visual이 본다). sibling chunk 초기화 테스트는
key={definition.routeId}를 지우면 여전히 실패한다(변이 확인).
검증: RED는 템플릿 복사본에서 home-page.tsx와 examples/*를 다른 화면으로
바꾸고 test:component를 돌렸다. 7파일 20개 실패(router 5, route-status 4,
platform-overview 7, app-shell·async-surface·chunk-recovery·
runtime-application 각 1). GREEN은 같은 조작에서 starter-* 2파일 12개만
실패하고, starter-*를 지우면 34파일 216개 전부 통과. worktree에서
tests/component 36파일 228개 통과, tsc -p tsconfig.test.json 통과, 바꾼
파일 eslint 통과.
문제: context gateway는 적재한 라우트의 handle `routeId`가 가리키는
등록 라우트를 그린다. `context-routes.ts`가 기능 계약에 없는 route id를
handle에 실으면(오타, 계약에서 지운 라우트) 적재는 성공하고, 그 URL을
그릴 때 context 경계 실패 화면이 된다. 7139c7c가 리뷰의 (1)(2)를 했고
(3) "핸들의 route id가 레지스트리에 있는가"는 설계 선택으로 남겼다.
고른 방법: 적재 때 검사한다. `defineBoundedContextModule`이
`route.loadRoutes`를 감싸, 적재한 각 라우트의 handle `routeId`가 그
context 기능들의 계약 라우트 id에 없으면 TypeError로 실패한다. 메시지에
route id, context id, 기능 id를 담는다. handle에 `routeId`가 없어도
실패한다(gateway는 그 라우트를 NOT_FOUND로 그린다).
- 모든 context가 이 함수를 거치므로(생성된 product-context-index) 모든
context에 걸린다. 모든 context의 라우트를 적재하는 기존 단위 테스트
(tests/unit/route-runtime.test.ts)가 개발 단계에서 잡는다.
- 적재 실패는 09-09(de48db2)의 "청크 누락이 아닌 적재 실패" 경로로
context 경계에 가서 `ui.render.failed` 진단을 남긴다. 테스트로 확인했다.
- 라우트는 계속 늦게 읽는다. context를 정의할 때는 loadRoutes를 부르지
않는다.
- 7139c7c의 `contractRoutePaths`를 bounded-context-module.ts로 옮겨
앱 모듈과 같이 쓴다. "계약 라우트"의 정의가 한 곳에 남는다.
- starter-experience.md 기능 추가 3단계에 규칙을 적었다.
버린 대안:
- 헬퍼로 제공: 그 헬퍼를 쓰는 context만 지킨다. 안 쓰면 그만이다.
- 생성기에서 검사: 생성기는 정규식으로 리터럴만 읽어 handle을 모른다.
위험·한계:
- 생성된 index는 기능별 라우트를 합쳐서 돌려주므로, 어느 기능의
`context-routes.ts`가 잘못된 handle을 냈는지는 알 수 없다. 메시지는
그 context의 기능 id 전부를 적는다. 기능이 하나인 context(지금
reference)는 정확하다.
- 최상위 라우트만 본다. 지금 context 라우트는 평평하다. children을 쓰는
context가 생기면 재귀가 필요하다.
- `defineBoundedContextModule`을 거치지 않고 손으로 만든 context 객체는
검사되지 않는다. 그 경우는 기존처럼 렌더 때 context 경계가 잡는다.
- 등록 라우트가 없는 URL에서 난 적재 실패는 진단 route_id가 NOT_FOUND다.
레지스트리의 NOT_FOUND splat이 모든 URL에 맞아 gateway의
`?? routeModule.id` 대체가 쓰이지 않는다. 09-09의 동작이고 고치지 않았다.
- 초기 JS gzip +141 B(203,818 -> 203,959 B, 여유 982 -> 841 B).
같은 worktree에서 `vite build` 두 번으로 쟀다.
검증:
- RED: tests/architecture/context-route-roots.test.ts 새 3건 중 거절
2건이 "promise resolved ... instead of rejecting"으로 실패(10건 중 2
실패). tests/component/context-boundary-diagnostics.test.tsx 새 1건이
route_id "FIXTURE_ITEMSS"(렌더 때 경계)로 실패.
- GREEN: 두 파일 10건, 4건 통과.
- 회귀: tests/{architecture,unit,features,platform,component,contract,
runtime-schema,integration,scripts,scale}(pnpm을 띄우는 4개 제외)
296 files 중 3,383 통과, 1건 실패. 실패는 telemetry-storm.test.ts의
10초 timeout(부하 34)이고 단독 재실행에서 4건 통과했다.
check-registries, check-adapter-inventory 통과.
- tsc app·test·node 통과. 바꾼 파일 eslint 통과.
verify-documentation-readiness PASS_SCOPED.
- check:architecture는 pnpm이 필요해 돌리지 않았다.
Refs: docs/reviews/2026-11-01-maturity-review/09-app-core.md 09-06
문제: useApplicationMutation이 BoundMutation과 함께 raw
LegacyMutationOptions({ execute, definitionId })도 공개 overload로
받는다. raw 쓰기는 intent가 없어 Idempotency-Key 없이 나가고, scope
세대 확인과 측정 profile을 건너뛴다. 결과 불명 뒤 resendUnknownEffect()는
null이라 샘플 폼을 복사하면 "같은 요청으로 다시 보내기"를 눌러도 아무
일이 없고 새 제출도 막힌다. tsc·eslint·depcruise 어느 것도 기능 코드의
raw 사용을 막지 않는다.
고른 방법(결정대로):
- 공개 useApplicationMutation에서 raw overload를 뺀다. 남은 공개
시그니처는 BoundMutation 하나다. 런타임 LEGACY 분기는 그대로 둔다.
- raw로 쓰인 테스트 24곳(3파일)은 tests/helpers/legacy-application-
query-harness.ts의 useLegacyApplicationMutation으로 옮긴다. harness는
명시적 cast로만 그 분기에 닿는다. 단언은 한 줄도 바꾸지 않았다.
- 타입 fixture: application-mutation-admission 테스트에 제품 훅에 raw
입력을 넘기는 @ts-expect-error를 둔다. raw overload가 돌아오면
tsconfig.test.json 검사가 TS2578로 실패한다.
- raw query({ queryKey, execute })는 남긴다. 먼저 확인했다: raw query는
세션이 바뀐 뒤 이전 사용자의 결과를 보이지 않는다. FENCED에서
ServerStateScopeProvider가 하위 트리를 내리고, READY는 이전
QueryClient를 비우고 세대 key로 새 QueryClient를 붙인 뒤에 온다. 늦게
온 이전 응답은 버려진 client에 쓰인다. 이 동작을
server-state-generation-provider 테스트로 고정했고, 생성 저장소가 같은
client를 비우지 않고 다시 쓰게 바꾸면 이 테스트가 실패한다(변이 확인).
시그니처 JSDoc에 "scope·측정 profile 없이 도는 읽기 경로"와 provider
밖에서는 훅이 막지 않는다는 위험을 적었다.
- typescript-state-and-data-flow.md 4.3의 raw 예시를 bound 정의로 바꾼다.
버린 대안: raw query까지 제거 — 다운스트림 memento의 raw query 12곳이
깨지는데 읽기는 다시 보내도 부작용이 없어 얻는 안전이 작다. 현상 유지 —
쓰기 경로의 중복 생성과 동작하지 않는 재전송이 남는다. 런타임 LEGACY
분기 제거 — legacy 전용 테스트 4건의 단언이 바뀌어 "같은 단언 유지"를
못 지킨다. 별도 tests/fixtures/typecheck + CI 명령 — package.json,
gates.json, contract-baseline.json, 명령 수를 고정한 테스트까지 바꾸고
다른 수정과 baseline 해시가 충돌한다. 같은 tsc 검사를 기존
check:types:test 게이트가 돈다.
위험·한계: 공개 계약 변경(BREAKING). 런타임에는 raw 분기가 남아 cast로
여전히 닿는다(타입으로만 막음). LegacyMutationOptions 타입은 harness가
쓰도록 application-query.ts에서 export한다(배럴에는 없음). raw query는
ServerStateGenerationProvider 밖에서 쓰면 세션 보호가 없다.
검증:
- RED: 원래 훅(raw overload 있음)으로 tsc -p tsconfig.test.json →
"error TS2578: Unused '@ts-expect-error' directive."
- GREEN: tsc app·test·node 통과. tests/component 35 files 229 tests
통과(옮긴 테스트 포함). tests/unit·component·features·contract·
runtime-schema·architecture·scripts·integration(security-followup-
archive 제외, pnpm 사용) 256 files 중 3 files 4 tests가 부하(load
avg 32)에서 실패했고 세 파일을 3회 다시 돌려 모두 통과(78/78). eslint
(바꾼 파일) 통과.
- 다운스트림(읽기만): memento 10곳, tech-log 34곳 모두 bound. 깨지는
제품 호출 0곳. 두 repo의 tests/component 템플릿 소유 테스트 3파일은
raw 호출이 있어 harness와 함께 동기화해야 한다.
BREAKING CHANGE: useApplicationMutation이 raw { execute, definitionId }
입력을 받지 않는다. BoundMutation(definitionId, definitionVersion,
operationId, requiresIdempotencyKey, owner, duplicatePolicy, scope,
invalidate, execute(input, { signal, intent }))을 넘긴다. scope는
useServerStateScope()에서 얻는다.
Refs: docs/reviews/2026-11-01-maturity-review/08-presentation.md 08-03
문제: 조회 실패는 failure.requestId를 "지원 참조"로 보이는데, 폼의
FormFailureStatus는 넘기지 않았다. 결과 불명 저장은 AsyncSurface의
indicator 분기라 실패 객체가 없고, 폼도 MAYBE_APPLIED 실패를 버렸다.
사용자가 가장 문의하고 싶은 경우에 줄 식별자가 없었다. 샘플의
contact-support 이동은 식별자를 버리고, 상태 페이지는 식별자처럼 보이는
고정 문자열 "REFERENCE-STATUS-DEMO"를 보였다.
고른 방법: 리뷰의 최소 개선 방향(기대 계약 고정)대로 했다.
- FormFailureStatus가 supportReference={failure.requestId}를 넘긴다.
- useAppForm이 MAYBE_APPLIED 실패도 보관하고 supportReference(현재
보이는 상태 실패 또는 결과 불명 저장의 requestId)를 돌려준다. failure는
여전히 상태 결과에만 값이 있어 FormFailureStatus가 결과 불명을 두 번
그리지 않는다.
- AsyncSurface가 supportReference prop을 받아 결과 불명 indicator에서만
보인다. 샘플 폼 페이지가 form.supportReference를 넘긴다.
- 샘플 contact-support 이동은 식별자를 history state로 넘기고(URL에
넣지 않음), 상태 페이지는 받은 문자열만 보이고 없으면 줄을 숨긴다.
공개 API는 추가만 했다(useAppForm 반환 필드, AsyncSurface prop).
버린 대안: 결과 불명 식별자를 mutation 채널(application-query.ts)에
두기 — 재마운트 뒤에도 남지만 925줄 파일의 채널 구조를 바꾸고 08-03
(raw 경로 정리)과 겹친다.
위험·한계: 폼이 재마운트되면 결과 불명 배너는 mutation 채널에서
남지만 식별자는 사라진다(제출 값과 같은 수명). 서버가
x-correlation-id를 노출하지 않으면 식별자가 없다(0929 FOLLOW-UP 03-03).
결과 불명 화면에 줄 하나가 생긴다. 초기 JS는 이번 브랜치 전체 기준
202,520 → 202,631 B(예산 204,800 B).
검증:
- RED: 새 테스트 6건이 수정 전 실패(form-foundation 2, async-surface 1,
reference-page 3. 예: "Unable to find an element with the text: 지원
참조: corr-save-500"). 새 e2e가 이전 빌드에서 실패(getByText('지원 참조:
corr-save-500') not found).
- GREEN: 관련 3파일 70/70, tests/component·features·architecture
59 files 336 tests 통과. e2e reference-save·reference-form·
reference-route chromium·firefox·webkit 42/42. tsc app·test, eslint,
check-i18n, check-design-system 통과.
Refs: docs/reviews/2026-09-29-maturity-review/08-presentation.md 08-04
문제: 접근성 기본 장치 일부를 지키는 테스트가 없었다. 리뷰 변이 중
M3(건너뛰기 링크 대상을 #content로), M4(LoadingSurface의 aria-live
제거), M5(상태 화면 제목을 <p>로), M6(사이드바 aria-label 제거)가
component 211개를 모두 통과했다. e2e의 axe는 WCAG 태그만 돌려
best-practice인 skip-link 규칙이 빠지고, 건너뛰기 링크를 누르는 e2e도
없었다.
고른 방법: 리뷰의 최소 개선 방향 그대로 단언을 더했다.
- app-shell.test.tsx: 건너뛰기 링크 href가 main의 id와 같고, 이름 있는
complementary 안에 주요 탐색이 있다.
- async-surface.test.tsx: LoadingSurface가 aria-busy와 aria-live="polite"를
가진다.
- accessibility.spec.ts: 건너뛰기 링크 Enter 뒤 포커스가 main 안에 있다.
- M5는 08-05 커밋의 제목 수준 테스트가 이미 잡는다.
버린 대안: axe에 best-practice 태그를 켜기 — 이번 범위 밖의 위반까지
한꺼번에 게이트가 된다.
위험·한계: 사이드바 이름 "사이드바"는 위치를 말하는 이름이라 리뷰가
관찰로 남겼다. 테스트는 지금 이름을 고정하므로 이름을 바꾸면 테스트도
같이 바꾼다. M3 변이 빌드에서 e2e는 공용 실행 잠금이 길게 잡혀
돌리지 못했다(component 테스트가 M3를 잡는다).
검증(테스트만 추가라 RED는 변이로 확인):
- M3: app-shell landmarks 테스트 실패(1 failed | 221 passed)
- M4: loading surface 테스트 실패(1 failed | 221 passed)
- M5(state-surfaces.tsx 제목을 <p>로): 08-05 테스트 2건 실패
- M6: app-shell landmarks 테스트 실패(1 failed | 221 passed)
- 변이 없음: tests/component 222/222, 새 e2e chromium·firefox·webkit 3/3.
tsc test 통과, eslint 통과.
Refs: docs/reviews/2026-11-01-maturity-review/08-presentation.md 08-09
문제: EmptySurface, TerminalErrorSurface, 접근 상태 화면, ErrorSummary의
제목이 h2로 고정돼 있다. Card(h3)나 상세 구획(h2) 안에 넣으면 그 안의
상태 문구가 카드 제목보다 상위 제목이 된다. /examples/states에서
h3 카드 안에 h2가 있었고, 섹션 h2 아래 접근 상태 화면도 h2였다.
상태 화면 제목을 <p>로 바꾸는 변이(M5)를 잡는 테스트도 없었다.
고른 방법: Card에 이미 있는 계약을 그대로 옮겼다. 위 네 컴포넌트에
headingLevel?: 2 | 3 | 4(기본 2)를 더하고, 이들을 그리는 AsyncSurface와
AccessSurface가 같은 prop을 넘긴다(그러지 않으면 가장 흔한 진입점에서
뒤집힘이 남는다). 타입은 state-surfaces.tsx의 HeadingLevel 하나에 둔다.
갤러리는 카드 안 상태에 4, 섹션 바로 아래 접근 상태에 3을 준다.
상태·오류 요약 CSS 선택자는 :is(h2, h3, h4)로 넓혔다. 공개 prop은 추가만
했고 기본값이 그대로라 기존 화면은 바뀌지 않는다. 버린 대안: 제목
수준 context(R7) — 모든 컨테이너가 제공자를 둬야 하고 Card의 prop
계약과 갈린다. Card의 인라인 2 | 3 | 4와 HeadingLevel을 합치는 것은
VD-05 재수출 경로를 건드려 이번 범위에서 뺐다.
위험·한계: 갤러리 화면이 바뀐다(카드 안 상태 제목 h4 16px, 접근 상태
h3 20px). 시각 골든은 오케스트레이터가 갱신한다. 실제 스크린 리더
제목 목록은 확인하지 않았다(접근성 트리 대신 component 단언).
검증:
- RED: async-surface.test.tsx 새 테스트 7건이 수정 전 실패(예: "expected
[ <h2></h2> ] to have a length of +0 but got 1").
- GREEN: async-surface.test.tsx 31/31, tests/component 220/220(4회 반복
통과, 부하 32에서 첫 실행 1건 실패 뒤 재현 안 됨). tsc app·test 통과,
eslint 통과. e2e accessibility·typography·reference-form·reference-save
chromium 27/27.
Refs: docs/reviews/2026-11-01-maturity-review/08-presentation.md 08-05
문제: RouteLifecycle이 pathname·search·navigationType을 effect 의존값으로
썼다. 그래서 URL에 묶은 필터를 바꾸면 포커스가 컨트롤에서 <main>으로
튀고, POP이 아니면 맨 위로 스크롤하고, route.changed를 한 번 더 남겼다.
이미 보고 있는 화면의 링크를 눌러도(React Router가 REPLACE로 바꿈)
navigationType만 바뀌어 같은 일이 났다. 템플릿은 필터를 URL에 두라고
권하므로 첫 목록 화면에서 바로 드러난다(WCAG 3.2.2).
고른 방법: 이동 판단을 route ID 또는 pathname 변경으로 좁혔다(리뷰 5.1
(B)). 포커스·스크롤·진단은 useEffectEvent로 옮겨 navigationType을 읽기만
하고 트리거로 쓰지 않는다. 검색값 변경에 맨 위가 필요한 화면(페이지
번호)은 그 화면이 직접 스크롤한다. routing 문서 6.3절에 규칙을 적었다.
버린 대안: (C) 라우트 계약에 searchChangeIsNavigation 선언 — 그런
라우트가 템플릿에 없고 생성기·문서까지 바뀐다. 필요해지면 (B) 위에
더할 수 있다. navigationType을 ref로 들고 있기 — 렌더 중 ref 쓰기라
React 19의 useEffectEvent보다 의도가 덜 드러난다.
위험·한계: 지금 검색값 변경을 이동으로 세던 대시보드가 있다면 수치가
준다. 실제 브라우저의 스크롤 유지는 jsdom이 스크롤을 건너뛰어 정적
확인만 했다. 테스트용 fixture 페이지에 URL에 묶은 select를 더했다.
검증:
- RED: router.test.tsx 새 테스트 2건이 수정 전 실패. 포커스가
<main id="main-content">에 있었고 route.changed가 필터 테스트 1→3,
링크 테스트 1→2로 늘었다.
- GREEN: router.test.tsx 11/11, tests/component 34 files 213 tests 통과.
tsc(app, test) 통과, eslint(바꾼 파일) 통과,
verify-documentation-readiness PASS_SCOPED.
- check:architecture는 pnpm 실행을 요구해 이 worktree에서 미실행.
Refs: docs/reviews/2026-11-01-maturity-review/08-presentation.md 08-02
문제: "Escape 뒤 포커스가 trigger로 돌아온다" 단언은 trigger를 클릭한
채로 Escape를 누른다. Popover는 열 때 포커스를 내용으로 옮기지 않으므로
포커스는 처음부터 끝까지 trigger에 있다. overlays.tsx의 Escape 처리에서
`triggerRef.current?.focus()`를 지워도(M15) 관련 테스트가 모두 통과한다.
내용 안의 버튼으로 Tab한 뒤 Escape를 누르는 키보드 사용자는 포커스를
잃어도 아무 테스트가 모른다(WCAG 2.4.3).
고른 방법: 열고 나서 Tab으로 내용 안의 "내부 작업" 버튼에 포커스를
옮기고, 그 버튼에 포커스가 있는지 먼저 단언한다. 그 뒤 Escape와 trigger
포커스 단언은 그대로 둔다. 리뷰 최소 개선안 그대로다.
위험·한계: 바깥 클릭으로 닫을 때의 포커스 반환(closeOutside)은 이
테스트가 보지 않는다. 이번 발견 범위 밖이다.
검증:
- RED(M15 적용): 변경 전 테스트 파일은 통과, 새 테스트는
"expect(element).toHaveFocus()" 실패(design-system-platform.test.tsx
trigger 단언).
- GREEN: 원본 overlays.tsx로 되돌리고 related overlays.tsx --run —
23파일 152 passed.
- eslint(바꾼 파일), tsc -p tsconfig.test.json 통과.
Refs: docs/reviews/2026-11-01-maturity-review/10-tests-fast-layers.md 10-02
문제: context gateway의 `ContextErrorBoundary`·`FeatureErrorBoundary`는
`onError`를 받지 않아 잡은 실패를 진단에 남기지 않고, 화면 지원 참조는
buildId뿐이다. 라우트 모듈이 청크 누락이 아닌 이유로 실패할 때(평가 중
throw, 15-01 뒤로는 기능 실행부 적재 실패)도 같은 화면만 그리고 기록이
없다. 안쪽 경계(`RenderErrorBoundary`) 밖에서 난 실패, 예를 들어 핸들의
route id가 레지스트리에 없거나 핸들에 라우트 codec이 없을 때는 사용자
신고로도 사건을 찾을 수 없다. 0929/08-05와 같은 결함이다.
고른 방법:
- `ScopedErrorBoundary`가 잡을 때 incident id를 만들어 `onError` 보고에
넣고, 함수형 fallback에 같은 id를 넘긴다. 둘 다 추가 변경이다(기존
ReactNode fallback과 `{scope, ownerId}`를 읽는 쪽은 그대로 동작).
- incident id 생성기를 `src/platform/errors/incident-id.ts`로 옮겨 두
경계 계열이 같은 함수를 쓴다(platform은 presentation을 import할 수 없다).
- gateway가 두 경계에 `reportRenderFailure` 호출과
`<buildId>:<incidentId>` 지원 참조를 넘긴다. context 경계는
`component_boundary`를 "route"로 보고한다. 진단·텔레메트리 계약에
context 값이 없고, 같은 gateway의 청크 복구 보고도 "route"를 쓴다.
- 비청크 적재 실패는 context 경계 안에서 다시 throw해 같은 보고 경로를
탄다. route id는 URL의 등록 라우트, 없으면 context id다.
버린 대안:
- 세 곳을 presentation `RouteBoundary`로 바꾸기(0929/08-05 제안): 경계
두 계열 통합(리팩토링 R4) 성격이고 context/feature 소유 범위 표시
(`data-boundary`, testid)가 바뀐다.
- gateway가 URL마다 incident id를 하나 만들어 두 경계에 나눠 주기:
두 경계가 같은 id를 공유해 사건 구분이 흐려진다.
- `component_boundary`에 "context" 추가: 진단·텔레메트리 계약과
레지스트리 기준선을 바꾸는 일이라 이번 범위 밖이다.
위험·한계:
- `APP_SHELL`의 `errorElement`(0929/08-05가 함께 적은 곳)는 그대로
buildId만 보이고 보고하지 않는다. React Router 오류 요소라 다른 방식
(useRouteError + 마운트 시 보고)이 필요해 남겼다.
- 실패한 context 안에서 URL을 바꾸면 경계가 리셋되고 다시 throw해 방문마다
한 번 보고한다.
- 화면 변화: context·feature 경계 실패 화면과 비청크 적재 실패 화면의
지원 참조가 `build:incident` 형식이 된다. 시각 골든에는 없는 화면이다.
- 초기 JS +58 B gzip(202,748 → 202,806 B, 여유 1,994 B).
검증:
- RED: tests/component/context-boundary-diagnostics.test.tsx 3건(context
경계: 미등록 핸들 id, feature 경계: codec 없는 핸들, 비청크 적재 실패)이
모두 `Unable to find an element with the text: /^지원 참조:
build-a:[0-9a-f]{8}$/`로 실패. 화면은 "지원 참조: build-a"였다.
- GREEN: 3건 통과. failure-boundary.test.tsx에 함수형 fallback이 보고한
incident id를 받는지 1건 추가, `onError` 보고 기대값에 incidentId 추가.
- 회귀: tests/{architecture,platform,component,features,scripts,contract}
95 files / 592 tests, tests/unit(pnpm을 띄우는 5개 제외) 164 files /
1,929 tests 통과. tsc app·test 통과. 바꾼 파일 eslint 통과.
check-architecture(shim), check-adapter-inventory, check-diagnostics,
check-registries 통과.
문제
초기 JS는 203,572 / 204,800 B(gzip)였다. 생성 인덱스가 각 기능의
feature-module.ts를 정적으로 import하고, 그 파일이 계약(zod 스키마·mapper
포함), HTTP 계약 contribution, application input 팩토리, route codec까지
모두 끌고 왔다. 참조 모양 기능 1개를 더하면 +3,922 B가 늘어 첫 기능에서
예산을 넘었다.
고른 방법
- 기능을 두 부분으로 나눈다. 선언(FeatureModule: route 표, route runtime
계약, invalidation, 문구, 부팅 때 release manifest와 맞춰 볼
contractPackages)은 초기 청크에 남는다. 실행부(FeatureRuntime: V2 API
계약, adapter contribution, contract contribution)는 feature-runtime.ts로
옮기고 loadRuntime이 동적 import한다. route codec은 context-routes.ts의
route handle에 실어 route와 함께 적재한다.
- 적재 시점은 그 기능의 route에 들어갈 때다. ContextRouteGateway가 route
모듈과 함께 application.features.load(featureId)를 부르고, 끝난 뒤에
화면을 그린다(공개 포트에는 load만 추가). 들어온 URL의 기능은 route
모듈과 병렬로 적재해 왕복을 늘리지 않는다. 런타임 설정으로 꺼진 기능은
적재하지 않는다.
- 조립부는 기능별 로더를 만든다(installed-feature-adapters.ts). contract
registry는 기능이 적재될 때마다 전체를 다시 합쳐 검증한다
(installed-contract-contributions.ts). 선언하지 않은 contract package를
적재하면 거절한다.
- 모든 실행부를 한꺼번에 읽는 registry(V2 API, contract contribution)는
installed-feature-runtime-registries.ts의 async 함수로, Node·테스트·
registry 거버넌스용 상수는 top-level await 모듈 loaded-feature-runtimes.ts로
둔다. src에서 후자를 import하면 새 아키텍처 규칙
boot-does-not-load-every-feature-runtime이 막는다. 플랫폼 구성 화면은
route 로더에서 async 함수를 불러 결과를 prop으로 받는다.
- vite.config.ts에 청크 그룹 2개를 둔다. rolldown은 부팅 그래프와 lazy
청크가 같이 쓰는 모듈을 importer 집합마다 따로 청크로 뗀다. 그대로 두면
기능마다 선언 청크가 하나씩 늘고(기능당 +1,471 B), 실행부와 공유하는
플랫폼 모듈(HTTP executor, contract runtime, zod)이 6개 청크로 쪼개져
템플릿 자체가 +438 B 커졌다. feature-declarations는 모든 기능의 선언을,
feature-platform은 실행부가 같이 쓰는 부팅 모듈을 한 청크로 묶는다.
render-boot-failure.tsx가 쓰는 모듈은 feature-platform에서 뺀다(09-03:
애플리케이션 그래프가 평가 중 던져도 실패 화면은 떠야 한다).
버린 대안
- 부팅 때 feature 청크를 미리 동적 import하고 기다린 뒤 렌더: 분류기는
lazy로 세지만 첫 렌더 경로의 바이트는 그대로다. 예산을 속이는 것이라
버렸다.
- 실행부 일부만 지연(adapter와 contribution만): 모두 같은 zod 스키마를
공유해 줄지 않았다. 실측 +4,031 B로 오히려 늘었다.
- 선언과 실행부를 같은 lazy 청크(context-routes)에 두기: 기능당
-60 B 수준이라 그룹 없이 목표에 못 미쳤다.
- 페이지 문구까지 실행부로 옮기기: 기능당 약 300~450 B를 더 줄이지만
i18n catalog를 런타임 등록 구조로 바꿔야 해 이번 범위에서 뺐다.
- boot.tsx를 별도 진입점으로 추가: 분류기가 boot의 동적 import를 모두
초기로 세어 218,303 B가 됐다.
위험·한계
- FeatureModule 모양이 바뀐다. 다운스트림 기능은 feature-runtime.ts로
실행부를 옮겨야 한다(BREAKING CHANGE).
- 기능 계약 간 중복(operation, schema, contribution) 검사가 부팅이 아니라
그 기능의 적재 시점과 Node 검사(loaded-feature-runtimes를 읽는 스크립트·
테스트)로 옮겨 간다.
- 기능 route에 처음 들어갈 때 실행부 청크(약 5 KB gzip)를 받는다. 플랫폼
구성 화면은 모든 기능의 실행부를 받은 뒤 그린다. lab 게이트(FE-GATE-026)가
재는 화면이라 LCP가 조금 늘 수 있다. 측정하지 않았다.
- 청크 그룹은 rolldown 자동 분할을 일부 대신한다. feature-declarations가
비면 기능당 증가 상한 테스트가 실패한다. feature-platform이 비면 템플릿
총량(약 2 KB)만 늘고 번들 예산 검사가 잡는다.
- config/contracts/registry-baseline.json의 FE-REG-API/SCHEMA source는 아직
installed-feature-contracts.ts다. 승인 digest가 걸려 있어 소유자 재승인
때 고친다. check-registries는 통과한다.
- 예산 안에 들어가는 참조 모양 기능은 약 3개다. 플랫폼 자체가 예산의
98.8%다.
수치 (vite build, classifyViteJavascript + gzipSync 기본 수준)
- 템플릿: 203,572 B(13파일) -> 202,361 B(16파일), -1,211 B
- 참조 복사본 +1: 207,494 B(+3,922) -> 203,102 B(+741)
- 참조 복사본 +2: 210,818 B(+3,324) -> 203,750 B(+648)
- 참조 복사본 +5: 205,629 B
- lazy JS: 23,516 B -> 28,204 B
검증
- RED: node scripts/run-vitest.ts run tests/unit/feature-shape-growth.test.ts
"adds at most 1 KiB ... (15-01)" 실패: expected 3934 to be less than or
equal to 1024
- GREEN: 같은 테스트 통과(+741 B)
- node scripts/run-vitest.ts run tests/unit: 168파일 2,383 통과
- node scripts/run-vitest.ts run tests/component tests/features
tests/integration tests/contract tests/runtime-schema tests/architecture
tests/platform tests/recipes (security-followup-archive 제외, pnpm 호출):
109파일 787 통과
- npx tsc --noEmit: app, node, test, recipes, web-worker, service-worker 통과
- npx eslint 바뀐 파일 통과
- check-architecture.ts(pnpm exec 대신 eslint를 부르는 shim): PASS, 새 규칙이
boot.tsx의 import를 거절하는 것 확인
- check-adapter-inventory, check-registries, verify-documentation-readiness,
check-ci-contract: PASS
- e2e Chromium 전체(pnpm 없는 build-frontend + vite preview, 별도 포트):
55 통과
- storybook build 성공
- 미실행: Firefox·WebKit e2e, 시각 회귀, lab 성능(FE-GATE-026),
pnpm 경로의 check:bundle, test:system
BREAKING CHANGE: FeatureModule은 id, contracts(선언), routes, messages,
loadRuntime만 가진다. adapters, contractContributions와 V2 API 계약
(apiOperations, schemas, runtimeSchemas, mappers)은 defineFeatureRuntime으로
만든 feature-runtime.ts로, route codec은 context-routes.ts의 route handle
codecs로 옮긴다. contracts에는 contractPackages를 추가한다.
Refs: docs/reviews/2026-11-01-maturity-review/15-performance.md 15-01,
16-structure-patterns.md 9절
문제
lazy route 화면을 findBy*·waitFor 기본값(1초)으로 기다리는 테스트가 1코어
부하에서 코드와 무관하게 떨어진다. 수정 전 재현에서
runtime-application.test.tsx:65 "Unable to find role=heading name=Clean
Architecture Frontend"와 reference-production-vertical.test.tsx:103
"Unable to find role=button name=로그인 시작"이 났다. 두 DOM 모두
route-loading(aria-busy) 상태였다. 지난 리뷰는 router.test.tsx:244-250도
같은 이유로 실패했다고 적었다. React 19는 Suspense를 풀 때마다 실제 300ms
타이머(FALLBACK_THROTTLE_MS)를 기다린다. context route 표와 lazy 페이지를
거치는 화면은 렌더링 전에 1초 중 600ms를 쓴다. 이 사정을 아는 파일만
호출마다 { timeout: 5000 }을 붙이거나(7개 파일 13곳) 파일 단위로
configure를 바꿨다(reference-page). 새 테스트 작성자는 이 규칙을 알 방법이
없다.
고른 방법
tests/setup.ts에서 configure({ asyncUtilTimeout: 5_000 })를 한 번 정하고,
같은 값을 반복하던 호출·파일 단위 override를 지웠다. findBy*·waitFor는
DOM 변화가 오면 바로 끝나므로 기한은 멈춤을 알리는 용도뿐이다. 10초 테스트
제한의 절반이라 진짜 멈춤은 여전히 Testing Library의 DOM 덤프와 함께
실패한다. 기한을 늘리는 방식이라 고른 이유를 setup에 주석으로 남겼다.
버린 대안
- 가짜 시계: Testing Library는 Jest의 가짜 타이머만 알아본다
(jestFakeTimersAreEnabled가 jest 전역을 본다). Vitest 가짜 타이머에서
waitFor는 자기 타이머가 멈춰 끝나지 않는다. MSW와 user-event도 실제
시계로 돈다.
- route chunk를 테스트에서 미리 import하기: chunk를 받아도 React의 300ms
reveal 타이머와 렌더링 비용은 그대로 기한 안에 남는다. 테스트가 route
모듈 목록을 따로 알아야 한다.
- 실패한 파일에만 timeout 붙이기: 지금 상태와 같다. 다음 lazy 화면
테스트에서 같은 실패가 반복된다.
위험·한계
- 기다리다 실패하는 테스트는 실패까지 1초가 아니라 5초 걸린다. 부재를
findBy·waitFor의 실패로 확인하는 테스트는 없다(grep으로 확인).
- 가짜 타이머를 쓰는 테스트의 waitFor는 이 값과 무관하다(가짜 시간).
검증
- RED(수정 전, taskset -c 0 + 같은 코어의 바쁜 이웃 1개, --maxWorkers=4,
component·features·integration·platform/cardinality): 3회 중 1회 위 두
테스트 실패.
- GREEN(같은 조건): 대상 6개 파일 6회, 넓은 묶음 5회 모두 통과. 바쁜
이웃 2개로 3회 돌렸을 때도 이 커밋이 다루는 테스트는 모두 통과했다.
넓은 묶음 한 번의 시간은 RED 91~111s(실패가 몰린 209s 회차 제외)
-> GREEN 86~88s다.
- 기본 코어: tests/unit·component·integration 212파일 2,734개, features·
platform·architecture·contract·runtime-schema 60파일 403개 통과.
tsc -p tsconfig.test.json, 바꾼 파일 eslint 통과.
Refs: docs/reviews/2026-09-29-maturity-review/10-tests-fast-layers.md
표를 감싼 스크롤 영역이 키보드 포커스(tabIndex 0)를 받지만 역할과
이름이 없었다. 스크린 리더가 이름 없는 정지점으로 읽었다.
영역에 role="region"을 주고 caption을 aria-labelledby로 연결했다.
위험: 없음. 시각 변화가 없다.
검증: 이름 있는 region을 요구하는 컴포넌트 테스트가 고치기 전 실패했고,
고친 뒤 통과했다(design-system-platform.test.tsx 10/10).
Only the optional host was tested, so removing the composition line that hands
it the telemetry port kept every test green. The real composition with an
ACTIVE selection and a failing first install now must emit one event, and the
recipe doc names what the template still leaves unwired.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
package.json and public/release-manifest.json carry the version the
release manifest reports; the three tests that build a manifest for the
installed app use the same value. Test fixtures that pin 0.1.0 as an
arbitrary release stay as they are.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Save failures outside sign-in, permission and retry still went into
ErrorSummary under "review the entered information". They now reach
FormFailureStatus with their own copy and action; the unused copy is gone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The page links prevented every click, so Ctrl/Cmd/Shift-click changed the page
in place instead of opening a new tab.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AsyncSurface drew auth-required, forbidden and not-found query failures with
its own copy while the gallery used AccessSurface. Both now use one set, and
a state surface without a handler shows no dead button.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The form kept translated strings in state, so errors already on screen stayed
in the old language. It now keeps message keys and translates on render.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Route render, unrecovered chunk and query failure screens now show the id
a user quotes to support, and the render diagnostic records the same id as
correlation_id. The route failure page also offers a reload.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A config or manifest request that failed or timed out left only an error code
on screen. The boot shell now explains and offers a "try again" button for
those codes; it never reloads on its own, so the reload-once rule holds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
check:diagnostics refuses direct console use in src. The development report of
an unclassified boot error now goes through reportError, which still lands in
the browser console.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
A module that threw while evaluating stopped main.tsx before boot() ran, so the
static loading shell stayed up. The entry now imports the app (boot.tsx)
dynamically and renders the shell on rejection; the shell reads boot messages
without the feature catalog. The preload helper gets its own chunk so lazy
chunks do not import the per-build entry, and the bundle budget counts the
entry's dynamic imports as initial JS.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The bundle applied the selection at runtime while Node build scripts and the
context router ignored it, and a typo only failed in the browser. The generator
now imports only the selected features and rejects unknown ids (D-9); declared
ids stay in the index for NOT_INSTALLED reporting. Default build modules are
unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every non-input save failure became "unavailable" under the "review the entered
information" summary, with no sign-in button. useAppForm now reports
reauth-required, forbidden and retry-later with the failure, and
FormFailureStatus shows each one's copy and action outside ErrorSummary.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A save whose response was lost minted a new key on the next submit, and the
screen let the user declare "not applied" without evidence. The same canonical
input now reuses the unknown admission's intent; the screen offers "send the
same request again" and a list refresh link instead.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Six platform tests imported or named the removable reference feature, so
FE-GATE-020 failed on typecheck, unit, coverage, home smoke and residue.
Router surfaces now install tests/helpers/fixture-feature.tsx by mocking
the generated indexes; the rest use neutral names or read the installed
modules. test:sample-removal passes 13/13.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A disabled query (no data, no error, not fetching) fell through
deriveAsyncState to "empty", so AsyncSurface rendered the
"no items" copy before the query had even started.
- AsyncState.base gains "idle" for "not started / waiting on a
precondition". A completed empty result (`[]`, `""`, `null`) stays
"empty"; a real first load stays "initial-loading".
- AsyncSurface renders an optional `idle` slot for idle, else nothing
(no skeleton, no aria-busy, no empty copy, no children).
Consumer-facing: AsyncState["base"] union adds "idle" (additive);
AsyncSurface gains an optional `idle` prop. No in-repo exhaustive
switch over base needed changes.
RED (before the fix, node scripts/run-vitest.ts on the two files):
application-query-bridge > disabled query: expected 'empty' to be 'idle'
async-surface > derives base state 4 ({}): expected 'empty' to be 'idle'
async-surface > idle renders neither loading nor empty:
toBeEmptyDOMElement() received the empty-copy section
Tests 3 failed | 25 passed (pins for first load, [] and null empty passed)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Chunk recovery kept its own guard: marker keyed by the release pair, no
TTL, trusted write().ok. Round 1 fixed the boot guard (key-independent
marker within a TTL, read-back check) but the chunk copy still reloaded
on every failure when replicas alternated A->B, B->A.
platform/release gains createReloadOnceGuard (the round-1 boot rule,
now with a refusal reason); createReleaseMismatchRecovery wraps it with
unchanged boot semantics (marker within TTL blocks regardless of key,
markCoherentBoot clears), and decideChunkRecovery uses it over its own
CHUNK_RELOAD_GUARD key, keeping its reason vocabulary. Application ->
platform is allowed by .dependency-cruiser.json; platform may not import
application, so the guard lives in platform.
Behavior change (chunk only): a second reload within the TTL is refused
even for a different release pair, and a marker that does not read back
is guard-write-failed. tests/component/context-route-gateway.test.tsx
used a preferences stub that dropped writes; it now persists them.
Verified: tests/unit/chunk-recovery.test.ts characterization (read/write
failure, same pair, invariants) green before the change; alternating
pair test RED before, green after. Boot tests unchanged and green;
FE-RB-002 drill PASS; test:integration PASS; all gates PASS.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Boot awaits runtime config (5s budget), the release manifest (5s) and
contract-set checks before its first render, and #root was empty the
whole time with no busy state. index.html now ships a static loading
status (role="status", aria-busy="true", the existing state-surface
loading class) inside #root; createRoot's first render — the app or the
BootErrorShell — replaces it.
Verified: tests/component/bootstrap-shell.test.tsx reads index.html
(RED before: no busy status) and checks the first React render removes
the shell; `pnpm build` keeps the shell in dist/index.html with the
render-blocking CSS link. All gates pass; test:reference-feature's
production-vertical test timed out once on "로그인 시작" and passed on
rerun (timing flake, unrelated file).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The render boundary's default fallback reads the current locale instead
of formatting ko-KR, and resolveMessage's "message unavailable" fallback
comes from the requested locale's catalog (ko-KR only as a last resort).
SearchField's clear button moves focus to the input before it unmounts,
so focus no longer drops to the body.
tests/unit/i18n-contract.test.ts expected the Korean fallback for en-US,
which encoded the bug; it now expects the English copy and keeps a ko-KR
case. New component cases for the boundary fallback and SearchField
(RED: 3 failed before the change); lane gates pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
useAppForm holds one submission from validation to outcome, so a second
submit during an async refine returns the running submission instead of
submitting again (the pending ref used to be set only after
safeParseAsync). A successful save commits its settled values with
flushSync before submitForm resolves, so a navigate() right after the
save meets a clean form and the dirty guard does not ask to discard.
Verified with two new form-foundation cases (RED: submit ran twice; the
discard dialog blocked navigation) and the lane gates.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
D-16. The platform `none` codec strips unknown keys instead of rejecting
them, so `/?utm_source=x` or an OAuth callback parameter no longer renders
"invalid address". The canonical redirect keeps the query of a route whose
search codec is `none`, so the URL itself is not rewritten.
router.test.tsx used `/examples/ui?unexpected=1` as its invalid-address
case, which encoded the old behavior; it now uses the reference list with
`?limit=invalid`. New router case (RED before the change) checks the page
renders and the URL keeps `?utm_source=mail`; lane gates pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pagination links only the first and last page, the current page and its
neighbours, with an aria-hidden ellipsis for a longer gap and the page
itself for a one-page gap, so 5000 pages render five links instead of
5000. Inside CollectionPage, whose slot already is the pagination `nav`,
Pagination renders a labelled group instead of a nested `nav`; on its own
it stays a navigation landmark.
Verified with tests/component/pagination.test.tsx (RED: 3 of 5 failed
before the change) and the lane gates.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tooltip injects `aria-describedby` into its focusable child (merged with
any existing value) instead of a non-focusable wrapper span, and Escape
hides the tooltip until the next hover or focus (WCAG 1.4.13). The
listener is on the document so a hovered, unfocused trigger closes too.
Verified with tests/component/tooltip.test.tsx (RED: 3 of 3 failed before
the change) and the lane gates.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Route-level loading (Suspense fallback, context gateway, chunk check) now
renders LoadingSurface, which gains optional visible copy; route-level
auth-required, integration-required, invalid-address, disabled-feature,
failure and 404 screens render StatusPage, which gains an optional
`surface` marker and children slot. Visible copy, h1 headings, data-surface
markers and alerts are unchanged; the 404 home link is a router link.
The unlabelled context gateway loading now has an accessible name.
Session buttons in the shell, the auth-required screen and the auth example
share useSessionAction: one pending/failed state and sign-in returns to the
current URL including its hash (the auth example dropped the hash).
PageActionBar keys actions by position so a pending label does not remount
the pressed button.
The home and platform overview release loaders now handle a rejected
summary instead of showing "checking" forever.
Pinned first with tests/component/route-status-surfaces.test.tsx (RED: auth
example hash and both loaders; loading, auth-required, shell session and
404 link characterized before the change), plus the lane gates.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LinkButton, Breadcrumbs items and page link actions accept an additive
`to` target rendered as a router Link, so in-app links keep the router
basename and navigate without a document reload. `href` still renders a
plain anchor. Pagination builds its page links from the current search
(router location, or the document URL outside a router) and only replaces
`page`, so other search parameters survive.
Verified with tests/component/design-system-links.test.tsx (RED: 5 of 6
failed before the change) and the lane gates.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(a) ContextRouteGateway had no key, so React Router reused one instance
across sibling contexts. On a context A -> B move the first render still
held A's routes, matched B's URL against them and mounted NOT_FOUND, which
reported route.changed(NOT_FOUND) and moved title/focus once. The gateway
element is now keyed by the context id.
(b) A rejected loadRoutes() always showed RouteFailureSurface, so a
routes module missing after a deploy never reached recoverChunk. A chunk
load failure is now rethrown inside a ChunkRecoveryBoundary keyed on the
chunk of the registered route the URL names (the routes module has no
manifest entry of its own; recoverChunk needs one to decide
reload-once). Other load errors still show RouteFailureSurface.
Verified: new tests/component/context-route-gateway.test.tsx mocks the
app with contexts cut from the real reference routes. RED "never matches
a new context's URL against the previous context's routes" (NOT_FOUND
reported) and "sends a failed routes-module download through chunk
recovery" (navigation.reload never called after a release change) failed
before and pass after. check:architecture, check:types:app,
check:types:test, lint, test:component, test:reference-feature pass;
test:unit passes except the pre-existing removal-fixture test (needs
generated artifacts/ files absent from a fresh worktree).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LocaleProvider and ThemeProvider lived inside AppRouter, below the
server-state scope fence (and below QueryClientProvider keyed by
generation). A session change (FENCED -> READY) unmounted and remounted
them, so their live state was thrown away and re-read from storage. The
browser router was created in useMemo and never disposed, so every
remount (and StrictMode's double useMemo) left a popstate listener behind.
- New presentation/providers/preference-providers.tsx: persisted
LocaleProvider + ThemeProvider (the wiring T45 added to AppRouter).
- bootstrap/runtime-application.tsx: ApplicationProvider >
PreferenceProviders > ServerStateGenerationProvider > AppRouter, so the
fence only remounts session-scoped UI.
- AppRouter no longer mounts Locale/Theme. It creates the router in the
effect that disposes it: a disposed router never listens to history
again, so useMemo + cleanup would break back/forward under StrictMode's
replayed mount.
- Tests that mount AppRouter directly now wrap it in PreferenceProviders
(router, chunk-recovery-boundary, app-shell, product-feature-switch,
locale-platform, reference-feature reference-page).
Verified: RED "keeps locale state across a session scope fence and
disposes routers" (RuntimeApplication, demo sign-in, storage cleared after
choosing en-US) came back in Korean before and passes after; with the
providers hoisted but no dispose it fails on popstate listeners (4 added,
0 removed). check:architecture, check:types:app, check:types:test, lint,
test:component, test:reference-feature pass; test:unit passes except the
pre-existing removal-fixture test (needs generated artifacts/ files absent
from a fresh worktree).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The locale lived only in LocaleProvider state, so every remount (reload,
or the scope fence after a session change) started again from ko-KR.
The theme already persisted through preferences.setColorScheme; the
locale now uses the same path (D-5):
- contracts/storage-keys.ts: LOCALE key next to COLOR_SCHEME
(localStorage, public-preference, opaque-string-v1).
- application preferences port: additive getLocale()/setLocale(). The
application treats the tag as opaque; presentation owns the locale
list and normalizes what it reads back.
- LocaleProvider: optional onLocaleChange; the provider stays
storage-free so standalone uses and tests are unchanged.
- AppRouter mounts LocaleProvider from the stored locale and persists
changes (T46 moves this above the scope fence).
Verified: RED "stores the chosen locale and starts the next mount from
it" failed before (nothing written to LOCALE) and passes after.
check:architecture, check:types:app, check:types:test, lint,
test:component pass; check:registries PASS (compatibility unchanged from
baseline); test:unit passes except the pre-existing removal-fixture test
(needs generated artifacts/ files absent from a fresh worktree).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Navigating from the mobile drawer left focus on the menu button. The
route's main.focus() ran while the modal drawer was still open (the page
is inert then, so the call is ignored), the shell closed the drawer one
commit later, and the Dialog's deferred restore moved focus to the menu
button.
- app-shell.tsx: drawer links close the drawer on click, so the modal is
closed before the route commits and the route can take focus.
- core.tsx (Dialog): the deferred restore only runs while focus is still
unclaimed (body/null or inside the dialog). React usually commits the
navigation before setTimeout(0) fires in a browser; without this the
restore would take focus back from the new page. Escape still returns
focus to the trigger, because focus is inside the dialog then.
Verified: new tests/component/app-shell.test.tsx emulates modal
inertness (jsdom has no showModal/inert). RED "hands focus to the new
page when a drawer link navigates" ended on the menu button before and
passes after; "still returns focus to the menu button when Escape closes
the drawer" passes. New Dialog test "does not pull back focus that moved
out of a closed drawer" fails without the core.tsx guard. check:architecture,
check:types:app, check:types:test, lint, test:component pass; test:unit
passes except the pre-existing removal-fixture test (needs generated
artifacts/ files absent from a fresh worktree).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RouteLifecycle lived inside the route content, which ProtectedRoute,
InvalidRouteSurface and DisabledFeatureSurface never render. On those
screens document.title kept the previous page's title, focus stayed on the
link the user left (screen readers got no page-change cue), and no
route.changed diagnostic was recorded.
RegisteredRoute is now a thin wrapper that renders RouteLifecycle first and
the former body (renamed RouteSurface) after it, so every branch gets title,
main focus and telemetry, and the lifecycle effect still runs before the
page heading's focus effect.
Verified: RED "runs the route lifecycle on the {authentication-required,
invalid-route, disabled-feature} surface" (focus left on a nav link, then a
history navigation) all failed before with the home title still set and
pass after. check:architecture, check:types:app, check:types:test, lint,
test:component, test:reference-feature pass; test:unit passes except the
pre-existing removal-fixture test (needs generated artifacts/ files absent
from a fresh worktree).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RouteLifecycle ran title, main focus, scroll-to-top and reportRouteChanged
in one effect that depended on message/resolve, which the LocaleProvider
recreates on every locale change. Changing the language therefore moved
focus off the language select (main, then the h1), scrolled to the top
and reported a route change, against the routing doc's "locale change
re-renders the title and copy only" contract.
The title now has its own effect (locale-dependent). Focus, scroll and
telemetry run on pathname/search only; location.key is dropped, so a
hash-only move (skip link, error summary #field) no longer re-runs them.
Verified: RED "changes only the title and copy when the locale changes"
failed before (focus moved off the locale select) and passes after; it
also checks document.title and the route.changed count. check:architecture,
check:types:app, check:types:test, lint, test:component pass; test:unit
passes except the pre-existing removal-fixture test (needs generated
artifacts/ files absent from a fresh worktree).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
useApplicationQuery passed TanStack's isPending as isInitialLoading. A
disabled query without data is pending (fetchStatus "idle"), so dependent
queries waiting on a prerequisite showed a skeleton and aria-busy forever.
Two changes were needed:
- application-query.ts passes isPending && fetchStatus !== "idle". The
review suggested isLoading, but with the default networkMode "online" an
offline first load is "paused" (isFetching false), and isLoading would
stop showing it as loading.
- deriveAsyncState fell back to "initial-loading" whenever there was no
data, no failure and no load, so the signal fix alone still produced
initial-loading (checked). The fallback is now "empty". This also stops a
query that resolves to null from looking like it loads forever.
Verified: RED "does not report a disabled query without data as loading"
failed with base "initial-loading" before and passes after; "still
reports a real first load as loading, including a paused offline one"
guards the other direction. check:architecture, check:types:app,
check:types:test, lint, test:component pass; test:unit passes except the
pre-existing removal-fixture test (needs generated artifacts/ files absent
from a fresh worktree). test:reference-feature also passes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>