문제 Service Worker를 켜는 유일한 방법은 src/features/installed-runtime-capabilities.ts의 SERVICE_WORKER 상수를 바꾸는 것이었다. 그 파일에는 "Product-owned." 표시가 없고, 매뉴얼 03 D절은 src/features/installed-*.ts를 고치지 말라고 한다. 매뉴얼대로 하면 SW를 켤 수 없고, 켜면 동기화마다 템플릿 파일을 손으로 병합한다. 템플릿 상태 설명과 제품 선택 상수가 한 블록에 섞여 있었다(1101/09-05). 고른 방법 리뷰의 최소 방향을 따른다. - 선택 상수 넷(REALTIME, WEB_WORKERS, SERVICE_WORKER, OFFLINE_COMMANDS)을 제품 소유 src/features/product-capabilities.ts의 PRODUCT_RUNTIME_CAPABILITY_SELECTION으로 옮긴다. 09-02에서 만든 같은 새 제품 소유 파일이다. product-contracts.ts에 넣지 않은 이유: 계약 층(src/contracts)이 아니라 기능 카탈로그 옆의 선택이고, 템플릿은 복사 뒤 기존 제품 소유 파일에 칸을 더하지 않는다. - installed-runtime-capabilities.ts는 템플릿 소유로 남고 그 선택을 검사 (validateRealtimeContributions, validateWebWorkerContributions)하고 투영만 한다. §3.5 설명과 템플릿 상태 설명은 여기에 남는다. - 매뉴얼 03 C절에 "SW 켜기"를 넣었다. 조립 거절 메시지, e2e SW 빌드 도우미의 편집 대상(premise 1), 레시피·운영 문서, dependency-cruiser 주석의 경로를 새 파일로 바꿨다. - 09-02 typecheck 테스트는 이제 출하된 product-capabilities.ts에 타입만 채우고 (선택은 유지), 복사 목록은 REMOVAL_FIXTURE_COPY_TARGETS 하나를 쓴다. 위험·한계 - 리뷰가 함께 제안한 composeProduct의 SW 연결 칸(blockers, observe)은 만들지 않았다. 그 연결은 여전히 템플릿 파일 create-runtime-composition.ts를 고쳐야 한다. 매뉴얼 "SW 켜기"에 적었다. - 템플릿 안의 선택을 이미 바꾼 다운스트림은 값을 새 파일로 옮겨야 한다. 검증 - RED: tests/unit/product-runtime-capability-selection.test.ts 3건(선택이 제품 소유 파일에만 있음, 제품 SW 선택 투영, 잘못된 선택은 여전히 검사)이 수정 전 실패. - 그 테스트, service-worker-build-output, optional-runtime-host, runtime-composition-service-worker-telemetry, product-features, product-extension-typecheck, runtime-adapters 통과. - check:types, check:architecture, eslint, verify:documentation PASS_SCOPED. Refs: docs/reviews/2026-11-03-maturity-review/09-app-core.md 09-05
47 lines
2.1 KiB
TypeScript
47 lines
2.1 KiB
TypeScript
import type { InstalledRuntimeCapabilities } from "../contracts/runtime-capabilities.ts";
|
|
import {
|
|
validateRealtimeContributions,
|
|
} from "../contracts/runtime-capabilities.ts";
|
|
import { validateWebWorkerContributions } from "../contracts/web-worker.ts";
|
|
import { PRODUCT_RUNTIME_CAPABILITY_SELECTION } from "./product-capabilities.ts";
|
|
|
|
/**
|
|
* §3.5. Static optional capability selection SSOT.
|
|
*
|
|
* Runtime Config can only disable what was selected at build time, and no
|
|
* dynamic import path is ever built from a configuration string.
|
|
*
|
|
* 1103/09-05. The selection itself is the product's: it is declared in the
|
|
* product-owned `product-capabilities.ts`, and turning the Service Worker on
|
|
* edits that file. This file stays the template's and only validates and
|
|
* projects it.
|
|
*
|
|
* Only the Service Worker is installed by a selection alone. Realtime, Web
|
|
* Workers and offline commands have no runtime in the composition yet: a
|
|
* selection without one makes `createOptionalRuntimeHost` refuse to compose
|
|
* (09-07).
|
|
*
|
|
* The template ships every selection empty, matching the §25 stop conditions:
|
|
*
|
|
* - realtime: `NOT_SELECTED`. The RT-01..RT-04 common runtime exists and is
|
|
* independently verified, but no product contribution supplies an exact
|
|
* endpoint, event descriptor and recovery mode (§13.6).
|
|
* - webWorkers: `NOT_SELECTED`. No profiled CPU-bound task with an owner
|
|
* exists, so no production worker entry is created (§16.2).
|
|
* - serviceWorker: `null`. Switching to `ACTIVE` also enables the two-pass
|
|
* build in `scripts/build-frontend.ts`.
|
|
* - offlineCommands: `NOT_SELECTED`. No external package declares a `KEYED`
|
|
* operation with a recovery descriptor (§19.3).
|
|
*/
|
|
export const INSTALLED_RUNTIME_CAPABILITIES: InstalledRuntimeCapabilities =
|
|
Object.freeze({
|
|
realtime: validateRealtimeContributions(
|
|
PRODUCT_RUNTIME_CAPABILITY_SELECTION.realtime,
|
|
),
|
|
webWorkers: validateWebWorkerContributions(
|
|
PRODUCT_RUNTIME_CAPABILITY_SELECTION.webWorkers,
|
|
),
|
|
serviceWorker: PRODUCT_RUNTIME_CAPABILITY_SELECTION.serviceWorker,
|
|
offlineCommands: PRODUCT_RUNTIME_CAPABILITY_SELECTION.offlineCommands,
|
|
});
|