diff --git a/.dependency-cruiser.json b/.dependency-cruiser.json index 7ab151ca..5e19e4f3 100644 --- a/.dependency-cruiser.json +++ b/.dependency-cruiser.json @@ -58,14 +58,14 @@ }, { "name": "zod-is-reached-through-contracts-zod", - "comment": "F-7 (13-08). src/contracts/zod.ts sets zod jitless before any schema is built, so the production CSP never sees zod's Function probe. Schema code imports z from there.", + "comment": "F-7 (13-08). src/contracts/zod.ts sets zod jitless before any schema is built, so the production CSP never sees zod's Function probe. Schema code imports z from there. A subpath (zod/v4, zod/mini) is the same zod and counts too (0929/P-07-06).", "severity": "error", "from": { "path": "^src", "pathNot": "^src/contracts/zod\\.ts$" }, "to": { - "path": "^zod$" + "path": "^zod(/|$)" } }, { @@ -172,7 +172,7 @@ }, { "name": "unselected-realtime-runtime-is-not-composed", - "comment": "§9.2 / 12-10. Realtime and Web Push are NOT_SELECTED in the template (src/features/installed-runtime-capabilities.ts), so the composition root and the installed-feature registries do not import their concrete adapters. A project that selects one replaces this rule when it wires the runtime. Owner: frontend-platform.", + "comment": "§9.2 / 12-10. Realtime and Web Push are NOT_SELECTED in the template (src/features/product-capabilities.ts), so the composition root and the installed-feature registries do not import their concrete adapters. A project that selects one replaces this rule when it wires the runtime. Owner: frontend-platform.", "severity": "error", "from": { "path": "^src/(bootstrap/|features/installed-feature-)" @@ -237,9 +237,21 @@ "path": "^src/features/installed-" } }, + { + "name": "boot-does-not-load-every-feature-runtime", + "comment": "15-01. src/features/loaded-feature-runtimes.ts awaits every installed feature's runtime half at module evaluation. Imported anywhere on the boot path, the first render would wait for all feature code, and the initial-chunk budget would not see it because the runtimes are dynamic imports. Any top-level await in the browser graph also turns off rolldown chunk optimizations for the whole build. At runtime the composition root loads one feature at a time when its routes are entered; the platform overview route calls loadInstalledFeatureRuntimeRegistries() instead. Node scripts and tests are outside src and may import it. Owner: frontend-platform.", + "severity": "error", + "from": { + "path": "^src/", + "pathNot": "^src/features/loaded-feature-runtimes\\.ts$" + }, + "to": { + "path": "^src/features/loaded-feature-runtimes\\.ts$" + } + }, { "name": "adapters-do-not-know-other-concrete-adapters", - "comment": "docs/architecture/layers.md §4: a concrete adapter never depends on another concrete adapter. The adapter kernel is shared on purpose and any adapter may import it: src/adapters/platform/** (clock, abort primitive, capacity guard), src/adapters/browser-file-storage/result.ts (browser-data result helpers) and src/adapters/cross-context-invalidation/index.ts (the cross-context invalidation transport and its types). Owner: frontend-platform. No new file-level exception is added here; a new shared primitive goes into src/adapters/platform/.", + "comment": "docs/architecture/layers.md §4: a concrete adapter never depends on another concrete adapter. The adapter kernel is shared on purpose and any adapter may import it: src/adapters/platform/** (shared mechanisms only: clock, abort primitive, capacity guard, IndexedDB connection and transaction, Retry-After, JSON member scanner; plus two bootstrap-only services, see layers.md), src/adapters/browser-file-storage/result.ts (browser-data result helpers) and src/adapters/cross-context-invalidation/index.ts (the cross-context invalidation transport and its types). Owner: frontend-platform. No new file-level exception is added here; a new shared primitive goes into src/adapters/platform/.", "severity": "error", "from": { "path": "^src/adapters/([^/]+)/" @@ -312,7 +324,7 @@ }, { "name": "observability-vendors-live-behind-adapters", - "comment": "Spec §24. Features, platform, application, domain, contracts and presentation emit observability only through the provider-neutral TelemetryPort. A vendor telemetry SDK may be imported only by an adapter-side transport under src/adapters.", + "comment": "scale-architecture.md §24. Features, platform, application, domain, contracts and presentation emit observability only through the provider-neutral TelemetryPort. A vendor telemetry SDK may be imported only by an adapter-side transport under src/adapters.", "severity": "error", "from": { "path": "^src/", @@ -324,7 +336,7 @@ }, { "name": "platform-kernel-is-product-neutral", - "comment": "Spec §4. src/platform holds product-neutral primitives (budgets, execution, telemetry pipeline, validation, error envelopes). It never reaches up into a concrete feature, context, adapter, bootstrap or presentation module. Exception: src/platform/routing composes deployable-app descriptors by type. Owner: frontend-platform. Revisit if routing gains a product-specific import.", + "comment": "scale-architecture.md §4. src/platform holds product-neutral primitives (budgets, execution, telemetry pipeline, validation, error envelopes). It never reaches up into a concrete feature, context, adapter, bootstrap or presentation module. Exception: src/platform/routing composes deployable-app descriptors by type. Owner: frontend-platform. Revisit if routing gains a product-specific import.", "severity": "error", "from": { "path": "^src/platform/", diff --git a/.env.example b/.env.example index 47d62975..80f19b81 100644 --- a/.env.example +++ b/.env.example @@ -5,8 +5,11 @@ # # Runtime configuration — API endpoints, auth mode, telemetry, capability # switches — is NOT here. It lives in `config/runtime/.json` and is -# materialized into `dist/config.json` at build time, so it can be changed -# without rebuilding. See the "Runtime configuration" section of README.md. +# materialized into `dist/config.json` at build time. Only the emergency +# switches (CAPABILITY_OVERRIDES, FEATURE_OVERRIDES) may be changed in a +# deployed config.json without rebuilding, by the checked procedure in +# docs/runbooks/FE-RB-001.md. See the "Runtime configuration" section of +# README.md. # # Copy to `.env.local` (git-ignored) to override locally. diff --git a/.gitea/workflows/quality-gates.yml b/.gitea/workflows/quality-gates.yml index 273556ee..3841d543 100644 --- a/.gitea/workflows/quality-gates.yml +++ b/.gitea/workflows/quality-gates.yml @@ -51,6 +51,7 @@ jobs: - { gate: FE-GATE-009, name: accessibility, browser: true } - { gate: FE-GATE-010, name: architecture, browser: false } - { gate: FE-GATE-011, name: build, browser: false } + - { gate: FE-GATE-012, name: bundle, browser: false } - { gate: FE-GATE-013, name: security, browser: false } - { gate: FE-GATE-020, name: removability, browser: false } steps: @@ -66,7 +67,9 @@ jobs: corepack pnpm install --frozen-lockfile --ignore-scripts - name: Install Playwright browsers if: ${{ matrix.browser }} - run: corepack pnpm exec playwright install --with-deps chromium firefox webkit + run: | + corepack pnpm exec playwright install --with-deps chromium firefox webkit + $(command -v sudo || true) apt-get install -y fonts-noto-core fonts-noto-cjk fonts-noto-cjk-extra fonts-liberation - name: Run blocking gate run: corepack pnpm ci:gate -- ${{ matrix.gate }} - name: Upload merge gate evidence @@ -87,7 +90,6 @@ jobs: fail-fast: false matrix: include: - - { gate: FE-GATE-012, name: bundle, browser: false } - { gate: FE-GATE-014, name: config-compatibility, browser: false } - { gate: FE-GATE-026, name: lab-performance, browser: true } - { gate: FE-GATE-028, name: manual-accessibility-review, browser: false } @@ -104,7 +106,9 @@ jobs: corepack pnpm install --frozen-lockfile --ignore-scripts - name: Install Playwright browsers if: ${{ matrix.browser }} - run: corepack pnpm exec playwright install --with-deps chromium firefox webkit + run: | + corepack pnpm exec playwright install --with-deps chromium firefox webkit + $(command -v sudo || true) apt-get install -y fonts-noto-core fonts-noto-cjk fonts-noto-cjk-extra fonts-liberation - name: Run blocking gate run: corepack pnpm ci:gate -- ${{ matrix.gate }} - name: Upload release gate evidence @@ -366,15 +370,29 @@ jobs: node scripts/cleanup-verified-promotion.ts fi + deployment: + name: deploy-promoted-release + needs: [immutable_build, promotion] + if: ${{ gitea.event_name == 'workflow_dispatch' && (inputs.stage == 'production' || inputs.stage == 'field') }} + runs-on: ubuntu-latest + timeout-minutes: 45 + outputs: + deployed: ${{ steps.deploy.outputs.deployed }} + steps: + - name: Deployment slot is empty + id: deploy + run: echo "deployed=false" >> "$GITHUB_OUTPUT" + production_gate: name: "${{ matrix.gate }} / ${{ matrix.name }}" - needs: [immutable_build, promotion] + needs: [immutable_build, promotion, deployment] if: ${{ gitea.event_name == 'workflow_dispatch' && (inputs.stage == 'production' || inputs.stage == 'field') }} runs-on: ubuntu-latest timeout-minutes: 45 env: HOSTING_BASE_URL: "${{ vars.HOSTING_BASE_URL }}" CANDIDATE_ARCHIVE_SHA256: "${{ needs.immutable_build.outputs.archive_sha256 }}" + RELEASE_DEPLOYED: "${{ needs.deployment.outputs.deployed }}" strategy: fail-fast: false matrix: diff --git a/.gitignore b/.gitignore index b19dcdf9..5a42d78c 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,9 @@ artifacts/**/*.json artifacts/**/*.xml artifacts/**/*.txt artifacts/**/*.sarif +# 1103/12-08. Step logs from check:scale:* and verify:extreme-scale. They were +# committed once, and every local merge-gate run rewrote them. +artifacts/**/*.log artifacts/tests/e2e/ artifacts/tests/browser-capabilities/ artifacts/storybook/ diff --git a/CHANGELOG.md b/CHANGELOG.md index b017977c..5bc2e0b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,11 +4,276 @@ 가져오는 방법은 `README.md`의 "Updating a copied project" 절에 있다. - 버전은 git 태그 `vX.Y.Z`로 식별한다. 태그 사이의 변경을 여기 적는다. +- 미출시 절은 한 번의 동기화 단위(기준 커밋 → 브랜치 끝)에서 받는 변경의 순 요약이다. 최종 상태만 적고, 같은 범위 안에서 뒤 커밋이 바꾼 중간 상태는 지운다. 호환을 깨는 변경은 절 첫머리 "먼저 할 일"에 옮기기 전·옮기는 법·옮긴 뒤 확인 순서로 적는다. - **[보안]** 복사한 프로젝트도 가져가야 하는 보안·개인정보 수정이다. - **[계약]** 백엔드, 배포 설정, CI, 또는 기능 코드가 함께 바뀌어야 하는 변경이다(헤더, 변수, 게이트, 공개 포트). - 표시가 없으면 템플릿 안에서 끝나는 수정이다. -- 괄호 안 ID는 리뷰 발견 ID다. 근거와 재현 조건은 해당 리뷰 문서에 있다. -- 커밋 해시는 브랜치 `fix/maturity-review-2026-09-25` 기준이다. 병합 방식에 따라 `main`에서는 해시가 다를 수 있으니 ID로 찾는다(`git log --grep '03-03'`). +- 괄호 안 ID는 리뷰 발견 ID다. `MMDD/NN-MM`으로 적는다. `MMDD`는 리뷰 폴더 `docs/reviews/YYYY-MM-DD-maturity-review/`의 월일이고, 근거와 재현 조건은 그 폴더의 영역 문서에 있다. 복사한 프로젝트가 README대로 `docs/reviews/`를 지웠다면 이 폴더와 `PRODUCT.md`는 원본 템플릿 repo에서 찾는다. 라운드마다 `NN-MM`을 새로 매기므로 같은 `14-02`라도 라운드가 다르면 다른 결함이다. `F-N`은 그 라운드 `FOLLOW-UP.md`의 ID다. `tests/unit/changelog-review-ids.test.ts`가 라운드 없는 ID를 막는다. +- 0.2.0의 커밋 해시는 브랜치 `fix/maturity-review-2026-09-25`에서 만들었고, `main`에서도 같은 해시로 찾을 수 있다(2026-11-03에 52개 모두 확인). 그 뒤 절은 절 머리에 범위(기준 커밋과 브랜치)를 적고, 그 절의 해시는 모두 그 범위에 있다. 0.2.0의 커밋 제목은 라운드 없이 ID만 적었다(`git log --grep '03-03'`). + +## 미출시 — `752a61f` → 브랜치 `fix/maturity-review-2026-11-03` + +한 번의 동기화로 받는 변경의 순 요약이다. 범위는 `main` `752a61f`부터 브랜치 `fix/maturity-review-2026-11-03`의 끝까지다. 이 절을 쓸 때 끝은 `f887817`이었다(병합 커밋을 빼고 310개). 그 뒤 깨끗한 clone 검증(merge 단계 14개)에서 찾은 수정과 pin 갱신을 더했다. 버전 번호와 태그는 아직 정하지 않았다. + +이 묶음은 세 갈래를 합쳤다. + +- `fix/ui-design-audit-2026-11-01`: 2026-11-01 UI 디자인 감사(`docs/reviews/2026-11-01-ui-design-audit.md`, ID `UI-NN`)와 2026-11-01 성숙도 리뷰(`docs/reviews/2026-11-01-maturity-review/`) 조치. +- `claude/happy-easley-233d07`: 짝 백엔드 Envelope 읽기, V2 HTTP 경로 삭제, 거절 판정 표, 쿠키 쓰기 CSRF, KEYED 재전송. 앞 갈래와 `e40684b`에서 합쳤다. +- 2026-11-03 성숙도 리뷰(`docs/reviews/2026-11-03-maturity-review/`) 조치 브랜치 11개. `fix/maturity-review-2026-11-03`에서 합쳤다. + +읽는 법: + +- 최종 상태만 적는다. 같은 범위 안에서 뒤 커밋이 다시 바꾼 중간 상태는 적지 않는다. 예를 들어 V2 클라이언트를 고친 커밋들은 V2를 지운 행 하나로 남겼다. 중간 기록은 커밋 이력에 있다. +- 이 repo의 커밋 해시는 기준점 `752a61f`·`af3d8e6`을 빼면 모두 이 범위에 있다. 브랜치 끝에서 닿고 `752a61f`에서는 닿지 않는다. 다른 repo의 커밋(다운스트림, 짝 백엔드)은 repo 이름과 함께 적었다. +- 두 다운스트림(tech-log-frontend, memento-frontend)의 기준점은 `af3d8e6`이다. `af3d8e6`과 `752a61f` 사이에는 리뷰 문서만 있다. 그래서 두 제품이 받을 변경은 이 절과 같다. + +### 먼저 할 일 (BREAKING) + +복사한 프로젝트가 이 묶음을 받을 때 순서대로 한다. 단계 끝의 괄호는 아래 표의 근거 행이다. 두 다운스트림에서 읽은 모양(memento-frontend `d3810a0`, tech-log-frontend `7a4e201a`, 2026-11-05)을 단계마다 적었다. 템플릿은 이 안내를 두 제품 코드에 적용해 게이트를 돌려 보지는 않았다(알려진 제한). + +#### 옮기기 전 + +1. 기준점을 확인한다. memento는 `.template-origin`, tech-log는 `template.lock.json`의 `sourceRevision`에 있다. 둘 다 `af3d8e6`이다. +2. 제품이 고친 템플릿 파일을 뽑는다. 이 묶음은 그 일을 받을 제품 소유 파일을 새로 둔다(옮기는 법 2단계). 템플릿 파일을 고친 채로 두면 동기화마다 충돌한다. + - memento: `src/bootstrap/runtime-adapters.ts`, `src/features/feature-adapter-contribution.ts`(capability `offsetUpload`·`runtime`), `src/contracts/rest-profiles.ts`(`MEMENTO_BFF_READ`·`MEMENTO_BFF_WRITE`), `src/contracts/external-contract-runtime.ts`(출처 종류 `PRODUCT_LOCAL_CONTRACT`), `src/features/installed-feature-contracts.ts`(`APP_HOME` 다리), `src/features/installed-runtime-capabilities.ts`(Service Worker `ACTIVE`), `src/presentation/routes/app-router.tsx`(`ownsShell` 다리). + - tech-log: `src/contracts/env.ts`(`TECH_LOG_STUDIO_SOURCE`·`TECH_LOG_PUBLIC_SOURCE` 행), `src/bootstrap/create-runtime-composition.ts`(부트 전 BFF 세션 owner), `src/contracts/rest-profiles.ts`(`TECH_LOG_STUDIO_SESSION`·`TECH_LOG_STUDIO_BOOTSTRAP`), `src/bootstrap/runtime-adapters.ts`, `src/bootstrap/runtime-config-schema.ts`, `src/features/installed-*` 다섯 개(TechLog 직접 조립. 그중 `installed-feature-runtimes.tsx`는 템플릿이 지웠다), `src/presentation/routes/app-router.tsx`(PUBLIC/STUDIO 라우터). +3. 기능마다 HTTP descriptor를 센다. method, `retrySemantics`, `responseEnvelope`, 입력·응답·실패 검증기의 schemaId, 그 검증기가 zod인지. 옮기는 법 4·5단계의 작업량이 이 숫자로 정해진다. + - memento-web: descriptor 29개. 입력·응답 schemaId 42개와 실패 본문 `MementoProblem` 1개. 검증기는 zod가 아니라 손으로 쓴 `isRecord` 검사다. `responseEnvelope`는 없다. GET은 `SAFE`, 쓰기는 `KEYED`·`IDEMPOTENT`·`NEVER`다. + - TechLog: 검증기는 `zodValidator`다. 출력은 Envelope 뼈대만 검사하고 본문은 통과시킨다. `responseEnvelope`는 없다. GET은 `SAFE`, 쓰기는 `KEYED`나 `NEVER`(둘 다 `retryBudget` 0)다. +4. 지금 게이트 결과를 남긴다. 동기화 뒤의 실패가 원래 있던 것인지 가르는 데 쓴다. 두 제품의 지난 동기화 기록(`docs/operations/template-sync-2026-09-29.md`)과 같은 목록이면 된다. + +#### 옮기는 법 + +1. **기능이 아닌 폴더의 표시.** `src/features//NOT_INSTALLED`를 같은 자리의 `NOT_A_FEATURE`로 바꾼다. 생성기는 `NOT_INSTALLED`를 더는 읽지 않는다. 표시와 `feature-module.ts`가 한 폴더에 있으면 생성기가 실패한다. + - memento: `local-draft-feature`. 템플릿 폴더라 병합으로 바뀐다. + - tech-log: `tech-log`, `reference-feature`, `local-draft-feature`. `reference-feature`는 템플릿이 그 폴더에 둔 `feature-module.ts`·`feature-runtime.ts`·`context-routes.ts`를 받지 않는다. + (1103/09-09) +2. **제품 코드를 제품 소유 파일로 옮긴다.** 템플릿은 아래 파일을 비워서 내보내고, 복사한 뒤에는 고치지 않는다. 제품 코드를 여기로 옮기고 "옮기기 전" 2단계의 템플릿 파일은 템플릿 것으로 되돌린다. + - `src/contracts/product-contracts.ts` + - `PRODUCT_REST_AUTH_PROFILES`: 제품 인증 프로필. memento의 `MEMENTO_BFF_READ`·`MEMENTO_BFF_WRITE`, tech-log의 `TECH_LOG_STUDIO_SESSION`·`TECH_LOG_STUDIO_BOOTSTRAP`이 여기 온다. 템플릿 프로필과 id가 겹치면 모듈 로드가 실패한다. + - `PRODUCT_RUNTIME_CONFIG_FIELDS`와 `PRODUCT_ENV_REGISTRY`: 제품 런타임 설정 키(zod, `.default()`나 `.optional()`)와 그 FE-REG-ENV 행(`as const`). 키마다 행이 있어야 하고 행의 `required`·`defaultValue`가 스키마와 같아야 한다(`tests/unit/env-registry-coverage.test.ts`, `test:unit`). tech-log의 `TECH_LOG_*_SOURCE` 두 키가 여기 온다. + - `src/bootstrap/product-composition.ts` + - `composeProductSessionOwner(context)`: 부트 전 세션 owner. `AUTH_MODE=external`일 때만 불린다. tech-log가 `create-runtime-composition.ts`에서 host 전역에 넣던 BFF owner가 여기 온다. context의 `fetch`는 필수 칸이다(마감 `REQUEST_TIMEOUT_MS`, 본문 64 KiB, redirect 거부). 이 context를 직접 만드는 제품 테스트는 `fetch`를 더한다. 짝 백엔드 두 인증 모드의 owner 예시는 `recipes/session-owners/`에 있다. + - `composeProduct(context)`: `capabilities`(memento `offsetUpload`·`runtime`, tech-log Studio 소스·HTTP), `credentialProviders`(인증 프로필별 자격증명. memento는 `x-xsrf-token`, tech-log는 `x-csrf-token`), 선택 칸 `onCredentialRejected`와 `scopeParticipants`. + - 401 처리가 바뀌었다. 제품 provider가 자격증명을 낸 요청의 401은 템플릿 세션을 로그아웃시키지 않고 `onCredentialRejected`로만 온다. 두 제품처럼 provider와 세션 owner가 한 쿠키 세션을 쓰면 여기서 owner에 알린다(예: owner의 `notifyUnauthenticated`). 알리지 않으면 템플릿 세션은 그 401을 모른다. + - `scopeParticipants`: 로그아웃·계정 전환 때 FENCED와 READY 사이에서 닫을 제품 자원. 닫기가 실패하면 READY로 가지 않는다. + - `src/features/product-capabilities.ts` + - `ProductFeaturePlatformCapabilities`: 제품 capability의 타입. `feature-adapter-contribution.ts`의 `FeaturePlatformCapabilities`에 `declare module`로 붙이던 보강을 여기로 옮긴다. 템플릿이 만드는 키(`http`, `telemetry`, `indexedDb`)는 다시 선언할 수 없다. + - `PRODUCT_RUNTIME_CAPABILITY_SELECTION`: Service Worker·realtime·web worker·offline command 선택. memento가 `installed-runtime-capabilities.ts`에 적은 Service Worker `ACTIVE` 선택이 여기 온다. + - `config/ci/product-gates.json`: 배포(`deployment`)와 제품 merge 검사(`mergeGates`, ID `PRODUCT-GATE-NNN`). 배포 슬롯을 `config/ci/gates.json`에서 채웠다면 여기로 옮긴다. `deployment`에는 package script 이름과 `vars.*`·`secrets.*` 바인딩만 적는다. 승격 후보를 받아 digest를 확인하고 푸는 단계는 템플릿이 만들고, `secrets.*`는 deploy 단계에만 간다. + - 기능 어댑터 기여는 실행 중에도 `needs`에 적은 capability만 받는다. cast로 다른 capability를 읽던 코드는 `undefined`를 받는다. + (1101/09-02, 1103/09-01, 1103/09-02, 1103/09-03, 1103/09-05, 1103/09-08, 1103/02-01, 1103/12-07, 1103/13-05) +3. **기능을 선언과 실행부로 나눈다.** 기능 하나가 초기 JS에 약 3.9 KB gzip을 더해서 나눴다. 완성된 모양은 `src/features/reference-feature/`다. + - 선언(`feature-module.ts`, `FeatureModule`): 초기 청크에 남는다. `id`, `contracts`(route 표, route runtime 계약, invalidation, topic version, `contractPackages`), `routes`, `messages`, `loadRuntime`만 가진다. + - 실행부(`feature-runtime.ts`, `defineFeatureRuntime({ featureId, schemas, adapters, contractContributions })`): 그 기능의 route에 처음 들어갈 때 router가 `application.features.load(featureId)`로 적재한다. + + 순서: + + 1. 기능 계약에서 V2 칸 `apiOperations`·`runtimeSchemas`·`mappers`를 지운다. 스키마 메타데이터 `schemas`는 별도 파일로 빼서 `defineFeatureRuntime`에 넘긴다(참조: `contracts/reference-schema-metadata.ts`). memento-web에는 `*-api-contract.ts`가 없다. 이 칸들은 `contracts/memento-feature-contract.ts`에 있다. `apiOperations`와 `mappers`는 비어 있어 지우기만 한다. `runtimeSchemas`(`MEMENTO_RUNTIME_SCHEMA_CODECS`, 라우트 codec 7개)는 3번으로, `schemas`(라우트 행 7개)는 새 메타데이터 파일로 간다. + 2. 선언 계약에 `contractPackages`를 더한다. 기능의 `EXTERNAL_PACKAGE` 계약 기여가 고정하는 패키지 신원 목록이다. 없으면 `Object.freeze([])`. 부팅 때 release manifest를 이 목록과 맞춰 본다. 계약 기여의 출처는 `EXTERNAL_PACKAGE`이고, `TEMPLATE_FIXTURE`는 참조 기능 전용이다. memento가 템플릿 파일에 더한 `PRODUCT_LOCAL_CONTRACT`는 조립이 `unknown contribution source kind`로 거절한다. `EXTERNAL_PACKAGE`로 바꾸고 신원(패키지 이름·정확한 버전·`sha256:` digest·revision)을 준다. 자리표시자 신원은 로컬·개발 빌드에서는 되지만 staging·production 승인(FE-GATE-027)이 거절한다. 선택 기준은 `docs/manual/02-decision-tables.md` 2절이다. + 3. route codec을 `context-routes.ts`의 각 route `handle.codecs`로 옮긴다(참조: `presentation/reference-route-codecs.ts`의 `REFERENCE_FEATURE_ROUTE_CODECS`). 플랫폼 codec과 같은 id는 쓸 수 없다. `*-runtime-descriptor.ts`와 `src/features/installed-feature-runtimes.tsx`는 없어졌다. + 4. `feature-runtime.ts`를 만들고, `feature-module.ts`에서 `adapters`·`contractContributions`·`runtimes`를 지운 뒤 `loadRuntime: async () => (await import("./feature-runtime.ts")).FEATURE_RUNTIME`을 넣는다. `feature-runtime.ts`를 어디서도 정적으로 import하지 않는다. 그러면 실행부가 다시 초기 청크에 들어간다. `featureId`가 모듈 id와 다르면 적재 때 실패한다. + 5. runtime descriptor에 붙인 제품 칸은 context로 옮긴다. memento-web의 `ownsShell: true`와 `app-router.tsx` 다리는 `src/contexts/memento-context/context-layout.tsx`의 `CONTEXT_LAYOUT`이 대신한다. 레이아웃은 skip link와 `
` 하나를 그린다. `tests/component/layout-landmarks.test.tsx`가 설치된 레이아웃을 모두 검사한다. memento-web은 이미 route id `APP_HOME`을 선언하므로 그것만으로 플랫폼 홈을 대신한다. `installed-feature-contracts.ts`의 `FEATURE_REPLACEABLE_PLATFORM_ROUTE_IDS` 다리는 지운다. + 6. 기능 input(`application.features.get(id)`)은 적재 뒤에만 있다. 그 기능의 route 밖에서 읽는 코드는 먼저 `await application.features.load(id)`를 부른다. `ApplicationApi.features`를 직접 구현하거나 fake로 만든 코드는 `load`를 더한다. 모든 기능의 실행부가 필요한 화면은 `loadInstalledFeatureRuntimeRegistries()`를, Node 스크립트와 테스트는 `src/features/loaded-feature-runtimes.ts`를 쓴다. `src/`에서 이 파일을 import하면 아키텍처 규칙 `boot-does-not-load-every-feature-runtime`이 막는다. + 7. `vite.config.ts`의 청크 그룹(`feature-declarations`, `feature-platform`, `react-dom`)을 가져간다. 없으면 기능마다 선언 청크가 하나씩 는다. + + **직접 조립 제품(tech-log).** TechLog는 `feature-module.ts` 없이 `installed-*` 파일에 직접 조립된다. 이 묶음에는 그 자리가 없다. `installed-feature-runtimes.tsx`가 없어졌고, route codec은 context route handle에 실리고, 계약 기여는 기능 실행부를 적재할 때 설치되고, FE-REG-API·FE-REG-SCHEMA는 생성기가 설치한 기능만 본다. 템플릿이 준비한 길은 TechLog를 기능 모듈로 바꾸는 것이다. PUBLIC 묶음은 루트 `*`에 자기 레이아웃과 `APP_HOME`을 가진 context가 되고, 필요하면 같은 레이아웃을 쓰는 두 번째 루트 context(예: `topics/*`)를 둔다. STUDIO 묶음은 자기 레이아웃을 가진 `studio` context가 된다. 이 모양은 `tests/helpers/fixture-layout-product.tsx`가 선언하고 `tests/component/context-layouts.test.tsx`와 `layout-landmarks.test.tsx`가 실행한다. 바꾸면 TechLog descriptor에도 4·5단계가 적용된다. 직접 조립을 유지하면 `installed-*`와 라우터를 제품이 계속 고쳐야 하고, 템플릿은 그 경로를 검사하지 않는다(알려진 제한). + (1101/15-01, 1101/07-04, 1101/09-03, 1101/16-04) +4. **HTTP descriptor 조립 규칙.** 계약 조립(`composeContractContributions`)이 아래를 어기는 기여를 거절한다. 메시지는 `Installed contract contribution is not composable: `이다. + - GET·HEAD의 `retrySemantics`는 `SAFE`나 `IDEMPOTENT`다. 재시도를 막으려면 `retryBudget: 0`. + - POST·PUT·PATCH·DELETE에는 `SAFE`를 쓸 수 없다. `IDEMPOTENT`, `KEYED`(`commandRecovery` 필요), `NEVER`(`retryBudget` 0) 중 하나다. + - 계약 기여 하나 안의 operation은 모두 같은 `responseEnvelope`를 읽는다. 값이 없는 것과 `"NONE"`은 같다. 두 백엔드를 쓰면 기여를 나눈다. + - 쿠키 인증 프로필로 쓰기를 하면 그 프로필이 `x-csrf-token`이나 `x-xsrf-token`을 `requiredCredentialHeaders`로 요구해야 한다. + - `commandEffect.refusedBeforeWrite`(쓰기 전에 나는 업무 거절 code 목록)는 `responseEnvelope: "ENVELOPE_V1"` operation에만 쓴다. `IDEMPOTENT_*`·`IDEMPOTENCY_*` code는 적을 수 없다. + + 두 다운스트림의 지금 descriptor는 앞의 넷을 지킨다. memento의 쓰기 프로필 `MEMENTO_BFF_WRITE`는 `x-xsrf-token`을, TechLog의 `TECH_LOG_STUDIO_SESSION`은 `x-csrf-token`을 요구한다. `responseEnvelope`가 없는 operation의 적용 여부는 지금처럼 `classifyProblem`이 정한다. + + 뮤테이션: `useApplicationMutation`은 `useServerStateScope()`의 scope를 담은 `BoundMutation`만 받는다. memento-web의 뮤테이션 8곳과 TechLog는 이미 그 모양이다. `operationId`·`requiresIdempotencyKey`는 `commandMutationIdentity()`로 받을 수 있고, 그러면 오타를 타입 검사가 잡는다. `BoundMutation.owner`와 `QueryDefinition.owner`·`operationId`는 `@deprecated` 선택 칸이 됐고 다음 릴리스에서 지운다. + (1103/07-01, 1103/03-03, 1103/16-01, 1103/07-02, 1103/03-01, 1101/08-03, 1103/16-05, 1103/16-06) +5. **레지스트리 행과 기준선.** + - FE-REG-API 행은 설치된 기능의 모든 V3 descriptor에서 뽑는다(22칸). V2 API 행이 없던 기능도 descriptor마다 행이 새로 생긴다. memento-web은 29행이다. + - 각 행의 `requestSchema`·`responseSchema`·`problemSchema`는 FE-REG-SCHEMA 행을 가리켜야 한다. 그 기능의 `schemas`에 schemaId마다 행을 더한다. memento-web은 지금 라우트 행 7개뿐이라 43행(입력·응답 42, `MementoProblem` 1)을 더한다. 없으면 `check:registries`가 operation마다 `FE-REG-API..requestSchema references unknown FE-REG-SCHEMA.schemaId=`로 실패한다. + - 행의 칸: `boundary`는 쓰인 자리대로 적는다(`api-request` 입력, `api-response` 응답, `api-problem` 실패 본문, `route-params`, `route-search`, `route-search-api-request`). `direction`은 입력이 `REQUEST`, 응답·실패 본문이 `RESPONSE`다. `unknownFieldPolicy`는 적으면 검증기 동작과 같아야 한다. `tests/unit/schema-metadata-policy.test.ts`(`test:unit`)가 설치된 기능 전부를 대조한다. + - `runtime`은 `"zod"`만 받는다. 손으로 쓴 검증기를 그대로 두고 `"zod"`라고 적으면 행이 사실과 다르다. memento-web의 검증기는 `zodValidator(schemaId, schema)`(`src/contracts/zod-validator.ts`)로 옮긴다. 지금 검사하는 만큼(객체인지, `items`가 배열인지)만 옮겨도 된다. 일부러 검증하지 않을 칸은 `unvalidatedPayload(schemaId, reason)`로 바꾼다. 그 칸은 FE-REG-API 행의 `unvalidated`와 플랫폼 구성 화면에 드러난다. governance의 `runtime` 허용값을 제품 쪽에서 넓히지 않는다. + - 다 맞춘 뒤 기준선을 한 번 다시 승인한다. FE-REG-API governance가 바뀌어 동기화 직후 `check:registries`가 `contract-field-changed`로 실패하기 때문이다. `REGISTRY_BASELINE_OWNER= REGISTRY_BASELINE_REASON="<이유>" corepack pnpm update:registry-baseline`. 지금 diff와 맞지 않는 옛 breaking 증거 행도 이 명령이 지운다. + (1103/07-01, 1103/16-04, 1103/07-03, 1101/07-03, 0929/07-01) +6. **쓰는 곳이 있을 때만.** + - V2 HTTP 클라이언트와 V2 API 행에서 지운 이름(아래 `048f490`·`12f3bb7` 행). 두 다운스트림은 앱 코드에서 V2 클라이언트를 부르지 않는다. 부르는 곳은 템플릿의 `tests/unit/runtime-adapters.test.ts`뿐이고 그 파일은 템플릿 것으로 바뀐다. + - realtime: `BoundedPollOperationContract`를 지웠다. SSE·poll이 서버에 닿지 못한 실패는 `OFFLINE` 대신 `PROVIDER_UNAVAILABLE`이다. + - 예제 화면 3개(`EXAMPLES_UI`·`EXAMPLES_STATES`·`EXAMPLES_AUTH`)가 `platform-examples-feature`로 옮겼다. 예제를 지운 제품(tech-log)은 이 기능 폴더와 `src/contexts/platform-examples-context/`를 지운다. 예제 화면을 여는 제품 테스트는 그 기능을 설치해 두거나 제품 화면으로 옮긴다. memento의 `production-csp.spec.ts`·`old-tab-chunk-recovery.spec.ts`가 `/examples/states`·`/examples/ui`에서 시작한다. `/examples/platform`(플랫폼 구성 화면)은 플랫폼 라우트로 남는다. + - 포트를 직접 구현한 코드: `OpfsJournalPort.countPartitionTransactions`·`removePartition`, worker gateway의 `removePartition`, `PublicCacheInspection.activePointer`가 필수 칸이다. + - offline-indexeddb recipe 타입: `src`와 이름이 같은 34개가 `src` 타입을 다시 내보낸다. + (1103/04-01, 1103/04-04, 1103/09-04, 1103/05-01, 0929/05-01, 1103/02-05, 0929/05-03) +7. **초기 JS 예산.** 예산은 gzip 204,800 B와 초기 파일 26개다(`config/performance/budgets.json`, merge 게이트 FE-GATE-012의 `check:bundle`). 템플릿 자체가 202,927 B를 쓴다. 여유는 1,873 B다. 측정용 기능 복사본 하나를 같은 context에 더하면 +768 B, 새 context 하나는 +233 B다(`config/scale/feature-shape-ceilings.json`. `tests/unit/feature-shape-growth.test.ts`가 기능 1 KiB·context 512 B로 막는다). 제품 기능의 선언(라우트 표, 문구)은 초기 청크에 들어간다. memento-web(라우트 14개)과 기능 모듈로 바꾼 TechLog의 크기는 템플릿이 재지 않았다. `build` 뒤 `check:bundle`이 넘은 한도와 초과량을 적는다. 예산을 올릴 때는 `docs/operations/performance-evidence.md`대로 기준선·새 측정값·이유를 같은 변경에 적는다. 초기 파일 수는 HTTP/2 서빙이 전제다. + (1101/15-01, 1103/15-02, 1103/15-03, 1103/15-04, 1103/15-05) + +#### 옮긴 뒤 확인 + +1. 로컬 merge 게이트 14개를 돈다(README "CI and evidence"의 반복문). `config/ci/product-gates.json`에 적은 `PRODUCT-GATE-NNN`은 workflow의 `product_merge_gate` job이 돈다. +2. 그중 이 묶음 때문에 먼저 볼 것: + - `check:registries`: `11 registries PASS`. 기준선을 다시 승인한 뒤에는 `compatibility=none`. + - `test:unit`: `schema-metadata-policy`, `env-registry-coverage`, `feature-shape-growth`. + - `test:component`: `layout-landmarks`, `context-layouts`. + - `build` 뒤 `check:bundle`: 예산 안. + - `verify:documentation`(FE-GATE-017): 참조 기능을 지운 제품도 통과한다. + - `test:sample-removal -- --feature=<제품 기능 id>`: 그 기능을 지운 사본이 게이트를 통과한다. +3. 배포가 있는 제품: FE-GATE-019는 TLS ALPN `h2`와 entry 응답의 `Content-Encoding`(br·gzip·zstd)을 요구한다. HTTP/1.1이나 압축하지 않는 호스트는 FAIL이다. + +### 보안·계약 변경 + +#### 기능 구조와 조립 + +| 표시 | 변경 | 영향 경로 | 커밋 | +|---|---|---|---| +| [계약] **BREAKING** | 기능을 선언(`feature-module.ts`)과 실행부(`feature-runtime.ts`)로 나눴다. 위 "먼저 할 일" 3단계. `ApplicationApi.features`에 `load(featureId)`가 생겼다. `*-runtime-descriptor.ts`와 `src/features/installed-feature-runtimes.tsx`는 없다 (1101/15-01) | `src/features/`, `src/application/ports/in/application-api.ts`, `src/presentation/routes/`, `vite.config.ts`, `.dependency-cruiser.json` | `298201f` | +| [계약] **BREAKING** | 기능이 아닌 폴더의 표시는 `NOT_A_FEATURE`다. `NOT_INSTALLED`는 읽지 않는다. 표시와 `feature-module.ts`가 함께 있으면 생성기가 실패한다 (1103/09-09) | `scripts/generate-product-feature-index.ts`, `src/features/*/NOT_A_FEATURE` | `9edc830` | +| [계약] | 제품 코드는 템플릿 파일이 아니라 제품 소유 파일에 둔다. `src/bootstrap/product-composition.ts`(capability, 인증 프로필별 자격증명 provider, `composeProductSessionOwner`, 선택 `onCredentialRejected`·`scopeParticipants`), `src/contracts/product-contracts.ts`(제품 인증 프로필, 런타임 설정 키, 그 FE-REG-ENV 행), `src/features/product-capabilities.ts`(capability 타입 `ProductFeaturePlatformCapabilities`, 선택 런타임 `PRODUCT_RUNTIME_CAPABILITY_SELECTION`). 자격증명 순서는 scope fence → ANONYMOUS → 제품 provider → 세션 → fence 재확인이다. 제품 설정 키는 `.default()`나 `.optional()`이어야 템플릿 테스트가 통과한다 (1101/09-02, 1103/09-02, 1103/09-05) | `src/bootstrap/product-composition.ts`, `src/bootstrap/product-composition-contract.ts`, `src/contracts/product-contracts.ts`, `src/features/product-capabilities.ts`, `src/features/installed-runtime-capabilities.ts` | `da1e128`, `ece944d`, `245f428`, `2f6df14`, `2963c6f` | +| [계약] | 런타임 설정 키마다 FE-REG-ENV 행이 있어야 하고, 행의 `required`·`defaultValue`가 스키마와 같아야 한다(`tests/unit/env-registry-coverage.test.ts`). 템플릿 행 `RELEASE_ID`·`BUILD_ID`를 더했고 `TELEMETRY_ENABLED`·`AUTH_MODE`·`RELEASE_MANIFEST_URL`·`CAPABILITY_OVERRIDES`·`FEATURE_OVERRIDES` 행을 스키마에 맞췄다. `defaultValue`는 객체일 수 있다 (1101/09-02, 1103/13-04) | `src/contracts/env.ts`, `config/contracts/registry-governance.json`, `tests/unit/env-registry-coverage.test.ts` | `d0414c8`, `a144b57` | +| [계약] | 기능 어댑터 기여는 실행 중에도 `needs`에 적은 capability만 받는다. cast로 다른 capability를 읽던 기능은 `undefined`를 받는다 (1103/09-08) | `src/features/feature-adapter-contribution.ts` | `e7d6358` | +| [계약] | 기능 계약이 route id `APP_HOME`을 선언하면 플랫폼 홈을 대신한다. 둘이 선언하면 두 기능 id를 적고 실패한다. `src/contexts//context-layout.tsx`가 `CONTEXT_LAYOUT`을 내보내면 그 context의 라우트가 AppShell 대신 그 레이아웃 아래에 놓인다. 레이아웃은 skip link와 `
` 하나를 그려야 하고, `tests/component/layout-landmarks.test.tsx`가 설치된 레이아웃을 모두 실행해 본다 (1101/09-03) | `src/contracts/routes.ts`, `src/contexts/bounded-context-module.ts`, `scripts/generate-product-feature-index.ts`, `tests/component/layout-landmarks.test.tsx` | `ca16187`, `27f4523` | +| [계약] | 앱 조립이 닿지 않는 기능 라우트를 앱 모듈을 평가할 때 throw로 거절한다. 소유 context 루트 밖의 라우트, 계약에 없는 route handle, 플랫폼 라우트가 먼저 받는 경로, 다른 기능과 같은 경로(파라미터 이름만 다른 것과 대소문자·끝 슬래시만 다른 것 포함)다. 시작할 런타임이 없는 선택 capability(realtime·webWorkers·offlineCommands)도 거절한다 (1101/09-06, 1101/09-07, 1103/08-04, 1101 README 14.4) | `src/apps/deployable-app-module.ts`, `src/contexts/bounded-context-module.ts`, `src/bootstrap/` | `7139c7c`, `d6e4e51`, `7d85589`, `8469554`, `851fded`, `48a4074` | +| [계약] **BREAKING** | 예제 화면 `EXAMPLES_UI`·`EXAMPLES_STATES`·`EXAMPLES_AUTH`가 끌 수 있는 기능 `platform-examples-feature`(context `platform-examples-context`, 루트 `examples/*`)로 옮겼다. 페이지 파일은 그 기능의 `presentation/`에 있다. `PLATFORM_ROUTE_REGISTRY`·`PLATFORM_ROUTE_RUNTIME_CONTRACT`·`PLATFORM_ROUTE_RUNTIME`에서 키가 빠졌다. 홈 문구 `home.starter.platform`·`ui`·`states`는 `home.starter.open({title})`로 바뀌었다. 예제를 지운 제품은 이 기능 폴더와 context를 지운다. `/examples/platform`은 플랫폼 라우트로 남는다 (1103/09-04) | `src/features/platform-examples-feature/`, `src/contexts/platform-examples-context/`, `src/contracts/routes.ts` | `b96d61d` | +| [계약] | 계약 기여의 출처는 `EXTERNAL_PACKAGE`이고, `TEMPLATE_FIXTURE`는 참조 기능만 하나 쓸 수 있다. 다른 출처 종류는 `unknown contribution source kind`로 거절한다 (1101/07-04) | `src/contracts/external-contract-runtime.ts` | `c063389` | +| [계약] **BREAKING** | `useApplicationMutation`은 raw `{ execute, definitionId }`를 받지 않는다. `useServerStateScope()`의 scope로 만든 `BoundMutation`을 넘기고 `execute(input, { signal, intent })`로 부른다. `commandMutationIdentity()`가 `operationId`·`requiresIdempotencyKey`를 descriptor에서 준다. `QueryDefinition.owner`·`operationId`와 `BoundMutation.owner`는 아무도 읽지 않아 `@deprecated` 선택 칸으로 바꿨고 다음 릴리스에서 지운다. raw query는 남았다. 세션이 바뀌면 이전 결과가 보이지 않는다(JSDoc에 위험 표기) (1101/08-03, 1103/16-05, 1101/03-03, 1103/16-06) | `src/presentation/adapters/query/application-query.ts`, `src/presentation/adapters/query/` | `1fa5f3e`, `f59a806`, `68f94f5` | + +#### HTTP와 계약 + +| 표시 | 변경 | 영향 경로 | 커밋 | +|---|---|---|---| +| [계약] **BREAKING** | V2 HTTP 클라이언트를 지웠다. HTTP 경로는 V3 실행기 하나다. 배럴(`src/adapters/http/index.ts`)에서 `createHttpClient`, `HttpClient`, `HttpClientDependencies`, `HttpFailure`, `HttpResult`, `LegacyHttpInput`, `Scheduler`, `OperationRequestInput`가, `src/bootstrap/runtime-adapters.ts`에서 `createRuntimeHttpClient`, `RuntimeHttpContract`가 없어졌다. 지운 파일: `client.ts`, `bounded-json.ts`, `request-builder.ts`, `resource-mapper.ts`, `retry-policy.ts`, `schema-registry.ts`(`src/adapters/http/`). Envelope 스키마는 `backend-envelope.ts`에 있다. V2 클라이언트를 부르는 코드는 그 operation의 V3 descriptor를 만들어 `createFeatureHttpBinding`으로 실행한다 | `src/adapters/http/`, `src/bootstrap/runtime-adapters.ts`, `scripts/drill-runbook.ts` | `048f490` | +| [계약] **BREAKING** | 기능마다 적던 V2 API 행을 지웠다. FE-REG-API 행은 contract contribution의 V3 descriptor에서 뽑는다(`src/contracts/api-operations.ts`의 `projectApiOperationRows`, 22칸: operation·경로·인증·재시도 의미·본문 모양·Envelope·스키마 세 개·`acceptedStatuses`·`emptyBodyStatuses`·`unvalidated`·바이트 상한 둘·`totalDeadlineMs`·`retryBudget`·`traffic`·`commandEffect`·`commandRecovery`). `problemSchema`도 FE-REG-SCHEMA를 참조하고, 그 행의 `boundary`는 새 값 `api-problem`이다. `problemSchema`·`unvalidated` 변경과 status 값 제거는 breaking이다. `FeatureRuntime`은 `apiContract` 대신 `schemas`(FE-REG-SCHEMA 행)를 받는다. 지운 이름: `defineRestOperation`, `ApiOperation`, `RestOperationV2`, `composeApiOperations`, `validateApiRuntimeBindings`, `getApiOperation`, contracts의 `API_OPERATIONS`; `rest-profiles.ts`의 `createRestProviderProfile`, `RestProviderProfile`, `resolveRestSecurityProfiles`, `validateRestProfileBindings`, `REST_CSRF_PROFILES`, `RestCsrfProfile`; `loaded-feature-runtimes.ts`의 `RUNTIME_SCHEMA_CODECS`, `MAPPER_REGISTRY`, `REST_PROFILE_BINDINGS_VALID`, `API_RUNTIME_BINDINGS_VALID`. realtime `apiOperations` 바인딩은 `ApiOperationRow`를 받고, snapshot operation을 `method: "GET"`과 `SAFE`·`IDEMPOTENT`로 본다. 옮기는 법은 위 "먼저 할 일" 3·5단계 (1103/07-01, 1103/16-04) | `src/contracts/api-operations.ts`, `src/contracts/schema-registry.ts`, `src/features/feature-module.ts`, `src/features/installed-feature-runtime-registries.ts`, `config/contracts/`, `scripts/create-feature.ts` | `12f3bb7`, `08ed0a0`, `3b40f73` | +| [계약] **BREAKING** | 재시도 의미를 조립 때 검사한다. GET·HEAD는 `SAFE`·`IDEMPOTENT`만, POST·PUT·PATCH·DELETE는 `SAFE`를 쓸 수 없다 (1103/07-01, 1103/03-03) | `src/contracts/external-contract-runtime.ts` | `e4caafd`, `61f70cb` | +| [계약] | 계약 기여 하나 안의 operation이 서로 다른 `responseEnvelope`를 읽으면 조립이 거절한다. 두 백엔드는 기여를 나눈다 (1103/16-01) | `src/contracts/external-contract-runtime.ts` | `3f7e10c` | +| [보안] [계약] | 쿠키 인증 프로필(`SAME_ORIGIN_COOKIE`)로 쓰기(GET·HEAD 밖)를 하는 operation은 그 프로필이 `x-csrf-token`이나 `x-xsrf-token`을 `requiredCredentialHeaders`로 요구해야 한다. 아니면 조립이 거절한다. POST·PUT·PATCH·DELETE × 두 헤더 표로 테스트한다 (1103/07-02) | `src/contracts/external-contract-runtime.ts` | `365d8c3`, `a94006b` | +| [계약] | V3 descriptor의 선택 칸 `responseEnvelope: "ENVELOPE_V1"`이면 실행기가 짝 백엔드 Envelope(`{success, data\|error, meta}`)를 읽는다. `outputValidator`는 `data`(키가 없으면 `null`), `problemValidator`는 `error`를 받는다. `meta.requestId`·`traceId`는 선택이다. 성공 status의 Envelope 아닌 본문은 새 위반 `ENVELOPE_MISMATCH`다(`HttpContractViolationKind`에 추가). `create:feature`가 만든 기능은 이 값을 선언한다. 참조 기능과 값이 없는 descriptor는 DTO와 problem details를 읽는다 (1101 README 14.3) | `src/contracts/external-contract-runtime.ts`, `src/adapters/http/`, `scripts/create-feature.ts`, `tests/mocks/handlers/http-scenarios.ts` | `7db32e1`, `bd83b49` | +| [계약] | Envelope operation의 400·409·422와 백엔드가 정한 5xx 넷은 `classifyProblem` 대신 백엔드 기준 표(`backend-envelope.ts`, 근거는 계약 문서 6.1절)가 정한다. 적용 안 됨(`NOT_APPLIED`)은 400 `VALIDATION_FAILED`(details 모양과 상관없음), 400 `IDEMPOTENCY_KEY_INVALID`, 422 `IDEMPOTENT_REQUEST_MISMATCH`와 그 operation의 `refusedBeforeWrite` code다. 그 밖의 400·409·422는 결과 불명이다. 503 `IDEMPOTENCY_UNAVAILABLE`, 503 `IDEMPOTENCY_COMPLETION_UNKNOWN`, 500 `IDEMPOTENCY_RECOVERY_REQUIRED`, 503 `REQUEST_TIMEOUT`은 분류기와 상관없이 결과 불명이고 키를 지킨다. KEYED operation은 503 `IDEMPOTENCY_UNAVAILABLE`을 `retryBudget` 안에서 같은 키로 다시 보낸다. 필드 목록이 있는 거절은 `VALIDATION_REJECTED`와 필드 오류, 필드 목록 없는 422는 `UNKNOWN_CLIENT_FAILURE`다. 진단은 두 멱등성 거절에 `reason`을 싣는다 (1101 README 14.4, 1103/03-04, 1103/08-05) | `src/adapters/http/backend-envelope.ts`, `src/adapters/http/http-execution-v3.ts`, `docs/architecture/backend-api-and-server-state-contract.md` | `3261208`, `c05f41a`, `3761507`, `613c1cf` | +| [계약] | `CommandEffectDescriptor.refusedBeforeWrite`(선택, Envelope operation 전용): 그 엔드포인트가 쓰기 전에만 내는 업무 거절 code. 적은 code의 400·409·422는 `NOT_APPLIED`라 폼에서 값을 고쳐 다시 저장할 수 있다. 멱등성 code를 적거나 Envelope가 아닌 operation에 적으면 조립이 거절한다 (1103/03-01) | `src/contracts/external-contract-runtime.ts`, `src/adapters/http/backend-envelope.ts`, `src/contracts/api-operations.ts` | `1e8b3d0`, `3fba68b` | +| [계약] | 짝 백엔드 계약 기준점을 기계가 읽는다. `config/contracts/backend-contract-pin.json`(백엔드 `45d2a478`)과 백엔드 `docs/web/http-contract.md` §2 답 표(`config/contracts/backend-idempotency-answers.json`)를 `tests/unit/backend-contract-pin.test.ts`가 프론트 판정 표와 대조한다. `check:backend-contract-drift --backend <백엔드 checkout>`(로컬, 게이트 밖)이 pin 뒤의 백엔드 변경을 알린다 (1103/12-06) | `config/contracts/`, `scripts/check-backend-contract-drift.ts`, `src/adapters/http/backend-envelope.ts` | `ba2b4f4`, `5379c80` | +| [계약] | 성공 결과에 Envelope `meta.page`가 `page`로 실리고, `mapSuccess` 두 번째 인자 `FeatureHttpSuccessContext { page }`로 받는다(배럴 `EnvelopePage`). bulk `results`는 지원하지 않는다. 실패 Envelope의 `meta.traceId`는 `AppFailure.traceId`가 된다. 실행 결과의 선택 칸 `sentRequestId`: 서버가 `x-correlation-id`를 돌려주지 않으면 `AppFailure.requestId`는 보낸 값이고, 결과 불명·조회 실패 화면에 "지원 참조" 줄이 보인다 (1103/03-02, 1103/03-06, 0929/03-04) | `src/adapters/http/` | `49a0986`, `631ce33`, `849d000` | +| [계약] | 결과 불명 쓰기의 진단·텔레메트리에 `effect_certainty`가, 진단 `reason`에 `UnknownEffectReason`이 실린다 (1103/03-05) | `src/adapters/http/`, `config/contracts/` | `39c1de2` | +| [계약] | 키 없는(`NEVER`) 결과 불명 요청에는 "같은 요청으로 다시 보내기"가 없다. mutation 컨트롤러 `canResendUnknownEffect`, `AsyncState.unknownEffectResendable`. 처리 중 409의 `Retry-After`는 `retryAfterMs`로 실리고, 결과 불명 요청을 같은 키로 다시 보낼 때 그 시각까지(최대 5초) 기다린다 (0929/03-03, 백엔드 리뷰 1101/02-01) | `src/presentation/adapters/query/application-query.ts`, `src/presentation/components/async-surface.tsx` | `2017ef7`, `47fec5c` | +| [계약] | 전송 전 거절의 원인이 진단에 남는다. 연결 실수·멱등 키 위반은 `UNKNOWN_CLIENT_FAILURE`이고 화면 문구는 "요청을 처리할 수 없습니다."다 (1101/03-02) | `src/adapters/http/` | `4da0466` | +| [계약] | 참조 기능의 생성 분류기가 409를 problem code로 나눈다. 선언한 충돌 code(`CONFLICT`)만 적용 안 됨이고, `IDEMPOTENT_IN_FLIGHT`·code 없는 409·모르는 409는 결과 불명이라 다음 전송이 같은 멱등 키를 쓴다 (0929/03-01) | `src/features/reference-feature/contracts/reference-feature-contract-contribution.ts` | `112c870` | +| [계약] | 인증 프로필 `REFERENCE_EXTERNAL_BEARER`의 새 이름은 `EXTERNAL_BEARER`다. 옛 이름은 한 릴리스 동안 `@deprecated` 별칭으로 남는다. `CREDENTIAL_HEADER_NAMES`에 짝 백엔드 CSRF 헤더 `x-xsrf-token`을 더했다 (1101/16-03, 1101/09-02) | `src/contracts/rest-profiles.ts` | `6c5818f`, `183a4a3` | +| [계약] | `zodValidator`(`src/contracts/zod-validator.ts`)가 zod 스키마를 `RuntimeValidator`로 바꾼다. 검증을 일부러 생략할 때는 `unvalidatedPayload(schemaId, reason)`를 쓴다. `listUnvalidatedPayloads(composed)`가 생략 목록을 만들어 플랫폼 구성 화면이 보여 준다 (1101/07-03) | `src/contracts/zod-validator.ts`, `src/contracts/unvalidated-payload.ts` | `d3ddc89`, `8b7c6eb` | +| [계약] | 폐기 별칭 `MappingResult`(`boundary-mapper.ts`)와 `ApiFailure`(`errors.ts`)는 export로 남지만 lint가 `src`·`tests`의 import를 막는다. `BoundaryMappingResult`, `AppFailure`로 바꾼다 (1101/07-01) | `eslint.config.ts`, `src/contracts/boundary-mapper.ts`, `src/contracts/errors.ts` | `fc303d8` | + +#### 레지스트리 + +| 표시 | 변경 | 영향 경로 | 커밋 | +|---|---|---|---| +| [계약] | breaking 증거(`config/contracts/registry-change-evidence.json`)에 `after`가 필요하고 diff의 after 값과 같아야 한다. 지금 diff와 맞지 않는 증거 행은 `check:registries`가 적고 실패하며, `update:registry-baseline`이 그런 행을 지운다 (0929/07-01) | `scripts/lib/registry-compatibility.ts`, `scripts/update-registry-baseline.ts`, `docs/operations/ci-quality-gates.md` | `5e6be9a`, `4ada84e` | +| [계약] | 분류기가 덜 깐깐해졌다. 선언 타입 안의 null ↔ 값 전환은 `breakingFields`로 등급을 정하고(보통 behavior-change), `allowedValues`에 값을 더하기만 하면 additive다. 무효화 그래프에 원소를 더하기만 한 변경도 additive다. 빼거나 바꾸면 그대로 breaking이다 (0929/07-02) | `scripts/lib/registry-compatibility.ts`, `scripts/check-registries.ts` | `82c9e59`, `605fd17` | +| [계약] | FE-REG-ROUTE가 `paramsSchema`·`searchSchema`를 허용 목록으로 보지 않고, `loadingSurface`는 kebab-case 형식만 본다. 기능 라우트를 더해도 governance를 고치지 않는다. 다운스트림은 목록에 더해 둔 값을 지운다 (0929/07-03) | `config/contracts/registry-governance.json`, `scripts/check-registries.ts` | `e8d7fb4` | +| [계약] | `StorageBackend`에 `"external"`이 생겼다. cross-context pulse 키는 외부 소유라 StoragePort로 읽고 쓰면 `*_UNAVAILABLE`로 거절된다. exhaustive switch는 분기를 더한다 (1101/05-01) | `src/contracts/storage-keys.ts`, `config/contracts/` | `e98a980`, `65ea208` | +| [계약] | 진단 `ui.render.failed`의 `route_id`: 등록 라우트가 없는 URL의 적재 실패는 `NOT_FOUND` 대신 `UNREGISTERED_ROUTE`, 복구하지 못한 context 라우트 청크 실패는 context id 대신 그 라우트 id다. 이 값으로 거르는 대시보드·알림은 고친다 (1101 README 14.3) | `src/presentation/routes/`, `src/contracts/routes.ts` | `7c8cb19` | + +#### 세션·인증 + +| 표시 | 변경 | 영향 경로 | 커밋 | +|---|---|---|---| +| [계약] | 401은 그 요청의 자격증명을 낸 쪽에만 알린다. 템플릿 세션이 낸 자격증명의 401만 세션을 로그아웃시키고 캐시를 비운다. ANONYMOUS 요청과 제품 provider 요청의 401은 `ProductComposition.onCredentialRejected`(선택)로 간다 (1103/09-01) | `src/bootstrap/runtime-adapters.ts`, `src/bootstrap/product-composition-contract.ts` | `0aada28` | +| [계약] | 인증 프로필이 ANONYMOUS인 요청은 세션 상태와 상관없이 자격증명 없이 나간다. 전에는 어느 세션 상태에서도 보내지 않았다 (1101/09-01) | `src/bootstrap/runtime-adapters.ts` | `ddf411e` | +| [계약] | `ProductSessionOwnerContext`에 `fetch`(필수. 마감 `REQUEST_TIMEOUT_MS`, 본문 64 KiB, redirect 거부), `page`(`href`, `replaceUrl`, `assign`), `redirectStorage`, `readCookie`가 생겼다. 짝 백엔드 두 인증 모드의 owner recipe는 `recipes/session-owners/`(`oidc-pkce-session-owner.ts`, `cookie-session-owner.ts`)이고 매뉴얼은 `docs/manual/04-paired-backend-session.md`다. `src`가 이 recipe를 import하면 `check:optional-recipes`가 `PRODUCTION_IMPORTS_RECIPE`로 거절한다 (1103/09-03) | `src/bootstrap/product-composition-contract.ts`, `recipes/session-owners/`, `scripts/check-optional-recipes.ts` | `d02efe7`, `05958bb`, `f3fd10f` | +| [계약] | 세션 상태 전이: 복구 성공은 authenticated, no-session은 unauthenticated(또는 integration-failed), 거절은 상태 유지다. "세션 복구" 화면은 no-session이면 로그인 버튼을 보인다 (1103/09-11) | `src/adapters/auth/external-session-adapter.ts`, `src/presentation/providers/session-provider.tsx` | `d7c6cb4` | +| [계약] | `ProductComposition.scopeParticipants`(선택): 로그아웃·계정 전환 때 FENCED와 READY 사이에서 닫을 제품 자원. 닫기가 실패하면 READY로 가지 않는다. 예시는 `recipes/frontend-capabilities/browser-file-session-capability.ts` (1103/02-01) | `src/bootstrap/product-composition-contract.ts`, `src/bootstrap/runtime-adapters.ts`, `recipes/frontend-capabilities/` | `f485e51` | + +#### 저장소·파일·전송 + +| 표시 | 변경 | 영향 경로 | 커밋 | +|---|---|---|---| +| [계약] | OPFS journal 목록이 손상 행을 건너뛰고 `corruptRows`로 센다. reconcile은 `corruptTransactions`, 소속 partition이 없는 손상 행은 선택 칸 `unattributedRows`·`unattributedCorruptTransactions`로 따로 세고 DEGRADED 관측에서 뺀다. 승인된 LOGOUT·ACCOUNT_DELETION purge는 끝나지 않은 행을 보면 진행 중인 put을 기다린 뒤 partition을 지우고 `partitionDeleted`를 보고한다. partition 삭제는 partition Web Lock으로 다른 탭의 put과 겹치지 않는다. `OpfsJournalPort`의 `countPartitionTransactions(scope)`·`removePartition`과 worker gateway `removePartition`은 필수 메서드다 (0929/05-01, 1103/05-01, 1103/05-03) | `src/adapters/storage/opfs/`, `src/application/ports/browser-file-storage/` | `72edb55`, `e5b7b3e`, `d13a393`, `fd6b631` | +| [계약] | OPFS partition lock을 기다리는 put·remove는 자기 abort로 `ABORTED`, `mutationLockWaitTimeoutMs`를 넘으면 `BLOCKED`(retryable)다. 정책의 `putIdleTimeoutMs`가 `mutationLockWaitTimeoutMs` 이상이면 조립이 거절한다 (1103/05-02, 0929/05-09) | `src/adapters/storage/opfs/` | `7b55f0f`, `f6b74ed` | +| [계약] **BREAKING** | recipe의 browser-file·OPFS·storage durability·cache 타입 중 `src`와 이름이 같은 34개는 `src` 타입을 다시 내보낸다. fake는 `src` port를 구현하고 `BrowserDataResult`를 돌려준다. `MemoryDurableObjectStore` 생성자가 바뀌었고 `DurableObjectDataClass`·`DurableObjectIntegrity`·`DurableObjectRead`·`ObjectStoreRecoverySummary`는 지웠다. 이 fake의 reconcile은 `FILES_READY` put을 runtime처럼 commit하고 LOGOUT·ACCOUNT_DELETION은 멈춘 행도 지운다. offline-indexeddb recipe를 쓰는 프로젝트만 해당 (0929/05-03, 1103/05-04) | `recipes/frontend-capabilities/` | `e1a4580`, `36ff633` | +| [계약] | `PublicCacheInspection.activePointer`가 필수 칸이다. 손상 pointer에서도 inspect가 상태와 후보를 보여 준다. 포트를 직접 구현한 쪽은 채운다 (1103/02-05) | `src/adapters/cache-storage/public-response-cache-adapter.ts`, `src/application/ports/browser-file-storage/cache-storage-ports.ts` | `7e7614f` | +| [보안] | download 정책의 `safeExtension`이 위험 확장자이거나 그것으로 끝나면 조립이 거절한다 (1101/02-02) | `src/adapters/browser-files/` | `4f78890` | +| [계약] | 업로드 part 발급·PUT이 서버의 `Retry-After`를 기다린다. `maxRetryAfterMs`를 넘으면 다시 보내지 않고 `upload()`·`abort()`가 `RESUME`·`retryable: false`를 준다. 실패 결과에 대기 시간이 붙도록 포트 반환 타입이 넓어졌다(추가만). upload 실패 번역은 HTTP 상태와 code로 recovery를 고르고, part 발급(BFF)의 401/403은 `NONE`(`retryable: false`)이다. file-transfer recipe를 쓰는 프로젝트만 해당 (1101/01-01, 1103/01-02, 0929/01-01) | `src/adapters/browser-transfer/` | `95e4445`, `c695898`, `9142390`, `c5f87aa` | + +#### realtime·Service Worker·Web Push + +| 표시 | 변경 | 영향 경로 | 커밋 | +|---|---|---|---| +| [계약] **BREAKING** | `BoundedPollOperationContract`(V2 어휘)를 지웠다. `createBoundedPollCoordinator`의 operation과 `assertBoundedPollOperation`의 둘째 인자는 V3 descriptor(`BoundedPollOperation`)다. 조립된 행을 넘기고, `frontend.retryBudget` 0인 poll 전용 operation을 등록한다. 0이 아니면 생성 때 거절한다 (1103/04-01) | `src/adapters/realtime/` | `a65df74` | +| [계약] **BREAKING** | SSE의 fetch·reader 거절과 bounded poll의 execute 거절은 `OFFLINE` 대신 `PROVIDER_UNAVAILABLE`(retryable)로 끝난다. 브라우저가 online이면 online 이벤트를 기다리지 않고 backoff로 다시 시도하고 상한에서 끝난다. poll은 던지는 execute도 lease 안에서 다시 시도한다. `OFFLINE`은 환경 신호에서만 나온다 (1103/04-04, 0929/04-01) | `src/adapters/realtime/` | `af00067`, `4d27b20` | +| [계약] | stream coordinator와 live-poll handoff coordinator의 마감 실패가 `IDLE_TIMEOUT` 대신 `APPLY_FAILED`·`PROVIDER_UNAVAILABLE`로 나온다. stream coordinator의 `RealtimeObservation.reason`도 같다. `IDLE_TIMEOUT`은 전송 idle에만 쓴다 (1101/04-02) | `src/adapters/realtime/stream-coordinator.ts`, `src/adapters/realtime/` | `1196b86`, `17fa8d1` | +| [계약] | realtime 배럴이 결과 생성 함수 `realtimeSuccess`·`realtimeFailure`를 내보낸다. 동결이 필요한 경계에 직접 만든 결과를 넘기던 코드는 이 함수로 바꾼다 (1101/04-01) | `src/adapters/realtime/index.ts` | `3fe28de` | +| [계약] | Service Worker 빌드가 `public/`을 다시 복사하지 않는다(`publicDir: false`). 전에는 SW를 켠 빌드의 `dist/config.json`이 local 문서로 덮어써졌다 (0929/06-01) | `vite.service-worker.config.ts`, `scripts/build-frontend.ts` | `c7b9cb8` | +| [계약] | 라우터 base path(`VITE_ROUTER_BASE_PATH`)를 쓰면 Web Push 정상 클릭, SW 사전 캐시 URL, SW의 설정 URL이 모두 그 경로 아래로 간다 (1101/06-01, 0929/06-02) | `src/adapters/web-push/`, `scripts/generate-service-worker-assets.ts` | `c67edd2`, `85d55e0` | +| [보안] | Web Push registry가 URL로 해석하면 바뀌는 path(`..`, `%2e%2e`, `.`)를 생성 때 거절한다 (1103/06-02) | `src/adapters/web-push/` | `a145f30` | + +#### 화면·문구·디자인 시스템 + +| 표시 | 변경 | 영향 경로 | 커밋 | +|---|---|---|---| +| [계약] | `check:design-system` 규칙 4개: 두 테마에서 `--color-focus`가 표면 토큰 8종 모두와 3:1 이상, `color-mix()`는 `in oklab`만, 계약의 컴포넌트 토큰은 스타일 하나 이상이 `var(--name)`으로 읽음, `--font-sans` 첫 글꼴은 기본 키워드이거나 `@font-face`로 싣는 글꼴이거나 `PRODUCT_LOADED_FONT_FAMILIES`(`token-contract.ts`)에 있는 글꼴. deg 색상각과 시스템 글꼴 이름은 받는다 (UI-01, UI-02, UI-03, UI-05, 1101/12-01, 1101/12-02, 1101/12-04) | `scripts/check-design-system.ts`, `scripts/lib/design-system-rules.ts`, `src/presentation/design-system/tokens/token-contract.ts` | `35b183b`, `bfa7dd9`, `165ed19`, `8576ce1`, `49d8675`, `e714c0d`, `b4ccada` | +| [계약] | design-system primitive가 `src/presentation/design-system/primitives/<컴포넌트>.tsx`로 나뉘었다. `design-system/index.ts`의 export 목록은 같다. 파일을 직접 import하던 코드는 경로를 바꾼다 (1101/08-08) | `src/presentation/design-system/primitives/`, `vite.config.ts` | `6dd4bc1`, `51941a5` | +| [계약] | `MessageArguments`가 catalog 문자열의 `{이름}`에서 파라미터를 만든다(값은 string 또는 number). `check:i18n`은 catalog parity와 raw backend 메시지만 보고, 화면 문구 literal은 ESLint `screenTextSelectors`가 잡는다(template literal·삼항식·객체 prop 문구는 못 본다) (0929/08-03, 0929/08-02) | `src/presentation/i18n/message-contract.ts`, `eslint.config.ts`, `scripts/check-i18n.ts` | `ff33d58`, `855d22a` | + +#### 빌드·배포·CI + +| 표시 | 변경 | 영향 경로 | 커밋 | +|---|---|---|---| +| [계약] | 번들 예산 게이트 FE-GATE-012가 merge 단계에서 돈다. 예산은 gzip 204,800 B와 초기 파일 26개(`initialJsFiles`)다. `check:bundle`은 넘은 한도와 초과량을 적고, `bundle.json`에 `initialJsFiles`·`initialFilesPassed`가 있다. 초기 JS 기준선은 `config/scale/feature-shape-ceilings.json`의 `initialJavascript`(지금 202,927 B, 26개, 기능 하나 +768 B, context 하나 +233 B)이고 `test:unit`이 빌드와 대조한다 (1101/15-01, 1103/15-05, 1103/15-03, 1103/15-02, 1103/15-04) | `config/ci/gates.json`, `config/performance/budgets.json`, `scripts/check-bundle.ts`, `config/scale/` | `f41e3d5`, `46dfe23`, `1b8cb12`, `c9e7bab`, `f887817` | +| [계약] | 호스팅 계약: 파일이 없는 모든 경로에 그 release의 `index.html`을 HTML 헤더로 준다(SPA fallback, `appRoute`). 워커를 싣는 빌드의 `service-worker.js`는 `no-cache`다. live probe는 사전 캐시 확장자마다 `Content-Type`을 확인한다. nginx 예시는 `docs/operations/release-cache-rollback.md` (1101/13-04, 1103/06-03) | `config/hosting/cache-policy.json`, `scripts/lib/hosting-probe.ts`, `scripts/verify-hosting-headers.ts` | `629c8f0`, `0f58abb` | +| [계약] | FE-GATE-019(production 단계)는 workflow의 `deployment` 슬롯이 배포한 승격 release를 본다. 슬롯이 비어 있으면 `UNVERIFIED`다. 배포된 `release-manifest.json`의 buildId·releaseId, `config.json`(비상 스위치 제외), `index.html` entry가 후보와 다르면 FAIL이다. TLS ALPN `h2`와 entry `Content-Encoding`(br·gzip·zstd)을 요구한다(`config/hosting/cache-policy.json`). HTTP/1.1이나 비압축 호스트는 FAIL이다. nginx 예시가 http2·gzip을 켠다 (1101/13-01, 1103/13-01, 1103/13-02) | `.gitea/workflows/quality-gates.yml`, `config/ci/gates.json`, `config/hosting/cache-policy.json`, `scripts/verify-hosting-headers.ts` | `de379ea`, `4bce8bf`, `2e12d2f` | +| [계약] | 제품 소유 `config/ci/product-gates.json`: 배포(`deployment`, package script와 `vars.*`·`secrets.*` 바인딩)와 제품 merge 검사(`PRODUCT-GATE-NNN`, job `product_merge_gate`). 템플릿은 승격 후보를 받아 `CANDIDATE_ARCHIVE_SHA256`으로 확인하고 푸는 단계를 만든다. 배포 슬롯은 `gates.json`이 아니라 여기서 채운다 (1103/12-07, 1103/13-01) | `config/ci/product-gates.json`, `scripts/contracts/product-ci-overlay.ts`, `scripts/generate-ci-workflow.ts` | `4c4248a`, `2e12d2f` | +| [보안] | 배포 슬롯의 `secrets.*`는 deploy 단계 env에만 간다 (1103/13-05) | `scripts/generate-ci-workflow.ts`, `scripts/contracts/ci-gates.ts` | `2e12d2f` | +| [계약] | staging·production 승인(FE-GATE-027)이 `example.com`·`example.net`·`example.org`와 그 하위 도메인, `.example`·`.invalid`·`.test` endpoint와 자리표시자 계약 신원(digest `PLACEHOLDER_CONTRACT_PACKAGE_DIGEST`)을 거절한다. `findAdmissionViolations`가 세 번째 인자로 계약 패키지를 받는다. CI에서 endpoint는 `config/runtime/.json`에 커밋한다 (1101/13-02, 1101/16-01) | `src/contracts/deployment-admission.ts`, `scripts/check-release-admission.ts` | `7b34756`, `1269992` | +| [보안] | release 단계 FE-GATE-027이 `scan:dependency-advisories`로 의존성 advisory를 템플릿 정책에 따라 판정해 남긴다(막지 않음). `renovate.json`을 더했다. 개발 의존성의 high·critical advisory를 범위 안에서 고쳤다(storybook 10.6.5, vite 8.1.6, vitest 4.1.12) (1103/13-03) | `scripts/scan-dependency-advisories.ts`, `renovate.json`, `package.json`, `pnpm-lock.yaml` | `eeb6f92`, `26ca2fd` | +| [보안] | provider 샌드박스가 `.git` 파일(worktree·서브모듈)을 `/dev/null` 읽기 전용 bind로 가린다. worktree에서도 `test:system`이 돈다 (1103/11-04) | `scripts/run-and-validate-provider.ts` | `0edc3fc` | +| [계약] | `create:feature [--context ] [--with-create [--keyed]] [--package --digest --revision ]`가 기능 뼈대를 만든다. 목록 경로는 짝 백엔드 `new-feature.sh`와 같은 `/`이고 결과 수는 `meta.page.total`이다. `--with-create`는 짝 백엔드 생성기와 같은 상세 GET·작성 POST(기본 `NEVER`, `--keyed`면 `KEYED`)·폼·결과 불명 화면·백엔드 본문 테스트를 더한다. FE-GATE-020의 `test:feature-scaffold`는 생성한 기능으로 `gates.json`의 merge 단계 명령을 돌고(브라우저 게이트·`test:system`·`verify:lockfile`·제거 드릴은 이유와 함께 뺀다) 그 기능의 제거 드릴도 돈다 (1101/16-01, 1103/03-07, 1103/09-06, 1103/12-02, 1103/16-02) | `scripts/create-feature.ts`, `scripts/create-feature-write-slice.ts`, `scripts/test-feature-scaffold.ts`, `config/ci/gates.json` | `d166aa3`, `2ec9d56`, `e1b4e28`, `7411d4a` | +| [계약] | `verify:documentation`(FE-GATE-017)이 입구 문서 4개의 src 최상위 폴더 설명과 `layers.md`의 아키텍처 규칙 이름을 검사한다(`sourceStructure`). `docs/README.md` 1절 현재 계약 문서의 repo 경로·명령 안 경로·링크·package script·FE-GATE ID와 짝 백엔드 참조를 검사한다(`documentReferences`, 짝 저장소가 옆에 없으면 `unverifiedLinks`). 수동 접근성 범위는 라우트별 기록 파일로 검사한다. 참조 기능 경로와 그 전용 script는 문서에 백틱 없이 적어, 참조 기능을 지워도 통과한다 (1101/14-03, 1101/14-05, 1103/12-05, 1103/14-04) | `scripts/verify-documentation-readiness.ts`, `docs/README.md`, `docs/manual/` | `61baf96`, `16202fd`, `b4e4f98`, `c4d5870`, `fd11d08` | +| [계약] | 규모 설계서는 `docs/architecture/scale-architecture.md`(현재 계약, 절 번호 유지)다. 코드 주석 `Spec §N`은 `scale-architecture.md §N`이고, 문서 이름 없는 `spec §` 참조는 `tests/unit/deletable-history-documents.test.ts`가 막는다. `docs/reviews/adapters/`는 지울 수 있는 기록이 아니다 (1101/14-01) | `docs/architecture/scale-architecture.md`, `README.md`, `docs/README.md` | `0a7fbed`, `b26517e` | +| [계약] | 쓰지 않는 npm script 4개(`scan:security:fixture`, `build:profile`, `generate:contract-set`, `build:app-only`)를 지웠다. 게이트가 닿지 않는 `scan:*` script는 `config/ci/ungated-scripts.json` 항목이 있어야 한다 (1101/12-05) | `package.json`, `scripts/lib/ungated-scripts.ts` | `98b9682` | +| [계약] | Vitest가 CI에서 skip·todo·only가 남은 실행을 실패시킨다(`-t`나 `file:line`으로 좁힌 실행은 제외). quarantine 주석이 붙은 skip도 실패한다 (1101/10-04) | `vitest.config.ts`, `tests/support/` | `95e7d11` | +| [계약] | 시각 테스트: `tests/visual/fonts.conf`로 글꼴을 고정하고 스크린샷 전에 실제 글꼴을 검사한다(Linux 전용). CI 브라우저 설치 단계가 글꼴 4종(`fonts-noto-core fonts-noto-cjk fonts-noto-cjk-extra fonts-liberation`)을 설치한다. 허용치는 절대 50 px다. 골든은 설치된 기능의 링크·목록·계약 다이제스트를 가리고 찍어, 기능을 더해도 다시 찍지 않는다 (1101/11-02, 1103/11-02, 1101/11-03, 1103/12-01) | `tests/visual/`, `playwright.visual.config.ts`, `.gitea/workflows/quality-gates.yml` | `08b5ccc`, `b0195e3`, `5ce3db9`, `0a6ff6e` | +| [계약] | 레시피 번들 예산: file-transfer 57,800, offline-indexeddb 38,500, realtime 42,200, service-worker-pwa 10,100 B. 측정값 + 3%를 100 B 단위로 올린 값이고, 3%를 넘는 증가는 커밋 본문에 이유를 적는다. 규칙은 `docs/architecture/optional-adapter-recipes.md` (0929/05-04) | `config/recipes/frontend-capability-recipes.json` | `313f9ba` | + +### 그 밖의 수정 + +- 화면: 라이트 포커스 링 대비, oklab 색 혼합, 기본 버튼·현재 메뉴가 컴포넌트 토큰을 읽음, `--font-sans`가 실제로 그려지는 시스템 글꼴, 테마·언어 선택 상자 폭, 예제 머리글의 반복 "예제" 라벨 삭제, 표 스크롤 영역 이름, 입력란 테두리가 `--field-border`를 읽음 (UI-01, UI-02, UI-03, UI-04, UI-05, UI-06, UI-08, 1101/12-01) +- 화면: 좁은 화면(48rem 미만)에서 머리글이 숨기던 테마 선택과 세션 상태를 메뉴 서랍에 둔다. 셸 문구가 DOM에 두 벌이라 페이지 전체에서 `getByText`로 찾는 테스트는 범위를 좁혀야 한다 (1101/08-01) +- 화면: 검색값만 바뀌면 포커스·스크롤·`route.changed`를 건드리지 않는다 (1101/08-02). h2·h3·h4 제목 크기·굵기 (1101/08-04), 한국어 단어 단위 줄바꿈 (1101/08-06), 상태 화면·오류 요약의 제목 수준 (1101/08-05), 예제 화면의 `lang="ko-KR"` (1101/08-07), 폼 저장 실패와 결과 불명 화면의 지원 참조 (0929/08-04) +- 폼: 짝 백엔드 필드 검증 code(`NOT_BLANK`, `SIZE` 등 20개)마다 문구가 있다. 모르는 code는 기본 문구다 (`8a09c90`, 1101 README 14.4). `constructor` 같은 필드 code는 기본 문구다 (1103/08-03). 키보드 저장이 결과 불명·429 등 필드 오류가 아닌 실패로 끝나면 포커스가 실패 상태로 간다(`FormPage` `feedbackId`, 저장 버튼 pending) (1103/08-02) +- 진단: context·feature 오류 경계와 라우트 모듈 실패가 진단에 남고 지원 참조가 `build:incident` 형식이다 (1101/09-09). 계약 조립 오류 메시지가 `reason`을 싣는다 (1103/09-07). 문제 응답 분류기 실패는 `CLASSIFIER_FAILED` (1101/03-05). 어느 무효화 topic도 닿지 않는 조회 namespace를 진단으로 한 번 알린다 (1101/03-01) +- 저장소: 진단 `storage.operation.failed`에 `reason`이 붙는다 (1101/05-02). lifecycle 리스너 주인 규칙과 테스트 (1101/05-03). OPFS purge가 객체를 못 지우면 완료와 chunk sweep을 보고하지 않는다 (0929/05-02). 여러 페이지를 다 지운 purge는 한 번에 끝났다고 보고한다 (`c4052f0`, 1101 README 13.6) +- 브라우저 파일·캐시: preview·download의 dispose가 자기 lease만 푼다 (1101/02-01). 같은 이미지 동시 resolve는 probe를 한 번만 돈다 (1101/01-04). 캐시 stage 재검증 실패는 `CACHE_STAGE` (1101/02-03), 정책 변경·손상 뒤에도 다음 배포가 pointer를 덮어쓴다 (0929/02-01), cross-context publish 실패 원인이 관측 reason에 실린다 (1101/02-05). Cache Storage 활성화의 본문 읽기 일시 오류는 손상이 아니라 `UNAVAILABLE`·`RETRY`다 (1103/02-02). browser-files vault에서 inspect 중에 놓은 ref는 `NOT_FOUND`·`RESELECT`다 (1103/02-04) +- 전송: 재조정에서 checkpoint 삭제가 실패해도 `upload()`가 `resourceId`를 준다 (0929/01-02). `FILE_BYTE_SOURCE` 이어 올리기는 수락된 part를 다시 해시하지 않는다 (1101/01-02). 짝 백엔드 Fileserver `POST /v1/files` 한 번 업로드 client `createFileserverUploadClient`(`src/adapters/http` 배럴, 201·202, 실패 Envelope, `Idempotency-Key`, `Retry-After`)를 더했다. 413·415·422 파일 거절은 `VALIDATION_REJECTED`, 같은 키 불일치 422는 공통 판정이다. presigned 업로드 레시피가 짝 백엔드와 맞지 않음을 문서에 적었다 (1103/01-01) +- 운영: 배포된 `config.json`의 비상 스위치(`CAPABILITY_OVERRIDES`, `FEATURE_OVERRIDES`)를 바꾸기 전에 `check:release-admission --config <고친 사본> --original <배포된 원본>`으로 검사한다. 두 스위치 밖의 필드가 바뀌면 거절한다. 절차는 `docs/runbooks/FE-RB-001.md` (1101/13-05). 워커 스크립트 헤더 검사 범위 (1103/06-01), waiting 기간의 소유 캐시 누적 (1103/06-04), 워커 제거 1단계 유지 기간 (0929/06-06)을 운영 문서에 적었다 +- realtime 문서: 짝 백엔드 실시간 출구와 프론트 transport 대응표 (1103/04-02), 레지스트리 세 바인딩의 출처 (1103/04-06), heartbeat를 멈춘 WebSocket (0929/04-04), Service Worker 레시피가 오프라인 셸을 약속하지 않음 (0929/06-03). WebSocket 구독별 초당 event 상한 (1101/04-03)과 워커 보호 장치 4개 (1101/06-04)를 테스트로 고정했다 +- 빌드: react-dom과 scheduler를 자기 청크로 빼 build id만 바뀐 release의 캐시 손실을 줄였다 (1103/15-06). 운영 빌드가 react-router의 운영 빌드를 싣는다 (1103/15-07). 폐기 예정 `build.rollupOptions`를 `rolldownOptions`로 바꿨다 (0929/13-07). pnpm 설치 정책 키가 빠지거나 약해지면 테스트가 실패한다 (0929/13-08). README 변수 표에 `VITE_BUILD_ID`가 staging·production에서 필수임을 적었다 (0929/13-09). 갤러리 전용 primitive를 초기 청크에서 뺐다 (1101/08-08) +- 성능: 플랫폼 구성 화면이 제목과 선언 정보를 먼저 그리고 실행부 표만 나중에 채운다. lab 게이트 FE-GATE-026이 다시 통과한다. `PlatformOverviewPage`의 `contracts` prop은 Promise다 (1103/15-01). 성능 문서의 번들 기준선과 분류 규칙을 지금 빌드에 맞췄다 (1101/15-02, 1103/15-02) +- 레지스트리 도구: `check:registries`가 조립 실패의 `reason`을 적고, 읽지 못한 레지스트리를 지운 것으로 세지 않는다 (1103/14-06). FE-REG-SCHEMA 행의 `direction`·`unknownFieldPolicy`·`boundary`를 검증기·쓰임과 대조한다 (1103/07-03, 1103/16-04). 금지 조각이 든 런타임 설정 키를 `test:unit`이 이름과 함께 막는다 (1103/07-04). `check:feature-index` 예외 이유를 실제 사용처로 고쳤다 (1101/12-05) +- 아키텍처 검사: zod 하위 경로(`zod/v4` 등) import도 `src/contracts/zod.ts`를 거쳐야 한다 (`64f19ac`, 1103 07 영역 P-07-06). 금지 fixture를 그 계층의 운영 ESLint 설정으로 검사하고 fixture 전용 블록을 지웠다 (1103/12-04). adapter kernel 설명을 실제 `platform` 폴더 내용에 맞췄다 (`3f72ae7`). 두 오류 어휘(`AppFailure`·`AppError`)와 `commandRecovery`를 누가 읽는지 타입 옆에 적었다 (1101/07-05, 1101/07-07) +- 게이트·드릴: coverage 증거 검사(FE-GATE-005)가 istanbul summary의 `branchesTrue`를 받는다 (1103/12-09). compact smoke e2e가 빌드에 준 `VITE_BUILD_ID`를 기대해 CI 값에서 FE-GATE-008이 항상 실패하지 않는다 (1103/11-06). vitest와 dev server를 띄우는 Playwright 설정(capabilities, dev)이 CI의 `VITE_BUILD_ID`·`VITE_COMMIT_SHA`를 물려받지 않는다. 전에는 CI env에서 앱을 local-build fixture로 조립하는 테스트와 capability e2e가 `CONFIG_BUILD_MISMATCH`로 떨어져 FE-GATE-005·006·007·008·020이 항상 실패했다 (1103/11-07). 테스트가 만드는 로컬 빌드(fixture 빌드, 시각 골든 build, 브라우저 테스트의 dev server)는 `CI=true`에서도 release 빌드로 검사되지 않는다(`localBuildEnvironment`, `LOCAL_BUILD_IDENTITY`). 전에는 workflow env에서 FE-GATE-005·008·020이 실패했다 (1103/11-08). 브라우저 테스트의 strict fixture가 WebKit의 "preload했지만 몇 초 안에 쓰지 않았다" 경고 문구만 무시하고, 대신 preload된 build script가 실제로 실행됐는지를 세 엔진에서 검사한다(`preloadunused:`, `tests/support/browser/preload-use.ts`). WebKit은 load 3초 뒤 한 번 추정해서, 곧 쓰일 청크를 preload한 화면에서 FE-GATE-008이 가끔 떨어졌고 정말 안 쓴 preload는 놓쳤다. build script를 직접 fulfill하는 test는 `fulfillBuildScript`를 쓴다 (1103/11-09). browser capability의 파일 선택·다운로드 test가 붙이는 버튼을 앱 위 고정 층에 둔다. 앱이 그리는 도중 내용이 자라 클릭 사이에 버튼이 움직였고, 클릭이 버튼에 닿지 않아 firefox에서 FE-GATE-008이 가끔 30초 시간 초과로 떨어졌다 (1103/11-10). capability 제거 드릴 3개가 문서 테스트 `ENOENT`로 항상 실패하던 것을 고쳤다. 문서를 읽는 테스트 목록은 `scripts/lib/removal-fixture.ts` 한 곳이다 (1103/02-06). `test:sample-removal`이 문서를 복사해 `lint`·`verify:documentation`·`check:i18n`·`check:design-system`을 돈다 (1103/14-04). 제품 기능 제거 드릴이 CI 기준선 사유 공백으로 멈추지 않는다 (1103/16-02). `test:system` provider 묶음 30초 예산 (1103/11-03), scope wrapper EOF 테스트 (1103/10-01)와 IndexedDB 차단 업그레이드 테스트 (1103/11-05)의 부하 원인을 없앴다. `artifacts/**/*.log`를 추적하지 않는다 (1103/12-08) +- 기능 추가 뒤 검증(리뷰 조치 X2): [계약] `create:feature`와 기능 제거 드릴이 dev server의 manifest(`public/release-manifest.json`)의 contract set을 설치된 기능으로 다시 쓴다(`node scripts/write-dev-release-manifest.ts`). 기능과 함께 커밋한다. 낡으면 `tests/unit/dev-release-manifest.test.ts`가 실패한다. 전에는 `create:feature` 직후 dev server와 dev server를 쓰는 capability e2e가 `CONTRACT_SET_PACKAGE_MISSING`으로 부팅하지 못했다 (1103/16-09). dev server가 `artifacts/`·`dist/`·`.tmp/`를 감시하지 않는다. 기능 제거 드릴(`test:sample-removal -- --feature=`)이 지운 뒤 초기 JS 기록을 다시 쓴다 (1103/15-02). 초기 JS 파일 상한이 32다(템플릿 26 + 여유) (1103/15-05). Fileserver 업로드 client가 browser-file-storage 포트를 import하지 않아 그 런타임을 지워도 남는다(`FileserverByteSource`) (1103/01-01). 제품 확장 타입 검사 탐침이 예약 이름(`typecheck-probe-*`)을 쓰고 제품의 capability 선언을 덮어쓰지 않는다 (1103/09-02). 시각 골든 build와 storybook workshop spec이 CI 식별값·a11y 애드온 자동 검사와 겹치지 않는다 (1103/11-07) +- 테스트: Testing Library 대기 기한을 `tests/setup.ts` 한 곳에서 5초로 정했다 (0929/10-01). `npx vitest`나 npm을 거친 IDE 실행기로 돌려도 실패하지 않는다 (1101/15-05). cgroup 시스템 테스트가 실행 단계가 남긴 PID·argv 기록을 읽는다 (1101/11-01). exact-five CLI 테스트가 실제 출력 문구를 기대한다 (0929/11-01). guardian이 실패하면 stdin을 기다리지 않고 끝난다 (`3c175a5`). 계약 조립기의 쓰기 API 규칙 5개 (1101/07-06), 이벤트 계약 검증 (1101/10-01), Envelope 판정 경계와 처리 중 409 무재전송 (1103/10-02), `MAX_RETRY_ATTEMPTS` 전달과 signal listener 정리 (1103/10-04)를 테스트로 고정했다. 규모 측정 기준선을 다시 쟀고 측정용 기능 복사본은 외부 패키지를 고정한다 (`9333595`, 1101/07-04). 설치 기능이 0개여도 타입 검사와 커버리지가 통과한다 (`e4ace51`, 1101/15-01) +- 테스트: 플랫폼 component 테스트가 스타터 화면 대신 테스트 전용 페이지(`tests/helpers/fixture-feature.tsx`)를 쓴다. 스타터 화면을 바꾸는 제품은 `tests/component/starter-*.test.tsx`를 함께 지운다. HTTP 시나리오 증거(FE-GATE-007)와 기능 API 타입 음성 fixture(FE-GATE-003)는 샘플을 지워도 남는다 (0929/10-02). 기능 테스트는 `createHttpScenarioHandler(<설치 계약>, { scenario, payload })`로 공유 MSW 시나리오를 쓰고, `tests/mocks/**`는 플랫폼 소유다 (1101/16-02, 1101/16-01). SW e2e가 제품이 켠 worker와 빌드가 만든 사전 캐시 목록을 쓴다 (0929/11-03, 0929/06-04). 접근성 e2e가 설치된 descriptor의 경로와 `responseEnvelope`로 빈 목록을 답하고 목록 화면에 경고 상자가 없음을 단언한다. 기능을 더해도 spec을 고치지 않는다 (1103/11-01, 1103/16-03) +- 참조 기능: 샘플 페이지가 `referenceRouteUrl(routeId, input)`으로 링크를 만들고 route 입력 cast를 없앴다. `REFERENCE_FEATURE_ROUTE_CODECS`는 `presentation/reference-route-codecs.ts`에 있다. 목록 링크 href는 `?limit=20`이 붙은 정식 URL이다 (1101/16-04). `create:feature --context reference-context`로 만들어도 참조 라우팅 테스트가 깨지지 않는다 (`e8c4197`) +- 문서: 새 기능 추가 매뉴얼 `docs/manual/`(한국어)을 더했다. 단계마다 정할 것, 판단 기준, 잡는 검사와 못 잡는 것을 적고, 결정표·기능 폴더 밖 파일·`create:feature` 인자·전역 ID·패턴·오류 메시지 참조를 둔다. 두 템플릿 공통 원칙은 design-docs repo `conventions/feature-design-principles.md`에 있다 (1101/16-01). 짝 백엔드 생성 기능의 쓰기 값 넷 결정표 (1103/16-07), 업무 거절 code를 `refusedBeforeWrite`에 적는 안내 (1103/03-01), 짝 백엔드 세션에 처음 붙이기 `docs/manual/04-paired-backend-session.md` (1103/09-03), 기능 실행부 설명 네 곳 (1103/09-10, 1103/07-05) +- 문서: 목표 설계 문서 VD-23·VD-24와 `api-contract-schema-mapper-and-server-state.md`의 V2 상태를 `REMOVED`로 바꾸고, VD-23의 401 문장을 정본 8.4("401 뒤 숨은 refresh-and-replay 없음")에 맞췄다. 쓰기 전 거절 표(계약 문서 6.1절)는 `docs/README.md` 1절이 링크해 경로 검사를 받는다 (1103/14-03). 정본 표가 제품 설정 키의 FE-REG-ENV 행을 요구하는 테스트를 적는다 (1103/14-05). `PRODUCT.md`를 더하고 예제 제거 주장을 드릴 범위에 맞췄다 (1101/14-04). 리뷰 ID에 라운드를 붙인다 (1101/14-02). `verify:documentation`이 실패하면 실패한 검사 이름과 고칠 문서·빠진 route ID를 적는다 (1101/14-06) + +### 알려진 제한 + +이 절을 쓴 끝 커밋(`f887817`)에서 사실인 것만 적었다. + +- 다운스트림 이행: 위 안내를 두 제품 코드에 적용해 게이트를 돌려 보지 않았다. memento-web의 숫자(descriptor 29개, schemaId 42개 + `MementoProblem`)는 memento `d3810a0`을 정적으로 센 값이다. +- 직접 조립 제품(tech-log의 TechLog): 템플릿에 그 자리가 없다. 기능 모듈로 바꾸는 길은 fixture(`tests/helpers/fixture-layout-product.tsx`)로만 검사했고 TechLog 화면으로는 해 보지 않았다. 직접 조립을 유지하면 FE-REG-API·FE-REG-SCHEMA와 스키마 메타 대조 테스트가 TechLog descriptor를 보지 않는다. +- 제품 안에 적은 계약(memento `PRODUCT_LOCAL_CONTRACT`)에 줄 출처 종류가 없다. `EXTERNAL_PACKAGE` 신원을 어떻게 정할지(패키지 없이 digest를 붙이는 법)는 템플릿이 정하지 않았다. +- 참조 기능은 `responseEnvelope`를 선언하지 않아 DTO와 problem details만 읽는다. 짝 백엔드에 붙는 완성 예시는 `create:feature --with-create`가 만드는 기능이다. +- 짝 백엔드 생성기(`new-feature.sh`)에 목록 GET이 없다. `create:feature` 목록 화면은 백엔드가 `GET /`을 더한 뒤에야 닿는다 (1103/03-07). +- 짝 백엔드 계약 pin은 `45d2a478`(2026-11-05)이다. 그 뒤 백엔드가 바뀌면 `check:backend-contract-drift --backend <백엔드 checkout>`가 알린다. 이 검사는 게이트 밖이라 CI는 알리지 않는다. +- 업로드: 백엔드 `POST /v1/files`는 `Idempotency-Key`를 읽지 않는다. 결과 불명 뒤 같은 키로 다시 보내도 파일이 둘 생길 수 있다. client의 code 목록은 백엔드 기준점에 묶여 있다. `EXTERNAL_BEARER`로 올리려면 제품 provider가 필요하다. 실제 백엔드 업로드와 firefox·webkit은 돌리지 않았다. +- 세션 owner recipe는 실제 Keycloak·Redis와 붙여 보지 않았다. jwt 모드: 백엔드 realm에 브라우저용 public client가 없어 제품이 더한다(매뉴얼 04에 JSON). redis-session 모드: 백엔드 운영 코드에 로그인·로그아웃·세션 조회·CSRF 발급 엔드포인트가 없어 owner가 URL을 기본값 없이 받는다. OIDC owner는 토큰을 메모리에 두어 새로고침하면 로그아웃되고, ID token 서명을 검사하지 않는다. +- 플랫폼 구성 화면(`EXAMPLES_PLATFORM`, `/examples/platform`)은 플랫폼 라우트라 끌 수 없고 FE-GATE-028 서명 대상이다. 예제 기능을 뺀 제품에서 예제 화면을 여는 e2e·visual spec은 실패한다 (1103/09-04). +- 기능 라우트 첫 진입(실행부 청크, 약 430 ms)은 어느 게이트도 재지 않는다. +- 초기 JS 여유가 1,873 B다. `--with-create` 기능 하나(약 +964 B)를 넣으면 약 900 B가 남는다. +- 운영 의존성 high advisory 2건이 남았다: `zod` 4.4.3 GHSA-mrhx-c7xc-m3w5(고치는 버전은 초기 JS 약 +7 KB로 예산을 넘는다), `react-router` 7.18.1 GHSA-qwww-vcr4-c8h2(약 +470 B). 둘 다 owner와 다른 reviewer의 `config/security/dependency-change-evidence.json` 항목이 필요하다. moderate 2건(`minimatch`, `glob`)은 major 범위 밖이다. +- 실제 Gitea runner, 실제 HTTPS 호스트, nginx 예시에서는 돌리지 않았다. FE-GATE-019 배포 슬롯은 주입한 fetcher로만 시험했다. +- `test:feature-scaffold` 한 번이 513~866초 걸린다(부하에 따라). FE-GATE-020 job 상한은 45분이다. 브라우저 게이트는 scaffold 드릴 밖이다. 짝 저장소 참조(1103/12-05)는 CI와 중첩 worktree에서 `not verified`다. +- Service Worker를 켠 제품의 `composeProduct` 쪽 칸(SW blocker·observe)은 없다 (1103/09-05). SW e2e와 실제 live probe는 이 묶음에서 돌리지 않았다. +- OPFS: `logicalKey`까지 깨진 행은 staging에 남을 틈이 있고, 같은 lock 대기 상한이 partition 삭제에도 걸린다. `dispose()`는 `scopeParticipants`를 부르지 않는다. 실제 로그아웃 E2E는 없다. +- 라우트 계약의 `title`·`navigationLabel`은 화면이 읽지 않는다(catalog가 읽는다) (1103/16-06). 키보드 저장 실패 포커스는 스크린리더로 확인하지 않았다 (1103/08-02). ## 0.2.0 — 태그 `v0.2.0` (2026-09-27) @@ -21,61 +286,61 @@ | 표시 | 변경 | 영향 경로 | 커밋 | |---|---|---|---| -| [계약] | 모든 V3 HTTP 요청이 논리 실행마다 `x-correlation-id` 헤더를 하나 보낸다. 다른 origin API는 preflight `Access-Control-Allow-Headers`에 이 헤더를 넣어야 요청이 나간다. 응답의 같은 헤더를 읽으려면 `Access-Control-Expose-Headers`에도 넣는다 (03-03) | `src/adapters/http/http-execution-v3.ts`, `src/adapters/http/feature-http-binding.ts`, `src/bootstrap/runtime-adapters.ts`, `docs/operations/api-contract-and-server-state-recovery.md` | `c5da3cf`, `f0a6495` | -| [계약] | 결과를 모르는 쓰기(응답 유실)를 다시 보낼 때 처음의 멱등 키를 그대로 쓴다. 백엔드는 같은 키의 재전송을 한 번만 적용해야 한다 (03-01, 08-03) | `src/presentation/adapters/query/application-query.ts`, `src/presentation/forms/use-app-form.ts`, `src/presentation/components/async-surface.tsx` | `dfb1b9e` | -| [계약] | 명령의 401/403/429를 기능 패키지가 분류할 수 있다(`classifyStatus`, 선택 필드). 재로그인이 먼저다 (03-02) | `src/adapters/http/http-effect-certainty.ts`, `src/adapters/http/http-execution-v3.ts`, `src/contracts/errors.ts`, `src/contracts/external-contract-runtime.ts` | `2afee67` | -| [계약] | 422 problem body의 필드 오류(`path`, `code`)를 폼까지 전달한다 (03-04) | `src/adapters/http/feature-http-binding.ts`, `src/features/reference-feature/contracts/reference-schemas.ts` | `479acd5` | -| [계약] | 텔레메트리 수집기 이벤트마다 `build_id`, `release_id`가 붙는다. 한 번에 보내는 본문은 60KiB 아래로 나뉜다 (13-11, 03-05) | `src/adapters/telemetry/telemetry-collector.ts`, `src/bootstrap/runtime-adapters.ts` | `43e47f4`, `e14c613` | -| [보안] | 번들이 읽지 않는 `VITE_*` 값까지 통째로 넣던 문제를 고쳤다. 값은 키로만 읽고, `ENV_REGISTRY`에 없는 `VITE_*` 이름은 빌드를 멈춘다 (13-06) | `src/contracts/env.ts`, `vite.config.ts`, `eslint.config.ts` | `2ec59ad` | -| [보안] | 로그아웃·계정 삭제 purge가 손상된 IndexedDB 때문에 열리지 않으면 그 파티션의 DB를 지운다. OPFS purge는 남은 chunk를 바로 지운다 (05-03, 05-04) | `src/adapters/platform/indexeddb-connection.ts`, `src/adapters/storage/indexeddb/indexeddb-runtime.ts`, `src/adapters/storage/opfs/opfs-byte-store-adapter.ts`, `src/application/ports/browser-file-storage/` | `3e37fbf`, `6ab564f` | -| [계약] | `RELEASE_TARGET`이 `APP_PROFILE`과 다르면 배포 승인이 거절된다 (12-02, 13-01) | `scripts/check-release-admission.ts`, `.gitea/workflows/quality-gates.yml` | `239b22a` | -| [계약] | 설정·매니페스트 URL이 `VITE_ROUTER_BASE_PATH`를 따른다. base 밖의 설정 URL은 빌드를 멈춘다 (13-07) | `scripts/generate-runtime-config.ts`, `src/contracts/env.ts`, `vite.config.ts` | `e215c84` | -| [계약] | `VITE_PRODUCT_FEATURES`는 생성기에서 적용되고, 모르는 기능 ID는 빌드를 멈춘다 (09-02) | `scripts/generate-product-feature-index.ts`, `src/contracts/product-features.ts` | `a8111f7` | -| [계약] | `src/features//`에 `feature-module.ts`도 `NOT_INSTALLED` 표식도 없으면 생성기가 실패한다. 기능 제거 검사는 `--feature=`를 받는다 (09-07, 14-03) | `scripts/generate-product-feature-index.ts`, `scripts/test-sample-removal.ts`, `config/contracts/registry-governance.json`, `docs/architecture/starter-experience.md` | `ad0e83c` | -| [계약] | 기능 루트·context·app 파일은 `src/adapters`를 import할 수 없다. presentation은 app·context를 import할 수 없다(`app-router.tsx` 예외) (12-03) | `scripts/check-architecture.ts`, `.dependency-cruiser.json`, `docs/architecture/layers.md` | `f8b6a36` | -| [계약] | CI 계약의 게이트 수·해시가 `config/ci/contract-baseline.json`으로 옮겨졌다. 게이트를 바꾸면 `update:ci-contract-baseline`로 갱신한다 (14-02) | `config/ci/contract-baseline.json`, `scripts/check-ci-contract.ts` | `0114b1e` | -| [계약] | 모든 테스트 파일은 어떤 게이트가 돌리거나 `config/ci/ungated-tests.json`에 이유가 있어야 한다 (12-04, 09-11, 11-03) | `config/ci/gates.json`, `config/ci/ungated-tests.json`, `scripts/lib/ungated-tests.ts` | `840de45`, `45ee231` | -| [계약] | 게이트 판정 변경: 서명된 수동 접근성 검토는 release 게이트 FE-GATE-028로, runbook drill은 관측하지 못한 단계를 `UNVERIFIED`(exit 3)로, FE-GATE-016은 폐지, FE-GATE-019는 배포 뒤 production 단계에서 돈다 (08-06, 11-01, 13-03, 13-05) | `config/ci/gates.json`, `.gitea/workflows/quality-gates.yml`, `scripts/drill-runbook.ts`, `docs/operations/ci-quality-gates.md` | `7298275`, `7f889a6`, `a263d8c` | -| [계약] | `engineStrict`, `saveExact`를 `pnpm-workspace.yaml`로 옮겼다. 지원하지 않는 Node에서 설치가 실패한다 (13-09) | `pnpm-workspace.yaml`, `.npmrc` | `a5dc851` | -| [계약] | 폼 저장 실패에 재로그인·권한 없음·나중에 재시도 상태가 따로 생겼다 (08-01) | `src/presentation/forms/form-contracts.ts`, `src/presentation/forms/use-app-form.ts`, `src/presentation/forms/form-components.tsx` | `9894a70` | -| [계약] | browser-transfer 포트: `upload()` 실패의 recovery 값이 다섯 개로 정리됐고, 완료된 업로드는 `resourceId`를 잃지 않는다. 시간 제한이 바이트 수에 비례한다 (01-01~01-11). file-transfer recipe를 쓰는 프로젝트만 해당 | `src/application/ports/browser-transfer/`, `src/adapters/browser-transfer/` | `648fe4e`, `7b2cefb`, `5a6665a`, `426b6b8` 외 | -| [계약] | IndexedDB·OPFS 포트: 미래 스키마는 `INCOMPATIBLE`, 빈 receipt는 없음으로 본다 (05-01~05-14). offline-indexeddb recipe를 쓰는 프로젝트만 해당 | `src/application/ports/browser-file-storage/`, `src/adapters/storage/` | `7f45afa`, `47cf040`, `8fc816e` 외 | +| [계약] | 모든 V3 HTTP 요청이 논리 실행마다 `x-correlation-id` 헤더를 하나 보낸다. 다른 origin API는 preflight `Access-Control-Allow-Headers`에 이 헤더를 넣어야 요청이 나간다. 응답의 같은 헤더를 읽으려면 `Access-Control-Expose-Headers`에도 넣는다 (0925/03-03) | `src/adapters/http/http-execution-v3.ts`, `src/adapters/http/feature-http-binding.ts`, `src/bootstrap/runtime-adapters.ts`, `docs/operations/api-contract-and-server-state-recovery.md` | `c5da3cf`, `f0a6495` | +| [계약] | 결과를 모르는 쓰기(응답 유실)를 다시 보낼 때 처음의 멱등 키를 그대로 쓴다. 백엔드는 같은 키의 재전송을 한 번만 적용해야 한다 (0925/03-01, 0925/08-03) | `src/presentation/adapters/query/application-query.ts`, `src/presentation/forms/use-app-form.ts`, `src/presentation/components/async-surface.tsx` | `dfb1b9e` | +| [계약] | 명령의 401/403/429를 기능 패키지가 분류할 수 있다(`classifyStatus`, 선택 필드). 재로그인이 먼저다 (0925/03-02) | `src/adapters/http/http-effect-certainty.ts`, `src/adapters/http/http-execution-v3.ts`, `src/contracts/errors.ts`, `src/contracts/external-contract-runtime.ts` | `2afee67` | +| [계약] | 422 problem body의 필드 오류(`path`, `code`)를 폼까지 전달한다 (0925/03-04) | `src/adapters/http/feature-http-binding.ts`, `src/features/reference-feature/contracts/reference-schemas.ts` | `479acd5` | +| [계약] | 텔레메트리 수집기 이벤트마다 `build_id`, `release_id`가 붙는다. 한 번에 보내는 본문은 60KiB 아래로 나뉜다 (0925/13-11, 0925/03-05) | `src/adapters/telemetry/telemetry-collector.ts`, `src/bootstrap/runtime-adapters.ts` | `43e47f4`, `e14c613` | +| [보안] | 번들이 읽지 않는 `VITE_*` 값까지 통째로 넣던 문제를 고쳤다. 값은 키로만 읽고, `ENV_REGISTRY`에 없는 `VITE_*` 이름은 빌드를 멈춘다 (0925/13-06) | `src/contracts/env.ts`, `vite.config.ts`, `eslint.config.ts` | `2ec59ad` | +| [보안] | 로그아웃·계정 삭제 purge가 손상된 IndexedDB 때문에 열리지 않으면 그 파티션의 DB를 지운다. OPFS purge는 남은 chunk를 바로 지운다 (0925/05-03, 0925/05-04) | `src/adapters/platform/indexeddb-connection.ts`, `src/adapters/storage/indexeddb/indexeddb-runtime.ts`, `src/adapters/storage/opfs/opfs-byte-store-adapter.ts`, `src/application/ports/browser-file-storage/` | `3e37fbf`, `6ab564f` | +| [계약] | `RELEASE_TARGET`이 `APP_PROFILE`과 다르면 배포 승인이 거절된다 (0925/12-02, 0925/13-01) | `scripts/check-release-admission.ts`, `.gitea/workflows/quality-gates.yml` | `239b22a` | +| [계약] | 설정·매니페스트 URL이 `VITE_ROUTER_BASE_PATH`를 따른다. base 밖의 설정 URL은 빌드를 멈춘다 (0925/13-07) | `scripts/generate-runtime-config.ts`, `src/contracts/env.ts`, `vite.config.ts` | `e215c84` | +| [계약] | `VITE_PRODUCT_FEATURES`는 생성기에서 적용되고, 모르는 기능 ID는 빌드를 멈춘다 (0925/09-02) | `scripts/generate-product-feature-index.ts`, `src/contracts/product-features.ts` | `a8111f7` | +| [계약] | `src/features//`에 `feature-module.ts`도 `NOT_INSTALLED` 표식도 없으면 생성기가 실패한다. 기능 제거 검사는 `--feature=`를 받는다 (0925/09-07, 0925/14-03) | `scripts/generate-product-feature-index.ts`, `scripts/test-sample-removal.ts`, `config/contracts/registry-governance.json`, `docs/architecture/starter-experience.md` | `ad0e83c` | +| [계약] | 기능 루트·context·app 파일은 `src/adapters`를 import할 수 없다. presentation은 app·context를 import할 수 없다(`app-router.tsx` 예외) (0925/12-03) | `scripts/check-architecture.ts`, `.dependency-cruiser.json`, `docs/architecture/layers.md` | `f8b6a36` | +| [계약] | CI 계약의 게이트 수·해시가 `config/ci/contract-baseline.json`으로 옮겨졌다. 게이트를 바꾸면 `update:ci-contract-baseline`로 갱신한다 (0925/14-02) | `config/ci/contract-baseline.json`, `scripts/check-ci-contract.ts` | `0114b1e` | +| [계약] | 모든 테스트 파일은 어떤 게이트가 돌리거나 `config/ci/ungated-tests.json`에 이유가 있어야 한다 (0925/12-04, 0925/09-11, 0925/11-03) | `config/ci/gates.json`, `config/ci/ungated-tests.json`, `scripts/lib/ungated-tests.ts` | `840de45`, `45ee231` | +| [계약] | 게이트 판정 변경: 서명된 수동 접근성 검토는 release 게이트 FE-GATE-028로, runbook drill은 관측하지 못한 단계를 `UNVERIFIED`(exit 3)로, FE-GATE-016은 폐지, FE-GATE-019는 배포 뒤 production 단계에서 돈다 (0925/08-06, 0925/11-01, 0925/13-03, 0925/13-05) | `config/ci/gates.json`, `.gitea/workflows/quality-gates.yml`, `scripts/drill-runbook.ts`, `docs/operations/ci-quality-gates.md` | `7298275`, `7f889a6`, `a263d8c` | +| [계약] | `engineStrict`, `saveExact`를 `pnpm-workspace.yaml`로 옮겼다. 지원하지 않는 Node에서 설치가 실패한다 (0925/13-09) | `pnpm-workspace.yaml`, `.npmrc` | `a5dc851` | +| [계약] | 폼 저장 실패에 재로그인·권한 없음·나중에 재시도 상태가 따로 생겼다 (0925/08-01) | `src/presentation/forms/form-contracts.ts`, `src/presentation/forms/use-app-form.ts`, `src/presentation/forms/form-components.tsx` | `9894a70` | +| [계약] | browser-transfer 포트: `upload()` 실패의 recovery 값이 다섯 개로 정리됐고, 완료된 업로드는 `resourceId`를 잃지 않는다. 시간 제한이 바이트 수에 비례한다 (0925/01-01~01-11). file-transfer recipe를 쓰는 프로젝트만 해당 | `src/application/ports/browser-transfer/`, `src/adapters/browser-transfer/` | `648fe4e`, `7b2cefb`, `5a6665a`, `426b6b8` 외 | +| [계약] | IndexedDB·OPFS 포트: 미래 스키마는 `INCOMPATIBLE`, 빈 receipt는 없음으로 본다 (0925/05-01~05-14). offline-indexeddb recipe를 쓰는 프로젝트만 해당 | `src/application/ports/browser-file-storage/`, `src/adapters/storage/` | `7f45afa`, `47cf040`, `8fc816e` 외 | | [계약] | 외부 세션 owner의 `readSubject()`와 `SessionGateway.getSubject()`가 필수가 됐다. `readSubject`가 없는 owner는 `integration-failed`로 닫힌다. 토큰 갱신마다 서버 상태 캐시가 비워지던 문제를 막는다 | `src/adapters/auth/external-session-adapter.ts`, `src/application/ports/`, `docs/architecture/starter-experience.md` | `c6300e9` | -| [보안] | 운영 CSP(`unsafe-eval` 없음) 아래에서 zod가 eval을 시험하지 않는다. `src/`의 코드는 zod를 `src/contracts/zod.ts`로만 가져온다(dependency-cruiser 규칙) (13-08, F-7) | `src/contracts/zod.ts`, `.dependency-cruiser.json`, `tests/e2e/production-csp.spec.ts` | `9dc95ca` | -| [계약] | 레지스트리 호환성 분류기가 모르는 스키마 변경을 breaking으로 본다. 런타임 설정 스키마도 기준선과 비교한다(FE-GATE-014) (07-02, 13-10) | `src/contracts/compatibility.ts`, `scripts/check-registries.ts`, `config/contracts/` | `17d617a` | -| [계약] | 오류 레지스트리에서 읽지 않는 필드를 뺐다. 호환 별칭과 V1 reader에 `@deprecated`와 제거 조건을 붙였다 (07-04, 07-07) | `src/contracts/errors.ts`, `src/contracts/` | `aff5f43`, `9e616d3` | -| [계약] | staging·production 빌드는 `VITE_BUILD_ID`가 없으면 실패한다 (13-15, F-6) | `scripts/generate-runtime-config.ts`, `src/contracts/env.ts` | `063375e` | -| [계약] | Service Worker 빌드가 `public/config.json` 대신 프로필에서 만든 `dist/config.json`을 읽고, `APP_ENV`가 `APP_PROFILE`과 다르면 빌드를 멈춘다 (06-10, F-8) | `vite.service-worker.config.ts`, `scripts/lib/service-worker-build-input.ts` | `cefb0b2` | -| [계약] | Web Push: 탭 사이 구독 제어를 Web Lock으로 직렬화하고, 새 세션이 다른 계정의 push fence를 넘겨받는다. `REMOVE_REGISTRATION`은 스스로 등록을 해지하는 worker를 배포한다 (06-02, 06-06, 06-03) | `src/adapters/web-push/`, `scripts/lib/self-unregistering-service-worker.ts`, `docs/runbooks/` | `e6c683e`, `996a959`, `9f2305a` | -| [계약] | realtime: 세션이 끝날 때마다 재시도 예산을 초기화하고 offline 동안 멈춘다. SSE `Retry-After`를 따른다. 등록되지 않은 이벤트 종류는 registry mismatch로 끝난다 (04-01~04-08). realtime recipe를 쓰는 프로젝트만 해당. 레시피 번들 예산은 40,900 bytes로 올렸다 | `src/adapters/realtime/`, `config/recipes/frontend-capability-recipes.json` | `bcad7b0`, `02d3fdf`, `7e37660`, `2c5e268` 외 | -| [계약] | browser-files 포트: 같은 턴의 abort는 `ABORTED`, 닫은 선택 창은 `DISMISSED`, 소진된 object URL lease는 재시도 가능으로 보고한다. Cache Storage는 후보 항목을 검증한 뒤에만 verified로 보고한다 (02-01~02-09). browser-files recipe를 쓰는 프로젝트만 해당 | `src/adapters/browser-file-storage/`, `src/adapters/cache-storage/` | `c9be8d6`, `d76653b`, `0b41cb3`, `55c0bf5` 외 | -| [계약] | 샘플 상세 경로가 `/examples/reference-resources/items/:resourceId`로 옮겨졌다. ID가 `new`·`status`인 항목도 상세가 열린다 (08-13) | `src/features/reference-feature/contracts/reference-feature-contract.ts`, `config/contracts/registry-change-evidence.json` | `d7b81c6` | -| [계약] | `tsconfig.base.json`에 `noUnusedLocals`를 켰다. 복사한 프로젝트의 쓰지 않는 import·변수가 `check:types`에서 실패한다 (12-12) | `tsconfig.base.json` | `49413af` | +| [보안] | 운영 CSP(`unsafe-eval` 없음) 아래에서 zod가 eval을 시험하지 않는다. `src/`의 코드는 zod를 `src/contracts/zod.ts`로만 가져온다(dependency-cruiser 규칙) (0925/13-08, 0925/F-7) | `src/contracts/zod.ts`, `.dependency-cruiser.json`, `tests/e2e/production-csp.spec.ts` | `9dc95ca` | +| [계약] | 설정 스키마 호환성 분류기(`classifyObjectSchemaChange`)가 모르는 스키마 변경을 breaking으로 본다. 런타임 설정 스키마도 기준선과 비교한다(FE-GATE-014, `verify:compatibility`). 레지스트리 분류기(`scripts/lib/registry-compatibility.ts`)와는 다른 것이다 (0925/07-02, 0925/13-10) | `src/contracts/compatibility.ts`, `scripts/check-compatibility.ts`, `config/compatibility/` | `17d617a` | +| [계약] | 오류 레지스트리에서 읽지 않는 필드를 뺐다. 호환 별칭과 V1 reader에 `@deprecated`와 제거 조건을 붙였다 (0925/07-04, 0925/07-07) | `src/contracts/errors.ts`, `src/contracts/` | `aff5f43`, `9e616d3` | +| [계약] | staging·production 빌드는 `VITE_BUILD_ID`가 없으면 실패한다 (0925/13-15, 0925/F-6) | `scripts/generate-runtime-config.ts`, `src/contracts/env.ts` | `063375e` | +| [계약] | Service Worker 빌드가 `public/config.json` 대신 프로필에서 만든 `dist/config.json`을 읽고, `APP_ENV`가 `APP_PROFILE`과 다르면 빌드를 멈춘다 (0925/06-10, 0925/F-8) | `vite.service-worker.config.ts`, `scripts/lib/service-worker-build-input.ts` | `cefb0b2` | +| [계약] | Web Push: 탭 사이 구독 제어를 Web Lock으로 직렬화하고, 새 세션이 다른 계정의 push fence를 넘겨받는다. `REMOVE_REGISTRATION`은 스스로 등록을 해지하는 worker를 배포한다 (0925/06-02, 0925/06-06, 0925/06-03) | `src/adapters/web-push/`, `scripts/lib/self-unregistering-service-worker.ts`, `docs/runbooks/` | `e6c683e`, `996a959`, `9f2305a` | +| [계약] | realtime: 세션이 끝날 때마다 재시도 예산을 초기화하고 offline 동안 멈춘다. SSE `Retry-After`를 따른다. 등록되지 않은 이벤트 종류는 registry mismatch로 끝난다 (0925/04-01~04-08). realtime recipe를 쓰는 프로젝트만 해당. 레시피 번들 예산은 40,900 bytes로 올렸다 | `src/adapters/realtime/`, `config/recipes/frontend-capability-recipes.json` | `bcad7b0`, `02d3fdf`, `7e37660`, `2c5e268` 외 | +| [계약] | browser-files 포트: 같은 턴의 abort는 `ABORTED`, 닫은 선택 창은 `DISMISSED`, 소진된 object URL lease는 재시도 가능으로 보고한다. Cache Storage는 후보 항목을 검증한 뒤에만 verified로 보고한다 (0925/02-01~02-09). browser-files recipe를 쓰는 프로젝트만 해당 | `src/adapters/browser-file-storage/`, `src/adapters/cache-storage/` | `c9be8d6`, `d76653b`, `0b41cb3`, `55c0bf5` 외 | +| [계약] | 샘플 상세 경로가 `/examples/reference-resources/items/:resourceId`로 옮겨졌다. ID가 `new`·`status`인 항목도 상세가 열린다 (0925/08-13) | `src/features/reference-feature/contracts/reference-feature-contract.ts`, `config/contracts/registry-change-evidence.json` | `d7b81c6` | +| [계약] | `tsconfig.base.json`에 `noUnusedLocals`를 켰다. 복사한 프로젝트의 쓰지 않는 import·변수가 `check:types`에서 실패한다 (0925/12-12) | `tsconfig.base.json` | `49413af` | ### 그 밖의 수정 -- 부트: 앱 모듈 평가 실패, 분류되지 않은 오류, 재시도 가능한 실패에 오류 화면을 보여 준다 (09-03, 09-04, 09-10). `src/bootstrap/`, `src/presentation/boundaries/boot-error-shell.tsx` -- 부트: `FEATURE_OVERRIDES`의 모르는 키를 진단으로 남긴다 (09-09). `src/bootstrap/runtime-adapters.ts`, `scripts/check-release-admission.ts` -- 빌드: `dist` 파일을 다른 사용자도 읽을 수 있게 한다 (13-02). `scripts/lib/dist-permissions.ts` -- 공급망: 번들에 들어간 패키지 목록과 각 증거의 범위를 남긴다. 승격된 릴리스를 나중에 다시 검증한다 (13-12, 13-04). `scripts/lib/vite-module-inventory.ts`, `scripts/verify-exact-promotion-bundle.ts` -- 아키텍처 검사: dependency-cruiser 실행을 멈추고 import graph 하나로 검사한다. 경계 예외를 좁히고, 위반 메시지에 이유와 갈 곳을 적는다 (12-05~12-11). `scripts/check-architecture.ts` -- 기능 조립: `needs` 검사, 기능 두 개 설치 시 타입 유지, local-draft 샘플 정리 (09-01, 09-05, 09-06, 09-08, 09-12, 00-02). `src/features/`, `src/bootstrap/runtime-adapters.ts` -- 테스트 보강: production CSP 아래 빌드 smoke, 멱등 키 재사용, IndexedDB fake, KEYED 재시도 (13-08, 01-04, 05-08, 10-03) -- 샘플 제거: `test:sample-removal`이 다시 통과한다. 플랫폼 테스트가 샘플 대신 테스트 전용 기능을 쓴다 (14-01, 14-08, 00-01, 10-01). `scripts/test-sample-removal.ts`, `scripts/lib/removal-fixture.ts` -- 문서: README에 런타임 프로필·배포 변수·우선순위를 적고 `verify:documentation`이 변수 목록을 검사한다 (13-15). 성능 예산, 공급망, 운영 runbook 문서를 코드에 맞췄다 (13-13, 13-14, 03-06, 03-08). +- 부트: 앱 모듈 평가 실패, 분류되지 않은 오류, 재시도 가능한 실패에 오류 화면을 보여 준다 (0925/09-03, 0925/09-04, 0925/09-10). `src/bootstrap/`, `src/presentation/boundaries/boot-error-shell.tsx` +- 부트: `FEATURE_OVERRIDES`의 모르는 키를 진단으로 남긴다 (0925/09-09). `src/bootstrap/runtime-adapters.ts`, `scripts/check-release-admission.ts` +- 빌드: `dist` 파일을 다른 사용자도 읽을 수 있게 한다 (0925/13-02). `scripts/lib/dist-permissions.ts` +- 공급망: 번들에 들어간 패키지 목록과 각 증거의 범위를 남긴다. 승격된 릴리스를 나중에 다시 검증한다 (0925/13-12, 0925/13-04). `scripts/lib/vite-module-inventory.ts`, `scripts/verify-exact-promotion-bundle.ts` +- 아키텍처 검사: dependency-cruiser 실행을 멈추고 import graph 하나로 검사한다. 경계 예외를 좁히고, 위반 메시지에 이유와 갈 곳을 적는다 (0925/12-05~12-11). `scripts/check-architecture.ts` +- 기능 조립: `needs` 검사, 기능 두 개 설치 시 타입 유지, local-draft 샘플 정리 (0925/09-01, 0925/09-05, 0925/09-06, 0925/09-08, 0925/09-12, 0925/00-02). `src/features/`, `src/bootstrap/runtime-adapters.ts` +- 테스트 보강: production CSP 아래 빌드 smoke, 멱등 키 재사용, IndexedDB fake, KEYED 재시도 (0925/13-08, 0925/01-04, 0925/05-08, 0925/10-03) +- 샘플 제거: `test:sample-removal`이 다시 통과한다. 플랫폼 테스트가 샘플 대신 테스트 전용 기능을 쓴다 (0925/14-01, 0925/14-08, 0925/00-01, 0925/10-01). `scripts/test-sample-removal.ts`, `scripts/lib/removal-fixture.ts` +- 문서: README에 런타임 프로필·배포 변수·우선순위를 적고 `verify:documentation`이 변수 목록을 검사한다 (0925/13-15). 성능 예산, 공급망, 운영 runbook 문서를 코드에 맞췄다 (0925/13-13, 0925/13-14, 0925/03-06, 0925/03-08). -- 화면: 오류 종류마다 문구가 있고, 실패 화면에 지원 참조와 다음 행동이 나온다. 언어를 바꾸면 폼 오류도 다시 번역된다. 조회 실패의 인증·권한·없음 화면이 갤러리와 같은 컴포넌트다. 수정키 클릭은 브라우저에 맡긴다. 스크롤·해시 이동을 복원한다 (07-01, 08-02, 08-04, 08-07~08-12, F-10). `src/presentation/`, `src/presentation/i18n/` -- 접근성·visual 검사가 로그인 뒤 실제 화면을 상태별로 검사한다 (08-05, 11-02). `tests/e2e/accessibility.spec.ts` -- 계약 테스트: V2/V3 일치, 두 번째 기능의 레지스트리 통과, validator 결과 검사 (07-03, 07-05, 07-06, 09-07, F-3). `tests/unit/`, `src/contracts/` -- Service Worker: 알림 클릭, kill switch, drain 시간 초과, 이전 릴리스 fallback, 거절 클릭 경로, 시작 실패 텔레메트리 (06-01, 06-04, 06-05, 06-07~06-09). `src/adapters/web-push/`, `src/adapters/service-worker/`, `src/bootstrap/` -- 테스트 체계: 부하에 강한 대기, 커버리지 정책, 파일 하나 실행, 실제 타이머 복원, 포커스 테스트 금지, reference 데이터 E2E, 실제 모양 기능 규모 측정, SW 없는 구 탭 청크 복구, 성능 측정 중앙값, 모듈 평가 실패 부트 화면 (10-02, 10-04~10-07, 11-04~11-08, F-2). `tests/`, `scripts/scale/`, `scripts/lib/lab-performance.ts` -- 테스트 fixture가 공유 `node_modules`를 다시 쓰지 않고, 임시 폴더를 지운다 (F-4, F-12, 00-03). `scripts/lib/removal-fixture.ts`, `tests/unit/` -- 문서: 손으로 적은 게이트 수와 LOC를 지우고 `verify:documentation`의 검사 범위를 적었다 (14-07) +- 화면: 오류 종류마다 문구가 있고, 실패 화면에 지원 참조와 다음 행동이 나온다. 언어를 바꾸면 폼 오류도 다시 번역된다. 조회 실패의 인증·권한·없음 화면이 갤러리와 같은 컴포넌트다. 수정키 클릭은 브라우저에 맡긴다. 스크롤·해시 이동을 복원한다 (0925/07-01, 0925/08-02, 0925/08-04, 0925/08-07~08-12, 0925/F-10). `src/presentation/`, `src/presentation/i18n/` +- 접근성·visual 검사가 로그인 뒤 실제 화면을 상태별로 검사한다 (0925/08-05, 0925/11-02). `tests/e2e/accessibility.spec.ts` +- 계약 테스트: V2/V3 일치, 두 번째 기능의 레지스트리 통과, validator 결과 검사 (0925/07-03, 0925/07-05, 0925/07-06, 0925/09-07, 0925/F-3). `tests/unit/`, `src/contracts/` +- Service Worker: 알림 클릭, kill switch, drain 시간 초과, 이전 릴리스 fallback, 거절 클릭 경로, 시작 실패 텔레메트리 (0925/06-01, 0925/06-04, 0925/06-05, 0925/06-07~06-09). `src/adapters/web-push/`, `src/adapters/service-worker/`, `src/bootstrap/` +- 테스트 체계: 부하에 강한 대기, 커버리지 정책, 파일 하나 실행, 실제 타이머 복원, 포커스 테스트 금지, reference 데이터 E2E, 실제 모양 기능 규모 측정, SW 없는 구 탭 청크 복구, 성능 측정 중앙값, 모듈 평가 실패 부트 화면 (0925/10-02, 0925/10-04~10-07, 0925/11-04~11-08, 0925/F-2). `tests/`, `scripts/scale/`, `scripts/lib/lab-performance.ts` +- 테스트 fixture가 공유 `node_modules`를 다시 쓰지 않고, 임시 폴더를 지운다 (0925/F-4, 0925/F-12, 0925/00-03). `scripts/lib/removal-fixture.ts`, `tests/unit/` +- 문서: 손으로 적은 게이트 수와 LOC를 지우고 `verify:documentation`의 검사 범위를 적었다 (0925/14-07) ### 알려진 제한 - Playwright spec은 chromium·firefox·webkit에서 확인했다. WebKit에서만 난 실패 1건(구 탭 청크 복구 spec의 콘솔 문구 허용 목록)은 `b1a36ab`로 고쳤다. -- 사용자 몫(SPEC "범위 밖" U-1~U-5, F-11)은 이 버전에 들어 있지 않다. +- 사용자 몫(SPEC "범위 밖" U-1~U-5, 0925/F-11)은 이 버전에 들어 있지 않다. ## 0.1.0 — `main` `4626b73` (2026-09-24) diff --git a/PRODUCT.md b/PRODUCT.md new file mode 100644 index 00000000..de4e8dc6 --- /dev/null +++ b/PRODUCT.md @@ -0,0 +1,56 @@ +# Product + + + +## Platform + +web + +## Users + +- **템플릿을 가져다 쓰는 개발자**: 이 템플릿으로 새 서비스를 빠르게 시작하는 사람입니다. 예제 화면(홈, 플랫폼 구성, UI 구성요소, 화면 상태, 인증 연동, Reference feature)은 이 사람이 실행 구조와 공통 동작을 확인하는 용도입니다. +- **파생 서비스의 최종 사용자**: 디자인 시스템(토큰, 프리미티브, 패턴, 레이아웃, 페이지 템플릿)은 이 템플릿으로 만든 서비스를 실제로 쓰는 사람을 기준으로 합니다. + +## Product Purpose + +도메인·비즈니스·DB 로직을 뺀 공통 기능을 모두 갖춘 React/Vite 프론트엔드 출발점입니다. 아키텍처 경계, 연동 동작, 릴리스 정합성, 접근성, 성능, 운영을 관례가 아니라 실행되는 계약으로 둡니다. 성공 기준은 이 템플릿에서 도메인만 추가해 서비스를 빠르게 만들고, 운영 중인 desktop 서버에 바로 띄워 출시할 수 있는 것입니다. + +## Positioning + +화면 품질 규칙(접근성, 상태 표현, 반응형, 토큰 사용)이 문서가 아니라 게이트로 강제됩니다. 시각 회귀 골든, 아키텍처 검사, 접근성 테스트가 그 게이트입니다. 그래서 파생 서비스가 템플릿을 고쳐도 기준이 조용히 낮아지지 않습니다. + +## Operating Context + +- 실행 형태는 브라우저 SPA + 정적 호스팅 + Service Worker입니다. SSR은 없습니다. +- 파생 서비스는 운영 중인 desktop 서버에 배포됩니다. +- 예제 앱 셸에는 테마 전환(시스템/라이트/다크), 언어 전환(한국어/영어), 로그인 상태 표시가 있습니다. + +## Capabilities and Constraints + +- 하나의 디자인 시스템으로 세 종류의 서비스를 받칩니다. 업무용·관리 도구(대시보드, 어드민, 설정), 일반 사용자용 웹 서비스, 소개·랜딩 페이지입니다. +- 디자인 시스템 위치는 `src/presentation/design-system/`입니다. 토큰은 primitive → semantic → component 세 단계로 파생됩니다(`tokens/primitive.css`, `semantic.css`, `component.css`). +- 시각 회귀 골든이 `tests/visual/__snapshots__/`에 있습니다. 화면을 바꾸면 골든도 의도적으로 갱신해야 합니다. +- 참조 기능(`src/features/reference-feature/`)은 `test:sample-removal`로 지울 수 있습니다. 예제 라우트 4개(`/examples/platform`, `ui`, `states`, `auth`)와 홈은 기본 구성이고 제거 드릴이 없습니다. 그래서 예제 화면에만 넣은 디자인은 파생 서비스에 그대로 남습니다. +- 어떤 서비스가 먼저 만들어질지, 서비스별 우선순위는 아직 정하지 않았습니다. + +## Brand Commitments + +브랜드는 중립으로 유지합니다. 템플릿에는 브랜드 이름·로고·고유 톤을 넣지 않고, 서비스마다 토큰을 바꿔 브랜드를 입힙니다. 현재 표시 이름 "Frontend Skeleton"은 자리표시자입니다. + +## Evidence on Hand + +- 실제 고객, 사용 후기, 로고, 지표, 가격 정보는 없습니다. 지어내지 않습니다. +- 예제 문구는 템플릿 기능 설명뿐입니다(`src/presentation/i18n/catalog.ts`). +- 현재 화면 기록: `tests/visual/__snapshots__/platform.visual.spec.ts-snapshots/`, Storybook(`src/presentation/design-system/design-system.stories.tsx`). + +## Product Principles + +1. 디자인 시스템은 최종 사용자를 위한 것이고, 예제 화면은 개발자를 위한 것입니다. 둘을 섞지 않습니다. +2. 브랜드는 토큰으로만 바꿉니다. 컴포넌트에 브랜드 값을 직접 넣지 않습니다. +3. 업무 도구, 일반 서비스, 랜딩을 모두 받쳐야 하므로 밀도와 표현 폭은 토큰과 페이지 템플릿에서 조절합니다. 컴포넌트를 서비스 종류별로 복제하지 않습니다. +4. 접근성과 상태 표현(로딩, 빈 상태, 오류, 권한 없음)은 기능이 아니라 기본값입니다. +5. 한국어가 기본이고 영어를 함께 지원합니다. 두 언어의 문구 길이 차이를 견디는 레이아웃이어야 합니다. + +## Accessibility & Inclusion + +WCAG 2.2 AA를 기준으로 합니다. 키보드 탐색, 포커스 이동과 복원, 색에만 의존하지 않는 상태 표현, 라이트·다크 테마 모두에서 대비를 지킵니다. 릴리스 후보 하나로 라우트를 사람이 직접 접근성 검토하는 절차가 따로 있습니다(`docs/accessibility/manual-checklist.md`). diff --git a/README.md b/README.md index b21660d1..be85eada 100644 --- a/README.md +++ b/README.md @@ -41,9 +41,9 @@ Build and deploy variables, lowest precedence first: | Variable | Sets | Default | | --- | --- | --- | | `APP_PROFILE` | which `config/runtime/.json` is used | `local`; an empty value fails the build | -| `RUNTIME_API_BASE_URL` | `API_BASE_URL`, overriding the profile | the profile value | -| `RUNTIME_TELEMETRY_ENDPOINT` | `TELEMETRY_ENDPOINT`, overriding the profile | the profile value | -| `VITE_BUILD_ID` | `BUILD_ID` in the runtime config and the release manifest | `local-build` | +| `RUNTIME_API_BASE_URL` | `API_BASE_URL`, overriding the profile; the CI workflow cannot pass it (see below) | the profile value | +| `RUNTIME_TELEMETRY_ENDPOINT` | `TELEMETRY_ENDPOINT`, overriding the profile; the CI workflow cannot pass it (see below) | the profile value | +| `VITE_BUILD_ID` | `BUILD_ID` in the runtime config and the release manifest | `local-build` for `local` and `development`; a `staging` or `production` build fails without it | | `RELEASE_ID` | `RELEASE_ID` in the runtime config and the release manifest | `local-release` | | `RELEASE_TARGET` | the environment FE-GATE-027 admits the build to; must equal `APP_PROFILE` | none; admission refuses without it | @@ -52,14 +52,23 @@ admission reads (`scripts/verify-documentation-readiness.ts`). Only the two `RUNTIME_*` values can differ from the reviewed profile. Anything else changes by editing the profile file. Staging and production reject demo -auth and non-HTTPS endpoints. +auth, non-HTTPS endpoints and the names reserved for examples and tests +(`example.com`, `example.net`, `example.org` and their subdomains, `.example`, +`.invalid`, `.test`). The shipped `staging` and `production` profiles use +`*.example.com`, so admission refuses them until a project sets its own +endpoints. -A production build and its admission check: +In CI the only way to set the endpoints is to commit them to +`config/runtime/.json`. The CI contract binds just `APP_PROFILE` and +`RELEASE_TARGET` to the build job (`scripts/contracts/ci-gates.ts`), so a +`RUNTIME_*` repository variable never reaches the build. + +A local production build and its admission check: ```bash APP_PROFILE=production \ -RUNTIME_API_BASE_URL=https://api.example.com/ \ -RUNTIME_TELEMETRY_ENDPOINT=https://telemetry.example.com/v1/events \ +RUNTIME_API_BASE_URL=/ \ +RUNTIME_TELEMETRY_ENDPOINT= \ VITE_BUILD_ID= RELEASE_ID= \ corepack pnpm build APP_PROFILE=production RELEASE_TARGET=production corepack pnpm check:release-admission @@ -73,16 +82,14 @@ list is in [`docs/operations/ci-quality-gates.md`](docs/operations/ci-quality-ga ## Included starter experience The default build mounts a domain-neutral application shell with a header, -responsive sidebar, route focus management, session integration status, and a -persistent `system` / `light` / `dark` theme selector. +responsive sidebar, route focus management, session integration status, a +persistent `system` / `light` / `dark` theme selector, and a language selector. -| Route | Purpose | -| --- | --- | -| `/` | implementation readiness and starter links | -| `/examples/ui` | buttons, fields, cards, alerts, badges, modal, and tokens | -| `/examples/states` | loading, refresh, empty, error, auth, forbidden, and not-found states | -| `/examples/auth` | reactive external-auth integration seam | -| `/examples/reference-resources` | removable, session-required reference feature | +The route list is `ROUTE_REGISTRY` (`src/features/installed-feature-contracts.ts`): +the platform routes of `src/contracts/routes.ts` plus the routes of every +installed feature, the removable reference feature included. The platform +overview page (`/examples/platform`) shows the composed list at runtime, so +this README keeps no copy of it and adding a feature does not edit it. `AUTH_MODE=demo` is credential-free and accepted only in local/development environments. Deployments use `AUTH_MODE=external` and provide the opaque auth @@ -114,7 +121,7 @@ and | `COMPOSED` | capability ledger, design documents | wired into the default production path | Default | | `INSTALLED` | a project's own recipe catalog (step 10 of the recipe procedure) | the project added the recipe | Default, for that project | | `RECIPE_AVAILABLE` | recipe catalog `status` | a recipe exists to copy; nothing is installed | Optional | -| `NOT_INSTALLED` | recipe catalog `defaultStatus`; a `src/features//NOT_INSTALLED` marker file | not part of the build | Optional (recipe) or Experimental (feature) | +| `NOT_INSTALLED` | recipe catalog `defaultStatus`; a declared feature the build or `FEATURE_OVERRIDES` left out. A sample directory that is no feature at all carries a `src/features//NOT_A_FEATURE` marker file instead | not part of the build | Optional (recipe) or Experimental (feature) | | `AVAILABLE_NOT_COMPOSED` | capability ledger; recipe `referenceRuntime.status` | code and tests exist; the default build leaves it out | Optional | | `DESIGNED_NOT_IMPLEMENTED` | capability ledger, design documents | design approved, runtime missing | Experimental | | `NOT_SELECTED` | capability ledger, design documents | deliberately not chosen | Not supported | @@ -137,20 +144,37 @@ This repository is a **Frontend Application Foundation**: a starter/composition skeleton plus a reusable capability platform. Platform capabilities stay horizontal while product business features use vertical slices. -Dependencies point inward: +`src/` has nine top-level folders. The descriptions match the table in +`docs/architecture/layers.md`, which also names every import rule: + +- `src/bootstrap` — the composition root: runtime configuration, concrete adapter construction and the React mount +- `src/apps` — deployable apps: each `app-module.ts` declares an app and its context budget; `template-app.ts` is the app this build produces +- `src/contexts` — bounded contexts: each `context-module.ts` declares its app, route root and feature budget +- `src/features` — removable vertical slices (`src/features//{domain,application,contracts,adapters,presentation}`) and the installed-feature catalogs (`src/features/*.ts`) +- `src/presentation` — generic UI and the inbound adapter: routes, layouts, the design system, pages and providers +- `src/adapters` — reusable capability runtimes that implement application ports: HTTP, auth, storage, query cache, telemetry, workers and more +- `src/application` — generic use cases, ports, policies and view-models +- `src/contracts` — shared vocabulary and registries read by several layers, the workers and the build and release scripts +- `src/platform` — product-neutral primitives any folder may use: budgets, execution context, resilience, the telemetry pipeline, error envelopes and release coherence + +Dependencies point inward. Every folder may also import `contracts` and +`platform`: ```text -presentation -> application -> domain +presentation -> application -> contracts -> platform adapters -----^ bootstrap composes concrete adapters +apps -> contexts -> features (an app deploys contexts; a context owns features) feature use case -> feature port <- feature-owned capability binding ``` +Domain code lives inside each feature; there is no top-level domain folder. + See `docs/architecture/frontend-application-foundation.md`, `docs/architecture/overview.md`, `docs/architecture/layers.md`, and `docs/architecture/starter-experience.md`. The removable vertical slice is -under `src/features/reference-feature`; its domain, application input, HTTP +the reference sample, src/features/reference-feature; its domain, application input, HTTP binding, contracts, route runtime, and presentation own their contributions. The central installed catalogs only aggregate selected contributions. The generic starter routes continue to typecheck, test, and build after that @@ -188,6 +212,8 @@ and executable gates pass. [`docs/README.md`](docs/README.md) sorts the documents into current contracts, target designs and work history. +[`docs/manual/`](docs/manual/README.md) is the step-by-step guide (Korean) for +adding a feature, starting from `corepack pnpm create:feature `. ### Files you can delete after copying @@ -198,9 +224,10 @@ reads them, except the one file noted below | Path | Contents | | --- | --- | | `docs/superpowers/` | past plans and specs | -| `docs/reviews/` | reviews and the review guide. Keep `docs/reviews/adapters/INVENTORY.md`: `check:adapter-inventory` (FE-GATE-010) reads it | +| `docs/reviews/` | reviews and the review guide. Keep `docs/reviews/adapters/`: `check:adapter-inventory` (FE-GATE-010) reads its `INVENTORY.md`, whose rows link to the adapter reviews beside it, and `docs/operations/adapter-remediation-ledger.md` cites those reviews | | `SPEC.md`, `tasks/` | requirements and task list of the 2026-09-25 review fix round | | `CLAUDE.md` | review instructions for the template repository itself; replace it with your own | +| `PRODUCT.md` | product context of the template itself (users, purpose, principles) for design tools; replace it with your product's | The reference feature is not in this list: deleting its directory alone leaves tests, policy entries and CI scripts behind that fail the gates. @@ -268,20 +295,22 @@ corepack pnpm exec playwright install --with-deps chromium firefox webkit Two gates intentionally need external evidence: - `review:a11y-manual` (release gate FE-GATE-028) needs a signed human - keyboard/focus/screen-reader review for all ten registered routes: `APP_HOME`, `EXAMPLES_PLATFORM`, - `EXAMPLES_UI`, `EXAMPLES_STATES`, `EXAMPLES_AUTH`, `NOT_FOUND`, - `REFERENCE_RESOURCE_LIST`, `REFERENCE_RESOURCE_DETAIL`, - `REFERENCE_RESOURCE_FORM` and `REFERENCE_RESOURCE_STATUS`. - `verify:documentation` derives that list from the route registry and fails if - this paragraph falls behind it. The merge gate FE-GATE-009 runs only + keyboard/focus/screen-reader review of every registered route, one record + per route at `artifacts/tests/a11y-manual/.md`. The routes are + `ROUTE_REGISTRY`; `verify:documentation` fails, naming the route ID, when a + registered route has no record. The merge gate FE-GATE-009 runs only `review:a11y-manual -- --format-only`, which checks that every route record keeps the template's fields, reviewed or still pending. - `collect:web-vitals-evidence` stays `FAIL_UNVERIFIED` until a reviewed minimum eligible-sample threshold and 28 days of production data exist. Live hosting verification (FE-GATE-019, production stage) requires -`HOSTING_BASE_URL` and a deployed promoted release; without it the result is -`UNVERIFIED`, not `PASS`. +`HOSTING_BASE_URL` and the promoted release deployed by the workflow's +`deployment` job. That job is an empty slot until the project fills it in +`config/ci/product-gates.json` +([`docs/operations/ci-quality-gates.md`](docs/operations/ci-quality-gates.md)); +until then the result is `UNVERIFIED`, not `PASS`. A host serving another +release fails, and so does one without HTTP/2 or entry compression. ## CI and evidence @@ -297,15 +326,29 @@ MERGE_READY -> RELEASE_READY -> PROD_PROMOTION_READY -> FIELD_SLO_READY The workflow runs on pull requests, pushes to `main` and `develop`, and `v*` tags. The Git host of this repository may not have Actions enabled, so a pull request can show no gate status at all; no status is not a pass. Until the -host runs the workflow and marks the merge gates as required checks, run the 13 +host runs the workflow and marks the merge gates as required checks, run the 14 merge gates locally before merging (FE-GATE-008 and 009 need Playwright -browsers): +browsers; FE-GATE-012 builds the app first). Product checks listed in +`config/ci/product-gates.json` (`PRODUCT-GATE-NNN`) run in the workflow's own +`product_merge_gate` job: ```bash -for gate in 001 002 003 004 005 006 007 008 009 010 011 013 020; do +for gate in 001 002 003 004 005 006 007 008 009 010 011 012 013 020; do corepack pnpm ci:gate -- "FE-GATE-$gate" || break done ``` + +To run them as the workflow does, give the workflow's environment first. +`CI=true` makes the runner and the release build require the CI build +identity; builds a test makes of a copy (fixture builds, the visual goldens' +build, the dev servers of the browser tests) run as local builds whatever this +says (`localBuildEnvironment` in `scripts/lib/build-environment.ts`). Run it in +a clean clone: `ci:gate` stops a gate at its first failing command. + +```bash +export CI=true VITE_COMMIT_SHA="$(git rev-parse HEAD)" VITE_BUILD_ID=local-ci-1 \ + RELEASE_ID=local-ci-1 CI_RUNNER_IMAGE="local/runner@sha256:$(printf 'a%.0s' $(seq 64))" +``` Machine-readable evidence is written below `artifacts/`; generated evidence is ignored by Git while `.gitkeep` files preserve the taxonomy. @@ -317,7 +360,9 @@ Operational details are in `docs/operations/`, with incident procedures in Template versions are Git tags `vX.Y.Z`. [`CHANGELOG.md`](CHANGELOG.md) lists the changes between tags, marks security fixes **[보안]** and contract changes **[계약]** (backend, deployment, CI or feature code must change too), and names -the affected paths. +the affected paths. Its unreleased section summarizes one sync range (the +section head names the base commit and the branch); take that range as a whole +and do its "먼저 할 일" (BREAKING) steps in order before running the gates. Record where you started. Right after copying, commit a one-line `.template-origin` file at the root of your project with the template tag (or diff --git a/artifacts/phase5/check-architecture.log b/artifacts/phase5/check-architecture.log deleted file mode 100644 index 70a3edf3..00000000 --- a/artifacts/phase5/check-architecture.log +++ /dev/null @@ -1,5 +0,0 @@ -$ node scripts/check-architecture.ts -Static import graph: 330 modules, 984 dependencies, all imports resolved -Architecture graph fixtures: 16 regression checks PASS -TypeScript-only source policy: PASS (src, scripts, tests, .storybook, recipes; no fixture exceptions) -Architecture fixtures: allowed PASS, 9 forbidden rejected diff --git a/artifacts/phase5/check-types-app.log b/artifacts/phase5/check-types-app.log deleted file mode 100644 index 388c04b1..00000000 --- a/artifacts/phase5/check-types-app.log +++ /dev/null @@ -1 +0,0 @@ -$ tsc --project tsconfig.app.json diff --git a/artifacts/phase5/check-types-test.log b/artifacts/phase5/check-types-test.log deleted file mode 100644 index 08d11af4..00000000 --- a/artifacts/phase5/check-types-test.log +++ /dev/null @@ -1 +0,0 @@ -$ tsc --project tsconfig.test.json diff --git a/artifacts/phase5/traffic-regression.log b/artifacts/phase5/traffic-regression.log deleted file mode 100644 index fe4cb21b..00000000 --- a/artifacts/phase5/traffic-regression.log +++ /dev/null @@ -1,20 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/unit/http-retry-lifecycle.test.ts (4 tests) 4ms - ✓ tests/unit/realtime/bounded-polling-policy.test.ts (3 tests) 6ms - ✓ tests/unit/realtime/realtime-reconnect-policy.test.ts (7 tests) 6ms - ✓ tests/unit/retry-policy.test.ts (4 tests) 5ms - ✓ tests/unit/realtime/bounded-poll-coordinator.test.ts (16 tests) 25ms - ✓ tests/unit/realtime/live-poll-handoff-coordinator.test.ts (13 tests) 71ms - ✓ tests/unit/resumable-upload-runtime.test.ts (18 tests) 87ms - ✓ tests/unit/realtime/realtime-reconnect-coordinator.test.ts (25 tests) 32ms - ✓ tests/unit/tanstack-cache-coordinator.test.ts (8 tests) 168ms - ✓ tests/unit/resumable-upload-runtime-teardown.test.ts (4 tests) 163ms - ✓ tests/unit/realtime/stream-coordinator.test.ts (36 tests) 625ms - - Test Files  11 passed (11) - Tests  138 passed (138) - Start at  08:27:14 - Duration  1.40s (transform 1.56s, setup 3.50s, import 2.09s, tests 1.19s, environment 2ms) - diff --git a/artifacts/quality/extreme-scale-gates/build.log b/artifacts/quality/extreme-scale-gates/build.log deleted file mode 100644 index 98603526..00000000 --- a/artifacts/quality/extreme-scale-gates/build.log +++ /dev/null @@ -1,37 +0,0 @@ -contract set: 0 package(s) sha256:ad6aab71fea6a9ff87cbd170b984b339965afc90d85bb57f87801c9e0c020da2 -vite v8.1.5 building client environment for production... - transforming...✓ 2113 modules transformed. -rendering chunks... -computing gzip size... -dist/index.html 1.12 kB │ gzip: 0.45 kB -dist/.vite/manifest.json 8.11 kB │ gzip: 1.04 kB -dist/.vite/module-inventory.json 21.94 kB │ gzip: 3.15 kB -dist/assets/index-C0p5zoj4.css 39.62 kB │ gzip: 8.51 kB -dist/assets/installed-contract-contributions-CFHdeDEf.js 0.16 kB │ gzip: 0.15 kB -dist/assets/not-found-page-CHQA5rw5.js 0.45 kB │ gzip: 0.30 kB -dist/assets/reference-resource-status-page-t3RWROLD.js 0.51 kB │ gzip: 0.45 kB -dist/assets/use-reference-failure-action-BYb2UYeT.js 0.57 kB │ gzip: 0.37 kB -dist/assets/session-provider-CIR3Mmin.js 0.60 kB │ gzip: 0.39 kB -dist/assets/application-provider-_OkSTAcq.js 0.61 kB │ gzip: 0.34 kB -dist/assets/reference-resource-page-1-Q0DGen.js 1.21 kB │ gzip: 0.77 kB -dist/assets/reference-resource-detail-page-D5mbWw2a.js 1.23 kB │ gzip: 0.72 kB -dist/assets/async-state-CfvFHl3I.js 1.53 kB │ gzip: 0.49 kB -dist/assets/auth-example-page-htVwyPYW.js 1.78 kB │ gzip: 0.94 kB -dist/assets/context-routes-CEM0c3Wb.js 1.80 kB │ gzip: 0.70 kB -dist/assets/server-state-DQADfngu.js 2.24 kB │ gzip: 0.90 kB -dist/assets/home-page-a_jMrdst.js 2.37 kB │ gzip: 1.27 kB -dist/assets/state-gallery-page-CunviFji.js 2.70 kB │ gzip: 1.22 kB -dist/assets/reference-resource-form-page-BHq_gRJf.js 2.77 kB │ gzip: 1.50 kB -dist/assets/installed-feature-contracts-DgTAlLr2.js 4.52 kB │ gzip: 1.43 kB -dist/assets/ui-gallery-page-Ru0CrH32.js 8.09 kB │ gzip: 2.90 kB -dist/assets/platform-overview-page-BgxC-c_W.js 11.90 kB │ gzip: 4.08 kB -dist/assets/route-input-DpW3PpRj.js 19.72 kB │ gzip: 6.27 kB -dist/assets/use-reference-feature-DkrwJNPz.js 23.75 kB │ gzip: 8.06 kB -dist/assets/preload-helper-ChbRSsLi.js 101.06 kB │ gzip: 27.93 kB -dist/assets/design-system-Bd1NzELd.js 213.52 kB │ gzip: 65.78 kB -dist/assets/index-zhAbJ8ef.js 294.86 kB │ gzip: 91.72 kB - -✓ built in 361ms -runtime config: local profile written to dist/config.json (APP_ENV=local, AUTH_MODE=demo) -service worker mode null: skipping worker build -$ node scripts/build-frontend.ts diff --git a/artifacts/quality/extreme-scale-gates/check-app-build-input-bundle.log b/artifacts/quality/extreme-scale-gates/check-app-build-input-bundle.log deleted file mode 100644 index d6bc0c9a..00000000 --- a/artifacts/quality/extreme-scale-gates/check-app-build-input-bundle.log +++ /dev/null @@ -1,2 +0,0 @@ -app build input: app=template-app contexts=1 features=1 generatedImports=1 bundle=1 feature dirs PASS -$ node scripts/check-app-build-input.ts --require-bundle diff --git a/artifacts/quality/extreme-scale-gates/check-app-build-input.log b/artifacts/quality/extreme-scale-gates/check-app-build-input.log deleted file mode 100644 index 24ccd47a..00000000 --- a/artifacts/quality/extreme-scale-gates/check-app-build-input.log +++ /dev/null @@ -1,2 +0,0 @@ -app build input: app=template-app contexts=1 features=1 generatedImports=1 bundle=not checked PASS -$ node scripts/check-app-build-input.ts diff --git a/artifacts/quality/extreme-scale-gates/check-architecture.log b/artifacts/quality/extreme-scale-gates/check-architecture.log deleted file mode 100644 index 565ed845..00000000 --- a/artifacts/quality/extreme-scale-gates/check-architecture.log +++ /dev/null @@ -1,5 +0,0 @@ -Static import graph: 363 modules, 1043 dependencies, all imports resolved -Architecture graph fixtures: 16 regression checks PASS -TypeScript-only source policy: PASS (src, scripts, tests, .storybook, recipes; no fixture exceptions) -Architecture fixtures: allowed PASS, 9 forbidden rejected -$ node scripts/check-architecture.ts diff --git a/artifacts/quality/extreme-scale-gates/check-diagnostics.log b/artifacts/quality/extreme-scale-gates/check-diagnostics.log deleted file mode 100644 index bfc6c2b0..00000000 --- a/artifacts/quality/extreme-scale-gates/check-diagnostics.log +++ /dev/null @@ -1,2 +0,0 @@ -Diagnostics contract: 8 diagnostics and 5 telemetry producers PASS -$ node scripts/check-diagnostics.ts diff --git a/artifacts/quality/extreme-scale-gates/check-feature-index.log b/artifacts/quality/extreme-scale-gates/check-feature-index.log deleted file mode 100644 index 27dc0c3a..00000000 --- a/artifacts/quality/extreme-scale-gates/check-feature-index.log +++ /dev/null @@ -1 +0,0 @@ -$ node scripts/generate-product-feature-index.ts --check diff --git a/artifacts/quality/extreme-scale-gates/check-observability.log b/artifacts/quality/extreme-scale-gates/check-observability.log deleted file mode 100644 index 02d9e4c9..00000000 --- a/artifacts/quality/extreme-scale-gates/check-observability.log +++ /dev/null @@ -1,23 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/platform/telemetry/telemetry-port.test.ts (3 tests) 8ms - ✓ tests/platform/telemetry/redact-telemetry.test.ts (14 tests) 17ms - ✓ tests/platform/telemetry/telemetry-buffer.test.ts (8 tests) 22ms - ✓ tests/platform/validation/validation-budget.test.ts (7 tests) 10ms - ✓ tests/platform/telemetry/telemetry-deduplicator.test.ts (8 tests) 13ms - ✓ tests/architecture/observability-boundaries.test.ts (4 tests) 142ms - ✓ tests/platform/errors/platform-errors.test.ts (16 tests) 23ms - ✓ tests/platform/telemetry/trace-context.test.ts (6 tests) 63ms - ✓ tests/platform/validation/bounded-json.test.ts (10 tests) 107ms - ✓ tests/platform/errors/app-error.test.ts (10 tests) 7ms - ✓ tests/platform/errors/failure-boundary.test.tsx (4 tests) 55ms - ✓ tests/platform/telemetry/telemetry-pipeline.test.ts (9 tests) 785ms - ✓ bounds network sends during a repeated error storm  718ms - - Test Files  12 passed (12) - Tests  99 passed (99) - Start at  13:29:27 - Duration  1.58s (transform 1.38s, setup 3.81s, import 1.84s, tests 1.25s, environment 902ms) - -$ node scripts/run-vitest.ts run tests/platform/errors tests/platform/validation tests/platform/telemetry tests/architecture/observability-boundaries.test.ts --reporter=default diff --git a/artifacts/quality/extreme-scale-gates/check-registries.log b/artifacts/quality/extreme-scale-gates/check-registries.log deleted file mode 100644 index 1abd421a..00000000 --- a/artifacts/quality/extreme-scale-gates/check-registries.log +++ /dev/null @@ -1,2 +0,0 @@ -Registry governance: 11 registries PASS; compatibility=breaking -$ node scripts/check-registries.ts diff --git a/artifacts/quality/extreme-scale-gates/check-release-coherence.log b/artifacts/quality/extreme-scale-gates/check-release-coherence.log deleted file mode 100644 index e981f0df..00000000 --- a/artifacts/quality/extreme-scale-gates/check-release-coherence.log +++ /dev/null @@ -1,16 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/platform/release/release-coherence.test.ts (10 tests) 9ms - ✓ tests/platform/release/release-mismatch-recovery.test.ts (10 tests) 14ms - ✓ tests/release/old-asset-reachability.test.ts (4 tests) 8ms - ✓ tests/platform/release/cache-policy.test.ts (5 tests) 39ms - ✓ tests/release/release-matrix.test.ts (7 tests) 48ms - ✓ tests/release/mixed-replica.test.ts (7 tests) 69ms - - Test Files  6 passed (6) - Tests  43 passed (43) - Start at  13:29:30 - Duration  914ms (transform 1.31s, setup 1.45s, import 2.18s, tests 187ms, environment 1ms) - -$ node scripts/run-vitest.ts run tests/platform/release tests/release --reporter=default diff --git a/artifacts/quality/extreme-scale-gates/check-request-fanout.log b/artifacts/quality/extreme-scale-gates/check-request-fanout.log deleted file mode 100644 index 03e090d1..00000000 --- a/artifacts/quality/extreme-scale-gates/check-request-fanout.log +++ /dev/null @@ -1,3 +0,0 @@ -request fan-out: 77 files scanned, 0 per-row dispatches PASS -request fan-out fixtures: forbidden 3 rejected in 3 files, allowed 0 violations PASS -$ node scripts/check-request-fanout.ts && node scripts/check-request-fanout.ts --fixture diff --git a/artifacts/quality/extreme-scale-gates/check-scale-baseline.log b/artifacts/quality/extreme-scale-gates/check-scale-baseline.log deleted file mode 100644 index b624defd..00000000 --- a/artifacts/quality/extreme-scale-gates/check-scale-baseline.log +++ /dev/null @@ -1,4 +0,0 @@ -compatibility: structural=true compiler=true timing=true -axes: absolute 28 (ok), growth 8 (ok), relative 16 compiler + 12 timing -scale baseline gate: PASSED (artifacts/scale/baseline-comparison.json) -$ node scripts/scale/check-scale-baseline.ts diff --git a/artifacts/quality/extreme-scale-gates/check-scale-main.log b/artifacts/quality/extreme-scale-gates/check-scale-main.log deleted file mode 100644 index c9cf9ea5..00000000 --- a/artifacts/quality/extreme-scale-gates/check-scale-main.log +++ /dev/null @@ -1,10 +0,0 @@ -PASSED main:architecture-topology (3173ms) -PASSED main:traffic-budgets (1489ms) -PASSED main:scale-units (2433ms) -PASSED main:composition-s0-s1 (91ms) -PASSED main:composition-s0-s2 (232ms) -PASSED main:composition-scale-suite (941ms) -PASSED main:typescript-diagnostics (1543ms) -PASSED main:baseline-regression (1739ms) -scale tier main: PASSED (artifacts/scale/main/summary.json) -$ node scripts/scale/run-scale-profile.ts main diff --git a/artifacts/quality/extreme-scale-gates/check-scale-nightly.log b/artifacts/quality/extreme-scale-gates/check-scale-nightly.log deleted file mode 100644 index 32a2a312..00000000 --- a/artifacts/quality/extreme-scale-gates/check-scale-nightly.log +++ /dev/null @@ -1,14 +0,0 @@ -PASSED nightly:architecture-topology (3175ms) -PASSED nightly:traffic-budgets (1393ms) -PASSED nightly:scale-units (2435ms) -PASSED nightly:composition-s0-s1 (90ms) -PASSED nightly:composition-s0-s2 (226ms) -PASSED nightly:composition-scale-suite (861ms) -PASSED nightly:typescript-diagnostics (1552ms) -PASSED nightly:baseline-regression (1750ms) -PASSED nightly:topology-s3-s4 (6995ms) -PASSED nightly:telemetry-storm (3703ms) -PASSED nightly:session-cycles (1703ms) -PASSED nightly:browser-soak (121407ms) -scale tier nightly: PASSED (artifacts/scale/nightly/summary.json) -$ node scripts/scale/run-scale-profile.ts nightly diff --git a/artifacts/quality/extreme-scale-gates/check-scale-pr.log b/artifacts/quality/extreme-scale-gates/check-scale-pr.log deleted file mode 100644 index e629a086..00000000 --- a/artifacts/quality/extreme-scale-gates/check-scale-pr.log +++ /dev/null @@ -1,6 +0,0 @@ -PASSED pr:architecture-topology (4307ms) -PASSED pr:traffic-budgets (1446ms) -PASSED pr:scale-units (2377ms) -PASSED pr:composition-s0-s1 (87ms) -scale tier pr: PASSED (artifacts/scale/pr/summary.json) -$ node scripts/scale/run-scale-profile.ts pr diff --git a/artifacts/quality/extreme-scale-gates/check-scale-release.log b/artifacts/quality/extreme-scale-gates/check-scale-release.log deleted file mode 100644 index d145f26f..00000000 --- a/artifacts/quality/extreme-scale-gates/check-scale-release.log +++ /dev/null @@ -1,13 +0,0 @@ -PASSED release:release-coherence (1123ms) -PASSED release:architecture-topology (3142ms) -PASSED release:traffic-budgets (1432ms) -PASSED release:scale-units (2318ms) -PASSED release:composition-s0-s1 (95ms) -PASSED release:composition-s0-s2 (235ms) -PASSED release:composition-scale-suite (843ms) -PASSED release:typescript-diagnostics (1499ms) -PASSED release:baseline-regression (1820ms) -PASSED release:topology-s3-s4 (7137ms) -PASSED release:telemetry-storm (3364ms) -scale tier release: PASSED (artifacts/scale/release/summary.json) -$ node scripts/scale/run-scale-profile.ts release diff --git a/artifacts/quality/extreme-scale-gates/check-topology.log b/artifacts/quality/extreme-scale-gates/check-topology.log deleted file mode 100644 index f971e428..00000000 --- a/artifacts/quality/extreme-scale-gates/check-topology.log +++ /dev/null @@ -1,19 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/platform/cardinality/cardinality-budget.test.ts (3 tests) 7ms - ✓ tests/platform/cardinality/compose-unique-record.test.ts (2 tests) 9ms - ✓ tests/architecture/context-lazy-loading.test.ts (1 test) 6ms - ✓ tests/platform/routing/context-route-module.test.ts (3 tests) 9ms - ✓ tests/architecture/topology-cardinality.test.ts (9 tests) 13ms - ✓ tests/platform/cardinality/extreme-scale-registry.test.ts (3 tests) 2363ms - ✓ keeps 10k -> 100k composition growth below a quadratic regression budget  391ms - ✓ keeps one million lookups bounded on a 100k-entry runtime registry  1515ms - ✓ selects and resolves 100k feature ids within the membership budget  455ms - - Test Files  6 passed (6) - Tests  21 passed (21) - Start at  13:29:21 - Duration  2.94s (transform 231ms, setup 1.63s, import 305ms, tests 2.41s, environment 1ms) - -$ node scripts/run-vitest.ts run tests/architecture/topology-cardinality.test.ts tests/architecture/context-lazy-loading.test.ts tests/platform/cardinality tests/platform/routing --reporter=default diff --git a/artifacts/quality/extreme-scale-gates/check-traffic.log b/artifacts/quality/extreme-scale-gates/check-traffic.log deleted file mode 100644 index dbc62acb..00000000 --- a/artifacts/quality/extreme-scale-gates/check-traffic.log +++ /dev/null @@ -1,21 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/platform/traffic/request-budget.test.ts (7 tests) 17ms - ✓ tests/platform/resilience/retry-budget.test.ts (6 tests) 7ms - ✓ tests/platform/resilience/deadline.test.ts (3 tests) 6ms - ✓ tests/platform/traffic/concurrency-budget.test.ts (6 tests) 11ms - ✓ tests/platform/execution/execution-context.test.ts (10 tests) 11ms - ✓ tests/platform/traffic/traffic-budget.test.ts (9 tests) 11ms - ✓ tests/platform/traffic/operation-traffic-policy.test.ts (7 tests) 10ms - ✓ tests/platform/traffic/request-fanout.test.ts (6 tests) 49ms - ✓ tests/platform/traffic/request-deduplication.test.ts (3 tests) 47ms - ✓ tests/platform/traffic/http-budget-integration.test.ts (9 tests) 130ms - ✓ tests/platform/traffic/traffic-amplification.test.ts (3 tests) 391ms - - Test Files  11 passed (11) - Tests  69 passed (69) - Start at  13:29:25 - Duration  1.34s (transform 858ms, setup 4.17s, import 1.44s, tests 690ms, environment 2ms) - -$ node scripts/run-vitest.ts run tests/platform/execution tests/platform/traffic tests/platform/resilience --reporter=default diff --git a/artifacts/quality/extreme-scale-gates/check-types-app.log b/artifacts/quality/extreme-scale-gates/check-types-app.log deleted file mode 100644 index 388c04b1..00000000 --- a/artifacts/quality/extreme-scale-gates/check-types-app.log +++ /dev/null @@ -1 +0,0 @@ -$ tsc --project tsconfig.app.json diff --git a/artifacts/quality/extreme-scale-gates/check-types-test.log b/artifacts/quality/extreme-scale-gates/check-types-test.log deleted file mode 100644 index 08d11af4..00000000 --- a/artifacts/quality/extreme-scale-gates/check-types-test.log +++ /dev/null @@ -1 +0,0 @@ -$ tsc --project tsconfig.test.json diff --git a/artifacts/quality/extreme-scale-gates/check-types.log b/artifacts/quality/extreme-scale-gates/check-types.log deleted file mode 100644 index 9a7a2716..00000000 --- a/artifacts/quality/extreme-scale-gates/check-types.log +++ /dev/null @@ -1,7 +0,0 @@ -$ corepack pnpm check:types:app && corepack pnpm check:types:node && corepack pnpm check:types:test && corepack pnpm check:types:recipes && corepack pnpm check:types:web-worker && corepack pnpm check:types:service-worker -$ tsc --project tsconfig.app.json -$ tsc --project tsconfig.node.json -$ tsc --project tsconfig.test.json -$ node scripts/check-optional-recipe-types.ts -$ tsc --project tsconfig.web-worker.json -$ tsc --project tsconfig.service-worker.json diff --git a/artifacts/quality/extreme-scale-gates/lint.log b/artifacts/quality/extreme-scale-gates/lint.log deleted file mode 100644 index 90a5c4cf..00000000 --- a/artifacts/quality/extreme-scale-gates/lint.log +++ /dev/null @@ -1 +0,0 @@ -$ eslint src scripts tests recipes .storybook vite.config.ts vitest.config.ts playwright*.config.ts --max-warnings=0 diff --git a/artifacts/quality/extreme-scale-gates/test-extreme-scale-focused.log b/artifacts/quality/extreme-scale-gates/test-extreme-scale-focused.log deleted file mode 100644 index 45372352..00000000 --- a/artifacts/quality/extreme-scale-gates/test-extreme-scale-focused.log +++ /dev/null @@ -1,23 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/scripts/generate-product-feature-index.test.ts (8 tests) 41ms - ✓ tests/platform/traffic/request-deduplication.test.ts (3 tests) 54ms - ✓ tests/platform/traffic/request-fanout.test.ts (6 tests) 56ms - ✓ tests/architecture/request-fanout.test.ts (4 tests) 194ms - ✓ tests/features/reference-feature/reference-request-deduplication.test.ts (3 tests) 50ms - ✓ tests/features/reference-feature/reference-request-fanout.test.ts (8 tests) 68ms - ✓ tests/architecture/app-build-input.test.ts (4 tests) 2380ms - ✓ accepts the production generator's output and an app-local bundle  771ms - ✓ rejects a generator regression that imports every discovered feature  673ms - ✓ rejects a production bundle that contains another app's feature  643ms - ✓ tests/scale/global-local-independence.test.ts (7 tests) 7755ms - ✓ keeps App A's generated indexes and reachable source graph identical from S0 to S2 on disk  5260ms - ✓ selects another app from the same repository without App A's features  982ms - - Test Files  8 passed (8) - Tests  43 passed (43) - Start at  13:29:12 - Duration  8.30s (transform 919ms, setup 1.94s, import 1.61s, tests 10.60s, environment 1ms) - -$ node scripts/run-vitest.ts run tests/scale/global-local-independence.test.ts tests/architecture/app-build-input.test.ts tests/architecture/request-fanout.test.ts tests/platform/traffic/request-fanout.test.ts tests/platform/traffic/request-deduplication.test.ts tests/features/reference-feature/reference-request-fanout.test.ts tests/features/reference-feature/reference-request-deduplication.test.ts tests/scripts/generate-product-feature-index.test.ts --reporter=default diff --git a/artifacts/quality/extreme-scale-gates/test-platform.log b/artifacts/quality/extreme-scale-gates/test-platform.log deleted file mode 100644 index d634a635..00000000 --- a/artifacts/quality/extreme-scale-gates/test-platform.log +++ /dev/null @@ -1,55 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/architecture/app-build-input.test.ts (4 tests) 9429ms - ✓ accepts the production generator's output and an app-local bundle  1340ms - ✓ rejects a generator regression that imports every discovered feature  5122ms - ✓ rejects a production bundle that contains another app's feature  2464ms - ✓ tests/platform/cardinality/extreme-scale-registry.test.ts (3 tests) 3975ms - ✓ keeps 10k -> 100k composition growth below a quadratic regression budget  634ms - ✓ keeps one million lookups bounded on a 100k-entry runtime registry  2331ms - ✓ selects and resolves 100k feature ids within the membership budget  1007ms - ✓ tests/platform/telemetry/telemetry-pipeline.test.ts (9 tests) 1077ms - ✓ bounds network sends during a repeated error storm  961ms - ✓ tests/platform/traffic/traffic-amplification.test.ts (3 tests) 558ms - ✓ keeps physical requests bounded when every dispatch fails  307ms - ✓ tests/architecture/request-fanout.test.ts (4 tests) 344ms - ✓ finds no per-row dispatch in feature code or application use cases  330ms - ✓ tests/architecture/observability-boundaries.test.ts (4 tests) 235ms - ✓ tests/platform/traffic/http-budget-integration.test.ts (9 tests) 133ms - ✓ tests/platform/validation/bounded-json.test.ts (10 tests) 140ms - ✓ tests/platform/telemetry/trace-context.test.ts (6 tests) 82ms - ✓ tests/platform/errors/failure-boundary.test.tsx (4 tests) 87ms - ✓ tests/platform/traffic/request-fanout.test.ts (6 tests) 75ms - ✓ tests/platform/traffic/request-deduplication.test.ts (3 tests) 74ms - ✓ tests/platform/release/cache-policy.test.ts (5 tests) 40ms - ✓ tests/platform/errors/platform-errors.test.ts (16 tests) 19ms - ✓ tests/platform/telemetry/telemetry-buffer.test.ts (8 tests) 20ms - ✓ tests/platform/telemetry/redact-telemetry.test.ts (14 tests) 14ms - ✓ tests/platform/traffic/request-budget.test.ts (7 tests) 7ms - ✓ tests/platform/release/release-mismatch-recovery.test.ts (10 tests) 12ms - ✓ tests/architecture/topology-cardinality.test.ts (9 tests) 10ms - ✓ tests/platform/telemetry/telemetry-deduplicator.test.ts (8 tests) 9ms - ✓ tests/platform/traffic/concurrency-budget.test.ts (6 tests) 11ms - ✓ tests/platform/execution/execution-context.test.ts (10 tests) 12ms - ✓ tests/platform/traffic/traffic-budget.test.ts (9 tests) 8ms - ✓ tests/platform/validation/validation-budget.test.ts (7 tests) 11ms - ✓ tests/platform/traffic/operation-traffic-policy.test.ts (7 tests) 11ms - ✓ tests/platform/routing/context-route-module.test.ts (3 tests) 10ms - ✓ tests/platform/release/release-coherence.test.ts (10 tests) 13ms - ✓ tests/platform/cardinality/compose-unique-record.test.ts (2 tests) 5ms - ✓ tests/platform/telemetry/telemetry-port.test.ts (3 tests) 6ms - ✓ tests/platform/resilience/retry-budget.test.ts (6 tests) 5ms - ✓ tests/platform/errors/app-error.test.ts (10 tests) 6ms - ✓ tests/platform/cardinality/cardinality-budget.test.ts (3 tests) 7ms - ✓ tests/architecture/context-lazy-loading.test.ts (1 test) 6ms - ✓ tests/platform/resilience/deadline.test.ts (3 tests) 7ms - ✓ tests/architecture/module-hierarchy.test.ts (1 test) 6ms - - Test Files  35 passed (35) - Tests  223 passed (223) - Start at  13:29:32 - Duration  33.44s (transform 977ms, setup 7.36s, import 2.52s, tests 16.46s, environment 1.01s) - -JUNIT report written to /shared/codebase/clean-architecture-frontend-template/artifacts/tests/platform.xml -$ node scripts/run-vitest.ts run tests/platform tests/architecture --no-file-parallelism --reporter=default --reporter=junit --outputFile.junit=artifacts/tests/platform.xml diff --git a/artifacts/quality/extreme-scale-gates/test-reference-feature.log b/artifacts/quality/extreme-scale-gates/test-reference-feature.log deleted file mode 100644 index 84e4fd89..00000000 --- a/artifacts/quality/extreme-scale-gates/test-reference-feature.log +++ /dev/null @@ -1,30 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/features/reference-feature/reference-error.test.ts (3 tests) 102ms - ✓ tests/features/reference-feature/reference-telemetry.test.ts (4 tests) 55ms - ✓ tests/features/reference-feature/reference-http-problem-mapping.test.ts (6 tests) 12ms - ✓ tests/features/reference-feature/reference-request-deduplication.test.ts (3 tests) 112ms - ✓ tests/features/reference-feature/reference-request-fanout.test.ts (8 tests) 189ms - ✓ tests/features/reference-feature/reference-traffic-policy.test.ts (1 test) 9ms - ✓ tests/features/reference-feature/installed-context-routing.test.ts (2 tests) 108ms - ✓ tests/features/reference-feature/reference-contract.test.ts (7 tests) 35ms - ✓ tests/features/reference-feature/feature-module.test.ts (1 test) 6ms - ✓ tests/features/reference-feature/reference-http-gateway.test.ts (2 tests) 8ms - ✓ tests/features/reference-feature/reference-installed-executor.test.ts (1 test) 7ms - ✓ tests/features/reference-feature/reference-diagnostics.test.ts (1 test) 81ms - ✓ tests/features/reference-feature/reference-runtime-composition.test.ts (3 tests) 201ms - ✓ tests/features/reference-feature/reference-production-vertical.test.tsx (1 test) 1243ms - ✓ traverses bootstrap, router, application, HTTP schema/mapper and query cache  1237ms - ✓ tests/features/reference-feature/reference-page.test.tsx (11 tests) 3248ms - ✓ mounts list and detail keys under the installed governed namespace  1035ms - ✓ renders backend forbidden even when the client access hint allowed entry  423ms - ✓ deduplicates create, preserves input and surfaces a conflict  584ms - - Test Files  15 passed (15) - Tests  54 passed (54) - Start at  13:30:06 - Duration  7.80s (transform 13.26s, setup 7.90s, import 20.03s, tests 5.42s, environment 2.84s) - -JUNIT report written to /shared/codebase/clean-architecture-frontend-template/artifacts/tests/reference-feature.xml -$ node scripts/run-vitest.ts run tests/features/reference-feature --reporter=default --reporter=junit --outputFile.junit=artifacts/tests/reference-feature.xml --passWithNoTests diff --git a/artifacts/scale/main/architecture-topology.log b/artifacts/scale/main/architecture-topology.log deleted file mode 100644 index 26511617..00000000 --- a/artifacts/scale/main/architecture-topology.log +++ /dev/null @@ -1,25 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/platform/cardinality/cardinality-budget.test.ts (3 tests) 6ms - ✓ tests/platform/cardinality/compose-unique-record.test.ts (2 tests) 7ms - ✓ tests/architecture/module-hierarchy.test.ts (1 test) 5ms - ✓ tests/architecture/context-lazy-loading.test.ts (1 test) 6ms - ✓ tests/platform/routing/context-route-module.test.ts (3 tests) 10ms - ✓ tests/architecture/topology-cardinality.test.ts (9 tests) 11ms - ✓ tests/architecture/observability-boundaries.test.ts (4 tests) 97ms - ✓ tests/architecture/request-fanout.test.ts (4 tests) 206ms - ✓ tests/platform/cardinality/extreme-scale-registry.test.ts (3 tests) 2005ms - ✓ keeps 10k -> 100k composition growth below a quadratic regression budget  407ms - ✓ keeps one million lookups bounded on a 100k-entry runtime registry  1229ms - ✓ selects and resolves 100k feature ids within the membership budget  366ms - ✓ tests/architecture/app-build-input.test.ts (4 tests) 2215ms - ✓ accepts the production generator's output and an app-local bundle  714ms - ✓ rejects a generator regression that imports every discovered feature  626ms - ✓ rejects a production bundle that contains another app's feature  613ms - - Test Files  10 passed (10) - Tests  34 passed (34) - Start at  13:30:24 - Duration  2.82s (transform 645ms, setup 2.94s, import 949ms, tests 4.57s, environment 2ms) - diff --git a/artifacts/scale/main/baseline-regression.log b/artifacts/scale/main/baseline-regression.log deleted file mode 100644 index 041945a2..00000000 --- a/artifacts/scale/main/baseline-regression.log +++ /dev/null @@ -1,3 +0,0 @@ -compatibility: structural=true compiler=true timing=true -axes: absolute 28 (ok), growth 8 (ok), relative 16 compiler + 12 timing -scale baseline gate: PASSED (artifacts/scale/main/baseline-regression.json) diff --git a/artifacts/scale/main/composition-s0-s1.log b/artifacts/scale/main/composition-s0-s1.log deleted file mode 100644 index 8b47e2ad..00000000 --- a/artifacts/scale/main/composition-s0-s1.log +++ /dev/null @@ -1,5 +0,0 @@ -PASS registry-composition:growth (exponents 0.00) -PASS product-feature-selection:growth (exponents 0.00) -PASS product-feature-resolution:growth (exponents 0.00) -PASS context-hierarchy-composition:growth (exponents 0.00) -composition scale artifact: /shared/codebase/clean-architecture-frontend-template/artifacts/scale/main/composition-s0-s1.json diff --git a/artifacts/scale/main/composition-s0-s2.log b/artifacts/scale/main/composition-s0-s2.log deleted file mode 100644 index 5a79c68b..00000000 --- a/artifacts/scale/main/composition-s0-s2.log +++ /dev/null @@ -1,5 +0,0 @@ -PASS registry-composition:growth (exponents 0.00, 0.64) -PASS product-feature-selection:growth (exponents 0.00, 0.83) -PASS product-feature-resolution:growth (exponents 0.00, 0.83) -PASS context-hierarchy-composition:growth (exponents 0.00, 0.34) -composition scale artifact: /shared/codebase/clean-architecture-frontend-template/artifacts/scale/main/composition-s0-s2.json diff --git a/artifacts/scale/main/composition-scale-suite.log b/artifacts/scale/main/composition-scale-suite.log deleted file mode 100644 index 9ce1a4eb..00000000 --- a/artifacts/scale/main/composition-scale-suite.log +++ /dev/null @@ -1,11 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/scale/tsc-diagnostics-parser.test.ts (3 tests) 7ms - ✓ tests/scale/composition-scale.test.ts (6 tests) 232ms - - Test Files  2 passed (2) - Tests  9 passed (9) - Start at  13:30:31 - Duration  596ms (transform 94ms, setup 326ms, import 114ms, tests 239ms, environment 0ms) - diff --git a/artifacts/scale/main/scale-units.log b/artifacts/scale/main/scale-units.log deleted file mode 100644 index 52c54bf4..00000000 --- a/artifacts/scale/main/scale-units.log +++ /dev/null @@ -1,17 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/scale/growth-regression.test.ts (7 tests) 6ms - ✓ tests/scale/traffic/retry-after-jitter.test.ts (5 tests) 38ms - ✓ tests/scale/traffic/amplification-metrics.test.ts (6 tests) 5ms - ✓ tests/scale/benchmark.test.ts (4 tests) 8ms - ✓ tests/scale/synthetic-topology.test.ts (8 tests) 8ms - ✓ tests/scale/scale-baseline.test.ts (11 tests) 11ms - ✓ tests/scale/traffic/failure-scenarios.test.ts (5 tests) 1420ms - ✓ bounds physical requests when all upstream calls fail  896ms - - Test Files  7 passed (7) - Tests  46 passed (46) - Start at  13:30:29 - Duration  2.04s (transform 695ms, setup 1.76s, import 808ms, tests 1.50s, environment 1ms) - diff --git a/artifacts/scale/main/traffic-budgets.log b/artifacts/scale/main/traffic-budgets.log deleted file mode 100644 index b49a8ea7..00000000 --- a/artifacts/scale/main/traffic-budgets.log +++ /dev/null @@ -1,20 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/platform/resilience/deadline.test.ts (3 tests) 4ms - ✓ tests/platform/traffic/request-budget.test.ts (7 tests) 5ms - ✓ tests/platform/resilience/retry-budget.test.ts (6 tests) 7ms - ✓ tests/platform/traffic/concurrency-budget.test.ts (6 tests) 11ms - ✓ tests/platform/traffic/traffic-budget.test.ts (9 tests) 10ms - ✓ tests/platform/execution/execution-context.test.ts (10 tests) 9ms - ✓ tests/platform/traffic/operation-traffic-policy.test.ts (7 tests) 9ms - ✓ tests/platform/traffic/request-fanout.test.ts (6 tests) 59ms - ✓ tests/platform/traffic/request-deduplication.test.ts (3 tests) 47ms - ✓ tests/platform/traffic/http-budget-integration.test.ts (9 tests) 124ms - ✓ tests/platform/traffic/traffic-amplification.test.ts (3 tests) 379ms - - Test Files  11 passed (11) - Tests  69 passed (69) - Start at  13:30:27 - Duration  1.13s (transform 1.01s, setup 3.62s, import 1.55s, tests 663ms, environment 2ms) - diff --git a/artifacts/scale/main/typescript-diagnostics.log b/artifacts/scale/main/typescript-diagnostics.log deleted file mode 100644 index f0982fbb..00000000 --- a/artifacts/scale/main/typescript-diagnostics.log +++ /dev/null @@ -1,5 +0,0 @@ -tsc app: files=827 types=279186 instantiations=700415 -PASS tsc:types (exponents 0.84, 0.96) -PASS tsc:symbols (exponents 0.51, 0.80) -PASS tsc:instantiations (exponents 0.97, 0.99) -tsc diagnostics artifact: /shared/codebase/clean-architecture-frontend-template/artifacts/scale/main/typescript-diagnostics.json diff --git a/artifacts/scale/nightly/architecture-topology.log b/artifacts/scale/nightly/architecture-topology.log deleted file mode 100644 index 9debb7bf..00000000 --- a/artifacts/scale/nightly/architecture-topology.log +++ /dev/null @@ -1,25 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/platform/cardinality/compose-unique-record.test.ts (2 tests) 5ms - ✓ tests/platform/cardinality/cardinality-budget.test.ts (3 tests) 5ms - ✓ tests/architecture/module-hierarchy.test.ts (1 test) 6ms - ✓ tests/architecture/context-lazy-loading.test.ts (1 test) 7ms - ✓ tests/platform/routing/context-route-module.test.ts (3 tests) 8ms - ✓ tests/architecture/topology-cardinality.test.ts (9 tests) 13ms - ✓ tests/architecture/observability-boundaries.test.ts (4 tests) 109ms - ✓ tests/architecture/request-fanout.test.ts (4 tests) 151ms - ✓ tests/platform/cardinality/extreme-scale-registry.test.ts (3 tests) 1946ms - ✓ keeps 10k -> 100k composition growth below a quadratic regression budget  378ms - ✓ keeps one million lookups bounded on a 100k-entry runtime registry  1201ms - ✓ selects and resolves 100k feature ids within the membership budget  365ms - ✓ tests/architecture/app-build-input.test.ts (4 tests) 2219ms - ✓ accepts the production generator's output and an app-local bundle  671ms - ✓ rejects a generator regression that imports every discovered feature  648ms - ✓ rejects a production bundle that contains another app's feature  649ms - - Test Files  10 passed (10) - Tests  34 passed (34) - Start at  13:30:41 - Duration  2.82s (transform 580ms, setup 3.20s, import 787ms, tests 4.47s, environment 2ms) - diff --git a/artifacts/scale/nightly/baseline-regression.log b/artifacts/scale/nightly/baseline-regression.log deleted file mode 100644 index 47c89185..00000000 --- a/artifacts/scale/nightly/baseline-regression.log +++ /dev/null @@ -1,3 +0,0 @@ -compatibility: structural=true compiler=true timing=true -axes: absolute 28 (ok), growth 8 (ok), relative 16 compiler + 12 timing -scale baseline gate: PASSED (artifacts/scale/nightly/baseline-regression.json) diff --git a/artifacts/scale/nightly/browser-soak.log b/artifacts/scale/nightly/browser-soak.log deleted file mode 100644 index 7751993d..00000000 --- a/artifacts/scale/nightly/browser-soak.log +++ /dev/null @@ -1,12 +0,0 @@ -browser soak: passed classification=stable samples=24 cycles=2012 -PASS cycles (2012 >= 200) -PASS post-warmup samples (18 >= 3) -PASS navigation (0 failures) -PASS heap slope (stable) -PASS listeners (stable, delta 2) -PASS timers (delta 0, max 2) -PASS in-flight settles (final 0, max 0) -PASS storage growth (keys 0, bytes 0) -PASS backend failure exercised (68 settled visits, 479 API requests, 24 telemetry events) -PASS request amplification (479 requests / 336 visits) -PASS telemetry rate (max 14/min, 24 posts, 24 events) diff --git a/artifacts/scale/nightly/composition-s0-s1.log b/artifacts/scale/nightly/composition-s0-s1.log deleted file mode 100644 index f6854892..00000000 --- a/artifacts/scale/nightly/composition-s0-s1.log +++ /dev/null @@ -1,5 +0,0 @@ -PASS registry-composition:growth (exponents 0.00) -PASS product-feature-selection:growth (exponents 0.00) -PASS product-feature-resolution:growth (exponents 0.00) -PASS context-hierarchy-composition:growth (exponents 0.00) -composition scale artifact: /shared/codebase/clean-architecture-frontend-template/artifacts/scale/nightly/composition-s0-s1.json diff --git a/artifacts/scale/nightly/composition-s0-s2.log b/artifacts/scale/nightly/composition-s0-s2.log deleted file mode 100644 index cf0e827b..00000000 --- a/artifacts/scale/nightly/composition-s0-s2.log +++ /dev/null @@ -1,5 +0,0 @@ -PASS registry-composition:growth (exponents 0.00, 0.64) -PASS product-feature-selection:growth (exponents 0.00, 0.85) -PASS product-feature-resolution:growth (exponents 0.00, 0.83) -PASS context-hierarchy-composition:growth (exponents 0.00, 0.34) -composition scale artifact: /shared/codebase/clean-architecture-frontend-template/artifacts/scale/nightly/composition-s0-s2.json diff --git a/artifacts/scale/nightly/composition-scale-suite.log b/artifacts/scale/nightly/composition-scale-suite.log deleted file mode 100644 index 055c5b6a..00000000 --- a/artifacts/scale/nightly/composition-scale-suite.log +++ /dev/null @@ -1,11 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/scale/tsc-diagnostics-parser.test.ts (3 tests) 6ms - ✓ tests/scale/composition-scale.test.ts (6 tests) 191ms - - Test Files  2 passed (2) - Tests  9 passed (9) - Start at  13:30:48 - Duration  514ms (transform 78ms, setup 296ms, import 81ms, tests 197ms, environment 0ms) - diff --git a/artifacts/scale/nightly/scale-units.log b/artifacts/scale/nightly/scale-units.log deleted file mode 100644 index acaba57c..00000000 --- a/artifacts/scale/nightly/scale-units.log +++ /dev/null @@ -1,17 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/scale/traffic/retry-after-jitter.test.ts (5 tests) 34ms - ✓ tests/scale/traffic/amplification-metrics.test.ts (6 tests) 6ms - ✓ tests/scale/benchmark.test.ts (4 tests) 8ms - ✓ tests/scale/growth-regression.test.ts (7 tests) 6ms - ✓ tests/scale/synthetic-topology.test.ts (8 tests) 8ms - ✓ tests/scale/scale-baseline.test.ts (11 tests) 14ms - ✓ tests/scale/traffic/failure-scenarios.test.ts (5 tests) 1453ms - ✓ bounds physical requests when all upstream calls fail  896ms - - Test Files  7 passed (7) - Tests  46 passed (46) - Start at  13:30:45 - Duration  2.07s (transform 436ms, setup 1.74s, import 563ms, tests 1.53s, environment 1ms) - diff --git a/artifacts/scale/nightly/session-cycles.log b/artifacts/scale/nightly/session-cycles.log deleted file mode 100644 index 978ef846..00000000 --- a/artifacts/scale/nightly/session-cycles.log +++ /dev/null @@ -1,12 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/scale/session/network-flap.test.ts (2 tests) 324ms - ✓ tests/scale/session/long-session.test.ts (1 test) 921ms - ✓ returns timers, listeners, leases, buffers and cache entries to a stable bound  919ms - - Test Files  2 passed (2) - Tests  3 passed (3) - Start at  13:31:03 - Duration  1.37s (transform 228ms, setup 296ms, import 363ms, tests 1.24s, environment 0ms) - diff --git a/artifacts/scale/nightly/telemetry-storm.log b/artifacts/scale/nightly/telemetry-storm.log deleted file mode 100644 index 0823d58b..00000000 --- a/artifacts/scale/nightly/telemetry-storm.log +++ /dev/null @@ -1,19 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/platform/telemetry/telemetry-port.test.ts (3 tests) 6ms - ✓ tests/platform/telemetry/telemetry-deduplicator.test.ts (8 tests) 11ms - ✓ tests/platform/telemetry/telemetry-buffer.test.ts (8 tests) 15ms - ✓ tests/platform/telemetry/redact-telemetry.test.ts (14 tests) 11ms - ✓ tests/platform/telemetry/trace-context.test.ts (6 tests) 43ms - ✓ tests/platform/telemetry/telemetry-pipeline.test.ts (9 tests) 669ms - ✓ bounds network sends during a repeated error storm  609ms - ✓ tests/scale/telemetry/telemetry-storm.test.ts (4 tests) 2882ms - ✓ does not turn 100000 identical failures into 100000 sends  748ms - ✓ bounds sends and buffer when a storm has many distinct fingerprints  2099ms - - Test Files  7 passed (7) - Tests  52 passed (52) - Start at  13:30:59 - Duration  3.35s (transform 427ms, setup 1.75s, import 534ms, tests 3.64s, environment 1ms) - diff --git a/artifacts/scale/nightly/topology-s3-s4.log b/artifacts/scale/nightly/topology-s3-s4.log deleted file mode 100644 index d035d0dc..00000000 --- a/artifacts/scale/nightly/topology-s3-s4.log +++ /dev/null @@ -1,16 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/platform/cardinality/extreme-scale-registry.test.ts (3 tests) 1822ms - ✓ keeps 10k -> 100k composition growth below a quadratic regression budget  313ms - ✓ keeps one million lookups bounded on a 100k-entry runtime registry  1163ms - ✓ selects and resolves 100k feature ids within the membership budget  345ms - ✓ tests/scale/global-local-independence.test.ts (7 tests) 6311ms - ✓ keeps App A's generated indexes and reachable source graph identical from S0 to S2 on disk  4764ms - ✓ selects another app from the same repository without App A's features  583ms - - Test Files  2 passed (2) - Tests  10 passed (10) - Start at  13:30:52 - Duration  6.64s (transform 87ms, setup 327ms, import 80ms, tests 8.13s, environment 0ms) - diff --git a/artifacts/scale/nightly/traffic-budgets.log b/artifacts/scale/nightly/traffic-budgets.log deleted file mode 100644 index 7d62db26..00000000 --- a/artifacts/scale/nightly/traffic-budgets.log +++ /dev/null @@ -1,20 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/platform/traffic/concurrency-budget.test.ts (6 tests) 9ms - ✓ tests/platform/resilience/deadline.test.ts (3 tests) 4ms - ✓ tests/platform/traffic/request-budget.test.ts (7 tests) 7ms - ✓ tests/platform/resilience/retry-budget.test.ts (6 tests) 5ms - ✓ tests/platform/traffic/traffic-budget.test.ts (9 tests) 8ms - ✓ tests/platform/execution/execution-context.test.ts (10 tests) 10ms - ✓ tests/platform/traffic/operation-traffic-policy.test.ts (7 tests) 9ms - ✓ tests/platform/traffic/request-fanout.test.ts (6 tests) 41ms - ✓ tests/platform/traffic/request-deduplication.test.ts (3 tests) 40ms - ✓ tests/platform/traffic/http-budget-integration.test.ts (9 tests) 121ms - ✓ tests/platform/traffic/traffic-amplification.test.ts (3 tests) 316ms - - Test Files  11 passed (11) - Tests  69 passed (69) - Start at  13:30:44 - Duration  1.04s (transform 890ms, setup 3.40s, import 1.40s, tests 570ms, environment 2ms) - diff --git a/artifacts/scale/nightly/typescript-diagnostics.log b/artifacts/scale/nightly/typescript-diagnostics.log deleted file mode 100644 index a9f17c57..00000000 --- a/artifacts/scale/nightly/typescript-diagnostics.log +++ /dev/null @@ -1,5 +0,0 @@ -tsc app: files=827 types=279186 instantiations=700415 -PASS tsc:types (exponents 0.84, 0.96) -PASS tsc:symbols (exponents 0.51, 0.80) -PASS tsc:instantiations (exponents 0.97, 0.99) -tsc diagnostics artifact: /shared/codebase/clean-architecture-frontend-template/artifacts/scale/nightly/typescript-diagnostics.json diff --git a/artifacts/scale/pr/architecture-topology.log b/artifacts/scale/pr/architecture-topology.log deleted file mode 100644 index 7bb024ec..00000000 --- a/artifacts/scale/pr/architecture-topology.log +++ /dev/null @@ -1,25 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/architecture/module-hierarchy.test.ts (1 test) 14ms - ✓ tests/architecture/topology-cardinality.test.ts (9 tests) 37ms - ✓ tests/architecture/observability-boundaries.test.ts (4 tests) 210ms - ✓ tests/architecture/context-lazy-loading.test.ts (1 test) 18ms - ✓ tests/platform/cardinality/cardinality-budget.test.ts (3 tests) 22ms - ✓ tests/platform/cardinality/compose-unique-record.test.ts (2 tests) 12ms - ✓ tests/platform/routing/context-route-module.test.ts (3 tests) 11ms - ✓ tests/architecture/request-fanout.test.ts (4 tests) 234ms - ✓ tests/platform/cardinality/extreme-scale-registry.test.ts (3 tests) 2791ms - ✓ keeps 10k -> 100k composition growth below a quadratic regression budget  721ms - ✓ keeps one million lookups bounded on a 100k-entry runtime registry  1649ms - ✓ selects and resolves 100k feature ids within the membership budget  420ms - ✓ tests/architecture/app-build-input.test.ts (4 tests) 2872ms - ✓ accepts the production generator's output and an app-local bundle  996ms - ✓ rejects a generator regression that imports every discovered feature  897ms - ✓ rejects a production bundle that contains another app's feature  723ms - - Test Files  10 passed (10) - Tests  34 passed (34) - Start at  13:30:15 - Duration  3.81s (transform 625ms, setup 4.78s, import 1.11s, tests 6.22s, environment 2ms) - diff --git a/artifacts/scale/pr/composition-s0-s1.log b/artifacts/scale/pr/composition-s0-s1.log deleted file mode 100644 index bd2058b4..00000000 --- a/artifacts/scale/pr/composition-s0-s1.log +++ /dev/null @@ -1,5 +0,0 @@ -PASS registry-composition:growth (exponents 0.00) -PASS product-feature-selection:growth (exponents 0.00) -PASS product-feature-resolution:growth (exponents 0.00) -PASS context-hierarchy-composition:growth (exponents 0.00) -composition scale artifact: /shared/codebase/clean-architecture-frontend-template/artifacts/scale/pr/composition-s0-s1.json diff --git a/artifacts/scale/pr/scale-units.log b/artifacts/scale/pr/scale-units.log deleted file mode 100644 index 7d2a53fa..00000000 --- a/artifacts/scale/pr/scale-units.log +++ /dev/null @@ -1,17 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/scale/traffic/amplification-metrics.test.ts (6 tests) 5ms - ✓ tests/scale/growth-regression.test.ts (7 tests) 6ms - ✓ tests/scale/traffic/retry-after-jitter.test.ts (5 tests) 38ms - ✓ tests/scale/benchmark.test.ts (4 tests) 7ms - ✓ tests/scale/synthetic-topology.test.ts (8 tests) 10ms - ✓ tests/scale/scale-baseline.test.ts (11 tests) 11ms - ✓ tests/scale/traffic/failure-scenarios.test.ts (5 tests) 1429ms - ✓ bounds physical requests when all upstream calls fail  919ms - - Test Files  7 passed (7) - Tests  46 passed (46) - Start at  13:30:21 - Duration  2.02s (transform 485ms, setup 1.52s, import 646ms, tests 1.51s, environment 1ms) - diff --git a/artifacts/scale/pr/traffic-budgets.log b/artifacts/scale/pr/traffic-budgets.log deleted file mode 100644 index 2026fd77..00000000 --- a/artifacts/scale/pr/traffic-budgets.log +++ /dev/null @@ -1,20 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/platform/traffic/request-budget.test.ts (7 tests) 5ms - ✓ tests/platform/resilience/deadline.test.ts (3 tests) 5ms - ✓ tests/platform/traffic/concurrency-budget.test.ts (6 tests) 10ms - ✓ tests/platform/resilience/retry-budget.test.ts (6 tests) 5ms - ✓ tests/platform/execution/execution-context.test.ts (10 tests) 9ms - ✓ tests/platform/traffic/traffic-budget.test.ts (9 tests) 10ms - ✓ tests/platform/traffic/operation-traffic-policy.test.ts (7 tests) 7ms - ✓ tests/platform/traffic/request-fanout.test.ts (6 tests) 44ms - ✓ tests/platform/traffic/request-deduplication.test.ts (3 tests) 40ms - ✓ tests/platform/traffic/http-budget-integration.test.ts (9 tests) 127ms - ✓ tests/platform/traffic/traffic-amplification.test.ts (3 tests) 328ms - - Test Files  11 passed (11) - Tests  69 passed (69) - Start at  13:30:20 - Duration  1.09s (transform 1.03s, setup 3.64s, import 1.52s, tests 590ms, environment 2ms) - diff --git a/artifacts/scale/release/architecture-topology.log b/artifacts/scale/release/architecture-topology.log deleted file mode 100644 index 30f4f1ab..00000000 --- a/artifacts/scale/release/architecture-topology.log +++ /dev/null @@ -1,25 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/platform/cardinality/compose-unique-record.test.ts (2 tests) 7ms - ✓ tests/architecture/context-lazy-loading.test.ts (1 test) 7ms - ✓ tests/platform/routing/context-route-module.test.ts (3 tests) 9ms - ✓ tests/platform/cardinality/cardinality-budget.test.ts (3 tests) 6ms - ✓ tests/architecture/module-hierarchy.test.ts (1 test) 6ms - ✓ tests/architecture/topology-cardinality.test.ts (9 tests) 12ms - ✓ tests/architecture/observability-boundaries.test.ts (4 tests) 101ms - ✓ tests/architecture/request-fanout.test.ts (4 tests) 155ms - ✓ tests/platform/cardinality/extreme-scale-registry.test.ts (3 tests) 1941ms - ✓ keeps 10k -> 100k composition growth below a quadratic regression budget  383ms - ✓ keeps one million lookups bounded on a 100k-entry runtime registry  1177ms - ✓ selects and resolves 100k feature ids within the membership budget  379ms - ✓ tests/architecture/app-build-input.test.ts (4 tests) 2191ms - ✓ accepts the production generator's output and an app-local bundle  659ms - ✓ rejects a generator regression that imports every discovered feature  635ms - ✓ rejects a production bundle that contains another app's feature  660ms - - Test Files  10 passed (10) - Tests  34 passed (34) - Start at  13:33:08 - Duration  2.80s (transform 512ms, setup 3.13s, import 681ms, tests 4.43s, environment 2ms) - diff --git a/artifacts/scale/release/baseline-regression.log b/artifacts/scale/release/baseline-regression.log deleted file mode 100644 index 2de93de9..00000000 --- a/artifacts/scale/release/baseline-regression.log +++ /dev/null @@ -1,3 +0,0 @@ -compatibility: structural=true compiler=true timing=true -axes: absolute 28 (ok), growth 8 (ok), relative 16 compiler + 12 timing -scale baseline gate: PASSED (artifacts/scale/release/baseline-regression.json) diff --git a/artifacts/scale/release/composition-s0-s1.log b/artifacts/scale/release/composition-s0-s1.log deleted file mode 100644 index edb0d391..00000000 --- a/artifacts/scale/release/composition-s0-s1.log +++ /dev/null @@ -1,5 +0,0 @@ -PASS registry-composition:growth (exponents 0.00) -PASS product-feature-selection:growth (exponents 0.00) -PASS product-feature-resolution:growth (exponents 0.00) -PASS context-hierarchy-composition:growth (exponents 0.00) -composition scale artifact: /shared/codebase/clean-architecture-frontend-template/artifacts/scale/release/composition-s0-s1.json diff --git a/artifacts/scale/release/composition-s0-s2.log b/artifacts/scale/release/composition-s0-s2.log deleted file mode 100644 index c3156c6c..00000000 --- a/artifacts/scale/release/composition-s0-s2.log +++ /dev/null @@ -1,5 +0,0 @@ -PASS registry-composition:growth (exponents 0.00, 0.65) -PASS product-feature-selection:growth (exponents 0.00, 0.90) -PASS product-feature-resolution:growth (exponents 0.00, 0.85) -PASS context-hierarchy-composition:growth (exponents 0.00, 0.44) -composition scale artifact: /shared/codebase/clean-architecture-frontend-template/artifacts/scale/release/composition-s0-s2.json diff --git a/artifacts/scale/release/composition-scale-suite.log b/artifacts/scale/release/composition-scale-suite.log deleted file mode 100644 index d366d63e..00000000 --- a/artifacts/scale/release/composition-scale-suite.log +++ /dev/null @@ -1,11 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/scale/tsc-diagnostics-parser.test.ts (3 tests) 7ms - ✓ tests/scale/composition-scale.test.ts (6 tests) 186ms - - Test Files  2 passed (2) - Tests  9 passed (9) - Start at  13:33:15 - Duration  494ms (transform 86ms, setup 297ms, import 80ms, tests 193ms, environment 0ms) - diff --git a/artifacts/scale/release/release-coherence.log b/artifacts/scale/release/release-coherence.log deleted file mode 100644 index f348e9a1..00000000 --- a/artifacts/scale/release/release-coherence.log +++ /dev/null @@ -1,15 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/platform/release/release-coherence.test.ts (10 tests) 8ms - ✓ tests/platform/release/release-mismatch-recovery.test.ts (10 tests) 14ms - ✓ tests/release/old-asset-reachability.test.ts (4 tests) 7ms - ✓ tests/platform/release/cache-policy.test.ts (5 tests) 29ms - ✓ tests/release/release-matrix.test.ts (7 tests) 39ms - ✓ tests/release/mixed-replica.test.ts (7 tests) 67ms - - Test Files  6 passed (6) - Tests  43 passed (43) - Start at  13:33:06 - Duration  780ms (transform 1.11s, setup 1.22s, import 1.79s, tests 163ms, environment 1ms) - diff --git a/artifacts/scale/release/scale-units.log b/artifacts/scale/release/scale-units.log deleted file mode 100644 index 12c471b0..00000000 --- a/artifacts/scale/release/scale-units.log +++ /dev/null @@ -1,17 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/scale/traffic/amplification-metrics.test.ts (6 tests) 6ms - ✓ tests/scale/growth-regression.test.ts (7 tests) 9ms - ✓ tests/scale/traffic/retry-after-jitter.test.ts (5 tests) 27ms - ✓ tests/scale/benchmark.test.ts (4 tests) 11ms - ✓ tests/scale/synthetic-topology.test.ts (8 tests) 13ms - ✓ tests/scale/scale-baseline.test.ts (11 tests) 11ms - ✓ tests/scale/traffic/failure-scenarios.test.ts (5 tests) 1362ms - ✓ bounds physical requests when all upstream calls fail  874ms - - Test Files  7 passed (7) - Tests  46 passed (46) - Start at  13:33:12 - Duration  1.96s (transform 513ms, setup 1.59s, import 672ms, tests 1.44s, environment 1ms) - diff --git a/artifacts/scale/release/telemetry-storm.log b/artifacts/scale/release/telemetry-storm.log deleted file mode 100644 index 89083c98..00000000 --- a/artifacts/scale/release/telemetry-storm.log +++ /dev/null @@ -1,12 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/scale/telemetry/telemetry-storm.test.ts (4 tests) 2705ms - ✓ does not turn 100000 identical failures into 100000 sends  672ms - ✓ bounds sends and buffer when a storm has many distinct fingerprints  1998ms - - Test Files  1 passed (1) - Tests  4 passed (4) - Start at  13:33:26 - Duration  3.01s (transform 58ms, setup 146ms, import 52ms, tests 2.71s, environment 0ms) - diff --git a/artifacts/scale/release/topology-s3-s4.log b/artifacts/scale/release/topology-s3-s4.log deleted file mode 100644 index 2ada7f2a..00000000 --- a/artifacts/scale/release/topology-s3-s4.log +++ /dev/null @@ -1,12 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/scale/global-local-independence.test.ts (7 tests) 6484ms - ✓ keeps App A's generated indexes and reachable source graph identical from S0 to S2 on disk  4707ms - ✓ selects another app from the same repository without App A's features  646ms - - Test Files  1 passed (1) - Tests  7 passed (7) - Start at  13:33:19 - Duration  6.79s (transform 53ms, setup 145ms, import 49ms, tests 6.48s, environment 0ms) - diff --git a/artifacts/scale/release/traffic-budgets.log b/artifacts/scale/release/traffic-budgets.log deleted file mode 100644 index 31abbdee..00000000 --- a/artifacts/scale/release/traffic-budgets.log +++ /dev/null @@ -1,20 +0,0 @@ - - RUN  v4.1.10 /shared/codebase/clean-architecture-frontend-template - - ✓ tests/platform/traffic/request-budget.test.ts (7 tests) 5ms - ✓ tests/platform/traffic/concurrency-budget.test.ts (6 tests) 10ms - ✓ tests/platform/resilience/retry-budget.test.ts (6 tests) 5ms - ✓ tests/platform/resilience/deadline.test.ts (3 tests) 6ms - ✓ tests/platform/traffic/traffic-budget.test.ts (9 tests) 9ms - ✓ tests/platform/execution/execution-context.test.ts (10 tests) 13ms - ✓ tests/platform/traffic/operation-traffic-policy.test.ts (7 tests) 7ms - ✓ tests/platform/traffic/request-fanout.test.ts (6 tests) 47ms - ✓ tests/platform/traffic/request-deduplication.test.ts (3 tests) 50ms - ✓ tests/platform/traffic/http-budget-integration.test.ts (9 tests) 121ms - ✓ tests/platform/traffic/traffic-amplification.test.ts (3 tests) 331ms - - Test Files  11 passed (11) - Tests  69 passed (69) - Start at  13:33:11 - Duration  1.08s (transform 940ms, setup 3.62s, import 1.46s, tests 603ms, environment 2ms) - diff --git a/artifacts/scale/release/typescript-diagnostics.log b/artifacts/scale/release/typescript-diagnostics.log deleted file mode 100644 index a9e02468..00000000 --- a/artifacts/scale/release/typescript-diagnostics.log +++ /dev/null @@ -1,5 +0,0 @@ -tsc app: files=827 types=279186 instantiations=700415 -PASS tsc:types (exponents 0.84, 0.96) -PASS tsc:symbols (exponents 0.51, 0.80) -PASS tsc:instantiations (exponents 0.97, 0.99) -tsc diagnostics artifact: /shared/codebase/clean-architecture-frontend-template/artifacts/scale/release/typescript-diagnostics.json diff --git a/config/ci/contract-baseline.json b/config/ci/contract-baseline.json index 9b062c4b..8b63dfd9 100644 --- a/config/ci/contract-baseline.json +++ b/config/ci/contract-baseline.json @@ -1,11 +1,11 @@ { "schemaVersion": 1, - "owner": "frontend-platform", - "reason": "13-03: production_gate downloads the promoted archive and FE-GATE-021..025 drill it with --release-root instead of rebuilding", + "owner": "DongHyeonka", + "reason": "1103/13-03: FE-GATE-027 also runs scan:dependency-advisories, a non-blocking release-stage advisory signal", "gates": 27, - "commands": 98, - "commandReferences": 103, - "artifacts": 109, + "commands": 100, + "commandReferences": 104, + "artifacts": 110, "stages": 5, - "gateShapeSha256": "630e801239de5d175fd1049b2527851dabe06f139ba8ff6a98de7f09f7a257c2" + "gateShapeSha256": "6225494d6447a2065d921a34597a744d180a7a68e601119e32f8fc42e18eb1c1" } diff --git a/config/ci/gates.json b/config/ci/gates.json index 8bbebbaa..46a4d27f 100644 --- a/config/ci/gates.json +++ b/config/ci/gates.json @@ -505,6 +505,11 @@ { "id": "verify-hosting-headers", "script": "verify:hosting-headers", + "args": [ + "--", + "--release-root", + ".release/promoted-release" + ], "expect": "pass" }, { @@ -512,6 +517,11 @@ "script": "test:sample-removal", "expect": "pass" }, + { + "id": "test-feature-scaffold", + "script": "test:feature-scaffold", + "expect": "pass" + }, { "id": "test-optional-recipe-removal", "script": "test:optional-recipe-removal", @@ -585,6 +595,11 @@ "id": "check-release-admission", "script": "check:release-admission", "expect": "pass" + }, + { + "id": "scan-dependency-advisories", + "script": "scan:dependency-advisories", + "expect": "pass" } ], "artifactSchemas": [ @@ -1599,6 +1614,15 @@ "test-sample-removal" ] }, + { + "id": "artifact-artifacts-tests-feature-scaffold-xml", + "path": "artifacts/tests/feature-scaffold.xml", + "schemaId": "junit", + "production": "command-generated", + "producerCommandIds": [ + "test-feature-scaffold" + ] + }, { "id": "artifact-artifacts-tests-optional-recipe-removal-xml", "path": "artifacts/tests/optional-recipe-removal.xml", @@ -2073,7 +2097,6 @@ "id": "FE-GATE-019", "name": "hosting-header", "commandIds": [ - "build", "verify-hosting-headers" ], "logArtifactId": "artifact-artifacts-quality-gates-FE-GATE-019-txt", @@ -2090,6 +2113,7 @@ "name": "removability", "commandIds": [ "test-sample-removal", + "test-feature-scaffold", "test-optional-recipe-removal", "test-browser-file-storage-removal", "test-realtime-removal" @@ -2097,6 +2121,7 @@ "logArtifactId": "artifact-artifacts-quality-gates-FE-GATE-020-txt", "evidenceArtifactIds": [ "artifact-artifacts-tests-sample-removal-xml", + "artifact-artifacts-tests-feature-scaffold-xml", "artifact-artifacts-tests-optional-recipe-removal-xml", "artifact-artifacts-tests-browser-file-storage-runtime-removal-xml", "artifact-artifacts-tests-realtime-runtime-removal-xml" @@ -2180,7 +2205,8 @@ "id": "FE-GATE-027", "name": "release-admission", "commandIds": [ - "check-release-admission" + "check-release-admission", + "scan-dependency-advisories" ], "logArtifactId": "artifact-artifacts-quality-gates-FE-GATE-027-txt", "evidenceArtifactIds": [ @@ -2224,6 +2250,7 @@ "FE-GATE-009", "FE-GATE-010", "FE-GATE-011", + "FE-GATE-012", "FE-GATE-013", "FE-GATE-020" ] @@ -2235,7 +2262,6 @@ "merge" ], "gateIds": [ - "FE-GATE-012", "FE-GATE-014", "FE-GATE-015", "FE-GATE-026", @@ -2297,6 +2323,7 @@ "FE-GATE-009", "FE-GATE-010", "FE-GATE-011", + "FE-GATE-012", "FE-GATE-013", "FE-GATE-020" ], @@ -2342,7 +2369,6 @@ "condition": "release", "timeoutMinutes": 45, "gateIds": [ - "FE-GATE-012", "FE-GATE-014", "FE-GATE-026", "FE-GATE-028" @@ -2765,13 +2791,33 @@ } ] }, + { + "id": "deployment", + "displayName": "deploy-promoted-release", + "kind": "deployment", + "needs": [ + "immutable_build", + "promotion" + ], + "condition": "production", + "timeoutMinutes": 45, + "gateIds": [], + "browserGateIds": [], + "environment": [], + "steps": [ + { + "kind": "deploy" + } + ] + }, { "id": "production_gate", "displayName": "${{ matrix.gate }} / ${{ matrix.name }}", "kind": "gate-matrix", "needs": [ "immutable_build", - "promotion" + "promotion", + "deployment" ], "condition": "production", "timeoutMinutes": 45, @@ -2792,6 +2838,10 @@ { "name": "CANDIDATE_ARCHIVE_SHA256", "value": "${{ needs.immutable_build.outputs.archive_sha256 }}" + }, + { + "name": "RELEASE_DEPLOYED", + "value": "${{ needs.deployment.outputs.deployed }}" } ], "steps": [ diff --git a/config/ci/product-gates.json b/config/ci/product-gates.json new file mode 100644 index 00000000..2849a590 --- /dev/null +++ b/config/ci/product-gates.json @@ -0,0 +1,5 @@ +{ + "schemaVersion": 1, + "deployment": null, + "mergeGates": [] +} diff --git a/config/ci/ungated-scripts.json b/config/ci/ungated-scripts.json index 62f76209..6d1ed86d 100644 --- a/config/ci/ungated-scripts.json +++ b/config/ci/ungated-scripts.json @@ -1,9 +1,13 @@ { "schemaVersion": 1, "entries": [ + { + "script": "check:backend-contract-drift", + "reason": "1103/12-06. Compares the paired backend checkout next to this repository with the commit config/contracts/backend-contract-pin.json pins. CI checks out this repository alone, so a gate has no backend to read; with no checkout the script reports skipped. The gated half of the pin is tests/unit/backend-contract-pin.test.ts (test:unit), which holds the Envelope table to the copied backend answer table. Run this before moving the pin." + }, { "script": "check:feature-index", - "reason": "The generated indexes (src/.generated/) are not committed, and every gate script regenerates them first (generate-product-feature-index.ts), so --check can only tell a developer that the local copy is stale." + "reason": "Local check that the generated indexes (src/.generated/, not committed) are current, and the first step of verify:extreme-scale (scripts/verify-extreme-scale.ts), itself a local run. A gate gains nothing from it: every gate script regenerates the indexes first (generate-product-feature-index.ts)." }, { "script": "check:http-scenario-evidence", @@ -15,7 +19,7 @@ }, { "script": "check:remediation-ledger", - "reason": "Checks the prose ledger of the 2026-08-14 adapter re-review (docs/operations/adapter-remediation-ledger.md) against test-file markers and the file-transfer bundle budget. Later fixes removed those markers and the budget is re-set at integration, so the check reports stale claims at this commit. It is a history record run by hand, not a current contract; wiring it into a gate first needs the ledger or the markers brought up to date." + "reason": "Checks the prose ledger of the 2026-08-14 adapter re-review (docs/operations/adapter-remediation-ledger.md) against test-file markers and the file-transfer bundle budget. It is a history record run by hand, not a current contract: it fails when a product removes the optional file-transfer recipe or when a test split moves a marked test to another file, and neither should block a merge. Run it after moving those tests or changing that budget, and point the ledger rows at the new files." }, { "script": "check:scale:baseline", diff --git a/config/contracts/backend-contract-pin.json b/config/contracts/backend-contract-pin.json new file mode 100644 index 00000000..e7a57933 --- /dev/null +++ b/config/contracts/backend-contract-pin.json @@ -0,0 +1,19 @@ +{ + "schemaVersion": 1, + "backend": { + "repository": "clean-architecture-backend-template", + "commit": "45d2a478b800586f1d84151723629a560265d58e", + "document": "docs/web/http-contract.md", + "sectionsCompared": ["1", "2", "4"] + }, + "frontend": { + "contractDocument": "docs/architecture/backend-api-and-server-state-contract.md", + "contractSections": ["4.1", "6", "6.1"], + "readers": ["src/adapters/http/backend-envelope.ts"] + }, + "tables": { + "idempotencyAnswers": "config/contracts/backend-idempotency-answers.json" + }, + "owner": "frontend-platform", + "comparedOn": "2026-11-04" +} diff --git a/config/contracts/backend-idempotency-answers.json b/config/contracts/backend-idempotency-answers.json new file mode 100644 index 00000000..23c7c23e --- /dev/null +++ b/config/contracts/backend-idempotency-answers.json @@ -0,0 +1,59 @@ +{ + "schemaVersion": 1, + "source": { + "repository": "clean-architecture-backend-template", + "commit": "45d2a478b800586f1d84151723629a560265d58e", + "document": "docs/web/http-contract.md" + }, + "answers": [ + { + "section": "2", + "code": "IDEMPOTENT_IN_FLIGHT", + "status": 409, + "refusedBeforeWrite": false, + "sameKeyResend": true + }, + { + "section": "2", + "code": "IDEMPOTENT_REQUEST_MISMATCH", + "status": 422, + "refusedBeforeWrite": true, + "sameKeyResend": false + }, + { + "section": "2", + "code": "IDEMPOTENCY_KEY_INVALID", + "status": 400, + "refusedBeforeWrite": true, + "sameKeyResend": false + }, + { + "section": "2", + "code": "IDEMPOTENCY_UNAVAILABLE", + "status": 503, + "refusedBeforeWrite": true, + "sameKeyResend": true + }, + { + "section": "2", + "code": "IDEMPOTENCY_COMPLETION_UNKNOWN", + "status": 503, + "refusedBeforeWrite": false, + "sameKeyResend": true + }, + { + "section": "2", + "code": "IDEMPOTENCY_RECOVERY_REQUIRED", + "status": 500, + "refusedBeforeWrite": false, + "sameKeyResend": true + }, + { + "section": "4", + "code": "REQUEST_TIMEOUT", + "status": 503, + "refusedBeforeWrite": false, + "sameKeyResend": false + } + ] +} diff --git a/config/contracts/registry-baseline.approval.json b/config/contracts/registry-baseline.approval.json index 1c30ebaa..74247c76 100644 --- a/config/contracts/registry-baseline.approval.json +++ b/config/contracts/registry-baseline.approval.json @@ -1,7 +1,7 @@ { "schemaVersion": 1, - "snapshotDigest": "83d11f848b8b2f67bcb657403f112d4baaf05481ab6bcee94ebc6851c32e2159", - "owner": "frontend-platform", - "reason": "07-04: FE-REG-ERROR drops severity, telemetryEvent and redaction, which nothing read", - "approvedAt": "2026-09-25T15:11:58.763Z" + "snapshotDigest": "319a798ca3c9a87d7e2943177d952b13941622f4faec23c28f36024196a9e91d", + "owner": "DongHyeonka", + "reason": "1103/16-04 FE-REG-API problemSchema가 FE-REG-SCHEMA api-problem 행을 참조한다", + "approvedAt": "2026-11-04T14:04:44.377Z" } diff --git a/config/contracts/registry-baseline.json b/config/contracts/registry-baseline.json index 46dc3ebb..6a56a3ef 100644 --- a/config/contracts/registry-baseline.json +++ b/config/contracts/registry-baseline.json @@ -43,24 +43,6 @@ "public", "session-required" ], - "paramsSchema": [ - null, - "NotFoundSplat", - "ReferenceResourceParams" - ], - "searchSchema": [ - null, - "ReferenceResourceListQuery" - ], - "loadingSurface": [ - "app-shell", - "example-page", - "reference-resource-list", - "reference-resource-detail", - "reference-resource-form", - "reference-resource-status", - "none" - ], "errorSurface": [ "route-boundary", "feature-boundary", @@ -92,7 +74,10 @@ "searchSchema", "access", "chunkId" - ] + ], + "fieldPatterns": { + "loadingSurface": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$" + } }, "rows": { "APP_HOME": { @@ -181,7 +166,7 @@ "navigationLabel": null, "navigationOrder": null, "paramsSchema": "ReferenceResourceParams", - "path": "/examples/reference-resources/:resourceId", + "path": "/examples/reference-resources/items/:resourceId", "routeId": "REFERENCE_RESOURCE_DETAIL", "searchSchema": null, "title": "Reference detail" @@ -341,34 +326,56 @@ { "registryId": "FE-REG-API", "owner": "feature-frontend-api-client-response-envelope-contract", - "source": "src/features/installed-feature-contracts.ts", + "source": "src/features/loaded-feature-runtimes.ts", "rowCount": 3, "contract": { "requiredFields": [ + "operationId", + "featureId", "method", "path", - "operationId", - "auth", - "timeoutMs", - "idempotency", - "retry", - "requestSource", + "authProfileId", + "retrySemantics", + "requestBody", + "responseBody", + "responseEnvelope", "requestSchema", "responseSchema", - "owner" + "problemSchema", + "acceptedStatuses", + "emptyBodyStatuses", + "unvalidated", + "requestByteLimit", + "responseByteLimit", + "totalDeadlineMs", + "retryBudget", + "traffic", + "commandEffect", + "commandRecovery" ], "fieldTypes": { + "operationId": "string", + "featureId": "string", "method": "string", "path": "string", - "operationId": "string", - "auth": "string", - "timeoutMs": "integer|null", - "idempotency": "string", - "retry": "string", - "requestSource": "string", + "authProfileId": "string", + "retrySemantics": "string", + "requestBody": "string", + "responseBody": "string", + "responseEnvelope": "string", "requestSchema": "string", "responseSchema": "string", - "owner": "string" + "problemSchema": "string", + "acceptedStatuses": "array", + "emptyBodyStatuses": "array", + "unvalidated": "array", + "requestByteLimit": "integer", + "responseByteLimit": "integer", + "totalDeadlineMs": "integer", + "retryBudget": "integer", + "traffic": "object|null", + "commandEffect": "object|null", + "commandRecovery": "object|null" }, "uniqueFields": [ "operationId" @@ -376,28 +383,30 @@ "allowedValues": { "method": [ "GET", + "HEAD", "POST", "PUT", "PATCH", "DELETE" ], - "auth": [ - "none", - "external-session" + "retrySemantics": [ + "SAFE", + "IDEMPOTENT", + "KEYED", + "NEVER" ], - "idempotency": [ - "safe", - "keyed", - "none" + "requestBody": [ + "NONE", + "JSON" ], - "retry": [ - "runtime", - "never" + "responseBody": [ + "REQUIRED_JSON", + "OPTIONAL_JSON", + "NONE" ], - "requestSource": [ - "none", - "search", - "body" + "responseEnvelope": [ + "NONE", + "ENVELOPE_V1" ] }, "references": [ @@ -410,126 +419,135 @@ "field": "responseSchema", "registryId": "FE-REG-SCHEMA", "targetField": "schemaId" + }, + { + "field": "problemSchema", + "registryId": "FE-REG-SCHEMA", + "targetField": "schemaId" } ], "keyField": "operationId", "breakingFields": [ + "operationId", "method", "path", - "operationId", - "auth", - "idempotency", - "requestSource", + "authProfileId", + "retrySemantics", + "requestBody", + "responseBody", + "responseEnvelope", "requestSchema", - "responseSchema" + "responseSchema", + "problemSchema", + "unvalidated" ] }, "rows": { "CREATE_REFERENCE_RESOURCE": { - "auth": "external-session", - "authProfileId": "REFERENCE_EXTERNAL_BEARER", - "contractVersion": 2, - "csrfProfileId": "NO_CSRF_BEARER", - "idempotency": "keyed", - "idempotencyKeyPolicy": "REQUIRED", - "mapperId": "ReferenceResourceMapper", - "maxEncodedSearchBytes": 0, - "maxResponseBytes": 32768, - "method": "POST", - "operationId": "CREATE_REFERENCE_RESOURCE", - "owner": "feature-frontend-reference-feature-vertical-slice", - "path": "/api/reference-resources", - "pathParameterNames": [], - "pathSchema": "NoRequest", - "protocol": "REST", - "providerId": "PRIMARY_API", - "replayPolicy": "KEYED_COMMAND", - "requestSchema": "CreateReferenceResourceCommand", - "requestSource": "body", - "responseMediaTypes": [ - "application/json" - ], - "responseSchema": "ReferenceResourcePayload", - "retry": "runtime", - "semantics": "COMMAND", - "successStatuses": [ + "acceptedStatuses": [ 200, 201 ], - "timeoutMs": null + "authProfileId": "EXTERNAL_BEARER", + "commandEffect": { + "classifiesStatus": true + }, + "commandRecovery": { + "mode": "IDEMPOTENCY_REPLAY", + "operationIdentityField": "idempotencyKey" + }, + "emptyBodyStatuses": [], + "featureId": "reference-feature", + "method": "POST", + "operationId": "CREATE_REFERENCE_RESOURCE", + "path": "/api/reference-resources", + "problemSchema": "ReferenceProblem", + "requestBody": "JSON", + "requestByteLimit": 32768, + "requestSchema": "CreateReferenceResourceCommand", + "responseBody": "REQUIRED_JSON", + "responseByteLimit": 32768, + "responseEnvelope": "NONE", + "responseSchema": "ReferenceResourcePayload", + "retryBudget": 0, + "retrySemantics": "KEYED", + "totalDeadlineMs": 10000, + "traffic": { + "maxConcurrentRequests": 1, + "maxPhysicalRequests": 1, + "maxQueuedRequests": 0, + "maxRetries": 0 + }, + "unvalidated": [] }, "GET_REFERENCE_RESOURCE": { - "auth": "external-session", - "authProfileId": "REFERENCE_EXTERNAL_BEARER", - "contractVersion": 2, - "csrfProfileId": "NO_CSRF_BEARER", - "idempotency": "safe", - "idempotencyKeyPolicy": "NONE", - "mapperId": "ReferenceResourceMapper", - "maxEncodedSearchBytes": 0, - "maxResponseBytes": 32768, + "acceptedStatuses": [ + 200 + ], + "authProfileId": "EXTERNAL_BEARER", + "commandEffect": null, + "commandRecovery": null, + "emptyBodyStatuses": [], + "featureId": "reference-feature", "method": "GET", "operationId": "GET_REFERENCE_RESOURCE", - "owner": "feature-frontend-reference-feature-vertical-slice", "path": "/api/reference-resources/{resourceId}", - "pathParameterNames": [ - "resourceId" - ], - "pathSchema": "ReferenceResourceParams", - "protocol": "REST", - "providerId": "PRIMARY_API", - "replayPolicy": "SAFE", - "requestSchema": "NoRequest", - "requestSource": "none", - "responseMediaTypes": [ - "application/json" - ], + "problemSchema": "ReferenceProblem", + "requestBody": "NONE", + "requestByteLimit": 0, + "requestSchema": "ReferenceResourceParams", + "responseBody": "REQUIRED_JSON", + "responseByteLimit": 32768, + "responseEnvelope": "NONE", "responseSchema": "ReferenceResourcePayload", - "retry": "runtime", - "semantics": "QUERY", - "successStatuses": [ - 200 - ], - "timeoutMs": null + "retryBudget": 2, + "retrySemantics": "SAFE", + "totalDeadlineMs": 10000, + "traffic": { + "maxConcurrentRequests": 1, + "maxPhysicalRequests": 3, + "maxQueuedRequests": 0, + "maxRetries": 2 + }, + "unvalidated": [] }, "LIST_REFERENCE_RESOURCES": { - "auth": "external-session", - "authProfileId": "REFERENCE_EXTERNAL_BEARER", - "contractVersion": 2, - "csrfProfileId": "NO_CSRF_BEARER", - "idempotency": "safe", - "idempotencyKeyPolicy": "NONE", - "mapperId": "ReferenceResourceListMapper", - "maxEncodedSearchBytes": 4096, - "maxResponseBytes": 262144, - "method": "GET", - "operationId": "LIST_REFERENCE_RESOURCES", - "owner": "feature-frontend-reference-feature-vertical-slice", - "path": "/api/reference-resources", - "pathParameterNames": [], - "pathSchema": "NoRequest", - "protocol": "REST", - "providerId": "PRIMARY_API", - "replayPolicy": "SAFE", - "requestSchema": "ReferenceResourceListQuery", - "requestSource": "search", - "responseMediaTypes": [ - "application/json" - ], - "responseSchema": "ReferenceResourceListPayload", - "retry": "runtime", - "semantics": "QUERY", - "successStatuses": [ + "acceptedStatuses": [ 200 ], - "timeoutMs": null + "authProfileId": "EXTERNAL_BEARER", + "commandEffect": null, + "commandRecovery": null, + "emptyBodyStatuses": [], + "featureId": "reference-feature", + "method": "GET", + "operationId": "LIST_REFERENCE_RESOURCES", + "path": "/api/reference-resources", + "problemSchema": "ReferenceProblem", + "requestBody": "NONE", + "requestByteLimit": 0, + "requestSchema": "ReferenceResourceListQuery", + "responseBody": "REQUIRED_JSON", + "responseByteLimit": 262144, + "responseEnvelope": "NONE", + "responseSchema": "ReferenceResourceListPayload", + "retryBudget": 2, + "retrySemantics": "SAFE", + "totalDeadlineMs": 10000, + "traffic": { + "maxConcurrentRequests": 1, + "maxPhysicalRequests": 3, + "maxQueuedRequests": 0, + "maxRetries": 2 + }, + "unvalidated": [] } } }, { "registryId": "FE-REG-SCHEMA", "owner": "feature-frontend-contract-schema-registry", - "source": "src/features/installed-feature-contracts.ts", + "source": "src/features/loaded-feature-runtimes.ts", "rowCount": 8, "contract": { "requiredFields": [ @@ -553,7 +571,8 @@ "route-search", "route-search-api-request", "api-request", - "api-response" + "api-response", + "api-problem" ], "runtime": [ "zod" @@ -583,21 +602,21 @@ "runtime": "zod", "schemaId": "none" }, - "NoRequest": { - "boundary": "api-request", - "direction": "REQUEST", - "owner": "feature-frontend-reference-feature-vertical-slice", - "runtime": "zod", - "schemaId": "NoRequest", - "schemaVersion": 1, - "unknownFieldPolicy": "REJECT_UNKNOWN" - }, "NotFoundSplat": { "boundary": "route-params", "owner": "feature-frontend-routing-release-recovery-runtime", "runtime": "zod", "schemaId": "NotFoundSplat" }, + "ReferenceProblem": { + "boundary": "api-problem", + "direction": "RESPONSE", + "owner": "feature-frontend-reference-feature-vertical-slice", + "runtime": "zod", + "schemaId": "ReferenceProblem", + "schemaVersion": 1, + "unknownFieldPolicy": "STRIP_UNKNOWN" + }, "ReferenceResourceListPayload": { "boundary": "api-response", "direction": "RESPONSE", @@ -640,7 +659,7 @@ "registryId": "FE-REG-ENV", "owner": "feature-frontend-env-runtime-config-contract", "source": "src/contracts/env.ts", - "rowCount": 16, + "rowCount": 18, "contract": { "requiredFields": [ "phase", @@ -652,7 +671,7 @@ "phase": "string", "classification": "string", "required": "boolean", - "defaultValue": "string|integer|boolean|null" + "defaultValue": "string|integer|boolean|object|null" }, "uniqueFields": [], "allowedValues": { @@ -690,13 +709,24 @@ }, "AUTH_MODE": { "classification": "public", - "defaultValue": "external", + "defaultValue": null, "phase": "runtime", "required": true }, + "BUILD_ID": { + "classification": "public-metadata", + "defaultValue": null, + "phase": "runtime", + "required": false + }, "CAPABILITY_OVERRIDES": { "classification": "public", - "defaultValue": null, + "defaultValue": { + "OFFLINE_COMMANDS": "DEFAULT", + "REALTIME": "DEFAULT", + "SERVICE_WORKER": "DEFAULT", + "WEB_WORKER": "DEFAULT" + }, "phase": "runtime", "required": false }, @@ -708,7 +738,7 @@ }, "FEATURE_OVERRIDES": { "classification": "public", - "defaultValue": null, + "defaultValue": {}, "phase": "runtime", "required": false }, @@ -718,11 +748,17 @@ "phase": "runtime", "required": false }, + "RELEASE_ID": { + "classification": "public-metadata", + "defaultValue": null, + "phase": "runtime", + "required": false + }, "RELEASE_MANIFEST_URL": { "classification": "public", "defaultValue": "/release-manifest.json", "phase": "runtime", - "required": true + "required": false }, "REQUEST_TIMEOUT_MS": { "classification": "public", @@ -732,7 +768,7 @@ }, "TELEMETRY_ENABLED": { "classification": "public", - "defaultValue": false, + "defaultValue": null, "phase": "runtime", "required": true }, @@ -744,7 +780,7 @@ }, "VITE_BUILD_ID": { "classification": "public-metadata", - "defaultValue": null, + "defaultValue": "local-build", "phase": "build", "required": true }, @@ -812,7 +848,8 @@ "sessionStorage", "localStorage", "disabled", - "forbidden" + "forbidden", + "external" ], "classification": [ "public-preference", @@ -860,7 +897,7 @@ "valueCodec": "none" }, "CACHE_INVALIDATION_PULSE": { - "backend": "localStorage", + "backend": "external", "classification": "opaque-cache", "logicalName": "CACHE_INVALIDATION_PULSE", "migration": "discard", @@ -870,7 +907,7 @@ "schemaVersion": 1, "scope": "cache-invalidation", "ttl": null, - "valueCodec": "opaque-string-v1" + "valueCodec": "none" }, "CHUNK_RELOAD_GUARD": { "backend": "sessionStorage", @@ -1327,7 +1364,7 @@ "registryId": "FE-REG-TELEMETRY", "owner": "feature-frontend-diagnostics-telemetry-runtime", "source": "src/contracts/telemetry.ts", - "rowCount": 5, + "rowCount": 6, "contract": { "requiredFields": [ "eventName", @@ -1385,6 +1422,7 @@ ], "optionalAttributes": [ "duration_bucket", + "effect_certainty", "operation_id" ], "requiredAttributes": [ @@ -1450,6 +1488,32 @@ "sampling": "all", "trigger": "release tuple mismatch" }, + "service-worker.start.failed": { + "delivery": "best-effort", + "eventName": "service-worker.start.failed", + "forbiddenAttributes": [ + "access_token", + "authorization_header", + "cookie", + "email", + "query_string", + "raw_url", + "raw_user_id", + "refresh_token", + "request_body", + "response_body", + "stack_in_user_message", + "storage_value", + "user_name" + ], + "optionalAttributes": [], + "requiredAttributes": [ + "build_id", + "error_kind" + ], + "sampling": "all", + "trigger": "Service Worker start ended FAILED or INCOMPATIBLE" + }, "telemetry.delivery.dropped": { "delivery": "best-effort", "eventName": "telemetry.delivery.dropped", diff --git a/config/contracts/registry-change-evidence.json b/config/contracts/registry-change-evidence.json index 3c90d861..62d2c3c4 100644 --- a/config/contracts/registry-change-evidence.json +++ b/config/contracts/registry-change-evidence.json @@ -1,125 +1,4 @@ { "schemaVersion": 1, - "changes": [ - { - "changeId": "FE-REG-ENV:API_CONTRACT_VERSION:*:removed", - "versionBump": "Runtime Config V2 (CONFIG_SCHEMA_VERSION 2.0) removes the scalar API contract version.", - "migration": "Release Manifest V2 contractSet replaces the scalar: the compiled external contract package set is canonicalized and digested, and boot compares it against the manifest.", - "compatibilityWindow": "The V1 config and V1 manifest readers stay in place for one release. A V1 document may still carry the scalar; a V2 document is rejected if it does.", - "rollback": "Restore the V1 writer in scripts/generate-build-manifest.ts and the scalar key in public/config.json; the V1 reader is still present.", - "owner": "frontend-platform" - }, - { - "changeId": "FE-REG-QUERY:*:*:removed", - "versionBump": "Query invalidation composition moves from the legacy flat query registry to the bounded many-to-many invalidation graph.", - "migration": "Installed feature contracts now contribute topics, namespace identities, edges, and separate wire versions; bootstrap validates and indexes those contributions before constructing coordinators.", - "compatibilityWindow": "Cross-context envelopes remain opaque topic/version pairs and release cache epochs isolate mixed releases; no query keys or cached values cross contexts.", - "rollback": "Restore the flat QUERY_REGISTRY composition and its coordinator adapter together with the prior governance entry.", - "owner": "frontend-platform" - }, - { - "changeId": "FE-REG-QUERY:$contract:allowedValues:contract-field-changed", - "versionBump": "Cross-context invalidation wire protocol starts at version 1.", - "migration": "Every installed query row declares invalidate-only; older tabs remain local-only.", - "compatibilityWindow": "Mixed releases are isolated by release cacheEpoch and never exchange query keys or values.", - "rollback": "Remove the coordinator composition and the two query registry fields.", - "owner": "frontend-platform" - }, - { - "changeId": "FE-REG-QUERY:$contract:breakingFields:contract-field-changed", - "versionBump": "Cross-context invalidation wire protocol starts at version 1.", - "migration": "Every installed query row declares its opaque topic and transport policy.", - "compatibilityWindow": "A release cacheEpoch rejects messages from a different deployed contract.", - "rollback": "Remove the coordinator composition and restore the prior query registry contract.", - "owner": "frontend-platform" - }, - { - "changeId": "FE-REG-QUERY:$contract:fieldTypes:contract-field-changed", - "versionBump": "Cross-context invalidation wire protocol starts at version 1.", - "migration": "The installed reference query row and all consumers were updated atomically.", - "compatibilityWindow": "Old clients do not consume the new fields; new clients validate them before boot.", - "rollback": "Restore the previous query registry field types and local-only invalidation.", - "owner": "frontend-platform" - }, - { - "changeId": "FE-REG-QUERY:$contract:requiredFields:contract-field-changed", - "versionBump": "Cross-context invalidation wire protocol starts at version 1.", - "migration": "Missing topics now fail registry validation instead of silently degrading at runtime.", - "compatibilityWindow": "Only a fully built release consumes its own installed registry snapshot.", - "rollback": "Remove the newly required fields and cross-context composition together.", - "owner": "frontend-platform" - }, - { - "changeId": "FE-REG-QUERY:$contract:uniqueFields:contract-field-changed", - "versionBump": "Cross-context invalidation wire protocol starts at version 1.", - "migration": "Existing query namespaces received unique registry-issued opaque topics.", - "compatibilityWindow": "Topics are scoped by release cacheEpoch, so mixed releases cannot collide.", - "rollback": "Drop invalidationTopic uniqueness after removing the transport consumer.", - "owner": "frontend-platform" - }, - { - "changeId": "FE-REG-RELEASE:apiContractVersion:compatibilityRole:field-changed", - "versionBump": "The release token registry adds contractSetDigest and demotes apiContractVersion to a legacy V1 scalar.", - "migration": "compareReleaseToRuntime no longer sources the scalar from Runtime Config; when neither side declares it there is nothing to compare and contractSet verification owns contract coherence.", - "compatibilityWindow": "A V1 manifest still supplies apiContractVersion and is still compared against a V1 config that declares one.", - "rollback": "Restore the previous compatibilityRole text and remove the contractSetDigest token together with the V2 manifest writer.", - "owner": "frontend-platform" - }, - { - "changeId": "FE-REG-STORAGE:$contract:allowedValues:contract-field-changed", - "versionBump": "Web Storage value codec contracts start at version 1.", - "migration": "Existing keys retain their physical schema version; values outside the selected codec are discarded.", - "compatibilityWindow": "Valid existing color-scheme and opaque-string records remain readable.", - "rollback": "Restore the previous registry contract; no physical key deletion is required.", - "owner": "frontend-platform" - }, - { - "changeId": "FE-REG-STORAGE:$contract:breakingFields:contract-field-changed", - "versionBump": "Web Storage value codec contracts start at version 1.", - "migration": "Each existing row received an explicit codec; executable migration was never consumed and is now forbidden.", - "compatibilityWindow": "Schema-versioned physical keys and the envelope shape remain unchanged.", - "rollback": "Remove valueCodec enforcement and restore the prior metadata declaration.", - "owner": "frontend-platform" - }, - { - "changeId": "FE-REG-STORAGE:$contract:fieldTypes:contract-field-changed", - "versionBump": "Web Storage value codec contracts start at version 1.", - "migration": "The dead function migration union was narrowed to the only implemented discard policy.", - "compatibilityWindow": "All installed definitions already used discard before this contract change.", - "rollback": "Restore the former type metadata without rewriting persisted records.", - "owner": "frontend-platform" - }, - { - "changeId": "FE-REG-STORAGE:$contract:requiredFields:contract-field-changed", - "versionBump": "Web Storage value codec contracts start at version 1.", - "migration": "All installed storage rows now declare their closed value codec.", - "compatibilityWindow": "Existing valid envelopes continue to decode; invalid values fail closed.", - "rollback": "Remove the required codec field and runtime codec dispatch together.", - "owner": "frontend-platform" - }, - { - "changeId": "FE-REG-ERROR:QUERY_CACHE_FAILURE:telemetryEvent:field-changed", - "versionBump": "Error taxonomy observability references became the closed union of registered diagnostic and telemetry event ids (extreme-scale Phase 4 ledger, 2026-09-23).", - "migration": "QUERY_CACHE_FAILURE pointed at the unregistered event id query.cache.failed; it now references the registered cache.operation.failed diagnostic event that the query cache adapter actually emits.", - "compatibilityWindow": "No wire, storage or runtime-config format changes: the old id was never emitted by any producer, so no consumer could observe it.", - "rollback": "Restore the previous telemetryEvent string on QUERY_CACHE_FAILURE in src/contracts/errors.ts and widen ErrorObservationEvent back to string.", - "owner": "frontend-platform" - }, - { - "changeId": "FE-REG-ENV:VITE_BUILD_ID:defaultValue:field-type-changed", - "versionBump": "F-6 (13-15): the registry now records the local-build fallback that getBuildConfig and the build scripts already applied; the value itself did not change.", - "migration": "None for local builds. A staging or production build without VITE_BUILD_ID now fails in scripts/generate-runtime-config.ts instead of shipping the placeholder that admission refused.", - "compatibilityWindow": "No runtime document or wire format changes: BUILD_ID was already local-build whenever VITE_BUILD_ID was unset.", - "rollback": "Restore defaultValue null on VITE_BUILD_ID in src/contracts/env.ts and drop the public-target check in scripts/generate-runtime-config.ts.", - "owner": "frontend-platform" - }, - { - "changeId": "FE-REG-ROUTE:REFERENCE_RESOURCE_DETAIL:path:field-changed", - "versionBump": "The reference detail route moves from /examples/reference-resources/:resourceId to /examples/reference-resources/items/:resourceId (maturity review 08-13), so a server id equal to the static segments new or status opens its detail instead of the form or status screen.", - "migration": "The only in-app link (reference-resource-page.tsx) builds the new path from the contract route. The reference feature is a sample; downstream features that copied it keep their own paths.", - "compatibilityWindow": "None for bookmarked sample detail URLs: an old /examples/reference-resources/ URL no longer matches the detail route; new and status keep opening the form and status screens.", - "rollback": "Restore the previous path in src/features/reference-feature/contracts/reference-feature-contract.ts and the link in reference-resource-page.tsx, then drop this entry.", - "owner": "frontend-platform" - } - ] + "changes": [] } diff --git a/config/contracts/registry-governance.json b/config/contracts/registry-governance.json index 11eaa591..a7755371 100644 --- a/config/contracts/registry-governance.json +++ b/config/contracts/registry-governance.json @@ -41,23 +41,15 @@ "uniqueFields": ["routeId", "path", "chunkId"], "allowedValues": { "access": ["public", "session-required"], - "paramsSchema": [null, "NotFoundSplat", "ReferenceResourceParams"], - "searchSchema": [null, "ReferenceResourceListQuery"], - "loadingSurface": [ - "app-shell", - "example-page", - "reference-resource-list", - "reference-resource-detail", - "reference-resource-form", - "reference-resource-status", - "none" - ], "errorSurface": [ "route-boundary", "feature-boundary", "not-found" ] }, + "fieldPatterns": { + "loadingSurface": "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$" + }, "references": [ { "field": "routeId", @@ -141,43 +133,89 @@ }, { "registryId": "FE-REG-API", - "path": "src/features/installed-feature-contracts.ts", + "path": "src/features/loaded-feature-runtimes.ts", "exportName": "API_OPERATIONS", "owner": "feature-frontend-api-client-response-envelope-contract", "keyField": "operationId", "requiredFields": [ + "operationId", + "featureId", "method", "path", - "operationId", - "auth", - "timeoutMs", - "idempotency", - "retry", - "requestSource", + "authProfileId", + "retrySemantics", + "requestBody", + "responseBody", + "responseEnvelope", "requestSchema", "responseSchema", - "owner" + "problemSchema", + "acceptedStatuses", + "emptyBodyStatuses", + "unvalidated", + "requestByteLimit", + "responseByteLimit", + "totalDeadlineMs", + "retryBudget", + "traffic", + "commandEffect", + "commandRecovery" ], "fieldTypes": { + "operationId": "string", + "featureId": "string", "method": "string", "path": "string", - "operationId": "string", - "auth": "string", - "timeoutMs": "integer|null", - "idempotency": "string", - "retry": "string", - "requestSource": "string", + "authProfileId": "string", + "retrySemantics": "string", + "requestBody": "string", + "responseBody": "string", + "responseEnvelope": "string", "requestSchema": "string", "responseSchema": "string", - "owner": "string" + "problemSchema": "string", + "acceptedStatuses": "array", + "emptyBodyStatuses": "array", + "unvalidated": "array", + "requestByteLimit": "integer", + "responseByteLimit": "integer", + "totalDeadlineMs": "integer", + "retryBudget": "integer", + "traffic": "object|null", + "commandEffect": "object|null", + "commandRecovery": "object|null" }, - "uniqueFields": ["operationId"], + "uniqueFields": [ + "operationId" + ], "allowedValues": { - "method": ["GET", "POST", "PUT", "PATCH", "DELETE"], - "auth": ["none", "external-session"], - "idempotency": ["safe", "keyed", "none"], - "retry": ["runtime", "never"], - "requestSource": ["none", "search", "body"] + "method": [ + "GET", + "HEAD", + "POST", + "PUT", + "PATCH", + "DELETE" + ], + "retrySemantics": [ + "SAFE", + "IDEMPOTENT", + "KEYED", + "NEVER" + ], + "requestBody": [ + "NONE", + "JSON" + ], + "responseBody": [ + "REQUIRED_JSON", + "OPTIONAL_JSON", + "NONE" + ], + "responseEnvelope": [ + "NONE", + "ENVELOPE_V1" + ] }, "references": [ { @@ -189,6 +227,11 @@ "field": "responseSchema", "registryId": "FE-REG-SCHEMA", "targetField": "schemaId" + }, + { + "field": "problemSchema", + "registryId": "FE-REG-SCHEMA", + "targetField": "schemaId" } ], "consumerIdentityField": "operationId", @@ -197,19 +240,23 @@ "src/features/*/application" ], "breakingFields": [ + "operationId", "method", "path", - "operationId", - "auth", - "idempotency", - "requestSource", + "authProfileId", + "retrySemantics", + "requestBody", + "responseBody", + "responseEnvelope", "requestSchema", - "responseSchema" + "responseSchema", + "problemSchema", + "unvalidated" ] }, { "registryId": "FE-REG-SCHEMA", - "path": "src/features/installed-feature-contracts.ts", + "path": "src/features/loaded-feature-runtimes.ts", "exportName": "SCHEMA_REGISTRY", "owner": "feature-frontend-contract-schema-registry", "keyField": "schemaId", @@ -227,7 +274,8 @@ "route-search", "route-search-api-request", "api-request", - "api-response" + "api-response", + "api-problem" ], "runtime": ["zod"] }, @@ -249,7 +297,7 @@ "phase": "string", "classification": "string", "required": "boolean", - "defaultValue": "string|integer|boolean|null" + "defaultValue": "string|integer|boolean|object|null" }, "allowedValues": { "phase": ["build", "runtime"], @@ -307,7 +355,8 @@ "sessionStorage", "localStorage", "disabled", - "forbidden" + "forbidden", + "external" ], "classification": [ "public-preference", @@ -366,7 +415,7 @@ }, "consumers": [ { - "path": "src/adapters/http/client.ts", + "path": "src/adapters/http/feature-http-binding.ts", "token": "failure(" } ], diff --git a/config/hosting/cache-policy.json b/config/hosting/cache-policy.json index 1bf46db8..46e786d5 100644 --- a/config/hosting/cache-policy.json +++ b/config/hosting/cache-policy.json @@ -1,5 +1,8 @@ { "schemaVersion": 1, + "transport": { + "alpnProtocols": ["h2"] + }, "surfaces": { "index": { "path": "/", @@ -23,10 +26,24 @@ "pathPattern": "/assets/*", "cacheControl": "public, max-age=31536000, immutable", "contentTypes": ["text/javascript", "application/javascript"], + "contentEncodings": ["br", "gzip", "zstd"], "securityHeaders": false }, "sourceMap": { "public": false + }, + "appRoute": { + "path": "/__probe/deep-link", + "cacheControl": "no-cache", + "contentTypes": ["text/html"], + "securityHeaders": true + }, + "serviceWorker": { + "path": "/service-worker.js", + "requiredWhen": "service-worker-shipped", + "cacheControl": "no-cache", + "contentTypes": ["text/javascript", "application/javascript"], + "securityHeaders": false } } } diff --git a/config/hosting/response-headers.fixture.json b/config/hosting/response-headers.fixture.json index 88ece613..6d301ac4 100644 --- a/config/hosting/response-headers.fixture.json +++ b/config/hosting/response-headers.fixture.json @@ -33,6 +33,21 @@ }, "hashedAsset": { "cache-control": "public, max-age=31536000, immutable", + "content-type": "text/javascript; charset=utf-8", + "content-encoding": "gzip" + }, + "appRoute": { + "cache-control": "no-cache", + "content-type": "text/html; charset=utf-8", + "content-security-policy": "default-src 'self'; base-uri 'self'; object-src 'none'; frame-ancestors 'none'; form-action 'self'; script-src 'self'; style-src 'self'; img-src 'self' data:; connect-src 'self' https:; font-src 'self'; upgrade-insecure-requests", + "strict-transport-security": "max-age=31536000; includeSubDomains", + "x-frame-options": "DENY", + "referrer-policy": "strict-origin-when-cross-origin", + "x-content-type-options": "nosniff", + "permissions-policy": "camera=(), microphone=(), geolocation=()" + }, + "serviceWorker": { + "cache-control": "no-cache", "content-type": "text/javascript; charset=utf-8" } } diff --git a/config/performance/budgets.json b/config/performance/budgets.json index adf9cc73..18d08dc8 100644 --- a/config/performance/budgets.json +++ b/config/performance/budgets.json @@ -2,6 +2,7 @@ "schemaVersion": 1, "bundle": { "initialJsGzipBytes": 204800, + "initialJsFiles": 32, "lazyChunkGzipBytes": 122880 }, "lab": { diff --git a/config/recipes/frontend-capability-recipes.json b/config/recipes/frontend-capability-recipes.json index 9f05f6ef..386e792f 100644 --- a/config/recipes/frontend-capability-recipes.json +++ b/config/recipes/frontend-capability-recipes.json @@ -67,7 +67,7 @@ "lifecycleMethods": ["close-or-dispose", "unsubscribe", "cancel-via-AbortSignal", "bounded-poll-lease", "revoke-push-association"], "owner": "project-owner-required", "securityPrivacy": ["Validate every event envelope and closed transport frame before application effects.", "Bind stream state to the current opaque scope generation and advance checkpoints only after committed effects or authoritative recovery.", "Use fixed same-origin endpoints and an exact WebSocket subprotocol; never place credentials, cursors, subscription material or scope bindings in URLs or telemetry.", "Treat Web Push as a notification hint, fence registration and revocation with one durable compare-and-swap control record, and allow only registry-owned notification and route intents.", "Keep every queue, parser, reconnect, poll, notification and storage operation bounded and abortable."], - "bundleBudgetGzipBytes": 40900, + "bundleBudgetGzipBytes": 42200, "fallback": "Bounded polling or explicitly stale UI.", "removal": ["Disable admission and close active readers, sockets, poll leases and worker handlers.", "Revoke and purge only the owned Web Push association and notification state.", "Remove composition, registries, adapters and any selected vendor dependency.", "Run realtime boundary, runtime-removal and production-bundle gates."], "serverStatePolicy": "query-cache-owned" @@ -104,12 +104,12 @@ "forbiddenWhen": ["The data contains credentials.", "The browser would connect directly to a server database or object store.", "A normal HTTP cache is sufficient.", "Partition, retention, quota and recovery ownership are undefined."], "boundary": "feature-specific async repository with registry-issued opaque dataset scope and immutable full-policy binding, plus an OPFS large-object sidecar whose logical commit authority and bidirectional scope binding are owned by an IndexedDB journal", "port": "IndexedDbRepositoryPort / IndexedDbMaintenancePort / DurableObjectStorePort / DurableObjectMaintenancePort / StorageDurabilityPort", - "fake": "MemoryStructuredOfflineStore / MemoryDurableObjectStore / MemoryStorageDurabilityAdapter", + "fake": "MemoryDurableObjectStore / MemoryStorageDurabilityAdapter (no recipe fake implements IndexedDbRepositoryPort; run the reference runtime on tests/helpers/memory-indexeddb.ts)", "failureKinds": ["open-blocked", "versionchange", "quota", "corruption", "migration-rollback", "revision-conflict", "storage-eviction", "partial-object-write", "dataset-binding-mismatch", "dataset-budget-exceeded", "lifecycle-authorization-denied", "expired-resource"], "lifecycleMethods": ["close", "cancel-via-AbortSignal", "enforce-bounded-lifecycle-batch", "prune-expired-receipts", "reconcile", "enforcePolicies-with-composition-authority"], "owner": "project-owner-required", "securityPrivacy": ["Classify every persisted field and binary namespace.", "Encrypting in the same client is not a credential protection boundary.", "Keep database schema and record codec versions separate.", "Derive the physical IndexedDB name only from registry-issued authority, namespace and partition tokens; readable namespace, business and account IDs are forbidden.", "Persist and revalidate an immutable scope plus full BrowserStoragePolicy binding during upgrade, post-open and maintenance; missing or mismatched existing bindings fail closed.", "Use the actual IndexedDB wire split: StoredRecord contains only key, codecVersion, revision and payload; writtenAtEpochMs, synchronization, measuredBytes and eligibleAtEpochMs belong to the retention sidecar, while idempotency receipts and governance binding/budget use separate stores.", "Include every store registered in lifecycleMetadataStores in bounded full-partition purge while retaining immutable governance identity.", "Measure conservative logical bytes through the codec and atomically enforce dataset usedBytes plus receiptCount with record, lifecycle and migration writes.", "Enforce TTL before sweep visibility, delete UNTIL_SYNCED only after explicit confirmation, and require a composition-authorized short-lived proof for every deleting IndexedDB lifecycle batch.", "Bound idempotency receipt retention to 31 days and configured count to the implementation ceiling of 1000000; bound migration to old-writer-drained batches no larger than 500 rows or 30000ms.", "Bind OPFS readable and physical scopes in both directions and use only /ca-frontend-opfs-v1/authorities//// for physical dataset layout.", "For OPFS LOGOUT, UNTIL_SYNCED and ACCOUNT_DELETION maintenance, composition must provide both requestMaintenanceAuthority and consumeMaintenanceAuthority; issue a fresh proof bound to the exact frozen reason, scope and policy for at most five minutes, then atomically consume it to reject replay.", "Never expose an OPFS authority proof through the application request, persistence, diagnostics or telemetry.", "Never place user file names or identifiers in OPFS paths or diagnostics."], - "bundleBudgetGzipBytes": 36900, + "bundleBudgetGzipBytes": 38500, "fallback": "Read-only or online-only query path; OPFS may degrade to a size-capped IndexedDB Blob only when the product policy approves it.", "removal": ["Stop writes and background migration.", "Reconcile or export unsynced data, then purge only governance-bound owned partitions and OPFS namespaces through authorized bounded lifecycle operations.", "Close all database, channel, worker and file handles.", "Remove repository composition and dependency."], "serverStatePolicy": "reference-or-command-only" @@ -137,16 +137,16 @@ ], "productionComposition": false }, - "trigger": "Installability, a measured offline-shell requirement, or an explicitly owned public HTTP representation cache is approved.", + "trigger": "Installability or an explicitly owned public HTTP representation cache is approved. The reference worker keeps navigation network-only and has no offline shell; an offline document is a separate product capability (closed deep design 18.8).", "forbiddenWhen": ["Hosting cache and worker cache ownership conflict.", "Update and rollback UX is undefined.", "Authenticated, private, opaque or personal responses would be cached.", "Cache freshness, byte and entry limits are undefined."], "boundary": "bootstrap update controller plus platform-local public Request/Response cache administration", "port": "ServiceWorkerUpdatePort / PublicResponseCacheAdmin recipe / PublicResponseCachePort / PublicResponseCacheAdminPort reference runtime", "fake": "FakeServiceWorkerUpdateAdapter / MemoryPublicResponseCache", - "failureKinds": ["stale-worker", "update-loop", "offline-fallback", "incomplete-candidate", "integrity-mismatch", "cache-policy-rejection", "quota"], + "failureKinds": ["stale-worker", "update-loop", "offline-navigation-network-error", "incomplete-candidate", "integrity-mismatch", "cache-policy-rejection", "quota"], "lifecycleMethods": ["unregister", "rollback", "delete-owned-caches"], "owner": "project-owner-required", "securityPrivacy": ["Cache only explicit same-origin public GET representations.", "Never cache authenticated, cookie-dependent, private, no-store, opaque or personal responses.", "Bind candidate cache names to release identity and a canonical manifest digest that includes normalized expectedContentType, exact request identity, expected byte length and integrity digest.", "Reject a response whose normalized Content-Type differs from manifest expectedContentType even when body integrity matches.", "Derive cleanup retention only from the verified active pointer and composition retainedPreviousReleaseCount; cleanup callers cannot submit cache names, release registry IDs or any retain set.", "Read active-pointer and release-marker control JSON through a strict UTF-8 stream capped at exactly 2 MiB (2097152 bytes), cancel on overflow and fail closed before parsing oversized metadata.", "Keep exact query and Vary semantics; ignoreSearch and ignoreVary are forbidden.", "Fail closed on malformed update metadata or integrity mismatch."], - "bundleBudgetGzipBytes": 10000, + "bundleBudgetGzipBytes": 10100, "fallback": "Normal network application with hosting cache headers.", "removal": ["Deploy an unregister migration.", "Delete only parsed, owned cache namespaces after old controlled clients drain.", "Remove worker registration, cache metadata and manifest."], "serverStatePolicy": "network-cache-policy-only" @@ -195,8 +195,8 @@ "lifecycleMethods": ["release-file-ref", "release-or-dispose-preview-leases", "cancel-via-AbortSignal", "reconcile-or-explicitly-abort-upload", "close-checkpoint-store", "dispose-capability-and-image-runtime", "dispose-browser-file-runtime-on-logout-or-account-switch"], "owner": "project-owner-required", "securityPrivacy": ["Treat file name, extension, MIME and lastModified as untrusted metadata.", "Resolve only exact composition-issued file and image policy object identities; callers cannot raise byte, candidate, pixel, quality, format, lifetime or origin ceilings.", "Use opaque file references and verification receipts bound to an inspected immutable file snapshot and the exact registered profile; reject replay through another profile even when an inspection rule ID matches.", "Treat presigned URLs as bearer capabilities; bind exact method, resource or upload part, offset, length, media type, checksum, origin, path, query, headers and expiry in an in-memory identity vault.", "Use credentials omit, redirect error, no-referrer and no-store for direct data-plane fetch; never persist or observe URL, query, signed header, capability, file name or raw backend message, and never emit digest, raw ETag or receipt values to diagnostics or telemetry.", "A strict account-partitioned upload checkpoint may persist only the protocol-defined SHA-256 file fingerprint, per-part checksum and bounded opaque non-authorizing part receipt token required for server reconciliation; no bearer token or raw signed capability is allowed.", "Persist only strict non-authorizing upload checkpoints and reconcile them with server-authoritative status and re-hashed local parts before completion.", "Require a synchronous server-issued browser-managed download capability whose receipt exactly equals the caller's branded capability receipt and whose resource, media type, safe extension, maximum bytes, optional digest and expiry all match before handoff.", "Expose File, OPFS, Cache and transfer byte streams only as chunk-level closed Results; stop after the first failure, cancel native readers and never throw a raw native exception across the port.", "Accept Image CDN assets only through immutable allowlisted or signature-verified descriptors and registered preset identities; reject active formats, arbitrary transforms, pixel/decode-budget overflow and unsafe cache policy.", "Upload completion remains QUARANTINED until backend scan and promotion; client capability checks are not an authorization boundary.", "Active content preview requires isolation or download-only treatment."], - "bundleBudgetGzipBytes": 55700, - "fallback": "Accessible native file input, same-origin authorized server upload/download and a single bounded server-selected image rendition; generated artifacts above the buffer budget move to server-side generation.", + "bundleBudgetGzipBytes": 57800, + "fallback": "Accessible native file input, same-origin authorized server upload/download and a single bounded server-selected image rendition; generated artifacts above the buffer budget move to server-side generation. The paired backend template has no presigned or direct multipart server (removed 2026-09-25): with it, upload through its Fileserver (POST /v1/files) with createFileserverUploadClient from src/adapters/http.", "removal": ["Stop new capability and upload-session issuance, then cancel active reads and transfers.", "Reconcile or explicitly abort active multipart sessions and let backend TTL cleanup remove ambiguous orphans.", "Remove non-secret checkpoints according to account and retention policy.", "Release file references, revoke preview object-URL leases and dispose file, capability and image runtimes.", "Remove transfer/image feature facades and composition, then prove browser-transfer sources are absent from the production module inventory."], "serverStatePolicy": "query-cache-metadata-only" }, diff --git a/config/scale/feature-shape-ceilings.json b/config/scale/feature-shape-ceilings.json index 1731d967..7b45c40a 100644 --- a/config/scale/feature-shape-ceilings.json +++ b/config/scale/feature-shape-ceilings.json @@ -9,7 +9,7 @@ "axes": [ { "axis": "Typecheck of one app", - "verified": "Linear, about 115k instantiations and 37 MB of tsc memory per feature, up to 100 features", + "verified": "Linear, about 117k instantiations and 36 MB of tsc memory per feature, up to 100 features", "condition": "Reference-shaped features, tsconfig.app.json, the host recorded in the baseline", "notVerified": "200 features (one full context) and beyond; 4,000 (20 x 200) would need on the order of 150 GB by the same slope" }, @@ -21,13 +21,13 @@ }, { "axis": "Initial JavaScript", - "verified": "Grows by about 2.9 KB gzip and one file per feature: every installed feature's contracts and module load at boot", - "condition": "Same", - "notVerified": "The initial budget (204,800 B, config/performance/budgets.json) is exceeded after a few more reference-shaped features, far below the context ceiling" + "verified": "15-01: only each feature's declaration (route table, messages, invalidation identities) loads at boot; its runtime half loads with its routes, and a copy adds no initial file. initialJavascript below is the current template build, what one more feature in an existing context adds (perFeatureGzipBytes) and what a new context adds (perContextGzipBytes); tests/unit/feature-shape-growth.test.ts measures them on every unit run, bounds a feature at 1 KiB and a context at 512 B, and fails when the record no longer matches the build. The 25- and 100-copy runs are in the baseline at its source commit (before 15-01: +3,922 B per copy)", + "condition": "Same; the feature-declarations and feature-platform chunk groups in vite.config.ts", + "notVerified": "How many more features fit: the initial budget (config/performance/budgets.json) minus initialJavascript.gzipBytes, divided by perFeatureGzipBytes (plus perContextGzipBytes per new context). The platform itself takes most of the budget" }, { "axis": "Lazy JavaScript", - "verified": "About 6.8 KB gzip and six files per feature, every file far below the 120 KiB lazy-chunk budget", + "verified": "About 8.5 KB gzip and eight files per feature, every file far below the 120 KiB lazy-chunk budget", "condition": "Same", "notVerified": "Download cost of many lazy files" }, @@ -37,5 +37,11 @@ "condition": "Same", "notVerified": "Router matching cost at runtime" } - ] + ], + "initialJavascript": { + "gzipBytes": 202927, + "files": 26, + "perFeatureGzipBytes": 768, + "perContextGzipBytes": 233 + } } diff --git a/config/scale/feature-shape-growth.json b/config/scale/feature-shape-growth.json index 2a28b36e..052374f4 100644 --- a/config/scale/feature-shape-growth.json +++ b/config/scale/feature-shape-growth.json @@ -1,17 +1,24 @@ { "schemaVersion": 1, - "measuredAt": "2026-09-27T04:03:00.821Z", + "measuredAt": "2026-11-01T14:29:42.148Z", "command": "node scripts/scale/measure-feature-shape-growth.ts --sizes=0,25,100 --repeats=2", "environment": { "node": "24.14.0", "platform": "linux", "arch": "x64", - "cpuModel": "Intel(R) Core(TM) i5-10400F CPU @ 2.90GHz", - "logicalCpus": 12, - "availableParallelism": 12, + "cpuModel": "Intel(R) Core(TM) Ultra 7 155H", + "logicalCpus": 22, + "availableParallelism": 22, "typescript": "Version 7.0.2", "vite": "vite/8.1.5 linux-x64 node-v24.14.0" }, + "source": { + "commit": "373b27b09c7c24c50ea81fca0238138f6b8189a8", + "modifiedPaths": [ + "scripts/scale/measure-feature-shape-growth.ts", + "tests/unit/feature-shape-growth.test.ts" + ] + }, "sourceFeature": "src/features/reference-feature", "runs": [ { @@ -21,29 +28,29 @@ "tsc": { "passed": true, "firstError": null, - "files": 840, - "types": 284678, - "symbols": 802946, - "instantiations": 712089, - "memoryKb": 520454, - "wallMs": 3408 + "files": 844, + "types": 287435, + "symbols": 794593, + "instantiations": 721205, + "memoryKb": 521732, + "wallMs": 811 }, "build": { - "wallMs": 1208, - "initialJavascriptFiles": 13, - "initialJavascriptGzipBytes": 200001, - "lazyJavascriptFiles": 14, - "lazyJavascriptGzipBytes": 24938 + "wallMs": 428, + "initialJavascriptFiles": 16, + "initialJavascriptGzipBytes": 203816, + "lazyJavascriptFiles": 17, + "lazyJavascriptGzipBytes": 28413 }, "loadBefore": [ - 25.05, - 16.88, - 7.75 + 2.97, + 7.82, + 8.57 ], "loadAfter": [ - 26.4, - 17.3, - 7.93 + 2.97, + 7.82, + 8.57 ] }, { @@ -53,29 +60,29 @@ "tsc": { "passed": true, "firstError": null, - "files": 840, - "types": 284678, - "symbols": 802946, - "instantiations": 712089, - "memoryKb": 520395, - "wallMs": 3930 + "files": 844, + "types": 287435, + "symbols": 794593, + "instantiations": 721205, + "memoryKb": 521779, + "wallMs": 789 }, "build": { - "wallMs": 1526, - "initialJavascriptFiles": 13, - "initialJavascriptGzipBytes": 200001, - "lazyJavascriptFiles": 14, - "lazyJavascriptGzipBytes": 24938 + "wallMs": 400, + "initialJavascriptFiles": 16, + "initialJavascriptGzipBytes": 203816, + "lazyJavascriptFiles": 17, + "lazyJavascriptGzipBytes": 28413 }, "loadBefore": [ - 26.4, - 17.3, - 7.93 + 2.97, + 7.82, + 8.57 ], "loadAfter": [ - 27.65, - 17.71, - 8.12 + 2.97, + 7.82, + 8.57 ] }, { @@ -85,29 +92,29 @@ "tsc": { "passed": true, "firstError": null, - "files": 1366, - "types": 1055723, - "symbols": 2831441, - "instantiations": 3579093, - "memoryKb": 1422337, - "wallMs": 8121 + "files": 1395, + "types": 1062647, + "symbols": 2897351, + "instantiations": 3645516, + "memoryKb": 1438408, + "wallMs": 2362 }, "build": { - "wallMs": 1676, - "initialJavascriptFiles": 39, - "initialJavascriptGzipBytes": 274493, - "lazyJavascriptFiles": 165, - "lazyJavascriptGzipBytes": 171638 + "wallMs": 556, + "initialJavascriptFiles": 16, + "initialJavascriptGzipBytes": 219508, + "lazyJavascriptFiles": 218, + "lazyJavascriptGzipBytes": 239901 }, "loadBefore": [ - 27.65, - 17.71, - 8.12 + 3.13, + 7.78, + 8.55 ], "loadAfter": [ - 27.17, - 17.93, - 8.29 + 3.13, + 7.78, + 8.55 ] }, { @@ -117,29 +124,29 @@ "tsc": { "passed": true, "firstError": null, - "files": 1366, - "types": 1055723, - "symbols": 2831441, - "instantiations": 3579093, - "memoryKb": 1422431, - "wallMs": 8714 + "files": 1395, + "types": 1062647, + "symbols": 2897351, + "instantiations": 3645516, + "memoryKb": 1438614, + "wallMs": 2453 }, "build": { - "wallMs": 2140, - "initialJavascriptFiles": 39, - "initialJavascriptGzipBytes": 274493, - "lazyJavascriptFiles": 165, - "lazyJavascriptGzipBytes": 171638 + "wallMs": 546, + "initialJavascriptFiles": 16, + "initialJavascriptGzipBytes": 219508, + "lazyJavascriptFiles": 218, + "lazyJavascriptGzipBytes": 239901 }, "loadBefore": [ - 27.17, - 17.93, - 8.29 + 3.13, + 7.78, + 8.55 ], "loadAfter": [ - 27.55, - 18.46, - 8.62 + 3.2, + 7.71, + 8.52 ] }, { @@ -149,61 +156,61 @@ "tsc": { "passed": true, "firstError": null, - "files": 2941, - "types": 3349868, - "symbols": 8940533, - "instantiations": 12157304, - "memoryKb": 4195900, - "wallMs": 31315 + "files": 3045, + "types": 3373621, + "symbols": 9115707, + "instantiations": 12392128, + "memoryKb": 4264554, + "wallMs": 8403 }, "build": { - "wallMs": 6010, - "initialJavascriptFiles": 114, - "initialJavascriptGzipBytes": 490658, - "lazyJavascriptFiles": 615, - "lazyJavascriptGzipBytes": 704938 + "wallMs": 944, + "initialJavascriptFiles": 16, + "initialJavascriptGzipBytes": 264841, + "lazyJavascriptFiles": 818, + "lazyJavascriptGzipBytes": 873479 }, "loadBefore": [ - 27.43, - 18.59, + 3.2, + 7.71, + 8.52 + ], + "loadAfter": [ + 6.72, + 8.32, + 8.71 + ] + }, + { + "repeat": 2, + "addedFeatures": 100, + "routes": 410, + "tsc": { + "passed": true, + "firstError": null, + "files": 3045, + "types": 3373621, + "symbols": 9115707, + "instantiations": 12392128, + "memoryKb": 4263823, + "wallMs": 9717 + }, + "build": { + "wallMs": 933, + "initialJavascriptFiles": 16, + "initialJavascriptGzipBytes": 264841, + "lazyJavascriptFiles": 818, + "lazyJavascriptGzipBytes": 873479 + }, + "loadBefore": [ + 6.72, + 8.32, 8.71 ], "loadAfter": [ - 29.72, - 20.12, - 9.64 - ] - }, - { - "repeat": 2, - "addedFeatures": 100, - "routes": 410, - "tsc": { - "passed": true, - "firstError": null, - "files": 2941, - "types": 3349868, - "symbols": 8940533, - "instantiations": 12157304, - "memoryKb": 4195704, - "wallMs": 43234 - }, - "build": { - "wallMs": 3702, - "initialJavascriptFiles": 114, - "initialJavascriptGzipBytes": 490658, - "lazyJavascriptFiles": 615, - "lazyJavascriptGzipBytes": 704938 - }, - "loadBefore": [ - 29.72, - 20.12, - 9.64 - ], - "loadAfter": [ - 35.75, - 22.97, - 11.09 + 6.3, + 8.17, + 8.66 ] } ] diff --git a/config/security/dependency-baseline.approval.json b/config/security/dependency-baseline.approval.json index 9ee247b5..0ed6a64c 100644 --- a/config/security/dependency-baseline.approval.json +++ b/config/security/dependency-baseline.approval.json @@ -1,7 +1,7 @@ { "schemaVersion": 1, - "snapshotDigest": "ce4fa9b7944f27553067228bd6c9e73e7dc05875c283255b50d7eb3ad2923f6d", - "owner": "frontend-platform", - "reason": "RP-11-initial-transitive-inventory", - "approvedAt": "2026-07-26T08:27:17.874Z" + "snapshotDigest": "1be535686bed2315cc986f51b991b269c359ce1dca34d47faee6d35b0d57cfd3", + "owner": "DongHyeonka", + "reason": "1103/13-03 dev-only advisory fixes: vite 8.1.6, vitest and coverage-v8 4.1.12, storybook 10.6.5, in-range updates of undici, brace-expansion, nanoid, source-map-js, postcss", + "approvedAt": "2026-11-04T13:27:48.076Z" } diff --git a/config/security/dependency-baseline.json b/config/security/dependency-baseline.json index fe775508..f77c911d 100644 --- a/config/security/dependency-baseline.json +++ b/config/security/dependency-baseline.json @@ -1,8 +1,8 @@ { "schemaVersion": 2, "packageManager": "pnpm@11.17.0", - "lockfileSha256": "bedf1bbc1007a7cf0dbc6d29b1f4da0a3296717d5969c7fabc4a2844d949ae21", - "dependencyCount": 561, + "lockfileSha256": "3a818cf0ea62509ded18f9989e0df6704eb1258b8caa9543f9b227fe91fb6d30", + "dependencyCount": 562, "directDependencyCount": 35, "dependencies": [ { @@ -12,8 +12,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-6OzddxPio9UiWTCemp4N8cYLV2ZN1ncRnV1cVGtve7dhPOtRkleRyx32GQCYSwDYgaHU3USMm84tNsvKzRCa1Q==" + "integrity": "sha512-6OzddxPio9UiWTCemp4N8cYLV2ZN1ncRnV1cVGtve7dhPOtRkleRyx32GQCYSwDYgaHU3USMm84tNsvKzRCa1Q==", + "dependencies": [] }, { "name": "@asamuzakjp/css-color", @@ -22,14 +22,14 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-KVw6qIiCTUQhByfTd78h2yD1/00waTmm9uy/R7Ck/ctUyAPj+AEDLkQIdJW0T8+qGgj3j5bpNKK7Q3G+LedJWg==", "dependencies": [ "@asamuzakjp/generational-cache@1.0.1", "@csstools/css-calc@3.3.0", "@csstools/css-color-parser@4.1.10", "@csstools/css-parser-algorithms@4.0.0", "@csstools/css-tokenizer@4.0.0" - ], - "integrity": "sha512-KVw6qIiCTUQhByfTd78h2yD1/00waTmm9uy/R7Ck/ctUyAPj+AEDLkQIdJW0T8+qGgj3j5bpNKK7Q3G+LedJWg==" + ] }, { "name": "@asamuzakjp/dom-selector", @@ -38,14 +38,14 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-67RZDnYRc8H/8MLDgQCDE//zoqVFwajkepHZgmXrbwybzXOEwOWGPYGmALYl9J2DOLfFPPs6kKCqmbzV895hTQ==", "dependencies": [ "@asamuzakjp/generational-cache@1.0.1", "@asamuzakjp/nwsapi@2.3.9", "bidi-js@1.0.3", "css-tree@3.2.1", "is-potential-custom-element-name@1.0.1" - ], - "integrity": "sha512-67RZDnYRc8H/8MLDgQCDE//zoqVFwajkepHZgmXrbwybzXOEwOWGPYGmALYl9J2DOLfFPPs6kKCqmbzV895hTQ==" + ] }, { "name": "@asamuzakjp/generational-cache", @@ -54,8 +54,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-wajfB8KqzMCN2KGNFdLkReeHncd0AslUSrvHVvvYWuU8ghncRJoA50kT3zP9MVL0+9g4/67H+cdvBskj9THPzg==" + "integrity": "sha512-wajfB8KqzMCN2KGNFdLkReeHncd0AslUSrvHVvvYWuU8ghncRJoA50kT3zP9MVL0+9g4/67H+cdvBskj9THPzg==", + "dependencies": [] }, { "name": "@asamuzakjp/nwsapi", @@ -64,8 +64,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-n8GuYSrI9bF7FFZ/SjhwevlHc8xaVlb/7HmHelnc/PZXBD2ZR49NnN9sMMuDdEGPeeRQ5d0hqlSlEpgCX3Wl0Q==" + "integrity": "sha512-n8GuYSrI9bF7FFZ/SjhwevlHc8xaVlb/7HmHelnc/PZXBD2ZR49NnN9sMMuDdEGPeeRQ5d0hqlSlEpgCX3Wl0Q==", + "dependencies": [] }, { "name": "@axe-core/playwright", @@ -74,11 +74,11 @@ "scope": "development", "optional": false, "license": "MPL-2.0", + "integrity": "sha512-rMd7xriptqKpP+w5265i4Hdkv2X5kbu6uiBi/B2I7uf3hieRBM3qDCfaKPtxfiYb2mKXfF+yLODJwIx+Jv1GDw==", "dependencies": [ "axe-core@4.12.1", "playwright-core@1.62.0" - ], - "integrity": "sha512-rMd7xriptqKpP+w5265i4Hdkv2X5kbu6uiBi/B2I7uf3hieRBM3qDCfaKPtxfiYb2mKXfF+yLODJwIx+Jv1GDw==" + ] }, { "name": "@babel/code-frame", @@ -87,12 +87,12 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", "dependencies": [ "@babel/helper-validator-identifier@7.29.7", "js-tokens@4.0.0", "picocolors@1.1.1" - ], - "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==" + ] }, { "name": "@babel/code-frame", @@ -101,11 +101,11 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-dYYg153EyN2Ekbqw2zAsbd6/JR+9N2SEoC7YV2GyyqMM7x9bLDTjBD6XBhSMLH0wtIVyJj03jWNriQhaN+eoCw==", "dependencies": [ "@babel/helper-validator-identifier@8.0.4", "js-tokens@10.0.0" - ], - "integrity": "sha512-dYYg153EyN2Ekbqw2zAsbd6/JR+9N2SEoC7YV2GyyqMM7x9bLDTjBD6XBhSMLH0wtIVyJj03jWNriQhaN+eoCw==" + ] }, { "name": "@babel/compat-data", @@ -114,8 +114,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==" + "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==", + "dependencies": [] }, { "name": "@babel/compat-data", @@ -124,8 +124,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-DOjnob/cXOUgDOozCDeq/aK2p5y8dUIVdf6tNhEV1HQRd6I8aQ4f4fbtHRVEvb6lP3BGomrKHiS8ICAASSVQSw==" + "integrity": "sha512-DOjnob/cXOUgDOozCDeq/aK2p5y8dUIVdf6tNhEV1HQRd6I8aQ4f4fbtHRVEvb6lP3BGomrKHiS8ICAASSVQSw==", + "dependencies": [] }, { "name": "@babel/core", @@ -134,6 +134,7 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==", "dependencies": [ "@babel/code-frame@7.29.7", "@babel/generator@7.29.7", @@ -150,8 +151,7 @@ "gensync@1.0.0-beta.2", "json5@2.2.3", "semver@6.3.1" - ], - "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==" + ] }, { "name": "@babel/core", @@ -160,6 +160,7 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-5FgxM4dLQpMJHSiVATk8foW263dVHQHBVpXYiimNECVWG01f4nFyEbQixeT6Mwvg7TayREJ2gpKl3o2RoMdnqw==", "dependencies": [ "@babel/code-frame@8.0.0", "@babel/generator@8.0.0", @@ -177,8 +178,7 @@ "json5@2.2.3", "obug@2.1.4", "semver@7.8.5" - ], - "integrity": "sha512-5FgxM4dLQpMJHSiVATk8foW263dVHQHBVpXYiimNECVWG01f4nFyEbQixeT6Mwvg7TayREJ2gpKl3o2RoMdnqw==" + ] }, { "name": "@babel/eslint-parser", @@ -187,14 +187,14 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-2javO8pAQv/ld6sS6OcxoLAlzZEZy+xm99bnoAfMhzKSumKhdF5wylpbZB7XTorWr3KLPtx5K95eduJPOy1mzA==", "dependencies": [ "@babel/core@8.0.1", "eslint-scope@9.1.2", "eslint-visitor-keys@5.0.1", "eslint@10.8.0", "semver@7.8.5" - ], - "integrity": "sha512-2javO8pAQv/ld6sS6OcxoLAlzZEZy+xm99bnoAfMhzKSumKhdF5wylpbZB7XTorWr3KLPtx5K95eduJPOy1mzA==" + ] }, { "name": "@babel/generator", @@ -203,14 +203,14 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ==", "dependencies": [ "@babel/parser@7.29.7", "@babel/types@7.29.7", "@jridgewell/gen-mapping@0.3.13", "@jridgewell/trace-mapping@0.3.31", "jsesc@3.1.0" - ], - "integrity": "sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ==" + ] }, { "name": "@babel/generator", @@ -219,6 +219,7 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-NT9NrVwJsbSV6Y2FSstWa71EETOnzrjkL5/wX3D2mYHtKM+qvqB1DvR4D0Setb/gDBsHzRICifwEWMO8CnTF6g==", "dependencies": [ "@babel/parser@8.0.4", "@babel/types@8.0.4", @@ -226,8 +227,7 @@ "@jridgewell/trace-mapping@0.3.31", "@types/jsesc@2.5.1", "jsesc@3.1.0" - ], - "integrity": "sha512-NT9NrVwJsbSV6Y2FSstWa71EETOnzrjkL5/wX3D2mYHtKM+qvqB1DvR4D0Setb/gDBsHzRICifwEWMO8CnTF6g==" + ] }, { "name": "@babel/helper-compilation-targets", @@ -236,14 +236,14 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==", "dependencies": [ "@babel/compat-data@7.29.7", "@babel/helper-validator-option@7.29.7", "browserslist@4.28.7", "lru-cache@5.1.1", "semver@6.3.1" - ], - "integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==" + ] }, { "name": "@babel/helper-compilation-targets", @@ -252,14 +252,14 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-JwculLABZvyPvyLBpwU/E/IbH2uM3mnxNtIJpxnIfb24y1PrdVxK5Dqjle4DpgqpGRnwgC7G8IkzPdSXZrO1Ew==", "dependencies": [ "@babel/compat-data@8.0.0", "@babel/helper-validator-option@8.0.0", "browserslist@4.28.7", "lru-cache@11.5.2", "semver@7.8.5" - ], - "integrity": "sha512-JwculLABZvyPvyLBpwU/E/IbH2uM3mnxNtIJpxnIfb24y1PrdVxK5Dqjle4DpgqpGRnwgC7G8IkzPdSXZrO1Ew==" + ] }, { "name": "@babel/helper-globals", @@ -268,8 +268,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==" + "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==", + "dependencies": [] }, { "name": "@babel/helper-globals", @@ -278,8 +278,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-lLozHOM6sWWlxNo8CYqHy4MBZeTvHXNgVPBfPOGsjPKUzHC2Az9QwB6gxdQmpwHl6GlQtbGgS+lj5887guDiLw==" + "integrity": "sha512-lLozHOM6sWWlxNo8CYqHy4MBZeTvHXNgVPBfPOGsjPKUzHC2Az9QwB6gxdQmpwHl6GlQtbGgS+lj5887guDiLw==", + "dependencies": [] }, { "name": "@babel/helper-module-imports", @@ -288,11 +288,11 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==", "dependencies": [ "@babel/traverse@7.29.7", "@babel/types@7.29.7" - ], - "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==" + ] }, { "name": "@babel/helper-module-transforms", @@ -301,13 +301,13 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==", "dependencies": [ "@babel/core@7.29.7", "@babel/helper-module-imports@7.29.7", "@babel/helper-validator-identifier@7.29.7", "@babel/traverse@7.29.7" - ], - "integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==" + ] }, { "name": "@babel/helper-plugin-utils", @@ -316,10 +316,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-3PKFgjTyPlhFhorfP+SjKQxLViIL++zWjFOO4hGriYU+Bsm983DxEM1JmDRJVWXV0O9npu+xXRqz7Pbd3mh70g==", "dependencies": [ "@babel/core@8.0.1" - ], - "integrity": "sha512-3PKFgjTyPlhFhorfP+SjKQxLViIL++zWjFOO4hGriYU+Bsm983DxEM1JmDRJVWXV0O9npu+xXRqz7Pbd3mh70g==" + ] }, { "name": "@babel/helper-string-parser", @@ -328,8 +328,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==" + "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==", + "dependencies": [] }, { "name": "@babel/helper-string-parser", @@ -338,8 +338,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-6mJgmFFFIIO82vvoLt9XtRC7/TkzXfts1t/SpRX4IHSzMgqoPYCWesVu1udUPUWioAE/2fcG6WuI8zrkE1gwrg==" + "integrity": "sha512-6mJgmFFFIIO82vvoLt9XtRC7/TkzXfts1t/SpRX4IHSzMgqoPYCWesVu1udUPUWioAE/2fcG6WuI8zrkE1gwrg==", + "dependencies": [] }, { "name": "@babel/helper-validator-identifier", @@ -348,8 +348,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==" + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", + "dependencies": [] }, { "name": "@babel/helper-validator-identifier", @@ -358,8 +358,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-4wFaiLd0bVo4cIoTXI3zKI038NIWE/cr3jvBjejOVYVxV/m8Ltav1USiGzG1fmS5J2RhgEOgXNNK46cRPnRsrg==" + "integrity": "sha512-4wFaiLd0bVo4cIoTXI3zKI038NIWE/cr3jvBjejOVYVxV/m8Ltav1USiGzG1fmS5J2RhgEOgXNNK46cRPnRsrg==", + "dependencies": [] }, { "name": "@babel/helper-validator-option", @@ -368,8 +368,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==" + "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==", + "dependencies": [] }, { "name": "@babel/helper-validator-option", @@ -378,8 +378,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-U4Dybxh4WESWHt5XhBeExi4DrY0/DNK1aHpQbsrQXCUbFHuMweT0TpLEWKvaraV2Y6fS+ZXunsZ8zIuZIgvF2Q==" + "integrity": "sha512-U4Dybxh4WESWHt5XhBeExi4DrY0/DNK1aHpQbsrQXCUbFHuMweT0TpLEWKvaraV2Y6fS+ZXunsZ8zIuZIgvF2Q==", + "dependencies": [] }, { "name": "@babel/helpers", @@ -388,11 +388,11 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg==", "dependencies": [ "@babel/template@7.29.7", "@babel/types@7.29.7" - ], - "integrity": "sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg==" + ] }, { "name": "@babel/helpers", @@ -401,11 +401,11 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-wfbi91pM3py96oIiJEz7qIpyXDytgr9zQC1HEWwlGNVRAEmItuU/0a41ZUKu1sJGyhhOIpc4t5vk4PYzt8wpsg==", "dependencies": [ "@babel/template@8.0.0", "@babel/types@8.0.4" - ], - "integrity": "sha512-wfbi91pM3py96oIiJEz7qIpyXDytgr9zQC1HEWwlGNVRAEmItuU/0a41ZUKu1sJGyhhOIpc4t5vk4PYzt8wpsg==" + ] }, { "name": "@babel/parser", @@ -414,10 +414,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==", "dependencies": [ "@babel/types@7.29.7" - ], - "integrity": "sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==" + ] }, { "name": "@babel/parser", @@ -426,10 +426,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-srpptsAkEbbNIC/q8nT7o+m6CQe8CJUTV/t7MYc9NnWlgYVtHOb7JH6SorxMhN0kuRJjVqXbKClG6xSbPtzz+g==", "dependencies": [ "@babel/types@8.0.4" - ], - "integrity": "sha512-srpptsAkEbbNIC/q8nT7o+m6CQe8CJUTV/t7MYc9NnWlgYVtHOb7JH6SorxMhN0kuRJjVqXbKClG6xSbPtzz+g==" + ] }, { "name": "@babel/plugin-syntax-jsx", @@ -438,11 +438,11 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-n0jtCOxEovhU7METqSQjcZO9pX53nu9uNIjMS+hEt+Nt9jA7oOZoBIgbCxhhASmF6T6rPDGge5UAvh6Z4eFz/g==", "dependencies": [ "@babel/core@8.0.1", "@babel/helper-plugin-utils@8.0.1" - ], - "integrity": "sha512-n0jtCOxEovhU7METqSQjcZO9pX53nu9uNIjMS+hEt+Nt9jA7oOZoBIgbCxhhASmF6T6rPDGge5UAvh6Z4eFz/g==" + ] }, { "name": "@babel/plugin-syntax-typescript", @@ -451,11 +451,11 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-jmTPwps7oSQSZaV1SxkQ3C12UWyufGysGc5OzDpZzvPAIX4mO7dJT3hoqkWVrSImvkcMiknir1iLN1SNV/CZzg==", "dependencies": [ "@babel/core@8.0.1", "@babel/helper-plugin-utils@8.0.1" - ], - "integrity": "sha512-jmTPwps7oSQSZaV1SxkQ3C12UWyufGysGc5OzDpZzvPAIX4mO7dJT3hoqkWVrSImvkcMiknir1iLN1SNV/CZzg==" + ] }, { "name": "@babel/runtime", @@ -464,8 +464,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==" + "integrity": "sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==", + "dependencies": [] }, { "name": "@babel/template", @@ -474,12 +474,12 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==", "dependencies": [ "@babel/code-frame@7.29.7", "@babel/parser@7.29.7", "@babel/types@7.29.7" - ], - "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==" + ] }, { "name": "@babel/template", @@ -488,12 +488,12 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-eAD0QW/AlbamBbw0FeGiwasbCVPq5ncW0HNVyLP3B9czqLyh4gvw+5JTSNt6le9+ziAU7mqDZsKTHf3jTb4chQ==", "dependencies": [ "@babel/code-frame@8.0.0", "@babel/parser@8.0.4", "@babel/types@8.0.4" - ], - "integrity": "sha512-eAD0QW/AlbamBbw0FeGiwasbCVPq5ncW0HNVyLP3B9czqLyh4gvw+5JTSNt6le9+ziAU7mqDZsKTHf3jTb4chQ==" + ] }, { "name": "@babel/traverse", @@ -502,6 +502,7 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-EhlfNQtZ+NK22w5BM61ciuiq1m58ed33Wr1Xan//ZRTy6hgjnwyCffRYwzsGXdASJSUJ1guZILsErh1eQcl+zw==", "dependencies": [ "@babel/code-frame@7.29.7", "@babel/generator@7.29.7", @@ -510,8 +511,7 @@ "@babel/template@7.29.7", "@babel/types@7.29.7", "debug@4.4.3" - ], - "integrity": "sha512-EhlfNQtZ+NK22w5BM61ciuiq1m58ed33Wr1Xan//ZRTy6hgjnwyCffRYwzsGXdASJSUJ1guZILsErh1eQcl+zw==" + ] }, { "name": "@babel/traverse", @@ -520,6 +520,7 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-bZnmqzGG8UZneG1lLxBoWIH0G6Gr1D846Yu4/3XnY6FhCndMR49u26nTY08u/dAxWmLWF9vGQOuC+84FfIUoeg==", "dependencies": [ "@babel/code-frame@8.0.0", "@babel/generator@8.0.0", @@ -528,8 +529,7 @@ "@babel/template@8.0.0", "@babel/types@8.0.4", "obug@2.1.4" - ], - "integrity": "sha512-bZnmqzGG8UZneG1lLxBoWIH0G6Gr1D846Yu4/3XnY6FhCndMR49u26nTY08u/dAxWmLWF9vGQOuC+84FfIUoeg==" + ] }, { "name": "@babel/types", @@ -538,11 +538,11 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==", "dependencies": [ "@babel/helper-string-parser@7.29.7", "@babel/helper-validator-identifier@7.29.7" - ], - "integrity": "sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==" + ] }, { "name": "@babel/types", @@ -551,11 +551,11 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-eY+Yn3dCqTGmyiq2QRU66lA5FL8lqqqvecHt0fF3uHONIa7ToYsaCiWV8lOKqAs0Rb2SjixiKFROngnulPtt2g==", "dependencies": [ "@babel/helper-string-parser@8.0.0", "@babel/helper-validator-identifier@8.0.4" - ], - "integrity": "sha512-eY+Yn3dCqTGmyiq2QRU66lA5FL8lqqqvecHt0fF3uHONIa7ToYsaCiWV8lOKqAs0Rb2SjixiKFROngnulPtt2g==" + ] }, { "name": "@bcoe/v8-coverage", @@ -564,8 +564,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==" + "integrity": "sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==", + "dependencies": [] }, { "name": "@bramus/specificity", @@ -574,10 +574,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-ctxtJ/eA+t+6q2++vj5j7FYX3nRu311q1wfYH3xjlLOsczhlhxAg2FWNUXhpGvAw3BWo1xBcvOV6/YLc2r5FJw==", "dependencies": [ "css-tree@3.2.1" - ], - "integrity": "sha512-ctxtJ/eA+t+6q2++vj5j7FYX3nRu311q1wfYH3xjlLOsczhlhxAg2FWNUXhpGvAw3BWo1xBcvOV6/YLc2r5FJw==" + ] }, { "name": "@csstools/color-helpers", @@ -586,8 +586,8 @@ "scope": "development", "optional": false, "license": "MIT-0", - "dependencies": [], - "integrity": "sha512-064IFJdjTfUqnjpCVpMOdbr8FLQBhinbZj6yRv2An2E41O/pLEXqfFRWqGq/SxlE5PEUYTlvWsG2r8MswAVvkg==" + "integrity": "sha512-064IFJdjTfUqnjpCVpMOdbr8FLQBhinbZj6yRv2An2E41O/pLEXqfFRWqGq/SxlE5PEUYTlvWsG2r8MswAVvkg==", + "dependencies": [] }, { "name": "@csstools/css-calc", @@ -596,11 +596,11 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-c5ihYsPkdG6JCkU2zTMm4+k6r7RXuGxtWYhu5DHMIiF1FHzrfmHL5so11AoFpUv/tu61xfcmT4AmKoFfMPoqdQ==", "dependencies": [ "@csstools/css-parser-algorithms@4.0.0", "@csstools/css-tokenizer@4.0.0" - ], - "integrity": "sha512-c5ihYsPkdG6JCkU2zTMm4+k6r7RXuGxtWYhu5DHMIiF1FHzrfmHL5so11AoFpUv/tu61xfcmT4AmKoFfMPoqdQ==" + ] }, { "name": "@csstools/css-color-parser", @@ -609,13 +609,13 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-UZhQLIUyJaaMepqehrCODwCg2KW25vFvLWBmqYFaPclYvvxzj/sG8LBOhBFCp11i9uE7t1EyS+RAoV9tztPFyw==", "dependencies": [ "@csstools/color-helpers@6.1.0", "@csstools/css-calc@3.3.0", "@csstools/css-parser-algorithms@4.0.0", "@csstools/css-tokenizer@4.0.0" - ], - "integrity": "sha512-UZhQLIUyJaaMepqehrCODwCg2KW25vFvLWBmqYFaPclYvvxzj/sG8LBOhBFCp11i9uE7t1EyS+RAoV9tztPFyw==" + ] }, { "name": "@csstools/css-parser-algorithms", @@ -624,10 +624,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-+B87qS7fIG3L5h3qwJ/IFbjoVoOe/bpOdh9hAjXbvx0o8ImEmUsGXN0inFOnk2ChCFgqkkGFQ+TpM5rbhkKe4w==", "dependencies": [ "@csstools/css-tokenizer@4.0.0" - ], - "integrity": "sha512-+B87qS7fIG3L5h3qwJ/IFbjoVoOe/bpOdh9hAjXbvx0o8ImEmUsGXN0inFOnk2ChCFgqkkGFQ+TpM5rbhkKe4w==" + ] }, { "name": "@csstools/css-syntax-patches-for-csstree", @@ -636,10 +636,10 @@ "scope": "development", "optional": false, "license": "MIT-0", + "integrity": "sha512-fQ+05118eQS1cofO3aJpB5efgpBZMvIzwr/sbC8kDLVA5XLG8q1kJV5yzrUAI1f7lvhPnm8fgIjzFB8/O/5Dig==", "dependencies": [ "css-tree@3.2.1" - ], - "integrity": "sha512-fQ+05118eQS1cofO3aJpB5efgpBZMvIzwr/sbC8kDLVA5XLG8q1kJV5yzrUAI1f7lvhPnm8fgIjzFB8/O/5Dig==" + ] }, { "name": "@csstools/css-tokenizer", @@ -648,8 +648,21 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-QxULHAm7cNu72w97JUNCBFODFaXpbDg+dP8b/oWFAZ2MTRppA3U00Y2L1HqaS4J6yBqxwa/Y3nMBaxVKbB/NsA==" + "integrity": "sha512-QxULHAm7cNu72w97JUNCBFODFaXpbDg+dP8b/oWFAZ2MTRppA3U00Y2L1HqaS4J6yBqxwa/Y3nMBaxVKbB/NsA==", + "dependencies": [] + }, + { + "name": "@emnapi/core", + "version": "1.11.0", + "direct": false, + "scope": "development", + "optional": true, + "license": "NOASSERTION", + "integrity": "sha512-l9Oo58x0HOP5znGzVhYW9U3e5wVuA4LAZU2AGezTmkhO1CgQRFDhDg4nneHsu/t3WniXg9QrG2nIXL/ZS8ln8Q==", + "dependencies": [ + "@emnapi/wasi-threads@1.2.2", + "tslib@2.8.1" + ] }, { "name": "@emnapi/core", @@ -658,24 +671,11 @@ "scope": "development", "optional": true, "license": "NOASSERTION", + "integrity": "sha512-RSvbQmHzdKzNsLYa/wHrbc3KN4sYLKAdPZxqiM2HATqv/SBk2/ENSHpvXGaLOMcsAyz0poEGqkmmKYG3OWiJEQ==", "dependencies": [ "@emnapi/wasi-threads@1.2.2", "tslib@2.8.1" - ], - "integrity": "sha512-RSvbQmHzdKzNsLYa/wHrbc3KN4sYLKAdPZxqiM2HATqv/SBk2/ENSHpvXGaLOMcsAyz0poEGqkmmKYG3OWiJEQ==" - }, - { - "name": "@emnapi/core", - "version": "1.11.2", - "direct": false, - "scope": "development", - "optional": true, - "license": "NOASSERTION", - "dependencies": [ - "@emnapi/wasi-threads@1.2.2", - "tslib@2.8.1" - ], - "integrity": "sha512-TC8MkTuZUtcTSiFeuC0ksCh9QIJ5+F21MvZ4Wn4ORfYaFJ/0dsiudv5tVkejgwZlwQ39jL9WWDe2lz8x0WglOA==" + ] }, { "name": "@emnapi/core", @@ -684,11 +684,23 @@ "scope": "development", "optional": true, "license": "NOASSERTION", + "integrity": "sha512-UC+ZhH3XtczQYfOlu3lNEkdW/p4dsJ1r/bP7H8+rhao3TTTMO1ATq/4DdIi23XuGoFY+Cz0JmCbdVl0hz9jZcA==", "dependencies": [ "@emnapi/wasi-threads@1.2.1", "tslib@2.8.1" - ], - "integrity": "sha512-UC+ZhH3XtczQYfOlu3lNEkdW/p4dsJ1r/bP7H8+rhao3TTTMO1ATq/4DdIi23XuGoFY+Cz0JmCbdVl0hz9jZcA==" + ] + }, + { + "name": "@emnapi/runtime", + "version": "1.11.0", + "direct": false, + "scope": "development", + "optional": true, + "license": "NOASSERTION", + "integrity": "sha512-55coeOFKHv1ywEcUXJtWU5f+Jr/W5tZDvZig8DLKSwUN1JpROQ4rk/SNOQiFWmaR/VKF4zuFyW1B8JduOSv6Pg==", + "dependencies": [ + "tslib@2.8.1" + ] }, { "name": "@emnapi/runtime", @@ -697,22 +709,10 @@ "scope": "development", "optional": true, "license": "NOASSERTION", + "integrity": "sha512-vgj7R3y3Wgx24IQaGPA/R6YFXLHVMOZ0uVEyIQPaWs+rd1AzfEMXlAC22FYwO1XkKR6NPsq7mUandH8oIRdZFw==", "dependencies": [ "tslib@2.8.1" - ], - "integrity": "sha512-vgj7R3y3Wgx24IQaGPA/R6YFXLHVMOZ0uVEyIQPaWs+rd1AzfEMXlAC22FYwO1XkKR6NPsq7mUandH8oIRdZFw==" - }, - { - "name": "@emnapi/runtime", - "version": "1.11.2", - "direct": false, - "scope": "development", - "optional": true, - "license": "NOASSERTION", - "dependencies": [ - "tslib@2.8.1" - ], - "integrity": "sha512-kyOl3X0DuTiT1h2ft8r2fYO8JYtU9a9Xis/zBSiGArNaagCOWx90N1k2wxp18czFDH+OgcWGb5ZP/XMt3dcyPA==" + ] }, { "name": "@emnapi/runtime", @@ -721,10 +721,10 @@ "scope": "development", "optional": true, "license": "NOASSERTION", + "integrity": "sha512-3U4+MIWHImeyu1wnmVygh5WlgfYDtyf0k8AbLhMFxOipihf6nrWC4syIm/SwEeec0mNSafiiNnMJwbza/Is6Lw==", "dependencies": [ "tslib@2.8.1" - ], - "integrity": "sha512-3U4+MIWHImeyu1wnmVygh5WlgfYDtyf0k8AbLhMFxOipihf6nrWC4syIm/SwEeec0mNSafiiNnMJwbza/Is6Lw==" + ] }, { "name": "@emnapi/wasi-threads", @@ -733,10 +733,10 @@ "scope": "development", "optional": true, "license": "NOASSERTION", + "integrity": "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==", "dependencies": [ "tslib@2.8.1" - ], - "integrity": "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==" + ] }, { "name": "@emnapi/wasi-threads", @@ -745,10 +745,10 @@ "scope": "development", "optional": true, "license": "NOASSERTION", + "integrity": "sha512-c95qOXkHdydNKhscBTebqEC1CVAZpyqOfVfBzQ1qgzyl3gfeldUjIggDbIZgDKsHLgnsM+igH7TJ/eAasaVuMA==", "dependencies": [ "tslib@2.8.1" - ], - "integrity": "sha512-c95qOXkHdydNKhscBTebqEC1CVAZpyqOfVfBzQ1qgzyl3gfeldUjIggDbIZgDKsHLgnsM+igH7TJ/eAasaVuMA==" + ] }, { "name": "@esbuild/aix-ppc64", @@ -757,8 +757,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==" + "integrity": "sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==", + "dependencies": [] }, { "name": "@esbuild/android-arm", @@ -767,8 +767,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==" + "integrity": "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==", + "dependencies": [] }, { "name": "@esbuild/android-arm64", @@ -777,8 +777,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==" + "integrity": "sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==", + "dependencies": [] }, { "name": "@esbuild/android-x64", @@ -787,8 +787,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==" + "integrity": "sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==", + "dependencies": [] }, { "name": "@esbuild/darwin-arm64", @@ -797,8 +797,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==" + "integrity": "sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==", + "dependencies": [] }, { "name": "@esbuild/darwin-x64", @@ -807,8 +807,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==" + "integrity": "sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==", + "dependencies": [] }, { "name": "@esbuild/freebsd-arm64", @@ -817,8 +817,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==" + "integrity": "sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==", + "dependencies": [] }, { "name": "@esbuild/freebsd-x64", @@ -827,8 +827,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==" + "integrity": "sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==", + "dependencies": [] }, { "name": "@esbuild/linux-arm", @@ -837,8 +837,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==" + "integrity": "sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==", + "dependencies": [] }, { "name": "@esbuild/linux-arm64", @@ -847,8 +847,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==" + "integrity": "sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==", + "dependencies": [] }, { "name": "@esbuild/linux-ia32", @@ -857,8 +857,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==" + "integrity": "sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==", + "dependencies": [] }, { "name": "@esbuild/linux-loong64", @@ -867,8 +867,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==" + "integrity": "sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==", + "dependencies": [] }, { "name": "@esbuild/linux-mips64el", @@ -877,8 +877,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==" + "integrity": "sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==", + "dependencies": [] }, { "name": "@esbuild/linux-ppc64", @@ -887,8 +887,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==" + "integrity": "sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==", + "dependencies": [] }, { "name": "@esbuild/linux-riscv64", @@ -897,8 +897,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==" + "integrity": "sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==", + "dependencies": [] }, { "name": "@esbuild/linux-s390x", @@ -907,8 +907,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==" + "integrity": "sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==", + "dependencies": [] }, { "name": "@esbuild/linux-x64", @@ -917,8 +917,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==" + "integrity": "sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==", + "dependencies": [] }, { "name": "@esbuild/netbsd-arm64", @@ -927,8 +927,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==" + "integrity": "sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==", + "dependencies": [] }, { "name": "@esbuild/netbsd-x64", @@ -937,8 +937,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==" + "integrity": "sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==", + "dependencies": [] }, { "name": "@esbuild/openbsd-arm64", @@ -947,8 +947,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==" + "integrity": "sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==", + "dependencies": [] }, { "name": "@esbuild/openbsd-x64", @@ -957,8 +957,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==" + "integrity": "sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==", + "dependencies": [] }, { "name": "@esbuild/openharmony-arm64", @@ -967,8 +967,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==" + "integrity": "sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==", + "dependencies": [] }, { "name": "@esbuild/sunos-x64", @@ -977,8 +977,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==" + "integrity": "sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==", + "dependencies": [] }, { "name": "@esbuild/win32-arm64", @@ -987,8 +987,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==" + "integrity": "sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==", + "dependencies": [] }, { "name": "@esbuild/win32-ia32", @@ -997,8 +997,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==" + "integrity": "sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==", + "dependencies": [] }, { "name": "@esbuild/win32-x64", @@ -1007,8 +1007,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==" + "integrity": "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==", + "dependencies": [] }, { "name": "@eslint-community/eslint-utils", @@ -1017,11 +1017,11 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-cuadcxVFE8sDK6iWJbs8Sn0av2Nrh2QSGQhVlBW9AaAHqHwjWsZHT8LJ4hFGPh7ASBV2deFdM7H/DPjulmh8rg==", "dependencies": [ "eslint-visitor-keys@3.4.3", "eslint@10.8.0" - ], - "integrity": "sha512-cuadcxVFE8sDK6iWJbs8Sn0av2Nrh2QSGQhVlBW9AaAHqHwjWsZHT8LJ4hFGPh7ASBV2deFdM7H/DPjulmh8rg==" + ] }, { "name": "@eslint-community/regexpp", @@ -1030,8 +1030,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==" + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", + "dependencies": [] }, { "name": "@eslint/config-array", @@ -1040,12 +1040,12 @@ "scope": "development", "optional": false, "license": "Apache-2.0", + "integrity": "sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA==", "dependencies": [ "@eslint/object-schema@3.0.5", "debug@4.4.3", "minimatch@10.2.5" - ], - "integrity": "sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA==" + ] }, { "name": "@eslint/config-helpers", @@ -1054,10 +1054,10 @@ "scope": "development", "optional": false, "license": "Apache-2.0", + "integrity": "sha512-DObd/KKUsU+FaFv4PLxSRenpXfQWmPXXP3pPZ6/K1PCrMu2vQpMDMuQe/BqYeoLcz8ro0bVDF1RxOJgfVEdhUw==", "dependencies": [ "@eslint/core@1.2.1" - ], - "integrity": "sha512-DObd/KKUsU+FaFv4PLxSRenpXfQWmPXXP3pPZ6/K1PCrMu2vQpMDMuQe/BqYeoLcz8ro0bVDF1RxOJgfVEdhUw==" + ] }, { "name": "@eslint/core", @@ -1066,10 +1066,10 @@ "scope": "development", "optional": false, "license": "Apache-2.0", + "integrity": "sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ==", "dependencies": [ "@types/json-schema@7.0.15" - ], - "integrity": "sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ==" + ] }, { "name": "@eslint/js", @@ -1078,10 +1078,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==", "dependencies": [ "eslint@10.8.0" - ], - "integrity": "sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==" + ] }, { "name": "@eslint/object-schema", @@ -1090,8 +1090,8 @@ "scope": "development", "optional": false, "license": "Apache-2.0", - "dependencies": [], - "integrity": "sha512-vqTaUEgxzm+YDSdElad6PiRoX4t8VGDjCtt05zn4nU810UIx/uNEV7/lZJ6KwFThKZOzOxzXy48da+No7HZaMw==" + "integrity": "sha512-vqTaUEgxzm+YDSdElad6PiRoX4t8VGDjCtt05zn4nU810UIx/uNEV7/lZJ6KwFThKZOzOxzXy48da+No7HZaMw==", + "dependencies": [] }, { "name": "@eslint/plugin-kit", @@ -1100,11 +1100,11 @@ "scope": "development", "optional": false, "license": "Apache-2.0", + "integrity": "sha512-+CNAzxglkrpNf/kKywqQfk74QjtceuOE7Qm+AF8miRvPF/wmmK5+OJOgVh3AVTT3RP2mH3+FOaxlE5v72owk0A==", "dependencies": [ "@eslint/core@1.2.1", "levn@0.4.1" - ], - "integrity": "sha512-+CNAzxglkrpNf/kKywqQfk74QjtceuOE7Qm+AF8miRvPF/wmmK5+OJOgVh3AVTT3RP2mH3+FOaxlE5v72owk0A==" + ] }, { "name": "@exodus/bytes", @@ -1113,8 +1113,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-S6mL0yNB/Abt9Ei4tq8gDhcczc4S3+vQ4ra7vxnAf+YHC02srtqxKKZghx2Dq6p0e66THKwR6r8N6P95wEty7Q==" + "integrity": "sha512-S6mL0yNB/Abt9Ei4tq8gDhcczc4S3+vQ4ra7vxnAf+YHC02srtqxKKZghx2Dq6p0e66THKwR6r8N6P95wEty7Q==", + "dependencies": [] }, { "name": "@humanfs/core", @@ -1123,10 +1123,10 @@ "scope": "development", "optional": false, "license": "Apache-2.0", + "integrity": "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==", "dependencies": [ "@humanfs/types@0.15.0" - ], - "integrity": "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==" + ] }, { "name": "@humanfs/node", @@ -1135,12 +1135,12 @@ "scope": "development", "optional": false, "license": "Apache-2.0", + "integrity": "sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==", "dependencies": [ "@humanfs/core@0.19.2", "@humanfs/types@0.15.0", "@humanwhocodes/retry@0.4.3" - ], - "integrity": "sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==" + ] }, { "name": "@humanfs/types", @@ -1149,8 +1149,8 @@ "scope": "development", "optional": false, "license": "Apache-2.0", - "dependencies": [], - "integrity": "sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==" + "integrity": "sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==", + "dependencies": [] }, { "name": "@humanwhocodes/module-importer", @@ -1159,8 +1159,8 @@ "scope": "development", "optional": false, "license": "Apache-2.0", - "dependencies": [], - "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==" + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dependencies": [] }, { "name": "@humanwhocodes/retry", @@ -1169,8 +1169,8 @@ "scope": "development", "optional": false, "license": "Apache-2.0", - "dependencies": [], - "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==" + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", + "dependencies": [] }, { "name": "@inquirer/ansi", @@ -1179,8 +1179,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-3eTuUO1vH2cZm2ZKHeQxnOqlTi9EfZDGgIe3BL3I4u+rJHocr9Fz86M4fjYABPvFnQG/gGK551HqDiIcETwU6Q==" + "integrity": "sha512-3eTuUO1vH2cZm2ZKHeQxnOqlTi9EfZDGgIe3BL3I4u+rJHocr9Fz86M4fjYABPvFnQG/gGK551HqDiIcETwU6Q==", + "dependencies": [] }, { "name": "@inquirer/confirm", @@ -1189,12 +1189,12 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-eb8DBZcz/2qHWQda4rk2JiQk5h9QV/cVHi1yjt0f69WFZMRFn0sJTye3EAP8icut8UDMjQPsaH5KbcOogefrFQ==", "dependencies": [ "@inquirer/core@11.2.1", "@inquirer/type@4.0.7", "@types/node@24.13.3" - ], - "integrity": "sha512-eb8DBZcz/2qHWQda4rk2JiQk5h9QV/cVHi1yjt0f69WFZMRFn0sJTye3EAP8icut8UDMjQPsaH5KbcOogefrFQ==" + ] }, { "name": "@inquirer/core", @@ -1203,6 +1203,7 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-Qd6GJT1yVyrZZCfN8W2qKF5ApmqryXRhRKCuip8h01x2w/esJQ2XIYc6f9abMIHgKQdBfFTSOdbHRLAhuM09UA==", "dependencies": [ "@inquirer/ansi@2.0.7", "@inquirer/figures@2.0.7", @@ -1212,8 +1213,7 @@ "fast-wrap-ansi@0.2.2", "mute-stream@3.0.0", "signal-exit@4.1.0" - ], - "integrity": "sha512-Qd6GJT1yVyrZZCfN8W2qKF5ApmqryXRhRKCuip8h01x2w/esJQ2XIYc6f9abMIHgKQdBfFTSOdbHRLAhuM09UA==" + ] }, { "name": "@inquirer/figures", @@ -1222,8 +1222,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-aJ8TBPOGB6f/2qziPfElISTCEd5XOYTFckA2SGjhNmiKzfK/u4ot3v0DUzGVdUnKjN10EqnnEPck36BkyfLnJw==" + "integrity": "sha512-aJ8TBPOGB6f/2qziPfElISTCEd5XOYTFckA2SGjhNmiKzfK/u4ot3v0DUzGVdUnKjN10EqnnEPck36BkyfLnJw==", + "dependencies": [] }, { "name": "@inquirer/type", @@ -1232,10 +1232,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-t28inv14nMQ1PhKpsJPY+kEs/c00qzeCOS2gTNRyTjG5d6qsVA2fItxW4hkvGZ5lvanGLdtCzVIx5dwdRpN1+g==", "dependencies": [ "@types/node@24.13.3" - ], - "integrity": "sha512-t28inv14nMQ1PhKpsJPY+kEs/c00qzeCOS2gTNRyTjG5d6qsVA2fItxW4hkvGZ5lvanGLdtCzVIx5dwdRpN1+g==" + ] }, { "name": "@joshwooding/vite-plugin-react-docgen-typescript", @@ -1244,13 +1244,13 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-qvsTEwEFefhdirGOPnu9Wp6ChfIwy2dBCRuETU3uE+4cC+PFoxMSiiEhxk4lOluA34eARHA0OxqsEUYDqRMgeQ==", "dependencies": [ "glob@13.0.6", "react-docgen-typescript@2.4.0", "typescript@7.0.2", - "vite@8.1.5" - ], - "integrity": "sha512-qvsTEwEFefhdirGOPnu9Wp6ChfIwy2dBCRuETU3uE+4cC+PFoxMSiiEhxk4lOluA34eARHA0OxqsEUYDqRMgeQ==" + "vite@8.1.6" + ] }, { "name": "@jridgewell/gen-mapping", @@ -1259,11 +1259,11 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", "dependencies": [ "@jridgewell/sourcemap-codec@1.5.5", "@jridgewell/trace-mapping@0.3.31" - ], - "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==" + ] }, { "name": "@jridgewell/remapping", @@ -1272,11 +1272,11 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", "dependencies": [ "@jridgewell/gen-mapping@0.3.13", "@jridgewell/trace-mapping@0.3.31" - ], - "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==" + ] }, { "name": "@jridgewell/resolve-uri", @@ -1285,8 +1285,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==" + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dependencies": [] }, { "name": "@jridgewell/sourcemap-codec", @@ -1295,8 +1295,18 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==" + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dependencies": [] + }, + { + "name": "@jridgewell/sourcemap-codec", + "version": "1.6.0", + "direct": false, + "scope": "development", + "optional": false, + "license": "MIT", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "dependencies": [] }, { "name": "@jridgewell/trace-mapping", @@ -1305,11 +1315,11 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", "dependencies": [ "@jridgewell/resolve-uri@3.1.2", "@jridgewell/sourcemap-codec@1.5.5" - ], - "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==" + ] }, { "name": "@mswjs/interceptors", @@ -1318,6 +1328,7 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-VVPPgHyQ6ShqnrmDWuxjmUIsO9gWyOZFmuOfLd9LfBGQJwZfy0gvv9pbHSJuoFNIYC7ZDX9aoFwowjcdSC4E8w==", "dependencies": [ "@open-draft/deferred-promise@2.2.0", "@open-draft/logger@0.3.0", @@ -1325,8 +1336,7 @@ "is-node-process@1.2.0", "outvariant@1.4.3", "strict-event-emitter@0.5.1" - ], - "integrity": "sha512-VVPPgHyQ6ShqnrmDWuxjmUIsO9gWyOZFmuOfLd9LfBGQJwZfy0gvv9pbHSJuoFNIYC7ZDX9aoFwowjcdSC4E8w==" + ] }, { "name": "@napi-rs/wasm-runtime", @@ -1335,16 +1345,16 @@ "scope": "development", "optional": true, "license": "NOASSERTION", + "integrity": "sha512-ZLv/JdUfkvOy9eCnnBaGfiO+XimbjebAeO+MRQqD/B+FR1tnRN0tpKSJHRbE8sFfS6aqsXZ67TQjfwfsxULVbg==", "dependencies": [ + "@emnapi/core@1.11.0", "@emnapi/core@1.11.1", - "@emnapi/core@1.11.2", "@emnapi/core@1.9.2", + "@emnapi/runtime@1.11.0", "@emnapi/runtime@1.11.1", - "@emnapi/runtime@1.11.2", "@emnapi/runtime@1.9.2", "@tybys/wasm-util@0.10.3" - ], - "integrity": "sha512-ZLv/JdUfkvOy9eCnnBaGfiO+XimbjebAeO+MRQqD/B+FR1tnRN0tpKSJHRbE8sFfS6aqsXZ67TQjfwfsxULVbg==" + ] }, { "name": "@open-draft/deferred-promise", @@ -1353,8 +1363,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-CecwLWx3rhxVQF6V4bAgPS5t+So2sTbPgAzafKkVizyi7tlwpcFpdFqq+wqF2OwNBmqFuu6tOyouTuxgpMfzmA==" + "integrity": "sha512-CecwLWx3rhxVQF6V4bAgPS5t+So2sTbPgAzafKkVizyi7tlwpcFpdFqq+wqF2OwNBmqFuu6tOyouTuxgpMfzmA==", + "dependencies": [] }, { "name": "@open-draft/deferred-promise", @@ -1363,8 +1373,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-XW375UK8/9SqUVNVa6M0yEy8+iTi4QN5VZ7aZuRFQmy76LRwI9wy5F4YIBU6T+eTe2/DNDo8tqu8RHlwLHM6RA==" + "integrity": "sha512-XW375UK8/9SqUVNVa6M0yEy8+iTi4QN5VZ7aZuRFQmy76LRwI9wy5F4YIBU6T+eTe2/DNDo8tqu8RHlwLHM6RA==", + "dependencies": [] }, { "name": "@open-draft/logger", @@ -1373,11 +1383,11 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-X2g45fzhxH238HKO4xbSr7+wBS8Fvw6ixhTDuvLd5mqh6bJJCFAPwU9mPDxbcrRtfxv4u5IHCEH77BmxvXmmxQ==", "dependencies": [ "is-node-process@1.2.0", "outvariant@1.4.3" - ], - "integrity": "sha512-X2g45fzhxH238HKO4xbSr7+wBS8Fvw6ixhTDuvLd5mqh6bJJCFAPwU9mPDxbcrRtfxv4u5IHCEH77BmxvXmmxQ==" + ] }, { "name": "@open-draft/until", @@ -1386,8 +1396,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==" + "integrity": "sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==", + "dependencies": [] }, { "name": "@oxc-parser/binding-android-arm-eabi", @@ -1396,8 +1406,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-0LC7ye4hvqbIKxAzThzvswgHLFu2AURKzYLeSVvLdu2TBOYWQDmHnTqPLeA597BcUCxiLqLsS4CJ5uoI5WYWCQ==" + "integrity": "sha512-0LC7ye4hvqbIKxAzThzvswgHLFu2AURKzYLeSVvLdu2TBOYWQDmHnTqPLeA597BcUCxiLqLsS4CJ5uoI5WYWCQ==", + "dependencies": [] }, { "name": "@oxc-parser/binding-android-arm64", @@ -1406,8 +1416,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-b5jtVTH6AU5CJXHNdj7Jj9IEiR9yVjjnwHzPJhGyHGPdcsZSzBCkS9GBbV33niRMvKthDwQRFRJfI4a+k4PvYg==" + "integrity": "sha512-b5jtVTH6AU5CJXHNdj7Jj9IEiR9yVjjnwHzPJhGyHGPdcsZSzBCkS9GBbV33niRMvKthDwQRFRJfI4a+k4PvYg==", + "dependencies": [] }, { "name": "@oxc-parser/binding-darwin-arm64", @@ -1416,8 +1426,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-obCE8B7ISKkJidjlhv9xRGJPOSDG2Yu6PRga9Ruaz35uintHxbp1Ki/Yc71wx4rj3Edrm0a1kzG1TAwit0wFpg==" + "integrity": "sha512-obCE8B7ISKkJidjlhv9xRGJPOSDG2Yu6PRga9Ruaz35uintHxbp1Ki/Yc71wx4rj3Edrm0a1kzG1TAwit0wFpg==", + "dependencies": [] }, { "name": "@oxc-parser/binding-darwin-x64", @@ -1426,8 +1436,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-JL6Xb5IwPQT8rUzlpsX7E+AgfcdNklXNPFp8pjCQQ5MQOQo5rtEB2ui+3Hgg9Sn7Y9Egj6YOLLiHhLpdAe12Aw==" + "integrity": "sha512-JL6Xb5IwPQT8rUzlpsX7E+AgfcdNklXNPFp8pjCQQ5MQOQo5rtEB2ui+3Hgg9Sn7Y9Egj6YOLLiHhLpdAe12Aw==", + "dependencies": [] }, { "name": "@oxc-parser/binding-freebsd-x64", @@ -1436,8 +1446,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-SDQ/3MQFw58fqQz3Z1PhSKFF3JoCF4gmlNjziDm8X02tTahCw0qJbd7FGPDKw1i4VTBZene9JPyC3mHtSvi+wA==" + "integrity": "sha512-SDQ/3MQFw58fqQz3Z1PhSKFF3JoCF4gmlNjziDm8X02tTahCw0qJbd7FGPDKw1i4VTBZene9JPyC3mHtSvi+wA==", + "dependencies": [] }, { "name": "@oxc-parser/binding-linux-arm-gnueabihf", @@ -1446,8 +1456,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-Av+D1MIqzV0YMGPT9we2SIZaMKD7Cxs4CvXSx/yxaWHewZjYEjScpOf5igc8IILASViw4WTnjlwUdI1KzVtDHQ==" + "integrity": "sha512-Av+D1MIqzV0YMGPT9we2SIZaMKD7Cxs4CvXSx/yxaWHewZjYEjScpOf5igc8IILASViw4WTnjlwUdI1KzVtDHQ==", + "dependencies": [] }, { "name": "@oxc-parser/binding-linux-arm-musleabihf", @@ -1456,8 +1466,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-Cs2fdJ8cPpFdeebj6p4dag8A4+56hPvZ0AhQQzlaLswGz1tz7bXt1nETLeorrM9+AMcWFFkqxcXwDGfTVidY8g==" + "integrity": "sha512-Cs2fdJ8cPpFdeebj6p4dag8A4+56hPvZ0AhQQzlaLswGz1tz7bXt1nETLeorrM9+AMcWFFkqxcXwDGfTVidY8g==", + "dependencies": [] }, { "name": "@oxc-parser/binding-linux-arm64-gnu", @@ -1466,8 +1476,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-qdOfTcT6SY8gsJrrV92uyEUyjqMGPpIB5JZUG6QN5dukYd+7/j0kX6MwK1DgQj39jtUYixxPiaRUiEN1+0CXgQ==" + "integrity": "sha512-qdOfTcT6SY8gsJrrV92uyEUyjqMGPpIB5JZUG6QN5dukYd+7/j0kX6MwK1DgQj39jtUYixxPiaRUiEN1+0CXgQ==", + "dependencies": [] }, { "name": "@oxc-parser/binding-linux-arm64-musl", @@ -1476,8 +1486,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-EoTCZneNFU/P2qrpEM+RHmQwt+CvDkyGESG6qhr7KaegXLZwePfbrkCDfAk8/rhxbDUVGsZILX+2tqPzFtoFWA==" + "integrity": "sha512-EoTCZneNFU/P2qrpEM+RHmQwt+CvDkyGESG6qhr7KaegXLZwePfbrkCDfAk8/rhxbDUVGsZILX+2tqPzFtoFWA==", + "dependencies": [] }, { "name": "@oxc-parser/binding-linux-ppc64-gnu", @@ -1486,8 +1496,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-zALjmZYgxFLHjXeudcDF0xFGNydTAtkAeXAr2EuC17ywCyFxcmQra4w0BMde0Yi/re4Bi4iwEoEXtYN7l6eBLQ==" + "integrity": "sha512-zALjmZYgxFLHjXeudcDF0xFGNydTAtkAeXAr2EuC17ywCyFxcmQra4w0BMde0Yi/re4Bi4iwEoEXtYN7l6eBLQ==", + "dependencies": [] }, { "name": "@oxc-parser/binding-linux-riscv64-gnu", @@ -1496,8 +1506,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-fPP8M6zQLS7Jz7o9d5ArUSuAuSK3e+WCYVrCpdzeCOejidtZExJ9tjhDrAd3HEPqARBCPmdpqxESPFqy44vkBQ==" + "integrity": "sha512-fPP8M6zQLS7Jz7o9d5ArUSuAuSK3e+WCYVrCpdzeCOejidtZExJ9tjhDrAd3HEPqARBCPmdpqxESPFqy44vkBQ==", + "dependencies": [] }, { "name": "@oxc-parser/binding-linux-riscv64-musl", @@ -1506,8 +1516,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-7IcC4Ao02oGpfnjt+X/oF4U2mllo2qoSkw5xxiXNKL9MCTsTiAC6616beOuehdxGcnz1bRoPC1RQ2f1GQDdN+g==" + "integrity": "sha512-7IcC4Ao02oGpfnjt+X/oF4U2mllo2qoSkw5xxiXNKL9MCTsTiAC6616beOuehdxGcnz1bRoPC1RQ2f1GQDdN+g==", + "dependencies": [] }, { "name": "@oxc-parser/binding-linux-s390x-gnu", @@ -1516,8 +1526,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-pbXIhiNFHoqWeqDNLiJ9JkpHz1IM9k4DXa66x+1GTWMG7iLxtkXgE53iiuKSXwmk3zIYmaPVfBvgcAhS583K4Q==" + "integrity": "sha512-pbXIhiNFHoqWeqDNLiJ9JkpHz1IM9k4DXa66x+1GTWMG7iLxtkXgE53iiuKSXwmk3zIYmaPVfBvgcAhS583K4Q==", + "dependencies": [] }, { "name": "@oxc-parser/binding-linux-x64-gnu", @@ -1526,8 +1536,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-MYCguB9RvBvlSd6gbuNI7QwiLoCCAlGnlRJFPrzLI6U1/9wkC/WK6LtBAUln55H1Ctqw45PWmqrobKoMhsYQzQ==" + "integrity": "sha512-MYCguB9RvBvlSd6gbuNI7QwiLoCCAlGnlRJFPrzLI6U1/9wkC/WK6LtBAUln55H1Ctqw45PWmqrobKoMhsYQzQ==", + "dependencies": [] }, { "name": "@oxc-parser/binding-linux-x64-musl", @@ -1536,8 +1546,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-5eY0B/bxf1xIUxb4NOTvOI3KWtBQfPWYyKAzgcrCt0mDibSZygVpO1Pz8bkeiSZ5Jj9+M09dkggG3H8I5d0Uyg==" + "integrity": "sha512-5eY0B/bxf1xIUxb4NOTvOI3KWtBQfPWYyKAzgcrCt0mDibSZygVpO1Pz8bkeiSZ5Jj9+M09dkggG3H8I5d0Uyg==", + "dependencies": [] }, { "name": "@oxc-parser/binding-openharmony-arm64", @@ -1546,8 +1556,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-Gld0ajrFTUXNtdw20fVBuTQx66FA75nIVg+//pPfR3sXkuABB4mTBhl3r9JNzrJpgW//qiwxf0nWXUWGJSL3UQ==" + "integrity": "sha512-Gld0ajrFTUXNtdw20fVBuTQx66FA75nIVg+//pPfR3sXkuABB4mTBhl3r9JNzrJpgW//qiwxf0nWXUWGJSL3UQ==", + "dependencies": [] }, { "name": "@oxc-parser/binding-wasm32-wasi", @@ -1556,12 +1566,12 @@ "scope": "development", "optional": true, "license": "NOASSERTION", + "integrity": "sha512-T6KVD7rhLzFlwGRXMnxUFfkCZD8FHnb968wVXW1mXzgRFc5RNXOBY2mPPDZ77x5Ln76ltLMgtPg0cOkU1NSrEQ==", "dependencies": [ "@emnapi/core@1.9.2", "@emnapi/runtime@1.9.2", "@napi-rs/wasm-runtime@1.1.6" - ], - "integrity": "sha512-T6KVD7rhLzFlwGRXMnxUFfkCZD8FHnb968wVXW1mXzgRFc5RNXOBY2mPPDZ77x5Ln76ltLMgtPg0cOkU1NSrEQ==" + ] }, { "name": "@oxc-parser/binding-win32-arm64-msvc", @@ -1570,8 +1580,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-Ujvw4X+LD1CCGULcsQcvb4YNVoBGqt+JHgNNzGGaCImELiZLk477ifUH53gIbE7EKd933NdTi25JWEr9K2HwXw==" + "integrity": "sha512-Ujvw4X+LD1CCGULcsQcvb4YNVoBGqt+JHgNNzGGaCImELiZLk477ifUH53gIbE7EKd933NdTi25JWEr9K2HwXw==", + "dependencies": [] }, { "name": "@oxc-parser/binding-win32-ia32-msvc", @@ -1580,8 +1590,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-0cwxKO7KHQQQfo4Uf4B2SQrhgm+cJaP9OvFFhx52Tkg4bezsacu83GB2/In5bC415Ueeym+kXdnge/57rbSfTw==" + "integrity": "sha512-0cwxKO7KHQQQfo4Uf4B2SQrhgm+cJaP9OvFFhx52Tkg4bezsacu83GB2/In5bC415Ueeym+kXdnge/57rbSfTw==", + "dependencies": [] }, { "name": "@oxc-parser/binding-win32-x64-msvc", @@ -1590,8 +1600,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-rOrnSQSCbhI2kowr9XxE7m9a8oQXnBHjnS6j95LxxAnEZ0+Fz20WlRXG4ondQb+ejjt2KOsa65sE6++L6kUd+w==" + "integrity": "sha512-rOrnSQSCbhI2kowr9XxE7m9a8oQXnBHjnS6j95LxxAnEZ0+Fz20WlRXG4ondQb+ejjt2KOsa65sE6++L6kUd+w==", + "dependencies": [] }, { "name": "@oxc-project/types", @@ -1600,8 +1610,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-aIYXQBo4lCbO4z0R3FHeucQHpF46l2LbMdxRvqvuRuW2OxdnSkcng5B8+K12spgLDj93rtN3+J2Vac/TIO+ciQ==" + "integrity": "sha512-aIYXQBo4lCbO4z0R3FHeucQHpF46l2LbMdxRvqvuRuW2OxdnSkcng5B8+K12spgLDj93rtN3+J2Vac/TIO+ciQ==", + "dependencies": [] }, { "name": "@oxc-project/types", @@ -1610,202 +1620,202 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-r9gHphtCs+1M7J0pw6Sn/hh/Wpa/iQrOOkrNAlVLF/gHq+/CJmHIWKKUUhdWjcD6CIa8idarspCsASiXCXvFUw==" + "integrity": "sha512-r9gHphtCs+1M7J0pw6Sn/hh/Wpa/iQrOOkrNAlVLF/gHq+/CJmHIWKKUUhdWjcD6CIa8idarspCsASiXCXvFUw==", + "dependencies": [] }, { "name": "@oxc-resolver/binding-android-arm-eabi", - "version": "11.24.2", + "version": "11.21.2", "direct": false, "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-y09e0L0SRI2OA2tUIrjBgoV3eH5hvUKXNkJqXmNo5V2WxIjyC7I7aJfRLMEVpA8yi95f90gFDvO0VMgrDw+vwA==" + "integrity": "sha512-xQoCRv+gKax9KTdwdaQNnAFOai8neay7g3jExDIORzhbrejwGSJaZNTdOJHR5ziLg2joMxOCMOFMo4zuxza2uQ==", + "dependencies": [] }, { "name": "@oxc-resolver/binding-android-arm64", - "version": "11.24.2", + "version": "11.21.2", "direct": false, "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-cl4icWaZFnLdg8m6qtnh5rBMuGbxc/ptStFHLeCNwr+2cZjkjNwQu/jYRS0CHlnPecOJMpuS5M6/BH+0J/YkEg==" + "integrity": "sha512-HF5oiE2L05yInPYCFD/4uxSrEZW4SuIfn99Y6L1xnJnzl066JR+MJs2rIdstw8A2MPlAKH+13dpFPNycjqzvGg==", + "dependencies": [] }, { "name": "@oxc-resolver/binding-darwin-arm64", - "version": "11.24.2", + "version": "11.21.2", "direct": false, "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-At29QEMF6HajbQvgY8K6OXnHD1x9rad74xBEfmCB6ZqCGsdq75aK7tOYcTbOanMy8qdIBrfL3SMr3p/lfSlb9w==" + "integrity": "sha512-UX4u49CVCAD8QZNELaW8eMGgMAGwFWYEPbvNsh+3r/gs4NX3KfpiACMVwRQT0EuH3uat9hM5Zl+Ppm9pJD8tgg==", + "dependencies": [] }, { "name": "@oxc-resolver/binding-darwin-x64", - "version": "11.24.2", + "version": "11.21.2", "direct": false, "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-A5Kqr1EUj4oIL5CF4WRssq/o5P0Y11cwoFouMRmQ7YnC/A8V93nv1nb7aSU8HwcgmXropjLNkVTl4MN87cu28Q==" + "integrity": "sha512-J9xPx7YBkrRmJ+xl561ztnMWEc1aOyjEIxBiGX1dVb3u7bGSnfObfcZk+Pd+uM0HZAPNsQ1xvD8j52A/uOSqNQ==", + "dependencies": [] }, { "name": "@oxc-resolver/binding-freebsd-x64", - "version": "11.24.2", + "version": "11.21.2", "direct": false, "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-R5xkRBRRz7ceH/P5Jrc6G7FmdUdgpLYyESFAUDVTNQ9K0sGPxcp4ljiwEwEqsvNcQ4sYbMRrWcHHBCu7ksAJVw==" + "integrity": "sha512-fRlt7OvSaQkWj6+EDTVxawVxOlqJB2QSnBfkeCyK4RTvsGctbw3BiH2Tb7DzMs7bikc4BRBpvWP5zF9K8b54Zg==", + "dependencies": [] }, { "name": "@oxc-resolver/binding-linux-arm-gnueabihf", - "version": "11.24.2", + "version": "11.21.2", "direct": false, "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-k/RuYL4L/R58IBn3wT5ma3Wh4k62bp1eYCFRWCmMsasUOqL+H6sW0VGFadEzKWXFFlz+2uIMoeMk9ySSZJHgbg==" + "integrity": "sha512-gK+vPUcPQITkGwBKpZGrcDHSlU6eDGl7AQacxS2CEKAZIBHWkOVFeJwLZ4tYnA1acJqRM5lt7yYwPCVqGHIJ7A==", + "dependencies": [] }, { "name": "@oxc-resolver/binding-linux-arm-musleabihf", - "version": "11.24.2", + "version": "11.21.2", "direct": false, "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-bnHAak3ujYfH5pKk4NieFNbvYvernfoQDgwLddbZ3OtMYrem87/qjlA+u+aKG0oZcqSLGCful/6/CEA+aeAgaA==" + "integrity": "sha512-L/Rgas7SrOKy/z7IH+HxSFRqVO4PuLDKLEGKvnhoCBBq3UJ0YzGBou3qMzaAGgkJwsIvX2pBF+7ojzfUhLiZxQ==", + "dependencies": [] }, { "name": "@oxc-resolver/binding-linux-arm64-gnu", - "version": "11.24.2", + "version": "11.21.2", "direct": false, "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-vDT3KHgzYp47gmtNOqL2VNhCyl5Zv643eyxm//A68J8DeUGXrvD1pZFiaT4jSfe+RInfnn1R2yVHye4enx6RnA==" + "integrity": "sha512-CUEYvlX1Fk7E9kUMzuswru1J9HLxMwnpDeQGjQuI4ZH+iNCoa2X9T+pvyzrbsgl7WnIeTFTlNlHsRfVdf5g9/g==", + "dependencies": [] }, { "name": "@oxc-resolver/binding-linux-arm64-musl", - "version": "11.24.2", + "version": "11.21.2", "direct": false, "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-+kMlQvbzfyEYtu5FcjE4p+ttBLpKW4d/AsAsuE69BxV6V4twZJeIQZFfD8gh/wqglY0MkPSezWXQH0jBV13MUw==" + "integrity": "sha512-ViN1ZibQyxwC67GpoP33oo+S9UyUnkog13vzQb9+v9bCNvrVzJuk0MRdacjtv/9xfRMVF/eqHFyl8YOeykI10Q==", + "dependencies": [] }, { "name": "@oxc-resolver/binding-linux-ppc64-gnu", - "version": "11.24.2", + "version": "11.21.2", "direct": false, "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-shjfMhmZ3gq9fv/w7bi3PnZlgOPG+2QAOFf0BJF0EgBSIGZ6PMLN2zbGEblTUYB/NKVDRyYhE2ff3dJ1QqNPkA==" + "integrity": "sha512-CU1sCqWnhGqYD5I1HedHk5pujrn7ssDkNB/AEQd/pd3D/EojVSgJUlpbafwIbyhia3PgIfkvdFpRPWSALzVumA==", + "dependencies": [] }, { "name": "@oxc-resolver/binding-linux-riscv64-gnu", - "version": "11.24.2", + "version": "11.21.2", "direct": false, "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-zGelwFR5oRo+b69k8Lrzun86DyUHzfKN6cnjbR9l7Z7NIRznOE/2ZvPa1IUKqAL2PzAXOdwkfVqNvO1H2RlpAw==" + "integrity": "sha512-jWVyZtIHca4Gb96x7dag+y69vlei7ffjrsveLkmf2ZhqEAz6ZSBnY1GWvgZUaZlwZP62A3xD092BW97Q5VGc+g==", + "dependencies": [] }, { "name": "@oxc-resolver/binding-linux-riscv64-musl", - "version": "11.24.2", + "version": "11.21.2", "direct": false, "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-qxZ1SWCXJY0eyhAlP6Lmo9F2Nrtx7EkYj9oCgL8apDPCwXwCEDA2U697bbT81JIc2IrVjxO4KX6WU2N+oN9Z4w==" + "integrity": "sha512-LF29obFqNgBUgDX7rmUK7M4D0JQG5LxhYzn3xXmECcHU9aQAdWG7NiY052qybtesEdwHQXKNTWYQ7mTsybNvWg==", + "dependencies": [] }, { "name": "@oxc-resolver/binding-linux-s390x-gnu", - "version": "11.24.2", + "version": "11.21.2", "direct": false, "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-sGCecF3cx2DFlH4t/z7ApnOnXqN48p5p5mlHDEnHTAukQa2P+qMVE4CwyWE9W+q/m3QJ7kKfGrIjax31f44oFQ==" + "integrity": "sha512-+NYcm+cCHBbtdQQ3A4phQTSuVRYnNHz7wrl9XRAPEovcdoqi0mb1K5ZOl+jN54ZD+q1zz3V0vltbFJmzecJKmw==", + "dependencies": [] }, { "name": "@oxc-resolver/binding-linux-x64-gnu", - "version": "11.24.2", + "version": "11.21.2", "direct": false, "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-k/VlMMcSzMlahb3/fENM4rTlsJ0s3fFROA0KXPBmKggqmTSaE383sl8F3KCOXPLmVsYfW6hCitMhXCEtNeZxxg==" + "integrity": "sha512-UQqZDdG2r2HhAOsZEgufkIWHPQ886IUyuJQkoZByvzhW8j51R4UNzGBJFkTiTnLhQnggwJRdJgFWK4uY6ZVIMw==", + "dependencies": [] }, { "name": "@oxc-resolver/binding-linux-x64-musl", - "version": "11.24.2", + "version": "11.21.2", "direct": false, "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-8hbnZyNi97b/8wapYaIF9+t9GmZKBW2vunaOc3h9HGJptH7b7XpvZqOTBSm/MpTjr7H497BlgOaSfLUdhmy2bw==" + "integrity": "sha512-3Q9PMRjalWkT6NZ4jfujuqTCFwoWErg3y3BnOgb544B8IMw4PktiwWOigMfOHNRLMghZeJ7hpfpZf4CP7rV7Og==", + "dependencies": [] }, { "name": "@oxc-resolver/binding-openharmony-arm64", - "version": "11.24.2", + "version": "11.21.2", "direct": false, "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-MvyGik3a6pVgZ0t/kWlbmFxFLmXQJwgLsY2eYFHLpy0wGwRbfzeIGgDwQ3kXqE30z+kSXennRkCrT7TUvkptNg==" + "integrity": "sha512-Eljeq3ndtyKhM+Es8LITi4Zl2htzuRZcrPMF3kMCsrILztvU6AjZ3FuEhHHKobPUB9rMpzLpJP5bDqXI7r+iog==", + "dependencies": [] }, { "name": "@oxc-resolver/binding-wasm32-wasi", - "version": "11.24.2", + "version": "11.21.2", "direct": false, "scope": "development", "optional": true, "license": "NOASSERTION", + "integrity": "sha512-HGDbNsIywqc4LxU38+CTJNnB/6BF7rheWOJ259b4eE0aEnelYblC8x+1tEd63bp31fYne63RQz9Jb4yVnC7Yig==", "dependencies": [ - "@emnapi/core@1.11.2", - "@emnapi/runtime@1.11.2", + "@emnapi/core@1.11.0", + "@emnapi/runtime@1.11.0", "@napi-rs/wasm-runtime@1.1.6" - ], - "integrity": "sha512-vHcssMPwO08RTvj/c0iOBz90attxyG3wQJ0dTcyEQK43LRpcdLWZlV5feBhv6Isn6ahbQIzHbCgfa81+RiML0Q==" + ] }, { "name": "@oxc-resolver/binding-win32-arm64-msvc", - "version": "11.24.2", + "version": "11.21.2", "direct": false, "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-uokJqro2iBqkFvJdKQLP7d8/BUmFwESQFVmIJUQKj1Xn1a/LysJoe1vmeECLF5b3jsV8CAL5sEMJXX6SdK9Nhg==" + "integrity": "sha512-iWx25CBEgH49iE9q5coEGI/jb1jl5kkCY9z6U5Og67xCkQ/WFMDc2J5U78+AE91SUxM2NqSLhJC8/PLfWnImww==", + "dependencies": [] }, { "name": "@oxc-resolver/binding-win32-x64-msvc", - "version": "11.24.2", + "version": "11.21.2", "direct": false, "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-UqGPmo56KDfLlfXFAFIrNflHT8tFxWGEivWg3Zeyp4Uy2NlKN1FGPr6/BxcLGG3+kZ6Wp14g5Uj+n71boqZfiw==" + "integrity": "sha512-VPoCAhKvCQTlG7vxqaBXcmuvbh77BfnGXj8g0pbvVXpm1F/R8rDVwqIWcEbMzrI1JvJlm8v7T9uMVQb6UctMRg==", + "dependencies": [] }, { "name": "@playwright/test", @@ -1814,10 +1824,10 @@ "scope": "development", "optional": false, "license": "Apache-2.0", + "integrity": "sha512-9zOJ6ZQRAena31MpOH9VSzIz8Ou3YJ/wtY/eQm5T2uhfhG7/U3COrMS8xOtUrZrp9OgdmzEnIYODye3nY1VqzA==", "dependencies": [ "playwright@1.62.0" - ], - "integrity": "sha512-9zOJ6ZQRAena31MpOH9VSzIz8Ou3YJ/wtY/eQm5T2uhfhG7/U3COrMS8xOtUrZrp9OgdmzEnIYODye3nY1VqzA==" + ] }, { "name": "@rolldown/binding-android-arm64", @@ -1826,8 +1836,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-lZg8fqIv2v7FF237bwMgzGZEJvGL79/s5knJ/i6FmsGF4XXlzccZ4jb+TrFIxtSSxFtIpdsgrPZeMk1I9AFcyQ==" + "integrity": "sha512-lZg8fqIv2v7FF237bwMgzGZEJvGL79/s5knJ/i6FmsGF4XXlzccZ4jb+TrFIxtSSxFtIpdsgrPZeMk1I9AFcyQ==", + "dependencies": [] }, { "name": "@rolldown/binding-darwin-arm64", @@ -1836,8 +1846,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-51Bnx9pNiMRKSUNtBfySkNJ9vMU9Hh3I1ozDd6gyPPYzaXCfnptUcEZxXGYFn+ul2dtcMUiqGR1Yai2K10uoTw==" + "integrity": "sha512-51Bnx9pNiMRKSUNtBfySkNJ9vMU9Hh3I1ozDd6gyPPYzaXCfnptUcEZxXGYFn+ul2dtcMUiqGR1Yai2K10uoTw==", + "dependencies": [] }, { "name": "@rolldown/binding-darwin-x64", @@ -1846,8 +1856,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-Tm+gbfC0aHu1tBA/JvKQh32S0K6YgCHkiAF4/W6xX0K0RmNuc94VeK419dJoE65R5aRxmo+noZQSWrAMF6yb6g==" + "integrity": "sha512-Tm+gbfC0aHu1tBA/JvKQh32S0K6YgCHkiAF4/W6xX0K0RmNuc94VeK419dJoE65R5aRxmo+noZQSWrAMF6yb6g==", + "dependencies": [] }, { "name": "@rolldown/binding-freebsd-x64", @@ -1856,8 +1866,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-JMzDKCCXq93YccG5gz3hvOs1oXRKAf0XYpfOS88e+wZrC8Iugj6j68867vrYZkvpDDpKn/KoKORThmchMpF6TA==" + "integrity": "sha512-JMzDKCCXq93YccG5gz3hvOs1oXRKAf0XYpfOS88e+wZrC8Iugj6j68867vrYZkvpDDpKn/KoKORThmchMpF6TA==", + "dependencies": [] }, { "name": "@rolldown/binding-linux-arm-gnueabihf", @@ -1866,8 +1876,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-uML21j2K5TfPGutKxub+M+nLjZIrWjXQ5Grx4lCe/nimTj9B4L63zHpjXLl4y0L3mcm2htEQIb06oCG/szerNw==" + "integrity": "sha512-uML21j2K5TfPGutKxub+M+nLjZIrWjXQ5Grx4lCe/nimTj9B4L63zHpjXLl4y0L3mcm2htEQIb06oCG/szerNw==", + "dependencies": [] }, { "name": "@rolldown/binding-linux-arm64-gnu", @@ -1876,8 +1886,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-navSiuTMogvnQoZoM/v+l3ZWo50/NTwSHSzheABx/RCnmUPaKwq9qSo4Br2OYRs21+Fz8uFqITZM3H4opOB0/Q==" + "integrity": "sha512-navSiuTMogvnQoZoM/v+l3ZWo50/NTwSHSzheABx/RCnmUPaKwq9qSo4Br2OYRs21+Fz8uFqITZM3H4opOB0/Q==", + "dependencies": [] }, { "name": "@rolldown/binding-linux-arm64-musl", @@ -1886,8 +1896,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-lAryqH7IteztmCXQXk0etKj4wBQ7Gx5S6LjKhsgp9zb8I5bsuvU/2llH1hDQcjsFeqIsovMVN339/8pUDDBXxA==" + "integrity": "sha512-lAryqH7IteztmCXQXk0etKj4wBQ7Gx5S6LjKhsgp9zb8I5bsuvU/2llH1hDQcjsFeqIsovMVN339/8pUDDBXxA==", + "dependencies": [] }, { "name": "@rolldown/binding-linux-ppc64-gnu", @@ -1896,8 +1906,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-fsK/sNBnxzBlL4O1JNrZakVQxPspqpED5dLtNsZS9oOKmtSpdNIzxH2kkol5HYTWJN47sE20ztMJPxfZ89qGOg==" + "integrity": "sha512-fsK/sNBnxzBlL4O1JNrZakVQxPspqpED5dLtNsZS9oOKmtSpdNIzxH2kkol5HYTWJN47sE20ztMJPxfZ89qGOg==", + "dependencies": [] }, { "name": "@rolldown/binding-linux-s390x-gnu", @@ -1906,8 +1916,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-gLYb4BIadlfTOYT5gO503n8zQjXflgzpD0FcyKh0Mzx3rqCZKnHoJWV9xe1KXUJ5lx2JfcSHr/mhzS0PC/McAA==" + "integrity": "sha512-gLYb4BIadlfTOYT5gO503n8zQjXflgzpD0FcyKh0Mzx3rqCZKnHoJWV9xe1KXUJ5lx2JfcSHr/mhzS0PC/McAA==", + "dependencies": [] }, { "name": "@rolldown/binding-linux-x64-gnu", @@ -1916,8 +1926,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-FjcpEKUyJygHgs1o50VYNvkt5+7Le/VEdYt0AkRpkL33MnyQfwr8l5mXwMmfmTbyMPr5vJLC+8/Gd9gXnwU1QQ==" + "integrity": "sha512-FjcpEKUyJygHgs1o50VYNvkt5+7Le/VEdYt0AkRpkL33MnyQfwr8l5mXwMmfmTbyMPr5vJLC+8/Gd9gXnwU1QQ==", + "dependencies": [] }, { "name": "@rolldown/binding-linux-x64-musl", @@ -1926,8 +1936,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-Me+PfPI2TMeOQk0gYWfLQZtTktrmzbr8cDboqX83XKc7UrgAi55gF+2dUkWdxd19n55Essp2yeca+O9N5rBxHg==" + "integrity": "sha512-Me+PfPI2TMeOQk0gYWfLQZtTktrmzbr8cDboqX83XKc7UrgAi55gF+2dUkWdxd19n55Essp2yeca+O9N5rBxHg==", + "dependencies": [] }, { "name": "@rolldown/binding-openharmony-arm64", @@ -1936,8 +1946,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-yc5WrLzXks6zCQfn9Oxr8pORKyl/pF+QjHmW/Qx3qu0oyrrNC+y2JLTU1E2rcWYAmzlnqngWXHQjy51VzW70Vw==" + "integrity": "sha512-yc5WrLzXks6zCQfn9Oxr8pORKyl/pF+QjHmW/Qx3qu0oyrrNC+y2JLTU1E2rcWYAmzlnqngWXHQjy51VzW70Vw==", + "dependencies": [] }, { "name": "@rolldown/binding-wasm32-wasi", @@ -1946,12 +1956,12 @@ "scope": "development", "optional": true, "license": "NOASSERTION", + "integrity": "sha512-VbQGPX2b4r48TAMIM2cjgluIM1HYutm4pcTEJsle7iEP7sB1dFqtPLBVbdLAZCxy1txCcPxf4QFf4v8uvltPqA==", "dependencies": [ "@emnapi/core@1.11.1", "@emnapi/runtime@1.11.1", "@napi-rs/wasm-runtime@1.1.6" - ], - "integrity": "sha512-VbQGPX2b4r48TAMIM2cjgluIM1HYutm4pcTEJsle7iEP7sB1dFqtPLBVbdLAZCxy1txCcPxf4QFf4v8uvltPqA==" + ] }, { "name": "@rolldown/binding-win32-arm64-msvc", @@ -1960,8 +1970,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-gHv82k63z4qpV5+Q1y/12KrK0ltWBukVDI8nZcbT7Tt/ZlOIVwppazneq0F93oDxTo3IgAMEDIoQh3E2n6mVsw==" + "integrity": "sha512-gHv82k63z4qpV5+Q1y/12KrK0ltWBukVDI8nZcbT7Tt/ZlOIVwppazneq0F93oDxTo3IgAMEDIoQh3E2n6mVsw==", + "dependencies": [] }, { "name": "@rolldown/binding-win32-x64-msvc", @@ -1970,8 +1980,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-tTZuDBPw85tEN5PQi1pnEBzDy0Z49HtScLAbD5t6hyeU92A95pRWaSMw1GZZi/RwgSgUIl0xrSlXIT/9QzvYSA==" + "integrity": "sha512-tTZuDBPw85tEN5PQi1pnEBzDy0Z49HtScLAbD5t6hyeU92A95pRWaSMw1GZZi/RwgSgUIl0xrSlXIT/9QzvYSA==", + "dependencies": [] }, { "name": "@rolldown/pluginutils", @@ -1980,8 +1990,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==" + "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", + "dependencies": [] }, { "name": "@rollup/pluginutils", @@ -1990,12 +2000,12 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-MfPp06CjRLfXQ3wY0R8vJDYBy/MvVcc9OulEfR0B8Iv9ko+GCNaRZ+EpJYFl27LhKsZK0o420sYCRHCjfCgeUg==", "dependencies": [ "@types/estree@1.0.9", "estree-walker@2.0.2", "picomatch@4.0.5" - ], - "integrity": "sha512-MfPp06CjRLfXQ3wY0R8vJDYBy/MvVcc9OulEfR0B8Iv9ko+GCNaRZ+EpJYFl27LhKsZK0o420sYCRHCjfCgeUg==" + ] }, { "name": "@standard-schema/spec", @@ -2004,52 +2014,36 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==" + "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", + "dependencies": [] }, { "name": "@storybook/addon-a11y", - "version": "10.5.4", + "version": "10.6.5", "direct": true, "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-7dEH3OHKdE+0zakqEy50KtfhPORIm1xnhWeehyROO1Ct7Rx9s7cYcx6edUZvh0tCuX5VhDnDmkvQV+dbrPDmCA==", "dependencies": [ "@storybook/global@5.0.0", "axe-core@4.12.1", - "storybook@10.5.4" - ], - "integrity": "sha512-UWdZtB7Dh1GjqxTPOrisUNDhDGF5pKGzZdzW9DSSHMBcAOx2dsTmXGzLSFprAz4LTT0OHCtKhxNqKK0JZJ0Y8g==" + "storybook@10.6.5" + ] }, { "name": "@storybook/builder-vite", - "version": "10.5.4", + "version": "10.6.5", "direct": false, "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-udrGjg3yt38pz4FxplypXxw1creIGS7N6QS8xfvTFM8MQNtPyojT/gZdd4fhX0dFrQx5MMuJEYJA5gUBiPsLtg==", "dependencies": [ - "@storybook/csf-plugin@10.5.4", - "storybook@10.5.4", + "storybook@10.6.5", "ts-dedent@2.3.0", - "vite@8.1.5" - ], - "integrity": "sha512-eXdgow+brSzZrG3CnG18YwxZwEYNAZIh2G5qKwNoZf0uk2ZCPgLRQwtVAcd7BiiEDGnXUHm9pycAS+UiF4F4Mg==" - }, - { - "name": "@storybook/csf-plugin", - "version": "10.5.4", - "direct": false, - "scope": "development", - "optional": false, - "license": "MIT", - "dependencies": [ - "esbuild@0.28.1", - "storybook@10.5.4", - "unplugin@2.3.11", - "vite@8.1.5" - ], - "integrity": "sha512-DSp5Z/eZlRnKq0KrKLJE6uoYf/Ysc+FP0Z5DVTGnOrie+z3tC0lNi9I4RB++EXkJeUDS9/4dxvJZVSWjhLlXxw==" + "vite@8.1.6" + ] }, { "name": "@storybook/global", @@ -2058,8 +2052,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-FcOqPAXACP0I3oJ/ws6/rrPT9WGhu915Cg8D02a9YxLo0DE9zI+a9A5gRGvmQ09fiWPukqI8ZAEoQEdWUKMQdQ==" + "integrity": "sha512-FcOqPAXACP0I3oJ/ws6/rrPT9WGhu915Cg8D02a9YxLo0DE9zI+a9A5gRGvmQ09fiWPukqI8ZAEoQEdWUKMQdQ==", + "dependencies": [] }, { "name": "@storybook/icons", @@ -2068,72 +2062,72 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-Fxh9vYpX9bQqFeHRiY8h2ApeRGDzRSMLwJwNZ/AIRqnyOKHxRKL+yFe+ctEkVJmuptRE9u1Hrn8ZZNHyfDKKNg==", "dependencies": [ "react@19.2.8" - ], - "integrity": "sha512-Fxh9vYpX9bQqFeHRiY8h2ApeRGDzRSMLwJwNZ/AIRqnyOKHxRKL+yFe+ctEkVJmuptRE9u1Hrn8ZZNHyfDKKNg==" + ] }, { "name": "@storybook/react-dom-shim", - "version": "10.5.4", + "version": "10.6.5", "direct": false, "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-Qbbkp+5Otg32w8Ddav6rH6MGPiYVfEzrgn0HqbqlqS8kY+DRXo+NYXJwZTVSDSwrYPrfH+Ok2tV4uE8Zo0c3cg==", "dependencies": [ "@types/react-dom@19.2.3", "@types/react@19.2.8", "react-dom@19.2.8", "react@19.2.8", - "storybook@10.5.4" - ], - "integrity": "sha512-YdlppEOReg8MvTECRNuf79gu2zL83JqKDHIR/65eS0M6y+ue9pkpfjYo7hZVIcyOcRd9npBDXMdt2kC92bCuaA==" + "storybook@10.6.5" + ] }, { "name": "@storybook/react-vite", - "version": "10.5.4", + "version": "10.6.5", "direct": true, "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-RsRF1drYtCku7+PMdRnuFt3EdG8Rn8I5G8ne0cBjn24xSn5Pbo9W+y9IoyD2llAeaeCpzEEdASY12wpKd3aCQA==", "dependencies": [ "@joshwooding/vite-plugin-react-docgen-typescript@0.7.0", "@rollup/pluginutils@5.4.0", - "@storybook/builder-vite@10.5.4", - "@storybook/react@10.5.4", + "@storybook/builder-vite@10.6.5", + "@storybook/react@10.6.5", "empathic@2.0.1", - "magic-string@0.30.21", + "magic-string@1.4.5", "react-docgen@8.0.3", "react-dom@19.2.8", "react@19.2.8", "resolve@1.22.12", - "storybook@10.5.4", + "storybook@10.6.5", "tsconfig-paths@4.2.0", "typescript@7.0.2", - "vite@8.1.5" - ], - "integrity": "sha512-iw7EAA98n30vpf+ZSy2Ll4Ne7oyZ/lS6W22u5Sp5UOI2oAkYuklxIWjRIKGqpY0BHP+GqaGYtUGMZQnBqgul2g==" + "vite@8.1.6" + ] }, { "name": "@storybook/react", - "version": "10.5.4", + "version": "10.6.5", "direct": false, "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-vvRjRe/O8NRiQbGyA7Ne6h2jbD6GjwNZFkMdHl+0kZH8Z/S9ZWWmKmjCySvH/OmgighdCOQ98tcfND7m65WQBg==", "dependencies": [ "@storybook/global@5.0.0", - "@storybook/react-dom-shim@10.5.4", + "@storybook/react-dom-shim@10.6.5", "@types/react-dom@19.2.3", "@types/react@19.2.8", "react-docgen-typescript@2.4.0", "react-docgen@8.0.3", "react-dom@19.2.8", "react@19.2.8", - "storybook@10.5.4", + "storybook@10.6.5", "typescript@7.0.2" - ], - "integrity": "sha512-tOxfVgbYcaVsArN8XTDkJfdsnsnHh1LxjRHVpJ/N+VEkz4FveK/XH3jOLV0YqgrG8yXza7+CteDP4FfPVQY/mw==" + ] }, { "name": "@tailwindcss/node", @@ -2142,16 +2136,16 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-/T8IKEsf9VTU6tLjgC7+sv2mOPtQxzE2jMw7u4Tt40Tx+QSZxpzh95/H6cMKoja9XuW7iMdLJYBB0o9G1CaAgg==", "dependencies": [ "@jridgewell/remapping@2.3.5", "enhanced-resolve@5.24.2", "jiti@2.7.0", "lightningcss@1.32.0", "magic-string@0.30.21", - "source-map-js@1.2.1", + "source-map-js@1.2.2", "tailwindcss@4.3.3" - ], - "integrity": "sha512-/T8IKEsf9VTU6tLjgC7+sv2mOPtQxzE2jMw7u4Tt40Tx+QSZxpzh95/H6cMKoja9XuW7iMdLJYBB0o9G1CaAgg==" + ] }, { "name": "@tailwindcss/oxide-android-arm64", @@ -2160,8 +2154,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-Y85A2gmPSkl5Ve5qR86GL4HT509cFqQh1aes9p3sSkyTPwt0Pppf3GkwGe4JPACcRYjgJIEhQgM6dBClnr0NYw==" + "integrity": "sha512-Y85A2gmPSkl5Ve5qR86GL4HT509cFqQh1aes9p3sSkyTPwt0Pppf3GkwGe4JPACcRYjgJIEhQgM6dBClnr0NYw==", + "dependencies": [] }, { "name": "@tailwindcss/oxide-darwin-arm64", @@ -2170,8 +2164,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-BiaWatpBcERQFDlOjRDpIVXuFK5PJez5SA4JMg6VYZdBYU+qKfV/vqjcIs+IYmtitf1xYQZTwXvU/8y4lfZUGw==" + "integrity": "sha512-BiaWatpBcERQFDlOjRDpIVXuFK5PJez5SA4JMg6VYZdBYU+qKfV/vqjcIs+IYmtitf1xYQZTwXvU/8y4lfZUGw==", + "dependencies": [] }, { "name": "@tailwindcss/oxide-darwin-x64", @@ -2180,8 +2174,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-fAeUqfV5ndhxRwai8cXGzdLvul9utWOmeTkv69unv4ZXixjn61Z+p9lCWdwOwA3TYboG3BwdVuN/RDjhBRl0mw==" + "integrity": "sha512-fAeUqfV5ndhxRwai8cXGzdLvul9utWOmeTkv69unv4ZXixjn61Z+p9lCWdwOwA3TYboG3BwdVuN/RDjhBRl0mw==", + "dependencies": [] }, { "name": "@tailwindcss/oxide-freebsd-x64", @@ -2190,8 +2184,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-iyf5bV6+wnAlflVeEy7R25dupxTNECZN5QMI0qNT6eT+EgaGdZcKhGkr5SdoaWiLJ3spLqIY9VCeSGrwmtg4kw==" + "integrity": "sha512-iyf5bV6+wnAlflVeEy7R25dupxTNECZN5QMI0qNT6eT+EgaGdZcKhGkr5SdoaWiLJ3spLqIY9VCeSGrwmtg4kw==", + "dependencies": [] }, { "name": "@tailwindcss/oxide-linux-arm-gnueabihf", @@ -2200,8 +2194,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-aAYUprJAJQWWbRrPvtjdroZ56Md+JM8pMiopS6xGEwDfLhqj+2ver2p4nU4Mb3CRqcMmNBjo8KkUgcxhkzVQGQ==" + "integrity": "sha512-aAYUprJAJQWWbRrPvtjdroZ56Md+JM8pMiopS6xGEwDfLhqj+2ver2p4nU4Mb3CRqcMmNBjo8KkUgcxhkzVQGQ==", + "dependencies": [] }, { "name": "@tailwindcss/oxide-linux-arm64-gnu", @@ -2210,8 +2204,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-nDxldcEENOxZRzC2uu9jrutZdAAQtb+8WWDCSnWL1zvBk1+FN+x6MtDViPB5AJMfttVCUhehGWus3XBPgatM/w==" + "integrity": "sha512-nDxldcEENOxZRzC2uu9jrutZdAAQtb+8WWDCSnWL1zvBk1+FN+x6MtDViPB5AJMfttVCUhehGWus3XBPgatM/w==", + "dependencies": [] }, { "name": "@tailwindcss/oxide-linux-arm64-musl", @@ -2220,8 +2214,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-Md44bD6veX/PC5iyF8cDVnw4HBIANZepRZZ7a8DQOvkfo5WUBwcp6iAuCUz23u+4SUkhJlD3eL7hNdW8ezd/kA==" + "integrity": "sha512-Md44bD6veX/PC5iyF8cDVnw4HBIANZepRZZ7a8DQOvkfo5WUBwcp6iAuCUz23u+4SUkhJlD3eL7hNdW8ezd/kA==", + "dependencies": [] }, { "name": "@tailwindcss/oxide-linux-x64-gnu", @@ -2230,8 +2224,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-tx7us1muwOKAKWao2v/GaafFeQboE6aj88vC6ziN2NCGcRm8gWUhwjzg+YdVB1e4boAtdtma4L43onunI6NS4w==" + "integrity": "sha512-tx7us1muwOKAKWao2v/GaafFeQboE6aj88vC6ziN2NCGcRm8gWUhwjzg+YdVB1e4boAtdtma4L43onunI6NS4w==", + "dependencies": [] }, { "name": "@tailwindcss/oxide-linux-x64-musl", @@ -2240,8 +2234,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-SJxX60smvHgasZoBy11dX6YRjXJFovwWBoedhbQPOBzgFWBHGB+TVPWB9BxzR7TTxU8FQZAI2AyiNCMzFm8Img==" + "integrity": "sha512-SJxX60smvHgasZoBy11dX6YRjXJFovwWBoedhbQPOBzgFWBHGB+TVPWB9BxzR7TTxU8FQZAI2AyiNCMzFm8Img==", + "dependencies": [] }, { "name": "@tailwindcss/oxide-wasm32-wasi", @@ -2250,8 +2244,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-jx1+rPhY/5Ympkktd656HBWEBLxP7dH06losBLjjf5vgCODXvi9KhtftWcMIwTFIDqBr7cRnQkdLnAG+IOlGvQ==" + "integrity": "sha512-jx1+rPhY/5Ympkktd656HBWEBLxP7dH06losBLjjf5vgCODXvi9KhtftWcMIwTFIDqBr7cRnQkdLnAG+IOlGvQ==", + "dependencies": [] }, { "name": "@tailwindcss/oxide-win32-arm64-msvc", @@ -2260,8 +2254,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-3rc292Ca2ceK6Ulcc/bAVnTs/3nDtoPhyEKlgPv+yQJQi/JS/AMJlqzxvlDacL1nekbrcf6bTqp/jV4qgnPxNQ==" + "integrity": "sha512-3rc292Ca2ceK6Ulcc/bAVnTs/3nDtoPhyEKlgPv+yQJQi/JS/AMJlqzxvlDacL1nekbrcf6bTqp/jV4qgnPxNQ==", + "dependencies": [] }, { "name": "@tailwindcss/oxide-win32-x64-msvc", @@ -2270,8 +2264,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-yJ0pwIVc/nYeGoV02WtsN8KYyLQv7kyI2wDnkezyJlGGjkd4QLwDGAwl47YpPJeuI0M0ObaXGSPjvWDPeTPggw==" + "integrity": "sha512-yJ0pwIVc/nYeGoV02WtsN8KYyLQv7kyI2wDnkezyJlGGjkd4QLwDGAwl47YpPJeuI0M0ObaXGSPjvWDPeTPggw==", + "dependencies": [] }, { "name": "@tailwindcss/oxide", @@ -2280,6 +2274,7 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-krXjAikiaFSPaK/FkAQT5UTx3VormQaiZ5hBFlJZ9UFQGB/rwg1MZIhHAG9smMQRTdyJxP6Qt5MwMtdyU5FWrA==", "dependencies": [ "@tailwindcss/oxide-android-arm64@4.3.3", "@tailwindcss/oxide-darwin-arm64@4.3.3", @@ -2293,8 +2288,7 @@ "@tailwindcss/oxide-wasm32-wasi@4.3.3", "@tailwindcss/oxide-win32-arm64-msvc@4.3.3", "@tailwindcss/oxide-win32-x64-msvc@4.3.3" - ], - "integrity": "sha512-krXjAikiaFSPaK/FkAQT5UTx3VormQaiZ5hBFlJZ9UFQGB/rwg1MZIhHAG9smMQRTdyJxP6Qt5MwMtdyU5FWrA==" + ] }, { "name": "@tailwindcss/vite", @@ -2303,13 +2297,13 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-yYU8cogLeSh/ms2jh8Fj7jaba/EWa7Ja6GoUqYZaraEuCI5YS6ms6ObZgjjedm+jm6XZjdNRWBpPP6Z86oOxcw==", "dependencies": [ "@tailwindcss/node@4.3.3", "@tailwindcss/oxide@4.3.3", "tailwindcss@4.3.3", - "vite@8.1.5" - ], - "integrity": "sha512-yYU8cogLeSh/ms2jh8Fj7jaba/EWa7Ja6GoUqYZaraEuCI5YS6ms6ObZgjjedm+jm6XZjdNRWBpPP6Z86oOxcw==" + "vite@8.1.6" + ] }, { "name": "@tanstack/query-core", @@ -2318,8 +2312,8 @@ "scope": "production", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-gNwcvOJcRbLWPOLG/2OBm+zM+Yv+MKsXKEOWC57USuZDEsI71hEErQsiEGx5wX9rzWWkfwM0fVSPoiIFSsxfiw==" + "integrity": "sha512-gNwcvOJcRbLWPOLG/2OBm+zM+Yv+MKsXKEOWC57USuZDEsI71hEErQsiEGx5wX9rzWWkfwM0fVSPoiIFSsxfiw==", + "dependencies": [] }, { "name": "@tanstack/react-query", @@ -2328,11 +2322,11 @@ "scope": "production", "optional": false, "license": "MIT", + "integrity": "sha512-yRg2pfOCxIs4ZJW3XYYHU/WgtD04FHSnfHlpRT7h7pR77hwkdRG4wxbKe4aq6P0RvXUTBSQpQeadS1SUYUe+KA==", "dependencies": [ "@tanstack/query-core@5.101.4", "react@19.2.8" - ], - "integrity": "sha512-yRg2pfOCxIs4ZJW3XYYHU/WgtD04FHSnfHlpRT7h7pR77hwkdRG4wxbKe4aq6P0RvXUTBSQpQeadS1SUYUe+KA==" + ] }, { "name": "@testing-library/dom", @@ -2341,6 +2335,7 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-o4PXJQidqJl82ckFaXUeoAW+XysPLauYI43Abki5hABd853iMhitooc6znOnczgbTYmEP6U6/y1ZyKAIsvMKGg==", "dependencies": [ "@babel/code-frame@7.29.7", "@babel/runtime@7.29.7", @@ -2350,26 +2345,24 @@ "lz-string@1.5.0", "picocolors@1.1.1", "pretty-format@27.5.1" - ], - "integrity": "sha512-o4PXJQidqJl82ckFaXUeoAW+XysPLauYI43Abki5hABd853iMhitooc6znOnczgbTYmEP6U6/y1ZyKAIsvMKGg==" + ] }, { "name": "@testing-library/jest-dom", - "version": "6.10.0", + "version": "6.9.1", "direct": false, "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-zIcONa+hVtVSSep9UT3jZ5rizo2BsxgyDYU7WFD5eICBE7no3881HGeb/QkGfsJs6JTkY1aQhT7rIPC7e+0nnA==", "dependencies": [ "@adobe/css-tools@4.5.0", - "@testing-library/dom@10.4.1", "aria-query@5.3.2", "css.escape@1.5.1", "dom-accessibility-api@0.6.3", "picocolors@1.1.1", "redent@3.0.0" - ], - "integrity": "sha512-HQwu0KaB2zyT0iLzBL+8CLyZDL3KlZlZJ+2iyc9uCUnlJVskJU/UlPuVCyIPhtukjPQdT2QNoR5nCP5FqTmmDQ==" + ] }, { "name": "@testing-library/jest-dom", @@ -2378,6 +2371,7 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-HKAH9C6mBo5yBG6yRO5i43L2iisencAo5z+o5P/saHUoY+miC5ivXRxHBJcFyB5ypPNxHJdK3BoF/3O4DIptMg==", "dependencies": [ "@adobe/css-tools@4.5.0", "@testing-library/dom@10.4.1", @@ -2386,8 +2380,7 @@ "dom-accessibility-api@0.6.3", "picocolors@1.1.1", "redent@3.0.0" - ], - "integrity": "sha512-HKAH9C6mBo5yBG6yRO5i43L2iisencAo5z+o5P/saHUoY+miC5ivXRxHBJcFyB5ypPNxHJdK3BoF/3O4DIptMg==" + ] }, { "name": "@testing-library/react", @@ -2396,6 +2389,7 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-XU5/SytQM+ykqMnAnvB2umaJNIOsLF3PVv//1Ew4CTcpz0/BRyy/af40qqrt7SjKpDdT1saBMc42CUok5gaw+g==", "dependencies": [ "@babel/runtime@7.29.7", "@testing-library/dom@10.4.1", @@ -2403,8 +2397,7 @@ "@types/react@19.2.8", "react-dom@19.2.8", "react@19.2.8" - ], - "integrity": "sha512-XU5/SytQM+ykqMnAnvB2umaJNIOsLF3PVv//1Ew4CTcpz0/BRyy/af40qqrt7SjKpDdT1saBMc42CUok5gaw+g==" + ] }, { "name": "@testing-library/user-event", @@ -2413,10 +2406,22 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-vq7fv0rnt+QTXgPxr5Hjc210p6YKq2kmdziLgnsZGgLJ9e6VAShx1pACLuRjd/AS/sr7phAR58OIIpf0LlmQNw==", "dependencies": [ "@testing-library/dom@10.4.1" - ], - "integrity": "sha512-vq7fv0rnt+QTXgPxr5Hjc210p6YKq2kmdziLgnsZGgLJ9e6VAShx1pACLuRjd/AS/sr7phAR58OIIpf0LlmQNw==" + ] + }, + { + "name": "@testing-library/user-event", + "version": "14.6.8", + "direct": false, + "scope": "development", + "optional": false, + "license": "MIT", + "integrity": "sha512-vgSSqnANMnkcYR/vUNDbwS7aM3OErRLNUG8vCVVlj4oc6cKffUrccX7UAS5AmJQQNZTSibi9z5GvvRZ0aYgUCQ==", + "dependencies": [ + "@testing-library/dom@10.4.1" + ] }, { "name": "@tybys/wasm-util", @@ -2425,10 +2430,10 @@ "scope": "development", "optional": true, "license": "NOASSERTION", + "integrity": "sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg==", "dependencies": [ "tslib@2.8.1" - ], - "integrity": "sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg==" + ] }, { "name": "@types/aria-query", @@ -2437,8 +2442,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==" + "integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==", + "dependencies": [] }, { "name": "@types/babel__core", @@ -2447,14 +2452,14 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", "dependencies": [ "@babel/parser@7.29.7", "@babel/types@7.29.7", "@types/babel__generator@7.27.0", "@types/babel__template@7.4.4", "@types/babel__traverse@7.28.0" - ], - "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==" + ] }, { "name": "@types/babel__generator", @@ -2463,10 +2468,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", "dependencies": [ "@babel/types@7.29.7" - ], - "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==" + ] }, { "name": "@types/babel__template", @@ -2475,11 +2480,11 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", "dependencies": [ "@babel/parser@7.29.7", "@babel/types@7.29.7" - ], - "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==" + ] }, { "name": "@types/babel__traverse", @@ -2488,10 +2493,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", "dependencies": [ "@babel/types@7.29.7" - ], - "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==" + ] }, { "name": "@types/chai", @@ -2500,11 +2505,11 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==", "dependencies": [ "@types/deep-eql@4.0.2", "assertion-error@2.0.1" - ], - "integrity": "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==" + ] }, { "name": "@types/deep-eql", @@ -2513,8 +2518,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==" + "integrity": "sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==", + "dependencies": [] }, { "name": "@types/doctrine", @@ -2523,8 +2528,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-eOIHzCUSH7SMfonMG1LsC2f8vxBFtho6NGBznK41R84YzPuvSBzrhEps33IsQiOW9+VL6NQ9DbjQJznk/S4uRA==" + "integrity": "sha512-eOIHzCUSH7SMfonMG1LsC2f8vxBFtho6NGBznK41R84YzPuvSBzrhEps33IsQiOW9+VL6NQ9DbjQJznk/S4uRA==", + "dependencies": [] }, { "name": "@types/esrecurse", @@ -2533,8 +2538,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw==" + "integrity": "sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw==", + "dependencies": [] }, { "name": "@types/estree", @@ -2543,8 +2548,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==" + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", + "dependencies": [] }, { "name": "@types/gensync", @@ -2553,8 +2558,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-MbsRCT7mTikHwKZ0X+LVUTLRrZZRLipTuXEO9qOYO+zmjMVk81axyClMROf6uoPD9MRVu46bx8zoR0Ad9q3NAg==" + "integrity": "sha512-MbsRCT7mTikHwKZ0X+LVUTLRrZZRLipTuXEO9qOYO+zmjMVk81axyClMROf6uoPD9MRVu46bx8zoR0Ad9q3NAg==", + "dependencies": [] }, { "name": "@types/jsesc", @@ -2563,8 +2568,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-9VN+6yxLOPLOav+7PwjZbxiID2bVaeq0ED4qSQmdQTdjnXJSaCVKTR58t15oqH1H5t8Ng2ZX1SabJVoN9Q34bw==" + "integrity": "sha512-9VN+6yxLOPLOav+7PwjZbxiID2bVaeq0ED4qSQmdQTdjnXJSaCVKTR58t15oqH1H5t8Ng2ZX1SabJVoN9Q34bw==", + "dependencies": [] }, { "name": "@types/json-schema", @@ -2573,8 +2578,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==" + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dependencies": [] }, { "name": "@types/node", @@ -2583,10 +2588,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-Dh8vAsV36ig5wa9OX4pXvMc9D3Veibfw2wix0CUwYODLD8nkj9UsLjASr49nPg+2eKzxhBV+v7L8pXvT4e639Q==", "dependencies": [ "undici-types@7.18.2" - ], - "integrity": "sha512-Dh8vAsV36ig5wa9OX4pXvMc9D3Veibfw2wix0CUwYODLD8nkj9UsLjASr49nPg+2eKzxhBV+v7L8pXvT4e639Q==" + ] }, { "name": "@types/react-dom", @@ -2595,10 +2600,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==", "dependencies": [ "@types/react@19.2.8" - ], - "integrity": "sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==" + ] }, { "name": "@types/react", @@ -2607,10 +2612,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-3MbSL37jEchWZz2p2mjntRZtPt837ij10ApxKfgmXCTuHWagYg7iA5bqPw6C8BMPfwidlvfPI/fxOc42HLhcyg==", "dependencies": [ "csstype@3.2.3" - ], - "integrity": "sha512-3MbSL37jEchWZz2p2mjntRZtPt837ij10ApxKfgmXCTuHWagYg7iA5bqPw6C8BMPfwidlvfPI/fxOc42HLhcyg==" + ] }, { "name": "@types/resolve", @@ -2619,8 +2624,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-A4STmOXPhMUtHH+S6ymgE2GiBSMqf4oTvcQZMcHzokuTLVYzXTB8ttjcgxOVaAp2lGwEdzZ0J+cRbbeevQj1UQ==" + "integrity": "sha512-A4STmOXPhMUtHH+S6ymgE2GiBSMqf4oTvcQZMcHzokuTLVYzXTB8ttjcgxOVaAp2lGwEdzZ0J+cRbbeevQj1UQ==", + "dependencies": [] }, { "name": "@types/set-cookie-parser", @@ -2629,10 +2634,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-GGmQVGpQWUe5qglJozEjZV/5dyxbOOZ0LHe/lqyWssB88Y4svNfst0uqBVscdDeIKl5Jy5+aPSvy7mI9tYRguw==", "dependencies": [ "@types/node@24.13.3" - ], - "integrity": "sha512-GGmQVGpQWUe5qglJozEjZV/5dyxbOOZ0LHe/lqyWssB88Y4svNfst0uqBVscdDeIKl5Jy5+aPSvy7mI9tYRguw==" + ] }, { "name": "@types/statuses", @@ -2641,8 +2646,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-xMAgYwceFhRA2zY+XbEA7mxYbA093wdiW8Vu6gZPGWy9cmOyU9XesH1tNcEWsKFd5Vzrqx5T3D38PWx1FIIXkA==" + "integrity": "sha512-xMAgYwceFhRA2zY+XbEA7mxYbA093wdiW8Vu6gZPGWy9cmOyU9XesH1tNcEWsKFd5Vzrqx5T3D38PWx1FIIXkA==", + "dependencies": [] }, { "name": "@typescript/typescript-aix-ppc64", @@ -2651,8 +2656,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==" + "integrity": "sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==", + "dependencies": [] }, { "name": "@typescript/typescript-darwin-arm64", @@ -2661,8 +2666,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==" + "integrity": "sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==", + "dependencies": [] }, { "name": "@typescript/typescript-darwin-x64", @@ -2671,8 +2676,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==" + "integrity": "sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==", + "dependencies": [] }, { "name": "@typescript/typescript-freebsd-arm64", @@ -2681,8 +2686,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==" + "integrity": "sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==", + "dependencies": [] }, { "name": "@typescript/typescript-freebsd-x64", @@ -2691,8 +2696,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==" + "integrity": "sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==", + "dependencies": [] }, { "name": "@typescript/typescript-linux-arm", @@ -2701,8 +2706,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==" + "integrity": "sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==", + "dependencies": [] }, { "name": "@typescript/typescript-linux-arm64", @@ -2711,8 +2716,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==" + "integrity": "sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==", + "dependencies": [] }, { "name": "@typescript/typescript-linux-loong64", @@ -2721,8 +2726,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==" + "integrity": "sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==", + "dependencies": [] }, { "name": "@typescript/typescript-linux-mips64el", @@ -2731,8 +2736,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==" + "integrity": "sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==", + "dependencies": [] }, { "name": "@typescript/typescript-linux-ppc64", @@ -2741,8 +2746,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==" + "integrity": "sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==", + "dependencies": [] }, { "name": "@typescript/typescript-linux-riscv64", @@ -2751,8 +2756,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==" + "integrity": "sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==", + "dependencies": [] }, { "name": "@typescript/typescript-linux-s390x", @@ -2761,8 +2766,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==" + "integrity": "sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==", + "dependencies": [] }, { "name": "@typescript/typescript-linux-x64", @@ -2771,8 +2776,8 @@ "scope": "development", "optional": false, "license": "Apache-2.0", - "dependencies": [], - "integrity": "sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==" + "integrity": "sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==", + "dependencies": [] }, { "name": "@typescript/typescript-netbsd-arm64", @@ -2781,8 +2786,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==" + "integrity": "sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==", + "dependencies": [] }, { "name": "@typescript/typescript-netbsd-x64", @@ -2791,8 +2796,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==" + "integrity": "sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==", + "dependencies": [] }, { "name": "@typescript/typescript-openbsd-arm64", @@ -2801,8 +2806,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==" + "integrity": "sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==", + "dependencies": [] }, { "name": "@typescript/typescript-openbsd-x64", @@ -2811,8 +2816,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==" + "integrity": "sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==", + "dependencies": [] }, { "name": "@typescript/typescript-sunos-x64", @@ -2821,8 +2826,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==" + "integrity": "sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==", + "dependencies": [] }, { "name": "@typescript/typescript-win32-arm64", @@ -2831,8 +2836,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==" + "integrity": "sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==", + "dependencies": [] }, { "name": "@typescript/typescript-win32-x64", @@ -2841,8 +2846,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==" + "integrity": "sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==", + "dependencies": [] }, { "name": "@vitejs/plugin-react", @@ -2851,22 +2856,23 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-XcCQz0TBpBgljhj0gMuuDj49i6Ytqh5q1osT/Gp5uAVJUCTWxyskk/l1jwYYiu2xcNHHipdMz40EGfM1VdamVg==", "dependencies": [ "@rolldown/pluginutils@1.0.1", - "vite@8.1.5" - ], - "integrity": "sha512-XcCQz0TBpBgljhj0gMuuDj49i6Ytqh5q1osT/Gp5uAVJUCTWxyskk/l1jwYYiu2xcNHHipdMz40EGfM1VdamVg==" + "vite@8.1.6" + ] }, { "name": "@vitest/coverage-v8", - "version": "4.1.10", + "version": "4.1.12", "direct": true, "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-6S7/iVknKglLAxMFxQGNppBI0iqJS2NgM6FBxavitj7KaDq/vywOWGf6dGu7F2L1Qy0G6S3uTp7aGshHrzK8JA==", "dependencies": [ "@bcoe/v8-coverage@1.0.2", - "@vitest/utils@4.1.10", + "@vitest/utils@4.1.12", "ast-v8-to-istanbul@1.0.5", "istanbul-lib-coverage@3.2.2", "istanbul-lib-report@3.0.1", @@ -2875,9 +2881,8 @@ "obug@2.1.4", "std-env@4.2.0", "tinyrainbow@3.1.0", - "vitest@4.1.10" - ], - "integrity": "sha512-IM49HmthevbgAO4anp1hwtoT9wYe59w0LR00gr+eagHE+ZJ5lK4sLPeO0ubgoJcwLk6dehU3R24N+FbEEKDc8g==" + "vitest@4.1.12" + ] }, { "name": "@vitest/expect", @@ -2886,47 +2891,47 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==", "dependencies": [ "@types/chai@5.2.3", "@vitest/spy@3.2.4", "@vitest/utils@3.2.4", "chai@5.3.3", "tinyrainbow@2.0.0" - ], - "integrity": "sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==" + ] }, { "name": "@vitest/expect", - "version": "4.1.10", + "version": "4.1.12", "direct": false, "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-vFlTt+YEu9WBpNjdGayNmlMVzrWPi1+sv853/7t2FU7hpO5gAFBKHzQmkCq5Xjpr+evegF2994LQT3hF3mRlqQ==", "dependencies": [ "@standard-schema/spec@1.1.0", "@types/chai@5.2.3", - "@vitest/spy@4.1.10", - "@vitest/utils@4.1.10", + "@vitest/spy@4.1.12", + "@vitest/utils@4.1.12", "chai@6.2.2", "tinyrainbow@3.1.0" - ], - "integrity": "sha512-YsCn+qAk1GWjQOWFEsEcL2gNQ0zmVmQu3T03qP6UyjhtmdtwtbuI+DASn/7iQB3HGTXkdBwGddzxPlmiql5vlA==" + ] }, { "name": "@vitest/mocker", - "version": "4.1.10", + "version": "4.1.12", "direct": false, "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-fKShNpKZzupWZuY0z7egydvL0sqW4INEZBEExMBMAa6izlENEVHwoXgdaTCaBZ5fwlr4xf2o1wXC83n9RpO+NA==", "dependencies": [ - "@vitest/spy@4.1.10", + "@vitest/spy@4.1.12", "estree-walker@3.0.3", "magic-string@0.30.21", "msw@2.15.0", - "vite@8.1.5" - ], - "integrity": "sha512-v0xaezt+DKEmKfaxg133ldzADrwLGd7Ze1MfQQTYfvs8OqZIwbxyxaYURivwV7sWy5fqn3rH5uOrSp07bp44Ow==" + "vite@8.1.6" + ] }, { "name": "@vitest/pretty-format", @@ -2935,50 +2940,50 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==", "dependencies": [ "tinyrainbow@2.0.0" - ], - "integrity": "sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==" + ] }, { "name": "@vitest/pretty-format", - "version": "4.1.10", + "version": "4.1.12", "direct": false, "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-XW9O8+Mxx4VpCtkYdMJLZQQwsVryP9wk7cPKDxtXFfwSak6yRh5+2fep/Y0XF/ElBvJHq8bcYdi6aeuai0opZA==", "dependencies": [ "tinyrainbow@3.1.0" - ], - "integrity": "sha512-W1HsjSH4MXQ9YfmmhLAoIYf1HRfekQCGngeIgcei6MP5QQGWUe0gkopdZQaVCFO+JDJMrAJGwa5pRpNpvy4P8Q==" + ] }, { "name": "@vitest/runner", - "version": "4.1.10", + "version": "4.1.12", "direct": false, "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-NKlVKCr5QnCe8jijdMnmkpHHU+WTqiLFR6G0pHji9uRjXK9xJl1k1nTw6F3pOOj2PDcsDt2GKQMI7wIsaT491w==", "dependencies": [ - "@vitest/utils@4.1.10", + "@vitest/utils@4.1.12", "pathe@2.0.3" - ], - "integrity": "sha512-IKI6kpIH+LmpROplyLwBBaCfMgOZOMsygVa6BARD6ahA04VRuJSa6OaVG7kRvSEMD870Vd91rSSw0eegtWyLGg==" + ] }, { "name": "@vitest/snapshot", - "version": "4.1.10", + "version": "4.1.12", "direct": false, "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-ko1y1Qgb/slzQ9mr+b89Cuqud8WG1TKtsPD8r7ZUBdvVOGt85Af2HwCqHujrhwJq95hs/9RM7fcAPg57o1vlzw==", "dependencies": [ - "@vitest/pretty-format@4.1.10", - "@vitest/utils@4.1.10", + "@vitest/pretty-format@4.1.12", + "@vitest/utils@4.1.12", "magic-string@0.30.21", "pathe@2.0.3" - ], - "integrity": "sha512-xRkfOT1qpTAi/Ti4Y1LtfRc3kEuqxGw59eN2jN9pRWMtS/XDevekhcFSqvQqjUNGksfjMJu3Y+oJ+4Ypn2OaJw==" + ] }, { "name": "@vitest/spy", @@ -2987,20 +2992,20 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==", "dependencies": [ "tinyspy@4.0.4" - ], - "integrity": "sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==" + ] }, { "name": "@vitest/spy", - "version": "4.1.10", + "version": "4.1.12", "direct": false, "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-PLf/Ugvoq5wO/b4rwYCR1h2PSIdXz7wnkQFMiUpLdtM7l6pqVFcQIBEHyT1+l+cj7mNwAfZHzqXqDyjvOuwbDw==" + "integrity": "sha512-RGq9x4JNGNTZHEJxvN0oSiJjeSCExm0n2gZKKJZHY9cX5AVA6M7VJILBT3ZJ/tJ/0J9uWT7fETV9/btoi//vSg==", + "dependencies": [] }, { "name": "@vitest/utils", @@ -3009,26 +3014,26 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==", "dependencies": [ "@vitest/pretty-format@3.2.4", "loupe@3.2.1", "tinyrainbow@2.0.0" - ], - "integrity": "sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==" + ] }, { "name": "@vitest/utils", - "version": "4.1.10", + "version": "4.1.12", "direct": false, "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-Q3awXrwOfEV+qc3WmO5ONyE0yO7Q1gQ9/oyHxGLZ/pl7N3NO/ZztqQwKLuwMkV+CA1JYSIeO3gkHnRDIo4AVaA==", "dependencies": [ - "@vitest/pretty-format@4.1.10", + "@vitest/pretty-format@4.1.12", "convert-source-map@2.0.0", "tinyrainbow@3.1.0" - ], - "integrity": "sha512-fy9am/HWxbaGt/Sawrp90vt6Y6jQwf1RX77cz3uwoJwJVMli/e1IEwRPnMNJ7vKfPTwo0diXifkpPvwH9v7nGA==" + ] }, { "name": "@webcontainer/env", @@ -3037,8 +3042,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-6aN99yL695Hi9SuIk1oC88l9o0gmxL1nGWWQ/kNy81HigJ0FoaoTXpytCj6ItzgyCEwA9kF1wixsTuv5cjsgng==" + "integrity": "sha512-6aN99yL695Hi9SuIk1oC88l9o0gmxL1nGWWQ/kNy81HigJ0FoaoTXpytCj6ItzgyCEwA9kF1wixsTuv5cjsgng==", + "dependencies": [] }, { "name": "acorn-jsx-walk", @@ -3047,8 +3052,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-uuo6iJj4D4ygkdzd6jPtcxs8vZgDX9YFIkqczGImoypX2fQ4dVImmu3UzA4ynixCIMTrEOWW+95M2HuBaCEOVA==" + "integrity": "sha512-uuo6iJj4D4ygkdzd6jPtcxs8vZgDX9YFIkqczGImoypX2fQ4dVImmu3UzA4ynixCIMTrEOWW+95M2HuBaCEOVA==", + "dependencies": [] }, { "name": "acorn-jsx", @@ -3057,10 +3062,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dependencies": [ "acorn@8.17.0" - ], - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==" + ] }, { "name": "acorn-loose", @@ -3069,10 +3074,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-PPvV6g8UGMGgjrMu+n/f9E/tCSkNQ2Y97eFvuVdJfG11+xdIeDcLyNdC8SHcrHbRqkfwLASdplyR6B6sKM1U4A==", "dependencies": [ "acorn@8.17.0" - ], - "integrity": "sha512-PPvV6g8UGMGgjrMu+n/f9E/tCSkNQ2Y97eFvuVdJfG11+xdIeDcLyNdC8SHcrHbRqkfwLASdplyR6B6sKM1U4A==" + ] }, { "name": "acorn-walk", @@ -3081,10 +3086,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-HEHNfbars9v4pgpW6SO1KSPkfoS0xVOM/9UzkJltjlsHZmJasxg8aXkuZa7SMf8vKGIBhpUsPluQSqhJFCqebw==", "dependencies": [ "acorn@8.17.0" - ], - "integrity": "sha512-HEHNfbars9v4pgpW6SO1KSPkfoS0xVOM/9UzkJltjlsHZmJasxg8aXkuZa7SMf8vKGIBhpUsPluQSqhJFCqebw==" + ] }, { "name": "acorn", @@ -3093,8 +3098,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-xRQbDb9BnwDafYNn6Vwl839DYVjqXYb1XVGtWAZ1kcDc6iwAL4hg3B1dZlRiuENFeO2H53gFG3in621AdERVAg==" + "integrity": "sha512-xRQbDb9BnwDafYNn6Vwl839DYVjqXYb1XVGtWAZ1kcDc6iwAL4hg3B1dZlRiuENFeO2H53gFG3in621AdERVAg==", + "dependencies": [] }, { "name": "ajv", @@ -3103,13 +3108,13 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==", "dependencies": [ "fast-deep-equal@3.1.3", "fast-json-stable-stringify@2.1.0", "json-schema-traverse@0.4.1", "uri-js@4.4.1" - ], - "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==" + ] }, { "name": "ansi-regex", @@ -3118,8 +3123,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dependencies": [] }, { "name": "ansi-styles", @@ -3128,10 +3133,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dependencies": [ "color-convert@2.0.1" - ], - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==" + ] }, { "name": "ansi-styles", @@ -3140,8 +3145,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==" + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dependencies": [] }, { "name": "aria-query", @@ -3150,10 +3155,10 @@ "scope": "development", "optional": false, "license": "Apache-2.0", + "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==", "dependencies": [ "dequal@2.0.3" - ], - "integrity": "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==" + ] }, { "name": "aria-query", @@ -3162,8 +3167,8 @@ "scope": "development", "optional": false, "license": "Apache-2.0", - "dependencies": [], - "integrity": "sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==" + "integrity": "sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==", + "dependencies": [] }, { "name": "assertion-error", @@ -3172,8 +3177,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==" + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dependencies": [] }, { "name": "ast-types", @@ -3182,10 +3187,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-6t10qk83GOG8p0vKmaCr8eiilZwO171AvbROMtvvNiwrTly62t+7XkA8RdIIVbpMhCASAsxgAzdRSwh6nw/5Dg==", "dependencies": [ "tslib@2.8.1" - ], - "integrity": "sha512-6t10qk83GOG8p0vKmaCr8eiilZwO171AvbROMtvvNiwrTly62t+7XkA8RdIIVbpMhCASAsxgAzdRSwh6nw/5Dg==" + ] }, { "name": "ast-v8-to-istanbul", @@ -3194,12 +3199,12 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-UPAgKJFSEGMWSDr3LX4tqnAb4f7KGT8O40Tyx8wbYmmZ/yn58lNCm8h3svs3eXgiGd5AXxz8NDOvXWvicq+rJA==", "dependencies": [ "@jridgewell/trace-mapping@0.3.31", "estree-walker@3.0.3", "js-tokens@10.0.0" - ], - "integrity": "sha512-UPAgKJFSEGMWSDr3LX4tqnAb4f7KGT8O40Tyx8wbYmmZ/yn58lNCm8h3svs3eXgiGd5AXxz8NDOvXWvicq+rJA==" + ] }, { "name": "axe-core", @@ -3208,8 +3213,8 @@ "scope": "development", "optional": false, "license": "MPL-2.0", - "dependencies": [], - "integrity": "sha512-s7iGf5GaVMxEG0ENN9x+xTr7GFZCb1ZP/1uATUpCEK2X78nDB3RwbtFCo9pGAf9ru+VwoQ464DkaLEeRM08wJA==" + "integrity": "sha512-s7iGf5GaVMxEG0ENN9x+xTr7GFZCb1ZP/1uATUpCEK2X78nDB3RwbtFCo9pGAf9ru+VwoQ464DkaLEeRM08wJA==", + "dependencies": [] }, { "name": "balanced-match", @@ -3218,8 +3223,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==" + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dependencies": [] }, { "name": "baseline-browser-mapping", @@ -3228,8 +3233,8 @@ "scope": "development", "optional": false, "license": "Apache-2.0", - "dependencies": [], - "integrity": "sha512-HYXq73DDpCtNzOmrFsm9eSwCvWCql0RzqjpDzXN9EadiLJ4DNat0nsZ/Bzmy+Ud12mb4/zKDY0cQ805ZzN+i0A==" + "integrity": "sha512-HYXq73DDpCtNzOmrFsm9eSwCvWCql0RzqjpDzXN9EadiLJ4DNat0nsZ/Bzmy+Ud12mb4/zKDY0cQ805ZzN+i0A==", + "dependencies": [] }, { "name": "bidi-js", @@ -3238,22 +3243,22 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-RKshQI1R3YQ+n9YJz2QQ147P66ELpa1FQEg20Dk8oW9t2KgLbpDLLp9aGZ7y8WHSshDknG0bknqGw5/tyCs5tw==", "dependencies": [ "require-from-string@2.0.2" - ], - "integrity": "sha512-RKshQI1R3YQ+n9YJz2QQ147P66ELpa1FQEg20Dk8oW9t2KgLbpDLLp9aGZ7y8WHSshDknG0bknqGw5/tyCs5tw==" + ] }, { "name": "brace-expansion", - "version": "5.0.8", + "version": "5.0.12", "direct": false, "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", "dependencies": [ "balanced-match@4.0.4" - ], - "integrity": "sha512-JZyDyq3D4AUifKTPOB7DELf6XsB3WdPuNxCtob1vFXPsSXhdAiHBWJ/tJ8HAc9aH84BK+5JFZLNkJKx3G9kzQg==" + ] }, { "name": "browserslist", @@ -3262,14 +3267,14 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-JxV13hNrFxqjOc8alRbq9dK1MM79NEXYpma2B2J4wAtpWS5zIEIKqWPGCl7N4o7Uc7B7itylh7SuDujATRyyTw==", "dependencies": [ "baseline-browser-mapping@2.11.1", "caniuse-lite@1.0.30001806", "electron-to-chromium@1.5.396", "node-releases@2.0.51", "update-browserslist-db@1.2.3" - ], - "integrity": "sha512-JxV13hNrFxqjOc8alRbq9dK1MM79NEXYpma2B2J4wAtpWS5zIEIKqWPGCl7N4o7Uc7B7itylh7SuDujATRyyTw==" + ] }, { "name": "bundle-name", @@ -3278,10 +3283,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==", "dependencies": [ "run-applescript@7.1.0" - ], - "integrity": "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==" + ] }, { "name": "caniuse-lite", @@ -3290,8 +3295,8 @@ "scope": "development", "optional": false, "license": "CC-BY-4.0", - "dependencies": [], - "integrity": "sha512-72Cuvd95zbSYPKq6Fhg8eDJRlzgWDf7/mtoZv6Qe/DYNCEBdNxoA3+rZAU2ZhGCpZlns3EssFavaZomckT5Uuw==" + "integrity": "sha512-72Cuvd95zbSYPKq6Fhg8eDJRlzgWDf7/mtoZv6Qe/DYNCEBdNxoA3+rZAU2ZhGCpZlns3EssFavaZomckT5Uuw==", + "dependencies": [] }, { "name": "chai", @@ -3300,14 +3305,14 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==", "dependencies": [ "assertion-error@2.0.1", "check-error@2.1.3", "deep-eql@5.0.2", "loupe@3.2.1", "pathval@2.0.1" - ], - "integrity": "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==" + ] }, { "name": "chai", @@ -3316,8 +3321,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==" + "integrity": "sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==", + "dependencies": [] }, { "name": "chalk", @@ -3326,11 +3331,11 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dependencies": [ "ansi-styles@4.3.0", "supports-color@7.2.0" - ], - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==" + ] }, { "name": "check-error", @@ -3339,8 +3344,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==" + "integrity": "sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==", + "dependencies": [] }, { "name": "cli-width", @@ -3349,8 +3354,8 @@ "scope": "development", "optional": false, "license": "ISC", - "dependencies": [], - "integrity": "sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==" + "integrity": "sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==", + "dependencies": [] }, { "name": "cliui", @@ -3359,12 +3364,12 @@ "scope": "development", "optional": false, "license": "ISC", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", "dependencies": [ "string-width@4.2.3", "strip-ansi@6.0.1", "wrap-ansi@7.0.0" - ], - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==" + ] }, { "name": "color-convert", @@ -3373,10 +3378,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dependencies": [ "color-name@1.1.4" - ], - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==" + ] }, { "name": "color-name", @@ -3385,8 +3390,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dependencies": [] }, { "name": "commander", @@ -3395,8 +3400,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-z67u4ZhzCL/Tydu1lJARtEZYWbWaN7oYLHbsuzocr6y4N6WZAagG3RQ4FW61V1/0+jImpj293XfrcYnd1qxtPg==" + "integrity": "sha512-z67u4ZhzCL/Tydu1lJARtEZYWbWaN7oYLHbsuzocr6y4N6WZAagG3RQ4FW61V1/0+jImpj293XfrcYnd1qxtPg==", + "dependencies": [] }, { "name": "convert-source-map", @@ -3405,8 +3410,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==" + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dependencies": [] }, { "name": "cookie", @@ -3415,8 +3420,8 @@ "scope": "production", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==" + "integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==", + "dependencies": [] }, { "name": "cross-spawn", @@ -3425,12 +3430,12 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dependencies": [ "path-key@3.1.1", "shebang-command@2.0.0", "which@2.0.2" - ], - "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==" + ] }, { "name": "css-tree", @@ -3439,11 +3444,11 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-X7sjQzceUhu1u7Y/ylrRZFU2FS6LRiFVp6rKLPg23y3x3c3DOKAwuXGDp+PAGjh6CSnCjYeAul8pcT8bAl+lSA==", "dependencies": [ "mdn-data@2.27.1", - "source-map-js@1.2.1" - ], - "integrity": "sha512-X7sjQzceUhu1u7Y/ylrRZFU2FS6LRiFVp6rKLPg23y3x3c3DOKAwuXGDp+PAGjh6CSnCjYeAul8pcT8bAl+lSA==" + "source-map-js@1.2.2" + ] }, { "name": "css.escape", @@ -3452,8 +3457,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==" + "integrity": "sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==", + "dependencies": [] }, { "name": "csstype", @@ -3462,8 +3467,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==" + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "dependencies": [] }, { "name": "data-urls", @@ -3472,11 +3477,11 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-23XHcCF+coGYevirZceTVD7NdJOqVn+49IHyxgszm+JIiHLoB2TkmPtsYkNWT1pvRSGkc35L6NHs0yHkN2SumA==", "dependencies": [ "whatwg-mimetype@5.0.0", "whatwg-url@16.0.1" - ], - "integrity": "sha512-23XHcCF+coGYevirZceTVD7NdJOqVn+49IHyxgszm+JIiHLoB2TkmPtsYkNWT1pvRSGkc35L6NHs0yHkN2SumA==" + ] }, { "name": "debug", @@ -3485,11 +3490,11 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", "dependencies": [ "ms@2.1.3", "supports-color@7.2.0" - ], - "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==" + ] }, { "name": "decimal.js", @@ -3498,8 +3503,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==" + "integrity": "sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg==", + "dependencies": [] }, { "name": "deep-eql", @@ -3508,8 +3513,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==" + "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", + "dependencies": [] }, { "name": "deep-is", @@ -3518,8 +3523,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dependencies": [] }, { "name": "default-browser-id", @@ -3528,8 +3533,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==" + "integrity": "sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==", + "dependencies": [] }, { "name": "default-browser", @@ -3538,11 +3543,11 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-H9LMLr5zwIbSxrmvikGuI/5KGhZ8E2zH3stkMgM5LpOWDutGM2JZaj460Udnf1a+946zc7YBgrqEWwbk7zHvGw==", "dependencies": [ "bundle-name@4.1.0", "default-browser-id@5.0.1" - ], - "integrity": "sha512-H9LMLr5zwIbSxrmvikGuI/5KGhZ8E2zH3stkMgM5LpOWDutGM2JZaj460Udnf1a+946zc7YBgrqEWwbk7zHvGw==" + ] }, { "name": "define-lazy-prop", @@ -3551,8 +3556,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==" + "integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==", + "dependencies": [] }, { "name": "dependency-cruiser", @@ -3561,6 +3566,7 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-pbsH0gQ15BxXi97SCuMeVgsh8VzYpziGIVaMdnALbVu+TYjSZrW9/nOvsPU+NjHLmJSF9R1UijjoACq6Ne/ybQ==", "dependencies": [ "acorn-jsx-walk@2.0.0", "acorn-jsx@5.3.2", @@ -3580,8 +3586,7 @@ "semver@7.8.5", "tsconfig-paths-webpack-plugin@4.2.0", "watskeburt@6.0.0" - ], - "integrity": "sha512-pbsH0gQ15BxXi97SCuMeVgsh8VzYpziGIVaMdnALbVu+TYjSZrW9/nOvsPU+NjHLmJSF9R1UijjoACq6Ne/ybQ==" + ] }, { "name": "dequal", @@ -3590,8 +3595,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==" + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "dependencies": [] }, { "name": "detect-libc", @@ -3600,8 +3605,8 @@ "scope": "development", "optional": false, "license": "Apache-2.0", - "dependencies": [], - "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==" + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "dependencies": [] }, { "name": "doctrine", @@ -3610,10 +3615,10 @@ "scope": "development", "optional": false, "license": "Apache-2.0", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dependencies": [ "esutils@2.0.3" - ], - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==" + ] }, { "name": "dom-accessibility-api", @@ -3622,8 +3627,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==" + "integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==", + "dependencies": [] }, { "name": "dom-accessibility-api", @@ -3632,8 +3637,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==" + "integrity": "sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==", + "dependencies": [] }, { "name": "electron-to-chromium", @@ -3642,8 +3647,8 @@ "scope": "development", "optional": false, "license": "ISC", - "dependencies": [], - "integrity": "sha512-yHiw2Y3C3H9U6TMbOfoWK/BPreiOPXRfTWPBwQBoZG6/8TB6eOPnsy5oaRYuatR7Fw2SJ4kKforgufeo7fq0EQ==" + "integrity": "sha512-yHiw2Y3C3H9U6TMbOfoWK/BPreiOPXRfTWPBwQBoZG6/8TB6eOPnsy5oaRYuatR7Fw2SJ4kKforgufeo7fq0EQ==", + "dependencies": [] }, { "name": "emoji-regex", @@ -3652,8 +3657,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dependencies": [] }, { "name": "empathic", @@ -3662,8 +3667,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-YGRs8knHhKHVShLkFET/rWAU8kmHbOV5LwN938RHI0pljAJ1Gf6SzXsSmRaEzcXTtOOmVqJ5+WtQPL5uigY50Q==" + "integrity": "sha512-YGRs8knHhKHVShLkFET/rWAU8kmHbOV5LwN938RHI0pljAJ1Gf6SzXsSmRaEzcXTtOOmVqJ5+WtQPL5uigY50Q==", + "dependencies": [] }, { "name": "enhanced-resolve", @@ -3672,11 +3677,11 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-rpsZEGT1jFuve6QlpyRp9ckQ+kN61hvF9BzCPyMdaKTm8UJce96KBn3sorXOFXlzjPrs3Vc4T1NsSroZ3PxlFw==", "dependencies": [ "graceful-fs@4.2.11", "tapable@2.3.3" - ], - "integrity": "sha512-rpsZEGT1jFuve6QlpyRp9ckQ+kN61hvF9BzCPyMdaKTm8UJce96KBn3sorXOFXlzjPrs3Vc4T1NsSroZ3PxlFw==" + ] }, { "name": "entities", @@ -3685,8 +3690,8 @@ "scope": "development", "optional": false, "license": "BSD-2-Clause", - "dependencies": [], - "integrity": "sha512-zwfzJecQ/Uej6tusMqwAqU/6KL2XaB2VZ2Jg54Je6ahNBGNH6Ek6g3jjNCF0fG9EWQKGZNddNjU5F1ZQn/sBnA==" + "integrity": "sha512-zwfzJecQ/Uej6tusMqwAqU/6KL2XaB2VZ2Jg54Je6ahNBGNH6Ek6g3jjNCF0fG9EWQKGZNddNjU5F1ZQn/sBnA==", + "dependencies": [] }, { "name": "es-errors", @@ -3695,8 +3700,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==" + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dependencies": [] }, { "name": "es-module-lexer", @@ -3705,8 +3710,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-shc1dbU90Yl/xq1QrC7QRtfcwURZuVRfPhZbDoldJ1cn1gzDvBaBWlv0eFolj5+0znnPJz5TXLxsN77X/12KTA==" + "integrity": "sha512-shc1dbU90Yl/xq1QrC7QRtfcwURZuVRfPhZbDoldJ1cn1gzDvBaBWlv0eFolj5+0znnPJz5TXLxsN77X/12KTA==", + "dependencies": [] }, { "name": "esbuild", @@ -3715,6 +3720,7 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==", "dependencies": [ "@esbuild/aix-ppc64@0.28.1", "@esbuild/android-arm64@0.28.1", @@ -3742,8 +3748,7 @@ "@esbuild/win32-arm64@0.28.1", "@esbuild/win32-ia32@0.28.1", "@esbuild/win32-x64@0.28.1" - ], - "integrity": "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==" + ] }, { "name": "escalade", @@ -3752,8 +3757,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==" + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dependencies": [] }, { "name": "escape-string-regexp", @@ -3762,8 +3767,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dependencies": [] }, { "name": "eslint-plugin-react-hooks", @@ -3772,15 +3777,15 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-f2I7Gw6JbvCexzIInuSbZpfdQ44D7iqdWX01FKLvrPgqxoE7oMj8clOfto8U6vYiz4yd5oKu39rRSVOe1zRu0g==", "dependencies": [ "@babel/core@7.29.7", "@babel/parser@7.29.7", "eslint@10.8.0", "hermes-parser@0.25.1", "zod-validation-error@4.0.2", - "zod@4.4.3" - ], - "integrity": "sha512-f2I7Gw6JbvCexzIInuSbZpfdQ44D7iqdWX01FKLvrPgqxoE7oMj8clOfto8U6vYiz4yd5oKu39rRSVOe1zRu0g==" + "zod@4.6.7" + ] }, { "name": "eslint-scope", @@ -3789,13 +3794,13 @@ "scope": "development", "optional": false, "license": "BSD-2-Clause", + "integrity": "sha512-xS90H51cKw0jltxmvmHy2Iai1LIqrfbw57b79w/J7MfvDfkIkFZ+kj6zC3BjtUwh150HsSSdxXZcsuv72miDFQ==", "dependencies": [ "@types/esrecurse@4.3.1", "@types/estree@1.0.9", "esrecurse@4.3.0", "estraverse@5.3.0" - ], - "integrity": "sha512-xS90H51cKw0jltxmvmHy2Iai1LIqrfbw57b79w/J7MfvDfkIkFZ+kj6zC3BjtUwh150HsSSdxXZcsuv72miDFQ==" + ] }, { "name": "eslint-visitor-keys", @@ -3804,8 +3809,8 @@ "scope": "development", "optional": false, "license": "Apache-2.0", - "dependencies": [], - "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==" + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dependencies": [] }, { "name": "eslint-visitor-keys", @@ -3814,8 +3819,8 @@ "scope": "development", "optional": false, "license": "Apache-2.0", - "dependencies": [], - "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==" + "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", + "dependencies": [] }, { "name": "eslint", @@ -3824,6 +3829,7 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-nuKKvN+oIBO0koN7Tm7dlkmnkc21mtt0QJLwAKzjLq14y6lRTdVG36MZHJ8eQHwdJMwZbQNMlPOYedMq/oVJvQ==", "dependencies": [ "@eslint-community/eslint-utils@4.10.1", "@eslint-community/regexpp@4.12.2", @@ -3856,8 +3862,7 @@ "minimatch@10.2.5", "natural-compare@1.4.0", "optionator@0.9.4" - ], - "integrity": "sha512-nuKKvN+oIBO0koN7Tm7dlkmnkc21mtt0QJLwAKzjLq14y6lRTdVG36MZHJ8eQHwdJMwZbQNMlPOYedMq/oVJvQ==" + ] }, { "name": "espree", @@ -3866,12 +3871,12 @@ "scope": "development", "optional": false, "license": "BSD-2-Clause", + "integrity": "sha512-7p3DrVEIopW1B1avAGLuCSh1jubc01H2JHc8B4qqGblmg5gI9yumBgACjWo4JlIc04ufug4xJ3SQI8HkS/Rgzw==", "dependencies": [ "acorn-jsx@5.3.2", "acorn@8.17.0", "eslint-visitor-keys@5.0.1" - ], - "integrity": "sha512-7p3DrVEIopW1B1avAGLuCSh1jubc01H2JHc8B4qqGblmg5gI9yumBgACjWo4JlIc04ufug4xJ3SQI8HkS/Rgzw==" + ] }, { "name": "esprima", @@ -3880,8 +3885,8 @@ "scope": "development", "optional": false, "license": "BSD-2-Clause", - "dependencies": [], - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dependencies": [] }, { "name": "esquery", @@ -3890,10 +3895,10 @@ "scope": "development", "optional": false, "license": "BSD-3-Clause", + "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==", "dependencies": [ "estraverse@5.3.0" - ], - "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==" + ] }, { "name": "esrecurse", @@ -3902,10 +3907,10 @@ "scope": "development", "optional": false, "license": "BSD-2-Clause", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dependencies": [ "estraverse@5.3.0" - ], - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==" + ] }, { "name": "estraverse", @@ -3914,8 +3919,8 @@ "scope": "development", "optional": false, "license": "BSD-2-Clause", - "dependencies": [], - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==" + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dependencies": [] }, { "name": "estree-walker", @@ -3924,8 +3929,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==" + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "dependencies": [] }, { "name": "estree-walker", @@ -3934,10 +3939,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", "dependencies": [ "@types/estree@1.0.9" - ], - "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==" + ] }, { "name": "esutils", @@ -3946,8 +3951,8 @@ "scope": "development", "optional": false, "license": "BSD-2-Clause", - "dependencies": [], - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==" + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dependencies": [] }, { "name": "expect-type", @@ -3956,8 +3961,8 @@ "scope": "development", "optional": false, "license": "Apache-2.0", - "dependencies": [], - "integrity": "sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==" + "integrity": "sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA==", + "dependencies": [] }, { "name": "fast-deep-equal", @@ -3966,8 +3971,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dependencies": [] }, { "name": "fast-json-stable-stringify", @@ -3976,8 +3981,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dependencies": [] }, { "name": "fast-levenshtein", @@ -3986,8 +3991,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dependencies": [] }, { "name": "fast-string-truncated-width", @@ -3996,8 +4001,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g==" + "integrity": "sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g==", + "dependencies": [] }, { "name": "fast-string-width", @@ -4006,10 +4011,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-gX8LrtNEI5hq8DVUfRQMbr5lpaS4nMIWV+7XEbXk2b8kiQIizgnlr12B4dA3ZEx3308ze0O4Q1R+cHts8kyUJg==", "dependencies": [ "fast-string-truncated-width@3.0.3" - ], - "integrity": "sha512-gX8LrtNEI5hq8DVUfRQMbr5lpaS4nMIWV+7XEbXk2b8kiQIizgnlr12B4dA3ZEx3308ze0O4Q1R+cHts8kyUJg==" + ] }, { "name": "fast-wrap-ansi", @@ -4018,10 +4023,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-7F2Fl+TjRSenLqlU3UjSH0iyqopqoZIu7eZVpEirP2g1GtWa2G/ecEmBdgz31+Mxr+ELclgg6sokpSFIQiZ02Q==", "dependencies": [ "fast-string-width@3.0.2" - ], - "integrity": "sha512-7F2Fl+TjRSenLqlU3UjSH0iyqopqoZIu7eZVpEirP2g1GtWa2G/ecEmBdgz31+Mxr+ELclgg6sokpSFIQiZ02Q==" + ] }, { "name": "fdir", @@ -4030,10 +4035,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", "dependencies": [ "picomatch@4.0.5" - ], - "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==" + ] }, { "name": "file-entry-cache", @@ -4042,10 +4047,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", "dependencies": [ "flat-cache@4.0.1" - ], - "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==" + ] }, { "name": "find-up", @@ -4054,11 +4059,11 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", "dependencies": [ "locate-path@6.0.0", "path-exists@4.0.0" - ], - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==" + ] }, { "name": "flat-cache", @@ -4067,11 +4072,11 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", "dependencies": [ "flatted@3.4.3", "keyv@4.5.4" - ], - "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==" + ] }, { "name": "flatted", @@ -4080,8 +4085,8 @@ "scope": "development", "optional": false, "license": "ISC", - "dependencies": [], - "integrity": "sha512-/zipXxyO6rGvuNGDiULY9MvEGSkb2gaG4GGH4ygMi0ZZzyMHdUZBmntJmx5x1G2VuPytCwGN4xsJP6cw+sK+vQ==" + "integrity": "sha512-/zipXxyO6rGvuNGDiULY9MvEGSkb2gaG4GGH4ygMi0ZZzyMHdUZBmntJmx5x1G2VuPytCwGN4xsJP6cw+sK+vQ==", + "dependencies": [] }, { "name": "fsevents", @@ -4090,8 +4095,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==" + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dependencies": [] }, { "name": "fsevents", @@ -4100,8 +4105,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==" + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dependencies": [] }, { "name": "function-bind", @@ -4110,8 +4115,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==" + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dependencies": [] }, { "name": "gensync", @@ -4120,8 +4125,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==" + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dependencies": [] }, { "name": "get-caller-file", @@ -4130,8 +4135,8 @@ "scope": "development", "optional": false, "license": "ISC", - "dependencies": [], - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dependencies": [] }, { "name": "glob-parent", @@ -4140,10 +4145,10 @@ "scope": "development", "optional": false, "license": "ISC", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", "dependencies": [ "is-glob@4.0.3" - ], - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==" + ] }, { "name": "glob", @@ -4152,12 +4157,12 @@ "scope": "development", "optional": false, "license": "BlueOak-1.0.0", + "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==", "dependencies": [ "minimatch@10.2.5", "minipass@7.1.3", "path-scurry@2.0.2" - ], - "integrity": "sha512-Wjlyrolmm8uDpm/ogGyXZXb1Z+Ca2B8NbJwqBVg0axK9GbBeoS7yGV6vjXnYdGm6X53iehEuxxbyiKp8QmN4Vw==" + ] }, { "name": "global-directory", @@ -4166,10 +4171,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q==", "dependencies": [ "ini@4.1.1" - ], - "integrity": "sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q==" + ] }, { "name": "globals", @@ -4178,8 +4183,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-Czmyns5dUsq4seFBR/Kdydhmo8y9kC79hiSkPn0YcGtNnYWnrgt0vjrSjx9tspoDGWm2CMarffRuLjM4xUz8xg==" + "integrity": "sha512-Czmyns5dUsq4seFBR/Kdydhmo8y9kC79hiSkPn0YcGtNnYWnrgt0vjrSjx9tspoDGWm2CMarffRuLjM4xUz8xg==", + "dependencies": [] }, { "name": "graceful-fs", @@ -4188,8 +4193,8 @@ "scope": "development", "optional": false, "license": "ISC", - "dependencies": [], - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dependencies": [] }, { "name": "graphql", @@ -4198,8 +4203,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-Chq1s4CY7jmh8gO2qvLIJyfCDIN+EHLFW/9iShnp1z8FjBQMoodWP1kDC36VAMXXIvAjj4ARa7ntfAV2BrjsbA==" + "integrity": "sha512-Chq1s4CY7jmh8gO2qvLIJyfCDIN+EHLFW/9iShnp1z8FjBQMoodWP1kDC36VAMXXIvAjj4ARa7ntfAV2BrjsbA==", + "dependencies": [] }, { "name": "has-flag", @@ -4208,8 +4213,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dependencies": [] }, { "name": "hasown", @@ -4218,10 +4223,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", "dependencies": [ "function-bind@1.1.2" - ], - "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==" + ] }, { "name": "headers-polyfill", @@ -4230,11 +4235,11 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-1TJ6Fih/b8h5TIcv+1+Hw0PDQWJTKDKzFZzcKOiW1wJza3XoAQlkCuXLbymPYB8+ZQyw8mHvdw560e8zVFIWyA==", "dependencies": [ "@types/set-cookie-parser@2.4.10", "set-cookie-parser@3.1.2" - ], - "integrity": "sha512-1TJ6Fih/b8h5TIcv+1+Hw0PDQWJTKDKzFZzcKOiW1wJza3XoAQlkCuXLbymPYB8+ZQyw8mHvdw560e8zVFIWyA==" + ] }, { "name": "hermes-estree", @@ -4243,8 +4248,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw==" + "integrity": "sha512-0wUoCcLp+5Ev5pDW2OriHC2MJCbwLwuRx+gAqMTOkGKJJiBCLjtrvy4PWUGn6MIVefecRpzoOZ/UV6iGdOr+Cw==", + "dependencies": [] }, { "name": "hermes-parser", @@ -4253,10 +4258,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA==", "dependencies": [ "hermes-estree@0.25.1" - ], - "integrity": "sha512-6pEjquH3rqaI6cYAXYPcz9MS4rY6R4ngRgrgfDshRptUZIc3lw0MCIJIGDj9++mfySOuPTHB4nrSW99BCvOPIA==" + ] }, { "name": "html-encoding-sniffer", @@ -4265,10 +4270,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-CV9TW3Y3f8/wT0BRFc1/KAVQ3TUHiXmaAb6VW9vtiMFf7SLoMd1PdAc4W3KFOFETBJUb90KatHqlsZMWV+R9Gg==", "dependencies": [ "@exodus/bytes@1.15.1" - ], - "integrity": "sha512-CV9TW3Y3f8/wT0BRFc1/KAVQ3TUHiXmaAb6VW9vtiMFf7SLoMd1PdAc4W3KFOFETBJUb90KatHqlsZMWV+R9Gg==" + ] }, { "name": "html-escaper", @@ -4277,8 +4282,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==" + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dependencies": [] }, { "name": "ignore", @@ -4287,8 +4292,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==" + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dependencies": [] }, { "name": "ignore", @@ -4297,8 +4302,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-BAg6QkE8W+TuQLrrw0Ugr7HegXduRuuj8/ti2kSOc+jz1dmx8/WNcjr6XGnq5YpDWxFwwaavqD0+jIUOKelTsw==" + "integrity": "sha512-BAg6QkE8W+TuQLrrw0Ugr7HegXduRuuj8/ti2kSOc+jz1dmx8/WNcjr6XGnq5YpDWxFwwaavqD0+jIUOKelTsw==", + "dependencies": [] }, { "name": "import-meta-resolve", @@ -4307,8 +4312,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-Iqv2fzaTQN28s/FwZAoFq0ZSs/7hMAHJVX+w8PZl3cY19Pxk6jFFalxQoIfW2826i/fDLXv8IiEZRIT0lDuWcg==" + "integrity": "sha512-Iqv2fzaTQN28s/FwZAoFq0ZSs/7hMAHJVX+w8PZl3cY19Pxk6jFFalxQoIfW2826i/fDLXv8IiEZRIT0lDuWcg==", + "dependencies": [] }, { "name": "imurmurhash", @@ -4317,8 +4322,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==" + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dependencies": [] }, { "name": "indent-string", @@ -4327,8 +4332,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==" + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dependencies": [] }, { "name": "ini", @@ -4337,8 +4342,8 @@ "scope": "development", "optional": false, "license": "ISC", - "dependencies": [], - "integrity": "sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==" + "integrity": "sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==", + "dependencies": [] }, { "name": "interpret", @@ -4347,8 +4352,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==" + "integrity": "sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==", + "dependencies": [] }, { "name": "is-core-module", @@ -4357,10 +4362,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-evOr8xfXKxE6qSR0hSXL2r3sd7ALj8+7jQEUvPYcm5sgZFdJ+AYzT6yNmJenvIYQBgIGwfwz08sL8zoL7yq2BA==", "dependencies": [ "hasown@2.0.4" - ], - "integrity": "sha512-evOr8xfXKxE6qSR0hSXL2r3sd7ALj8+7jQEUvPYcm5sgZFdJ+AYzT6yNmJenvIYQBgIGwfwz08sL8zoL7yq2BA==" + ] }, { "name": "is-docker", @@ -4369,8 +4374,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==" + "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", + "dependencies": [] }, { "name": "is-extglob", @@ -4379,8 +4384,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dependencies": [] }, { "name": "is-fullwidth-code-point", @@ -4389,8 +4394,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dependencies": [] }, { "name": "is-glob", @@ -4399,10 +4404,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dependencies": [ "is-extglob@2.1.1" - ], - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==" + ] }, { "name": "is-inside-container", @@ -4411,10 +4416,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", "dependencies": [ "is-docker@3.0.0" - ], - "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==" + ] }, { "name": "is-installed-globally", @@ -4423,11 +4428,11 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-K55T22lfpQ63N4KEN57jZUAaAYqYHEe8veb/TycJRk9DdSCLLcovXz/mL6mOnhQaZsQGwPhuFopdQIlqGSEjiQ==", "dependencies": [ "global-directory@4.0.1", "is-path-inside@4.0.0" - ], - "integrity": "sha512-K55T22lfpQ63N4KEN57jZUAaAYqYHEe8veb/TycJRk9DdSCLLcovXz/mL6mOnhQaZsQGwPhuFopdQIlqGSEjiQ==" + ] }, { "name": "is-node-process", @@ -4436,8 +4441,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-Vg4o6/fqPxIjtxgUH5QLJhwZ7gW5diGCVlXpuUfELC62CuxM1iHcRe51f2W1FDy04Ai4KJkagKjx3XaqyfRKXw==" + "integrity": "sha512-Vg4o6/fqPxIjtxgUH5QLJhwZ7gW5diGCVlXpuUfELC62CuxM1iHcRe51f2W1FDy04Ai4KJkagKjx3XaqyfRKXw==", + "dependencies": [] }, { "name": "is-path-inside", @@ -4446,8 +4451,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==" + "integrity": "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==", + "dependencies": [] }, { "name": "is-potential-custom-element-name", @@ -4456,8 +4461,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==" + "integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==", + "dependencies": [] }, { "name": "is-wsl", @@ -4466,10 +4471,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==", "dependencies": [ "is-inside-container@1.0.0" - ], - "integrity": "sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==" + ] }, { "name": "isexe", @@ -4478,8 +4483,8 @@ "scope": "development", "optional": false, "license": "ISC", - "dependencies": [], - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dependencies": [] }, { "name": "istanbul-lib-coverage", @@ -4488,8 +4493,8 @@ "scope": "development", "optional": false, "license": "BSD-3-Clause", - "dependencies": [], - "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==" + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "dependencies": [] }, { "name": "istanbul-lib-report", @@ -4498,12 +4503,12 @@ "scope": "development", "optional": false, "license": "BSD-3-Clause", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", "dependencies": [ "istanbul-lib-coverage@3.2.2", "make-dir@4.0.0", "supports-color@7.2.0" - ], - "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==" + ] }, { "name": "istanbul-reports", @@ -4512,11 +4517,11 @@ "scope": "development", "optional": false, "license": "BSD-3-Clause", + "integrity": "sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==", "dependencies": [ "html-escaper@2.0.2", "istanbul-lib-report@3.0.1" - ], - "integrity": "sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==" + ] }, { "name": "jiti", @@ -4525,8 +4530,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==" + "integrity": "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==", + "dependencies": [] }, { "name": "js-tokens", @@ -4535,8 +4540,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-lM/UBzQmfJRo9ABXbPWemivdCW8V2G8FHaHdypQaIy523snUjog0W71ayWXTjiR+ixeMyVHN2XcpnTd/liPg/Q==" + "integrity": "sha512-lM/UBzQmfJRo9ABXbPWemivdCW8V2G8FHaHdypQaIy523snUjog0W71ayWXTjiR+ixeMyVHN2XcpnTd/liPg/Q==", + "dependencies": [] }, { "name": "js-tokens", @@ -4545,8 +4550,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dependencies": [] }, { "name": "jsdom", @@ -4555,6 +4560,7 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-ECi4Fi2f7BdJtUKTflYRTiaMxIB0O6zfR1fX0GXpUrf6flp8QIYn1UT20YQqdSOfk2dfkCwS8LAFoJDEppNK5Q==", "dependencies": [ "@asamuzakjp/css-color@5.1.11", "@asamuzakjp/dom-selector@7.1.1", @@ -4571,14 +4577,13 @@ "saxes@6.0.0", "symbol-tree@3.2.4", "tough-cookie@6.0.2", - "undici@7.28.0", + "undici@7.30.1", "w3c-xmlserializer@5.0.0", "webidl-conversions@8.0.1", "whatwg-mimetype@5.0.0", "whatwg-url@16.0.1", "xml-name-validator@5.0.0" - ], - "integrity": "sha512-ECi4Fi2f7BdJtUKTflYRTiaMxIB0O6zfR1fX0GXpUrf6flp8QIYn1UT20YQqdSOfk2dfkCwS8LAFoJDEppNK5Q==" + ] }, { "name": "jsesc", @@ -4587,8 +4592,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==" + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "dependencies": [] }, { "name": "json-buffer", @@ -4597,8 +4602,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==" + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dependencies": [] }, { "name": "json-schema-traverse", @@ -4607,8 +4612,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dependencies": [] }, { "name": "json-stable-stringify-without-jsonify", @@ -4617,8 +4622,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==" + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dependencies": [] }, { "name": "json5", @@ -4627,8 +4632,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==" + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "dependencies": [] }, { "name": "jsonc-parser", @@ -4637,8 +4642,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==" + "integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==", + "dependencies": [] }, { "name": "keyv", @@ -4647,10 +4652,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", "dependencies": [ "json-buffer@3.0.1" - ], - "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==" + ] }, { "name": "kleur", @@ -4659,8 +4664,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==" + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "dependencies": [] }, { "name": "levn", @@ -4669,11 +4674,11 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dependencies": [ "prelude-ls@1.2.1", "type-check@0.4.0" - ], - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==" + ] }, { "name": "lightningcss-android-arm64", @@ -4682,8 +4687,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==" + "integrity": "sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==", + "dependencies": [] }, { "name": "lightningcss-android-arm64", @@ -4692,8 +4697,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==" + "integrity": "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==", + "dependencies": [] }, { "name": "lightningcss-darwin-arm64", @@ -4702,8 +4707,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==" + "integrity": "sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==", + "dependencies": [] }, { "name": "lightningcss-darwin-arm64", @@ -4712,8 +4717,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==" + "integrity": "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==", + "dependencies": [] }, { "name": "lightningcss-darwin-x64", @@ -4722,8 +4727,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==" + "integrity": "sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==", + "dependencies": [] }, { "name": "lightningcss-darwin-x64", @@ -4732,8 +4737,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==" + "integrity": "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==", + "dependencies": [] }, { "name": "lightningcss-freebsd-x64", @@ -4742,8 +4747,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==" + "integrity": "sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==", + "dependencies": [] }, { "name": "lightningcss-freebsd-x64", @@ -4752,8 +4757,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==" + "integrity": "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==", + "dependencies": [] }, { "name": "lightningcss-linux-arm-gnueabihf", @@ -4762,8 +4767,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==" + "integrity": "sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==", + "dependencies": [] }, { "name": "lightningcss-linux-arm-gnueabihf", @@ -4772,8 +4777,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==" + "integrity": "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==", + "dependencies": [] }, { "name": "lightningcss-linux-arm64-gnu", @@ -4782,8 +4787,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==" + "integrity": "sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==", + "dependencies": [] }, { "name": "lightningcss-linux-arm64-gnu", @@ -4792,8 +4797,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==" + "integrity": "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==", + "dependencies": [] }, { "name": "lightningcss-linux-arm64-musl", @@ -4802,8 +4807,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==" + "integrity": "sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==", + "dependencies": [] }, { "name": "lightningcss-linux-arm64-musl", @@ -4812,8 +4817,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==" + "integrity": "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==", + "dependencies": [] }, { "name": "lightningcss-linux-x64-gnu", @@ -4822,8 +4827,8 @@ "scope": "development", "optional": false, "license": "MPL-2.0", - "dependencies": [], - "integrity": "sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==" + "integrity": "sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==", + "dependencies": [] }, { "name": "lightningcss-linux-x64-gnu", @@ -4832,8 +4837,8 @@ "scope": "development", "optional": false, "license": "MPL-2.0", - "dependencies": [], - "integrity": "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==" + "integrity": "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==", + "dependencies": [] }, { "name": "lightningcss-linux-x64-musl", @@ -4842,8 +4847,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==" + "integrity": "sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==", + "dependencies": [] }, { "name": "lightningcss-linux-x64-musl", @@ -4852,8 +4857,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==" + "integrity": "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==", + "dependencies": [] }, { "name": "lightningcss-win32-arm64-msvc", @@ -4862,8 +4867,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==" + "integrity": "sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==", + "dependencies": [] }, { "name": "lightningcss-win32-arm64-msvc", @@ -4872,8 +4877,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==" + "integrity": "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==", + "dependencies": [] }, { "name": "lightningcss-win32-x64-msvc", @@ -4882,8 +4887,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==" + "integrity": "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==", + "dependencies": [] }, { "name": "lightningcss-win32-x64-msvc", @@ -4892,8 +4897,8 @@ "scope": "development", "optional": true, "license": "NOASSERTION", - "dependencies": [], - "integrity": "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==" + "integrity": "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==", + "dependencies": [] }, { "name": "lightningcss", @@ -4902,6 +4907,7 @@ "scope": "development", "optional": false, "license": "MPL-2.0", + "integrity": "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==", "dependencies": [ "detect-libc@2.1.2", "lightningcss-android-arm64@1.32.0", @@ -4915,8 +4921,7 @@ "lightningcss-linux-x64-musl@1.32.0", "lightningcss-win32-arm64-msvc@1.32.0", "lightningcss-win32-x64-msvc@1.32.0" - ], - "integrity": "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==" + ] }, { "name": "lightningcss", @@ -4925,6 +4930,7 @@ "scope": "development", "optional": false, "license": "MPL-2.0", + "integrity": "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==", "dependencies": [ "detect-libc@2.1.2", "lightningcss-android-arm64@1.33.0", @@ -4938,8 +4944,7 @@ "lightningcss-linux-x64-musl@1.33.0", "lightningcss-win32-arm64-msvc@1.33.0", "lightningcss-win32-x64-msvc@1.33.0" - ], - "integrity": "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==" + ] }, { "name": "locate-path", @@ -4948,10 +4953,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", "dependencies": [ "p-locate@5.0.0" - ], - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==" + ] }, { "name": "loupe", @@ -4960,8 +4965,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==" + "integrity": "sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==", + "dependencies": [] }, { "name": "lru-cache", @@ -4970,8 +4975,8 @@ "scope": "development", "optional": false, "license": "BlueOak-1.0.0", - "dependencies": [], - "integrity": "sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g==" + "integrity": "sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g==", + "dependencies": [] }, { "name": "lru-cache", @@ -4980,10 +4985,10 @@ "scope": "development", "optional": false, "license": "ISC", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", "dependencies": [ "yallist@3.1.1" - ], - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==" + ] }, { "name": "lucide-react", @@ -4992,10 +4997,10 @@ "scope": "production", "optional": false, "license": "ISC", + "integrity": "sha512-/mdJTRbiwcLOQ1NZZK1amZF9rIZyvO18D6r9TngE6TG1NmqHgFuT4eE7Xrkm9UsXMbBJD1NlfwHVltCDWHrOTw==", "dependencies": [ "react@19.2.8" - ], - "integrity": "sha512-/mdJTRbiwcLOQ1NZZK1amZF9rIZyvO18D6r9TngE6TG1NmqHgFuT4eE7Xrkm9UsXMbBJD1NlfwHVltCDWHrOTw==" + ] }, { "name": "lz-string", @@ -5004,8 +5009,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==" + "integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==", + "dependencies": [] }, { "name": "magic-string", @@ -5014,10 +5019,22 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", "dependencies": [ "@jridgewell/sourcemap-codec@1.5.5" - ], - "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==" + ] + }, + { + "name": "magic-string", + "version": "1.4.5", + "direct": false, + "scope": "development", + "optional": false, + "license": "MIT", + "integrity": "sha512-oLLC2+YvQUfAa+vxoufE/yc1icb87M9iXIRqAoR/2EhE/8cb3SF/+Gi0c2By1B+5Vz2e2vQtUvHiu1+63Znh+w==", + "dependencies": [ + "@jridgewell/sourcemap-codec@1.6.0" + ] }, { "name": "magicast", @@ -5026,12 +5043,12 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-pVKE4UdSQ7DvHzivsCIFx2BJn1mHG6KsyrFcaxFx6tONdneEuThrDx0Cj3AMg58KyN4pzYT+LHOotxDQDjNvkw==", "dependencies": [ "@babel/parser@7.29.7", "@babel/types@7.29.7", - "source-map-js@1.2.1" - ], - "integrity": "sha512-pVKE4UdSQ7DvHzivsCIFx2BJn1mHG6KsyrFcaxFx6tONdneEuThrDx0Cj3AMg58KyN4pzYT+LHOotxDQDjNvkw==" + "source-map-js@1.2.2" + ] }, { "name": "make-dir", @@ -5040,10 +5057,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", "dependencies": [ "semver@7.8.5" - ], - "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==" + ] }, { "name": "mdn-data", @@ -5052,8 +5069,8 @@ "scope": "development", "optional": false, "license": "CC0-1.0", - "dependencies": [], - "integrity": "sha512-9Yubnt3e8A0OKwxYSXyhLymGW4sCufcLG6VdiDdUGVkPhpqLxlvP5vl1983gQjJl3tqbrM731mjaZaP68AgosQ==" + "integrity": "sha512-9Yubnt3e8A0OKwxYSXyhLymGW4sCufcLG6VdiDdUGVkPhpqLxlvP5vl1983gQjJl3tqbrM731mjaZaP68AgosQ==", + "dependencies": [] }, { "name": "min-indent", @@ -5062,8 +5079,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==" + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "dependencies": [] }, { "name": "minimatch", @@ -5072,10 +5089,10 @@ "scope": "development", "optional": false, "license": "BlueOak-1.0.0", + "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", "dependencies": [ - "brace-expansion@5.0.8" - ], - "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==" + "brace-expansion@5.0.12" + ] }, { "name": "minimist", @@ -5084,8 +5101,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==" + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dependencies": [] }, { "name": "minipass", @@ -5094,8 +5111,8 @@ "scope": "development", "optional": false, "license": "BlueOak-1.0.0", - "dependencies": [], - "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==" + "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", + "dependencies": [] }, { "name": "ms", @@ -5104,8 +5121,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dependencies": [] }, { "name": "msw", @@ -5114,6 +5131,7 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-2wQAmKkQKxRuXvYJxVhPGG0wZNBQyD06oJvxqw90XqLvptdqxdlHrFUfEteKkpaNORX3Xzc+HtEl/q0nfmN2wQ==", "dependencies": [ "@inquirer/confirm@6.1.1", "@mswjs/interceptors@0.41.9", @@ -5134,8 +5152,7 @@ "typescript@7.0.2", "until-async@3.0.2", "yargs@17.7.3" - ], - "integrity": "sha512-2wQAmKkQKxRuXvYJxVhPGG0wZNBQyD06oJvxqw90XqLvptdqxdlHrFUfEteKkpaNORX3Xzc+HtEl/q0nfmN2wQ==" + ] }, { "name": "mute-stream", @@ -5144,18 +5161,18 @@ "scope": "development", "optional": false, "license": "ISC", - "dependencies": [], - "integrity": "sha512-dkEJPVvun4FryqBmZ5KhDo0K9iDXAwn08tMLDinNdRBNPcYEDiWYysLcc6k3mjTMlbP9KyylvRpd4wFtwrT9rw==" + "integrity": "sha512-dkEJPVvun4FryqBmZ5KhDo0K9iDXAwn08tMLDinNdRBNPcYEDiWYysLcc6k3mjTMlbP9KyylvRpd4wFtwrT9rw==", + "dependencies": [] }, { "name": "nanoid", - "version": "3.3.16", + "version": "3.3.20", "direct": false, "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-bzlKTyNJ7+LdGIIwy8ijFpIqEQIvafahV7eYykJ8Cvh42EdJeODoJ6gUJXpQJvej1BddH8OqTXZNE/KfbWAu8Q==" + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", + "dependencies": [] }, { "name": "natural-compare", @@ -5164,8 +5181,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==" + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dependencies": [] }, { "name": "node-releases", @@ -5174,8 +5191,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-wRNIrw4DmVLKQlbgOMdkMx27Wrpzes2hh5Jtbi2bjPd+4wJstWIqP5A+lscnqbm0xxmT5Bpg8Lec5ItEBwx6BQ==" + "integrity": "sha512-wRNIrw4DmVLKQlbgOMdkMx27Wrpzes2hh5Jtbi2bjPd+4wJstWIqP5A+lscnqbm0xxmT5Bpg8Lec5ItEBwx6BQ==", + "dependencies": [] }, { "name": "obug", @@ -5184,8 +5201,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-4a+OsYv9UktOJKE+l1A4OufDgdRF9PifWj+tJnHURo/P+WOxpG4GzUFL9qCalmWauao6ogiG+QvnCovwPoyAWA==" + "integrity": "sha512-4a+OsYv9UktOJKE+l1A4OufDgdRF9PifWj+tJnHURo/P+WOxpG4GzUFL9qCalmWauao6ogiG+QvnCovwPoyAWA==", + "dependencies": [] }, { "name": "open", @@ -5194,13 +5211,13 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-YgBpdJHPyQ2UE5x+hlSXcnejzAvD0b22U2OuAP+8OnlJT+PjWPxtgmGqKKc+RgTM63U9gN0YzrYc71R2WT/hTA==", "dependencies": [ "default-browser@5.5.0", "define-lazy-prop@3.0.0", "is-inside-container@1.0.0", "wsl-utils@0.1.0" - ], - "integrity": "sha512-YgBpdJHPyQ2UE5x+hlSXcnejzAvD0b22U2OuAP+8OnlJT+PjWPxtgmGqKKc+RgTM63U9gN0YzrYc71R2WT/hTA==" + ] }, { "name": "optionator", @@ -5209,6 +5226,7 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "dependencies": [ "deep-is@0.1.4", "fast-levenshtein@2.0.6", @@ -5216,8 +5234,7 @@ "prelude-ls@1.2.1", "type-check@0.4.0", "word-wrap@1.2.5" - ], - "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==" + ] }, { "name": "outvariant", @@ -5226,8 +5243,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-+Sl2UErvtsoajRDKCE5/dBz4DIvHXQQnAxtQTF04OJxY0+DyZXSo5P5Bb7XYWOh81syohlYL24hbDwxedPUJCA==" + "integrity": "sha512-+Sl2UErvtsoajRDKCE5/dBz4DIvHXQQnAxtQTF04OJxY0+DyZXSo5P5Bb7XYWOh81syohlYL24hbDwxedPUJCA==", + "dependencies": [] }, { "name": "oxc-parser", @@ -5236,6 +5253,7 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-bkgD4qHlN7WxLdX8bLXdaU54TtQtAIg/ZBAfm0aje/mo3MRDo3P0hZSgr4U7O3xfX+fQmR5AP04JS/TGcZLcFA==", "dependencies": [ "@oxc-parser/binding-android-arm-eabi@0.127.0", "@oxc-parser/binding-android-arm64@0.127.0", @@ -5258,38 +5276,37 @@ "@oxc-parser/binding-win32-ia32-msvc@0.127.0", "@oxc-parser/binding-win32-x64-msvc@0.127.0", "@oxc-project/types@0.127.0" - ], - "integrity": "sha512-bkgD4qHlN7WxLdX8bLXdaU54TtQtAIg/ZBAfm0aje/mo3MRDo3P0hZSgr4U7O3xfX+fQmR5AP04JS/TGcZLcFA==" + ] }, { "name": "oxc-resolver", - "version": "11.24.2", + "version": "11.21.2", "direct": false, "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-w5tLwYN3Zo24w5EeWJjJWZOwhYqTtC8PS2B1tIt7BZUuqTIcU07sQValbDw+rq7+AuAGzOHklgK+ifsy4lpXfw==", "dependencies": [ - "@oxc-resolver/binding-android-arm-eabi@11.24.2", - "@oxc-resolver/binding-android-arm64@11.24.2", - "@oxc-resolver/binding-darwin-arm64@11.24.2", - "@oxc-resolver/binding-darwin-x64@11.24.2", - "@oxc-resolver/binding-freebsd-x64@11.24.2", - "@oxc-resolver/binding-linux-arm-gnueabihf@11.24.2", - "@oxc-resolver/binding-linux-arm-musleabihf@11.24.2", - "@oxc-resolver/binding-linux-arm64-gnu@11.24.2", - "@oxc-resolver/binding-linux-arm64-musl@11.24.2", - "@oxc-resolver/binding-linux-ppc64-gnu@11.24.2", - "@oxc-resolver/binding-linux-riscv64-gnu@11.24.2", - "@oxc-resolver/binding-linux-riscv64-musl@11.24.2", - "@oxc-resolver/binding-linux-s390x-gnu@11.24.2", - "@oxc-resolver/binding-linux-x64-gnu@11.24.2", - "@oxc-resolver/binding-linux-x64-musl@11.24.2", - "@oxc-resolver/binding-openharmony-arm64@11.24.2", - "@oxc-resolver/binding-wasm32-wasi@11.24.2", - "@oxc-resolver/binding-win32-arm64-msvc@11.24.2", - "@oxc-resolver/binding-win32-x64-msvc@11.24.2" - ], - "integrity": "sha512-FY91FiDBj7ls5MsFS9jN3tjz2o0/zsdSsymlakySaBwVJZorHhkWyICLZMKxlu1R9vYo+sd3z1jwb4J8x7bNDw==" + "@oxc-resolver/binding-android-arm-eabi@11.21.2", + "@oxc-resolver/binding-android-arm64@11.21.2", + "@oxc-resolver/binding-darwin-arm64@11.21.2", + "@oxc-resolver/binding-darwin-x64@11.21.2", + "@oxc-resolver/binding-freebsd-x64@11.21.2", + "@oxc-resolver/binding-linux-arm-gnueabihf@11.21.2", + "@oxc-resolver/binding-linux-arm-musleabihf@11.21.2", + "@oxc-resolver/binding-linux-arm64-gnu@11.21.2", + "@oxc-resolver/binding-linux-arm64-musl@11.21.2", + "@oxc-resolver/binding-linux-ppc64-gnu@11.21.2", + "@oxc-resolver/binding-linux-riscv64-gnu@11.21.2", + "@oxc-resolver/binding-linux-riscv64-musl@11.21.2", + "@oxc-resolver/binding-linux-s390x-gnu@11.21.2", + "@oxc-resolver/binding-linux-x64-gnu@11.21.2", + "@oxc-resolver/binding-linux-x64-musl@11.21.2", + "@oxc-resolver/binding-openharmony-arm64@11.21.2", + "@oxc-resolver/binding-wasm32-wasi@11.21.2", + "@oxc-resolver/binding-win32-arm64-msvc@11.21.2", + "@oxc-resolver/binding-win32-x64-msvc@11.21.2" + ] }, { "name": "p-limit", @@ -5298,10 +5315,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dependencies": [ "yocto-queue@0.1.0" - ], - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==" + ] }, { "name": "p-locate", @@ -5310,10 +5327,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dependencies": [ "p-limit@3.1.0" - ], - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==" + ] }, { "name": "parse5", @@ -5322,10 +5339,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-z1e/HMG90obSGeidlli3hj7cbocou0/wa5HacvI3ASx34PecNjNQeaHNo5WIZpWofN9kgkqV1q5YvXe3F0FoPw==", "dependencies": [ "entities@8.0.0" - ], - "integrity": "sha512-z1e/HMG90obSGeidlli3hj7cbocou0/wa5HacvI3ASx34PecNjNQeaHNo5WIZpWofN9kgkqV1q5YvXe3F0FoPw==" + ] }, { "name": "path-exists", @@ -5334,8 +5351,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dependencies": [] }, { "name": "path-key", @@ -5344,8 +5361,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==" + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dependencies": [] }, { "name": "path-parse", @@ -5354,8 +5371,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dependencies": [] }, { "name": "path-scurry", @@ -5364,11 +5381,11 @@ "scope": "development", "optional": false, "license": "BlueOak-1.0.0", + "integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==", "dependencies": [ "lru-cache@11.5.2", "minipass@7.1.3" - ], - "integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==" + ] }, { "name": "path-to-regexp", @@ -5377,8 +5394,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==" + "integrity": "sha512-Yhpw4T9C6hPpgPeA28us07OJeqZ5EzQTkbfwuhsUg0c237RomFoETJgmp2sa3F/41gfLE6G5cqcYwznmeEeOlQ==", + "dependencies": [] }, { "name": "pathe", @@ -5387,8 +5404,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==" + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dependencies": [] }, { "name": "pathval", @@ -5397,8 +5414,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==" + "integrity": "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==", + "dependencies": [] }, { "name": "picocolors", @@ -5407,8 +5424,8 @@ "scope": "development", "optional": false, "license": "ISC", - "dependencies": [], - "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==" + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dependencies": [] }, { "name": "picomatch", @@ -5417,8 +5434,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==" + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", + "dependencies": [] }, { "name": "playwright-core", @@ -5427,8 +5444,8 @@ "scope": "development", "optional": false, "license": "Apache-2.0", - "dependencies": [], - "integrity": "sha512-nsNRyq0r2zsG8AcRHWknc9QRA5XCueC7gWMrs+Gx2tlZn9hcl8zudfh00lhJPY1DE7NmZ6bDsT9g2yey8mXljA==" + "integrity": "sha512-nsNRyq0r2zsG8AcRHWknc9QRA5XCueC7gWMrs+Gx2tlZn9hcl8zudfh00lhJPY1DE7NmZ6bDsT9g2yey8mXljA==", + "dependencies": [] }, { "name": "playwright", @@ -5437,25 +5454,25 @@ "scope": "development", "optional": false, "license": "Apache-2.0", + "integrity": "sha512-Z14dG305dgaLu6foB1TXQagFiW8JfSUIUaUuPaKQ6NtBPKF1P/qXcqfh6c6K/icPqdy37JmjbiBXf6JNg6Sylw==", "dependencies": [ "fsevents@2.3.2", "playwright-core@1.62.0" - ], - "integrity": "sha512-Z14dG305dgaLu6foB1TXQagFiW8JfSUIUaUuPaKQ6NtBPKF1P/qXcqfh6c6K/icPqdy37JmjbiBXf6JNg6Sylw==" + ] }, { "name": "postcss", - "version": "8.5.22", + "version": "8.5.32", "direct": false, "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-LJlKCCAUFKOuZxipUdYw1NzIITEsPcgyOG9LkvRJvuKj/bRzbuRY0ARXvL0pWGpsZvn8jku+LMep2eU0seHp8g==", "dependencies": [ - "nanoid@3.3.16", + "nanoid@3.3.20", "picocolors@1.1.1", - "source-map-js@1.2.1" - ], - "integrity": "sha512-KBDEIpLrvpv16pp3K0Fw+UCoZfopFjjgeB+0tA/aaThfEE74kKDLrgg603YvOWJyg3+WYtyq3xYsQWsIyZlPqQ==" + "source-map-js@1.2.2" + ] }, { "name": "prelude-ls", @@ -5464,8 +5481,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==" + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dependencies": [] }, { "name": "pretty-format", @@ -5474,12 +5491,12 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==", "dependencies": [ "ansi-regex@5.0.1", "ansi-styles@5.2.0", "react-is@17.0.2" - ], - "integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==" + ] }, { "name": "prompts", @@ -5488,11 +5505,11 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", "dependencies": [ "kleur@3.0.3", "sisteransi@1.0.5" - ], - "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==" + ] }, { "name": "punycode", @@ -5501,8 +5518,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==" + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dependencies": [] }, { "name": "react-docgen-typescript", @@ -5511,10 +5528,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-ZtAp5XTO5HRzQctjPU0ybY0RRCQO19X/8fxn3w7y2VVTUbGHDKULPTL4ky3vB05euSgG5NpALhEhDPvQ56wvXg==", "dependencies": [ "typescript@7.0.2" - ], - "integrity": "sha512-ZtAp5XTO5HRzQctjPU0ybY0RRCQO19X/8fxn3w7y2VVTUbGHDKULPTL4ky3vB05euSgG5NpALhEhDPvQ56wvXg==" + ] }, { "name": "react-docgen", @@ -5523,6 +5540,7 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-aEZ9qP+/M+58x2qgfSFEWH1BxLyHe5+qkLNJOZQb5iGS017jpbRnoKhNRrXPeA6RfBrZO5wZrT9DMC1UqE1f1w==", "dependencies": [ "@babel/core@7.29.7", "@babel/traverse@7.29.7", @@ -5534,8 +5552,7 @@ "doctrine@3.0.0", "resolve@1.22.12", "strip-indent@4.1.1" - ], - "integrity": "sha512-aEZ9qP+/M+58x2qgfSFEWH1BxLyHe5+qkLNJOZQb5iGS017jpbRnoKhNRrXPeA6RfBrZO5wZrT9DMC1UqE1f1w==" + ] }, { "name": "react-dom", @@ -5544,11 +5561,11 @@ "scope": "production", "optional": false, "license": "MIT", + "integrity": "sha512-rVprimfGBG3DR+Tq0IQG2DT5PxKth1WIGDmj5yPmlzr4YBe7uyE+Du4oVqTDXZSHGGGXRtTJEGSSePyQCMBglQ==", "dependencies": [ "react@19.2.8", "scheduler@0.27.0" - ], - "integrity": "sha512-rVprimfGBG3DR+Tq0IQG2DT5PxKth1WIGDmj5yPmlzr4YBe7uyE+Du4oVqTDXZSHGGGXRtTJEGSSePyQCMBglQ==" + ] }, { "name": "react-is", @@ -5557,8 +5574,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==" + "integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==", + "dependencies": [] }, { "name": "react-router-dom", @@ -5567,12 +5584,12 @@ "scope": "production", "optional": false, "license": "MIT", + "integrity": "sha512-KaZh+X/6UtEp28x51AUYZDMg9NGoz2ja3dNHa+ta/tk40vCzKhQ/RypCWBMLbmDr6//E24Vv5uPsrqXFozdkAg==", "dependencies": [ "react-dom@19.2.8", "react-router@7.18.1", "react@19.2.8" - ], - "integrity": "sha512-KaZh+X/6UtEp28x51AUYZDMg9NGoz2ja3dNHa+ta/tk40vCzKhQ/RypCWBMLbmDr6//E24Vv5uPsrqXFozdkAg==" + ] }, { "name": "react-router", @@ -5581,13 +5598,13 @@ "scope": "production", "optional": false, "license": "MIT", + "integrity": "sha512-GDLgg3i3uM0aeJO3Fm+TCS+sDQ7gu12T6x0qdTEzcwqEfleci7JwugVNIF3U//0FWKnJT7ptG+20B2jfDqnZAg==", "dependencies": [ "cookie@1.1.1", "react-dom@19.2.8", "react@19.2.8", "set-cookie-parser@2.7.2" - ], - "integrity": "sha512-GDLgg3i3uM0aeJO3Fm+TCS+sDQ7gu12T6x0qdTEzcwqEfleci7JwugVNIF3U//0FWKnJT7ptG+20B2jfDqnZAg==" + ] }, { "name": "react", @@ -5596,8 +5613,8 @@ "scope": "production", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-PWaYA1L/q9u2u7xYQi+Y3L3Yfnie7XyLeaJICV1MGD6LprsBxcAqGjYyr0eY3p+QdsA+x/Irkt4Qif8D63+Sbw==" + "integrity": "sha512-PWaYA1L/q9u2u7xYQi+Y3L3Yfnie7XyLeaJICV1MGD6LprsBxcAqGjYyr0eY3p+QdsA+x/Irkt4Qif8D63+Sbw==", + "dependencies": [] }, { "name": "recast", @@ -5606,14 +5623,14 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-dEWRjcINDu/F4l2dYx57ugBtD7HV9KXESyxhzw/MqWLeglJrsjJKqACPyUPg+6AF8mIgm+Zi0dZ3ACoIg+QtpA==", "dependencies": [ "ast-types@0.16.1", "esprima@4.0.1", "source-map@0.6.1", "tiny-invariant@1.3.3", "tslib@2.8.1" - ], - "integrity": "sha512-dEWRjcINDu/F4l2dYx57ugBtD7HV9KXESyxhzw/MqWLeglJrsjJKqACPyUPg+6AF8mIgm+Zi0dZ3ACoIg+QtpA==" + ] }, { "name": "rechoir", @@ -5622,10 +5639,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==", "dependencies": [ "resolve@1.22.12" - ], - "integrity": "sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==" + ] }, { "name": "redent", @@ -5634,11 +5651,11 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", "dependencies": [ "indent-string@4.0.0", "strip-indent@3.0.0" - ], - "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==" + ] }, { "name": "regexp-tree", @@ -5647,8 +5664,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==" + "integrity": "sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA==", + "dependencies": [] }, { "name": "require-directory", @@ -5657,8 +5674,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==" + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dependencies": [] }, { "name": "require-from-string", @@ -5667,8 +5684,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==" + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dependencies": [] }, { "name": "resolve", @@ -5677,13 +5694,13 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-TyeJ1zif53BPfHootBGwPRYT1RUt6oGWsaQr8UyZW/eAm9bKoijtvruSDEmZHm92CwS9nj7/fWttqPCgzep8CA==", "dependencies": [ "es-errors@1.3.0", "is-core-module@2.16.2", "path-parse@1.0.7", "supports-preserve-symlinks-flag@1.0.0" - ], - "integrity": "sha512-TyeJ1zif53BPfHootBGwPRYT1RUt6oGWsaQr8UyZW/eAm9bKoijtvruSDEmZHm92CwS9nj7/fWttqPCgzep8CA==" + ] }, { "name": "rettime", @@ -5692,8 +5709,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-ILJRqVWBCTlg9r42fFgwVZx1gnFAcQF8mRoMkbgQfIrjEDf9nbBFDFx00oloOa+Q869FUtaYDXZvEfnecQSCoQ==" + "integrity": "sha512-ILJRqVWBCTlg9r42fFgwVZx1gnFAcQF8mRoMkbgQfIrjEDf9nbBFDFx00oloOa+Q869FUtaYDXZvEfnecQSCoQ==", + "dependencies": [] }, { "name": "rolldown", @@ -5702,6 +5719,7 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-t9z29cJjXf/vxQ8dyhCSpt6H6aSwHTk8cT5I3iy6SMXuFpk5mB6PL6XfC8PCwrPTx93udwKUm9HRteAlTGBLiA==", "dependencies": [ "@oxc-project/types@0.139.0", "@rolldown/binding-android-arm64@1.1.5", @@ -5720,8 +5738,7 @@ "@rolldown/binding-win32-arm64-msvc@1.1.5", "@rolldown/binding-win32-x64-msvc@1.1.5", "@rolldown/pluginutils@1.0.1" - ], - "integrity": "sha512-t9z29cJjXf/vxQ8dyhCSpt6H6aSwHTk8cT5I3iy6SMXuFpk5mB6PL6XfC8PCwrPTx93udwKUm9HRteAlTGBLiA==" + ] }, { "name": "run-applescript", @@ -5730,8 +5747,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==" + "integrity": "sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==", + "dependencies": [] }, { "name": "safe-regex", @@ -5740,10 +5757,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-rx+x8AMzKb5Q5lQ95Zoi6ZbJqwCLkqi3XuJXp5P3rT8OEc6sZCJG5AE5dU3lsgRr/F4Bs31jSlVN+j5KrsGu9A==", "dependencies": [ "regexp-tree@0.1.27" - ], - "integrity": "sha512-rx+x8AMzKb5Q5lQ95Zoi6ZbJqwCLkqi3XuJXp5P3rT8OEc6sZCJG5AE5dU3lsgRr/F4Bs31jSlVN+j5KrsGu9A==" + ] }, { "name": "saxes", @@ -5752,10 +5769,10 @@ "scope": "development", "optional": false, "license": "ISC", + "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==", "dependencies": [ "xmlchars@2.2.0" - ], - "integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==" + ] }, { "name": "scheduler", @@ -5764,8 +5781,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==" + "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==", + "dependencies": [] }, { "name": "semver", @@ -5774,8 +5791,8 @@ "scope": "development", "optional": false, "license": "ISC", - "dependencies": [], - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==" + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dependencies": [] }, { "name": "semver", @@ -5784,8 +5801,8 @@ "scope": "development", "optional": false, "license": "ISC", - "dependencies": [], - "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==" + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "dependencies": [] }, { "name": "set-cookie-parser", @@ -5794,8 +5811,8 @@ "scope": "production", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-oeM1lpU/UvhTxw+g3cIfxXHyJRc/uidd3yK1P242gzHds0udQBYzs3y8j4gCCW+ZJ7ad0yctld8RYO+bdurlvw==" + "integrity": "sha512-oeM1lpU/UvhTxw+g3cIfxXHyJRc/uidd3yK1P242gzHds0udQBYzs3y8j4gCCW+ZJ7ad0yctld8RYO+bdurlvw==", + "dependencies": [] }, { "name": "set-cookie-parser", @@ -5804,8 +5821,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-5/r/lTwbJ3zQ+qwdUFZYeRNqda7P5HD8zQKqlSjdGt1/S0cjLAphHusj4Y58ahDtWn/g32xrIS58/ikOvwl0Lw==" + "integrity": "sha512-5/r/lTwbJ3zQ+qwdUFZYeRNqda7P5HD8zQKqlSjdGt1/S0cjLAphHusj4Y58ahDtWn/g32xrIS58/ikOvwl0Lw==", + "dependencies": [] }, { "name": "shebang-command", @@ -5814,10 +5831,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dependencies": [ "shebang-regex@3.0.0" - ], - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==" + ] }, { "name": "shebang-regex", @@ -5826,8 +5843,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==" + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dependencies": [] }, { "name": "siginfo", @@ -5836,8 +5853,8 @@ "scope": "development", "optional": false, "license": "ISC", - "dependencies": [], - "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==" + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", + "dependencies": [] }, { "name": "signal-exit", @@ -5846,8 +5863,8 @@ "scope": "development", "optional": false, "license": "ISC", - "dependencies": [], - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==" + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dependencies": [] }, { "name": "sisteransi", @@ -5856,18 +5873,18 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==" + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dependencies": [] }, { "name": "source-map-js", - "version": "1.2.1", + "version": "1.2.2", "direct": false, "scope": "development", "optional": false, "license": "BSD-3-Clause", - "dependencies": [], - "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==" + "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==", + "dependencies": [] }, { "name": "source-map", @@ -5876,8 +5893,8 @@ "scope": "development", "optional": false, "license": "BSD-3-Clause", - "dependencies": [], - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dependencies": [] }, { "name": "stackback", @@ -5886,8 +5903,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==" + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", + "dependencies": [] }, { "name": "statuses", @@ -5896,8 +5913,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==" + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "dependencies": [] }, { "name": "std-env", @@ -5906,22 +5923,23 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-oCUKSupKTHX53EyjDtuZQ64pjLJ6yYCtpmEw0goYxtjG9KpbRe8KAsl2tBUGU9DyMcJ0RwJ8GqJAFzMXcXW1Rw==" + "integrity": "sha512-oCUKSupKTHX53EyjDtuZQ64pjLJ6yYCtpmEw0goYxtjG9KpbRe8KAsl2tBUGU9DyMcJ0RwJ8GqJAFzMXcXW1Rw==", + "dependencies": [] }, { "name": "storybook", - "version": "10.5.4", + "version": "10.6.5", "direct": true, "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-qurC38Nx4PDF9YIq6GO95dpUx8a3B9AZwlcHBo4cOI9At09ifjQRsqcwcdOf2YX0cpVhFKmHkI20SWCrxqYQrg==", "dependencies": [ "@storybook/global@5.0.0", "@storybook/icons@2.1.0", "@testing-library/dom@10.4.1", - "@testing-library/jest-dom@6.10.0", - "@testing-library/user-event@14.6.1", + "@testing-library/jest-dom@6.9.1", + "@testing-library/user-event@14.6.8", "@types/react@19.2.8", "@vitest/expect@3.2.4", "@vitest/spy@3.2.4", @@ -5930,13 +5948,12 @@ "jsonc-parser@3.3.1", "open@10.2.0", "oxc-parser@0.127.0", - "oxc-resolver@11.24.2", + "oxc-resolver@11.21.2", "recast@0.23.12", "semver@7.8.5", "use-sync-external-store@1.6.0", "ws@8.21.1" - ], - "integrity": "sha512-bmLxPsxVSPnbeiZqYQpozyNOiJXfk+pf7WfHZflvPkwT6Y+rvYz3Cj/D6H4Kf2jHpuDNiMXBKO3yawLN2OWirg==" + ] }, { "name": "strict-event-emitter", @@ -5945,8 +5962,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ==" + "integrity": "sha512-vMgjE/GGEPEFnhFub6pa4FmJBRBVOLpIII2hvCZ8Kzb7K0hlHo7mQv6xYrBvCL2LtAIBwFUK8wvuJgTVSQ5MFQ==", + "dependencies": [] }, { "name": "string-width", @@ -5955,12 +5972,12 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dependencies": [ "emoji-regex@8.0.0", "is-fullwidth-code-point@3.0.0", "strip-ansi@6.0.1" - ], - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==" + ] }, { "name": "strip-ansi", @@ -5969,10 +5986,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dependencies": [ "ansi-regex@5.0.1" - ], - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==" + ] }, { "name": "strip-bom", @@ -5981,8 +5998,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==" + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dependencies": [] }, { "name": "strip-indent", @@ -5991,10 +6008,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", "dependencies": [ "min-indent@1.0.1" - ], - "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==" + ] }, { "name": "strip-indent", @@ -6003,8 +6020,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-SlyRoSkdh1dYP0PzclLE7r0M9sgbFKKMFXpFRUMNuKhQSbC6VQIGzq3E0qsfvGJaUFJPGv6Ws1NZ/haTAjfbMA==" + "integrity": "sha512-SlyRoSkdh1dYP0PzclLE7r0M9sgbFKKMFXpFRUMNuKhQSbC6VQIGzq3E0qsfvGJaUFJPGv6Ws1NZ/haTAjfbMA==", + "dependencies": [] }, { "name": "supports-color", @@ -6013,10 +6030,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dependencies": [ "has-flag@4.0.0" - ], - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==" + ] }, { "name": "supports-preserve-symlinks-flag", @@ -6025,8 +6042,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==" + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dependencies": [] }, { "name": "symbol-tree", @@ -6035,8 +6052,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==" + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", + "dependencies": [] }, { "name": "tagged-tag", @@ -6045,8 +6062,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-yEFYrVhod+hdNyx7g5Bnkkb0G6si8HJurOoOEgC8B/O0uXLHlaey/65KRv6cuWBNhBgHKAROVpc7QyYqE5gFng==" + "integrity": "sha512-yEFYrVhod+hdNyx7g5Bnkkb0G6si8HJurOoOEgC8B/O0uXLHlaey/65KRv6cuWBNhBgHKAROVpc7QyYqE5gFng==", + "dependencies": [] }, { "name": "tailwindcss", @@ -6055,8 +6072,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-gOhV3P7ufE62QDGg1zVaTgCR+EtPv92k2nIhVcVKcLmxT1sUBsQGhnZj175j+MqRt4zLF7ic+sCYjfhxMxj7YQ==" + "integrity": "sha512-gOhV3P7ufE62QDGg1zVaTgCR+EtPv92k2nIhVcVKcLmxT1sUBsQGhnZj175j+MqRt4zLF7ic+sCYjfhxMxj7YQ==", + "dependencies": [] }, { "name": "tapable", @@ -6065,8 +6082,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==" + "integrity": "sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==", + "dependencies": [] }, { "name": "tiny-invariant", @@ -6075,8 +6092,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==" + "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==", + "dependencies": [] }, { "name": "tinybench", @@ -6085,8 +6102,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==" + "integrity": "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==", + "dependencies": [] }, { "name": "tinyexec", @@ -6095,8 +6112,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-SHf/r48b7vOrjve9PxJo3MN5v5yuyjHvdUcrQffT3WXMUfnGmHDVbC4k3sHJaJTgZCwpUplIaAo5ANtMyp3YHg==" + "integrity": "sha512-SHf/r48b7vOrjve9PxJo3MN5v5yuyjHvdUcrQffT3WXMUfnGmHDVbC4k3sHJaJTgZCwpUplIaAo5ANtMyp3YHg==", + "dependencies": [] }, { "name": "tinyglobby", @@ -6105,11 +6122,11 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", "dependencies": [ "fdir@6.5.0", "picomatch@4.0.5" - ], - "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==" + ] }, { "name": "tinyrainbow", @@ -6118,8 +6135,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==" + "integrity": "sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==", + "dependencies": [] }, { "name": "tinyrainbow", @@ -6128,8 +6145,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-Bf+ILmBgretUrdJxzXM0SgXLZ3XfiaUuOj/IKQHuTXip+05Xn+uyEYdVg0kYDipTBcLrCVyUzAPz7QmArb0mmw==" + "integrity": "sha512-Bf+ILmBgretUrdJxzXM0SgXLZ3XfiaUuOj/IKQHuTXip+05Xn+uyEYdVg0kYDipTBcLrCVyUzAPz7QmArb0mmw==", + "dependencies": [] }, { "name": "tinyspy", @@ -6138,8 +6155,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==" + "integrity": "sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==", + "dependencies": [] }, { "name": "tldts-core", @@ -6148,8 +6165,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-DxKfPBI52p2msTEu7MPhdpdDTBhhVQg1a/8PjQckeyAvO13eMYElX545grIp6nnTGIMZlRvFZPvFhvI/WIz2Vg==" + "integrity": "sha512-DxKfPBI52p2msTEu7MPhdpdDTBhhVQg1a/8PjQckeyAvO13eMYElX545grIp6nnTGIMZlRvFZPvFhvI/WIz2Vg==", + "dependencies": [] }, { "name": "tldts", @@ -6158,10 +6175,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-3kZ8wQQ/k5DrChD4X4FVvr2D7E5uoRgAqkPyLpSCGUvqOvqu+JEdr3mwMUaVWb+vMHZaKhF5fp2PBigKsui7hA==", "dependencies": [ "tldts-core@7.4.9" - ], - "integrity": "sha512-3kZ8wQQ/k5DrChD4X4FVvr2D7E5uoRgAqkPyLpSCGUvqOvqu+JEdr3mwMUaVWb+vMHZaKhF5fp2PBigKsui7hA==" + ] }, { "name": "tough-cookie", @@ -6170,10 +6187,10 @@ "scope": "development", "optional": false, "license": "BSD-3-Clause", + "integrity": "sha512-exgYmnmL/sJpR3upZfXG5PoatXQii55xAiXGXzY+sROLZ/Y+SLcp9PgJNI9Vz37HpQ74WvDcLT8eqm+kV3FzrA==", "dependencies": [ "tldts@7.4.9" - ], - "integrity": "sha512-exgYmnmL/sJpR3upZfXG5PoatXQii55xAiXGXzY+sROLZ/Y+SLcp9PgJNI9Vz37HpQ74WvDcLT8eqm+kV3FzrA==" + ] }, { "name": "tr46", @@ -6182,10 +6199,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-bLVMLPtstlZ4iMQHpFHTR7GAGj2jxi8Dg0s2h2MafAE4uSWF98FC/3MomU51iQAMf8/qDUbKWf5GxuvvVcXEhw==", "dependencies": [ "punycode@2.3.1" - ], - "integrity": "sha512-bLVMLPtstlZ4iMQHpFHTR7GAGj2jxi8Dg0s2h2MafAE4uSWF98FC/3MomU51iQAMf8/qDUbKWf5GxuvvVcXEhw==" + ] }, { "name": "ts-dedent", @@ -6194,8 +6211,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-JfJeIHke7y2egdGGgRAvpCwYFUsHlM2gPcrVOxFkznt/4uzQ7HFmvE63iFHVLBJNDuyDOQgijDK/tXH/f6Msjg==" + "integrity": "sha512-JfJeIHke7y2egdGGgRAvpCwYFUsHlM2gPcrVOxFkznt/4uzQ7HFmvE63iFHVLBJNDuyDOQgijDK/tXH/f6Msjg==", + "dependencies": [] }, { "name": "tsconfig-paths-webpack-plugin", @@ -6204,13 +6221,13 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-zbem3rfRS8BgeNK50Zz5SIQgXzLafiHjOwUAvk/38/o1jHn/V5QAgVUcz884or7WYcPaH3N2CIfUc2u0ul7UcA==", "dependencies": [ "chalk@4.1.2", "enhanced-resolve@5.24.2", "tapable@2.3.3", "tsconfig-paths@4.2.0" - ], - "integrity": "sha512-zbem3rfRS8BgeNK50Zz5SIQgXzLafiHjOwUAvk/38/o1jHn/V5QAgVUcz884or7WYcPaH3N2CIfUc2u0ul7UcA==" + ] }, { "name": "tsconfig-paths", @@ -6219,12 +6236,12 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==", "dependencies": [ "json5@2.2.3", "minimist@1.2.8", "strip-bom@3.0.0" - ], - "integrity": "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==" + ] }, { "name": "tslib", @@ -6233,8 +6250,8 @@ "scope": "development", "optional": false, "license": "0BSD", - "dependencies": [], - "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dependencies": [] }, { "name": "type-check", @@ -6243,10 +6260,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dependencies": [ "prelude-ls@1.2.1" - ], - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==" + ] }, { "name": "type-fest", @@ -6255,10 +6272,10 @@ "scope": "development", "optional": false, "license": "(MIT OR CC0-1.0)", + "integrity": "sha512-YGYEVz3Fm5iy/AybuA0oyNFq7H4CgQNfRp/qfe8nurE1kuCeNm3/vfm9X4Mtl+qLyaKJUh5xrFZwogr41SMjYA==", "dependencies": [ "tagged-tag@1.0.0" - ], - "integrity": "sha512-YGYEVz3Fm5iy/AybuA0oyNFq7H4CgQNfRp/qfe8nurE1kuCeNm3/vfm9X4Mtl+qLyaKJUh5xrFZwogr41SMjYA==" + ] }, { "name": "typescript", @@ -6267,6 +6284,7 @@ "scope": "development", "optional": false, "license": "Apache-2.0", + "integrity": "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==", "dependencies": [ "@typescript/typescript-aix-ppc64@7.0.2", "@typescript/typescript-darwin-arm64@7.0.2", @@ -6288,8 +6306,7 @@ "@typescript/typescript-sunos-x64@7.0.2", "@typescript/typescript-win32-arm64@7.0.2", "@typescript/typescript-win32-x64@7.0.2" - ], - "integrity": "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==" + ] }, { "name": "undici-types", @@ -6298,33 +6315,18 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==" + "integrity": "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==", + "dependencies": [] }, { "name": "undici", - "version": "7.28.0", + "version": "7.30.1", "direct": false, "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA==" - }, - { - "name": "unplugin", - "version": "2.3.11", - "direct": false, - "scope": "development", - "optional": false, - "license": "MIT", - "dependencies": [ - "@jridgewell/remapping@2.3.5", - "acorn@8.17.0", - "picomatch@4.0.5", - "webpack-virtual-modules@0.6.2" - ], - "integrity": "sha512-5uKD0nqiYVzlmCRs01Fhs2BdkEgBS3SAVP6ndrBsuK42iC2+JHyxM05Rm9G8+5mkmRtzMZGY8Ct5+mliZxU/Ww==" + "integrity": "sha512-03KrMbjIFDWQR5RNPrSw3bd1r12JpyFQl9/yxjUbJtqkjmllqC5lFjZh6ujeuJCKr8EOQvRW872Oy/az+nLYxg==", + "dependencies": [] }, { "name": "until-async", @@ -6333,8 +6335,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-IiSk4HlzAMqTUseHHe3VhIGyuFmN90zMTpD3Z3y8jeQbzLIq500MVM7Jq2vUAnTKAFPJrqwkzr6PoTcPhGcOiw==" + "integrity": "sha512-IiSk4HlzAMqTUseHHe3VhIGyuFmN90zMTpD3Z3y8jeQbzLIq500MVM7Jq2vUAnTKAFPJrqwkzr6PoTcPhGcOiw==", + "dependencies": [] }, { "name": "update-browserslist-db", @@ -6343,12 +6345,12 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", "dependencies": [ "browserslist@4.28.7", "escalade@3.2.0", "picocolors@1.1.1" - ], - "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==" + ] }, { "name": "uri-js", @@ -6357,10 +6359,10 @@ "scope": "development", "optional": false, "license": "BSD-2-Clause", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "dependencies": [ "punycode@2.3.1" - ], - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==" + ] }, { "name": "use-sync-external-store", @@ -6369,18 +6371,19 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w==", "dependencies": [ "react@19.2.8" - ], - "integrity": "sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w==" + ] }, { "name": "vite", - "version": "8.1.5", + "version": "8.1.6", "direct": true, "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-aRAHIxx5SW5zc1sMqFwJU/t5qaFfXb5Hj0J7W0VXihu/X99+346tz6080tO1T1xVIJORX/b3zVTXGFqUXh35uw==", "dependencies": [ "@types/node@24.13.3", "esbuild@0.28.1", @@ -6388,29 +6391,29 @@ "jiti@2.7.0", "lightningcss@1.33.0", "picomatch@4.0.5", - "postcss@8.5.22", + "postcss@8.5.32", "rolldown@1.1.5", "tinyglobby@0.2.17" - ], - "integrity": "sha512-7ULLwsCdYx/nRyrpiEwvqb5TFHrMVZyBt+rg/OAXT7rgj/z+DtTDyKFeLAdDkubDVDKD8jOsndmy7m55XcfUsw==" + ] }, { "name": "vitest", - "version": "4.1.10", + "version": "4.1.12", "direct": true, "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-5eWdz2yb3ajxWF3C8C4TjkXl7FGm3n2E/VlazALrQHzK7nYMSGFnCZto0bbPNl77AwkOZVLk0YnBAejUu0NiWA==", "dependencies": [ "@types/node@24.13.3", - "@vitest/coverage-v8@4.1.10", - "@vitest/expect@4.1.10", - "@vitest/mocker@4.1.10", - "@vitest/pretty-format@4.1.10", - "@vitest/runner@4.1.10", - "@vitest/snapshot@4.1.10", - "@vitest/spy@4.1.10", - "@vitest/utils@4.1.10", + "@vitest/coverage-v8@4.1.12", + "@vitest/expect@4.1.12", + "@vitest/mocker@4.1.12", + "@vitest/pretty-format@4.1.12", + "@vitest/runner@4.1.12", + "@vitest/snapshot@4.1.12", + "@vitest/spy@4.1.12", + "@vitest/utils@4.1.12", "es-module-lexer@2.3.1", "expect-type@1.4.0", "jsdom@29.1.1", @@ -6423,10 +6426,9 @@ "tinyexec@1.2.4", "tinyglobby@0.2.17", "tinyrainbow@3.1.0", - "vite@8.1.5", + "vite@8.1.6", "why-is-node-running@2.3.0" - ], - "integrity": "sha512-R9jUTe5S4Qb0HCd4TNqpC7oGcrMssMRGXLW80ubjWsW9VH5GF8y1Y0SFLY9AbqSk6nt0PnOx4H4WNJYZ13GUPw==" + ] }, { "name": "w3c-xmlserializer", @@ -6435,10 +6437,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==", "dependencies": [ "xml-name-validator@5.0.0" - ], - "integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==" + ] }, { "name": "watskeburt", @@ -6447,8 +6449,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-jfiuDABaxSkC71T6oZ3vCS99roYkSHm/+As+G0Dz8taAHQb+SJBvLEm5RlsgG71XdfAj3rv7eudUBTgwcQUPlQ==" + "integrity": "sha512-jfiuDABaxSkC71T6oZ3vCS99roYkSHm/+As+G0Dz8taAHQb+SJBvLEm5RlsgG71XdfAj3rv7eudUBTgwcQUPlQ==", + "dependencies": [] }, { "name": "webidl-conversions", @@ -6457,18 +6459,8 @@ "scope": "development", "optional": false, "license": "BSD-2-Clause", - "dependencies": [], - "integrity": "sha512-BMhLD/Sw+GbJC21C/UgyaZX41nPt8bUTg+jWyDeg7e7YN4xOM05YPSIXceACnXVtqyEw/LMClUQMtMZ+PGGpqQ==" - }, - { - "name": "webpack-virtual-modules", - "version": "0.6.2", - "direct": false, - "scope": "development", - "optional": false, - "license": "MIT", - "dependencies": [], - "integrity": "sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==" + "integrity": "sha512-BMhLD/Sw+GbJC21C/UgyaZX41nPt8bUTg+jWyDeg7e7YN4xOM05YPSIXceACnXVtqyEw/LMClUQMtMZ+PGGpqQ==", + "dependencies": [] }, { "name": "whatwg-mimetype", @@ -6477,8 +6469,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-sXcNcHOC51uPGF0P/D4NVtrkjSU2fNsm9iog4ZvZJsL3rjoDAzXZhkm2MWt1y+PUdggKAYVoMAIYcs78wJ51Cw==" + "integrity": "sha512-sXcNcHOC51uPGF0P/D4NVtrkjSU2fNsm9iog4ZvZJsL3rjoDAzXZhkm2MWt1y+PUdggKAYVoMAIYcs78wJ51Cw==", + "dependencies": [] }, { "name": "whatwg-url", @@ -6487,12 +6479,12 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-1to4zXBxmXHV3IiSSEInrreIlu02vUOvrhxJJH5vcxYTBDAx51cqZiKdyTxlecdKNSjj8EcxGBxNf6Vg+945gw==", "dependencies": [ "@exodus/bytes@1.15.1", "tr46@6.0.0", "webidl-conversions@8.0.1" - ], - "integrity": "sha512-1to4zXBxmXHV3IiSSEInrreIlu02vUOvrhxJJH5vcxYTBDAx51cqZiKdyTxlecdKNSjj8EcxGBxNf6Vg+945gw==" + ] }, { "name": "which", @@ -6501,10 +6493,10 @@ "scope": "development", "optional": false, "license": "ISC", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dependencies": [ "isexe@2.0.0" - ], - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==" + ] }, { "name": "why-is-node-running", @@ -6513,11 +6505,11 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==", "dependencies": [ "siginfo@2.0.0", "stackback@0.0.2" - ], - "integrity": "sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==" + ] }, { "name": "word-wrap", @@ -6526,8 +6518,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==" + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dependencies": [] }, { "name": "wrap-ansi", @@ -6536,12 +6528,12 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", "dependencies": [ "ansi-styles@4.3.0", "string-width@4.2.3", "strip-ansi@6.0.1" - ], - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==" + ] }, { "name": "ws", @@ -6550,8 +6542,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-+0NTnW77fFN/DjQi6k/Sq/Yvk4Sgajw7urW8V+asjXnRgDs9gyGkdb7EzgfhA4goXsRIZKE28fzIXBHEzhuiWw==" + "integrity": "sha512-+0NTnW77fFN/DjQi6k/Sq/Yvk4Sgajw7urW8V+asjXnRgDs9gyGkdb7EzgfhA4goXsRIZKE28fzIXBHEzhuiWw==", + "dependencies": [] }, { "name": "wsl-utils", @@ -6560,10 +6552,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-h3Fbisa2nKGPxCpm89Hk33lBLsnaGBvctQopaBSOW/uIs6FTe1ATyAnKFJrzVs9vpGdsTe73WF3V4lIsk4Gacw==", "dependencies": [ "is-wsl@3.1.1" - ], - "integrity": "sha512-h3Fbisa2nKGPxCpm89Hk33lBLsnaGBvctQopaBSOW/uIs6FTe1ATyAnKFJrzVs9vpGdsTe73WF3V4lIsk4Gacw==" + ] }, { "name": "xml-name-validator", @@ -6572,8 +6564,8 @@ "scope": "development", "optional": false, "license": "Apache-2.0", - "dependencies": [], - "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==" + "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==", + "dependencies": [] }, { "name": "xmlchars", @@ -6582,8 +6574,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==" + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", + "dependencies": [] }, { "name": "y18n", @@ -6592,8 +6584,8 @@ "scope": "development", "optional": false, "license": "ISC", - "dependencies": [], - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dependencies": [] }, { "name": "yallist", @@ -6602,8 +6594,8 @@ "scope": "development", "optional": false, "license": "ISC", - "dependencies": [], - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "dependencies": [] }, { "name": "yargs-parser", @@ -6612,8 +6604,8 @@ "scope": "development", "optional": false, "license": "ISC", - "dependencies": [], - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==" + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dependencies": [] }, { "name": "yargs", @@ -6622,6 +6614,7 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g==", "dependencies": [ "cliui@8.0.1", "escalade@3.2.0", @@ -6630,8 +6623,7 @@ "string-width@4.2.3", "y18n@5.0.8", "yargs-parser@21.1.1" - ], - "integrity": "sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g==" + ] }, { "name": "yocto-queue", @@ -6640,8 +6632,8 @@ "scope": "development", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==" + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dependencies": [] }, { "name": "zod-validation-error", @@ -6650,10 +6642,10 @@ "scope": "development", "optional": false, "license": "MIT", + "integrity": "sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ==", "dependencies": [ - "zod@4.4.3" - ], - "integrity": "sha512-Q6/nZLe6jxuU80qb/4uJ4t5v2VEZ44lzQjPDhYJNztRQ4wyWc6VF3D3Kb/fAuPetZQnhS3hnajCf9CsWesghLQ==" + "zod@4.6.7" + ] }, { "name": "zod", @@ -6662,8 +6654,18 @@ "scope": "production", "optional": false, "license": "MIT", - "dependencies": [], - "integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==" + "integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==", + "dependencies": [] + }, + { + "name": "zod", + "version": "4.6.7", + "direct": false, + "scope": "development", + "optional": false, + "license": "MIT", + "integrity": "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==", + "dependencies": [] } ] } diff --git a/config/testing/risk-coverage.json b/config/testing/risk-coverage.json index 3095ac12..0ba7859c 100644 --- a/config/testing/risk-coverage.json +++ b/config/testing/risk-coverage.json @@ -19,16 +19,6 @@ "branches": 90 } }, - { - "path": "src/adapters/http/bounded-json.ts", - "owner": "http-runtime", - "minimum": { - "lines": 85, - "statements": 84, - "functions": 95, - "branches": 78 - } - }, { "path": "src/adapters/http/http-execution-v3.ts", "owner": "http-runtime", @@ -39,26 +29,6 @@ "branches": 52 } }, - { - "path": "src/adapters/http/request-builder.ts", - "owner": "http-runtime", - "minimum": { - "lines": 85, - "statements": 85, - "functions": 95, - "branches": 82 - } - }, - { - "path": "src/adapters/http/retry-policy.ts", - "owner": "http-runtime", - "minimum": { - "lines": 80, - "statements": 78, - "functions": 95, - "branches": 78 - } - }, { "path": "src/adapters/query-cache/server-state-scope-runtime.ts", "owner": "server-state-runtime", @@ -212,10 +182,7 @@ ], "highRiskPaths": [ "src/adapters/http/bounded-body-reader.ts", - "src/adapters/http/bounded-json.ts", "src/adapters/http/http-execution-v3.ts", - "src/adapters/http/request-builder.ts", - "src/adapters/http/retry-policy.ts", "src/adapters/query-cache/server-state-scope-runtime.ts", "src/adapters/service-worker/service-worker-lifecycle.ts", "src/adapters/storage/browser-storage-adapter.ts", diff --git a/config/testing/test-evidence.json b/config/testing/test-evidence.json index afa519f3..914258ff 100644 --- a/config/testing/test-evidence.json +++ b/config/testing/test-evidence.json @@ -2,7 +2,7 @@ "schemaVersion": 2, "scenarioCatalogs": [ { - "owner": "reference-feature", + "owner": "platform", "path": "tests/mocks/scenarios/catalog.ts", "expectationExport": "HTTP_SCENARIO_EXPECTATIONS", "receiptPath": "artifacts/tests/http-scenario-executions.json", @@ -11,8 +11,8 @@ ], "sourceContracts": [ { - "owner": "reference-feature", - "path": "tests/mocks/handlers/reference-resources.ts", + "owner": "platform", + "path": "tests/mocks/handlers/test-entities.ts", "requiredTokens": [ "assertOperationScenario", "../scenarios/catalog.ts" diff --git a/docs/README.md b/docs/README.md index e0ac866f..6435d08c 100644 --- a/docs/README.md +++ b/docs/README.md @@ -29,7 +29,10 @@ README와 입구 문서는 영어, recipe·ledger·스타일 문서는 한국어 입구 문서가 가리키는 세부 규칙: +- 새 기능 추가 매뉴얼(작업 순서, 단계별 판단 기준, `create:feature`): [`manual/`](manual/), [`manual/reference/`](manual/reference/). 한국어다 +- 규모 설계(구조·소유·실행·트래픽·오류·검증·텔레메트리·릴리스 일관성)와 코드 주석 `scale-architecture.md §N`의 근거: [`architecture/scale-architecture.md`](architecture/scale-architecture.md). 절마다 현재 계약인지 기록만인지 머리말 표에 적었다 - 계약 소유와 호환성: [`architecture/contract-ownership.md`](architecture/contract-ownership.md), [`contracts/compatibility.md`](contracts/compatibility.md) +- 짝 백엔드 Envelope 판정과 쓰기 전 거절 표(지금 실행 규칙, `src/adapters/http/backend-envelope.ts`의 근거): [`architecture/backend-api-and-server-state-contract.md`](architecture/backend-api-and-server-state-contract.md) 4.1·6·6.1절. 기준 커밋은 [`../config/contracts/backend-contract-pin.json`](../config/contracts/backend-contract-pin.json). 같은 문서의 나머지 절은 목표 설계다 - 정적 배포와 런타임 설정: [`architecture/static-delivery.md`](architecture/static-delivery.md) - 기능 개발자가 알아야 하는 양: [`architecture/capability-consumer-experience.md`](architecture/capability-consumer-experience.md) - 운영·복구: [`operations/`](operations/), [`runbooks/`](runbooks/) @@ -37,11 +40,21 @@ README와 입구 문서는 영어, recipe·ledger·스타일 문서는 한국어 - 디자인 토큰과 수동 접근성 검토: [`styling/design-tokens.md`](styling/design-tokens.md), [`accessibility/manual-checklist.md`](accessibility/manual-checklist.md) - 버전별 변경: [`../CHANGELOG.md`](../CHANGELOG.md) +`verify:documentation`은 이 파일과 이 절에서 링크한 문서(폴더 링크는 그 안의 `.md` 전부)에 +적힌 repo 경로·링크·package script·FE-GATE ID가 실제로 있는지 검사한다. 명령(인라인 코드와 +셸 코드 블록) 안의 경로 인자도 본다. 짝 백엔드 템플릿(`clean-architecture-backend-template`)의 +경로와 링크는 그 checkout이 이 checkout 옆에 있을 때만 확인하고, 없으면 실패 대신 확인하지 +못한 것으로 출력과 `artifacts/quality/documentation-review.json`에 남긴다. `CHANGELOG.md`는 +지난 상태를 적는 문서라 빼고, git이 무시하는 생성 산출물과 복사한 프로젝트가 지운 작업 이력은 +없어도 된다. 설명·수치가 코드와 맞는지는 검사하지 않는다. 규칙과 예외의 정본은 +`scripts/verify-documentation-readiness.ts`다. + 게이트가 직접 읽는 파일이라 지우거나 옮기면 게이트가 실패한다. | 파일 | 읽는 명령 | |---|---| -| `architecture/review-ledger.json`, `architecture/review-evidence.md`, `accessibility/manual-checklist.md` | `verify:documentation` (FE-GATE-017) | +| 이 파일, `architecture/review-ledger.json`, `architecture/review-evidence.md` | `verify:documentation` (FE-GATE-017) | +| repo 루트의 `artifacts/tests/a11y-manual/` 라우트별 기록 | `verify:documentation` (FE-GATE-017), `review:a11y-manual` (FE-GATE-009, FE-GATE-028) | | `reviews/adapters/INVENTORY.md` | `check:adapter-inventory` (FE-GATE-010) | | `operations/adapter-remediation-ledger.md`, `operations/adapter-remediation-dispositions.json` | `check:remediation-ledger` (게이트 밖. 이유는 `config/ci/ungated-scripts.json`) | @@ -68,5 +81,5 @@ README와 입구 문서는 영어, recipe·ledger·스타일 문서는 한국어 | 경로 | 내용 | |---|---| | [`superpowers/`](superpowers/) | 과거 작업 계획과 스펙 | -| [`reviews/`](reviews/) | 리뷰 결과와 리뷰 가이드. `reviews/adapters/INVENTORY.md`만 게이트가 읽는다 | +| [`reviews/`](reviews/) | 리뷰 결과와 리뷰 가이드. `reviews/adapters/INVENTORY.md`만 게이트가 읽는다. `reviews/adapters/`는 지우지 않는다: INVENTORY의 행과 `operations/adapter-remediation-ledger.md`가 그 안의 리뷰로 링크한다 | | [`../SPEC.md`](../SPEC.md), [`../tasks/`](../tasks/) | 2026-09-25 리뷰 수정 라운드의 요구사항과 작업 목록. 이 라운드가 쓰는 중이라 `docs/` 밖에 그대로 둔다 | diff --git a/docs/accessibility/manual-checklist.md b/docs/accessibility/manual-checklist.md index 77b804f7..21804569 100644 --- a/docs/accessibility/manual-checklist.md +++ b/docs/accessibility/manual-checklist.md @@ -1,14 +1,12 @@ # Manual accessibility review checklist Automated axe checks do not establish WCAG conformance. A human reviewer must -review all ten route records in `artifacts/tests/a11y-manual/` against one -release candidate and sign them. The required scope is derived from the route -registry: `APP_HOME`, `EXAMPLES_PLATFORM`, `EXAMPLES_UI`, `EXAMPLES_STATES`, -`EXAMPLES_AUTH`, `NOT_FOUND`, `REFERENCE_RESOURCE_LIST`, -`REFERENCE_RESOURCE_DETAIL`, `REFERENCE_RESOURCE_FORM` and -`REFERENCE_RESOURCE_STATUS`. Copy the template fields exactly; the gate rejects -blank identity/timestamp/signature fields, pending verdicts, mismatched release -IDs, or missing routes. +review every route record in `artifacts/tests/a11y-manual/` against one +release candidate and sign them. The required scope is the route registry +(`ROUTE_REGISTRY` in `src/features/installed-feature-contracts.ts`): one +record per route, named `.md`. Copy the template fields exactly; the +gate rejects blank identity/timestamp/signature fields, pending verdicts, +mismatched release IDs, or missing routes. The signed review is the release gate FE-GATE-028 (`review:a11y-manual`), so it is required once per release candidate, not on every merge. The merge gate @@ -16,11 +14,11 @@ FE-GATE-009 runs `review:a11y-manual -- --format-only`: each record must keep the fields below with `pending`, `pass` or `not-applicable ()` verdicts, and a record marked `reviewed` must be complete. -This list is not maintained by hand: `verify:documentation` compares it against -the installed route registry and fails when a registered route is absent. It -said six routes while ten were registered, which put the platform overview and -the three reference-resource screens outside the declared manual review scope -without anyone deciding they should be. +This document keeps no route list. A list here once said six routes while ten +were registered, and keeping it current made every new feature edit this file. +Instead `verify:documentation` fails, naming the route ID, when a registered +route has no record file. A new route starts from a copy of a pending record +with its title and `Route ID` changed. Allowed item verdicts: @@ -70,9 +68,14 @@ What the automated run scans: never lands on the app shell's loading surface (`tests/e2e/accessibility.spec.ts`). A public route's `h1` must equal its catalog title. -- Protected routes after the demo sign-in, never the sign-in prompt. Their API - calls answer an empty list there. +- Protected routes after the demo sign-in, never the sign-in prompt. A list + read answers an empty list in the frame its descriptor declares (inside the + Envelope for `responseEnvelope: "ENVELOPE_V1"`), and the scan runs only once + no alert box is on screen, so a list page is scanned in its empty state. A + read of one resource (a detail page) has no generic answer: that route is + scanned in its failure state and the run records an `a11y-data-state` + annotation. - The reference sample's list in its success, empty and error states, its detail, its form with submit errors and its status page, each after that - state is on screen (`tests/e2e/reference-form.spec.ts`, removed with the + state is on screen (tests/e2e/reference-form.spec.ts, removed with the sample). diff --git a/docs/architecture/api-contract-schema-mapper-and-server-state.md b/docs/architecture/api-contract-schema-mapper-and-server-state.md index cf323151..1a874e72 100644 --- a/docs/architecture/api-contract-schema-mapper-and-server-state.md +++ b/docs/architecture/api-contract-schema-mapper-and-server-state.md @@ -81,8 +81,8 @@ PromotionEvidence | capability | primary current status | 현재 증거 | 목표 또는 잔여 | | --- | --- | --- | --- | | installed REST reference vertical | `COMPOSED` | operation registry → request schema → HTTP → envelope/payload schema → mapper → application input → Query 화면 경로 | 아래 REST hardening delta와 실제 제품 provider 계약 | -| shared REST JSON executor | `COMPOSED` | path/search/body codec projection, shared deadline/retry-sleep budget, AbortSignal, bounded auth recovery, exact envelope/media/status, safe failure와 diagnostics | 204/304/412 execution join과 actual provider conformance | -| REST v2 security/execution baseline | `COMPOSED` | collision-aware operation composition, path placeholder↔codec key exact join, prefix-preserving HTTPS/loopback provider, named bearer/CSRF profile와 credential-mode ceiling, auth fail-before-fetch, bounded JSON, outbound correlation/status·physical-attempt 관측 | cookie-CSRF/CORS provider evidence, 204/304/412 conditional execution과 compatibility artifact | +| shared REST JSON executor (V3 contract executor) | `COMPOSED` | `src/adapters/http/http-execution-v3.ts`: descriptor 하나로 실행, shared deadline/retry 예산, AbortSignal, exact media/status, 짝 백엔드 Envelope 판정(`backend-envelope.ts`), safe failure와 diagnostics. 401은 끝이고 숨은 auth recovery는 없다(정본 8.4) | 204/304/412 등 남은 REST hardening delta | +| REST v2 security/execution baseline | `REMOVED` | 2026-11-03 V2 HTTP 경로 삭제(`048f490`·`12f3bb7`). V2 provider·CSRF 프로필 해석도 함께 지웠다 | 지금 경로는 V3 contract executor(아래 행) | | GraphQL provider-neutral reference adapter | `DESIGNED_NOT_IMPLEMENTED` | source/dependency/codegen/runtime 없음 | persisted-operation-only transport, GraphQL response decoder, mapper binding과 contract harness | | product GraphQL composition | `NOT_SELECTED` | endpoint/schema/persisted manifest/owner 없음 | 제품 query가 REST보다 GraphQL aggregation을 정당화할 때 선택 | | GraphQL batching, subscription, `@defer`/`@stream` | `NOT_SELECTED` | 없음 | 각각 독립 ADR, proxy/browser lifecycle과 cache semantics 필요 | @@ -98,7 +98,7 @@ PromotionEvidence | Protobuf REST Gateway reference contract/harness | `DESIGNED_NOT_IMPLEMENTED` | HttpRule/transcoder/OpenAPI/provider fixture 없음 | selected kind의 deterministic/provider conformance | | product Protobuf REST Gateway composition | `NOT_SELECTED` | route/provider/owner 없음 | curated BFF, grpc-gateway 또는 Envoy transcoder 중 하나와 public HTTP contract 승인 | | feature runtime request/response Schema | `COMPOSED` | Zod request/payload schemas와 installed schema registry가 reference feature에 연결 | byte/depth/node ceiling, unknown-field profile, schema artifact/digest와 multi-protocol source governance | -| schema/mapper v2 reference baseline | `COMPOSED` | collision-aware schema codec/mapper contribution install, operation schema/mapper reference resolution, request reject/response strip 방향, bounded collection, typed no-throw mapping result와 operation별 cast-free result guard | actual codec fingerprint, source provenance와 multi-protocol compatibility policy | +| schema/mapper v2 reference baseline | `REMOVED` | 2026-11-03 삭제(`12f3bb7`). schema는 descriptor 검증기와 FE-REG-SCHEMA 행, mapping은 descriptor `mapSuccess`다 | — | | generated contract artifact governance | `DESIGNED_NOT_IMPLEMENTED` | `generated-api` recipe만 있고 generator/provider 선택 없음 | OpenAPI/GraphQL/proto source authentication, pinned generation, drift/breaking gate와 N/N-1 | | feature boundary Mapper | `COMPOSED` | installed mapper metadata composer와 response-schema exact join 뒤 typed no-throw MappingResult → immutable domain/application view 실행 | numeric/date/null/enum canonical rules와 generated-artifact join | | TanStack Query memory Server State | `COMPOSED` | QueryClient, cancellation, stale-degraded UI, session-generation cancel/clear fence와 invalidation coordinator | account identity projection과 bounded topic↔namespace many-to-many registry | @@ -264,9 +264,10 @@ registry validation은 다음을 build/boot 전에 거절한다. Connect/gRPC-Web operation↔provider의 runtime/wire/status/capability tuple mismatch -현재 installed reference operation은 REST v2 metadata를 사용한다. operation, -runtime schema codec과 mapper contribution은 object spread가 아니라 각각의 -collision-aware composer로 설치되며 duplicate ID를 덮어쓰기 전에 거절한다. +현재 installed reference operation은 V3 descriptor 하나로 적는다(REST v2 metadata는 +2026-11-03에 지웠다). contract contribution은 object spread가 아니라 collision-aware +composer로 설치되며 duplicate ID를 덮어쓰기 전에 거절한다. 아래 binding 검증 서술은 +V2 기록이 섞여 있다. 지금 규칙은 `src/contracts/external-contract-runtime.ts`가 정본이다. boot-time binding 검증은 path placeholder와 codec key, provider/auth/CSRF profile, path/request/response schema와 mapper input schema를 exact resolve한 뒤 immutable registry를 발행한다. GraphQL/Connect/gRPC-Web discriminant와 protocol-specific diff --git a/docs/architecture/backend-api-and-server-state-contract.md b/docs/architecture/backend-api-and-server-state-contract.md index c209ef03..2e2fe977 100644 --- a/docs/architecture/backend-api-and-server-state-contract.md +++ b/docs/architecture/backend-api-and-server-state-contract.md @@ -8,7 +8,7 @@ > 본 문서의 해당 서술이 정본과 충돌하면 정본을 따른다. -- 상태: frontend handoff design accepted, backend implementation/evidence pending +- 상태: frontend handoff design accepted, backend implementation/evidence pending. 단 4.1·6·6.1절(Envelope 읽기, effect 판정, 쓰기 전 거절 표)은 지금 실행 규칙이다(`COMPOSED`, `src/adapters/http/backend-envelope.ts`) - 기준일: 2026-07-28 - 대상: Web API/BFF, application service, persistence, identity, GraphQL router, Connect/gRPC-Web gateway, Protobuf REST Gateway와 운영 owner @@ -160,57 +160,46 @@ authorization을 다시 수행한다. ### 4.1 JSON envelope -모든 현재 JSON success/failure는 다음 envelope를 사용한다. +Envelope의 모양과 키 존재 규칙은 짝 백엔드 템플릿 문서가 정본이다. 이 +문서에 표를 다시 적지 않는다. -```json -{ - "success": true, - "data": {}, - "meta": { - "requestId": "server-request-id", - "traceId": "server-trace-id", - "correlationId": "client-correlation-id" - } -} -``` - -```json -{ - "success": false, - "error": { - "code": "STABLE_MACHINE_CODE", - "category": "optional-safe-category", - "message": "optional non-sensitive copy", - "retryable": false, - "details": {} - }, - "meta": { - "requestId": "server-request-id", - "traceId": "server-trace-id", - "correlationId": "client-correlation-id" - } -} -``` - -Envelope 최상위 unknown field는 현재 거절된다. ordinary resource DTO의 unknown -field는 frontend schema에서 strip되지만 additive compatibility는 contract -review와 fixture를 먼저 통과해야 한다. - -`requestId`, `traceId`, `correlationId`는 각각 1..128 범위의 안전한 opaque -identifier다. credential, user data, cursor, validator와 database key를 -identifier에 encode하지 않는다. +- 정본: [`clean-architecture-backend-template/docs/web/http-contract.md`](../../../clean-architecture-backend-template/docs/web/http-contract.md) + 1절 "Envelope 키 존재 규칙" +- 기준 커밋: 백엔드 `45d2a478`. 기계가 읽는 정본은 + `config/contracts/backend-contract-pin.json`(repo, 전체 SHA, 대조한 절 §1·§2·§4, + 담당)이다. 백엔드 §2 표와 §4 `REQUEST_TIMEOUT`은 + `config/contracts/backend-idempotency-answers.json`에 code·status·쓰기 전 거절·같은 키 + 재전송 열로 옮겨 두었다. `tests/unit/backend-contract-pin.test.ts`가 그 표와 + `backend-envelope.ts`의 판정을 양방향으로 대조한다. 값이 null인 필드는 키째 + 생략한다. 백엔드 기준 커밋을 올리면 pin, 답 표 JSON, 6.1절 표를 같은 변경에서 + 다시 확인한다. 형제 디렉터리에 백엔드 checkout이 있으면 + `corepack pnpm check:backend-contract-drift`가 pin 뒤 `http-contract.md`가 + 바뀌었는지 알려 준다(게이트 밖). +- 프론트에서 Envelope를 읽는 곳: `src/adapters/http/backend-envelope.ts`(스키마와 + 해석). V3 실행기는 descriptor가 `responseEnvelope: "ENVELOPE_V1"`일 때 쓴다. + `create:feature`가 만든 기능은 이 값을 선언한다. 참조 기능은 선언하지 않고 + DTO와 problem details를 검증한다. +- 실패 Envelope의 `error.code`가 "적용 안 됨"인지는 6.1절이 정한다. +- 페이지 목록의 `meta.page`(`number`·`size`·`total`·`sort`)는 기능의 + `mapSuccess(value, { page })` 두 번째 인자로 간다(`FeatureHttpSuccessContext`). + `outputValidator`는 지금처럼 `data`만 본다. 백엔드 범위(정수, `size` 1~100) 밖의 + `page`는 버리고 응답은 그대로 읽는다. 목록 화면의 전체 수는 `page.total`이다. + 배열 길이는 첫 페이지 크기(기본 20)일 뿐이다. +- bulk 응답(`results`, `BATCH_PARTIAL_FAILURE`)은 지원하지 않는다. 성공 status의 + `results` Envelope는 `ENVELOPE_MISMATCH`다. bulk 엔드포인트를 붙이려면 + `responseEnvelope`를 빼고 기능 스키마가 본문 전체를 읽는다. ### 4.2 Status와 error | HTTP status | 의미 | | --- | --- | -| `400` | malformed request 또는 closed request contract 위반 | +| `400` | malformed request 또는 closed request contract 위반. 짝 백엔드의 필드 검증 실패는 400 `VALIDATION_FAILED`(필드 목록 `details`)다. 적용 여부는 6.1절 | | `401` | 인증 없음/만료. 이미 적용된 command를 401로 반환하지 않음 | | `403` | authenticated principal에게 권한 없음 | | `404` | authorization 정책상 공개 가능한 not-found | -| `409` | idempotency fingerprint, domain revision 또는 semantic conflict | +| `409` | domain revision 또는 semantic conflict. 멱등성 응답(409·422·400)은 6절 | | `412` | selected conditional write의 `If-Match` precondition 실패 | -| `422` | field validation. bounded `details.issues[]`만 허용 | +| `422` | 짝 백엔드에서는 field validation이 아니다. 기본 배포는 `IDEMPOTENT_REQUEST_MISMATCH`(6절)만, fileserver 모듈은 쓰기 뒤에도 나오는 code를 422로 보낸다. 프론트는 `IDEMPOTENT_REQUEST_MISMATCH`만 적용 안 됨으로 보고, 폼 필드 오류는 `details.issues[]`가 있으면 읽는다. 필드 목록이 없는 422는 입력 오류가 아니라 `UNKNOWN_CLIENT_FAILURE`다(폼은 지원 참조가 있는 실패 상태를 보인다). 적용 여부는 6.1절 | | `429` | rate limit. 유효한 `Retry-After`와 operation 정책 제공 | | `500/502/503/504` | server/provider failure. command effect certainty 별도 | @@ -255,7 +244,9 @@ Cross-origin bearer provider 최소 CORS: `X-Correlation-ID`, 향후 `If-None-Match`, `If-Match` 허용 - 필요한 경우 `ETag`, `Retry-After`, request/trace header만 expose. `X-Correlation-ID`를 expose하면 V3 실패의 `AppFailure.requestId`가 된다 - (`src/adapters/http/feature-http-binding.ts`) + (`src/adapters/http/feature-http-binding.ts`). expose하지 않거나 응답이 없으면 + 클라이언트가 보낸 값이 된다. Envelope operation의 실패 본문 `meta.traceId`는 + `AppFailure.traceId`가 된다(헤더가 아니라 본문이라 CORS expose와 상관없다) - redirect login page, HTML error body와 wildcard credential 금지 ## 6. Command와 idempotency @@ -263,53 +254,119 @@ Cross-origin bearer provider 최소 CORS: `CREATE_REFERENCE_RESOURCE`는 keyed command다. frontend memory single-flight는 backend idempotency를 대체하지 않는다. -idempotency identity: +멱등성 응답의 status·`error.code`·`retryable`·`Retry-After`와 키 문법은 짝 +백엔드 템플릿 문서가 정본이다. 이 문서에 표를 다시 적지 않는다. -```text -principal/tenant - + semantic operation ID and contract version - + Idempotency-Key - + canonical request fingerprint -``` +- 정본: [`clean-architecture-backend-template/docs/web/http-contract.md`](../../../clean-architecture-backend-template/docs/web/http-contract.md) + 2절 "멱등성 응답", 4절 "web 전용 오류 코드" +- 기준 커밋: 4.1절과 같다(백엔드 `45d2a478`, `config/contracts/backend-contract-pin.json`). +- 프론트가 그 응답을 읽는 곳: + - 키 생성·검사: `src/contracts/mutation-intent.ts` `isValidIdempotencyKey` + - 결과 불명 재전송이 같은 키를 쓰고 `Retry-After`까지 기다리는 곳: + `src/presentation/adapters/query/application-query.ts` + - Envelope operation의 거절 판정: `src/adapters/http/backend-envelope.ts` + `REFUSED_BEFORE_WRITE`(6.1절 표) + - 참조 기능(Envelope 없음) 판정: src/features/reference-feature/contracts/reference-feature-contract-contribution.ts + (effect), src/features/reference-feature/adapters/reference-http-gateway.ts + (code) -권장 record: +### 6.1 거절 code와 적용 여부 -```text -IdempotencyRecord - principalFingerprint - operationId - contractVersion - idempotencyKeyHash - requestFingerprint - state = IN_PROGRESS | COMMITTED | FAILED_SAFE | EFFECT_UNKNOWN - responseStatus - responseEnvelopeReference - resourceRevision | null - leaseOwner + leaseExpiry - retentionExpiry - createdAt + completedAt -``` +mutation이 400·409·422로 실패하면 프론트는 그 요청이 적용됐는지 정해야 한다. -불변조건: +- `NOT_APPLIED`: 쓰기 전에 거절됐다. 다음 저장은 새 `Idempotency-Key`를 쓴다. +- `MAYBE_APPLIED`: 쓰기 뒤에도 나올 수 있다. mutation 코디네이터가 키를 붙들고 + 결과 불명으로 보인다. effect가 없는 실패도 이 값이다. -- claim과 command transaction의 관계가 원자적이거나 crash reconciliation - 가능해야 한다. -- 같은 key와 같은 fingerprint replay는 같은 authoritative receipt를 반환한다. -- 같은 key와 다른 fingerprint는 `409 IDEMPOTENCY_KEY_REUSED`다. -- concurrent replay는 하나만 실행하고 나머지는 같은 result를 기다리거나 - bounded `IN_PROGRESS` 결과를 받는다. -- commit 뒤 response 유실은 새 resource를 만들지 않는다. -- `EFFECT_UNKNOWN`은 새 key로 자동 재시도하지 않고 status/reconcile endpoint로 - 확인한다. -- retention은 frontend retry/recovery 최대 window보다 길고 quota/abuse limit이 - 있다. -- key 원문과 request body를 log/metric label에 넣지 않는다. +백엔드 `http-contract.md`는 code가 어느 단계에서 나오는지 적지 않는다. 아래 표는 +프론트가 백엔드 코드를 읽고 정한 판정이다. `5786126c`에서 읽었고, `bbe944bd`에서 +바뀐 파일(`GlobalExceptionHandler`, `IdempotencyExecutor`, `PersistenceExceptionTranslator`, +`FailureCategory`, `DomainExceptionHandler`)을 다시 읽었다. 판정은 바뀌지 않았고 줄 +번호만 옮겼다. `c508b1ba`에서는 바뀐 `IdempotencyExecutor`(늦게 끝난 실행 기록)를 다시 +읽었다. 처리 중·불일치 판정은 그대로 action 전이고 줄 번호만 옮겼다. `45d2a478`에서는 +바뀐 `GlobalExceptionHandler`(로그 줄 정리)와 `IdempotencyExecutor`를 다시 읽었다. 인용한 +블록의 내용은 그대로이고 줄 번호만 옮겼다. §2는 처리 중(PostgreSQL 저장소는 409 대신 +기다림)과 `IDEMPOTENCY_UNAVAILABLE`(lease 만료로 시작 거절) 설명만 늘었고 code·status·재시도는 같다. 같은 code가 쓰기 전과 +뒤에서 모두 나오면 "쓰기 뒤 가능"으로 둔다. 프론트는 code만 보고 둘을 가를 수 +없다. -Database unique constraint 또는 durable compare-and-set이 최종 중복 방지 -authority여야 한다. process-local map/lock만 사용하지 않는다. +| code (status) | 나오는 곳 | 단계 | 프론트 결과 | 백엔드 파일:줄 | +| --- | --- | --- | --- | --- | +| `VALIDATION_FAILED` (400), details = 필드 목록 | 요청 본문 `@Valid` 실패, 컨트롤러 파라미터 제약 실패. 컨트롤러 메서드가 불리기 전 | 쓰기 전 | `NOT_APPLIED` | `GlobalExceptionHandler.java:205-218`, `:333-355` | +| `VALIDATION_FAILED` (400), details = 필드 목록 | `ConstraintViolationException`. 어느 층에서 던져도 이 handler가 받는다. 요청 경로에서 던지는 코드는 없다(application bean에 `@Validated` 없음, JPA entity에 Bean Validation 제약 없음, 직접 throw 없음) | 쓰기 전(현재 출처 없음) | `NOT_APPLIED` | `GlobalExceptionHandler.java:101-106` | +| `VALIDATION_FAILED` (400), details = `{cause}` 또는 없음 | 본문을 읽지 못함(`HttpMessageNotReadableException`) | 쓰기 전 | `NOT_APPLIED` | `GlobalExceptionHandler.java:220-238` | +| `VALIDATION_FAILED` (400), details = `{field, code}` | 페이지·정렬 파라미터. 목록 GET 컨트롤러가 use case 전에 검사한다 | 쓰기 전 | `NOT_APPLIED` | `GlobalExceptionHandler.java:149-153`, `PageParams.java:27-33`, `SortParam.java:16-43` | +| `IDEMPOTENCY_KEY_INVALID` (400) | KEYED 컨트롤러 첫 줄의 키 파싱 | 쓰기 전 | `NOT_APPLIED` | `IdempotencyKeyHeader.java:32-38`, `PosterImagePublicationController.java:64` | +| `IDEMPOTENT_REQUEST_MISMATCH` (422) | 멱등성 executor가 action 전에 판정 | 쓰기 전 | `NOT_APPLIED` | `IdempotencyExecutor.java:127-128`, `:166-167` | +| `IDEMPOTENT_IN_FLIGHT` (409) | 멱등성 executor가 action 전에 판정. 같은 키의 앞선 요청이 실행 중이다 | 이번 요청은 쓰기 전. 앞선 요청은 적용될 수 있다 | `MAYBE_APPLIED` | `IdempotencyExecutor.java:129-130`, `:168-169` | +| `BAD_PARAMETER` (400) | 타입 변환 실패, 필수 파라미터·헤더 없음(쓰기 전). **어느 층이든 `IllegalArgumentException`**(use case·domain 포함) | 쓰기 뒤 가능 | `MAYBE_APPLIED` | `GlobalExceptionHandler.java:92-99`, `:108-116`, `:384-404`, `HttpStatusErrorCodes.java:33-34` | +| `MAPPING_FAILED` (400) | web 매퍼(쓰기 전), outbound ACL 매퍼(use case 안), 멱등성 응답 직렬화(action이 끝난 뒤) | 쓰기 뒤 가능 | `MAYBE_APPLIED` | `WorkLogWebMapper.java:36`, `RepoStatsAclMapper.java:14`, `JsonIdempotentResponseCodec.java:32`, `IdempotencyExecutor.java:276` | +| `DB_SERIALIZATION_FAILURE`, `DB_DEADLOCK`, `DB_LOCK_TIMEOUT`, `DB_NULL_VIOLATION`, `DB_FK_VIOLATION`, `DB_UNIQUE_VIOLATION`, `DB_CHECK_VIOLATION`, `DB_OPTIMISTIC_CONFLICT` (409) | persistence 어댑터가 SQL·JPA 실패를 바꾼 것. 트랜잭션 안이나 commit에서 | 쓰기 뒤 가능 | `MAYBE_APPLIED` | `FailureCategory.java:86-102`, `StandardSqlStateErrorMapping.java:46-52`, `PersistenceExceptionTranslator.java:133` | +| `LOCK_ACQUISITION_TIMEOUT` (409) | 분산 락 대기 초과. use case 안 | 쓰기 뒤 가능 | `MAYBE_APPLIED` | `LockRegistryDistributedLock.java:50`, `:53` | +| 참조 도메인 `WORKLOG_INVALID`, `POSTER_INVALID_STATE`, `POSTER_IMAGE_REQUIRED` (400), `WORKLOG_CONFLICT`, `POSTER_ALREADY_EXISTS`, `POSTER_IMAGE_ALREADY_PUBLISHED` (409) | application·domain 예외 | 쓰기 뒤 가능 | `MAYBE_APPLIED` | `DomainExceptionHandler.java:52-90` | +| 선택 모듈 web-advanced `PATCH_REJECTED` (400), `PATCH_TEST_FAILED` (409) | patch 라이브러리. 부르는 코드가 단계를 정한다 | 쓰기 뒤 가능 | `MAYBE_APPLIED` | `clean-architecture-backend-template/src/adapter/inbound/web-advanced/README.md` 「오류 응답」 | +| 선택 모듈 fileserver `BAD_REQUEST` (400), `FILE_ALREADY_EXISTS`, `FILE_NOT_READY`, `UPLOAD_OFFSET_MISMATCH`, `CONCURRENT_MODIFICATION` (409), `INTEGRITY_MISMATCH`, `MALWARE_DETECTED`, `INVALID_PATH`, `PATH_OUTSIDE_NAMESPACE` (422) | application·outbound 층. `INTEGRITY_MISMATCH`·`MALWARE_DETECTED`는 레코드를 `REJECTED`로 쓴 뒤 던진다 | 쓰기 뒤 가능 | `MAYBE_APPLIED` | `FileserverErrorCode.java:26-44`, `FinalizeUploadApplicationUseCase.java:211-224`, `:336-341` | + +- application-notification의 `VALIDATION_FAILED`(`NotificationFailureCode`)는 + `ApiErrorCarrier`가 아니다. HTTP로는 500 `INTERNAL_ERROR`로 나가므로 표에 없다. +- 표에 없는 400·409·422 code는 `MAYBE_APPLIED`로 본다. +- 400·409·422 밖에서 백엔드 계약이 직접 정한 답 넷도 status와 code가 함께 + 맞으면 기능 분류기와 상관없이 `MAYBE_APPLIED`다(`backend-envelope.ts` + `MAYBE_APPLIED_ANSWERS`). `http-contract.md` §2의 503 `IDEMPOTENCY_UNAVAILABLE`, + 503 `IDEMPOTENCY_COMPLETION_UNKNOWN`(백엔드 `bbe944bd`부터), 500 + `IDEMPOTENCY_RECOVERY_REQUIRED`, §4의 503 `REQUEST_TIMEOUT`이다. 실행기가 + 자동으로 다시 보내는 것은 KEYED 명령의 503 `IDEMPOTENCY_UNAVAILABLE`뿐이다. + 나머지는 결과 불명 화면에서 사용자가 같은 키로 다시 보낸다. +- 파일 위치(백엔드 repo `clean-architecture-backend-template` 기준): + - `GlobalExceptionHandler.java`, `HttpStatusErrorCodes.java`: `clean-architecture-backend-template/src/adapter/inbound/web/src/main/java/dev/caskeleton/adapter/inbound/web/error/` + - `PageParams.java`, `SortParam.java`: 같은 모듈 `.../web/pagination/` + - `IdempotencyKeyHeader.java`: 같은 모듈 `.../web/http/` + - `IdempotencyExecutor.java`: `clean-architecture-backend-template/src/application-core/src/main/java/dev/caskeleton/application/idempotency/` + - `JsonIdempotentResponseCodec.java`: `clean-architecture-backend-template/src/adapter/inbound/web-advanced/.../advanced/idempotency/` + - `FailureCategory.java`, `StandardSqlStateErrorMapping.java`, + `PersistenceExceptionTranslator.java`, `LockRegistryDistributedLock.java`: + `clean-architecture-backend-template/src/adapter/outbound/persistence-jpa/` + - `PosterImagePublicationController.java`, `WorkLogWebMapper.java`, + `RepoStatsAclMapper.java`, `DomainExceptionHandler.java`: `clean-architecture-backend-template/src/sample-portfolio/` + - `FileserverErrorCode.java`, `FinalizeUploadApplicationUseCase.java`: + `clean-architecture-backend-template/src/application-fileserver/` + +**operation이 선언하는 쓰기 전 거절**(1103/03-01): 업무 code는 엔드포인트마다 +단계가 달라 위 표에 "쓰기 뒤 가능"으로 둔다. 쓰기 전에만 그 code를 내는 엔드포인트를 +아는 사람은 기능 작성자다. 그 사람이 descriptor의 +`commandEffect.refusedBeforeWrite`에 code를 적는다. + +- 그 code로 온 400·409·422는 `NOT_APPLIED`다. 적지 않은 code는 그대로 `MAYBE_APPLIED`다. +- 짝 백엔드 생성 기능의 create는 이름 규칙을 `build(command)`에서 트랜잭션 전에 + 검사하고 400 `_INVALID`를 준다(`Create__Feature__UseCase.java.tmpl`, + `__Feature__ErrorCode.java.tmpl`). 이 code는 적는다. +- 위 표의 code(`VALIDATION_FAILED` 등)는 적어도 표의 status 규칙을 따른다. + `IDEMPOTENT_*`·`IDEMPOTENCY_*`는 적을 수 없다. 계약 조립이 거절하고, 실행기도 + 무시한다. 409 `IDEMPOTENT_IN_FLIGHT`의 앞선 요청은 적용될 수 있기 때문이다. +- `responseEnvelope: "ENVELOPE_V1"`가 아닌 operation에는 적을 수 없다. 실행기가 + 백엔드 code를 읽지 않는다. +- 판정은 `src/adapters/http/backend-envelope.ts` `envelopeFailureEffect`, 조립 검사는 + `src/contracts/external-contract-runtime.ts` `assertRefusedBeforeWrite`다. + +프론트 판정과 표가 다른 곳(고치면 이 줄을 지운다): + +- 참조 기능 분류기(`classifyProblem`)는 참조 fixture(problem+json)용이라 + 400·422를 모두 `NOT_APPLIED`로 본다. 참조 기능은 Envelope operation이 아니라 + 이 표의 대상이 아니다. 짝 백엔드에 붙이는 Envelope operation은 + `src/adapters/http/backend-envelope.ts`의 표가 400·409·422를 정한다(`3261208`). + +남은 위험: "쓰기 전"은 현재 코드에서 그 handler에 닿는 출처를 센 결과다. 백엔드가 +application bean에 `@Validated`를 달거나 JPA entity에 Bean Validation 제약을 +넣으면, 필드 목록이 있는 400 `VALIDATION_FAILED`가 use case 안에서도 나온다. +백엔드에는 이것을 막는 검사가 없다. ## 7. Cursor pagination과 snapshot +짝 백엔드 템플릿의 페이지 목록은 이 절의 cursor가 아니라 offset이다(`PageParams`, +`meta.page`, 4.1절). 프론트는 그 `meta.page`를 읽어 기능에 넘길 뿐이고, 아래 +`CursorPage` 계약은 cursor를 고른 백엔드를 위한 것이다. 백엔드가 cursor로 바꾸면 +이 절로 합친다. + Backend가 pagination을 선택할 때 새 response schema/operation version으로 다음 contract를 제공한다. @@ -600,12 +657,12 @@ query invalidate hint로만 쓸지 operation별 reducer contract가 필요하다 같은 이름의 정책이라도 전송마다 동작이 다르다. operation을 다른 전송으로 옮기면 이 표로 동작 변화를 확인한다. -| 규칙 | V3 contract executor (기본 경로) | V2 client (기본 조합에 없음) | Browser RPC | -|---|---|---|---| -| KEYED 명령 자동 재시도 | 전송 전 실패만 재시도한다. 전송 뒤 실패는 재시도하지 않고 `MAYBE_APPLIED`다. 응답(5xx·429)으로는 재시도하지 않는다 (`src/adapters/http/http-retry-lifecycle.ts` `canRetryTransport`, `isRetryableSemantics`) | 네트워크·타임아웃·429·408/425/502/503/504 뒤 같은 키로 다시 보낸다. 전송 여부를 보지 않는다 (`src/adapters/http/retry-policy.ts` `shouldRetry`) | `KEYED_COMMAND`는 유효한 키가 있고 profile `retryOwner`가 `FRONTEND_ADAPTER`면 `retryableFailures`에서 같은 키로 다시 보낸다 (`src/adapters/browser-rpc/browser-rpc-runtime.ts` `shouldRetry`) | -| 재시도 횟수 상한 | min(계약 `retryBudget`, `MAX_RETRY_ATTEMPTS`, 2) (`http-execution-v3.ts` `retryCeiling`) | `MAX_RETRY_ATTEMPTS`, 기본 2 (`client.ts` `maxRetryAttempts`) | profile `maxAttempts`(시도 횟수), 하드 상한 4 (`src/contracts/browser-rpc.ts` `BROWSER_RPC_HARD_LIMITS`) | -| `Retry-After` | 5초를 넘으면 재시도하지 않는다. 이하면 hint에 jitter를 더해 기다린다 (`http-retry-lifecycle.ts` `retryDelayFor`) | 30초를 넘으면 재시도하지 않는다. 이하면 max(backoff, hint)만큼 기다린다 (`retry-policy.ts`) | profile `maxRetryAfterMs`로 잘라 max(backoff, hint)만큼 기다린다. 하드 상한 60초 (`browser-rpc-runtime.ts` `retryDelay`) | -| `REQUEST_TIMEOUT_MS` | 상한이다. 계약 `totalDeadlineMs`를 줄이기만 한다 (`runtime-adapters.ts` `requestDeadlineCeilingMs`) | 기본값이다. operation `timeoutMs`가 있으면 그 값을 쓰고, 더 길 수도 있다 (`client.ts` `defaultTimeoutMs`) | 쓰지 않는다. operation `totalDeadlineMs`만 쓴다. 하드 상한 30분 | +| 규칙 | V3 contract executor | Browser RPC | +|---|---|---| +| KEYED 명령 자동 재시도 | 전송 전 실패만 재시도한다. 전송 뒤 실패는 재시도하지 않고 `MAYBE_APPLIED`다. 응답으로는 재시도하지 않는다. 예외: Envelope operation이 503 `IDEMPOTENCY_UNAVAILABLE`(실행 전 거절, 백엔드 §2가 같은 키 재전송을 요구)을 받으면 `retryBudget` 안에서 같은 키로 다시 보낸다 (`src/adapters/http/http-retry-lifecycle.ts` `canRetryTransport`, `isRetryableSemantics`, `backend-envelope.ts` `invitesKeyedResend`) | `KEYED_COMMAND`는 유효한 키가 있고 profile `retryOwner`가 `FRONTEND_ADAPTER`면 `retryableFailures`에서 같은 키로 다시 보낸다 (`src/adapters/browser-rpc/browser-rpc-runtime.ts` `shouldRetry`) | +| 재시도 횟수 상한 | min(계약 `retryBudget`, `MAX_RETRY_ATTEMPTS`, 2) (`http-execution-v3.ts` `retryCeiling`) | profile `maxAttempts`(시도 횟수), 하드 상한 4 (`src/contracts/browser-rpc.ts` `BROWSER_RPC_HARD_LIMITS`) | +| `Retry-After` | 5초를 넘으면 재시도하지 않는다. 이하면 hint에 jitter를 더해 기다린다 (`http-retry-lifecycle.ts` `retryDelayFor`) | profile `maxRetryAfterMs`로 잘라 max(backoff, hint)만큼 기다린다. 하드 상한 60초 (`browser-rpc-runtime.ts` `retryDelay`) | +| `REQUEST_TIMEOUT_MS` | 상한이다. 계약 `totalDeadlineMs`를 줄이기만 한다 (`runtime-adapters.ts` `requestDeadlineCeilingMs`) | 쓰지 않는다. operation `totalDeadlineMs`만 쓴다. 하드 상한 30분 | 결과 불명 뒤 사용자 재전송은 전송과 무관하게 같은 intent·같은 키를 쓴다 (`src/presentation/adapters/query/application-query.ts` `resendUnknownEffect`). diff --git a/docs/architecture/browser-file-and-origin-storage.md b/docs/architecture/browser-file-and-origin-storage.md index abe95cd4..d9762ec6 100644 --- a/docs/architecture/browser-file-and-origin-storage.md +++ b/docs/architecture/browser-file-and-origin-storage.md @@ -351,25 +351,38 @@ digest 또는 별도 검토된 streaming hash adapter를 사용한다. - preview 대상 교체, load error, unmount에서 정확히 한 번 revoke한다. - one-shot 작은 download는 click handoff 뒤 cross-engine scheduling을 위해 기본 - 30초 grace를 두고 revoke한다. feature/runtime dispose는 grace를 기다리지 않고 + 30초 grace를 두고 revoke한다. runtime dispose는 grace를 기다리지 않고 모든 active lease를 즉시 revoke한다. - preview와 download는 runtime 하나의 lease registry를 같이 쓴다 (`src/adapters/browser-files/create-browser-file-runtime.ts:154`, `:163`). lease 개수나 합계 바이트 한도가 차면 둘 다 `LIMIT_EXCEEDED`를 `retryable: true`, `recovery: "RETRY"`로 반환한다 - (`src/adapters/browser-files/object-url-lease.ts:48-73`, `:131-139`). download - lease는 grace(`download-delivery-adapter.ts:149`)가 끝나면 풀리므로 잠시 뒤 + (`src/adapters/browser-files/object-url-lease.ts:48-71`, `:143-151`). download + lease는 grace(`download-delivery-adapter.ts:150`)가 끝나면 풀리므로 잠시 뒤 다시 시도하면 된다. Blob 하나가 단일 lease 상한을 넘으면 재시도 불가다. +- 한도는 같이 쓰지만 해제 권한은 나뉜다. `runtime.previews.dispose()`와 + download의 `dispose()`는 각자 만든 lease만 revoke한다(`ObjectUrlLeaseScope`). + registry 전체를 비우는 것은 `runtime.dispose()`뿐이다. `previews.dispose()` + 뒤에는 그 runtime의 preview가 계속 `UNAVAILABLE`이므로 route 정리에는 쓰지 + 않고 lease마다 `release()`한다. - URL을 global state, IndexedDB, query cache, log, analytics에 보관하지 않는다. - Service Worker에서 object URL을 사용하지 않는다. - 로그아웃·계정 전환에서는 runtime 전체를 dispose한다. browser file runtime은 세션을 모른다(`src/adapters/browser-files/create-browser-file-runtime.ts:93`). - `runtime.dispose()`(`:177-185`)가 이전 사용자가 고른 File 참조, preview lease, - 진행 중 download(`download-delivery-adapter.ts:385-391`)를 한 번에 닫는다. - runtime을 route·feature보다 오래 사는 곳에서 만들었다면 server-state scope - reset participant(`src/adapters/query-cache/server-state-scope-runtime.ts:19`, - 등록 예 `src/bootstrap/runtime-adapters.ts:410-416`)로 `dispose()`를 등록하고 - 다음 세대에서 새 runtime을 만든다. dispose한 runtime은 다시 쓸 수 없다. + `runtime.dispose()`(`:177-188`)가 이전 사용자가 고른 File 참조, preview lease, + 진행 중 download(`download-delivery-adapter.ts:390-396`)를 한 번에 닫는다. + runtime을 route·feature보다 오래 사는 곳(`product-composition.ts`의 + capability)에서 만들었다면 제품 소유 파일만 고친다. `composeProduct`가 + `scopeParticipants`로 `dispose()`를 돌려주면 템플릿이 로그아웃·계정 전환마다 + FENCED와 READY 사이에서 부르고, 실패하면 READY로 가지 않는다 + (`ProductScopeParticipant`, `src/bootstrap/product-composition-contract.ts`). + `composeProduct`는 부팅 때 한 번만 불리므로 기능에는 runtime 대신 getter를 + 주고 그 뒤에서 세대마다 새 runtime을 만든다. 예제는 + `recipes/frontend-capabilities/browser-file-session-capability.ts`이고 + `tests/recipes/browser-file-session-capability.test.ts`가 계정 전환 뒤 이전 + runtime의 읽기가 `UNAVAILABLE`, 진행 중 download가 `ABORTED`(handoff 0회), + 다음 세대의 파일 선택이 성공함을 확인한다(2026-11-03 02-01). dispose한 + runtime은 다시 쓸 수 없다. - SVG, HTML, untrusted PDF 같은 active content를 same-origin object URL iframe에 직접 preview하지 않는다. 별도 격리 origin 또는 안전한 decode/re-encode 결과, 아니면 attachment-only 정책을 사용한다. @@ -434,7 +447,10 @@ stream-to-file에서 integrity를 close 전에 확인해야 하면 writable을 `INTEGRITY_FAILED` 또는 partial-save failure를 반환한다. 전략, media type, safe extension, integrity mode와 최대 bytes는 composition -registry가 소유한다. caller는 composition이 등록한 정확한 +registry가 소유한다. registry는 사용자 파일명에서 지우는 위험 확장자 +(`.exe`, `.html`, `.js` 등)이거나 그것으로 끝나는 safe extension을 조립 때 +거절한다(2026-11-01 02-02). media type과 확장자가 서로 맞는지는 아직 보지 +않는다. caller는 composition이 등록한 정확한 `FilePolicyReference` 객체, 아래 source union의 최소 입력, filename과 limit reduction만 전달한다. `policyKey`/`intention`이 같은 새 객체나 raw 전략을 제출할 수 없다. source는 다음처럼 분리한다. @@ -971,6 +987,17 @@ preflight와 정확히 2 MiB(2,097,152 bytes) cap의 stream reader로 완전히 strict UTF-8와 runtime schema를 검증하며, cap을 넘으면 reader를 cancel하고 `CORRUPT_DATA`로 fail-closed한다. +active pointer의 rollback 목록 길이는 읽을 때 현재 +`retainedPreviousReleaseCount`와 비교하지 않는다. 더 큰 값으로 쓴 pointer도 +정상으로 읽고, 다음 activation이 목록을 현재 값으로 자른다. 읽을 수 없는 +pointer(`CORRUPT_DATA`: 손상, 또는 지금 정책으로 허용되지 않는 ID)는 조회와 +cleanup을 계속 막지만, 다음 `activateRelease`가 전체 재검증을 통과한 후보로 +rollback 목록 없이 덮어쓴다. pointer 읽기의 일시 오류는 activation을 멈춘다 +(0929/02-01). 그동안 `inspect()`는 멈추지 않고 `activePointer: "UNREADABLE"`과 +남은 후보 목록을 돌려준다. 운영자는 다음 activation이 무엇을 덮어쓰고 그 뒤 +cleanup이 무엇을 지울지 볼 수 있다. 일시 오류에서는 inspect도 실패한다 +(2026-11-03 02-05). + 현재 `cleanupOwned()`와 `inspect()`는 위 ownership/integrity 경계를 지키지만 cache count에 대한 cursor, per-invocation max count와 deadline은 제공하지 않는다. 따라서 cache 수에 비례한 unbounded maintenance를 production boot path에 diff --git a/docs/architecture/client-cache-and-storage.md b/docs/architecture/client-cache-and-storage.md index a71033be..8e7143d6 100644 --- a/docs/architecture/client-cache-and-storage.md +++ b/docs/architecture/client-cache-and-storage.md @@ -80,22 +80,26 @@ delivery/cleanup을 검증한다. 다만 production QueryClient/coordinator까 account transition, bfcache/StrictMode lifecycle E2E는 없고, 현재 보존 artifact도 Chromium/Firefox만 통과해 WebKit을 포함한 promotion evidence는 충족하지 않는다. localStorage fallback physical key는 storage registry의 -`CACHE_INVALIDATION_PULSE` 항목에서 온다(`src/contracts/storage-keys.ts:102`, +`CACHE_INVALIDATION_PULSE` 항목에서 온다(`src/contracts/storage-keys.ts:112`, `src/adapters/cross-context-invalidation/browser-cross-context-host.ts:36-37`). +값은 envelope 없는 wire JSON이라 이 항목은 `backend: "external"`이다. +registry는 이름만 갖고, StoragePort는 이 key를 거절한다(05-01). host facade는 native `StorageEvent.storageArea`를 캡처한 `localStorage` 객체와 동일성으로 비교하고(`browser-cross-context-host.ts:286-296`), core는 `EXPECTED_LOCAL_STORAGE`로 표시된 pulse만 받는다 (`browser-cross-context-invalidation.ts:197-201`). 현재 epoch는 release 하나다. `cacheEpoch`는 release ID의 64-bit FNV-1a digest를 -`release.<16자리 hex>`로 쓴 값이다(`browser-cross-context-host.ts:45-51`, 조립 -`src/bootstrap/runtime-adapters.ts:364-366`). 세션 identity가 바뀌면 scope +`release.<16자리 hex>`로 쓴 값이다(`browser-cross-context-host.ts` +`crossContextCacheEpochForRelease`, 조립은 `src/bootstrap/runtime-adapters.ts`의 +`createServerStateGenerationStore` 콜백). 세션 identity가 바뀌면 scope runtime이 다음 server-state generation을 열고 -(`src/adapters/query-cache/server-state-scope-runtime.ts:148`), generation마다 -새 `QueryClient`와 새 cross-context transport(새 `sourceId`·`sourceEpoch`)를 -만든다(`src/bootstrap/server-state-generation-store.ts:50-57`, -`runtime-adapters.ts:359-372`). 이전 generation의 transport는 coordinator -dispose에서 닫힌다(`src/adapters/query-cache/tanstack-cache-coordinator.ts:276-280`). +(`src/adapters/query-cache/server-state-scope-runtime.ts`의 +`activateNextGeneration` 호출), generation마다 새 `QueryClient`와 새 +cross-context transport(새 `sourceId`·`sourceEpoch`)를 만든다 +(`src/bootstrap/server-state-generation-store.ts:50-57`, 같은 콜백). 이전 +generation의 transport는 coordinator `dispose()`에서 닫힌다 +(`src/adapters/query-cache/tanstack-cache-coordinator.ts`). session/account epoch, opaque account partition과 durable namespace epoch는 아직 없다. wire event에 사용자·세션 scope가 없으므로 현재 cross-tab event는 같은 release의 등록 query topic을 빠르게 stale 처리하는 용도에 한정된다. @@ -464,6 +468,13 @@ normative key layout: non-finite number, DOM/native object를 fail-closed로 거절한다. - array 순서는 의미가 있으므로 유지한다. - query namespace는 arbitrary caller string이 아니라 registry reference다. + 현재 구현(03-01): `QueryDefinition.namespace`에 무효화 registry의 + `QueryNamespaceIdentity` 객체를 그대로 넘긴다(참조 기능이 이렇게 한다). + 예전 형태인 문자열 id와 `namespaceVersion` 쌍도 아직 받는다. 어느 등록 + topic도 닿지 않는 namespace로 bound query가 만들어지면 cache coordinator가 + namespace당 한 번 `cache.operation.failed`(`operation: + unregistered-query-namespace`) 진단을 남긴다. 저장으로 무효화할 일이 없는 + 정적 조회는 `invalidation: "NONE"`으로 선언해 이 진단에서 뺀다. - cross-tab event에는 전체 query key나 filter를 넣지 않는다. 현재 `src/contracts/query-keys.ts`의 `canonicalize()`는 object key order는 diff --git a/docs/architecture/contract-ownership.md b/docs/architecture/contract-ownership.md index fec11dee..270956b5 100644 --- a/docs/architecture/contract-ownership.md +++ b/docs/architecture/contract-ownership.md @@ -19,6 +19,9 @@ The placement rule is: - one feature owner -> keep it under that feature, - one reusable capability owner -> keep it under that adapter/capability and export it through the capability public entry point, +- a product-neutral primitive any layer may call, with no product vocabulary + in it (a budget, deadline, retry, execution context, telemetry pipeline step + or error envelope) -> `src/platform`, - multiple independent capability/layer owners -> `src/contracts`, - browser/build/release wire or artifact authority -> `src/contracts` even when the browser source graph alone looks small. @@ -26,6 +29,17 @@ The placement rule is: Consumer count alone is not sufficient. Scripts, generated artifacts and release gates are semantic consumers too. +`src/platform` and `src/contracts` differ in what they hold. `src/contracts` +holds the product's shared vocabulary: registries, schemas and wire formats +such as routes, API operations, storage keys and release artifacts. +`src/platform` holds mechanisms that work without that vocabulary, plus the +few error kinds no feature owns (network, deadline, cancellation, response +bounds). Today `src/contracts` imports `src/platform` and not the other way +round. `platform-kernel-is-product-neutral` stops `src/platform` from importing +any feature, context, app, adapter, bootstrap, presentation or application +module. A primitive that needs a route, an API operation or a feature's +vocabulary is not product-neutral: put it in `src/contracts` or with its owner. + ## Audit result The September 2026 architecture review triggered an import-graph audit of all diff --git a/docs/architecture/decisions/VD-06-intl-typed-message-catalog.md b/docs/architecture/decisions/VD-06-intl-typed-message-catalog.md index 2b994271..9268cff4 100644 --- a/docs/architecture/decisions/VD-06-intl-typed-message-catalog.md +++ b/docs/architecture/decisions/VD-06-intl-typed-message-catalog.md @@ -21,9 +21,11 @@ JavaScript에 분산돼 있었다. 날짜는 일부 application mapper에서 고 2. `MessageKey`는 한국어 canonical catalog에서 도출하며 영어와 RTL smoke catalog는 `satisfies Record`으로 compile-time parity를 강제한다. -3. 보간이 필요한 key는 `MessageParameters`에 key별 parameter object를 - 선언한다. 잘못된 key, 누락·초과 parameter는 TypeScript negative fixture가 - 거절한다. +3. 보간 parameter는 catalog 문자열의 `{이름}`에서 도출한다(0929/08-03). + 값 타입은 `string | number`다. 값 타입을 좁히고 싶은 key만 + `MessageParameters`에 key별 parameter object를 선언한다. 기능 catalog의 + key도 같은 규칙을 쓰므로 기능이 이 파일을 고치지 않는다. 잘못된 key, + 누락·초과 parameter는 TypeScript negative fixture가 거절한다. 4. 기본 locale은 `ko-KR`, fallback locale도 `ko-KR`이다. 알려지지 않은 locale은 language fallback 후 `ko-KR`로 정규화한다. 알려지지 않은 key와 누락 보간은 raw key나 외부 값을 출력하지 않고 안전한 공통 fallback을 반환한다. @@ -66,13 +68,22 @@ route/form/failure 의미 값 ## 검증 -- `check:i18n`은 catalog key와 placeholder parity, 화면 코드의 한국어 literal, - backend message JSX 렌더링과 raw HTML 사용을 검사한다. 검사 범위는 공통 UI - 디렉터리, `src/presentation/pages`, 모든 `src/features/*/presentation`이다. - 컴포넌트 갤러리 `src/presentation/examples`는 일부러 뺐다 - (`scripts/check-i18n.ts`의 `commonDirectories`, `featurePresentationDirectories`). -- `check:i18n:fixture`는 같은 탐색 규칙을 `tests/fixtures/i18n/forbidden` 트리에 - 돌린다. fixture 파일 하나라도 거절되지 않으면 종료 코드 2로 실패한다. +- `check:i18n`은 catalog key와 placeholder parity, backend message JSX 렌더링을 + 검사한다. 검사 범위는 공통 UI 디렉터리, `src/presentation/pages`, 모든 + `src/features/*/presentation`이다. 플랫폼 구성 화면 + `src/presentation/examples`와 예제 화면 + `src/features/platform-examples-feature/presentation`(1103/09-04)은 화면 + 문구 ESLint 규칙에서 일부러 뺐다(`eslint.config.ts`). +- 화면 문구가 catalog에서 오는지는 ESLint `no-restricted-syntax`가 본다 + (`eslint.config.ts`의 `screenTextSelectors`, 0929/08-02). 대상은 글자가 든 + `JSXText`와 표시·접근성 속성(`aria-label`, `title`, `placeholder`, `alt`, + `label` 등)의 문자열 literal이다. 주석은 AST에 없어 걸리지 않는다. 범위는 위와 + 같고 stories는 뺐다. 제품은 이 선택자를 자기 설정으로 덮어쓸 수 있다. + raw HTML은 FE-OC-019 ESLint 규칙이 거절한다. +- `check:i18n:fixture`는 같은 탐색 규칙과 위 ESLint 규칙을 + `tests/fixtures/i18n/forbidden` 트리에 돌린다. fixture 파일 하나라도 거절되지 + 않으면 종료 코드 2로 실패한다. `tests/fixtures/i18n/allowed` 트리(한국어 주석, + 구두점, catalog 문구)가 거절돼도 종료 코드 2로 실패한다. - `tests/unit/i18n-contract.test.ts`는 `ERROR_REGISTRY`의 모든 `userMessageKey`가 ko-KR·en-US catalog에 있는지 확인한다. - type negative fixture는 unknown key와 잘못된 parameter shape를 거절한다. diff --git a/docs/architecture/decisions/VD-07-diagnostics-and-telemetry-exporter.md b/docs/architecture/decisions/VD-07-diagnostics-and-telemetry-exporter.md index 524a55bb..8b09f220 100644 --- a/docs/architecture/decisions/VD-07-diagnostics-and-telemetry-exporter.md +++ b/docs/architecture/decisions/VD-07-diagnostics-and-telemetry-exporter.md @@ -43,13 +43,27 @@ vendor 결정 전에는 안전한 기본값이 아니다. `createHttpObservationProjector`가 유일한 projection authority다. observation은 arbitrary context map이 아니며 projector는 `route_id`, `operation_id`, `operation`, `outcome`, `error_kind`, `http_status_group`, - `attempt_count_bucket`, `duration_bucket`만 사용한다. diagnostics에만 + `attempt_count_bucket`, `duration_bucket`, `effect_certainty`만 사용한다. + `effect_certainty`는 V3 `HttpEffectCertainty` 다섯 값(`NOT_APPLICABLE`, + `NOT_STARTED`, `NOT_APPLIED`, `APPLIED_CONFIRMED`, `MAYBE_APPLIED`)만 받는 닫힌 + value policy(`isEffectCertainty`)를 두 sink가 함께 쓴다. 결과 불명 쓰기의 수를 + 세기 위해서다(1103/03-05). diagnostics에만 `correlation_id`(서버가 돌려준 `x-correlation-id`, 없으면 실행이 보낸 요청 ID)를 - 더한다. telemetry에는 넣지 않는다(03-03, `createHttpObservationProjector`). raw attempt count, + 더한다. telemetry에는 넣지 않는다(03-03, `createHttpObservationProjector`). + 실행이 observation의 `diagnosticReason`(닫힌 집합 `HttpDiagnosticReason`)을 + 남기면 diagnostics에만 `reason`으로 더한다. 값은 넷 중 하나다. 기능 패키지의 + `classifyProblem`이 throw하거나 집합 밖 값을 돌려줘 효과를 `MAYBE_APPLIED`로 + 떨어뜨린 `CLASSIFIER_FAILED`(03-05), 전송 전에 거절한 요청의 원인 + `HttpRequestRejectionReason`(입력 검증 실패, 요청 조립 실패, 최종 불변식 실패, + 미설치 계약 `CONTRACT_NOT_INSTALLED`, 03-02), Envelope 백엔드가 멱등 키를 + 거절한 `IdempotencyRefusalReason`, 그리고 Envelope 명령의 결과를 모르게 된 + 원인 `UnknownEffectReason`(`IN_FLIGHT`, `IDEMPOTENCY_UNAVAILABLE`, + `COMPLETION_UNKNOWN`, `RECOVERY_REQUIRED`, `SERVER_TIMEOUT`, `STAGE_UNKNOWN`, + 1103/03-05)이다. 백엔드 `error.code` 원문은 싣지 않는다. 미설치 계약은 실행기를 + 거치지 않으므로 조립 지점이 같은 projector로 관측 1건을 직접 남긴다. + raw attempt count, duration, status, URL, intent, key, input identity와 내부 `terminalReason`은 - sink로 나가지 않는다. effect certainty가 운영상 필요해지면 `effect_certainty` - key와 닫힌 value policy를 contract·fixture·이 ADR에 동시에 추가한 뒤에만 - 전달한다. + sink로 나가지 않는다. 5-2. caller cancellation과 scope fence는 API failure가 아니다. diagnostics는 한 번 남기고 `api.request.failed`는 발행하지 않는다. 자격증명이 없어 한 번도 보내지 않은 `UNAUTHENTICATED`(응답 status 없음)도 같다(03-07, diff --git a/docs/architecture/decisions/VD-23-api-transport-selection-and-rest-execution.md b/docs/architecture/decisions/VD-23-api-transport-selection-and-rest-execution.md index f9c7fd60..d24ca9a7 100644 --- a/docs/architecture/decisions/VD-23-api-transport-selection-and-rest-execution.md +++ b/docs/architecture/decisions/VD-23-api-transport-selection-and-rest-execution.md @@ -1,9 +1,17 @@ # VD-23: API transport selection과 REST execution -- 상태: Accepted — REST v2 security/execution baseline composed, advanced profiles pending +> **정본 안내 (non-authoritative for runtime capability decisions)** +> +> Runtime Config/boot, Fetch HTTP client, Router, Query/Mutation, realtime 공통 경계, Web Worker, +> Service Worker, offline command와 Background Sync의 구현 결정은 +> [프론트엔드 런타임 Capability 저장소 정합형 구현 결정 폐쇄 상세 설계](../2026-07-30-frontend-runtime-capability-repository-aligned-implementation-closed-deep-design.md)가 정본이다. +> 본 결정의 해당 서술이 정본과 충돌하면 정본을 따른다. + +- 상태: Accepted — REST v2 실행 경로는 2026-11-03에 지웠다(`048f490`·`12f3bb7`). 지금 REST 실행은 V3 contract executor다. advanced profiles pending - 결정일: 2026-07-28 - installed REST reference vertical: `COMPOSED` -- REST v2 security/execution baseline: `COMPOSED` +- REST v2 security/execution baseline: `REMOVED` (2026-11-03, `048f490`·`12f3bb7`) +- V3 contract executor(descriptor → FE-REG-API 행 투영, 짝 백엔드 Envelope 판정): `COMPOSED` - provider/path/auth profile baseline: `COMPOSED` - conditional execution/provider-conformance delta: `DESIGNED_NOT_IMPLEMENTED` - GraphQL/Connect/gRPC-Web/REST Gateway product selection: `NOT_SELECTED` @@ -23,8 +31,9 @@ TanStack Query까지 실제 production composition에 연결된다. 따라서 RE 현재 reference operation은 v2 metadata, collision-aware composition, allowlisted credential patch, auth fail-before-fetch, prefix-preserving target, shared logical deadline, exact JSON media/success status, bounded decoder와 typed mapping failure를 -실행한다. correlation header, success status group과 401 replay를 포함한 physical -attempt도 terminal observation에 연결한다. +실행한다. correlation header와 success status group을 포함한 physical attempt도 +terminal observation에 연결한다. 401은 끝이다. 숨은 refresh-and-replay는 하지 않는다 +(정본 8.4, FRT-D016). 이 절의 "v2 metadata" 서술은 2026-11-03 V2 삭제 전의 기록이다. operation은 path placeholder↔codec key exact join, named provider/bearer/CSRF profile, provider credential-mode ceiling과 encoded query byte ceiling도 실행한다. @@ -61,6 +70,10 @@ feature use case ### 2. REST operation은 실행 source와 정적 manifest를 분리하지 않는다 +> 2026-11-03: 아래 `defineRestOperation`(V2 행)은 지웠다(`12f3bb7`). 지금 operation은 +> contract contribution의 V3 descriptor 하나로 적고, FE-REG-API 행은 그 descriptor에서 +> 뽑는다(`src/contracts/api-operations.ts`). + 목표 API는 feature가 generic이 연결된 definition을 만든다. ```text @@ -303,7 +316,7 @@ allowed/required credential header 집합을 독립적으로 재검증한다. `AUTH_MODE=demo`는 profile을 약화시키지 않는다. `createDemoSessionAdapter`가 고정된 비밀 아닌 `DEMO_AUTHORIZATION_MARKER` proof header를 제공하여 strict -`REFERENCE_EXTERNAL_BEARER`를 그대로 만족시킨다. 진짜 anonymous backend는 별도 +`EXTERNAL_BEARER`(16-03 전 이름 `REFERENCE_EXTERNAL_BEARER`)를 그대로 만족시킨다. 진짜 anonymous backend는 별도 anonymous contract/profile을 composition에서 선택해야 한다. credential collaborator는 `AuthOperationContext { signal, deadlineAtMonotonicMs }`를 @@ -419,9 +432,10 @@ network failure - schema, mapper, 4xx validation/authz/conflict와 redirect failure는 retry하지 않는다. - caller cancel, navigation supersede, runtime teardown, attempt timeout과 logical deadline을 다른 safe failure로 유지한다. -- 401 recovery는 auth-required이면서 replay-safe한 operation만 한 번 수행한다. -- 동시 401은 session owner의 single-flight recovery를 공유한다. -- physical attempt, logical retry와 auth replay를 따로 관측한다. +- 401 response 뒤 숨은 refresh-and-replay를 하지 않는다. command를 새 credential로 + 자동 replay하지 않는다(정본 8.4, FRT-D016). 자격 증명 owner가 보내기 전에 + credential을 준비하고, 401은 그 요청의 끝이다. +- physical attempt와 logical retry를 따로 관측한다. ### 9. Closed execution diff --git a/docs/architecture/decisions/VD-24-runtime-schema-and-boundary-mapper.md b/docs/architecture/decisions/VD-24-runtime-schema-and-boundary-mapper.md index 39c6f3d4..b32324e7 100644 --- a/docs/architecture/decisions/VD-24-runtime-schema-and-boundary-mapper.md +++ b/docs/architecture/decisions/VD-24-runtime-schema-and-boundary-mapper.md @@ -1,6 +1,6 @@ # VD-24: Runtime Schema와 boundary Mapper -- 상태: Accepted — reference typed codec/mapper baseline composed, artifact governance pending +- 상태: Accepted — reference typed codec/mapper baseline은 2026-11-03에 지웠다(`12f3bb7`, `MAPPER_REGISTRY`·`RUNTIME_SCHEMA_CODECS` 삭제). 지금 schema는 V3 descriptor 검증기와 FE-REG-SCHEMA 행, mapping은 descriptor의 `mapSuccess`다. artifact governance pending - 결정일: 2026-07-28 - reference REST Schema/Mapper vertical: `COMPOSED` - semantic compatibility/codegen governance delta: diff --git a/docs/architecture/decisions/VD-28-realtime-events-web-push-and-bounded-polling.md b/docs/architecture/decisions/VD-28-realtime-events-web-push-and-bounded-polling.md index 24f76268..402365a4 100644 --- a/docs/architecture/decisions/VD-28-realtime-events-web-push-and-bounded-polling.md +++ b/docs/architecture/decisions/VD-28-realtime-events-web-push-and-bounded-polling.md @@ -18,14 +18,16 @@ (`UNKNOWN/CURRENT/STALE/RESYNCING`)와 별개다. - effect/recovery deadline에 도달하면 commit capability를 즉시 영구 무효화하고 - abort한다. caller에는 bounded `IDLE_TIMEOUT`(non-retryable, operation - `APPLY`/`RECOVER`)을 반환하되 **실제 task는 버리지 않고 retain**한다. + abort한다. caller에는 bounded non-retryable failure를 반환하되 **실제 task는 + 버리지 않고 retain**한다. effect 마감은 `APPLY_FAILED/APPLY`, recovery 마감은 + `PROVIDER_UNAVAILABLE/RECOVER`다(13.1). transport idle(`IDLE_TIMEOUT`)과 + 관측에서 구분하기 위해서다. - retain된 task가 하나라도 있으면 stream은 `DRAINING`이고 새 event/recovery admission을 거절한다. 실제 settlement가 일어나야 `STALE`로 돌아가 authoritative recovery를 요구하거나, close 요청이면 `CLOSED`가 된다. - `close()`는 `Promise>`다. 모든 retain task가 실제로 - settle해야 success이고, drain bound를 넘기면 `IDLE_TIMEOUT/CLOSE`를 반환하며 - stream은 계속 `DRAINING`이다. teardown success가 곧 quiescence다. + settle해야 success이고, drain bound를 넘기면 `PROVIDER_UNAVAILABLE/CLOSE`를 + 반환하며 stream은 계속 `DRAINING`이다. teardown success가 곧 quiescence다. - LIVE↔POLL overflow fail-close는 active/probe/quiescing/transition lease를 모두 abort한 뒤 **retired writer set**으로 옮기고 나서 reference를 지운다. `close()`는 current와 retired를 dedupe해 함께 기다리므로, 버려진 @@ -461,7 +463,7 @@ push hint와 worker deadline을 제한한다. 제품 config는 더 작게만 설 2026-07-28 reference-runtime amendment로, RT-01~RT-04 source 전체를 tree-shaking 없이 합성하는 optional-recipe gzip 예산을 40,000 bytes로 -고정한다(2026-09-27 성숙도 리뷰 반영으로 40,900 bytes로 올림. 근거는 `config/recipes/frontend-capability-recipes.json` 변경 커밋). 이는 production bundle 허용량이 아니며 미선택 production asset의 +고정한다(지금 값과 정하는 규칙은 `docs/architecture/optional-adapter-recipes.md`의 "Reference runtime bundle budget" 절). 이는 production bundle 허용량이 아니며 미선택 production asset의 realtime module 허용량은 계속 0이다. SSE replay-open과 WebSocket `SUBSCRIBED`가 exact recovery checkpoint를 증명하고 common barrier가 확인될 때까지 event admission을 막는 readiness gate는 attempt당 최대 30초다. diff --git a/docs/architecture/frontend-application-foundation.md b/docs/architecture/frontend-application-foundation.md index d820018e..b1fae3da 100644 --- a/docs/architecture/frontend-application-foundation.md +++ b/docs/architecture/frontend-application-foundation.md @@ -15,16 +15,29 @@ do not have to understand that internal sophistication. ## Hybrid architecture +`src/` has nine top-level folders. The descriptions match the table in +[the layer contract](./layers.md), which also names every import rule. + Platform code is horizontal: -- `application`: generic application inputs/policies/ports -- `contracts`: genuinely cross-capability shared vocabulary and registries -- `adapters`: reusable capability runtimes -- `presentation`: generic UI/routing/query integration -- `bootstrap`: concrete composition +- `src/bootstrap` — the composition root: runtime configuration, concrete adapter construction and the React mount +- `src/presentation` — generic UI and the inbound adapter: routes, layouts, the design system, pages and providers +- `src/adapters` — reusable capability runtimes that implement application ports: HTTP, auth, storage, query cache, telemetry, workers and more +- `src/application` — generic use cases, ports, policies and view-models +- `src/contracts` — shared vocabulary and registries read by several layers, the workers and the build and release scripts +- `src/platform` — product-neutral primitives any folder may use: budgets, execution context, resilience, the telemetry pipeline, error envelopes and release coherence + +Ownership declarations group features into deployable units: + +- `src/apps` — deployable apps: each `app-module.ts` declares an app and its context budget; `template-app.ts` is the app this build produces +- `src/contexts` — bounded contexts: each `context-module.ts` declares its app, route root and feature budget Product business code is vertical: +- `src/features` — removable vertical slices (`src/features//{domain,application,contracts,adapters,presentation}`) and the installed-feature catalogs (`src/features/*.ts`) + +Inside one feature: + - `features//domain` - `features//application` - `features//contracts` @@ -98,9 +111,19 @@ A feature owns its contract, runtime and adapter contributions. Central installed catalogs are aggregation points only: - `installed-product-manifest.ts`: which product features are compiled/selected -- `installed-feature-contracts.ts`: contract aggregation -- `installed-feature-runtimes.tsx`: runtime contribution aggregation -- `installed-feature-adapters.ts`: application-input contribution aggregation +- `installed-feature-contracts.ts`: boot-time contract aggregation (routes, + route runtime contracts, invalidation) from the feature declarations +- `installed-feature-adapters.ts`: application-input loaders, one per active + feature, run when the router enters the feature's routes (15-01) +- `installed-contract-contributions.ts`: declared contract packages and the + registry the HTTP executor resolves against, filled as features load +- `installed-feature-runtime-registries.ts`: loads every runtime half and + composes the contract contributions, the FE-REG-API rows projected from + them and the FE-REG-SCHEMA registry; the platform overview page calls it + after it draws its title (1103/15-01), the boot never does +- `loaded-feature-runtimes.ts`: the same registries as module constants (top- + level await) for Node scripts, tests and registry governance; nothing under + `src` may import it (`boot-does-not-load-every-feature-runtime`) Feature-specific composition belongs under the feature itself. Central catalogs must not grow feature-specific branching logic. @@ -144,10 +167,31 @@ runtime (`productionComposition: false` in `recipes/frontend-capabilities/indexeddb-feature-capability.ts` (`createLocalDraftIndexedDbCapability`, exercised by `tests/recipes/indexeddb-feature-capability.test.ts`). A product that installs a -feature with `needs: ["indexedDb"]` copies it and adds `indexedDb` to the feature -capabilities in `src/bootstrap/runtime-adapters.ts`. Until it does, that object -fails the app typecheck, and `composeFeatureAdapterInputs()` rejects the -composition with `feature needs indexedDb, which the host did not provide`. +feature with `needs: ["indexedDb"]` copies it and returns `indexedDb` from the +product-owned `src/bootstrap/product-composition.ts`. Until it does, the feature +capabilities in `src/bootstrap/runtime-adapters.ts` fail the app typecheck, and +`composeFeatureAdapterInputs()` rejects the composition with +`feature needs indexedDb, which the host did not provide`. + +The same file is where a product adds any other capability and the +credential provider for a product auth profile. The capability's type goes in +the product-owned `src/features/product-capabilities.ts` +(`ProductFeaturePlatformCapabilities`, which `FeaturePlatformCapabilities` +extends), so every typecheck program that sees a feature sees it +(`tests/unit/product-extension-typecheck.test.ts`). The composition root keeps the order: scope fence, `ANONYMOUS` +profile, product provider, session, scope fence again +(`tests/unit/runtime-adapters-credential-order.test.ts`). A product that owns +the session itself (a BFF whose session is an httpOnly cookie) returns its +session owner from `composeProductSessionOwner` in the same file. It is asked +first, before `http` exists, only when `AUTH_MODE` is `external`, and it comes +before the host's `__CA_FRONTEND_AUTH_OWNER__`; `null` leaves the session to +that global. Its context (`src/bootstrap/product-session-owner-context.ts`) +carries a `fetch` with one deadline over the whole exchange, the page for a +sign-in redirect, the page's session storage for that redirect only, and +`readCookie`. Product auth profiles, runtime-config keys and the keys' +FE-REG-ENV rows go in `src/contracts/product-contracts.ts`; each joins the +template's registry under the same checks +(`tests/unit/product-composition-fixture.test.ts`). ## Presentation consumer surface diff --git a/docs/architecture/frontend-platform-capability-review.md b/docs/architecture/frontend-platform-capability-review.md index 12281e55..eaf21b76 100644 --- a/docs/architecture/frontend-platform-capability-review.md +++ b/docs/architecture/frontend-platform-capability-review.md @@ -88,7 +88,7 @@ P0/P1 acceptance와 P2 recipe 기본값은 `LOCAL_TEMPLATE_READY`다. 다만 실 | logging/diagnostics | 준비됨 | 별도 `DiagnosticsPort`, 8-event registry, allowlist, bounded/no-op adapter와 production producer | 실제 프로젝트의 remote sink는 port 뒤에서 선택 | | telemetry | 준비됨/프로젝트 선택 | 5-event registry, bounded queue, redaction/value policy, boot·HTTP·render·release·drop producer | analytics/RUM/error vendor와 consent는 프로젝트에서 선택 | | 비동기 상태 불변식 | 준비됨 | 배타적 typed overlay, stale latch, 실제 retry/conflict action | reference 화면에서 전체 상태 전시 | -| 단위·통합·E2E | 준비됨 | source/test strict typecheck, shared MSW 19개 scenario, 실제 bootstrap, built-dist 3엔진·compact E2E | 제품별 critical flow를 같은 catalog/gate에 추가 | +| 단위·통합·E2E | 준비됨 | source/test strict typecheck, shared MSW 20개 scenario, 실제 bootstrap, built-dist 3엔진·compact E2E | 제품별 critical flow를 같은 catalog/gate에 추가 | | UI 회귀 검증 | 준비됨 | dev-only Storybook interaction/axe와 pinned Chromium visual baseline 4종 | cloud review와 다중 OS/device는 프로젝트 선택 | | 샘플 제거 | 준비됨 | feature/catalog/test 제거 후 type/architecture/registry/test/home/build 9단계 검증 | 새 contribution도 같은 제거 gate에 포함 | | registry·compatibility 집행 | 준비됨 | 10개 registry type/reference/consumer/orphan, 승인 digest와 actual semantic diff, breaking evidence | public 계약 변경 시 baseline review 유지 | @@ -434,9 +434,9 @@ bootstrap → React TSX → tests 순서로 이동한다. ### retry, API client, logger, token manager, error, validation은 어디에 있는가 -- retry: `src/adapters/http/retry-policy.ts`, runtime max-attempt/cleanup 계약까지 구현 -- API client: `src/adapters/http/client.ts`, path/search/body projection과 - runtime schema/mapper를 사용하며 feature gateway 뒤에서 실행 +- retry: `src/adapters/http/http-retry-lifecycle.ts`, runtime max-attempt/cleanup 계약까지 구현 +- API client: `src/adapters/http/http-execution-v3.ts`, 설치된 계약의 path/search/body + projection과 검증기를 쓰며 feature binding(`feature-http-binding.ts`) 뒤에서 실행 - logger: `DiagnosticsPort`로 telemetry와 분리해 구현. closed event/level, allowlist와 bounded/no-op adapter 제공 - token manager: 의도적으로 없음. opaque external auth owner가 credential을 소유 diff --git a/docs/architecture/frontend-platform-implementation-roadmap.md b/docs/architecture/frontend-platform-implementation-roadmap.md index 1049d05a..da4d17ac 100644 --- a/docs/architecture/frontend-platform-implementation-roadmap.md +++ b/docs/architecture/frontend-platform-implementation-roadmap.md @@ -852,7 +852,7 @@ owner와 만료 시한이 있는 quarantine만 허용한다. `behavior-change`, 제거/type/path/contract 변경은 `breaking`으로 계산한다. breaking에는 version, migration, compatibility window, rollback과 owner를 요구하며 digest 변조와 누락 fixture가 실제로 실패한다. -- API operation별 19개 shared MSW scenario catalog와 strict unhandled-request +- API operation별 20개 shared MSW scenario catalog와 strict unhandled-request server를 제공하고 reference vertical integration이 공통 envelope/handler를 사용한다. - 기본 Playwright는 `build` + `preview`의 실제 `dist`를 Chromium, Firefox, diff --git a/docs/architecture/layers.md b/docs/architecture/layers.md index 007b3bc2..a57351d8 100644 --- a/docs/architecture/layers.md +++ b/docs/architecture/layers.md @@ -1,55 +1,105 @@ # Clean Architecture layer contract -The import direction is `domain <- application <- presentation`; concrete -adapters implement application-owned ports and are assembled only in -`src/bootstrap`. +Dependencies point inward: `presentation -> application -> contracts -> +platform`. Concrete adapters implement application-owned ports and are +assembled only in `src/bootstrap`. -| Layer | Owns | May depend on | +## Top-level folders + +`src/` has these nine folders and no others: + +| Folder | Owns | +| --- | --- | +| `src/bootstrap` | the composition root: runtime configuration, concrete adapter construction and the React mount | +| `src/apps` | deployable apps: each `app-module.ts` declares an app and its context budget; `template-app.ts` is the app this build produces | +| `src/contexts` | bounded contexts: each `context-module.ts` declares its app, route root and feature budget | +| `src/features` | removable vertical slices (`src/features//{domain,application,contracts,adapters,presentation}`) and the installed-feature catalogs (`src/features/*.ts`) | +| `src/presentation` | generic UI and the inbound adapter: routes, layouts, the design system, pages and providers | +| `src/adapters` | reusable capability runtimes that implement application ports: HTTP, auth, storage, query cache, telemetry, workers and more | +| `src/application` | generic use cases, ports, policies and view-models | +| `src/contracts` | shared vocabulary and registries read by several layers, the workers and the build and release scripts | +| `src/platform` | product-neutral primitives any folder may use: budgets, execution context, resilience, the telemetry pipeline, error envelopes and release coherence | + +Domain code lives inside a feature (`src/features//domain`). There is no +top-level domain folder. If a project adds one, `domain-is-framework-neutral` +and `concrete-adapters-compose-only-in-bootstrap` already cover it. + +`src/adapters/platform` is the adapter kernel (below). It is not +`src/platform`. + +Where a shared type or primitive goes is decided in +[contract ownership](./contract-ownership.md). + +## Rules + +Each row is one `forbidden` rule in `.dependency-cruiser.json`, by its `name`. +"Forbids" lists what code under "Applies to" must not import. + +| Rule | Applies to | Forbids | | --- | --- | --- | -| `domain` | framework-neutral models and pure policies | domain siblings | -| `application` | use cases, ports, orchestration, view-models | domain and application siblings | -| `presentation` | routes, components, user interaction and view state | application public API and shared UI | -| `adapters` | browser and third-party implementations of application ports | application ports and limited domain values | -| `features/` | removable vertical domain/application/contracts/adapters/presentation slice | the same inward rule plus platform public boundaries | -| `bootstrap` | runtime configuration, adapter construction and React mount | all selected runtime modules | +| `domain-is-framework-neutral` | a top-level domain folder (none today) | application, presentation, adapters, bootstrap, React, TanStack | +| `application-does-not-know-concrete-runtime` | `src/application` | presentation, adapters, bootstrap, React, TanStack | +| `presentation-does-not-know-adapters` | `src/presentation`, except `adapters/query` | adapters, bootstrap, TanStack | +| `page-templates-own-layout-only` | `src/presentation/templates` | application, adapters, bootstrap, the presentation query adapter, TanStack. Templates take data and actions as props | +| `icon-vendor-is-facade-only` | all of `src`, except the lucide vendor facade | `lucide-react` | +| `zod-is-reached-through-contracts-zod` | all of `src`, except `src/contracts/zod.ts` | `zod` and its subpaths (`zod/v4`) | +| `design-system-is-reached-through-its-index` | code outside the design system and its named facades | design-system files other than its `index.ts` | +| `adapters-do-not-know-presentation` | `src/adapters` | presentation, bootstrap | +| `feature-domain-is-framework-neutral` | `src/features//domain` | application, presentation, adapters, bootstrap, any feature's application, adapters and presentation, React, TanStack | +| `feature-application-does-not-know-runtime` | `src/features//application` | presentation, adapters, bootstrap, any feature's adapters and presentation, React, TanStack | +| `feature-presentation-does-not-know-outbound-adapters` | `src/features//presentation` | adapters, bootstrap, any feature's adapters, TanStack | +| `feature-adapters-do-not-know-presentation` | `src/features//adapters` | presentation, bootstrap, any feature's presentation | +| `concrete-adapters-compose-only-in-bootstrap` | `src/application`, `src/presentation`, `src/contracts` | `src/adapters` | +| `external-contract-package-single-import-path` | all of `src`, except `src/features//contracts/*-contract-contribution.ts` | the generated `@org-contracts/*` service packages | +| `presentation-does-not-fetch-directly` | generic and feature presentation | the HTTP, realtime, service-worker, web-worker and storage adapters | +| `unselected-realtime-runtime-is-not-composed` | `src/bootstrap`, `src/features/installed-feature-*` | the realtime and Web Push adapters, which the template does not select | +| `generic-worker-has-no-network-or-credentials` | `src/adapters/web-worker` | the HTTP, realtime, auth and Web Push adapters | +| `service-worker-entry-is-not-page-code` | `src/adapters/service-worker` | presentation, bootstrap, React, TanStack | +| `contracts-do-not-know-application` | `src/contracts` | application, features. Contracts is the lower package and owns the vocabulary both read | +| `contracts-do-not-know-presentation-or-bootstrap` | `src/contracts` | presentation, bootstrap | +| `generic-presentation-does-not-compose-the-product` | `src/presentation`, except the files the rule lists | the installed-feature registries. Which features exist is a product decision owned by `src/bootstrap` | +| `boot-does-not-load-every-feature-runtime` | all of `src`, except the module itself | `src/features/loaded-feature-runtimes.ts` | +| `adapters-do-not-know-other-concrete-adapters` | each adapter group | another adapter group, except the adapter kernel | +| `adapter-groups-are-reached-through-their-barrel` | code outside `src/adapters` | adapter files other than a group's `index.ts` and the `storage/indexeddb` and `storage/opfs` sub-barrels | +| `features-do-not-import-other-features` | each feature | another feature | +| `contexts-do-not-import-other-contexts` | each context | another context | +| `feature-and-app-roots-do-not-reach-adapters` | `src/features/*.ts`, `src/features//*.ts`, `src/contexts`, `src/apps`, except the type-only `src/features/feature-adapter-contribution.ts` | `src/adapters` | +| `presentation-does-not-import-apps-or-contexts` | generic and feature presentation, except `src/presentation/routes/app-router.tsx`, which mounts the app's route tree | `src/apps`, `src/contexts` | +| `observability-vendors-live-behind-adapters` | code outside `src/adapters` | vendor telemetry SDKs | +| `platform-kernel-is-product-neutral` | `src/platform`, except `routing/`, which reads app descriptors by type | features, contexts, apps, adapters, bootstrap, presentation, application | +| `no-circular-dependencies` | all of `src` | import cycles | -The following edges are forbidden: - -- domain to application, presentation, adapters, bootstrap, React, or browser globals -- application to presentation, concrete adapters, bootstrap, React, or browser globals -- `contracts` to application or features: contracts is the lower package and - owns the shared vocabulary both of them read -- presentation to concrete adapters, raw DTO schemas, or storage implementations -- generic presentation to the installed-feature registries: which features exist - is a product decision owned by `bootstrap` -- an adapter to presentation, bootstrap internals, or another concrete adapter -- feature domain/application to its presentation or outbound adapter, and - feature presentation to its outbound adapter -- a module presentation may import to a concrete adapter: files outside a - feature's layer folders (`src/features/*.ts`, `src/features//*.ts`), - `src/contexts` and `src/apps` (`feature-and-app-roots-do-not-reach-adapters`). - The graph checks one edge at a time, so a re-export there would carry an - adapter into presentation with every other rule passing. The one exception is - the type-only `src/features/feature-adapter-contribution.ts` -- presentation to `src/apps` or `src/contexts`, except - `src/presentation/routes/app-router.tsx`, which mounts the app's route tree - (`presentation-does-not-import-apps-or-contexts`) +`feature-and-app-roots-do-not-reach-adapters` exists because the graph checks +one edge at a time. Presentation may import those files, so a re-export of an +adapter there would carry the adapter into presentation with every other rule +passing. ## The adapter kernel -"Another concrete adapter" excludes the adapter kernel, which is shared on -purpose and is the only adapter code an adapter may reach across a group for: +`adapters-do-not-know-other-concrete-adapters` excludes the adapter kernel, +which is shared on purpose and is the only adapter code an adapter may reach +across a group for: -- `src/adapters/platform/**` — the system clock, the shared abort primitive and - the bounded-capacity guard +- `src/adapters/platform/**` — mechanisms more than one adapter group shares: + the system clock, the shared abort primitive, the bounded-capacity guard, + the IndexedDB connection and transaction helpers, `Retry-After` parsing and + the JSON member scanner. Two bootstrap-only platform services live there + too: the browser lifecycle runtime and the mutation intent factory (no + adapter imports them). A kernel file owns mechanics only, never names, + schemas, failure codes or observation shapes; the full list of what it must + never own is at the top of `indexeddb-connection.ts` - `src/adapters/browser-file-storage/result.ts` — the browser-data result and failure constructors - `src/adapters/cross-context-invalidation/index.ts` — the cross-context invalidation transport and its types. Any adapter may import it; today `query-cache` does -Each rule above is enforced by `check:architecture`, including the kernel -carve-out, so this table and the executable rules cannot drift apart. +`check:architecture` enforces every rule above, including the kernel carve-out. +`verify:documentation` fails when a rule name or a top-level `src` folder is +missing from this page, when `README.md`, `overview.md` or +`frontend-application-foundation.md` describe a folder differently from the +folder table, and when any of them names a top-level `src` folder that does not +exist. Neither checks that a row describes its rule correctly. Every exception is written in the rule itself (`.dependency-cruiser.json`): the exempted path in `pathNot`, and the reason, owner and revisit condition in @@ -63,6 +113,8 @@ exempted path in `pathNot`, and the reason, owner and revisit condition in - `src/presentation/routes/app-router.tsx` importing the app (`presentation-does-not-import-apps-or-contexts`) - the design-system facades (`design-system-is-reached-through-its-index`) +- `src/platform/routing` reading deployable-app types + (`platform-kernel-is-product-neutral`) ## 어댑터 그룹의 공개 경계 @@ -100,7 +152,8 @@ realm 파일만 빼는 구조라, 배럴이 그 파일을 다시 끌어들이면 담당하고, 워커 진입점은 배럴을 쓰지 않는다. `bootstrap` contains composition only. Business rules and page-specific -orchestration belong to domain/application. +orchestration belong to `src/application` or to a feature's domain and +application. The [ports, adapters, and feature-boundary contract](./frontend-ports-adapters-and-boundaries.md) explains how `presentation` acts as the inbound adapter and how feature diff --git a/docs/architecture/optional-adapter-recipes.md b/docs/architecture/optional-adapter-recipes.md index 0de7551a..3027cdf7 100644 --- a/docs/architecture/optional-adapter-recipes.md +++ b/docs/architecture/optional-adapter-recipes.md @@ -19,9 +19,10 @@ production readiness를 뜻하지 않는다. | TypeScript port | `recipes/frontend-capabilities/contracts.ts` | 아니오 | | fake/unavailable | `recipes/frontend-capabilities/fake-adapters.ts` | 아니오 | | contract test | `tests/recipes/optional-capability-contracts.test.ts` | 아니오 | -| file/IndexedDB/OPFS/Cache 심층 계약 | `recipes/frontend-capabilities/browser-file-storage-contracts.ts` | 아니오 | -| 심층 deterministic fake | `recipes/frontend-capabilities/browser-file-storage-fakes.ts` | 아니오 | +| file/IndexedDB/OPFS/Cache 심층 계약. reference runtime이 있는 port는 복사하지 않고 `src/application/ports`의 port를 다시 내보낸다([0929] 05-03) | `recipes/frontend-capabilities/browser-file-storage-contracts.ts` | 아니오 | +| 심층 deterministic fake. file·storage durability·OPFS fake는 `src` port를 `implements`한다 | `recipes/frontend-capabilities/browser-file-storage-fakes.ts` | 아니오 | | 심층 contract test | `tests/recipes/browser-file-storage-contracts.test.ts` | 아니오 | +| 짝 백엔드 세션 owner(JWT·Keycloak PKCE, Redis session 쿠키+CSRF). catalog 밖이고 복사해서 쓴다. src가 import하면 `PRODUCTION_IMPORTS_RECIPE` | `recipes/session-owners/`, 테스트 `tests/recipes/oidc-pkce-session-owner.test.ts`, `tests/recipes/cookie-session-owner.test.ts`, `tests/recipes/session-owners-runtime.test.ts`, 절차 `docs/manual/04-paired-backend-session.md` | 아니오 | | browser data current-status ledger | `docs/architecture/browser-data-capability-completion-ledger.md` | 문서만 | | 심층 설계/ADR | `docs/architecture/browser-file-and-origin-storage.md`, `decisions/VD-11-browser-file-and-origin-storage.md` | 문서만 | | client cache scope/persistence 설계 | `docs/architecture/client-cache-and-storage.md`, `decisions/VD-13-client-cache-scope-and-persistence.md` | 문서만 | @@ -64,12 +65,29 @@ validation, quota, integrity, cleanup 같은 fail-closed guard가 예산에서 runtime을 compose하지 않는다. 별도의 production manifest/module-inventory 검사는 선택되지 않은 runtime source가 실제 `dist`에 없는지 계속 검증한다. -2026-07-28 기준 동일 설정의 `offline-indexeddb` 실측은 32,930 gzip bytes였다. -기존 8,000 bytes 값은 bundle 측정 없이 선언된 값으로 실제 reference runtime과 -일치하지 않아 약 9% headroom을 둔 36,000 bytes로 교정했다. -`service-worker-pwa` 10,000 bytes와 `file-transfer` 52,000 bytes는 현재 실측을 -수용하므로 유지한다. 이후 source가 예산을 넘으면 gate를 우회하거나 예산을 -자동 인상하지 않고, output artifact와 변경 이유를 검토해야 한다. +예산 값은 `config/recipes/frontend-capability-recipes.json`이 정본이다. 정하는 +규칙은 아래와 같다(2026-11-03, 리뷰 결정 0929/05-04). + +- 예산 = 측정값 + 3%를 100 B 단위로 올린 값. +- 측정값의 3% 안에서 늘면 예산을 고치지 않는다. +- 3%를 넘게 늘면 예산을 올리는 커밋 본문에 늘어난 이유를 적는다. 그때 다시 이 + 규칙으로 정한다. +- 이유: 전에는 수정마다 100 B씩 올렸다. 그러면 한도가 늘 직전 측정값이라, + 예산 초과가 "왜 커졌나"를 묻는 신호가 되지 못하고 수정마다 인상 커밋만 남았다. +- 버린 대안: 레시피 예산에서 kernel(`src/adapters/platform/` 등 공유 source)을 빼는 + 것. kernel이 커지는 것을 놓친다. + +2026-11-03 측정(`check:optional-recipes:source`, 기준 `d166aa3`)으로 정한 값: + +| recipe | 측정 gzip B | 예산 gzip B | +|---|---:|---:| +| `file-transfer` | 56,053 | 57,800 | +| `offline-indexeddb` | 37,327 | 38,500 | +| `realtime` | 40,902 | 42,200 | +| `service-worker-pwa` | 9,716 | 10,100 | + +source가 예산을 넘으면 gate를 우회하지 않는다. output artifact와 늘어난 이유를 +검토한 뒤 위 규칙으로 올린다. ## 2. 어느 경계에 두는가 @@ -91,7 +109,7 @@ type은 facade 밖으로 노출하지 않는다. | --- | --- | --- | --- | | realtime | foreground ordered event 또는 duplex protocol이 확정됨 | focus refetch/manual refresh가 충분하거나 ordering·replay owner 없음 | bounded polling 또는 stale UI | | offline/IndexedDB/OPFS | structured offline data/queue 또는 large local binary가 제품 요구 | credential, partition/retention/recovery 미정, HTTP cache로 충분 | read-only/online-only 또는 승인된 bounded Blob | -| Service Worker/Cache Storage | install/offline shell 또는 public HTTP representation cache owner 승인 | auth/private/opaque cache, update/rollback UX 없음 | hosting cache 기반 network app | +| Service Worker/Cache Storage | 설치형(installability) 또는 public HTTP representation cache owner 승인. 오프라인 셸은 지원하지 않는다(이 절 끝) | auth/private/opaque cache, update/rollback UX 없음 | hosting cache 기반 network app | | file/picker/download | selection/preview/upload/download와 bounded memory/integrity 요구 | backend 재검증 없음, whole-buffer large file, long-lived credential URL | native input + authorized direct download | | generated API | versioned source와 drift CI가 있음 | DTO가 domain/UI로 노출됨 | typed request builder + schema | | feature flag | rollout/kill switch owner와 default 있음 | authorization에 사용 | typed local default | @@ -106,11 +124,13 @@ type은 facade 밖으로 노출하지 않는다. SSOT다. 문서와 catalog가 다르면 gate가 검사하는 catalog를 우선 고치고 이 표도 같이 갱신한다. -Service Worker를 켤 때 확인할 것(06-05). 템플릿은 1·6과 2의 시작 실패 +Service Worker를 켤 때 확인할 것(06-05). 템플릿은 1·6·7과 2의 시작 실패 이벤트만 갖고 있다. -1. `src/features/installed-runtime-capabilities.ts`의 `SERVICE_WORKER`를 +1. 제품 소유 파일 `src/features/product-capabilities.ts`의 `SERVICE_WORKER`를 `ACTIVE`로 바꾼다. `scripts/build-frontend.ts`가 worker 빌드를 추가로 돈다. + 템플릿 파일 `src/features/installed-runtime-capabilities.ts`는 그 선택을 + 검사하고 투영만 하므로 고치지 않는다. 2. 관측: `createRuntimeComposition`이 텔레메트리 포트를 optional host에 넘긴다 (`src/bootstrap/create-runtime-composition.ts`). 시작 결과가 `FAILED`나 `INCOMPATIBLE`이면 `service-worker.start.failed`가 1건 남는다 @@ -129,6 +149,22 @@ Service Worker를 켤 때 확인할 것(06-05). 템플릿은 1·6과 2의 시작 5. reload 처리: `onReloadRequired`를 구독해 reload를 안내한다. 6. 끄기·롤백·제거: `docs/operations/release-cache-rollback.md`의 Service Worker 절차. `service-worker.js`는 `Cache-Control: no-cache`로 서빙한다. +7. 실제 브라우저 검사: `tests/e2e/service-worker-update.spec.ts`와 + `service-worker-recovery.spec.ts`를 제품 구성으로 돌린다. helper는 이미 + `ACTIVE`인 선택을 그대로 쓰고, 캐시 단언은 빌드가 만든 사전 캐시 목록과 + 비교한다. 준비 단계에서 실패하면 helper(`tests/e2e/support/service-worker-builds.ts`) + 머리 주석의 전제 목록과 두 spec 머리 주석에서 바뀐 곳을 찾는다. + +오프라인 셸(0929/06-03): reference 워커는 navigation을 가로채지 않는다 +(`service-worker-static-assets.ts` navigation `NETWORK_ONLY`, +`service-worker-lifecycle.ts` `intercepts`). 사전 캐시는 해시 이름의 +`assets/`뿐이고 `index.html`은 넣지 않는다(`scripts/generate-service-worker-assets.ts`). +설계가 cached `index.html` fallback을 금지한다(closed deep design 18.8). 오프라인 +셸이 필요한 제품은 템플릿 워커를 켜는 것으로 얻지 못한다. 별도 제품 capability로 +설계하고, 그때 넘겨받는 파일은 위 세 파일과 `vite.service-worker.config.ts`다. +`tests/e2e/service-worker-update.spec.ts`의 사전 캐시 단언과 "HTML과 자산은 같은 +release" 성질은 제품이 다시 증명한다. 넘겨받은 뒤에는 템플릿 동기화에서 이 파일들이 +충돌한다. Web Push target은 현재 13번째 설치 recipe가 아니다. 기존 `realtime`, `service-worker-pwa`, `browser-permission`의 인접 경계를 조합해야 하는 별도 @@ -186,6 +222,27 @@ Web Push를 함께 설치하지 않는다. - detailed status, target contract와 구현 work package는 [Realtime events, Web Push, and bounded polling](./realtime-events-web-push-and-bounded-polling.md)을 따른다. 현재 concrete runtime과 product selection은 없다. +- 짝 백엔드 템플릿의 실시간 출구(STOMP-over-SockJS, NDJSON)와 이 repo의 SSE· + `realtime.v1` WebSocket 어댑터는 그대로 연결되지 않는다. 지금 두 템플릿만으로 + 되는 경로는 bounded polling이다. 대응표와 push를 고를 때의 세 길은 설계 문서 + [0.1절](./realtime-events-web-push-and-bounded-polling.md#01-짝-백엔드-템플릿과의-대응-110304-02)에 + 있다(1103/04-02). +- realtime 레지스트리(`createRealtimePolicyRegistry`)가 받는 세 바인딩의 출처 + (1103/04-06). 기능 모듈에는 codec·mapper를 낼 칸이 없으므로 조합 코드가 모은다. + - `apiOperations`: `loadInstalledFeatureRuntimeRegistries().apiOperations` + (`projectApiOperationRows`). snapshot·checkpoint operation이 여기서 온다. + - `schemaCodecs`: 기능 contract contribution의 V3 `events[].payloadValidator` + (`composedContractContributions.eventByType`)와 checkpoint 응답의 + `outputValidator`를 `runtimeSchemaCodecFromValidator`로 바꿔 + `composeRuntimeSchemaCodecs`로 합친다. event type의 `payloadSchemaId`가 그 + validator의 `schemaId`와 같아야 등록된다. 같은 이벤트의 스키마를 V3 `events`와 + realtime 등록 두 곳에 따로 쓰지 않는다. + - `mappers`: 조합 코드가 `BoundaryMapper`(`src/contracts/boundary-mapper.ts`)를 + 쓰고 `composeBoundaryMapperRegistry`로 합친다. mapper의 `inputSchemaId`는 event + type의 `payloadSchemaId`와 같아야 한다. 템플릿이 만드는 출처는 없다. + - 기능 모듈에 칸을 더하는 것(V3 `events`에서 event type을 뽑거나 + `realtimeMappers` 칸)은 위 대응표에서 push 경로를 고른 뒤 정한다. STOMP hint + 경로면 delta mapper가 필요 없을 수 있다. ### IndexedDB/OPFS diff --git a/docs/architecture/overview.md b/docs/architecture/overview.md index 9f8579db..7750dc2b 100644 --- a/docs/architecture/overview.md +++ b/docs/architecture/overview.md @@ -4,23 +4,43 @@ This Mermaid view is a repository-local implementation projection. The `PASS_SCOPED` reviewer evidence applies to the canonical draw.io diagram named in `review-ledger.json`, not automatically to edits in this file. +`src/` has nine top-level folders. The descriptions match the table in +[the layer contract](./layers.md), which also names every import rule: + +- `src/bootstrap` — the composition root: runtime configuration, concrete adapter construction and the React mount +- `src/apps` — deployable apps: each `app-module.ts` declares an app and its context budget; `template-app.ts` is the app this build produces +- `src/contexts` — bounded contexts: each `context-module.ts` declares its app, route root and feature budget +- `src/features` — removable vertical slices (`src/features//{domain,application,contracts,adapters,presentation}`) and the installed-feature catalogs (`src/features/*.ts`) +- `src/presentation` — generic UI and the inbound adapter: routes, layouts, the design system, pages and providers +- `src/adapters` — reusable capability runtimes that implement application ports: HTTP, auth, storage, query cache, telemetry, workers and more +- `src/application` — generic use cases, ports, policies and view-models +- `src/contracts` — shared vocabulary and registries read by several layers, the workers and the build and release scripts +- `src/platform` — product-neutral primitives any folder may use: budgets, execution context, resilience, the telemetry pipeline, error envelopes and release coherence + +Arrows point from the importing folder to the imported one. Every folder may +also import `contracts` and `platform`; only the main path is drawn. + ```mermaid flowchart LR Bootstrap[bootstrap / composition root] --> Presentation[presentation] Bootstrap --> Adapters[adapters] + Bootstrap --> Features[features] Presentation --> Shell[app shell and route surfaces] Shell --> Providers[session and theme providers] - Presentation --> Application[application] + Presentation -- app router only --> Apps[apps] + Apps --> Contexts[contexts] + Contexts --> Features + Features --> Application[application] + Presentation --> Application Adapters --> Application - Application --> Domain[domain] - Contracts[contract registries] --> Bootstrap - Contracts --> Adapters - Contracts --> Presentation + Application --> Contracts[contracts] + Contracts --> Platform[platform] ``` The enforced dependency rule points inward: presentation calls application use cases, adapters implement application ports, and only the composition root -selects concrete adapters. Contract registries are the named source for routes, +selects concrete adapters. Domain code lives inside each feature. Contract +registries are the named source for routes, API operations, environment values, storage keys, errors, queries, telemetry, and release tokens. Installed feature contributions extend those registries without making the generic application or router import a concrete feature diff --git a/docs/architecture/presigned-transfer-and-image-cdn.md b/docs/architecture/presigned-transfer-and-image-cdn.md index 4fa8595b..bd36689b 100644 --- a/docs/architecture/presigned-transfer-and-image-cdn.md +++ b/docs/architecture/presigned-transfer-and-image-cdn.md @@ -11,6 +11,17 @@ authorization owner는 아직 조합하지 않는다. 이 개별 runtime은 표처럼 다른 상태다. 어느 경로도 임의의 URL이나 object key를 application caller가 직접 전달하는 범용 HTTP facade가 아니다. +> **짝 백엔드와 맞지 않는다(2026-11-03 리뷰 01-01).** 이 문서의 presigned·resumable +> 프로토콜(`PRESIGNED_MULTIPART_V1`)을 받는 서버가 짝 백엔드 템플릿에는 없다. 짝 백엔드는 +> 2026-09-25에 presigned·direct multipart 코드를 지웠고, 파일을 자기 Fileserver로 직접 +> 받는다(`POST /v1/files` multipart 한 번, `POST /v1/files:raw`, tus `/v1/uploads`). 두 템플릿을 +> 그대로 쓰는 업로드는 그 Fileserver로 올리는 것이다. 프론트 client는 +> `src/adapters/http/fileserver-upload.ts`의 `createFileserverUploadClient`(`POST /v1/files`)이고, +> 재개가 없다(`docs/manual/02-decision-tables.md` 「파일 업로드」). 이 문서의 경로는 제품 +> backend가 같은 BFF 계약을 직접 만들 때 쓴다 +> ([`server-file-capability-infrastructure.md`](./server-file-capability-infrastructure.md)). +> presigned 다운로드와 private Image CDN descriptor 발급 서버도 같은 이유로 짝 백엔드에 없다. + ## 0. 현재 구현과 목표 상태 이 문서에서 “설계됨”, “reference source가 있음”, “제품에 조합됨”과 “target @@ -381,7 +392,9 @@ complete 결과를 모를 때 클라이언트는 다음처럼 동작한다. resourceId 없이 닫는다(`resumable-upload-runtime.ts` `readCompletedResourceId`). - 서버가 complete를 반영한 뒤 로컬 checkpoint 삭제가 실패해도(IndexedDB 오류, complete 직후 caller abort) `upload()`는 성공을 돌려준다. 남은 행은 다음 - `upload()`나 `abort()`가 같은 자원으로 정리한다. + `upload()`나 `abort()`가 같은 자원으로 정리한다. 응답을 잃은 complete를 다음 + `upload()`가 재조정해 서버 status `QUARANTINED`를 찾았을 때도 같다 + (0929/01-02, `reconcileActiveCheckpoint`). 서버 계약 — complete 진행 중(`ResumableUploadControlPlane.complete` 주석): @@ -729,10 +742,26 @@ analytics는 제품 presentation이 소유한다. | recovery | 호출자 행동 | | --- | --- | | `RESUME` | 같은 파일·key로 `upload()`를 다시 부른다. `retryable:true`면 자동 재시도해도 된다. capability 재발급이 필요한 실패도 여기로 온다 | -| `RECONCILE` | `upload()`를 다시 부른다. 서버 상태를 먼저 읽는다(예: 다른 문맥이 checkpoint를 먼저 씀) | +| `RECONCILE` | `upload()`를 다시 부른다. 서버 상태를 먼저 읽는다(예: 다른 문맥이 checkpoint를 먼저 씀, part 발급에 서버가 session을 모른다고 404) | | `RESTART` | `abort()` 뒤 `upload()`로 새 session을 연다. abort가 남아 있음(operation `UPLOAD_ABORT`), 읽을 수 없는 checkpoint 행, 서버 part가 파일과 다름 | -| `RESELECT` | 파일을 다시 고르거나, 다른 파일이면 새 key를 쓴다 | -| `NONE` | 이 요청으로 할 행동이 없다. 잘못된 입력, 상한·정책·권한 거절, 호출자 자신의 abort, 다시 불러도 같은 답이 오는 서버 응답(정책보다 긴 session 등) | +| `RESELECT` | 파일을 다시 고르거나, 다른 파일이면 새 key를 쓴다(고른 파일이 바뀌었거나 읽을 수 없음 포함). `retryable`은 늘 `false`다 | +| `NONE` | 이 요청으로 할 행동이 없다. 잘못된 입력, 상한·정책·권한 거절, 호출자 자신의 abort, 닫힌 runtime, 다시 불러도 같은 답이 오는 서버 응답(정책보다 긴 session·capability 등). `retryable`은 늘 `false`다 | + +번역은 recovery 값만이 아니라 code도 본다(0929/01-01). `POLICY_REJECTED`는 +`NONE`, file store의 `NOT_READABLE`/`REOPEN`은 `RESELECT`, `UPLOAD_PART`의 +`NOT_FOUND`는 `RECONCILE`이다. 표 밖 값 중 `retryable:true`인 일시 오류는 +`RESUME`이다. part 발급(BFF)의 401/403과 object store PUT 403은 code·단계가 +같다. 그래서 출처를 아는 runtime의 발급 분기가 발급 거절을 `NONE`(retryable +`false`)으로 만든다. 세션 만료·권한 회수라 재인증 전에는 다시 불러도 같은 답이고, +재인증은 앱 세션 계층 몫이다. PUT 403은 서명 만료가 보통 원인이라 새 capability로 +풀리므로 `RESUME`이다. + +서버의 `Retry-After`가 runtime 정책의 `maxRetryAfterMs`보다 길면 runtime은 +기다리지 않고 멈춘다. 이때 앱에 주는 실패는 `RESUME`, `retryable:false`다 +(`resumable-upload-runtime.ts` `stripProviderFailure`, 2026-11-03 01-02). control +plane 전송이 상한 밖 429를 끝내는 규칙과 같다. 그래서 part 발급·PUT과 control +plane, 그리고 전송과 정책 중 어느 쪽 `maxRetryAfterMs`가 크든 같은 답이 나온다. +앱은 사람이 누르는 재시도로 넘긴다. 관측성에는 operation, safe outcome, byte/candidate bucket, retry bucket과 failure code만 기록한다. capability ID, URL, query, asset/resource/session ID, diff --git a/docs/architecture/realtime-events-web-push-and-bounded-polling.md b/docs/architecture/realtime-events-web-push-and-bounded-polling.md index 4110a765..a0d3a2e7 100644 --- a/docs/architecture/realtime-events-web-push-and-bounded-polling.md +++ b/docs/architecture/realtime-events-web-push-and-bounded-polling.md @@ -78,6 +78,45 @@ row의 `referenceRuntime.status=AVAILABLE_NOT_COMPOSED`가 reusable source의 | always-on background SSE/WebSocket/Polling | `PLATFORM_LIMITED` | 없음 | hidden/frozen/terminated browser 상태에서 공통 보장하지 않음 | | timely cross-browser Web Push | `PLATFORM_LIMITED` | 없음 | best-effort notification과 foreground authoritative refresh만 제공 | +### 0.1 짝 백엔드 템플릿과의 대응 (1103/04-02) + +결론: 짝 백엔드(`clean-architecture-backend-template`)의 실시간 출구와 이 +repo의 SSE·WebSocket 어댑터는 **지금 그대로 연결되는 조합이 없다.** 지금 두 +템플릿만으로 되는 경로는 bounded polling 하나다. push가 필요하면 한쪽에 새 코드를 +써야 하고, 어느 쪽을 쓸지는 제품이 정한다. + +```text +프론트 SSE 어댑터 → Accept: text/event-stream, REALTIME_EVENT_V1 envelope +프론트 WS 어댑터 → subprotocol 정확히 "realtime.v1", REALTIME_EVENT_V1 envelope +짝 백엔드 STOMP 채널 → SockJS /ws, /topic 구독 1개, Map 투영, 재전송 없음 +짝 백엔드 스트리밍 → NDJSON, JSON text sequence(RFC 7464). SSE writer는 없다 +``` + +| 프론트 transport | 짝 백엔드 출구 | 지금 연결되나 | 이유 | +| --- | --- | --- | --- | +| SSE (`fetch-sse-connection.ts`) | 없음 | 아니오 | 백엔드에 SSE writer가 없다(`StreamMediaType.SSE`는 OpenAPI 생성기만 쓴다). 아키텍처 테스트가 MVC `SseEmitter`를 금지한다(`ForbiddenApiArchitectureTest` `NO_SSE_EMITTER`, 백엔드 결정 D3). 스트리밍 writer는 NDJSON·JSON text sequence뿐이다(`src/adapter/inbound/web-advanced/README.md`) | +| WebSocket (`websocket-connection.ts`) | STOMP-over-SockJS 채널 | 아니오 | 프론트는 협상된 subprotocol이 정확히 `realtime.v1`이어야 연다(`websocket-protocol.ts`). 백엔드에는 subprotocol 협상 코드가 없다. STOMP frame은 `REALTIME_EVENT_V1` envelope(streamEpoch, sequence, eventId, scopeBinding)이 아니다 | +| WebSocket | raw WebSocket 라이브러리 API(`servlet/`) | 아니오(새 코드 필요) | 서비스 어댑터가 handler를 직접 조립한다. `realtime.v1` 협상과 envelope을 구현한 예시는 없다 | +| bounded polling (`bounded-poll-coordinator.ts`) | REST GET + Envelope | **예** | V3 실행기가 짝 백엔드 Envelope을 읽는다. poll 전용 operation의 `retryBudget`을 0으로 둔다(9.2절) | + +push가 필요할 때 고를 길(제품 결정, 리뷰 1103/04-02 결정의 근거): + +1. **백엔드에 `realtime.v1` WebSocket handler를 쓴다.** 프론트 어댑터를 그대로 + 쓰고 `CURSOR` 복구까지 갈 수 있다. 백엔드에 sequence·replay 저장소(outbox)가 + 필요하다. SSE는 백엔드 결정 D3을 먼저 바꿔야 하므로 이 표에서는 WebSocket을 + 먼저 적는다. +2. **프론트에 STOMP transport를 쓴다.** 백엔드는 그대로다. STOMP frame에는 + sequence·epoch가 없어 stream coordinator의 gap·cursor 기능을 못 쓴다. frame을 + query 무효화 hint로만 쓰고 데이터는 snapshot(REST GET)으로 다시 읽는다 + (`INVALIDATION_HINT` + `SNAPSHOT_ONLY`). simple broker는 재전송이 없으므로 + 연결이 끊긴 동안의 변경은 재연결 뒤 snapshot으로만 회복한다. +3. **push 없이 bounded polling만 쓴다.** 두 repo 모두 새 코드가 없다. freshness는 + poll 주기(최소 5초)로 정해진다. + +다시 볼 때: 백엔드에 `realtime.v1` handler나 SSE writer가 생기거나, 프론트에 STOMP +transport가 생기면 이 표를 고친다. 백엔드 쪽 정본은 백엔드 repo의 +`src/adapter/inbound/websocket/README.md`다. + 별도로 realtime catalog row 자체는 `RECIPE_AVAILABLE`이다. 이것은 primary runtime status가 아니다. 기존 copyable `RealtimePort`를 production wire authority나 generic mega port로 확장하지 않았고, reference runtime의 공개 계약은 @@ -769,9 +808,12 @@ effectiveDelay = max(localDelay, validServerNotBefore) elapsed budget을 reset한다(둘 중 하나만으로는 reset하지 않는다, `reconnect-policy.ts:131-149`). 이 확인은 server close뿐 아니라 offline과 `waitClosed` throw를 포함한 session의 모든 종료 경로에서 한다 - (`reconnect-coordinator.ts:886-900`). valid heartbeat는 SSE `onComment`와 + (`reconnect-coordinator.ts:888-902`). valid heartbeat는 SSE `onComment`와 WebSocket `HEARTBEAT_ACK` 관측이다. 조합 코드가 이를 - `markValidHeartbeatOrEvent`로 넘긴다. + `markValidHeartbeatOrEvent`로 넘긴다. WebSocket `heartbeatEligible()`이 + false인 동안(hidden 탭)은 heartbeat를 보내지 않아 ACK가 없다. 조용한 + stream은 그동안 예산을 새로 받지 못한다. hidden 연결은 닫거나 visible + 복귀 때 새 run을 만든다(0929/04-04). - stream reconnect는 realtime recovery coordinator, credential recovery는 session owner, Poll attempt 사이 cadence는 poll coordinator가 각각 소유한다. Poll-bound REST transport retry와 Query retry는 끈다. 같은 logical recovery의 @@ -780,14 +822,18 @@ effectiveDelay = max(localDelay, validServerNotBefore) `navigator.onLine`은 실제 backend reachability authority가 아니다. offline 대기 시간은 elapsed budget에 넣지 않는다. online으로 돌아오면 elapsed budget을 다시 시작하고 attempt 상한은 유지한다 - (`reconnect-coordinator.ts:550-559`). + (`reconnect-coordinator.ts:556-568`). 이 대기는 환경 신호가 offline일 때만 + 한다. 서버만 내려가면 online event가 오지 않는다. 그래서 템플릿 transport는 + 서버에 닿지 않은 실패를 `PROVIDER_UNAVAILABLE`로 보고하고, coordinator는 이를 + backoff로 재시도한다(1103/04-04). 조합 코드가 만든 transport가 `OFFLINE`을 + 보고해도 환경이 online이면 같은 backoff로 재시도한다. - auth expiry는 session owner의 single-flight recovery를 한 번 요청한다. 실패하면 `AUTH_REQUIRED`로 멈춘다. - protocol/schema/forbidden/policy failure는 retry하지 않는다. - 재시도 여부는 transport가 보고한 `retryable`이 정한다. reconnect coordinator는 retryable인 `CONNECT_TIMEOUT`·`IDLE_TIMEOUT`·`OFFLINE`· `PROVIDER_UNAVAILABLE`·`RATE_LIMITED`를 server hint가 없어도 남은 budget - 안에서 local full-jitter로 재시도한다(`reconnect-coordinator.ts:1582-1593`). + 안에서 local full-jitter로 재시도한다(`reconnect-coordinator.ts:1579-1590`). server hint가 꼭 필요한 실패는 transport가 hint 없을 때 `retryable: false`로 보고해 terminal이 된다. SSE `429`/`503`에 유효한 `Retry-After`가 없을 때 (`sse/fetch-sse-connection.ts:592-616`)와 WebSocket `OVERLOADED` @@ -824,7 +870,7 @@ attempt당 상한은 30초다. 동작을 강제하지 않는다. - reconnect coordinator가 따르는 환경 신호는 online 하나다 - (`reconnect-coordinator.ts:106-113`). SSE와 WebSocket 연결에는 visibility 입력이 + (`reconnect-coordinator.ts:106-116`). SSE와 WebSocket 연결에는 visibility 입력이 없다. visibility를 직접 듣는 것은 polling뿐이다 (`polling/bounded-poll-coordinator.ts:202-205`). - registry의 `hiddenPolicy`, `killSwitchId`, `fallback`은 검증만 하고 읽지 않는다 @@ -877,7 +923,7 @@ Service Worker message는 old generation/scope면 적용하지 않는다. reference runtime에서 위 흐름의 "close SSE/WebSocket"은 조합 코드가 reconnect coordinator의 `close()`를 불러야 일어난다. `isCurrent`는 attempt·sleep·waitClosed 경계에서만 확인하므로, 열린 채 조용한 session은 다음 event나 server close까지 -남는다(`reconnect-coordinator.ts:175-181`). 그동안 도착한 event는 stream +남는다(`reconnect-coordinator.ts:178-184`). 그동안 도착한 event는 stream coordinator의 scope fence가 막는다. long-lived connection은 connect-time authorization만 신뢰하지 않는다. backend는 @@ -1545,6 +1591,13 @@ NotificationClickDataV1 -> authoritative notification/resource fetch ``` +registry `path`는 router base path를 뺀 앱 기준 경로다. 정상 click은 그 경로를 +같은 앱 루트 아래에서 연다(`/app/` + `/inbox` → `/app/inbox`). 열린 창에 보내는 +handoff `path`는 registry 값 그대로(`/inbox`)라서 router basename과 겹치지 +않는다(06-01). registry는 URL parser가 바꾸지 않는 경로만 받는다. +`/../admin`, `/%2e%2e/admin`, `/./inbox`는 생성 때 거절한다. 이어 붙인 뒤 +parser가 dot segment를 풀면 base path 밖이 열리기 때문이다(1103/06-02). + route intent가 stale/unknown이면 안전한 notification inbox/home으로 이동한다. notification action 자체에서 destructive 업무 mutation을 실행하려면 별도의 confirmed UI 또는 idempotent authorized server command 설계가 필요하다. @@ -1599,13 +1652,25 @@ type PollLeasePolicy = Readonly<{ implementation absolute ceiling보다 느슨한 값, zero interval, unlimited attempt, unknown terminal state와 arbitrary operation ID는 startup에서 거절한다. -`operationId`는 existing API registry의 terminal `QUERY`, `REST`, -`SAFE | IDEMPOTENT`, non-`SERVER_STREAM` operation이어야 한다. command/mutation, -GraphQL subscription, Connect/gRPC-Web server stream과 arbitrary status URL은 poll하지 -않는다. Poll-bound operation의 transport retry profile과 TanStack Query retry는 -`NONE`/`false`여야 한다. 구체적으로 VD-23 `LogicalExecutionBudget`은 -`maxAttempts=1`, `authRecoveryCount=0`, `maxCumulativeSleepMs=0`으로 고정해 -executor 내부 status retry나 401 replay가 일어나지 않게 한다. +poll coordinator는 실행할 V3 descriptor(`InstalledHttpContract`, 조립된 행 +`composeContractContributions(...).httpByOperationId.get(id)`)를 직접 받는다 +(1103/04-01). 생성 때 `assertBoundedPollOperation`이 그 descriptor를 본다. + +- `contract.operationId`가 lease의 `operationId`와 같다. +- `contract.method`가 `GET` 또는 `HEAD`다. +- `contract.retrySemantics`가 `SAFE` 또는 `IDEMPOTENT`다. +- `frontend.retryBudget`이 `0`이다. +- `frontend.responseByteLimit`이 poll 상한(8 MiB) 이하다. + +`retryBudget: 0`이 핵심이다. V3 실행기는 SAFE·IDEMPOTENT 읽기를 +`min(retryBudget, maxRetryAttempts, 2)`번 다시 보낸다 +(`http-execution-v3.ts` `retryCeiling`). 이 값을 descriptor에서 읽으므로, poll에 +묶은 descriptor가 0이면 실행기의 `maxRetryAttempts`(`MAX_RETRY_ATTEMPTS`)와 상관없이 +poll 한 attempt가 요청 한 번이다. 같은 descriptor를 `execute` 안에서 실행기에 +넘긴다. 기능의 기본 GET descriptor(`create:feature`는 `retryBudget: 2`)는 생성 때 +거절된다. poll 전용 operation을 따로 등록한다. V3에는 401 재전송이 없다. +command/mutation, GraphQL subscription, Connect/gRPC-Web server stream과 arbitrary +status URL은 poll하지 않는다. TanStack Query retry도 `false`여야 한다. 한 lease는 다음 조건 중 먼저 발생하는 시점에 종료한다. @@ -1772,6 +1837,7 @@ authoritative query data를 덮지 않는다. | reorder buffer | 기본 0; 선택 시 64 event, 2초 | | WebSocket outbound queued bytes | 256 KiB | | WebSocket outbound queued messages | 128 | +| WebSocket 구독별 event rate | 1초 창마다 256 event. client 상한과 server가 알린 `maxEventsPerSecond` 중 작은 값. 넘으면 그 구독에 `EVENT_RATE_EXCEEDED` recovery를 요청하고 `QUEUE_OVERFLOW`로 연결을 닫는다(1101/04-03, `websocket-connection.ts` `processEvent`) | | reconnect attempts | 연속 10회 또는 5분 | | reconnect max delay | 60초 | | aborted reconnect task drain | 2초 고정; 구현 절대 최대 30초 | @@ -1799,7 +1865,7 @@ task는 run을 fail-closed로 끝내되 underlying task가 settle할 때까지 l `DRAINING`으로 유지하여 다음 physical connection을 허용하지 않는다. 미선택 reference source 전체를 tree-shaking 없이 합성하는 optional-recipe -측정의 gzip 상한은 40,900 bytes다(2026-09-27 성숙도 리뷰 04-x·06-x 반영 뒤 측정값 40,886을 100바이트 단위로 올림). 이 값은 production bundle 허용량이 아니라 +측정의 gzip 상한은 `config/recipes/frontend-capability-recipes.json`의 `realtime` 예산이다. 정하는 규칙은 `optional-adapter-recipes.md`의 "Reference runtime bundle budget" 절에 있다. 이 값은 production bundle 허용량이 아니라 RT-01~RT-04 reference runtime의 회귀 예산이며, production asset에는 계속 미선택 realtime module이 0이어야 한다. @@ -1886,13 +1952,13 @@ credential을 보호할 수 있다고 주장하지 않는다. | --- | --- | --- | | `ABORTED` | lifecycle/user cancellation | retry 없음 | | `UNSUPPORTED` | browser capability 없음 | declared fallback | -| `OFFLINE` | network hint/attempt failure | online hint 뒤 bounded check | +| `OFFLINE` | 환경 신호(`navigator.onLine` 등 조합 코드가 넘긴 `online()`)가 offline이다. 템플릿 transport는 이 kind를 내지 않는다(1103/04-04) | timer 없이 online hint를 기다린 뒤 bounded check. poll lease는 끝나고 `retryable: true`다 | | `CONNECT_TIMEOUT` | open deadline 초과 | bounded reconnect | -| `IDLE_TIMEOUT` | heartbeat/byte deadline 초과 | close + bounded reconnect | +| `IDLE_TIMEOUT` | transport: heartbeat/byte/unsubscribe deadline 초과(operation `RECEIVE`·`SUBSCRIBE`). 내부 task 마감에는 쓰지 않는다 | close + bounded reconnect | | `AUTH_REQUIRED` | session expired/recovery 실패 | sign-in UX | | `FORBIDDEN` | stream/resource 거절 | retry 없음 | | `RATE_LIMITED` | connection/request/provider limit | bounded server hint | -| `PROVIDER_UNAVAILABLE` | backend/push/hosting unavailable | bounded retry 또는 degraded | +| `PROVIDER_UNAVAILABLE` | backend/push/hosting unavailable. 환경은 online인데 서버·프록시에 닿지 않은 것(SSE fetch·reader 거절, WebSocket `error`, poll `execute` 거절)도 세 transport 모두 이 kind다(1103/04-04, `retryable: true`). stream coordinator의 recovery deadline 초과(operation `RECOVER`)와 close drain deadline 초과(operation `CLOSE`)도 이 kind다(`retryable: false`). live↔Poll handoff coordinator의 checkpoint deadline 초과(operation `RECOVER`)와 close drain deadline 초과(operation `CLOSE`)도 이 kind다(`retryable: true`) | bounded retry 또는 degraded. stream coordinator 마감은 재연결로 풀리지 않는다: task가 settle할 때까지 `DRAINING`을 유지한다. settle 뒤 recovery 마감은 다음 event가 recovery부터 하고, close 마감은 `CLOSED`가 된다. handoff checkpoint 마감은 그 전환을 fail-close하므로 새 handoff만 돌 수 있다. handoff close 마감 뒤에는 writer·checkpoint task가 settle하면 다시 부른 `close()`가 성공한다 | | `PROTOCOL_MISMATCH` | version/subprotocol/content type | terminal/rollout rollback | | `MALFORMED_EVENT` | state-bearing syntax/schema/exact-key 실패 | cursor 미진행, freshness `UNKNOWN`, close + registered recovery | | `MAPPING_CONTRACT_VIOLATION` | validated DTO의 registered mapper 실패 | effect/cache/cursor write 0, close + registered recovery | @@ -1903,7 +1969,7 @@ credential을 보호할 수 있다고 주장하지 않는다. | `SEQUENCE_GAP` | missing event | snapshot resync | | `CURSOR_EXPIRED` | replay retention 밖 | snapshot reset | | `QUEUE_OVERFLOW` | backpressure ceiling | close + registered snapshot/session rebuild | -| `APPLY_FAILED` | feature effect 실패 | cursor 미commit, bounded registered recovery | +| `APPLY_FAILED` | feature effect 실패. stream coordinator의 effect deadline 초과(operation `APPLY`, `retryable: false`)도 이 kind다. live↔Poll handoff coordinator에서 이전 writer의 effect가 quiescence deadline 안에 끝나지 않은 것(operation `RECOVER`, `retryable: true`)도 이 kind다 | cursor 미commit, bounded registered recovery. deadline 초과는 recovery를 바로 하지 않는다: task가 settle할 때까지 `DRAINING`을 유지하고, settle 뒤 다음 event가 recovery부터 한다. handoff quiescence 마감은 그 전환을 fail-close하므로 새 handoff만 돌 수 있다 | | `POLL_BUDGET_EXHAUSTED` | lease 한도 도달 | stale/manual retry | | `PUSH_PERMISSION_DENIED` | 사용자 거절 | foreground fallback | | `PUSH_SUBSCRIPTION_STALE` | rotation/expiry/provider gone | bounded re-registration | @@ -1992,7 +2058,7 @@ reference runtime의 관측 지점은 다음과 같다. 조합 코드는 attempt | WebSocket `HEARTBEAT_ACK` | `realtime_heartbeat_observed` | | polling `LEASE_STARTED`, `ATTEMPT_FINISHED`(`VALUE`·`UNCHANGED`·실패 kind), `LEASE_STOPPED` | `bounded_poll_*` | -근거는 `reconnect-coordinator.ts:128-182`, +근거는 `reconnect-coordinator.ts:131-185`, `polling/bounded-poll-coordinator.ts:87-113`, `websocket/websocket-connection.ts:376-378`이다. sink가 throw해도 제어 흐름은 바뀌지 않는다(`result.ts`의 `observeRealtime`). diff --git a/docs/architecture/routing-pages-and-patterns.md b/docs/architecture/routing-pages-and-patterns.md index 89515500..fdc9a828 100644 --- a/docs/architecture/routing-pages-and-patterns.md +++ b/docs/architecture/routing-pages-and-patterns.md @@ -38,8 +38,9 @@ RP-04 이후 route runtime과 RP-06 page/form platform에는 다음 장점이 production composition에서 실행한다. platform route 계약, `src/features/installed-feature-contracts.ts`, -`src/features/installed-feature-runtimes.tsx`의 완전성은 TypeScript와 registry -negative fixture가 함께 검사한다. params/search codec, loading/error surface, +`src/presentation/routes/route-runtime.tsx`의 완전성은 TypeScript와 registry +negative fixture가 함께 검사한다. feature route의 codec은 그 route의 context +route handle(`codecs`)에 실려 route와 함께 적재된다(15-01). params/search codec, loading/error surface, access, title, navigation, chunk ID는 `src/presentation/routes/app-router.tsx`에서 모두 소비된다. built Vite manifest의 dynamic entry는 release manifest route chunk map과 검증되며, @@ -289,6 +290,10 @@ chunk recovery 순서: "한 번 새로고침" 버튼이 있다(`app-router.tsx`의 `RouteFailureSurface`). - 복구하지 못한 청크 실패: 같은 형식이다. `ChunkRecoveryBoundary`의 `onUnrecovered`가 같은 ID로 `ui.render.failed`를 기록한다. +- context가 라우트나 레이아웃을 불러오지 못한 실패: `route_id`는 그 URL의 등록 + 라우트 id다. 등록 라우트가 없는 URL이면 `UNREGISTERED_ROUTE`다. not-found + 화면이 실패한 것이 아니므로 `NOT_FOUND`를 쓰지 않는다(`app-router.tsx`의 + `failedRouteIdAt`). - 조회 실패: `AppFailure.requestId`. HTTP 진단의 `correlation_id`와 같은 값이다 (`async-surface.tsx`의 `TerminalErrorSurface`). @@ -305,6 +310,10 @@ custom fallback을 넘겨 retry/reset 기능을 잃지 않게 한다. boundary `RouteLifecycle`은 POP이 아닐 때만 top으로 보낸다(`app-router.tsx`). `PageHeader`의 heading focus는 `preventScroll`이라 복원된 위치를 옮기지 않는다 - 새 primary route는 top으로 이동 +- 라우트 이동은 route ID나 pathname이 바뀐 것만이다. 검색값만 바뀐 경우(URL에 묶은 + 필터)와 지금 주소를 가리키는 링크는 같은 화면의 입력이라 focus·scroll을 건드리지 + 않고 `route.changed`도 남기지 않는다(`RouteLifecycle`). 검색값 변경에 top이 + 필요한 화면(페이지 번호)은 그 화면이 직접 scroll한다 - hash target은 fixed header offset과 focus 가능 여부를 처리. 페이지가 그려진 뒤 `PageHeader`가 대상으로 스크롤하고, 대상이 focus 가능하면 대상에, 아니면 heading에 focus한다(`page-header.tsx`). header 높이는 `html`의 diff --git a/docs/architecture/scale-architecture.md b/docs/architecture/scale-architecture.md new file mode 100644 index 00000000..aa4fad13 --- /dev/null +++ b/docs/architecture/scale-architecture.md @@ -0,0 +1,1406 @@ +# Scale Architecture + +> **상태 머리말 (2026-11-03)** +> +> - **현재 계약인 범위.** 아래 표에서 상태가 "현재 계약"인 절만 지금 코드가 지키는 규칙이다. "기록만"인 절은 2026-09-23 설계 당시의 계획·목록이고, 구현되지 않았거나 바뀌었다. 문서와 코드가 다르면 코드가 맞다. +> - **출처.** 2026-09-23 설계서 "Extreme-Scale Frontend Architecture Design"을 커밋 `6f6c48e`(2026-09-24)에서 옮겼다. 원래 파일은 작업 이력 묶음 안에 있어 복사한 프로젝트가 지울 수 있다. 원문은 `git show 6f6c48e:docs/reviews/2026-09-23-extreme-scale-frontend-plan-bundle/docs/superpowers/specs/2026-09-23-extreme-scale-frontend-architecture-design.md`로 볼 수 있다. +> - **본문.** §1~§55는 영어 원문 그대로다. 절 번호는 바꾸지 않았다. 원문 머리의 날짜·대상·상태·예정 경로 줄만 이 머리말로 바꿨다. +> - **코드가 이 문서를 가리키는 방법.** 코드 주석은 `scale-architecture.md §N` 형식으로 쓴다. 문서 이름이 없는 "Spec" + 절 번호 참조는 `tests/unit/deletable-history-documents.test.ts`가 거부한다. 절 번호를 바꾸면 `git grep "scale-architecture.md §"`로 찾은 주석을 모두 함께 고친다. +> - **코드와 달라진 곳을 적는 규칙.** 원문 문장은 고치지 않는다. 확인한 차이는 그 절 끝에 `> YYYY-MM-DD 현재:` 한두 줄로 적는다. 절의 상태가 바뀌면 아래 표도 고친다. + +## 절 상태 + +- **현재 계약 (코드 참조)**: 코드 주석이 `scale-architecture.md §N`으로 가리키는 절이다. 2026-11-03에 절의 주장을 그 절을 가리키는 모듈의 타입·머리 주석·테스트 이름과 대조했다. 동작을 실행해 확인한 것은 아니다. +- **현재 계약**: 코드가 가리키지 않지만 지금 코드가 지키는 절이다. 같은 날 같은 방법으로 대조했다. +- **기록만**: 구현되지 않았거나 바뀐 절이다. 설계 당시의 기록으로 남긴다. +- "차이 메모"가 "있음"이면 그 절 끝에 `2026-11-03 현재` 메모가 있다. + +집계: 현재 계약 (코드 참조) 41 · 현재 계약 10 · 기록만 4 · 미확인 0. + +| § | 제목 | 상태 | 차이 메모 | +|---|---|---|---| +| 1 | Purpose | 현재 계약 | | +| 2 | Core Principle | 현재 계약 | | +| 3 | Scale Model | 현재 계약 (코드 참조) | | +| 4 | Target Source Structure | 현재 계약 (코드 참조) | 있음 | +| 5 | Module Ownership | 현재 계약 | 있음 | +| 6 | Dependency Rules | 현재 계약 | | +| 7 | Cardinality Budgets | 현재 계약 | 있음 | +| 8 | Registry Composition | 현재 계약 | | +| 9 | Router Architecture | 현재 계약 | | +| 10 | Execution Model | 현재 계약 (코드 참조) | 있음 | +| 11 | Traffic Budget | 현재 계약 (코드 참조) | 있음 | +| 12 | Request Fan-Out | 현재 계약 (코드 참조) | | +| 13 | Retry Model | 현재 계약 (코드 참조) | | +| 14 | Concurrency Budget | 현재 계약 (코드 참조) | | +| 15 | Deadline Propagation | 현재 계약 (코드 참조) | | +| 16 | Request Deduplication and Coalescing | 현재 계약 (코드 참조) | | +| 17 | Error Model | 현재 계약 (코드 참조) | | +| 18 | Error Envelope | 현재 계약 (코드 참조) | | +| 19 | Presentation Error Mapping | 현재 계약 (코드 참조) | | +| 20 | Validation Boundaries | 현재 계약 (코드 참조) | | +| 21 | Validate Once at Trust Boundaries | 현재 계약 (코드 참조) | | +| 22 | Validation Budget | 현재 계약 (코드 참조) | | +| 23 | Telemetry Model | 현재 계약 (코드 참조) | | +| 24 | Telemetry Ownership | 현재 계약 (코드 참조) | 있음 | +| 25 | Telemetry Pipeline | 현재 계약 (코드 참조) | 있음 | +| 26 | Telemetry Must Fail Open for Business Behavior | 현재 계약 (코드 참조) | | +| 27 | Telemetry Storm Protection | 현재 계약 (코드 참조) | | +| 28 | Telemetry Privacy and Redaction | 현재 계약 (코드 참조) | | +| 29 | Trace and Correlation | 현재 계약 (코드 참조) | 있음 | +| 30 | Failure Boundaries | 현재 계약 (코드 참조) | | +| 31 | Async Failure Model | 현재 계약 | 있음 | +| 32 | Spike Traffic Design | 현재 계약 (코드 참조) | 있음 | +| 33 | Sustained Traffic Design | 현재 계약 (코드 참조) | | +| 34 | Amplification Metrics | 현재 계약 (코드 참조) | | +| 35 | Scale Profiles | 현재 계약 (코드 참조) | | +| 36 | Local Scale Verification | 현재 계약 (코드 참조) | 있음 | +| 37 | Global Topology Verification | 현재 계약 (코드 참조) | 있음 | +| 38 | TypeScript Scale Gate | 현재 계약 (코드 참조) | | +| 39 | Runtime Composition Scale Gate | 현재 계약 (코드 참조) | | +| 40 | Browser Boot Gate | 기록만 | 있음 | +| 41 | Request Fan-Out Gate | 현재 계약 (코드 참조) | | +| 42 | Failure and Chaos Scenarios | 현재 계약 (코드 참조) | | +| 43 | Telemetry Storm Test | 현재 계약 (코드 참조) | | +| 44 | Soak Testing | 현재 계약 (코드 참조) | 있음 | +| 45 | Horizontal Scaling and Release Coherence | 현재 계약 (코드 참조) | 있음 | +| 46 | Multi-Replica Release Matrix | 현재 계약 (코드 참조) | | +| 47 | CI Execution Tiers | 현재 계약 (코드 참조) | 있음 | +| 48 | Benchmark Result Format | 현재 계약 (코드 참조) | 있음 | +| 49 | Regression Policy | 현재 계약 (코드 참조) | | +| 50 | Required Architecture Gates | 현재 계약 (코드 참조) | 있음 | +| 51 | Compatibility With Current Template Strengths | 기록만 | | +| 52 | Explicit Non-Goals | 현재 계약 | | +| 53 | Implementation Sequence Constraints | 기록만 | | +| 54 | Acceptance Criteria | 기록만 | | +| 55 | Design Summary | 현재 계약 | | + +## 1. Purpose + +This design evolves the frontend template from a single-application Clean Architecture skeleton into a frontend application platform that remains maintainable when logical domain count, traffic, failure rate, and operating duration become extreme. + +The design must remain valid under worst-case growth assumptions: + +- 100, 1,000, 10,000, 100,000, or 1,000,000 logical features/domains across the product ecosystem. +- Short, severe spike traffic. +- Sustained high traffic over long periods. +- Partial and total backend failures. +- Retry storms, telemetry storms, cache-miss storms, and slow upstreams. +- Long-lived browser sessions. +- Multi-replica frontend deployments during rolling releases. + +The goal is **not** to make one SPA compile and boot one million features. The goal is to make global growth independent from local runtime and build cost by enforcing bounded architecture boundaries. + +## 2. Core Principle + +> No cardinality may become implicitly unbounded. + +The same rule applies to: + +- compile graphs, +- route graphs, +- feature registries, +- cross-feature dependencies, +- HTTP request fan-out, +- retries, +- concurrency, +- payload size, +- validation cost, +- telemetry buffering, +- timers/listeners, +- browser storage, +- failure propagation. + +The platform must expose these costs explicitly in code and CI instead of allowing them to hide behind arrays, `map`, `Promise.all`, global registries, retries, timers, or framework abstractions. + +## 3. Scale Model + +### 3.1 Separate global and local cardinality + +Two different concepts must never be conflated: + +```text +GlobalFeatureCount += logical feature count across the whole product ecosystem + +LocalFeatureCount += feature count compiled and booted by one deployable frontend application +``` + +A system may contain 1,000,000 logical features while an individual deployable app sees only 100-300 features. + +### 3.2 Architectural hierarchy + +```text +Product + -> Deployable App + -> Bounded Context + -> Feature + -> Use Case / Operation + -> Route / Adapter +``` + +A parent boundary knows only its direct children. It does not flatten every descendant into a global registry. + +Example: + +```text +Product + -> Commerce App + -> Order Context + -> Order Creation Feature + -> Payment Context + -> Account App + -> Identity Context +``` + +`Product` must not import `OrderCreatePage`, `PaymentRefundUseCase`, or other deep descendants. + +### 3.3 Scale escape rule + +When a boundary reaches its measured cardinality ceiling, the response is architectural split, not increasing the ceiling indefinitely. + +```text +Feature too large + -> split feature + +Context too large + -> split bounded context + +App too large + -> split deployable app +``` + +This is equivalent to refusing an implicit unbounded one-to-many relation in server-side architecture. + +## 4. Target Source Structure + +```text +src/ +├─ domain/ +├─ application/ +│ └─ ports/ +├─ contracts/ +├─ platform/ +│ ├─ cardinality/ +│ ├─ traffic/ +│ ├─ resilience/ +│ ├─ errors/ +│ ├─ validation/ +│ └─ telemetry/ +├─ features/ +│ └─ / +│ ├─ domain/ +│ ├─ application/ +│ ├─ contracts/ +│ ├─ adapters/ +│ ├─ presentation/ +│ └─ feature-module.ts +├─ contexts/ +│ └─ / +│ └─ context-module.ts +├─ apps/ +│ └─ / +│ └─ app-module.ts +├─ .generated/ +│ └─ +└─ bootstrap/ + └─ compose-product.ts +``` + +The exact path layout may adapt to current repository conventions, but ownership boundaries are mandatory. + +> 2026-11-03 현재: 위 그림의 최상위 `domain/` 폴더는 없다. domain 계층은 기능 안(`src/features//domain`)에만 있다. `src/platform`에는 `execution`·`release`·`routing`도 있다. +> 색인은 생성기가 git이 무시하는 `src/.generated/`에 쓴다. 조립 코드는 `src/bootstrap/`에 있고 `compose-product.ts`라는 파일은 없다. 실제 폴더 목록의 정본은 [`layers.md`](layers.md)다. + +## 5. Module Ownership + +### 5.1 Feature module + +Each feature owns one descriptor containing its own contributions. + +Conceptual API: + +```ts +export const ORDER_FEATURE = defineFeatureModule({ + id: "order", + contracts, + adapters, + runtime, + routes, + messages, + invalidation, + telemetry, +}); +``` + +A new feature must not require hand editing multiple central installation files. + +Target change surface: + +```text +src/features/new-feature/** +.generated/** +``` + +Central handwritten production files changed for a normal feature addition: + +```text +0 preferred +1 maximum when a deliberate bounded-context registration is required +``` + +### 5.2 Bounded context module + +A context composes only its direct feature modules. + +```ts +export const COMMERCE_CONTEXT = defineBoundedContextModule({ + id: "commerce", + features: COMMERCE_FEATURE_INDEX, + budget: COMMERCE_CARDINALITY_BUDGET, +}); +``` + +It does not expose concrete internal feature implementations to unrelated contexts. + +### 5.3 Deployable app module + +A deployable app owns only direct bounded contexts. + +```ts +export const CUSTOMER_APP = defineDeployableApp({ + id: "customer", + contexts: CUSTOMER_CONTEXT_INDEX, +}); +``` + +Each app becomes an independent compilation and deployment unit once scale requires it. + +### 5.4 Generated indexes + +Indexes are generated at build time from approved static source declarations. + +Required properties: + +- static TypeScript imports, +- deterministic output, +- no arbitrary runtime import path, +- no runtime plugin discovery from untrusted configuration, +- generated files are not handwritten registries. + +This preserves tree-shaking, supply-chain reviewability, and compile-time visibility while eliminating central merge hotspots. + +> 2026-11-03 현재: 실제 API는 `defineFeatureModule`(`src/features/feature-module.ts`), `defineBoundedContextModule`(`src/contexts/bounded-context-module.ts`), `defineDeployableAppModule`(`src/apps/deployable-app-module.ts`)이다. 기능 모듈의 필드는 `id`·`contracts`·`routes`·`messages`·`loadRuntime`이다. +> context와 app은 `context-module.ts`·`app-module.ts`의 상수로 소유와 한도를 선언한다. 생성기 `scripts/generate-product-feature-index.ts`가 이 선언을 읽어 색인을 만든다. + +## 6. Dependency Rules + +### 6.1 Cross-feature concrete imports are forbidden + +For different features A and B: + +```text +src/features/A/** -> src/features/B/** +``` + +is an architecture violation unless the dependency is through an explicitly approved public contract boundary. + +Preferred interaction boundaries: + +```text +feature + -> src/contracts + -> src/application/ports + -> explicit orchestration/workflow feature +``` + +### 6.2 Cross-context imports are stricter + +A context must not import another context's concrete feature internals. + +Allowed communication is through: + +- public contracts, +- application ports, +- explicitly named integration contracts, +- server-backed integration where appropriate. + +### 6.3 Cycles are always forbidden + +No cycle is permitted across feature, context, or app boundaries. + +## 7. Cardinality Budgets + +The platform defines explicit architectural budgets. + +Conceptual shape: + +```ts +interface ArchitectureCardinalityBudget { + readonly maxContextsPerApp: number; + readonly maxFeaturesPerContext: number; + readonly maxRoutesPerFeature: number; + readonly maxOperationsPerFeature: number; + readonly maxMessagesPerFeature: number; +} +``` + +Initial numeric values are not hardcoded by this design. They must be established through repository benchmarks. + +Budget files must be visible in review and version controlled. + +Budget increases must produce a detectable architecture-review signal. + +Example failure: + +```text +ARCHITECTURE_CARDINALITY_EXCEEDED +Context: commerce +Current: 201 +Allowed: 200 +Action: split the context or create another deployable boundary. +``` + +> 2026-11-03 현재: 한도를 하나로 묶은 `ArchitectureCardinalityBudget` 타입은 없다. 선언마다 자기 한도를 가진다(`APP_MAX_CONTEXTS = 20`, `CONTEXT_MAX_FEATURES = 200`). +> 한도를 넘으면 `src/platform/cardinality/cardinality-budget.ts`의 `assertWithinCardinalityBudget`이 `CardinalityBudgetExceededError`를 던진다. + +## 8. Registry Composition + +### 8.1 No repeated object spread in accumulation loops + +This pattern is forbidden in scale-sensitive composition paths: + +```ts +features.reduce( + (registry, feature) => ({ ...registry, ...feature.routes }), + {}, +); +``` + +It repeatedly copies accumulated state and becomes quadratic-like as the registry grows. + +### 8.2 Required composition strategy + +Use one mutable local accumulator, explicit duplicate detection, then freeze once. + +```ts +const result = Object.create(null); + +for (const feature of features) { + for (const [id, route] of Object.entries(feature.routes)) { + if (Object.hasOwn(result, id)) { + throw new DuplicateRouteError(id); + } + result[id] = route; + } +} + +return Object.freeze(result); +``` + +The same strategy applies to operation, schema, mapper, invalidation, adapter, runtime, and message contribution composition when a registry is necessary. + +### 8.3 Membership checks + +Repeated linear membership tests such as: + +```ts +installedIds.includes(featureId) +``` + +must not be used in scale-sensitive loops. + +Build a `Set` once and use `has`. + +## 9. Router Architecture + +A flat product-wide route table is not an acceptable extreme-scale model. + +Target hierarchy: + +```text +Product Router + -> Deployable App Router + -> Context Router + -> Feature Router + -> Page Route +``` + +Only the next boundary is loaded eagerly. + +Example at global scale: + +```text +Global logical features: 1,000,000 +Browser boot routes: product/app boundary only +Commerce app selected: commerce context routes loaded +Order context selected: order feature routes loaded +``` + +Global feature count must not linearly increase initial route object count, initial bundle size, or boot heap. + +## 10. Execution Model + +### 10.1 Interaction is the root execution scope + +HTTP requests are not the highest-level unit. A user or application interaction is. + +Examples: + +- open an order page, +- submit a payment, +- change workspace, +- load search results. + +Conceptual context: + +```ts +interface ExecutionContext { + readonly interaction: InteractionContext; + readonly traffic: TrafficContext; + readonly telemetry: TelemetryContext; + readonly cancellation: CancellationContext; +} +``` + +Operations run under the same interaction scope. + +### 10.2 Interaction context + +```ts +interface InteractionContext { + readonly interactionId: InteractionId; + readonly startedAt: number; + readonly deadlineAt: number; +} +``` + +All child operations inherit correlation and deadline information. + +> 2026-11-03 현재: `src/platform/execution/execution-context.ts`의 `ExecutionContext` 필드는 `interaction`(`id`·`startedAt`·`deadlineAt`), `cancellation`, `traffic`, 선택 필드 `trace`, `clock`이다. `telemetry` 필드는 없다. + +## 11. Traffic Budget + +Traffic cost must be explicit and bounded. + +Conceptual model: + +```ts +interface TrafficBudget { + readonly maxPhysicalRequests: number; + readonly maxConcurrentRequests: number; + readonly maxRetries: number; + readonly deadlineMs: number; +} +``` + +A feature owns the policy declaration; the platform owns enforcement. + +```ts +defineQueryOperation({ + id: "order.list", + traffic: { + maxPhysicalRequests: 2, + maxConcurrentRequests: 2, + maxRetries: 1, + deadlineMs: 4_000, + }, +}); +``` + +The platform must not maintain one global per-feature traffic registry. + +> 2026-11-03 현재: `TrafficBudget`의 필드는 `maxPhysicalRequests`·`maxRetries`·`maxConcurrentRequests`·`maxQueuedRequests`다. 마감 시간은 따로 받는다(`createExecutionContext`의 `deadlineMs`, HTTP 계약의 `totalDeadlineMs`). +> 연산의 정책은 HTTP 계약의 선택 필드 `traffic`(`src/contracts/external-contract-runtime.ts`)이다. 없으면 `src/adapters/http/http-execution-v3.ts`의 `DEFAULT_OPERATION_TRAFFIC_BUDGET`을 쓴다. `defineQueryOperation`은 없다. + +## 12. Request Fan-Out + +Frontend N+1 is treated as an architecture defect. + +Forbidden behavior: + +```text +load 1 collection + -> N rows + -> N detail requests +``` + +Preferred behavior: + +- pagination/cursor APIs, +- bounded page sizes, +- backend bulk endpoints, +- backend read models, +- request coalescing, +- shared query/cache ownership. + +A representative user interaction must have a physical-request budget. + +Synthetic integration tests increase data cardinality while asserting that network request count remains bounded rather than O(N). + +## 13. Retry Model + +### 13.1 Retry budget is interaction-scoped + +Retry count is not independently reset for every request. + +```text +Interaction retry budget = 2 +A consumes retry +B consumes retry +C cannot retry after budget exhaustion +``` + +This prevents multiple child requests from multiplying recovery traffic. + +### 13.2 Retry prerequisites + +Retries are allowed only when operation semantics permit them. + +The existing idempotency/replay semantics remain authoritative. + +### 13.3 Retry-After and jitter + +A `Retry-After` response must not synchronize all clients into a second spike. + +Effective scheduling combines server guidance with bounded jitter. + +## 14. Concurrency Budget + +Each interaction has bounded concurrent physical requests. + +Waiting work must be cancelable. + +Cancellation of an interaction must cancel or release: + +- queued requests, +- in-flight requests where possible, +- retry timers, +- concurrency leases, +- delayed telemetry associated only with that discarded interaction when safe. + +## 15. Deadline Propagation + +Timeouts do not reset after each retry or downstream call. + +A root deadline is established at interaction start. + +Each child computes remaining time: + +```ts +remainingMs = deadlineAt - now(); +``` + +A chain of retries therefore cannot turn a 5-second user operation into an unbounded 20- or 30-second operation. + +## 16. Request Deduplication and Coalescing + +Multiple consumers requesting the same logical resource concurrently should share compatible in-flight work. + +```text +10 consumers + -> 1 physical request + -> 10 subscribers +``` + +The existing TanStack Query infrastructure is a natural implementation foundation where its semantics match the operation. + +Deduplication must never merge requests across incompatible authentication, tenant, scope, locale, or cache identity boundaries. + +## 17. Error Model + +Errors are owned at the correct boundary. + +```text +Platform Error +Contract Error +Application / Domain Error +Presentation Mapping +``` + +### 17.1 Platform errors + +Examples: + +- network unavailable, +- request timeout, +- cancellation, +- response too large, +- unsupported content type, +- malformed transport response, +- traffic budget exceeded. + +### 17.2 Contract errors + +Contract failures identify violations at an external boundary: + +- schema mismatch, +- protocol mismatch, +- unsupported media type, +- missing required field, +- malformed payload. + +### 17.3 Domain/application errors + +Concrete business errors remain feature-owned. + +Example: + +```ts +type PaymentError = + | PaymentDeclined + | PaymentAlreadyProcessed + | PaymentLimitExceeded; +``` + +### 17.4 No global error union + +This is forbidden: + +```ts +type GlobalApplicationError = + | OrderError + | PaymentError + | ...; +``` + +Use local generic boundaries instead: + +```ts +Result +``` + +The platform understands only the common envelope. + +## 18. Error Envelope + +Unstructured `throw new Error("...")` is not the primary cross-layer error contract. + +Conceptual common metadata: + +```ts +interface AppError { + readonly kind: string; + readonly category: ErrorCategory; + readonly retryability: Retryability; + readonly severity: ErrorSeverity; +} +``` + +Concrete domain error semantics remain local. + +## 19. Presentation Error Mapping + +HTTP status codes and transport details must not leak into presentation logic. + +Bad: + +```ts +if (status === 409) { ... } +``` + +Preferred flow: + +```text +HTTP 409 + -> Transport/Contract interpretation + -> PaymentAlreadyProcessed + -> localized presentation message +``` + +## 20. Validation Boundaries + +Validation has distinct purposes: + +1. user-input validation, +2. transport validation, +3. domain invariant validation, +4. runtime configuration validation. + +Frontend validation improves UX but is never an authoritative security boundary. Backend validation remains authoritative. + +## 21. Validate Once at Trust Boundaries + +External data enters as unknown/untrusted data. + +```text +unknown HTTP body + -> size/content checks + -> parse + -> schema validation + -> Validated DTO + -> mapper + -> domain/application types +``` + +The same payload should not be repeatedly schema-validated at every internal layer without a specific trust-boundary reason. + +## 22. Validation Budget + +Validation itself has bounded cost. + +Before expensive parsing and validation, enforce structural constraints where possible: + +- maximum response bytes, +- maximum collection items, +- maximum string lengths, +- maximum allowed nesting/depth where relevant, +- bounded mapper output size. + +Oversized responses must be rejected before allocating or validating an arbitrarily large object graph. + +## 23. Telemetry Model + +Production frontend observability is required, but raw logging is not the architecture. + +The platform supports: + +- error reporting, +- real user monitoring, +- trace/correlation propagation, +- structured operational events, +- performance metrics. + +Feature code must not depend directly on a vendor SDK such as Sentry or Datadog. + +Conceptual port: + +```ts +interface TelemetryPort { + emit(event: TelemetryEvent): void; +} +``` + +Provider adapters live behind the platform boundary. + +## 24. Telemetry Ownership + +The platform owns a common envelope, not every feature event definition. + +Common metadata may include: + +- event name, +- severity, +- release, +- app/context/feature identifiers, +- interaction ID, +- trace/correlation identifiers, +- timestamp, +- safe attributes. + +Concrete event payload schemas remain feature-owned. + +No global telemetry event union containing every feature is allowed. + +> 2026-11-03 현재: 봉투(`src/platform/telemetry/telemetry-event.ts`)의 필드는 `kind`·`severity`·`contextId`·`featureId`·`interactionId`·`traceId`·`payload`다. +> 릴리스 식별자(`build_id`·`release_id`)는 수집기 adapter(`src/adapters/telemetry/telemetry-collector.ts`)가 붙인다. 시각과 app 식별자는 봉투에 없다. + +## 25. Telemetry Pipeline + +Required conceptual pipeline: + +```text +Feature event + -> normalize + -> redact + -> fingerprint + -> deduplicate + -> sample + -> bounded buffer + -> batch + -> rate limit + -> transport +``` + +All in-browser queues and maps are bounded. + +> 2026-11-03 현재: 코드의 순서는 봉투 검사 → redact → fingerprint → deduplicate → sample → buffer → rate limit → batch → transport다(`src/platform/telemetry/telemetry-pipeline.ts`). normalize 자리에 봉투 검사가 있고, rate limit이 batch보다 앞이다. + +## 26. Telemetry Must Fail Open for Business Behavior + +Telemetry failure must not fail application behavior. + +```text +business path +telemetry path +``` + +are separated. + +When telemetry capacity is exhausted, low-priority observability data is dropped rather than growing browser memory or blocking user operations. + +## 27. Telemetry Storm Protection + +A production incident may cause millions of browsers to report the same error simultaneously. + +The telemetry subsystem therefore requires: + +- deterministic or policy-driven sampling, +- repeated-error fingerprinting, +- bounded deduplication state, +- bounded batch size, +- bounded queue bytes/events, +- rate limiting, +- priority-based dropping. + +Observability must never amplify an incident into another outage. + +## 28. Telemetry Privacy and Redaction + +Feature authors must not be able to casually emit secrets. + +Runtime sanitization must reject/redact sensitive classes such as: + +- Authorization values, +- cookies, +- access tokens, +- refresh tokens, +- passwords, +- known secret fields. + +Typed safe payloads may be added where they improve correctness, but runtime defense remains required because compile-time types are not a security boundary. + +## 29. Trace and Correlation + +User interactions should connect browser events with backend traces where supported. + +```text +user interaction + -> interaction id + -> request trace/correlation metadata + -> backend trace + -> downstream dependency +``` + +Trace propagation must follow the chosen backend/OTel contract and must not invent incompatible identifiers independently per feature. + +> 2026-11-03 현재: 전파는 interaction이 켰을 때만 한다(`ExecutionContext`의 `trace`는 선택 필드). 헤더는 `traceparent`와 `x-correlation-id`다(`src/platform/telemetry/trace-context.ts`). + +## 30. Failure Boundaries + +Failure containment mirrors architecture ownership. + +```text +App Boundary + -> Context Boundary + -> Feature Boundary + -> Page Boundary where useful +``` + +Not every component gets an ErrorBoundary. Boundaries correspond to meaningful recovery/fallback domains. + +A payment UI failure should not necessarily destroy order, catalog, or account UI. + +## 31. Async Failure Model + +React render failures are only one class of failure. + +The architecture also models: + +- query failure, +- mutation failure, +- validation failure, +- timeout, +- cancellation, +- traffic-budget exhaustion. + +Presentation state should distinguish recoverable, terminal, and cancelled outcomes where useful. + +> 2026-11-03 현재: 화면 상태는 `src/application/view-models/async-state.ts`가 정한다. 기본 상태 `terminal-error`와 덧씌움 `stale-degraded`·`mutation-effect-unknown`·`mutation-conflict`가 있다. 취소만 따로 보여 주는 상태는 이 목록에 없다. + +## 32. Spike Traffic Design + +Spike scenarios include rapid jumps such as: + +```text +100 clients + -> 10,000 + -> 100,000+ +``` + +The frontend platform cannot control the number of users, but it must control client-side amplification. + +Critical risks: + +- retry storm, +- authentication refresh storm, +- cache-miss storm, +- telemetry storm, +- synchronized `Retry-After`, +- uncontrolled concurrency, +- duplicate requests. + +> 2026-11-03 현재: 이 절을 가리키는 테스트(`tests/platform/traffic/traffic-amplification.test.ts`)는 실패와 병렬 연산에서 요청·재시도 증폭만 본다. 인증 갱신 폭주와 cache-miss 폭주를 따로 재는 규모 테스트는 찾지 못했다. + +## 33. Sustained Traffic Design + +Long-running high traffic and long-lived SPA sessions expose different risks: + +- heap growth, +- timer/listener leaks, +- query cache churn, +- browser storage growth, +- stale auth/session state, +- repeated background polling, +- telemetry backlog, +- orphaned AbortControllers or tasks. + +Scale verification therefore includes soak-style tests and memory slope, not only peak request count. + +## 34. Amplification Metrics + +The platform test harness defines operational amplification metrics. + +### 34.1 Request amplification + +```text +physical HTTP requests / logical interactions +``` + +### 34.2 Retry amplification + +```text +total physical attempts / initial physical requests +``` + +### 34.3 Telemetry amplification + +```text +telemetry sends / logical failures or events +``` + +These are measured under healthy, slow, partial-failure, and total-failure conditions. + +## 35. Scale Profiles + +Synthetic scale profiles: + +```text +S0 100 +S1 1,000 +S2 10,000 +S3 100,000 +S4 1,000,000 +``` + +These do not all mean “generate that many TypeScript source files”. + +### S0-S1 + +Can exercise concrete module composition and type-check fixtures. + +### S2 + +Exercises larger generated indexes and composition structures when affordable. + +### S3-S4 + +Primarily verify global topology and local-boundary independence. They model one hundred thousand or one million logical features while asserting that any one app/context remains within local budgets. + +## 36. Local Scale Verification + +Within one allowed boundary, measure: + +- registry composition, +- route composition, +- generated index cost, +- TypeScript diagnostics, +- bundle/build cost, +- browser boot cost. + +Scale-sensitive composition should exhibit linear-or-better growth where linear work is unavoidable. + +Quadratic-like growth is a failure. + +> 2026-11-03 현재: 규모 측정(`scripts/scale/run-composition-scale.ts`, `scripts/scale/collect-tsc-diagnostics.ts`)은 registry·route 조립, 생성 색인, TypeScript 진단을 잰다. 번들·빌드 비용과 브라우저 부팅 비용은 이 측정에 없다(§40). + +## 37. Global Topology Verification + +Increase global logical cardinality while holding one app unchanged. + +Assertions: + +```text +Global feature count increases +but unchanged App A should not materially increase: +- TypeScript source graph +- initial bundle bytes +- initial routes +- initial runtime registries +- boot heap +- boot CPU +``` + +This is the critical proof that the architecture can extend toward 100K/1M logical domains. + +> 2026-11-03 현재: `tests/scale/global-local-independence.test.ts`는 생성 색인, 소스 그래프, 부팅 때 읽는 context 루트를 본다. 번들은 `check:app-build-input:bundle`이 "소유하지 않은 기능의 모듈이 없다"만 본다. 부팅 heap·CPU는 재지 않는다. + +## 38. TypeScript Scale Gate + +Use compiler diagnostics where supported, including `--extendedDiagnostics`. + +Track at least: + +- source file count, +- type count, +- symbol count, +- instantiations, +- memory, +- total type-check time. + +A global module augmentation or giant union that causes unrelated app compile cost to rise with global domain count is a design regression. + +## 39. Runtime Composition Scale Gate + +Benchmark relevant registries: + +- route, +- API operation, +- schema, +- mapper, +- invalidation, +- adapter contribution, +- runtime contribution, +- locale/message contribution. + +Test multiple N values to detect nonlinear regression. + +Absolute timing alone is insufficient; growth behavior matters. + +## 40. Browser Boot Gate + +Measure: + +- initial JS transferred, +- parsed/executed JS, +- initial route count, +- initial heap, +- bootstrap CPU, +- runtime config fetch, +- release manifest verification, +- first meaningful application render. + +Global topology growth must not cause proportional growth in these metrics for an unchanged app. + +> 2026-11-03 현재: 이 목록을 재는 부팅 게이트는 없다. 초기 JS gzip 크기만 `check:bundle`이 `config/performance/budgets.json`의 `initialJsGzipBytes`로 막는다. 초기 heap, 부팅 CPU, 첫 렌더, 초기 route 수는 재지 않는다. + +## 41. Request Fan-Out Gate + +Use representative collection pages with increasing server-returned cardinality: + +```text +N = 10 +N = 100 +N = 1,000 +``` + +A page that requires two bounded bulk requests should remain around that request count instead of issuing O(N) row-detail calls. + +> **Implementation note (2026-09-23).** The template's representative collection contract is a paginated bulk read with a hard page ceiling of 100 rows (`limit` ≤ 100, response schema `max(100)`). `N` above is the server-side collection cardinality, not the size of one response. Acceptance is therefore two-layered: +> +> - supported cardinality — collections of N = 10 / 50 / 100 / 1,000 rows load a page with **1** physical request, and a full 1,000-row walk costs ≤ ceil(N / 100) + 1 page requests, never one request per row; +> - oversized response — a single response carrying more than the page ceiling (e.g. 1,000 rows at once) is rejected within **1** request as a contract violation, with no per-row downstream fan-out. +> +> The ceiling is not raised to make an oversized fixture pass. A source gate (`pnpm check:request-fanout`) rejects any request dispatch inside a loop or array-iteration callback in feature/application code. + +## 42. Failure and Chaos Scenarios + +Required scenarios include: + +### Total API failure + +Verify: + +- retry bound, +- concurrency bound, +- telemetry bound, +- bounded memory, +- no infinite loop, +- no reload loop. + +### Partial failure + +Example: + +```text +Payment 100% failure +Order healthy +Catalog healthy +``` + +Payment should degrade without collapsing unrelated contexts. + +### Slow API + +Test long-tail latency. Verify deadlines, cancellation, concurrency queues, and queue limits. + +### Network flap + +Repeated online/offline transitions must not produce duplicate unsafe mutations or retry bursts. + +### Telemetry endpoint failure + +Business behavior remains functional and telemetry storage remains bounded. + +## 43. Telemetry Storm Test + +Generate a large number of identical errors/events. + +Expected behavior: + +```text +many logical errors + -> fingerprint/dedup/sample + -> bounded number of buffered/sent telemetry events +``` + +The test records emitted, deduplicated, sampled, dropped, and transmitted counts. + +## 44. Soak Testing + +Long-session profiles may include 30 minutes, 2 hours, 8 hours, or 24 hours depending on environment cost. + +Observe: + +- heap size and slope, +- active timers, +- event listeners, +- DOM nodes, +- query cache size, +- telemetry buffer, +- IndexedDB/browser storage, +- stale auth/session leakage. + +The primary leak signal is sustained positive growth after expected warm-up stabilization, not only an arbitrary maximum heap value. + +> 2026-11-03 현재: 브라우저 soak(`scripts/scale/browser-soak.ts`)은 nightly 단계에서 2분 돈다. heap, DOM 노드, listener, timer, 진행 중 fetch, Web Storage를 잰다. +> query cache와 telemetry buffer는 논리 테스트(`tests/scale/session/long-session.test.ts`)가 본다. IndexedDB는 재지 않고, 30분 이상 돌리는 실행은 없다. + +## 45. Horizontal Scaling and Release Coherence + +Frontend application instances are intended to remain stateless with respect to server-hosted browser user state. + +Horizontal scaling is safe only when release coherence is maintained. + +Deployment contract: + +- content-hashed assets are immutable, +- HTML is revalidated/no-cache according to current release strategy, +- runtime config and release manifest are no-store, +- old hashed assets remain available during rolling release windows, +- a deployment switches an active release tuple atomically, +- mixed incompatible HTML/config/manifest combinations fail closed rather than executing ambiguously. + +> 2026-11-03 현재: 불일치를 만나면 세션마다 한 번만 자동으로 다시 불러오고, 그 뒤의 불일치는 실패 화면으로 끝낸다(`src/platform/release/release-mismatch-recovery.ts`). 이 재시도는 원문에 없다. + +## 46. Multi-Replica Release Matrix + +At minimum verify: + +| HTML | Config | Manifest | Asset | Expected | +| --- | --- | --- | --- | --- | +| R10 | R10 | R10 | R10 | PASS | +| R10 | R11 | R10 | R10 | FAIL CLOSED | +| R10 | R10 | R11 | R10 | FAIL CLOSED | +| R10 | R10 | R10 | missing/incompatible | FAIL | +| R11 | R11 | R11 | R11 | PASS | + +Rolling deployments must also preserve reachability of previous immutable hashed assets for clients that loaded earlier HTML. + +## 47. CI Execution Tiers + +Heavy scale tests must not make every pull request unusably expensive. + +### Pull request + +Fast deterministic gates: + +- dependency architecture, +- cardinality budgets, +- unit tests, +- app/test type-check, +- small composition fixtures, +- duplicate collision tests, +- cross-feature dependency fixture, +- small request fan-out fixture. + +### Main branch + +Medium scale regression: + +- 1K/10K synthetic composition where appropriate, +- TypeScript diagnostic comparison, +- route/bootstrap growth checks, +- generated index validation. + +### Nightly + +Heavy synthetic and browser verification: + +- 10K/100K/1M topology model, +- browser memory and route loading, +- telemetry storm, +- failure scenarios, +- longer navigation/session cycles. + +### Release / dedicated environment + +Environment-dependent checks: + +- spike load, +- soak load, +- cache behavior, +- multi-replica mixed-release validation, +- CDN/LB/origin release contract. + +> 2026-11-03 현재: CI는 `pr` 단계만 돌린다(FE-GATE-005). `main`·`nightly`·`release`는 로컬 명령이다. 기준선 시간 비교가 그 기준선을 기록한 CPU에서만 성립하기 때문이다(`scripts/scale/run-scale-profile.ts`). + +## 48. Benchmark Result Format + +Scale results are machine-readable artifacts, not only console output. + +Example: + +```json +{ + "profile": "S2", + "globalLogicalFeatures": 10000, + "localFeatures": 150, + "routeCompositionMs": 3.21, + "typescriptMs": 4312, + "heapBytes": 1234567 +} +``` + +Store enough metadata to compare against a compatible baseline. + +> 2026-11-03 현재: 실제 형식은 `scripts/scale/benchmark-result.ts`의 `BenchmarkResult`(`name`·`profile`·`cardinality`·`samples`·`medianMs`·`heapBytes`·`metadata`)와 이를 담는 `BenchmarkArtifact`다. 위 JSON은 예시다. + +## 49. Regression Policy + +Use three kinds of thresholds: + +1. absolute ceiling, +2. relative regression percentage, +3. growth-complexity trend. + +Performance measurements should use multiple runs and robust summaries such as median where environment noise is relevant. + +Structural failures such as cycles, duplicate IDs, cross-feature concrete imports, or cardinality-budget violations are deterministic and should fail immediately. + +## 50. Required Architecture Gates + +The architecture must eventually provide automated gates for: + +1. cross-feature concrete import prohibition, +2. cross-context concrete import prohibition, +3. cycle prohibition, +4. cardinality budgets, +5. duplicate feature/route/operation/schema IDs, +6. O(N²)-style registry regression, +7. request fan-out regression, +8. retry-budget enforcement, +9. telemetry-buffer boundedness, +10. global-to-local scale independence, +11. TypeScript/build scale regression, +12. multi-replica release coherence. + +> 2026-11-03 현재: 1~3번은 `.dependency-cruiser.json`의 `features-do-not-import-other-features`, `contexts-do-not-import-other-contexts`, `no-circular-dependencies`다. 11번(TypeScript 규모)은 `main` 단계에만 있어 CI에서 돌지 않는다(§47). + +## 51. Compatibility With Current Template Strengths + +This design preserves and extends current strengths rather than replacing them: + +- Clean Architecture layer rules, +- capability-driven adapter composition, +- HTTP operation contracts, +- bounded response handling, +- retry/idempotency semantics, +- TanStack Query cache ownership, +- scope fencing/generation behavior, +- release/build/config coherence, +- immutable static asset release model. + +The implementation should refactor composition and introduce platform policies without unnecessary UI/design changes. + +## 52. Explicit Non-Goals + +This design does not require: + +- one SPA containing 1M TypeScript features, +- runtime discovery of arbitrary remote code, +- Module Federation or micro-frontends as the default starting point, +- a global mega-registry, +- a global mega-error union, +- a global telemetry schema union, +- vendor-specific observability APIs in feature code, +- frontend validation as a replacement for backend validation. + +Remote/micro-frontend deployment can remain an optional future escalation when organizational or deployment boundaries require independent teams/releases. It is not required to solve the current scaling architecture. + +## 53. Implementation Sequence Constraints + +Implementation should be incremental and preserve behavior. + +A safe high-level sequence is: + +1. establish deterministic architecture/scale tests around current behavior, +2. remove known O(N²) and repeated-membership composition paths, +3. introduce feature-owned descriptor boundaries, +4. generate static product/context indexes, +5. enforce cross-feature/context dependency rules, +6. introduce hierarchical route composition, +7. introduce cardinality budgets, +8. introduce execution context and traffic budgets, +9. normalize error and validation boundaries, +10. introduce telemetry port/pipeline/budgets, +11. add scale/chaos/soak/release gates by CI tier. + +The detailed implementation plan must decompose these into test-first tasks and identify exact existing files after re-reading the live repository state. + +## 54. Acceptance Criteria + +The design is considered implemented only when all of the following are true: + +- Adding a normal feature does not require editing a collection of central handwritten installation registries. +- Composition does not contain known quadratic accumulation patterns. +- Membership checks on scale-sensitive paths use appropriate indexed structures. +- Concrete imports across unrelated features fail architecture checks. +- Context/app cardinality ceilings are explicit and testable. +- An unchanged local app does not grow materially when global logical topology grows toward S3/S4 fixtures. +- Initial routing is hierarchical/lazy rather than a product-wide flat feature table. +- User interactions carry bounded request, retry, concurrency, cancellation, and deadline semantics. +- Representative collections do not create frontend N+1 request fan-out. +- Errors remain local and typed without constructing a global union of all feature errors. +- External data is validated at trust boundaries with bounded payload/structure cost. +- Feature code emits observability through a platform port rather than vendor SDKs. +- Telemetry is redacted, deduplicated, sampled, buffered, and rate-limited with bounded memory. +- Telemetry failure does not fail business behavior. +- Failure boundaries prevent one feature/context from unnecessarily collapsing unrelated UI. +- Spike and sustained-load tests detect request, retry, telemetry, and memory amplification. +- Multi-replica release tests verify fail-closed coherence and old-asset reachability. + +## 55. Design Summary + +The architecture is based on one rule: + +> Global scale must be partitioned into bounded local scale, and every remaining local cardinality must have an explicit budget. + +Therefore the platform avoids: + +```text +unbounded registry +unbounded compile graph +unbounded route graph +unbounded request fan-out +unbounded retries +unbounded concurrency +unbounded payloads +unbounded validation +unbounded telemetry +unbounded memory growth +unbounded failure propagation +``` + +This allows the product ecosystem to grow from hundreds toward hundreds of thousands or millions of logical domains without requiring a single browser, TypeScript compiler invocation, router, or runtime registry to directly carry that global cardinality. diff --git a/docs/architecture/server-file-capability-infrastructure.md b/docs/architecture/server-file-capability-infrastructure.md index 9a20b9c5..c02dfa2d 100644 --- a/docs/architecture/server-file-capability-infrastructure.md +++ b/docs/architecture/server-file-capability-infrastructure.md @@ -1,10 +1,22 @@ # Server file capability infrastructure handoff -- 상태: 설계 완료, 서버 구현 대기 +- 상태: 설계 완료. 짝 백엔드 템플릿은 구현하지 않음(2026-09-25 제거) - 목표 상태: `AVAILABLE_NOT_COMPOSED` -- 대상: 이후 서버 template 또는 제품 backend에서 구현할 공통 file capability +- 대상: 제품 backend가 직접 구현할 공통 file capability - 비대상: 제품 domain, 제품 use case, HTTP route/controller, provider 선택 -- 기준일: 2026-07-28 +- 기준일: 2026-07-28 (상태 줄은 2026-11-04에 고침) + +> **짝 백엔드와 맞지 않는다.** 짝 백엔드 템플릿(`clean-architecture-backend-template`)은 +> 2026-09-25에 presigned·direct multipart 코드를 지웠다(그 repo의 +> `docs/storage-capability-boundary.md`, `docs/capability-status.md` 「제거된 코드」). +> 그래서 이 문서의 server port와 프론트 `PRESIGNED_MULTIPART_V1` 레시피를 받는 서버가 +> 짝 백엔드에는 없다. 짝 백엔드는 파일을 자기 Fileserver가 직접 받는다 +> (`POST /v1/files` multipart 한 번, `POST /v1/files:raw`, tus `/v1/uploads`). +> 두 템플릿을 그대로 쓰는 업로드는 짝 백엔드 Fileserver로 올리는 것이다. 프론트 client는 +> `src/adapters/http/fileserver-upload.ts`의 `createFileserverUploadClient`(`POST /v1/files`)다. +> 고르는 기준과 기능에 붙이는 법은 +> `docs/manual/02-decision-tables.md` 「파일 업로드」에 있다. 이 문서는 제품 backend가 +> presigned 경로를 직접 만들기로 할 때의 설계로 남긴다. 이 문서는 frontend에 준비된 File/Blob/picker/download capability와 이후 연결할 서버측 기반을 정의한다. 서버는 object storage, multipart, integrity, diff --git a/docs/architecture/starter-experience.md b/docs/architecture/starter-experience.md index d47dc836..8c7967ad 100644 --- a/docs/architecture/starter-experience.md +++ b/docs/architecture/starter-experience.md @@ -51,6 +51,18 @@ An external owner implements `readState`, `readSubject`, `subscribe`, lacks any of these methods is rejected, and the session fails closed as `integration-failed`. +The state transitions an owner makes, and what `recover()` leaves behind for +each answer, are written on `SessionState` and `SessionGateway.recover` in +`src/application/ports/auth-session-port.ts`. For the paired backend's two +authentication modes there are owners to copy, not to write: +`recipes/session-owners/oidc-pkce-session-owner.ts` (JWT mode: Keycloak, +authorization code with PKCE, `EXTERNAL_BEARER`) and +`recipes/session-owners/cookie-session-owner.ts` (Redis session mode: the +session cookie, plus `SESSION_COOKIE_*` profiles and the `X-XSRF-TOKEN` +provider). `docs/manual/04-paired-backend-session.md` wires them and lists +what the backend template does not ship (a browser client in its realm; the +sign-in, sign-out and session endpoints). + `readSubject()` is required. The server-state cache is cleared only when the session state or the subject changes, so a token refresh for the same user keeps cached data. `readSubject()` must return: @@ -83,6 +95,35 @@ and the [TypeScript, state, and data-flow target](./typescript-state-and-data-flow.md) rather than adding another independent route or data-loading convention. +### Replacing the starter screens + +`/` (`src/presentation/pages/home-page.tsx`) is the platform's `APP_HOME`; a +feature takes it over by declaring that route id (see "Product home and +layouts"). Its starter links are the first three screens of the navigation. + +The example screens `/examples/ui`, `/examples/states` and `/examples/auth` +are one feature, `src/features/platform-examples-feature/`, in its own context +`src/contexts/platform-examples-context/` (1103/09-04). A product turns them +off like any feature: leave the id out of `VITE_PRODUCT_FEATURES`, or remove +it with `corepack pnpm test:sample-removal -- --feature=platform-examples-feature` +as the drill. Their routes then leave the registry, the navigation, the +bundle and the manual accessibility list (FE-GATE-028). Their component tests +are in `tests/features/platform-examples-feature/` and go with them. + +The platform overview (`/examples/platform`, +`src/presentation/examples/platform-overview-page.tsx`) stays a platform +route. It describes the installed registries, and the lab gate (FE-GATE-026) +times entering it: a feature route's first entry also loads its context's +routes module before the page, a second request round the 200 ms budget does +not fit. Its tests are the `tests/component/starter-*.test.tsx` files. + +The platform's component tests (router, boundaries, shell, runtime tree) run +on the pages of the test-only feature in `tests/helpers/fixture-feature.tsx` +and keep passing without the examples. The browser-level checks in +`tests/e2e` and `tests/visual` use the example screens as their pages and run +where the examples are installed: a product that leaves them out points those +specs at its own screens or deletes them. + ### Ownership declarations Features, contexts and apps are discovered by @@ -94,7 +135,9 @@ parent, as exported string or integer literals the generator reads: | `src/apps//app-module.ts` | `APP_MODULE_ID`, `APP_MAX_CONTEXTS` | | `src/contexts//context-module.ts` | `CONTEXT_MODULE_ID`, `CONTEXT_APP_ID`, `CONTEXT_ROUTE_PATH`, `CONTEXT_MAX_FEATURES` | | `src/features//feature-module.ts` | `FEATURE_MODULE_ID`, `FEATURE_CONTEXT_ID`, `FEATURE_MODULE` | +| `src/features//feature-runtime.ts` | `FEATURE_RUNTIME` (imported only by `feature-module.ts`, dynamically) | | `src/features//context-routes.ts` | `FEATURE_CONTEXT_ROUTES` | +| `src/contexts//context-layout.tsx` (optional) | `CONTEXT_LAYOUT`, the context's own layout ("Product home and layouts") | The generator writes `src/.generated/` (git-ignored): the feature index the installed catalogs import, the context index the router loads lazily, and the @@ -102,8 +145,8 @@ selected app. Every build and check script runs it first; run it yourself with `corepack pnpm generate:feature-index`. It fails, naming the file, when: - a directory under `src/features/` has no `feature-module.ts` and no - `NOT_INSTALLED` marker file (`src/features/local-draft-feature/NOT_INSTALLED` - is the one intentional example); + `NOT_A_FEATURE` marker file (`src/features/local-draft-feature/NOT_A_FEATURE` + is the one intentional example), or has both; - a feature names an undeclared context, or a context an undeclared app; - a context or app exceeds its declared budget; - `VITE_PRODUCT_FEATURES` names a feature the app does not declare. The @@ -112,39 +155,133 @@ selected app. Every build and check script runs it first; run it yourself with ### Adding a feature 1. Create `src/features//feature-module.ts`. Build `FEATURE_MODULE` - with `defineFeatureModule` (`src/features/feature-module.ts`): the feature's - contract (routes, route runtime contracts, API operations, invalidation, - schemas, runtime schemas, mappers), its adapter contributions + with `defineFeatureModule` (`src/features/feature-module.ts`). This is the + feature's declaration, and it is in the initial chunk, so it holds data + only: the declaration contract (routes, route runtime contracts, + invalidation, topic versions and the external `contractPackages` the + release manifest is checked against at boot), its message catalogs, and + `loadRuntime`, which imports `feature-runtime.ts` dynamically. + The reference sample's feature-module.ts (src/features/reference-feature, + while it is installed) is the complete example. +2. Create `src/features//feature-runtime.ts` with + `defineFeatureRuntime`: the `schemas` (FE-REG-SCHEMA rows for the + feature's route and API schemas), the adapter contributions (`defineFeatureAdapterContribution`, with `needs` naming the platform - capabilities it receives), its runtime descriptor (route codecs), its message - catalogs and its contract contributions. - `src/features/reference-feature/feature-module.ts` is the complete example. -2. Create `src/features//context-routes.ts` exporting - `FEATURE_CONTEXT_ROUTES`. Page components are imported lazily here; the - owning context loads this file only when its route root is visited - (`src/features/reference-feature/context-routes.ts`). -3. Name the owning context in `FEATURE_CONTEXT_ID`. Use an existing context or + capabilities it receives) and the contract contributions (the HTTP + operations). The router loads + it (`application.features.load`) when one of the feature's routes is + entered. Do not import it statically from anywhere: each feature would add + its whole executable code to the initial chunk again, about 3.9 KB gzip + (tests/unit/feature-shape-growth.test.ts, which goes with the reference + sample, bounds one feature at 1 KiB). + An HTTP API is written once, as its contract contribution descriptor: it + executes, and `check:registries` governs the FE-REG-API row projected from + it (`projectApiOperationRows` in `src/contracts/api-operations.ts`). + A product feature's contract contribution uses an `EXTERNAL_PACKAGE` + source. `TEMPLATE_FIXTURE` belongs to `reference-feature` only and never + joins the release contract set; the composer rejects it anywhere else. +3. Create `src/features//context-routes.ts` exporting + `FEATURE_CONTEXT_ROUTES`. Page components are imported lazily here, and each + route handle carries the route's params/search `codecs`; the owning context + loads this file only when its route root is visited + (the reference sample's context-routes.ts shows one). Each handle's + `routeId` must be a route of a feature contract in the same context; the + context refuses the routes when they load, naming the route, context and + features (`src/contexts/bounded-context-module.ts`). +4. Name the owning context in `FEATURE_CONTEXT_ID`. Use an existing context or add `src/contexts//context-module.ts` owned by the app. -4. If the feature has application input, augment `ApplicationFeatureInputs` + Every route path in the feature contract must sit at or under that + context's `CONTEXT_ROUTE_PATH` and must not fall under another context's + identical or more specific root: the router renders feature routes only + inside the owning context. No platform route may answer it either: the + router tries `AppShell`'s platform routes first, so the same path as a + platform route, `/` under an id other than `APP_HOME`, or a `*` root + without a layout (the not-found route takes every URL) never renders the + feature. The app module refuses anything else when it loads, naming the + route, feature and context (`src/apps/deployable-app-module.ts`). A route + that takes over the platform home is the exception ("Product home and + layouts"). +5. If the feature has application input, augment `ApplicationFeatureInputs` from the feature (`src/features/local-draft-feature/application/local-draft-api.ts`). -5. Run `corepack pnpm check:architecture`, `corepack pnpm check:types`, +6. Run `corepack pnpm check:architecture`, `corepack pnpm check:types`, `corepack pnpm check:registries` and the tests. `tests/unit/two-feature-install-typecheck.test.ts` keeps the installed catalogs compiling with more than one feature. -6. Run `corepack pnpm test:sample-removal -- --feature=` to prove +7. Run `corepack pnpm test:sample-removal -- --feature=` to prove the product still builds and passes its gates without the feature. -Files outside the feature directory: +Files outside the feature directory. Everything else a feature needs is in +`src/features//` and `tests/features//`. -| File | Change | -| --- | --- | -| `src/.generated/*` | regenerated automatically | -| `src/contexts//context-module.ts` | only when the feature needs a new context | -| `config/runtime/.json` | optional `FEATURE_OVERRIDES` entry to switch the feature off | -| `src/bootstrap/runtime-adapters.ts` | only when `needs` includes `indexedDb`: add the capability, built as in `recipes/frontend-capabilities/indexeddb-feature-capability.ts` | +| File | When | What fails without it | +| --- | --- | --- | +| `src/.generated/*` | never by hand: every build and check script regenerates it | — | +| `src/contexts//context-module.ts` | the feature needs a new context | `generate:feature-index`: `Feature belongs to undeclared context ` | +| `src/contexts//context-layout.tsx` | the context needs its own frame instead of `AppShell` (see "Product home and layouts" below) | nothing: without it the context renders in `AppShell` | +| `artifacts/tests/a11y-manual/.md` | every route the feature adds. Copy a record and reset it to `Status: pending-manual-review` | `test:unit` (`tests/unit/manual-a11y-evidence.test.ts`), `verify:documentation` (names the route IDs) and FE-GATE-009 (`review:a11y-manual -- --format-only`). FE-GATE-028 requires the signed review at release | +| `tests/e2e/accessibility.spec.ts` | never per feature (1103/16-03): it fills every path parameter with one value and answers each API request from the installed descriptor, a list read with an empty list in its `responseEnvelope` frame. Edit it only for a protected page that sends something other than an installed GET before it renders | `test:a11y` (FE-GATE-009): a request no installed GET declares fails the route; so does an alert box (`role="alert"`) on a page that read only lists | +| `src/features/product-capabilities.ts` (product-owned) | `needs` names a capability the template does not build: type it in `ProductFeaturePlatformCapabilities`. `FeaturePlatformCapabilities` extends it, so the app, scripts and tests typecheck programs all see the key (an augmentation inside `product-composition.ts` is not seen by the scripts' program) | `check:types`: `Type '""' is not assignable to type 'keyof FeaturePlatformCapabilities'` in the feature | +| `src/bootstrap/product-composition.ts` (product-owned) | `needs` names a capability the template does not build: return the capability here, typed in `product-capabilities.ts`. `indexedDb` is built as in `recipes/frontend-capabilities/indexeddb-feature-capability.ts`. Credentials for a product auth profile are returned here too. A product that owns the session (a BFF's httpOnly cookie) returns its session owner from `composeProductSessionOwner` instead of installing it on the host global before boot | `check:types`; at runtime `feature needs , which the host did not provide`. Without the session owner, `AUTH_MODE: "external"` boots with the session `integration-failed` | +| `src/contracts/product-contracts.ts` (product-owned) | a product auth profile, or a product runtime-config key and its FE-REG-ENV row (`PRODUCT_ENV_REGISTRY`) | auth profile: every gate that loads the operation, with `Installed contract contribution is not composable: /: unknown authProfileId `. Config key: `check:types` where it is read. Give the key a `.default()` or make it `.optional()`: template tests build their config with `tests/helpers/runtime-config.ts`, which fills the product's defaults, and a required key without a default fails them. FE-REG-ENV row: `check:registries` checks its fields, and `tests/unit/env-registry-coverage.test.ts` (`test:unit`) requires a row for every key, with the schema's `required` and `defaultValue` | +| `config/runtime/.json` | optional: a `FEATURE_OVERRIDES` entry switches the feature off | nothing | +| `package.json`, the lockfile, `config/security/dependency-change-evidence.json` | the contract contribution imports a generated `@org-contracts/*` package as a production dependency | `generate:supply-chain` (in `check:bundle`): `high-risk dependency missing review: add:` | The central catalogs (`src/features/installed-*.ts`) and the registry governance file do not change: consumer directories there are globs over every feature (`src/features/*/adapters`, `config/contracts/registry-governance.json`). +A route's params/search schema ids are checked against the schemas the feature +registers, and its `loadingSurface` only has to be a kebab-case name, so a +route with its own schema and loading surface needs no governance edit either. +The registry baseline does not change either. New routes, API operations, +schemas and invalidation topics, namespaces and edges are additive registry +changes; `update:registry-baseline` or breaking evidence is needed only to +remove or change a row or graph item. +`tests/unit/second-api-feature-registries.test.ts` adds such a feature (an API +operation, a route with its own search schema and loading surface, and an +invalidation topic) to a copy of the repository and runs `check:registries` on +it. + +Schema, operation, mapper, route and chunk ids and invalidation topics are +global. Prefix them with the feature; `create:feature` writes +`NoRequest`, so a bare `NoRequest` would collide between features. MSW scenarios for the feature's own operations come from +`createHttpScenarioHandler` (`tests/mocks/handlers/http-scenarios.ts`) with +the feature's installed contract; the shared scenario catalog does not change. + +### Product home and layouts + +A product whose home is a feature screen, or whose screens use a frame other +than `AppShell`, declares it. The router and the catalogs do not change. + +- **Home.** A feature takes over the platform home by declaring a route with + the id `APP_HOME` in its contract. The platform names the routes a feature + may take over (`FEATURE_REPLACEABLE_PLATFORM_ROUTE_IDS` in + `src/contracts/routes.ts`); any other platform route id is still a + duplicate. Two features declaring `APP_HOME` fail when the catalogs load, + naming both. The router mounts the route at its own path with the owning + context, whatever that context's route root. Leaving the feature out of the + build (`VITE_PRODUCT_FEATURES`) brings the platform home back; switching it + off at runtime shows the disabled-feature page at its path. +- **Layout.** A context with `src/contexts//context-layout.tsx` + exporting `CONTEXT_LAYOUT` (a component) renders under that layout instead + of `AppShell`. The generated index loads the file lazily, when one of the + context's routes is entered. The router mounts the context at each + registered path of its features under the layout, so an unknown URL still + gets the not-found page in `AppShell`. Contexts whose layout files export the + same component keep one layout instance when the user moves between them, + so several route roots can share a layout. +- **Accessibility.** The layout renders a skip link to `#main-content` and + exactly one `
` around ``. + The router moves focus there on every route change. Layout routes are + siblings of `AppShell`, never inside it. + `tests/component/layout-landmarks.test.tsx` renders `AppShell` and the + layout of every installed context and fails one without them. +- **Failures.** A layout chunk a deploy removed gets the reload-once recovery + of a route chunk. Route and feature boundaries work as they do in + `AppShell`. +- The route root rule of step 4 spans every layout: a root takes the URLs + under it whichever layout either context has. + +`tests/component/context-layouts.test.tsx` installs a product declared this +way (`tests/helpers/fixture-layout-product.tsx`). ### Before shipping diff --git a/docs/architecture/static-delivery.md b/docs/architecture/static-delivery.md index 130739e0..f6765dd2 100644 --- a/docs/architecture/static-delivery.md +++ b/docs/architecture/static-delivery.md @@ -29,10 +29,34 @@ sequenceDiagram CI->>Browser: boot, route, API, and reload-loop smoke ``` -In this repository the workflow stops at promotion. The upload, pointer switch -and smoke steps above belong to the project's provider adapter; after it has -deployed the promoted release, FE-GATE-019 probes the live headers (review -13-05, [`release-cache-rollback.md`](../operations/release-cache-rollback.md)). +In this repository the workflow deploys nothing. The upload, pointer switch +and smoke steps above belong to the project's provider adapter, which fills the +`deployment` job between `promotion` and `production_gate`. After it has +deployed the promoted release, FE-GATE-019 probes the live headers and checks +that the host serves that release; while the slot is empty FE-GATE-019 is +`UNVERIFIED` (reviews 13-05, 1101/13-01, +[`release-cache-rollback.md`](../operations/release-cache-rollback.md)). Rollback changes the active pointer only after confirming that the prior immutable release has a coherent HTML/assets/config/API/manifest tuple. + +Serve the app over HTTP/2 or later. The entry preloads every initial +JavaScript file in parallel (`initialJsFiles` in +`config/performance/budgets.json` bounds how many; the current count is +`initialJavascript.files` in config/scale/feature-shape-ceilings.json, which goes with the sample feature). Over HTTP/1.1 they queue for six connections per +host, and the first screen on Fast 3G came about one second later than with the +initial chunks grouped (2026-11-03). Over HTTP/2 the difference was under +100 ms, so the template keeps the chunks split. A product that can only serve +HTTP/1.1 groups its initial chunks in `vite.config.ts` and measures again +whenever the shell changes ("초기 청크 수와 HTTP/1.1" in +[`performance-evidence.md`](../operations/performance-evidence.md), review +1101/14.4). + +Serve JavaScript compressed (gzip, brotli or zstd). The bundle budget counts +gzip bytes; uncompressed, the initial JavaScript is about three times larger. +Both premises are declared in `config/hosting/cache-policy.json` +(`transport.alpnProtocols`, `hashedAsset.contentEncodings`), and the live probe +of FE-GATE-019 fails a host that does not meet them (review 1103/13-02). The +nginx example in +[`release-cache-rollback.md`](../operations/release-cache-rollback.md) turns +both on. diff --git a/docs/architecture/typescript-state-and-data-flow.md b/docs/architecture/typescript-state-and-data-flow.md index 9e77d838..ae7df761 100644 --- a/docs/architecture/typescript-state-and-data-flow.md +++ b/docs/architecture/typescript-state-and-data-flow.md @@ -322,15 +322,29 @@ export function useResourcesQuery(input: ListResourcesInput) { ```ts export function useCreateResourceMutation() { const application = useApplication(); + const scope = useServerStateScope(); return useApplicationMutation({ - execute: (command: CreateResourceCommand) => - application.resources.create(command), + definitionId: "resource-create-v1", + definitionVersion: 1, + operationId: "CREATE_RESOURCE", + requiresIdempotencyKey: true, + owner: RESOURCE_FEATURE_ID, + duplicatePolicy: "REJECT_WHILE_ACTIVE", invalidate: [RESOURCE_INVALIDATION_TOPIC], + scope, + execute: (command: CreateResourceCommand, context) => + application.resources.create(command, context), }); } ``` +`useApplicationMutation`은 bound 정의(`BoundMutation`)만 받는다(1101/08-03). +`{ execute }`만 넘기는 raw 형태는 멱등 키와 scope 확인 없이 쓰기를 보내고 +결과 불명 뒤 "다시 보내기"가 아무것도 하지 않아 타입에서 막는다. 실제 정의는 +`src/features/reference-feature/presentation/use-reference-feature.ts`의 +`REFERENCE_CREATE_MUTATION_POLICY`를 본다. + 기본 mutation은 navigation만으로 취소됐다고 가정하지 않는다. 서버 작업의 취소가 안전한 operation만 controller가 보관한 `AbortController`와 명시적 cancel action을 사용한다. idempotency key는 UI 입력으로 받지 않고 application use case가 diff --git a/docs/contracts/compatibility.md b/docs/contracts/compatibility.md index 46ec1b18..5d1337b2 100644 --- a/docs/contracts/compatibility.md +++ b/docs/contracts/compatibility.md @@ -20,15 +20,15 @@ reader that accepts it must ship before any writer sends it. | Boundary | Reader policy | Adding a field or value | Code | |---|---|---|---| -| Runtime config V2 (`/config.json`) | strict object; `CONFIG_SCHEMA_VERSION` is the literal `"2.0"` | breaking | `src/contracts/release-artifacts.ts:163-171` | -| `CAPABILITY_OVERRIDES` | strict; unknown capability rejected | breaking | `src/contracts/release-artifacts.ts:50-63` | -| `FEATURE_OVERRIDES` | record; unknown feature id ignored | additive | `src/contracts/release-artifacts.ts:65-80` | -| Release manifest V2 | strict object | breaking | `src/contracts/release-artifacts.ts:200-208` | -| HTTP V2 success/failure envelope | strict object (`meta` strips) | breaking | `src/adapters/http/schema-registry.ts:12-34` | -| HTTP V3 response DTO (reference feature) | `.strip()` drops unknown fields | additive | `src/features/reference-feature/contracts/reference-schemas.ts:29-35` | -| Realtime envelope | exact key set; unknown `eventType` is `MALFORMED_EVENT` | breaking | `src/adapters/realtime/event-codec.ts:126,149` | -| Browser RPC transport error code | closed vocabulary; unknown code is a protocol violation | breaking | `src/adapters/browser-rpc/browser-rpc-runtime.ts:1473` | -| Persisted client storage | versioned key; incompatible value discarded | use a new key version | `src/contracts/storage-keys.ts:138-140` | +| Runtime config V2 (`/config.json`) | strict object; `CONFIG_SCHEMA_VERSION` is the literal `"2.0"` | breaking | `runtimeConfigV2ArtifactSchema` in `src/contracts/release-artifacts.ts` | +| `CAPABILITY_OVERRIDES` | strict; unknown capability rejected | breaking | `capabilityOverrideArtifactSchema` in `src/contracts/release-artifacts.ts` | +| `FEATURE_OVERRIDES` | record; unknown feature id ignored | additive | `featureOverrideArtifactSchema` in `src/contracts/release-artifacts.ts` | +| Release manifest V2 | strict object | breaking | `releaseManifestV2ArtifactSchema` in `src/contracts/release-artifacts.ts` | +| HTTP success/failure envelope (V3 with `responseEnvelope: "ENVELOPE_V1"`) | strict object (`meta` strips) | breaking | `successEnvelopeSchema`, `failureEnvelopeSchema` in `src/adapters/http/backend-envelope.ts` | +| HTTP V3 response DTO (reference feature) | `.strip()` drops unknown fields | additive | `referenceResourceDtoSchema` in the reference sample's contracts/reference-schemas.ts | +| Realtime envelope | exact key set; unknown `eventType` is `MALFORMED_EVENT` | breaking | `decodeUnsafe` in `src/adapters/realtime/event-codec.ts` | +| Browser RPC transport error code | closed vocabulary; unknown code is a protocol violation | breaking | `decodeTransportFailure` in `src/adapters/browser-rpc/browser-rpc-runtime.ts` | +| Persisted client storage | versioned key; incompatible value discarded | use a new key version | `defineStorageKey` in `src/contracts/storage-keys.ts` | `CAPABILITY_OVERRIDES` and `FEATURE_OVERRIDES` differ on purpose. Feature ids vary per build because each downstream project installs its own features, and @@ -39,7 +39,7 @@ addition. ## Schema change classifier and FE-GATE-014 -`classifyObjectSchemaChange` (`src/contracts/compatibility.ts:110`) answers +`classifyObjectSchemaChange` (`src/contracts/compatibility.ts`) answers for a reader built against `before`. It is fail-closed: only a new property under a reader without `additionalProperties: false` is `additive`. A removed or changed property (type, enum, nullable, format, ...), a different required diff --git a/docs/manual/01-add-a-feature.md b/docs/manual/01-add-a-feature.md new file mode 100644 index 00000000..6128b020 --- /dev/null +++ b/docs/manual/01-add-a-feature.md @@ -0,0 +1,670 @@ +# 01. 새 기능 추가하기 — 0~11단계 + +핵심은 둘이다. + +- 뼈대는 손으로 만들지 않는다. `corepack pnpm create:feature `로 만든다. +- 뼈대를 실제 기능으로 바꾸는 순서가 아래 0~11단계다. + +참조 기능(src/features/reference-feature/)을 복사해 이름을 바꾸는 방법은 쓰지 않는다. +그 방법은 접두어 없는 전역 ID, 참조 전용 계약 출처, 기능 밖 테스트 의존 때문에 여러 번 막힌다. +생성 명령은 이 문제를 미리 피한 파일을 쓴다. + +## 전체 흐름 + +```text +0 경계 정하기 (기존 context? 새 context?) + → 1 create:feature로 뼈대 만들기 + → 2 도메인 모델 (선택) + → 3 API 계약 + → 4 application input + → 5 HTTP 어댑터와 조립 기여 + → 6 라우트 + → 7 쿼리·뮤테이션 + → 8 페이지 + → 9 기준선과 증거 + → 10 테스트 + → 11 제거 확인 +``` + +1단계의 생성 명령이 3~8단계와 10단계의 가장 작은 판을 한 번에 만든다. + +- 라우트 1개 (파라미터 없는 목록) +- GET 1개 (`SAFE`, `EXTERNAL_BEARER`). 경로는 짝 백엔드 `new-feature.sh`와 같은 `/`이다 +- 쿼리 1개와 무효화 topic 1개 +- `CollectionPage` 페이지 1개와 ko-KR·en-US 문구. 결과 수는 백엔드가 보낸 `meta.page.total`이다 +- 테스트 3개와 테스트용 앱 파일 1개 (application input 단위 테스트, 라우터를 거치는 페이지 테스트, 백엔드 본문을 적은 gateway 테스트, `-test-app.tsx`) + +`--with-create`를 주면 짝 백엔드 `new-feature.sh`가 만드는 나머지 두 엔드포인트를 함께 만든다. + +- 상세 GET(`GET //{id}`)과 `DetailPage` 상세 페이지 +- 작성 POST(`POST /`, 201)와 `FormPage` 작성 폼, 결과 불명 화면 +- 작성 폼 테스트: 201 저장 뒤 상세 열기, 400 `_INVALID`를 이름 칸에 보이고 다시 저장, 응답을 잃은 저장 +- 작성은 기본이 `NEVER`다. 백엔드 생성기의 create가 `NOT_IDEMPOTENT`라서다. 백엔드 create를 KEYED로 바꿨으면 `--keyed`를 함께 준다([02 결정표 3절](02-decision-tables.md#3-재시도-의미)). + +그래서 3~8단계는 "처음부터 쓰기"가 아니라 "생성된 파일을 실제 계약과 화면으로 바꾸기"다. + +## 단계마다 적은 것 + +- ① **정할 것**: 이 단계에서 고르는 값과 선택지. +- ② **기준**: 무엇을 보고 고르나. 표가 필요한 판단은 [02 결정표](02-decision-tables.md)에 있다. +- ③ **잡는 검사 / 못 잡는 것**: 실수했을 때 어느 명령(게이트 ID)이 어떤 메시지로 잡는가. "못 잡음"은 이 커밋의 검사가 잡지 못한다는 뜻이다. 메시지 전체는 [reference/errors.md](reference/errors.md)에 있다. +- ④ **쓸 스킬**: AI 에이전트가 부를 스킬. + +--- + +## 0단계. 경계와 소속 정하기 + +① **정할 것** + +- 기존 context에 넣을지, 새 context를 만들지. + - context: 같은 URL 앞부분(라우트 루트) 아래에서 함께 지연 로드되는 기능 묶음이다. +- 기능 ID. 케밥 표기만 쓴다. 소문자 단어를 `-`로 잇는 꼴이다(`invoice-feature`). + +② **기준** + +- context 판단은 [02 결정표 1절](02-decision-tables.md#1-context-경계)과 원칙 1을 본다. +- 기능 ID는 네 곳에 같은 문자열로 들어간다. 나중에 바꾸기 어렵다. + - `feature-module.ts`의 `FEATURE_MODULE_ID` + - 계약의 `featureId` + - `ApplicationFeatureInputs`의 키 + - `config/runtime/.json`의 `FEATURE_OVERRIDES` 키 +- ID가 `-feature`로 끝나면 생성 명령은 그 앞부분을 접두어로 쓴다. `invoice-feature`면 `invoice`, `INVOICE_`, `Invoice`다. +- 근거: `scale-architecture.md` §5(모듈 소유), §7(개수 예산), §9(라우터 구조). + +③ **잡는 검사 / 못 잡는 것** + +- 기능 라우트가 context 루트 밖에 있으면 앱 모듈이 적재 때 거부한다. + - 메시지: `Route () of feature is not under the route root of its context (...)` + - 앱 모듈을 적재하는 테스트(라우터를 거치는 페이지 테스트, component 테스트)와 앱 부팅이 실패한다. `tests/architecture/context-route-roots.test.ts`는 이 규칙을 fixture로만 고정하고, 설치된 기능의 라우트는 보지 않는다. + - 생성 명령은 라우트를 늘 루트 아래에 둔다. 손으로 경로를 바꿀 때만 걸린다. +- context 하나에 기능이 예산보다 많으면 생성기가 거부한다. + - 메시지: `Context feature cardinality exceeds budget ` + - 예산은 선언 파일의 `CONTEXT_MAX_FEATURES`다. +- **못 잡음**: 경계를 잘못 고른 것 자체. 업무가 다른 기능을 한 context에 넣어도 검사는 통과한다. + +④ **쓸 스킬**: `domain-driven-design` + +--- + +## 1단계. 뼈대 만들기 — `create:feature` + +기본 길은 생성 명령이다. + +```bash +corepack pnpm create:feature invoice-feature +``` + +명령이 하는 일: + +```text +인자 검사 + → 설치된 기능·context·라우트·topic·문구 키 읽기 + → 충돌 검사 (겹치면 아무것도 쓰지 않고 거부) + → 파일 쓰기 (있는 파일은 덮어쓰지 않음) + → 생성기 실행 + → 생성기가 거부하면 만든 파일을 모두 지움 + → 만든 파일과 다음 할 일 출력 +``` + +① **정할 것** + +- `--context `: 0단계에서 기존 context를 골랐을 때만 준다. +- `--with-create`: 상세와 작성까지 만든다. 짝 백엔드에서 `scripts/new-feature.sh `을 같은 이름으로 돌렸을 때 준다(예: 프론트 `invoice-feature`, 백엔드 `Invoice` → 둘 다 `/invoices`). +- `--keyed`: `--with-create`와 함께만. 백엔드 create를 멱등성 executor 뒤에 두었을 때(KEYED) 준다. +- `--package @scope/name@x.y.z --digest sha256:<64 hex> --revision `: 계약 패키지가 이미 배포됐을 때 준다. 셋은 함께 준다. +- 둘 다 없으면 새 context와 자리표시자 계약 신원으로 만든다. + - 자리표시자 신원: 패키지가 아직 없을 때 쓰는 가짜 신원이다. 로컬·개발 빌드는 되고, staging·production 승인은 거절한다. + +② **기준** + +- 패키지가 아직 없으면 자리표시자로 시작한다. 3단계에서 실제 신원으로 바꾼다([02 결정표 2절](02-decision-tables.md#2-계약-출처)). +- 손으로 만드는 길도 있다. `docs/architecture/starter-experience.md`의 "Adding a feature" 절이 그 순서다. 다만 전역 ID 접두어, 무작위 topic, a11y 기록을 직접 챙겨야 한다. +- 인자·파일·출력 전체는 [reference/create-feature.md](reference/create-feature.md)에 있다. + +③ **잡는 검사 / 못 잡는 것** + +- 명령 자체가 거부한다. ID 형식, 기존 기능·context와 겹침, 라우트·경로·chunk·문구 키 충돌, topic 충돌, 패키지 신원 형식. +- 생성기가 거부한다. 선언 헤더가 리터럴이 아님, 없는 context, 예산 초과. + - 이때 명령은 만든 파일을 모두 지우고 `the feature index generator rejected the feature, nothing was kept:`로 끝난다. +- 생성한 context 선언은 `tests/unit/create-feature.test.ts`가 생성기의 선언 읽기와 앱 모듈 조립으로 실행한다. 라우트가 그 루트 밖이면 그 테스트가 실패한다. +- `--context reference-context`로 참조 context에 넣을 수는 있다. 참조 기능의 라우팅 테스트는 참조 기능 자신의 라우트만 본다. + - 다만 경로가 `/examples/reference-resources/`가 된다. 참조 기능을 지우면 context가 그 기능 때문에 남고, 그 경로 문자열이 제거 드릴(`test:sample-removal`)의 잔여 검사(`reference-resource`)에 걸린다(추론, 실행하지 않음). 남길 기능은 제품 context에 둔다. + +④ **쓸 스킬**: `clean-architecture`, `codebase-design` + +--- + +## 2단계. 도메인 모델 (선택) + +생성 명령은 `domain/` 폴더를 만들지 않는다. + +① **정할 것**: 업무 규칙(불변식)이 있는가. + +- 불변식: 늘 참이어야 하는 업무 조건이다. 예: "금액은 0 이상", "마감일은 시작일 뒤". + +② **기준** + +- 업무 규칙이 없으면 만들지 않는다. mapper가 DTO를 화면 값으로 바꾸는 것으로 충분하다. +- 있으면 `domain/.ts`에 둔다. + - 생성 함수에서 불변식을 검사하고 `Object.freeze`로 고정한다. + - 이름은 와이어 필드가 아니라 업무 이름으로 짓는다(참조 기능은 `name`을 `displayName`으로 바꾼다). +- 예제(참조 기능): src/features/reference-feature/domain/ +- 길이 제한(예: 제목 100자)은 domain이 아니라 경계 검증에 둔다. + - 경계 검증: 값이 앱에 들어오거나 나가는 자리(요청·응답 스키마, 폼 스키마)에서 하는 검사다. + - 서버가 정한 제한이면 `contracts/-schemas.ts`에 상수로 두고 요청 스키마와 폼 스키마가 같은 상수를 쓴다. 숫자가 두 곳에서 갈라지지 않는다. + - 참조 기능도 이름 길이를 스키마(`reference-schemas.ts`)와 폼(`reference-resource-form.ts`)에만 둔다. `domain/`에는 없다. + - domain에는 서버 제한이 바뀌어도 그대로인 업무 규칙만 둔다(예: "마감일은 시작일 뒤"). + +③ **잡는 검사 / 못 잡는 것** + +- React·HTTP·application을 import하면 `check:architecture`(FE-GATE-010)가 `feature-domain-is-framework-neutral` 규칙으로 막는다. +- **못 잡음**: 불변식을 domain 대신 페이지에 쓰는 것. 규칙 위치는 검사하지 않는다. + +④ **쓸 스킬**: `clean-architecture`, `codebase-design` + +--- + +## 3단계. API 계약 + +생성된 파일: + +- `contracts/-feature-contract.ts`: 선언 쪽. 라우트, 무효화, 계약 패키지 신원(`contractPackages`). +- `contracts/-contract-contribution.ts`: HTTP 계약(descriptor). operation을 적는 곳은 여기 하나다. 이것이 실행되고, `check:registries`의 FE-REG-API 행도 여기서 뽑는다. +- `contracts/-schema-metadata.ts`: 스키마 메타데이터(FE-REG-SCHEMA 행). 스키마 ID마다 쓰이는 자리(`boundary`)와 소유자를 적는다. +- `contracts/-schemas.ts`: zod 스키마와 검증기. +- `contracts/-mapper.ts`: 와이어 값 → 화면 값. + +FE-REG-API 행은 descriptor에서 자동으로 만든다(`src/contracts/api-operations.ts`의 `projectApiOperationRows`). 같은 API를 다른 파일에 다시 적지 않는다. + +① **정할 것** + +- 계약 출처. 실제 패키지 / 자리표시자. [02 결정표 2절](02-decision-tables.md#2-계약-출처) +- operation마다: + - 재시도 의미(`retrySemantics`). [02 결정표 3절](02-decision-tables.md#3-재시도-의미) + - 쓰기의 실패 분류(`commandEffect`). [02 결정표 4절](02-decision-tables.md#4-결과-불명) + - 인증 프로필(`authProfileId`). [02 결정표 5절](02-decision-tables.md#5-인증) + - 바이트 한도·마감: `requestByteLimit`, `responseByteLimit`, `totalDeadlineMs`. + - 스키마 ID, operation ID. 모두 기능 접두어를 붙인다([reference/global-ids.md](reference/global-ids.md)). + +② **기준** + +- 밖에서 들어오는 값(응답, 문제 응답, 입력)은 받는 자리에서 검증한다(원칙 4). + - 검증기는 `src/contracts/zod-validator.ts`의 `zodValidator(schemaId, schema)` 하나를 쓴다. 기능마다 복사하지 않는다. + - 검증을 일부러 생략할 때는 `src/contracts/unvalidated-payload.ts`의 `unvalidatedPayload(schemaId, reason)`를 쓴다. 이유가 빈 문자열이면 throw한다. 생략 목록은 `listUnvalidatedPayloads`가 보여 준다. + - zod는 `src/contracts/zod.ts`로만 import한다. +- 경로는 짝 백엔드 컨트롤러의 매핑과 같은 `/`이다. 생성된 descriptor는 `API_PATH` 상수 하나를 쓴다. 백엔드에 `--path`를 줬으면 이 상수를 같은 값으로 바꾼다. + - 백엔드의 `api-base-path`(기본 `/v1`, 로컬 `/api`)는 descriptor에 적지 않는다. `config/runtime/.json`의 `API_BASE_URL`에 붙이고 끝을 `/`로 둔다(예: `https://api.example.com/v1/`). 끝 `/`가 없으면 실행기가 `URL_ORIGIN_ESCAPED`로 보내지 않는다. + - 백엔드 생성기는 목록 엔드포인트를 만들지 않는다. 백엔드에 `GET /` 페이지 목록(`PageParams`)을 더하기 전에는 생성된 목록이 405를 받는다. +- 계약 패키지(`@org-contracts/*`)는 `contracts/-contract-contribution.ts` 이름의 파일에서만 import한다. +- 패키지 신원 네 필드(`packageId`, `version`, `digest`, `sourceRevision`)는 `-feature-contract.ts`의 상수 하나에 있다. 바꿀 때는 넷을 함께 바꾼다. +- 근거: `scale-architecture.md` §13(재시도), §20~§22(검증 경계와 예산). + +**응답 모양: 짝 백엔드의 Envelope** + +생성한 기능은 짝 백엔드의 응답을 그대로 읽는다. +짝 백엔드의 정본은 `clean-architecture-backend-template/docs/web/http-contract.md`다(아래 `http-contract.md`). + +- Envelope: 성공·실패 본문을 한 번 더 감싸는 공통 바깥 객체다(`http-contract.md` §1). + - 성공: `{ "success": true, "data": ..., "meta": ... }` + - 실패: `{ "success": false, "error": { "code", ... }, "meta": ... }` +- 이 모양을 읽게 하는 것은 V3 descriptor(`-contract-contribution.ts`)의 한 줄 `responseEnvelope: "ENVELOPE_V1"`이다. 생성된 operation에는 모두 들어 있다. + - operation을 손으로 더할 때마다 이 줄을 적는다. 이 값은 operation마다 따로다. + - 한 계약 기여 안에서 이 값이 다른 operation이 있으면 계약 조립이 거부한다(`/: responseEnvelope NONE, but in the same contribution reads ENVELOPE_V1; ...`). 기여 하나는 백엔드 하나의 패키지라서다. 그래서 줄을 빠뜨리면 앱을 조립하는 테스트와 `check:registries`가 실패한다. + - **못 잡음**: 기여 안의 operation 모두에서 이 줄을 빼는 것. 그때는 아래 MSW 줄의 손글씨 gateway 테스트만 잡는다. + +```text +성공 status → Envelope 확인 → data를 outputValidator로 검증 → mapSuccess +실패 status → Envelope 확인 → error를 problemValidator로 검증 → 판정(effect) → mapProblem +``` + +- 백엔드는 값이 null인 필드를 키째 뺀다. `data` 키가 없으면 `null`로 읽는다. DTO 안에서 null일 수 있는 필드는 스키마에서 `.optional()`로 받는다. +- problem 스키마(`-schemas.ts`의 `ProblemSchema`)는 Envelope의 `error` 객체다. 분기는 `code`로 한다. `message`는 버린다. +- 400·409·422와 백엔드가 정한 5xx 넷이 적용됐는지는 실행기가 백엔드 기준 표로 정한다. 목록은 [02 결정표 4절](02-decision-tables.md#4-결과-불명)이다. +- 업무 규칙 거절(`_INVALID`, `*_ALREADY_EXISTS` 등)은 표에 없어 결과 불명이 된다. 그 엔드포인트가 쓰기 전에만 내는 code면 `commandEffect.refusedBeforeWrite`에 적는다. 적어야 사용자가 값을 고쳐 다시 저장할 수 있다(02 결정표 4절). +- `mapProblem`이 없거나 `undefined`를 돌려주면 백엔드 code·필드 오류·status별 kind로 읽는다(`src/adapters/http/backend-envelope.ts`). +- 바이트 상한(`responseByteLimit`)과 구조 예산은 Envelope 전체에 걸린다. +- MSW: `createHttpScenarioHandler`는 descriptor의 `responseEnvelope`를 보고 Envelope로 답한다(`tests/mocks/handlers/http-scenarios.ts`). 그래서 시나리오 테스트는 선언이 틀려도 통과한다. 생성된 `tests/features//-http-gateway.test.ts`는 백엔드 본문을 그대로 적어 검사한다. operation을 더하면 이 파일에도 그 operation의 백엔드 본문 테스트를 더한다. +- `http-contract.md`는 status·`code`의 **뜻**(예: 409 `IDEMPOTENT_IN_FLIGHT`)의 정본이다. 기능 코드에서 그 code는 problem의 `code`로 읽는다. + +**짝 백엔드가 아닌 백엔드** + +DTO와 problem details(`type`·`title`·`status`)를 감싸지 않고 보내는 백엔드에 붙일 때: + +1. descriptor에서 `responseEnvelope` 줄을 지운다. +2. problem 스키마를 problem details 모양으로 바꾼다. +3. `classifyProblem`이 모든 판정을 정한다. 실행기가 먼저 정하는 판정은 없다. + +참조 기능(src/features/reference-feature/)이 이 모양이다. 참조 기능의 MSW 본문도 DTO와 problem details다. + +**입력과 스키마 메타데이터** + +`inputValidator` 하나가 operation 입력 전체를 검증한다. 입력이 요청의 어디로 가는지는 `projectRequest`가 정한다. + +- 경로 파라미터: `pathValues`. 키는 `pathTemplate`의 `{이름}`과 같다. +- 검색값: `queryEntries`. 인코딩한 쿼리는 8,192바이트까지다(`HTTP_EXECUTION_CEILINGS.encodedQueryBytes`). +- 본문: `body`. `requestBody: "JSON"`일 때만 쓴다. 아니면 `null`이다. + +경로 파라미터와 본문을 함께 받는 operation(예: `PUT /items/{id}` + 본문)은 입력 스키마 하나에 둘을 담고 `projectRequest`가 나눈다. + +정본: descriptor 칸은 `src/contracts/external-contract-runtime.ts`(`InstalledHttpContract`), 스키마 메타데이터 칸은 `src/contracts/schema-registry.ts`(`SchemaDefinition`). + +스키마 `boundary` 값: + +- `route-params`: 라우트 경로 파라미터(`paramsSchema`). 같은 스키마를 경로 파라미터 GET의 `inputValidator`로도 쓴다. +- `route-search`: 라우트 검색값에만 쓴다. +- `route-search-api-request`: 라우트 검색값이면서 GET 쿼리다. 목록 검색이 이 경우다. +- `api-request`: 요청 입력. +- `api-response`: 응답 DTO. +- `api-problem`: 실패 본문(`problemValidator`). Envelope operation이면 `error` 객체다. FE-REG-API의 `problemSchema`가 이 행을 가리킨다. + +스키마 메타데이터의 `boundary`·`direction`·`unknownFieldPolicy`는 손으로 적지만 `tests/unit/schema-metadata-policy.test.ts`(`test:unit`)가 실제 쓰임과 대조한다. + +- `boundary`: descriptor의 입력·응답·실패 검증기와 라우트의 `paramsSchema`·`searchSchema`에서 쓰인 자리로 정해진다. 다르면 `: row <적은 값>, used as <맞는 값>`으로 실패한다. 쓰이는데 행이 없으면 `: no FE-REG-SCHEMA row`. +- `direction`: 입력은 `REQUEST`, 응답·실패는 `RESPONSE`. +- `unknownFieldPolicy`: zod가 모르는 키를 거부하면(`.strict()`) `REJECT_UNKNOWN`, 버리면(`.strip()`) `STRIP_UNKNOWN`. +- 이 테스트는 설치된 기능을 읽는다. 기능을 더한 상태에서 `test:unit`을 돌릴 때 잡힌다. + +예: 공지 기능의 검색값 GET과 경로 파라미터 GET. 입력에 관한 칸과 응답 모양 줄만 적었다. + +```ts +// GET /notices?q=... inputValidator 스키마 NoticeListQuery (boundary: "route-search-api-request") +pathTemplate: "/notices", +inputValidator: zodValidator("NoticeListQuery", noticeListQuerySchema), +responseEnvelope: "ENVELOPE_V1" as const, +projectRequest: (input) => Object.freeze({ + pathValues: Object.freeze({}), + queryEntries: Object.freeze(input.q === undefined ? [] : [Object.freeze(["q", input.q] as const)]), + body: null, +}), + +// GET /notices/{noticeId} inputValidator 스키마 NoticeParams (boundary: "route-params") +pathTemplate: "/notices/{noticeId}", +inputValidator: zodValidator("NoticeParams", noticeParamsSchema), +responseEnvelope: "ENVELOPE_V1" as const, +projectRequest: (input) => Object.freeze({ + pathValues: Object.freeze({ noticeId: input.noticeId }), + queryEntries: Object.freeze([]), + body: null, +}), +``` + +③ **잡는 검사 / 못 잡는 것** + +- descriptor의 입력·응답·실패 스키마 ID가 스키마 메타데이터에 없으면 `check:registries`가 실패한다. + - 메시지: `FE-REG-API..requestSchema references unknown FE-REG-SCHEMA.schemaId=` (`responseSchema`, `problemSchema`도 같다) +- 스키마 메타데이터의 `boundary`·`direction`·`unknownFieldPolicy`가 실제 쓰임과 다르면 `test:unit`의 `tests/unit/schema-metadata-policy.test.ts`가 실패한다(위 "입력과 스키마 메타데이터"). +- 인증 프로필 이름이 틀리면 계약 조립이 거부한다. `check:registries`(원인 `reason`도 적는다)와 그 기능의 실행부를 적재하는 테스트가 실패한다. `check:types`·`check:architecture`·`verify:documentation`은 통과한다. + - 오류의 `reason`: `/: unknown authProfileId ` +- 스키마 ID나 operation ID가 겹치면 적재 때 그 ID를 말하며 실패한다. + - 예: `Invalid or duplicate schema definition: `, 계약 조립 `duplicate operation: ` +- `TEMPLATE_FIXTURE` 출처를 참조 기능 밖에서 쓰면 계약 조립이 거부한다. + - 오류의 `reason`: `: TEMPLATE_FIXTURE REFERENCE_FEATURE_V1 belongs to reference-feature only; pin an EXTERNAL_PACKAGE` +- zod를 직접 import하면 `check:architecture`가 `zod-is-reached-through-contracts-zod`로 막는다. +- 계약 패키지를 다른 파일에서 import하면 `external-contract-package-single-import-path`로 막는다. +- 자리표시자 신원은 staging·production 승인(`check:release-admission`, FE-GATE-027)이 거절한다. +- **못 잡음**: 쓰기 실패를 서버 계약과 다르게 분류하는 것. 서버가 보장하지 않는 code를 `NOT_APPLIED`로 적어도 검사는 통과한다. 백엔드 계약을 보고 사람이 확인한다. +- **못 잡음**: 자리표시자 신원은 로컬·개발 빌드와 merge 게이트를 통과한다. 의도된 동작이다. + +④ **쓸 스킬**: `clean-architecture`, `codebase-design`, `api-and-interface-design`, `security-and-hardening` + +--- + +## 4단계. application input + +생성된 파일: `application/-feature-api.ts` + +- input 타입: 페이지가 부르는 메서드 모음. +- gateway 타입: HTTP 어댑터가 구현하는 port. +- `createFeatureInput(gateway, { telemetry })`: input을 만드는 함수. +- `ApplicationFeatureInputs` 보강: `declare module ".../application-api.ts"`로 기능 ID와 input 타입을 잇는다. + - 보강(module augmentation): 다른 파일에 있는 타입에 키를 더하는 TypeScript 문법이다. + +① **정할 것** + +- input 메서드 이름. 사용자가 하는 일로 짓는다(`listItems`, `createInvoice`). +- 반환 타입. `Result`(`src/contracts/result.ts`)를 쓴다. +- 쓰기 메서드의 호출 문맥. 쓰기는 뮤테이션의 `intent`를 받아 gateway까지 넘긴다(`Readonly<{ signal?: AbortSignal; intent: MutationIntent }>`). `KEYED` 쓰기의 멱등 키가 intent에 있다. `--with-create`의 `CommandContext`가 이 모양이다. +- 실패 telemetry의 `kind`. `.<동작>.failed` 꼴로 접두어를 붙인다. + +② **기준** + +- application은 React, HTTP, 어댑터를 모른다. gateway port만 안다. +- telemetry는 결과를 바꾸지 않는다. `failOpenTelemetryPort`로 감싼다(`src/platform/telemetry/telemetry-port.ts`). + - 근거: `scale-architecture.md` §24(텔레메트리 소유), §26(업무 동작에는 fail-open). +- 쓰지 않는 것: `src/application/result.ts`(폐기 재수출), `src/application/ports/telemetry-port.ts`(이름만 같은 다른 타입). + +③ **잡는 검사 / 못 잡는 것** + +- application이 React·어댑터·presentation을 import하면 `check:architecture`가 `feature-application-does-not-know-runtime`으로 막는다. +- 보강 키와 조립 기여의 `featureId`가 다르면 조립이 실패한다. + - 메시지: `feature adapter contribution installed an input for ` +- input 모양이 보강 타입과 다르면 `check:types`(FE-GATE-003)가 막는다. 음성 fixture `check:types:fixture:feature-input`도 같은 게이트에서 돈다. +- **못 잡음**: telemetry `kind` 중복. 유일성 검사가 없다. 접두어로 피한다. + +④ **쓸 스킬**: `clean-architecture`, `codebase-design` + +--- + +## 5단계. HTTP 어댑터와 조립 기여 + +생성된 파일: + +- `adapters/-http-gateway.ts`: `defineFeatureHttpOperationForRoutes`로 operation과 route ID를 묶고, gateway를 구현한다. +- `adapters/create--feature-input.ts`: `defineFeatureAdapterContribution`으로 조립 기여를 선언한다. + - 조립 기여: 부팅 때 플랫폼이 기능에게 capability를 주고 input을 받아 가는 약속이다. + +① **정할 것** + +- `needs`: 기능이 받을 capability. 템플릿이 만드는 것은 `http`, `telemetry`다. +- 문제 응답 → 실패 매핑. 필요하면 `mapProblem`을 둔다(예: 409, 422를 업무 실패로). Envelope operation에서 `mapProblem`은 kind·code·필드 오류만 바꾸고 적용 여부는 못 바꾼다. 쓰기 전 거절이면 그 code를 `refusedBeforeWrite`에도 적는다. +- operation마다 `routeId`. `defineFeatureHttpOperationForRoutes`로 정의할 때 적는다. + +② **기준** + +- `routeId`는 요청 결과 기록에 붙는 이름표다. + - 요청이 끝날 때마다 진단 기록(`http.request.completed`)과 실패 telemetry(`api.request.failed`)에 `route_id`로 실린다(`src/bootstrap/runtime-adapters.ts`의 `createHttpObservationProjector`). + - URL, 재시도, 취소, 캐시에는 쓰이지 않는다(`src/adapters/http/feature-http-binding.ts`는 이 값을 실행기에 넘기기만 한다). +- `routeId`에는 그 요청을 보내는 화면의 route ID를 적는다. + - 읽기: 데이터를 그리는 화면. 목록 GET은 목록 route, 상세 GET은 상세 route. + - 쓰기: 저장 버튼이 있는 화면. 작성 폼 route가 따로 있으면 그 route. + - 여러 화면에서 부르면 주로 부르는 화면 하나를 고른다. 이름표는 하나뿐이다. + - 참조 기능은 생성 operation에 목록 route(`REFERENCE_RESOURCE_LIST`)를 적었다. 실제로 보내는 화면은 폼 route다. 동작은 같고 기록의 이름표만 다르다. 새 기능은 위 기준을 따른다. +- `needs`에는 실제로 쓰는 것만 적는다. +- 템플릿이 만들지 않는 capability(예: `indexedDb`)는 `src/bootstrap/product-composition.ts`에서 만든다. 제품이 새로 만드는 capability의 타입은 `src/features/product-capabilities.ts`에 적는다. [03 문서](03-outside-feature-folder.md)를 본다. +- 문제 응답 매핑 예제(참조 기능): src/features/reference-feature/adapters/reference-http-gateway.ts + +③ **잡는 검사 / 못 잡는 것** + +- presentation이 기능 `adapters/`를 import하면 `feature-presentation-does-not-know-outbound-adapters`로 막는다. +- adapters가 presentation을 import하면 `feature-adapters-do-not-know-presentation`으로 막는다. +- 기능 루트 파일(`feature-module.ts` 등)이 `src/adapters`에 닿으면 `feature-and-app-roots-do-not-reach-adapters`로 막는다. +- operation ID·route ID·입력 타입을 틀리면 `check:types`가 막는다. 음성 fixture: `check:types:fixture:http-operation-id`, `check:types:fixture:http-route-id`, `check:types:fixture:http-operation-input`. +- 호스트가 주지 않는 capability를 `needs`에 적으면 조립이 실패한다. + - 메시지: `feature needs , which the host did not provide` +- operation을 계약에 두고 기능 `adapters/`·`application/`에서 쓰지 않으면 `check:registries`(FE-GATE-010)가 실패한다. + - 메시지: `FE-REG-API. has no executable consumer for operationId=` +- **못 잡음**: `routeId`가 실제로 요청을 보내는 화면과 다른 것. 타입은 기능의 route ID인지만 본다. +- **못 잡음**: 기능 `contracts/`나 다섯 폴더 밖에 새로 만든 폴더(예: `hooks/`)를 거쳐 `src/adapters`에 닿는 import. `.dependency-cruiser.json`에 그 경로를 막는 규칙이 없다. 기능 안에는 `domain/`, `application/`, `contracts/`, `adapters/`, `presentation/` 다섯 폴더만 둔다. + +④ **쓸 스킬**: `clean-architecture`, `codebase-design` + +--- + +## 6단계. 라우트 + +생성된 파일과 자리: + +- 계약의 `routes`와 `routeRuntimeContracts`. 같은 route ID를 두 곳에 쓴다. +- `presentation/-feature-runtime.ts`: 지연 로드 페이지 표. `moduleId`는 계약과 같아야 한다. +- `context-routes.ts`: context가 적재하는 라우트 목록. 생성된 판은 계약의 라우트를 그대로 옮긴다. +- `presentation/-routes.ts`: 링크용 URL 함수. route ID를 받아 `buildRouteUrl`(`src/presentation/routes/route-codecs.ts`)로 경로를 채운다. +- 문구 `route..title`, `route..navigation` (ko-KR, en-US). 화면의 문서 제목과 메뉴 이름은 이 문구다. + - 계약 `routes`의 `title`·`navigationLabel`은 화면이 읽지 않는다. FE-REG-ROUTE 기준선 행과 lab 측정(`scripts/test-performance.ts`, 플랫폼 라우트만)이 읽는다. 생성 명령은 문구와 같은 값을 넣는다. 값을 바꾸면 `check:registries`가 behavior-change로 기록한다. +- 기능 폴더 밖: `artifacts/tests/a11y-manual/.md`(pending 기록). 생성 명령이 만든다. + +① **정할 것** + +- `access`: `public`(로그인 없이) 또는 `session-required`(로그인 필요). +- `loadingSurface`: 로딩 화면 이름. 케밥 표기. +- `errorSurface`: `route-boundary`, `feature-boundary`, `not-found` 중 하나. 생성된 판은 `feature-boundary`다. +- `chunkId`: 지연 로드 청크 이름. 전역에서 유일해야 한다. +- `navigationOrder`: 메뉴 순서. `null`이면 메뉴에 나오지 않는다. +- 파라미터·검색값이 있으면 그 스키마와 codec(`paramsCodec`, `searchCodec`). + - codec: URL 문자열을 타입 있는 값으로 바꾸고 되돌리는 함수다. + +② **기준** + +- 경로는 계약에만 적는다. 페이지와 링크는 route ID와 `buildRouteUrl`로 URL을 만든다. 경로 문자열을 페이지에 다시 적지 않는다. +- 파라미터나 검색값이 있는 라우트는 `context-routes.ts`의 handle에 `codecs`를 싣는다. 예제(참조 기능): src/features/reference-feature/context-routes.ts. + - 링크용 URL 함수도 같은 codec을 `buildRouteUrl`의 세 번째 인자로 넘긴다. 기본 생성 판의 목록 라우트는 파라미터가 없어서 넘기지 않는다. `--with-create` 판의 상세 라우트는 codec을 넘긴다. 안 넘기면 `Unregistered route codec: `로 throw한다. codec ID는 계약 `routeRuntimeContracts`의 `paramsCodec`·`searchCodec` 값이다. 예제(참조 기능): src/features/reference-feature/presentation/reference-routes.ts. +- 상세 경로는 목록 경로 뒤에 `/items/:`을 붙인다. 예: `/notice/items/:noticeId`. `/notice/:noticeId`로 두지 않는다. + - 라우터(React Router)는 같은 자리에서 정적 경로를 먼저 고른다. 작성 폼 `/notice/new`가 있으면 id가 `new`인 공지는 `/notice/:noticeId`로 열 수 없다. + - `items/`를 끼우면 정적 경로와 겹치지 않는다. 참조 기능도 이렇게 한다(`/examples/reference-resources/items/:resourceId`). +- `tests/e2e/accessibility.spec.ts`는 기능마다 고치지 않는다(1103/16-03). + - 이 spec은 등록된 모든 라우트를 열어 axe로 검사한다. 경로 파라미터는 이름과 상관없이 모두 `a11y-1`로 바꾼다. 파라미터 스키마가 이 값을 거부하면 기능 페이지 대신 잘못된 경로 화면을 검사하므로, id 스키마는 짧은 영문·숫자 문자열을 받게 둔다. + - API 요청은 설치된 descriptor에서 method와 `pathTemplate`으로 찾아 답한다. 목록 조회에는 빈 목록을 그 operation의 모양(`responseEnvelope: "ENVELOPE_V1"`이면 Envelope)으로 답한다. 그 뒤 경고 상자(`role="alert"`)가 없는지 본다. 그래서 목록 페이지는 빈 상태로 검사된다. + - 한 자원을 읽는 조회(경로 파라미터가 있고 빈 목록을 받지 않는 GET)에는 빈 목록 말고 답할 것이 없다. 그래서 상세 페이지는 실패 상태로 그려지고, 테스트 결과에 `a11y-data-state` annotation이 남는다. + - 설치된 GET이 아닌 요청을 그리기 전에 보내면 spec이 실패한다(`requests no installed list or single-resource read answers`). + - spec은 h1이 보일 때까지 기다린다. 그래서 상세 페이지는 데이터가 없을 때도 h1을 그린다. 예: `heading={{ title: notice?.title ?? message("notice.detail.titlePending") }}`처럼 데이터가 없으면 고정 제목("공지")을 쓴다. +- 기능이 앱 홈(`/`)을 대신하려면 route ID `APP_HOME`을 쓴다. `docs/architecture/starter-experience.md`의 "Product home and layouts" 절을 본다. + +③ **잡는 검사 / 못 잡는 것** + +- route ID가 겹치면 조립이 실패한다. 메시지: `Duplicate route registry key: ` +- 경로·`chunkId`가 겹치면 `check:registries`가 실패한다. 메시지: `FE-REG-ROUTE. duplicates path= from ` +- `loadingSurface`가 케밥 표기가 아니면 `check:registries`가 `does not match`로 실패한다. +- `context-routes.ts`의 handle이 계약에 없는 route ID를 가리키면 context 적재가 거부한다. + - 메시지: `Route handle loaded by context is not a contract route of its features (...)` +- 라우트별 a11y 기록이 없으면 세 곳이 잡는다. + - `verify:documentation`(FE-GATE-017): `artifacts/tests/a11y-manual/ has no record for route IDs: ` + - `review:a11y-manual -- --format-only`(FE-GATE-009): `missing record` + - `test:unit`의 `tests/unit/manual-a11y-evidence.test.ts` +- en-US 문구 키가 ko-KR과 다르면 `check:i18n`(FE-GATE-010)이 `en-US catalog keys do not match ko-KR`로 실패한다. +- **못 잡음**: `navigationOrder` 중복. 같은 숫자가 둘이어도 통과한다. 생성 명령은 설치된 최댓값 + 10을 쓴다. +- **못 잡음**: 페이지가 경로를 문자열로 적어 계약과 어긋나는 것. 라우터를 거치는 페이지 테스트가 있을 때만 잡힌다(10단계). + +④ **쓸 스킬**: 정해 둔 스킬 없음. 이 절과 02 결정표로 판단한다. + +--- + +## 7단계. 쿼리·뮤테이션 바인딩 + +생성된 파일: `presentation/use--items.ts` (`bindQuery` + `useApplicationQuery`) + +① **정할 것** + +- 쿼리 namespace: `defineQueryNamespaceIdentity(name, version)`. 캐시 키의 앞부분이다. +- 무효화 topic: `qinv.` 뒤에 무작위 26자. 쓰기가 끝나면 어떤 쿼리를 다시 받을지 잇는 이름이다. +- profile: `LIST_STANDARD`, `DETAIL_STANDARD`, `LOOKUP_STABLE`, `VOLATILE_STATUS` 중 하나. 캐시 시간 정책이다. 정의는 `src/contracts/server-state.ts`. +- `measureResult`: 결과 크기 추정 함수. 캐시 예산에 쓴다. +- `definitionId`: 쿼리·뮤테이션 정의 이름. +- 쓰기가 있으면 뮤테이션 정책: `duplicatePolicy`, `invalidate`. operation ID와 멱등 키 여부는 정하지 않는다. descriptor에서 받는다(아래). + +② **기준** + +- topic은 복사하지 않는다. 새 topic이 더 필요하면 값을 새로 만든다. + - 형식: `qinv.` + 소문자·숫자 26자. `scripts/create-feature.ts`의 `randomTopicSuffix`가 쓰는 방식이다. +- `measureResult`에서 `JSON.stringify`를 쓰지 않는다. 문자열 바이트와 항목당 고정 크기로 어림한다(생성된 `measureItems` 참고). +- 뮤테이션 정책의 operation ID와 `requiresIdempotencyKey`는 `commandMutationIdentity(_CONTRACT)`(`src/contracts/server-state.ts`)로 descriptor에서 받는다. 손으로 적지 않는다. + - 실행기는 intent의 operation ID가 descriptor와 다르면 보내기 전에 거부한다. 손으로 적은 ID에 오타가 있으면 저장이 항상 실패하고, 화면은 "요청을 처리할 수 없습니다"다. + - `requiresIdempotencyKey`는 `retrySemantics`가 `KEYED`일 때만 참이다. +- 쓰기 정책은 `duplicatePolicy: "REJECT_WHILE_ACTIVE"`, `invalidate: [topic]`을 쓴다. + + ```ts + const INVOICE_CREATE_MUTATION_POLICY = Object.freeze({ + definitionId: "invoice-create-v1", + definitionVersion: 1, + ...commandMutationIdentity(INVOICE_CREATE_CONTRACT), + duplicatePolicy: "REJECT_WHILE_ACTIVE" as const, + invalidate: Object.freeze([INVOICE_ITEM_INVALIDATION_TOPIC]), + }); + ``` + + - 예제(참조 기능): src/features/reference-feature/presentation/use-reference-feature.ts의 생성 뮤테이션 정책. + +③ **잡는 검사 / 못 잡는 것** + +- topic·namespace가 겹치면 조립 때 실패한다. 메시지: `Duplicate invalidation topic: `, `Duplicate invalidation namespace: ` +- topic 형식이 틀리면 `Query invalidation topic is invalid.`로 실패한다. +- 등록되지 않은 profile은 실행 때 `Unregistered server-state profile: `로 실패한다. +- topic·namespace·edge를 더하기만 하면 레지스트리 기준선은 바뀌지 않는다(additive). 9단계에서 할 일이 없다. +- 뮤테이션 정책의 operation ID를 `commandMutationIdentity`로 받으면 descriptor 상수 이름의 오타는 `check:types`가 막는다. 쓰기 descriptor 대신 GET descriptor를 넘기면 바인딩 때 `commandMutationIdentity: is a GET; a mutation binds a write operation`으로 throw한다. +- **못 잡음**: 뮤테이션 정책에 operation ID를 문자열로 직접 적은 것. 타입이 `string`이라 오타가 통과하고, 저장할 때 실행기가 보내기 전에 거부한다(`MISSING_IDEMPOTENCY_KEY` 위반). `commandMutationIdentity`를 쓴다. +- `bindQuery`의 `owner`·`operationId`, 뮤테이션 정책의 `owner`는 적지 않는다. 읽는 곳이 없어 `@deprecated` 선택 칸이 됐고, 다음 릴리스에서 지운다. 요청 기록의 operation ID는 descriptor의 것이다. +- **못 잡음**: `definitionId` 중복. 유일성 검사가 없다. + +④ **쓸 스킬**: 정해 둔 스킬 없음. 이 절과 02 결정표로 판단한다. + +--- + +## 8단계. 페이지 + +생성된 파일: `presentation/-list-page.tsx` (`CollectionPage` + `AsyncSurface`) + +① **정할 것** + +- 페이지 템플릿. [02 결정표 6절](02-decision-tables.md#6-페이지-템플릿) +- 쓰기가 있으면 결과 불명 화면. `AsyncSurface`의 `onReconcileUnknownEffect`(확인), `onResendUnknownEffect`(같은 키로 다시 보내기). 다시 보내기 버튼은 키가 있는 요청(`KEYED`)에만 그려진다. `NEVER` 쓰기는 확인만 남는다. +- 폼이면 서버 필드 오류를 받을 필드(`useAppForm`의 `allowedServerFields`). 짝 백엔드는 필드 검증 거절을 400 `VALIDATION_FAILED`와 `details[{field, code}]`로 보낸다(422가 아니다). 공유 MSW 시나리오에는 짝 백엔드가 보내지 않는 `validation-422`만 있고, Envelope operation에서 그 답은 결과 불명이다. 짝 백엔드 모양의 필드 오류 테스트는 생성된 작성 폼 테스트(`-create-page.test.tsx`)처럼 400 본문을 손으로 적는다. + +② **기준** + +- 화면 문구는 모두 catalog에서 가져온다(`message(key)`). +- 링크는 6단계의 URL 함수로 만든다. +- 결과 불명 화면 예제: `create:feature --with-create`의 `presentation/-create-page.tsx`(짝 백엔드 Envelope), 참조 기능의 src/features/reference-feature/presentation/reference-resource-form-page.tsx(problem details) + +③ **잡는 검사 / 못 잡는 것** + +- TanStack·HTTP 어댑터를 직접 import하면 `check:architecture`가 `feature-presentation-does-not-know-outbound-adapters`, `presentation-does-not-fetch-directly`로 막는다. +- 디자인 시스템 하위 경로를 import하면 `design-system-is-reached-through-its-index`로 막는다. +- 화면에 문자를 직접 쓰면 `lint`(FE-GATE-002)가 막는다. + - 메시지: `Screen words come from the message catalog: use message(key) (0929/08-02).` +- **못 잡음**: `KEYED` 쓰기에서 결과 불명 화면을 빠뜨린 것. 기능 테스트로만 잡힌다. + +④ **쓸 스킬**: `frontend-ui-engineering` + +--- + +## 9단계. 기준선과 증거 + +① **정할 것** + +- 레지스트리 기준선을 바꿀 변경인가. + - 레지스트리 기준선: 승인된 레지스트리 스냅샷(`config/contracts/registry-baseline.json`)이다. +- 런타임에 기능을 끌 스위치가 필요한가(`FEATURE_OVERRIDES`). + +② **기준** + +- 라우트, operation, 스키마, 무효화 topic·namespace·edge를 **더하기만** 하면 기준선은 바뀌지 않는다. +- 행을 **빼거나** breaking 칸을 **바꾸면** breaking 변경이다. breaking 칸은 `config/contracts/registry-governance.json`의 `breakingFields`다. 배열 칸에서 값을 빼는 것도 breaking이다. + - FE-REG-API 예: 생성 API의 `acceptedStatuses`를 `[200, 201]`에서 `[201]`로 줄이거나, `problemSchema`를 바꾸거나, 검증기를 `unvalidatedPayload`로 바꾸면(`unvalidated` 칸) breaking이다. + - status를 더하는 것, 바이트 상한·마감·`retryBudget`·`traffic`·`commandEffect`·`commandRecovery`를 바꾸는 것은 behavior-change다. 통과하지만 스냅샷 diff(`artifacts/quality/registries.json`의 `compatibility.changes`)에 남는다. PR에서 본다. +- breaking 변경이면 둘 중 하나를 한다. + - `REGISTRY_BASELINE_OWNER`, `REGISTRY_BASELINE_REASON`을 주고 `corepack pnpm update:registry-baseline`을 돌린다. + - 또는 `config/contracts/registry-change-evidence.json`에 항목을 더한다. 칸 설명은 `docs/operations/ci-quality-gates.md`에 있다. +- a11y 기록은 생성 명령이 pending으로 만든다. 서명은 릴리스 전에 사람이 한다([03 문서](03-outside-feature-folder.md)). +- 자리표시자 계약 신원은 staging 배포 전에 바꾼다([03 문서](03-outside-feature-folder.md)). +- 선택: `config/runtime/.json`의 `FEATURE_OVERRIDES`에 기능 ID를 적으면 그 환경에서 기능을 끈다. + +③ **잡는 검사 / 못 잡는 것** + +- breaking 변경에 승인이 없으면 `check:registries`가 실패한다. + - 메시지: `breaking change missing evidence: ` +- 지금 diff와 맞지 않는 증거 행이 남으면 `stale breaking evidence : ...`로 실패한다. +- **못 잡음**: 사람이 서명하지 않은 a11y 기록은 merge 게이트를 통과한다. 릴리스 게이트 FE-GATE-028이 막는다. +- **못 잡음**: descriptor의 함수는 행에 없다. `classifyProblem`·`classifyStatus`가 무엇을 `NOT_APPLIED`로 보는지, `projectRequest`가 무엇을 보내는지는 PR에서 본다. + +④ **쓸 스킬**: `documentation-and-adrs`, `deprecation-and-migration` + +--- + +## 10단계. 테스트 + +생성된 파일: + +- `tests/features//-feature-input.test.ts`: application input 단위 테스트. +- `tests/features//-list-page.test.tsx`: 라우터를 거치는 페이지 테스트. + - 앱 전체를 조립하고(`createRuntimeComposition`, `RuntimeApplication`), 로그인한 뒤 URL로 들어간다. + - API 응답은 MSW로 준다. `tests/mocks/handlers/http-scenarios.ts`의 `createHttpScenarioHandler(_CONTRACT, { scenario, payload })`를 쓴다. + - 시나리오 이름의 정본은 `tests/mocks/scenarios/catalog.ts`의 `HttpScenarioId`다. + +① **정할 것**: 어떤 상태를 테스트하나(성공, 빈 목록, 실패와 다시 시도, 결과 불명). + +② **기준** + +- 라우터를 거치는 페이지 테스트를 최소 하나 둔다. 0·6·8단계의 "못 잡음" 대부분을 이 테스트가 잡는다. +- 기능 테스트는 `tests/features//`에만 둔다. `tests/mocks/`의 공유 파일은 쓰기만 하고 고치지 않는다. +- 보낸 요청(헤더·본문)은 MSW의 `request:start` 이벤트로 모아서 확인한다. + - `createHttpScenarioHandler`는 응답만 정한다. 받은 요청을 돌려주지 않는다. + - 생성된 페이지 테스트의 `setupServer` 설정을 아래처럼 바꾼다. + + ```tsx + const api = setupServer(); + const sent: Request[] = []; + beforeAll(() => { + api.listen({ onUnhandledRequest: "error" }); + api.events.on("request:start", ({ request }) => void sent.push(request.clone())); + }); + afterEach(() => { + api.resetHandlers(); + sent.length = 0; + }); + ``` + + - `request.clone()`: 요청 본문은 한 번만 읽힌다. 복사본을 모아 두어야 테스트에서 `json()`을 부를 수 있다. + - 같은 멱등 키 재전송 확인 순서: + + ```text + api.use(... { scenario: "in-flight-409" }) → 저장 → 결과 불명 화면 + → api.use(... 성공 응답) → "같은 요청으로 다시 보내기" 클릭 + → POST 두 개의 Idempotency-Key가 같은지 본다 + ``` + + ```tsx + const posts = sent.filter((request) => request.method === "POST"); + expect(posts).toHaveLength(2); + expect(posts[1]!.headers.get("idempotency-key")).toBe(posts[0]!.headers.get("idempotency-key")); + expect(await posts[0]!.json()).toEqual({ title: "새 공지", body: "본문입니다." }); + ``` + + - 핸들러를 직접 써서 요청을 모으는 방법도 있다. 예제(참조 기능): tests/features/reference-feature/reference-production-vertical.test.tsx의 504 재전송 테스트. +- 빠르게 돌리기: `node scripts/run-vitest.ts run tests/features/` +- CI에서는 `test:coverage`(FE-GATE-005)가 `tests/features`를 돈다. `test:unit`은 `tests/unit`만 돈다. + +③ **잡는 검사 / 못 잡는 것** + +- 테스트 실패는 `test:coverage`가 잡는다. 커버리지 하한도 같은 명령이 본다(`config/testing/risk-coverage.json`). +- **못 잡음**: 기능 전용 브라우저 테스트(e2e)를 둘 자리가 기능 폴더 안에 없다. Playwright는 `tests/e2e`만 읽는다. 그 폴더에 둔 spec은 기능을 지울 때 함께 지워야 한다(11단계). + +④ **쓸 스킬**: `test-driven-development`, `playwright-best-practices` + +--- + +## 11단계. 제거 확인 + +```bash +corepack pnpm test:sample-removal -- --feature=invoice-feature +``` + +이 명령이 하는 일: + +```text +저장소 복사본 만들기 + → 기능 폴더, 기능 테스트 폴더, (마지막 기능이면) context, FEATURE_OVERRIDES 키, + 기능 폴더를 가리키는 커버리지 정책 행, owner가 기능 ID인 증거 정책 행을 지움 + → 레지스트리 기준선을 다시 찍음 (빼는 변경은 breaking이라서) + → 타입·아키텍처·레지스트리·테스트·커버리지·CI 계약·빌드 게이트 + → src와 tests에 기능 ID나 폴더 이름이 남았는지 찾음 +``` + +① **정할 것**: 없음. 확인 단계다. + +② **기준** + +- 기능 전용 파일은 기능 폴더와 `tests/features//` 안에 둔다(원칙 6). +- 폴더 밖에 둘 수밖에 없는 파일은 [03 문서](03-outside-feature-folder.md)의 "기능을 지울 때" 목록에 있다. 실제로 지울 때 그 목록을 함께 지운다. + +③ **잡는 검사 / 못 잡는 것** + +- 남은 파일이 기능 ID나 폴더 이름을 담고 있으면 실패한다. + - 메시지: ` removal failed:` 다음 줄 `fixture-id-residue: residue: ` +- **못 잡음**: 기능 ID를 담지 않은 폴더 밖 파일. 예: route ID만 적은 e2e spec, `artifacts/tests/a11y-manual/.md`. 드릴은 `src`와 `tests`만 찾고, a11y 기록은 남아도 검사가 실패하지 않는다. + +④ **쓸 스킬**: `documentation-and-adrs`, `deprecation-and-migration` + +--- + +## merge 전에 돌릴 것 + +생성 명령 출력의 `Next:` 2번이 돌릴 명령 목록이다. 정본은 `config/ci/gates.json`의 `merge` 단계다. + +한 가지는 따로 본다. + +- `check:bundle`(FE-GATE-012): 기능 하나가 초기 JS를 늘린다. + - `feature-module.ts`가 정적으로 끌어오는 선언·스키마·문구가 초기 청크에 들어가기 때문이다. + - 지연 페이지가 셸과 같은 구성요소(`Button`, `SearchField` 등)를 쓰면 그 구성요소가 공유 청크로 떨어져 초기 파일 수도 하나 늘 수 있다. 파일 수 상한(`initialJsFiles`)은 여유가 있다. + - 예산은 `config/performance/budgets.json`에 있다. 넘었을 때 고르는 법은 `docs/operations/performance-evidence.md`에 있다. 넘으면 예산을 올리기 전에 팀이 정한다. + - 생성 명령의 드릴(`test:feature-scaffold`)도 merge 단계 명령으로 이 검사를 돈다. +- 참조 기능이 설치돼 있으면 초기 JS 기록(config/scale/feature-shape-ceilings.json)도 기능과 함께 바뀐다. test:unit이 빌드와 대조한다. 생성 명령 출력 `Next:` 3번의 명령으로 다시 쓰고 같은 커밋에 넣는다. 기능 제거 드릴(`test:sample-removal -- --feature=`)은 지운 뒤 기록을 다시 쓰고 검사한다. +- 로컬에서 FE-GATE-013을 돌리려면 `VITE_COMMIT_SHA=$(git rev-parse HEAD)`를 준다. 없으면 release candidate가 `source.revision`을 거절한다. 실패한 게이트의 로그는 `artifacts/quality/gates/FE-GATE-.txt`에 있다. +- workflow와 같은 조건으로 돌리려면 README 로컬 merge 게이트 반복문 아래의 env 블록대로 `CI=true`와 CI 빌드 식별값(`VITE_COMMIT_SHA`, `VITE_BUILD_ID`, `RELEASE_ID`, `CI_RUNNER_IMAGE` digest)을 주고 깨끗한 clone에서 돌린다. 이 값 없이 통과해도 CI에서 떨어질 수 있다(1103/11-07, 11-08). diff --git a/docs/manual/02-decision-tables.md b/docs/manual/02-decision-tables.md new file mode 100644 index 00000000..e36381f1 --- /dev/null +++ b/docs/manual/02-decision-tables.md @@ -0,0 +1,395 @@ +# 02. 결정표 + +기능을 만들며 고르는 일곱 가지다. 각 절은 같은 순서로 쓴다. + +```text +무엇을 고르나 → 선택지 비교 → 고르는 기준 → 어디에 적나 → 틀리면 무엇이 잡나 +``` + +판단 원칙은 design-docs repo의 `conventions/feature-design-principles.md`에 있다. 여기서는 번호로만 가리킨다. + +--- + +## 1. context 경계 + +**무엇을 고르나**: 새 기능을 기존 context에 넣을지, 새 context를 만들지. + +context는 URL 앞부분 하나(라우트 루트)를 가진다. 그 아래 기능들은 함께 지연 로드된다. + +```text +사용자가 /invoice 로 들어온다 + → 라우터가 루트 invoice/* 를 가진 context를 찾는다 + → 그 context의 기능들(context-routes.ts)을 한 번에 지연 로드한다 + → 기능 라우트 중 경로가 맞는 페이지를 그린다 +``` + +| | 기존 context에 넣는다 | 새 context를 만든다 | +|---|---|---| +| 언제 | URL 앞부분, 함께 로드·배포되어도 되는지, 소유자 셋이 모두 같다 | 셋 중 하나라도 다르다 | +| 명령 | `corepack pnpm create:feature --context ` | `corepack pnpm create:feature ` | +| 라우트 경로 | `/<루트>/` | `/` (루트는 `/*`) | +| 기능 폴더 밖 | 없음 | `src/contexts/-context/context-module.ts` (명령이 만든다) | +| 주의 | context의 기능 수 예산(`CONTEXT_MAX_FEATURES`)을 넘으면 생성기가 거부한다 | 앱이 하나일 때만 명령이 만든다. 앱이 여럿이면 `--context`로 기존 context를 고른다 | + +**기준**: 원칙 1. context 하나는 루트 경로 하나만 가진다. 그래서 URL 앞부분이 다르면 다른 context다. + +**어디에 적나**: `src/contexts//context-module.ts`의 `CONTEXT_ROUTE_PATH`, 기능의 `feature-module.ts`의 `FEATURE_CONTEXT_ID`. + +**틀리면** + +- 기능 라우트가 루트 밖이면 앱 모듈이 적재 때 거부한다(`... is not under the route root of its context ...`). +- 경계를 업무상 잘못 고른 것은 검사가 잡지 못한다. + +근거: `scale-architecture.md` §5(모듈 소유), §7(개수 예산), §9(라우터 구조). + +--- + +## 2. 계약 출처 + +**무엇을 고르나**: 기능의 API 계약(V3 descriptor와 패키지 신원)을 어디서 받나. + +| | 배포된 계약 패키지 | 자리표시자 신원 | `TEMPLATE_FIXTURE` | +|---|---|---|---| +| 언제 | 백엔드가 `@org-contracts/` 패키지를 배포했다 | 패키지가 아직 없다 | 쓰지 않는다. 참조 기능 전용이다 | +| 만드는 법 | `create:feature`에 `--package`, `--digest`, `--revision`을 준다 | `create:feature`에 패키지 인자를 주지 않는다 | — | +| 로컬·개발 빌드 | 된다 | 된다 | 참조 기능 밖에서는 계약 조립이 거부한다 | +| staging·production 승인 | 된다 | `check:release-admission`(FE-GATE-027)이 거절한다 | — | + +자리표시자 값은 `src/contracts/deployment-admission.ts`의 세 상수다. + +- `PLACEHOLDER_CONTRACT_PACKAGE_DIGEST`: `sha256:` 뒤에 0이 64개 +- `PLACEHOLDER_CONTRACT_PACKAGE_VERSION`: `0.0.0` +- `PLACEHOLDER_CONTRACT_PACKAGE_REVISION`: `0000000` + +**기준**: 원칙 2. 제품 기능은 버전과 digest를 고정한 패키지만 쓴다. 패키지를 기다리느라 화면 작업을 멈추지 않도록 자리표시자로 시작할 수 있다. 다만 공개 환경에는 나가지 못한다. + +**어디에 적나** + +- 신원 네 필드: `contracts/-feature-contract.ts`의 `_CONTRACT_PACKAGE`. +- 패키지 descriptor import: `contracts/-contract-contribution.ts`에서만. +- 자리표시자를 실제 신원으로 바꾸는 절차: [03 문서 "자리표시자 교체"](03-outside-feature-folder.md#자리표시자-계약-신원-교체). + +**틀리면** + +- 신원 형식이 틀리면(정확한 SemVer 아님, digest가 소문자 hex 64자리 아님 등) 생성 명령과 계약 조립이 거부한다. +- 자리표시자로 공개 대상을 승인받으려 하면 `contractPackages.: pins the placeholder identity create:feature writes; ...`로 거절된다. + +--- + +## 3. 재시도 의미 + +**무엇을 고르나**: operation을 다시 보내도 되는지. V3 `retrySemantics`에 적는다. + +**읽기(GET)는 늘 `SAFE`다.** 자동 재시도가 된다(`retryBudget` 0~2). 생성된 뼈대가 이 경우다. + +쓰기는 서버가 무엇을 보장하는지로 고른다. + +| | `KEYED` | `IDEMPOTENT` | `NEVER` | +|---|---|---|---| +| 서버 보장 | 멱등 키(`Idempotency-Key` 헤더)로 같은 요청의 중복 적용을 막는다 | 같은 요청을 여러 번 적용해도 결과가 같다 (키 없이) | 중복을 막지 못한다 | +| 자동 재시도 | 실제로 보내기 전까지만. 보낸 뒤 결과를 모르면 결과 불명(4절)으로 넘긴다. 예외: 짝 백엔드가 503 `IDEMPOTENCY_UNAVAILABLE`(실행 전 거절)로 답하면 `retryBudget` 안에서 같은 키로 다시 보낸다 | 된다 | 하지 않는다 | +| descriptor | `commandRecovery: { mode: "IDEMPOTENCY_REPLAY", operationIdentityField }` 필수. 짝 백엔드는 `retryBudget: 1`(아래 표), 참조 기능은 `0` | — | `retryBudget: 0` 필수 | +| 뮤테이션 정책 | `...commandMutationIdentity(_CONTRACT)`가 `requiresIdempotencyKey: true`를 준다 | 같은 함수가 `false`를 준다 | 같은 함수가 `false`를 준다 | + +- 멱등 키: 서버가 "같은 쓰기 요청"을 알아보게 하는 값이다. +- 결과를 모를 때 새 키로 다시 보내면 안 된다. 서버는 새 키를 다른 요청으로 보고 막지 못한다. + +**기준**: 원칙 3. 서버 계약에 적힌 보장으로 고른다. 모르면 `NEVER`로 두고 백엔드에 묻는다. + +**짝 백엔드의 생성 기능에 붙일 때 (1103/16-07, 03-07)** + +짝 백엔드 `new-feature.sh`가 만드는 create는 `NOT_IDEMPOTENT`다(`Create__Feature__UseCase.java.tmpl`). `Idempotency-Key`를 읽지 않는다. 그래서 프론트 쪽 값은 백엔드 create를 그대로 두었는지로 정해진다. + +```text +백엔드 create + ├─ 생성한 그대로 (NOT_IDEMPOTENT, 키를 읽지 않음) + │ → 프론트 NEVER ← create:feature --with-create + └─ IdempotencyExecutor 뒤로 옮김 (KEYED, 백엔드 docs/manual/05-idempotency.md "KEYED로 만드는 순서") + → 프론트 KEYED ← create:feature --with-create --keyed +``` + +백엔드가 키를 읽지 않는데 프론트를 `KEYED`로 두면 안 된다. 결과 불명 화면의 "같은 요청으로 다시 보내기"가 새 항목을 하나 더 만든다. 같은 키가 중복을 막는다는 보장이 백엔드에 없다. + +두 경우의 값이다. 생성 명령이 이 값을 쓴다. 손으로 만들 때도 같은 값을 쓴다. + +| 값 | `NEVER` (백엔드 그대로) | `KEYED` (백엔드 KEYED) | 이유 | +|---|---|---|---| +| `retrySemantics` | `"NEVER"` | `"KEYED"` | 백엔드가 키를 읽는지 | +| `frontend.retryBudget` | `0` (조립이 강제) | `1` | 백엔드는 503 `IDEMPOTENCY_UNAVAILABLE`(작업 실행 전 거절)에 "같은 키로 다시"를 요구한다. 실행기는 이 답에만 같은 키로 스스로 다시 보낸다. 실제 상한은 min(`retryBudget`, 앱 `MAX_RETRY_ATTEMPTS`(기본 2), 하드 상한 2)이다. 응답을 잃은 뒤에는 스스로 다시 보내지 않는다 | +| `commandRecovery` | `null` | `{ mode: "IDEMPOTENCY_REPLAY", operationIdentityField: "idempotencyKey" }` | 조립이 `KEYED`에 요구한다. `operationIdentityField`는 같은 요청을 알아보는 값의 이름이다. 실행기는 intent의 `idempotencyKey`를 `Idempotency-Key` 헤더로 보낸다. 이 칸은 FE-REG-API에 기록되고 실행기는 읽지 않는다 | +| 호출 문맥의 `intent` | 넘긴다(키 없음) | 넘긴다(키 있음) | 뮤테이션 조정자가 만든 intent를 input → gateway → 바인딩까지 그대로 넘긴다(생성된 `CommandContext`가 `intent`를 필수로 받는다). 빠뜨리면 `KEYED`는 보내기 전에 거부된다 | +| `commandEffect.classifyStatus` | `() => "NOT_APPLIED"` | 같다 | 생성된 create의 401은 보안 필터 체인, 403은 use case의 `@RequiresPermission` 프록시, 429는 rate-limit interceptor(`preHandle`)가 use case 전에 낸다. use case 안에서 `AuthorizationPort`를 쓰기 뒤에 부르게 바꾸면 403이 쓰기 뒤에도 나올 수 있다. 그때는 이 칸을 지운다(= `MAYBE_APPLIED`) | +| `commandEffect.refusedBeforeWrite` | `["_INVALID"]` | 같다 | 이름 규칙을 트랜잭션 전에 검사한다(4절) | +| `acceptedStatuses` | `[201]` | `[201]` | `ResponseEntity.created`. 같은 키 재생도 첫 요청과 같은 201이다 | +| 결과 불명 화면 | 확인만. 다시 보내기 버튼 없음 | "같은 요청으로 다시 보내기"가 같은 키로 보낸다 | 키 없는 재전송은 서버가 새 요청으로 본다 | +| 생성 테스트 | 응답 유실 → 결과 불명, 다시 보내기 없음, 키 헤더 없음 | 응답 유실 → 같은 키로 다시 보내기. 503 `IDEMPOTENCY_UNAVAILABLE` → 같은 키로 1회 자동 재전송 | `tests/features//-create-page.test.tsx`, `-http-gateway.test.ts` | + +- 테스트 하네스의 재시도 상한: 생성된 gateway 테스트는 앱 기본값(`maxRetryAttempts: 2`)으로 돈다. 그래야 `retryBudget: 1`의 재전송이 보인다. 페이지 테스트(`-test-app.tsx`)는 실패를 바로 보이려고 `MAX_RETRY_ATTEMPTS: 0`이다. + +**정본**: 백엔드가 멱등 키 요청에 어떻게 답하는지는 `clean-architecture-backend-template/docs/web/http-contract.md` §2(멱등성 응답)다. 여기에 표를 옮기지 않는다. + +**어디에 적나**: `contracts/-contract-contribution.ts`의 `retrySemantics`, `commandRecovery`, `frontend.retryBudget`. 다른 파일에 다시 적지 않는다. + +**틀리면** + +- 읽기(GET·HEAD)에 `KEYED`나 `NEVER`를 적으면 계약 조립이 ` is a read; its retrySemantics is SAFE or IDEMPOTENT, not <값>`으로 거부한다. +- 쓰기(POST·PUT·PATCH·DELETE)에 `SAFE`를 주면 계약 조립이 `SAFE retry semantics is for GET and HEAD only; ...`로 거부한다. `SAFE`는 보낸 뒤 응답을 잃어도 다시 보내는 의미라, 쓰기에서는 같은 생성이 두 번 나간다. 생성된 뼈대의 GET descriptor를 복사해 쓰기를 만들 때 `retrySemantics`를 위 표에서 다시 고른다. +- `NEVER`에 `retryBudget`을 0보다 크게 주면 계약 조립이 `retry budget contradicts NEVER retry semantics`로 거부한다. +- `KEYED`에 `commandRecovery`가 없으면 `KEYED commands require a recovery descriptor`로 거부한다. +- 서버 보장과 다른 의미를 고른 것은 검사가 잡지 못한다. + +근거: `scale-architecture.md` §13(재시도 모델). + +--- + +## 4. 결과 불명 + +**무엇을 고르나**: 쓰기가 실패 응답을 받았을 때 "적용 안 됨"으로 볼지, "적용됐을 수도 있음"으로 볼지. + +- 결과 불명: 서버가 요청을 적용했는지 모르는 상태다. 응답을 잃었거나, 서버가 "처리 중"이라고 답한 경우다. + +```text +쓰기 요청 + → 실패 응답 (또는 응답 없음) + → commandEffect.classifyProblem({ status, problem }) + ├─ NOT_APPLIED → 폼 오류·실패로 보여 준다. 다음 저장은 새 키를 쓴다 + └─ MAYBE_APPLIED → 결과 불명 화면 + ├─ 확인 (onReconcileUnknownEffect) + └─ 같은 키로 다시 보내기 (onResendUnknownEffect) + 키가 있는 요청만. 키 없는 쓰기(NEVER)는 버튼이 없다 +``` + +| | `NOT_APPLIED` | `MAYBE_APPLIED` | +|---|---|---| +| 뜻 | 서버가 상태를 바꾸지 않았다 | 바꿨을 수도 있다 | +| 언제 | 서버 계약이 "상태를 바꾸지 않음"을 보장하는 status·code | 그 밖의 모든 경우. 모르는 code 포함 | +| 화면 | 실패·폼 오류 | 결과 불명 화면 | +| 다음 전송 | 새 멱등 키 | 같은 멱등 키 | + +**기준**: 원칙 3. + +- 서버가 보장하는 것만 `NOT_APPLIED`로 적는다. 나머지는 `MAYBE_APPLIED`다. +- 같은 status라도 code로 나뉠 수 있다. 예: 409 중 "처리 중"은 `MAYBE_APPLIED`여야 한다. `NOT_APPLIED`로 보면 다음 저장이 새 키를 만들어 같은 작업이 두 번 적용된다. +- 401·403·429는 문제 응답 본문을 읽기 전에 status로 나뉜다. 서버가 상태를 안 바꾼다고 보장하면 `classifyStatus`로 `NOT_APPLIED`를 돌려준다. 없으면 `MAYBE_APPLIED`다. +- 문제 응답 본문이 기능의 problem 스키마를 통과하지 못하면 `classifyProblem`을 부르지 않는다. 쓰기는 `MAYBE_APPLIED`가 된다(`src/adapters/http/http-execution-v3.ts`). +- `responseEnvelope: "ENVELOPE_V1"`인 operation은 400·409·422와 백엔드가 직접 정한 5xx 네 가지의 판정을 실행기가 백엔드 기준 표로 정한다(`src/adapters/http/backend-envelope.ts`의 `REFUSED_BEFORE_WRITE`, `MAYBE_APPLIED_ANSWERS`). 표의 근거는 [계약 문서](../architecture/backend-api-and-server-state-contract.md) 6.1절이다(백엔드 코드에서 code마다 쓰기 전·후를 읽은 결과). `classifyProblem`은 그 밖의 status만 받고, 다르게 답해도 표의 판정은 바뀌지 않는다. + - `NOT_APPLIED`(쓰기 전 거절): 400 `VALIDATION_FAILED`(details 모양과 상관없음), 400 `IDEMPOTENCY_KEY_INVALID`, 422 `IDEMPOTENT_REQUEST_MISMATCH` + - `MAYBE_APPLIED`: 그 밖의 400·409·422. 409 `IDEMPOTENT_IN_FLIGHT`, `BAD_PARAMETER`, 도메인 code, fileserver의 422가 여기 든다. 그리고 status와 code가 함께 맞는 5xx 넷: 503 `IDEMPOTENCY_UNAVAILABLE`, 503 `IDEMPOTENCY_COMPLETION_UNKNOWN`(실행 뒤 결과 기록 실패, 새 키 금지), 500 `IDEMPOTENCY_RECOVERY_REQUIRED`(이전 시도 효과를 증명 못 함), 503 `REQUEST_TIMEOUT`(비동기 요청 시간 초과, 처리가 계속될 수 있음) + - 이 넷은 실행기가 자동으로 다시 보내지 않는다. 결과 불명 화면에서 같은 키로 다시 보낸다. 예외는 KEYED 명령의 503 `IDEMPOTENCY_UNAVAILABLE` 하나다(아래) + - 짝 백엔드가 모든 엔드포인트에서 쓰기 전에 거절하는 code를 새로 만들면 계약 문서 6.1절과 이 표를 함께 고친다. 표에 없으면 `MAYBE_APPLIED`다 +- **업무 규칙 거절은 operation이 선언한다.** 도메인 code(`_INVALID`, `*_ALREADY_EXISTS` 등)는 엔드포인트마다 쓰기 전에 나오는지가 다르다. 그래서 표에 없고, 그대로 두면 결과 불명이 된다. 폼은 "변경 결과를 확인할 수 없습니다"를 보이고 저장 버튼을 끈다. 사용자가 값을 고쳐 다시 저장할 수 없다. + - 그 엔드포인트가 쓰기 전에만 내는 code라면 `commandEffect.refusedBeforeWrite`에 적는다. 그 code로 온 400·409·422는 `NOT_APPLIED`가 되고, 다음 저장은 새 키를 쓴다. + - 짝 백엔드 `new-feature.sh`가 만든 create는 이름을 트랜잭션 전에 검사하고 400 `_INVALID`를 준다(백엔드 `Create__Feature__UseCase.java.tmpl`). 이 code는 적는다. 예: 기능 `worklog`이면 `refusedBeforeWrite: ["WORKLOG_INVALID"]`. + - 고르는 기준: 백엔드 코드에서 그 code를 던지는 곳이 모두 쓰기(트랜잭션, 외부 호출) 전인지 확인했을 때만 적는다. 확인하지 못했으면 적지 않는다. 쓰기 뒤에도 나오는 code를 적으면 결과 불명 요청을 새 키로 다시 보내 중복이 생길 수 있다. + - 적을 수 없는 code: `IDEMPOTENT_*`, `IDEMPOTENCY_*`. 멱등성 응답은 백엔드 표가 정한다. 적으면 계약 조립이 `refusedBeforeWrite cannot declare ...`로 거부한다. `responseEnvelope: "ENVELOPE_V1"`가 아닌 operation에 적어도 거부한다(`refusedBeforeWrite needs responseEnvelope ENVELOPE_V1 ...`). + - 거절 이유를 필드 옆에 보이려면 `mapProblem`이 그 code를 `VALIDATION_REJECTED`와 필드 목록으로 돌려준다. 선언 없이 `mapProblem`만 두면 필드 오류는 보이지만 저장 버튼은 꺼진 채다. + +**503 `IDEMPOTENCY_UNAVAILABLE`는 `NOT_APPLIED`로 분류하지 않는다.** + +백엔드는 이 응답을 "작업 실행 전에 거부됐다. 같은 키로 나중에 다시 보낸다"로 정한다(`http-contract.md` §2 두 번째 표). 적용은 안 됐지만 다음 전송은 같은 키다. 위 표의 두 칸 어디에도 딱 맞지 않는다. + +지금 프론트 동작: + +```text +503 IDEMPOTENCY_UNAVAILABLE + → V3 실행기 + ├─ responseEnvelope: "ENVELOPE_V1" (생성한 기능) → 실행기가 MAYBE_APPLIED로 정한다 + │ KEYED이고 retryBudget > 0이면 먼저 같은 키로 다시 보낸다(3절). 예산을 다 쓰면 결과 불명 + └─ Envelope 없음 (참조 기능) → 기능의 classifyProblem이 정한다 + 참조 기능: 400·422와 정해 둔 409 code만 NOT_APPLIED → 503은 MAYBE_APPLIED + → 결과 불명 화면 → "같은 요청으로 다시 보내기"가 같은 키로 보낸다 +``` + +- 뮤테이션 조정자는 effect가 없는 실패도 `MAYBE_APPLIED`로 본다(`src/presentation/adapters/query/application-query.ts`의 `mutationFailureWithEffect`). +- 판정: 맞는다. 지금 동작은 `MAYBE_APPLIED`이고 재전송은 같은 키다. 백엔드가 요구하는 행동과 같다. +- 다른 점은 화면뿐이다. 서버는 "실행 안 함"이라고 답했지만 화면은 "결과를 모른다"로 보여 준다. +- `NOT_APPLIED`로 바꾸면 다음 저장이 새 키를 만든다. 키를 다시 쓰는 것은 결과 불명으로 남은 요청뿐이다(같은 파일). 백엔드가 말한 "같은 키"와 어긋난다. + +**정본**: 어떤 status·code가 "적용 안 됨"인지는 `clean-architecture-backend-template/docs/web/http-contract.md` §2다. + +**어디에 적나**: `contracts/-contract-contribution.ts`의 `commandEffect`(`classifyProblem`, `classifyStatus`, Envelope operation이면 `refusedBeforeWrite`). 예제(참조 기능): src/features/reference-feature/contracts/reference-feature-contract-contribution.ts의 `CREATE_EFFECT`. + +**틀리면** + +- 쓰기 operation에 `commandEffect`가 없으면 계약 조립이 `command operations require a command effect descriptor`로 거부한다. +- 분류가 서버 계약과 다른 것은 검사가 잡지 못한다. 기능 테스트(같은 키 재전송, 409 처리 중)로 확인한다. + +--- + +## 5. 인증 + +**무엇을 고르나**: operation이 어떤 인증 프로필로 나가는지. + +- 인증 프로필: 요청에 어떤 자격 증명 헤더를 붙이고 쿠키를 보낼지 정한 이름이다. + +| | `ANONYMOUS` | `EXTERNAL_BEARER` | 제품 프로필 | +|---|---|---|---| +| 언제 | 로그인 없이 부르는 API | 세션 토큰을 `authorization` 헤더로 보내는 API. 생성된 뼈대가 이것이다 | 위 둘로 안 되는 경우(쿠키 세션, 별도 토큰 등) | +| 정의 | `src/contracts/rest-profiles.ts` (템플릿 소유) | 같은 파일 | `src/contracts/product-contracts.ts`의 `PRODUCT_REST_AUTH_PROFILES` (제품 소유) | +| 자격 증명 | 없음 | 템플릿 세션 | `src/bootstrap/product-composition.ts`의 `credentialProviders` | +| 라우트 `access` | 보통 `public` | 보통 `session-required` | 프로필에 맞게 | + +- `REFERENCE_EXTERNAL_BEARER`는 `EXTERNAL_BEARER`의 옛 이름이다. `@deprecated`이고 한 릴리스 뒤 지운다. 새 코드는 쓰지 않는다. +- 제품 프로필 ID는 템플릿 프로필 ID와 겹치면 안 된다. +- 쿠키 인증과 CSRF 헤더는 인증 프로필의 헤더 집합으로 표현한다. 예제: `tests/unit/product-composition-fixture.test.ts`. +- 서버가 401을 주면 그 요청의 자격 증명을 낸 쪽만 안다. `ANONYMOUS` 요청의 401은 세션을 바꾸지 않는다. 템플릿 세션이 낸 자격 증명이면 세션이 로그아웃된다. 제품 `credentialProviders`가 낸 자격 증명이면 세션은 그대로이고 `composeProduct`가 돌려준 `onCredentialRejected`가 불린다(선택). +- 짝 백엔드에 붙일 때 세션 owner와 프로필은 [04 문서](04-paired-backend-session.md)가 모드별로 정한다. JWT 모드는 `EXTERNAL_BEARER`, Redis session 모드는 `SESSION_COOKIE_READ`·`SESSION_COOKIE_WRITE`다. + +**기준**: 백엔드가 그 API에 요구하는 인증을 따른다. 새 프로필은 템플릿 파일이 아니라 제품 소유 파일 두 곳에만 더한다. + +**어디에 적나**: descriptor의 `frontend.authProfileId`, 라우트 `access`. + +**틀리면** + +- 없는 프로필이면 계약 조립이 거부해 `check:registries`와 그 기능의 실행부를 적재하는 테스트가 실패한다. `check:types`는 통과한다. + - `Installed contract contribution is not composable: /: unknown authProfileId ` +- 제품 프로필 ID가 템플릿 것과 같으면 `Product REST auth profile reuses a template profile id.` + +--- + +## 6. 페이지 템플릿 + +**무엇을 고르나**: 페이지가 쓸 틀. 다섯 개라 표 대신 목록으로 쓴다. + +- `CollectionPage`: 목록. 도구 막대, 필터, 결과 수, 일괄 작업, 페이지 넘김 자리가 있다. 생성된 뼈대가 이것이다. +- `DetailPage`: 한 항목 보기. 요약(`metadata`)과 위험한 작업(`destructiveAction`) 자리가 있다. +- `FormPage`: 만들기·고치기. 오류 요약, 필드, 폼 버튼, 이탈 확인(`guard`) 자리가 있다. + - `feedbackId={form.feedbackId}`를 넘기면 저장이 필드 오류가 아닌 실패(결과 불명, 429 등)로 끝날 때 포커스가 실패 상태로 간다. 저장 버튼은 저장 중에 `disabled` 대신 `pending`을 쓴다. 꺼진 버튼은 키보드 포커스를 잃는다. +- `StatusPage`: 안내 화면. 로그인 필요, 권한 없음, 없음, 쓸 수 없음, 오프라인, 점검, 예상 못 한 오류(`variant`). +- `StandardPage`: 위 넷에 맞지 않는 페이지. 넷 모두 이것을 바탕으로 한다. + +**기준**: 화면의 주된 일 하나로 고른다. 목록과 상세를 한 페이지에 섞지 않는다. 라우트를 나눈다. + +**정본**: `src/presentation/templates/page-templates.tsx`. 기능은 `src/presentation/design-system/index.ts`를 거쳐 import한다. + +**틀리면** + +- 템플릿은 데이터를 가져오지 않는다. 데이터와 동작은 props로 받는다. 템플릿 파일이 application·어댑터를 import하면 `check:architecture`가 `page-templates-own-layout-only`로 막는다. +- 디자인 시스템 하위 경로를 import하면 `design-system-is-reached-through-its-index`로 막는다. +- 템플릿을 잘못 고른 것은 검사가 잡지 못한다. + +--- + +## 7. 파일 업로드 + +**무엇을 고르나**: 기능이 파일을 서버에 올리는 경로. + +**두 템플릿을 짝으로 쓰면 presigned 레시피는 맞지 않는다.** + +- 프론트 `src/adapters/browser-transfer/`의 resumable upload는 `PRESIGNED_MULTIPART_V1` 서버를 가정한다. 브라우저가 object store에 바로 PUT하는 방식이다. +- 짝 백엔드는 2026-09-25에 그 서버 코드(presigned·direct multipart)를 지웠다. 파일은 자기 Fileserver가 직접 받는다(`clean-architecture-backend-template/docs/fileserver/http-contract.md`). +- 이 레시피를 짝 백엔드에 그대로 붙이면 첫 응답부터 읽지 못한다. 백엔드는 응답을 Envelope로 감싸고, 레시피의 control plane은 감싸지 않은 DTO를 기대한다. +- 짝으로 쓰는 경로는 Fileserver의 multipart 한 번 업로드(`POST /v1/files`)다. 프론트 client는 `src/adapters/http/fileserver-upload.ts`의 `createFileserverUploadClient`다. + +```text +사용자가 파일을 고른다 (FilePickerPort → LocalFileRef) + → FileContentPort.openSource(ref) → FileByteSource + → 기능 어댑터: upload({ source, filename, mediaType, idempotencyKey, signal }) + → POST /v1/files (multipart, 파트 이름 file) + → 201 READY 또는 202 VERIFYING + 저장된 파일 정보(fileId, sha256 …) +``` + +- `FileByteSource`: 고른 파일의 바이트를 조각으로 읽는 값이다. `File`·`Blob`은 파일 어댑터 밖으로 나오지 않는다. +- 파일 선택·읽기(`createBrowserFileRuntime`, `src/adapters/browser-files/index.ts`)도 `file-transfer` 레시피라 제품이 조립한다(`productionComposition: false`). + +| | Fileserver 한 번 업로드 | presigned resumable 레시피 | +|---|---|---| +| 짝 백엔드 | 맞는다 | 서버가 없다 | +| 코드 | `src/adapters/http/fileserver-upload.ts` | `src/adapters/browser-transfer/index.ts` | +| 끊긴 뒤 | 처음부터 다시 보낸다 | part 단위로 이어 간다 | +| 메모리 | 파일 전체를 한 번 읽는다. `maxFileBytes`까지 | part 크기 × 동시 수 | +| 바이트 경로 | 앱 서버를 지난다 | 브라우저 → object store | + +**기준** + +- 짝 백엔드를 그대로 쓰면 Fileserver 한 번 업로드를 쓴다. +- 큰 파일을 끊긴 데서 이어 올려야 하면 지금 템플릿에는 짝 경로가 없다. 짝 백엔드의 tus(`/v1/uploads`)를 부르는 프론트 client는 아직 없다. +- presigned 레시피는 제품 backend가 그 BFF 계약(`docs/architecture/server-file-capability-infrastructure.md`)을 직접 만들 때만 쓴다. + +**결과 읽기**: `upload()`는 `Result`를 돌려준다. + +- 성공 `state`가 `READY`(201)면 바로 내려받을 수 있다. 그 밖(202 `VERIFYING` 등)은 서버가 아직 검사 중이다. +- 실패 `effect`: + - `NOT_STARTED`: 보내지 않았다. 입력, 크기, 자격 증명에서 거절했다. + - `NOT_APPLIED`: 서버가 거절했고 파일은 없다. Fileserver는 모호하지 않은 실패에서 업로드를 취소한다. 아래 `MAYBE_APPLIED` 경우를 뺀 4xx와, 5xx 중 정한 code(`STORAGE_UNAVAILABLE` 등)다. + - `MAYBE_APPLIED`: 올라갔을 수도 있다. 응답을 잃음, 시간 초과, `details.ambiguous: true`, 409 `IDEMPOTENT_IN_FLIGHT`, 503 `IDEMPOTENCY_COMPLETION_UNKNOWN`, 그 밖의 5xx다. 다시 보낼 때는 같은 `idempotencyKey`를 쓴다. + - `APPLIED_CONFIRMED`: 서버는 만들었다고 답했지만 응답을 읽지 못했다. 다시 올리지 않는다. +- `code`는 백엔드 code 그대로다(`FILE_TOO_LARGE`, `UNSUPPORTED_MEDIA_TYPE`, `MALWARE_DETECTED` …). 화면 문구는 기능이 code로 고른다. +- client는 스스로 다시 보내지 않는다. `retryable: true`이고 `retryAfterMs`가 있으면 그만큼 기다린 뒤 기능이 다시 부른다. 서버가 상한(`maxRetryAfterMs`, 기본 30초)보다 길게 기다리라고 하면 `retryable: false`다. + +**주의 — 멱등 키**: 짝 백엔드(`bbe944bd`)의 `POST /v1/files`는 멱등 키를 읽지 않는다(업로드 use case가 `NOT_IDEMPOTENT`). + +- 그래서 `MAYBE_APPLIED` 뒤 다시 보내면 같은 파일이 두 개 생길 수 있다. +- 같은 키 재전송이 중복을 막는 것은 배포가 업로드를 백엔드 멱등성 executor 뒤에 둘 때뿐이다. +- 그 전에는 다시 보내기 전에 업무 데이터(파일 목록 등)로 먼저 확인한다. + +**어디에 적나**: 두 곳이다. + +1. `src/bootstrap/product-composition.ts`: client를 만들 재료(주소, 인증 프로필, 자격 증명, 크기 상한)를 capability로 넘긴다. client 코드는 넘기지 않는다. 기능 adapter는 기능 runtime과 함께 늦게 적재되므로, 업로드 코드가 boot 번들이 아니라 기능 chunk에 든다. +2. 기능 `adapters/create--feature-input.ts`: `needs`에 그 capability를 적고, 거기서 `createFileserverUploadClient`를 부른다. + +```ts +// src/bootstrap/product-composition.ts (제품 소유). BACKEND_SESSION은 +// src/contracts/product-contracts.ts에 더한 쿠키 세션 프로필이다. +import type { FileserverUploadClientDependencies } from "../adapters/http/index.ts"; +import { PRODUCT_REST_AUTH_PROFILES } from "../contracts/product-contracts.ts"; +// 파일에 이미 있는 import에 ProductCredentialProvider를 더한다. +import type { ProductCredentialProvider } from "./product-composition-contract.ts"; + +declare module "../features/feature-adapter-contribution.ts" { + interface FeaturePlatformCapabilities { + readonly fileserverUpload: FileserverUploadClientDependencies; + } +} + +export function composeProduct(context: ProductCompositionContext) { + const sessionCredentials: ProductCredentialProvider = () => { + if (!context.isScopeReady()) return { kind: "SCOPE_FENCED" }; + const csrf = context.readCookie("XSRF-TOKEN"); + return csrf === undefined + ? { kind: "UNAUTHENTICATED" } + : { kind: "READY", headers: { "x-xsrf-token": csrf } }; + }; + return { + capabilities: { + fileserverUpload: { + baseUrl: context.config.API_BASE_URL, + authProfile: PRODUCT_REST_AUTH_PROFILES.BACKEND_SESSION, + attachCredentials: sessionCredentials, + maxFileBytes: 20 * 1024 * 1024, + ...(context.fetcher === undefined ? {} : { fetcher: context.fetcher }), + }, + }, + credentialProviders: { BACKEND_SESSION: sessionCredentials }, + } satisfies ProductComposition; +} +``` + +```ts +// src/features//adapters/create--feature-input.ts +import { createFileserverUploadClient } from "../../../adapters/http/index.ts"; +import { defineFeatureAdapterContribution } from "../../feature-adapter-contribution.ts"; + +export const createAttachmentFeatureInput = defineFeatureAdapterContribution({ + featureId: "attachment", + needs: ["http", "fileserverUpload"], + createInput: ({ http, fileserverUpload }) => { + const uploads = createFileserverUploadClient(fileserverUpload); + return { + featureId: "attachment", + // 기능 port 구현이 uploads.upload({ source, filename, mediaType, idempotencyKey, signal })를 부른다. + input: { /* … */ }, + }; + }, +}); +``` + +- `baseUrl`은 끝이 `/`여야 한다. `v1/files`를 그 아래에 붙인다. 경로가 base 밖으로 나가면 조립할 때 `TypeError`다. +- 자격 증명 함수는 V3 실행기의 `attachCredentials`와 계약이 같다. 같은 프로필의 `credentialProviders`를 그대로 쓴다. 프로필이 허락하지 않은 헤더를 주면 보내지 않고 `AUTH_INTEGRATION_FAILURE`다. + +**틀리면** + +- 프로필의 필수 헤더가 없으면 `fetch`를 부르지 않고 `MISSING_REQUIRED_CREDENTIAL_HEADER`로 끝난다. +- 파일이 `maxFileBytes`보다 크면 읽기 전에 `FILE_TOO_LARGE`(`NOT_STARTED`)다. +- 백엔드가 Fileserver 응답 모양이나 code를 바꾸면 검사가 잡지 못한다. 실패 판정 표(`fileserver-upload.ts`의 `NOT_APPLIED_5XX_CODES`, `MAYBE_APPLIED_CODES`)는 백엔드 `bbe944bd` 기준이다. 백엔드 SHA가 바뀌면 같이 다시 본다. +- 테스트 예: `tests/integration/fileserver-upload.test.ts`(백엔드 계약대로 답하는 MSW). diff --git a/docs/manual/03-outside-feature-folder.md b/docs/manual/03-outside-feature-folder.md new file mode 100644 index 00000000..ca3ce7c8 --- /dev/null +++ b/docs/manual/03-outside-feature-folder.md @@ -0,0 +1,189 @@ +# 03. 기능 폴더 밖 파일 + +핵심: 기능 하나에 필요한 파일은 거의 모두 `src/features//`와 `tests/features//` 안에 있다. +폴더 밖 파일은 네 묶음으로 나뉜다. + +```text +기능 폴더 밖 파일 + ├─ A. 생성 명령이 만든다 → 사람은 확인만 + ├─ B. 사람이 꼭 해야 한다 → a11y 서명, 자리표시자 교체 + ├─ C. 조건이 맞을 때만 사람이 고친다 → 레이아웃, 새 capability, 제품 인증 프로필 등 + └─ D. 고치지 않는다 → 중앙 카탈로그, governance, 공유 mock 등 +``` + +**정본 표**: 파일마다 "언제 고치나"와 "안 고치면 무엇이 실패하나"는 `docs/architecture/starter-experience.md`의 "Adding a feature" 절 표(`File | When | What fails without it`)가 정본이다. 이 문서는 그 표를 복사하지 않는다. 그 표에 없는 것만 더한다. 누가 하는지, 왜 폴더 밖인지, 사람이 하는 절차. + +링크: [starter-experience.md "Adding a feature"](../architecture/starter-experience.md#adding-a-feature) + +--- + +## A. 생성 명령이 만든다 + +`corepack pnpm create:feature`가 쓰는 폴더 밖 파일은 둘이다. 있는 파일은 덮어쓰지 않는다. + +- `src/contexts//context-module.ts` + - 새 context일 때만 만든다. `--context`를 주면 만들지 않는다. + - 왜 밖인가: context는 여러 기능이 함께 쓰는 소속 선언이다. 기능 하나가 갖지 않는다. +- `artifacts/tests/a11y-manual/.md` + - 라우트마다 하나. `Status: pending-manual-review`로 만든다. + - 왜 밖인가: 수동 접근성 검토 기록은 라우트 단위로 한 폴더에 모은다. 릴리스 검토자가 한 곳에서 서명한다. + - pending 기록은 merge 게이트를 통과하고 릴리스 게이트를 넘지 못한다(원칙 7). + +`src/.generated/`도 기능 폴더 밖이다. 생성기가 매번 다시 만든다. 손으로 고치지 않는다. + +--- + +## B. 사람이 꼭 해야 한다 + +### 수동 접근성 검토 서명 + +```text +create:feature가 pending 기록을 만든다 + → merge: 형식만 본다 (review:a11y-manual -- --format-only, FE-GATE-009) + → 릴리스 후보가 나온다 + → 사람이 그 후보로 라우트를 검토하고 기록에 서명한다 + → release: 서명을 본다 (review:a11y-manual, FE-GATE-028) +``` + +할 일: + +1. 릴리스 후보 하나를 띄운다. +2. `docs/accessibility/manual-checklist.md`의 M1~M7과 스크린 리더 항목을 그 라우트에서 확인한다. +3. `artifacts/tests/a11y-manual/.md`를 채운다. + - `Status: reviewed`, `Release ID`, `Reviewer`, `Reviewed at`, `Signature`, `Attestation: accepted` + - 항목마다 `pass` 또는 `not-applicable (<구체적 이유>)` +4. 모든 라우트 기록의 `Release ID`가 같아야 한다. + +안 하면: FE-GATE-028이 `Manual accessibility evidence is incomplete:`로 릴리스를 막는다. + +생성 명령이 서명까지 하지 않는 이유: 자동으로 "검토함"을 쓰면 서명이 아무 뜻이 없어진다(원칙 7). + +### 자리표시자 계약 신원 교체 + +패키지 인자 없이 만든 기능은 자리표시자 신원을 쓴다. staging·production에 내보내기 전에 바꾼다. + +```text +백엔드가 @org-contracts/ 패키지를 배포한다 + → 패키지를 제품 의존성으로 더한다 + → 의존성 변경 증거를 적는다 + → 기능 계약의 신원 네 필드를 바꾼다 + → 계약 기여가 패키지의 descriptor를 쓰게 바꾼다 + → 승인 검사로 확인한다 +``` + +할 일: + +1. 패키지를 production 의존성으로 더한다. `package.json`과 lockfile이 바뀐다. +2. `config/security/dependency-change-evidence.json`에 `add:@` 항목을 더한다(`owner`, `reviewer`, `reason`, `rollback`). + - 안 하면: `generate:supply-chain`(`check:bundle`, FE-GATE-012 안에서 돈다)이 `high-risk dependency missing review: add:@`로 실패한다. +3. `src/features//contracts/-feature-contract.ts`의 `_CONTRACT_PACKAGE`에서 네 필드를 함께 바꾼다. + - `packageId`, `version`(정확한 SemVer), `digest`(`sha256:` + 소문자 hex 64자리), `sourceRevision`(hex 7~64자리) + - 자리표시자 상수 import를 지운다. +4. `src/features//contracts/-contract-contribution.ts`가 로컬 descriptor 대신 패키지의 descriptor를 쓰게 바꾼다. + - `@org-contracts/*` import는 이 파일에서만 된다(`external-contract-package-single-import-path`). +5. 공개 대상으로 승인 검사를 돌린다. + - `APP_PROFILE=staging`으로 빌드한 뒤 `APP_PROFILE=staging RELEASE_TARGET=staging corepack pnpm check:release-admission`(FE-GATE-027)을 돌린다. + - 검사는 빌드 결과 `dist/config.json`을 읽는다. 빌드 변수는 루트 `README.md`의 "Runtime configuration" 절에 있다. + +안 하면: FE-GATE-027이 거절한다. + +```text +release admission refused for staging: + contractPackages.@org-contracts/: pins the placeholder identity create:feature writes; pin the published package's version, digest and revision +``` + +생성 명령이 실제 신원을 만들지 않는 이유: 어느 백엔드 버전과 맞춰 빌드했는지는 사람이 정해야 한다(원칙 2). + +--- + +## C. 조건이 맞을 때만 사람이 고친다 + +언제와 실패 메시지는 정본 표에 있다. 여기에는 무엇을 위해 고치는지만 적는다. + +- `src/contexts//context-layout.tsx`: context가 `AppShell` 대신 자기 틀을 쓸 때. 예제: `tests/helpers/fixture-layout-product.tsx`. +- `tests/e2e/accessibility.spec.ts`: 기능마다 고치지 않는다. 경로 파라미터와 API 응답을 설치된 라우트·descriptor에서 만든다. 보호 페이지가 설치된 GET이 아닌 요청을 그리기 전에 보낼 때만 손본다. 자세한 동작은 [01 문서 6단계](01-add-a-feature.md#6단계-라우트). +- `src/features/product-capabilities.ts`: `needs`에 템플릿이 만들지 않는 capability를 적었을 때. 그 capability의 타입을 `ProductFeaturePlatformCapabilities`에 적는다. + - `product-composition.ts` 안에서 `FeaturePlatformCapabilities`를 보강(`declare module`)하면 `check:types:node`가 그 키를 보지 못한다. +- `src/bootstrap/product-composition.ts`: 위 capability의 값을 돌려줄 때. 제품 인증 프로필의 자격 증명도 여기서 준다. + - 로그아웃·계정 전환 때 닫아야 하는 것(파일 runtime 등)은 `scopeParticipants`로 돌려준다. 예제: `recipes/frontend-capabilities/browser-file-session-capability.ts`. + - 템플릿 파일 `src/bootstrap/runtime-adapters.ts`는 고치지 않는다. + - 실시간 갱신: 짝 백엔드의 실시간 출구(STOMP·NDJSON)와 프론트 realtime 어댑터(SSE·`realtime.v1` WebSocket)는 그대로 연결되지 않는다. 지금 되는 경로는 bounded polling이다. 대응표: [realtime 설계 0.1절](../architecture/realtime-events-web-push-and-bounded-polling.md#01-짝-백엔드-템플릿과의-대응-110304-02). +- `src/contracts/product-contracts.ts`: 제품 인증 프로필이나 제품 런타임 설정 키가 필요할 때. + - 템플릿 파일 `src/contracts/rest-profiles.ts`는 고치지 않는다. + - 설정 키 이름에 `TOKEN`·`COOKIE`·`SECRET`·`PASSWORD` 같은 조각(`src/contracts/env.ts`의 `FORBIDDEN_CONFIG_NAME_FRAGMENTS`, 대소문자 무관)을 넣지 않는다. 부팅이 `CONFIG_SECRET_NAME_REJECTED`로 멈춘다. `test:unit`의 `env-registry-coverage`가 먼저 `Forbidden client configuration key: <키>`로 실패한다. + - FE-REG-ENV 행의 `required`·`defaultValue`는 zod 필드가 키가 없을 때 하는 것과 같게 적는다. 기본값이 없으면 `defaultValue: null`이다. 같은 테스트가 대조한다. +- `config/runtime/.json`: 환경별로 기능을 끄고 싶을 때(`FEATURE_OVERRIDES`). +- `src/features/product-capabilities.ts`의 선택 런타임(`PRODUCT_RUNTIME_CAPABILITY_SELECTION`): Service Worker를 켤 때. 아래 "SW 켜기"를 본다. +- `config/ci/product-gates.json`: 배포 job(`deployment`)을 채우거나 제품 전용 merge 검사(`PRODUCT-GATE-NNN`)를 더할 때. 템플릿 파일 `config/ci/gates.json`은 고치지 않는다. 형식은 [`ci-quality-gates.md`](../operations/ci-quality-gates.md)에 있다. +- `package.json`, lockfile, `config/security/dependency-change-evidence.json`: 계약 패키지를 더할 때(B절). + +정본 표에 없는 것: + +- `config/contracts/registry-baseline.json`과 승인 파일: 레지스트리 행을 **빼거나 바꿀** 때만. 더하기만 하면 고치지 않는다. 절차는 [01 문서 9단계](01-add-a-feature.md#9단계-기준선과-증거). +- `config/testing/risk-coverage.json`의 `criticalModules`: 기능 파일에 따로 커버리지 하한을 걸고 싶을 때(선택). 제거 드릴이 기능 폴더를 가리키는 행을 지운다. +- `tests/e2e/.spec.ts`: 기능 전용 브라우저 테스트가 필요할 때. Playwright는 `tests/e2e`만 읽어서 기능 폴더 안에 둘 수 없다. + +왜 이것들이 기능 폴더 밖인가: 제품 전체가 하나만 갖는 파일이다. 템플릿은 이 자리를 제품 소유로 비워 두었다. 템플릿을 동기화해도 제품의 내용과 충돌하지 않는다. + +### SW 켜기 + +Service Worker는 기본으로 꺼져 있다. 켜는 것은 제품 소유 파일 하나만 고치는 일이다. + +```text +src/features/product-capabilities.ts (SERVICE_WORKER = ACTIVE) + → src/features/installed-runtime-capabilities.ts (템플릿: 검사하고 그대로 투영) + → scripts/build-frontend.ts (worker 빌드를 한 번 더 돈다) + → createOptionalRuntimeHost (부팅 때 worker를 등록한다) +``` + +1. `src/features/product-capabilities.ts`의 `SERVICE_WORKER`를 바꾼다. + + ```ts + const SERVICE_WORKER: InstalledServiceWorkerSelection | null = { + mode: "ACTIVE", + scriptPath: "service-worker.js", + handlers: ["PWA_STATIC_ASSETS"], + }; + ``` + +2. `corepack pnpm build`로 `dist/service-worker.js`가 생기는지 본다. +3. 운영에서 끄려면 런타임 설정 `CAPABILITY_OVERRIDES.SERVICE_WORKER`를 쓴다. 런타임 설정은 끄기만 한다. 켜는 것은 이 파일뿐이다. +4. 지우려면 한 번에 `null`로 가지 않는다. `REMOVE_REGISTRATION` → `PURGE_OWNED_RESOURCES` → `null` 순서로 릴리스한다. 이미 설치된 브라우저의 worker를 먼저 내려야 한다. + +- 고치지 않는다: `src/features/installed-runtime-capabilities.ts`(템플릿 소유, D절). +- 템플릿이 아직 연결하지 않은 것: 저장하지 않은 편집이 있는 탭의 활성화 거절(`blockers`), page controller의 `observe`, 활성화 화면. 지금은 `src/bootstrap/create-runtime-composition.ts`(템플릿 소유)를 고쳐야 연결된다. 확인할 것 목록은 `docs/architecture/optional-adapter-recipes.md`의 "Service Worker를 켤 때 확인할 것"에 있다. +- realtime·Web Worker·오프라인 명령을 고르면 조립이 `Selected optional capabilities have no runtime to start them`로 거절한다. 템플릿 조립에 아직 그 런타임이 없다. + +--- + +## D. 고치지 않는다 + +기능을 더할 때 아래는 고치지 않는다. 고쳐야 할 것 같으면 무언가 잘못 고른 것이다. + +- `src/features/installed-*.ts` (중앙 카탈로그): 기능 폴더를 glob으로 읽는다. +- `config/contracts/registry-governance.json`: 라우트의 스키마·로딩 화면 값을 허용 목록으로 갖지 않는다. +- `config/contracts/registry-baseline.json`: 더하기만 하는 변경은 additive다. +- `README.md`, `docs/accessibility/manual-checklist.md`: route ID 목록을 갖지 않는다. 라우트별 기록 파일이 검사 대상이다. +- `tests/mocks/` 아래 공유 파일: 기능 테스트는 `createHttpScenarioHandler`에 기능 계약을 넘긴다. 공유 시나리오 카탈로그는 바뀌지 않는다. +- `src/bootstrap/runtime-adapters.ts`, `src/contracts/rest-profiles.ts`: 템플릿 소유. 제품은 C절의 제품 소유 파일을 쓴다. + +--- + +## 기능을 지울 때 + +`corepack pnpm test:sample-removal -- --feature=`는 복사본에서 지워 보고 게이트를 돈다. 실제 저장소에서 지울 때는 아래를 함께 지운다. + +- `src/features//`, `tests/features//` +- 그 context의 마지막 기능이면 `src/contexts//` +- `artifacts/tests/a11y-manual/.md` (라우트마다) + - 남아도 검사는 실패하지 않는다. 검사는 등록된 라우트의 기록만 읽는다. 그래서 잊기 쉽다. +- 기능 전용 `tests/e2e/` spec +- `config/runtime/.json`의 `FEATURE_OVERRIDES` 키 +- `config/testing/risk-coverage.json`에서 그 기능을 가리키는 행 +- 그 기능만 쓰던 제품 capability, 제품 인증 프로필, 계약 패키지 의존성 + +그다음 dev manifest(`public/release-manifest.json`)의 계약 패키지를 `node scripts/write-dev-release-manifest.ts`로 다시 쓰고, 레지스트리 기준선을 다시 찍는다. 행을 빼는 것은 breaking 변경이다. + +```bash +REGISTRY_BASELINE_OWNER=<담당> REGISTRY_BASELINE_REASON=" removed" corepack pnpm update:registry-baseline +``` diff --git a/docs/manual/04-paired-backend-session.md b/docs/manual/04-paired-backend-session.md new file mode 100644 index 00000000..c9a6c965 --- /dev/null +++ b/docs/manual/04-paired-backend-session.md @@ -0,0 +1,298 @@ +# 04. 짝 백엔드에 처음 붙이기 — 세션 owner + +핵심: 짝 백엔드(`clean-architecture-backend-template`)는 인증 방식이 둘이다. 한 배포는 하나만 쓴다. +프론트는 그 방식에 맞는 세션 owner를 `recipes/session-owners/`에서 골라 복사하고, `composeProductSessionOwner`에서 돌려준다. + +- 세션 owner: 지금 누가 로그인했는지 알고, 요청에 붙일 자격 증명을 주는 객체다. 계약은 `src/adapters/auth/external-session-adapter.ts`의 `ExternalSessionOwner`다. +- 템플릿에는 demo owner만 있다. demo는 `APP_ENV=local`에서만 켜지고, 그 표식 토큰은 백엔드 JWT 검증을 통과하지 못한다. +- `AUTH_MODE: "external"`인데 owner가 없으면 세션은 `integration-failed`로 닫히고, 인증이 필요한 화면은 "로그인 연동이 필요합니다"를 보인다. + +이 문서의 백엔드 사실은 백엔드 `bbe944bd` 기준이다. 백엔드가 인증 설정을 바꾸면 이 문서와 recipe를 함께 맞춘다. + +--- + +## 1. 어느 쪽인가 + +백엔드의 `APP_SECURITY_AUTH_MODE`가 정한다. 기본값은 `jwt`다. + +| | `jwt` | `redis-session` | +|---|---|---| +| 백엔드가 받는 것 | `Authorization: Bearer ` | `CA_SESSION` 쿠키. 쓰기에는 `X-XSRF-TOKEN` 헤더도 | +| 프론트 recipe | `recipes/session-owners/oidc-pkce-session-owner.ts` | `recipes/session-owners/cookie-session-owner.ts` | +| operation 인증 프로필 | `EXTERNAL_BEARER` (템플릿. 생성 뼈대 기본값) | `SESSION_COOKIE_READ`, `SESSION_COOKIE_WRITE` (제품 프로필. recipe에 있다) | +| 백엔드 템플릿에 없어서 제품이 더하는 것 | Keycloak realm의 브라우저용 public client, 사용자 | 로그인·로그아웃·세션 조회 엔드포인트 | +| 브라우저에 남는 것 | 없음. 토큰은 메모리에만 | httpOnly 쿠키. 스크립트는 못 읽는다 | + +백엔드 근거 위치: + +- 두 모드의 보안 체인: `clean-architecture-backend-template/src/adapter/inbound/web/src/main/java/dev/caskeleton/adapter/inbound/web/auth/SecurityConfig.java` +- 쿠키·CSRF 이름과 모드 기본값: `clean-architecture-backend-template/src/app-bootstrap/src/main/resources/config/security.yml` +- local issuer·audience·CORS: `clean-architecture-backend-template/src/app-bootstrap/src/main/resources/application-local.yml` +- realm: `clean-architecture-backend-template/infra/keycloak/realms/ca-skeleton-realm.json` + +--- + +## 2. 공통 준비 + +1. `config/runtime/local.json`의 `AUTH_MODE`를 `"external"`로 바꾼다. + - `demo`로 두면 owner를 묻지 않는다. 백엔드에 실제로 붙지 않는다. +2. 백엔드 local 프로필의 CORS 허용 출처는 `http://localhost:3000`이다. 프론트를 그 포트로 띄운다. + - `corepack pnpm dev --port 3000` + - 다른 포트를 쓰면 백엔드의 CORS 허용 출처를 그 출처로 바꾼다. +3. owner는 `ProductSessionOwnerContext`(`src/bootstrap/product-composition-contract.ts`)에서 만든다. + - `fetch`: 요청 하나에 마감이 있다(`REQUEST_TIMEOUT_MS`가 상한). 본문은 64 KiB까지 읽는다. redirect는 따라가지 않는다. + - `fetcher`는 마감이 없다. owner에서 쓰지 않는다. 응답하지 않는 호출 하나가 세션을 "복구 중"에 영원히 둔다. + - `page`: 지금 URL, URL 바꾸기, 다른 페이지로 이동. 로그인 리다이렉트에 쓴다. + - `redirectStorage`: 페이지의 sessionStorage. 리다이렉트 한 번 동안의 상태만 둔다. 토큰은 두지 않는다(`AUTH_TOKEN`은 `src/contracts/storage-keys.ts`에서 `forbidden`이다). + - `readCookie`: 페이지 쿠키 읽기. +4. recipe는 `src/bootstrap/` 아래로 **복사**한다. import하지 않는다. + - `src`가 `recipes/`를 import하면 `check:optional-recipes`가 `PRODUCTION_IMPORTS_RECIPE`로 막는다. + - 복사한 파일의 import 경로에서 `../../src/`를 `../`로 바꾼다. + - 템플릿이 recipe를 고치면 CHANGELOG에 적는다. 복사본에 같은 diff를 옮긴다. + +--- + +## 3. `jwt` 모드 — OIDC PKCE owner + +```text +로그인 버튼 → beginSignIn(returnTo) + → owner가 verifier·state·nonce를 만들어 redirectStorage에 둔다 (10분) + → Keycloak 로그인 화면 (code_challenge = SHA-256(verifier)) + → 앱 기본 주소로 돌아온다 (?code=…&state=…&iss=…) + → owner가 저장한 거래를 지우고, URL에서 code를 지우고 returnTo로 바꾼다 [recovery-pending] + → 토큰 엔드포인트에서 code + verifier를 토큰으로 바꾼다 + → ID token의 iss·aud·nonce·exp·sub를 확인한다 [authenticated, subject = sub] + +요청 → attachCredential → Authorization: Bearer (API origin에만) +만료 30초 전 → refresh token으로 한 번 갱신. 상태 알림이 없어 서버 상태 캐시가 남는다 +서버 401 → refresh로 한 번 복구 → 새 토큰도 401이면 로그아웃 [unauthenticated] +``` + +- PKCE: 로그인 시작 때 만든 비밀값(verifier)의 해시를 보내고, 토큰을 받을 때 원래 값을 보내는 방식이다. 중간에서 code를 가로채도 토큰으로 바꾸지 못한다. +- 라이브러리는 없다. WebCrypto와 context `fetch`만 쓴다. + +### 3.1 Keycloak에 브라우저용 client를 더한다 + +백엔드 realm에는 서비스용 confidential client `ca-skeleton-api` 하나뿐이다. 그 client는 브라우저 로그인(standard flow)이 꺼져 있다. 그래서 브라우저가 로그인할 public client를 제품이 더한다. + +realm JSON의 `clients`에 넣거나 Keycloak 관리 화면에서 같은 값으로 만든다. + +```json +{ + "clientId": "ca-frontend", + "enabled": true, + "protocol": "openid-connect", + "publicClient": true, + "standardFlowEnabled": true, + "implicitFlowEnabled": false, + "directAccessGrantsEnabled": false, + "redirectUris": ["http://localhost:3000/*"], + "webOrigins": ["http://localhost:3000"], + "attributes": { + "pkce.code.challenge.method": "S256", + "post.logout.redirect.uris": "http://localhost:3000/*" + }, + "protocolMappers": [ + { + "name": "ca-skeleton-api-audience", + "protocol": "openid-connect", + "protocolMapper": "oidc-audience-mapper", + "config": { + "included.client.audience": "ca-skeleton-api", + "id.token.claim": "false", + "access.token.claim": "true" + } + } + ] +} +``` + +- audience mapper가 꼭 있어야 한다. 백엔드는 access token의 `aud`에 `APP_SECURITY_JWT_AUDIENCE`(local 기본 `ca-skeleton-api`)가 없으면 401 `AUTH_AUDIENCE_MISMATCH`로 거부한다. +- `webOrigins`는 브라우저가 토큰 엔드포인트를 부를 때의 CORS 허용이다. +- realm에는 사람 사용자가 없다. local에서는 관리 화면에서 사용자를 하나 만들고 realm role `user`를 준다. +- 백엔드 권한은 `realm_access.roles`와 `resource_access.ca-skeleton-api.roles`에서 온다. 쓰기 권한이 필요하면 그 사용자에게 `ca-skeleton-api`의 client role을 준다(`clean-architecture-backend-template/docs/manual/07-authorization.md`). + +### 3.2 제품 설정 키를 더한다 + +issuer와 client id는 환경마다 다르다. 그래서 런타임 설정 키로 둔다. `src/contracts/product-contracts.ts`: + +```ts +import { z } from "./zod.ts"; + +export const PRODUCT_RUNTIME_CONFIG_FIELDS = Object.freeze({ + OIDC_ISSUER: z.url().optional(), + OIDC_CLIENT_ID: z.string().min(1).optional(), +}); + +export const PRODUCT_ENV_REGISTRY = Object.freeze({ + OIDC_ISSUER: { phase: "runtime", classification: "public", required: false }, + OIDC_CLIENT_ID: { phase: "runtime", classification: "public", required: false }, +} as const); +``` + +- `.optional()`로 둔다. 값이 비면 owner는 `integration-failed`로 닫힌다. 잘못된 곳으로 로그인하지 않는다. +- `config/runtime/local.json`에 `"OIDC_ISSUER": "http://localhost:8081/realms/ca-skeleton"`, `"OIDC_CLIENT_ID": "ca-frontend"`를 더한다. +- `OIDC_ISSUER`는 백엔드 `APP_SECURITY_JWT_ISSUER`와 글자 하나까지 같아야 한다. 끝의 `/`도 같아야 한다. +- 원격 issuer는 HTTPS만 받는다. HTTP는 `localhost`, `127.0.0.1`, `[::1]`에서만 받는다. + +### 3.3 owner를 돌려준다 + +recipe를 `src/bootstrap/` 아래로 복사한 뒤(예: 같은 이름 oidc-pkce-session-owner.ts) `src/bootstrap/product-composition.ts`: + +```ts +import { createOidcPkceSessionOwner } from "./oidc-pkce-session-owner.ts"; + +export function composeProductSessionOwner( + context: ProductSessionOwnerContext, +): ProductSessionOwner { + const app = new URL(context.page.href()); + return createOidcPkceSessionOwner({ + issuer: context.config.OIDC_ISSUER ?? "", + clientId: context.config.OIDC_CLIENT_ID ?? "", + // 앱 기본 주소: origin + 라우터 base path. client의 redirect URI와 같아야 한다. + redirectUri: new URL("/", app.origin).href, + postLogoutRedirectUri: new URL("/", app.origin).href, + apiOrigins: [new URL(context.config.API_BASE_URL).origin], + fetch: context.fetch, + page: context.page, + redirectStorage: context.redirectStorage, + }); +} +``` + +- 라우터 base path가 `/`가 아니면 `redirectUri`에 그 경로를 넣는다. 돌아온 뒤 owner가 그 경로 아래의 `returnTo`로 URL을 바꾼다. +- operation은 `EXTERNAL_BEARER` 그대로 둔다. 바꿀 것이 없다. +- 배포 CSP `connect-src 'self' https:`는 HTTPS Keycloak을 이미 허용한다(`config/hosting/security-headers.json`). + +### 3.4 이 owner가 하지 않는 것 + +- **새로고침하면 로그아웃된다.** 토큰이 메모리에만 있기 때문이다. Keycloak SSO 세션이 살아 있으면 로그인 버튼 한 번이 비밀번호 없이 돌아온다. + - 새로고침에도 로그인을 유지하려면 `prompt=none` 리다이렉트를 더하는 것은 제품의 결정이다. 토큰을 storage에 두는 방법은 쓰지 않는다. +- **ID token 서명은 보지 않는다.** 토큰 엔드포인트에서 직접 받은 응답이라 TLS가 출처를 보증한다(OIDC Core 3.1.3.7 (6)). access token 서명은 백엔드가 확인한다. +- **로그아웃 URL에 ID token을 넣지 않는다.** 그래서 Keycloak이 "로그아웃할까요?"를 한 번 묻는다. + +--- + +## 4. `redis-session` 모드 — 쿠키 owner와 CSRF provider + +```text +부팅 → owner가 세션 엔드포인트를 묻는다 (GET, 쿠키 포함) [recovery-pending] + → 200 + subject → [authenticated] + → 401 → [unauthenticated] + → 그 밖·시간 초과 → 그대로 recovery-pending. "세션 복구" 버튼이 다시 묻는다 + +읽기 요청 (SESSION_COOKIE_READ) → 쿠키만 +쓰기 요청 (SESSION_COOKIE_WRITE) → 쿠키 + X-XSRF-TOKEN: +서버 401 → [unauthenticated] +``` + +- CSRF: 다른 사이트가 사용자의 쿠키로 쓰기를 보내는 공격이다. 백엔드는 스크립트가 읽을 수 있는 `XSRF-TOKEN` 쿠키를 주고, 쓰기 요청의 `X-XSRF-TOKEN` 헤더가 그 값과 같은지 본다. 다른 사이트의 스크립트는 이 쿠키를 읽지 못한다. +- 백엔드는 plain 방식이다(`CsrfTokenRequestAttributeHandler`). 쿠키 값을 그대로 헤더에 넣는다. + +### 4.1 백엔드에 엔드포인트 셋을 더한다 + +백엔드 템플릿의 운영 코드에는 로그인·로그아웃·세션 조회 엔드포인트가 없다. 테스트 픽스처(`SecurityModeWebContractTest.java`의 `/csrf`, `/login-test`, `/whoami`)만 있다. 그래서 recipe는 이 셋의 주소를 기본값 없이 받는다. + +- **세션 조회 (GET)**: 로그인했으면 200과 subject, 아니면 401. + - subject: 사용자마다 다르고 바뀌지 않는 불투명한 id다. 토큰이나 이메일을 쓰지 않는다. + - 이 엔드포인트가 CSRF 토큰을 읽어야 한다(Spring이면 `CsrfToken.getToken()`). Spring Security는 6부터 GET 요청에서 토큰을 읽을 때까지 `XSRF-TOKEN` 쿠키를 쓰지 않는다. +- **로그아웃 (POST)**: 세션을 끝낸다. CSRF 헤더가 필요하다. +- **로그인**: 로그인 화면 POST든 `oauth2Login` 리다이렉트든 제품이 정한다. 끝나면 페이지가 `recover()`를 불러 owner가 세션을 다시 묻게 한다. + +### 4.2 인증 프로필 두 개를 더한다 + +`cookie-session-owner.ts`의 `SESSION_COOKIE_AUTH_PROFILES` 두 행을 `src/contracts/product-contracts.ts`의 `PRODUCT_REST_AUTH_PROFILES`에 그대로 옮겨 적는다. + +- import하지 않고 옮겨 적는 이유: `src/contracts`는 `src/bootstrap`을 import하지 못한다(`check:architecture`의 `contracts-do-not-know-presentation-or-bootstrap`). +- 읽기 operation은 `SESSION_COOKIE_READ`, 쓰기 operation은 `SESSION_COOKIE_WRITE`를 `frontend.authProfileId`에 적는다. +- `SESSION_COOKIE_WRITE`는 `x-xsrf-token`을 요구한다. 쿠키가 없으면 executor가 요청을 하나도 보내지 않고 `AUTH_INTEGRATION_FAILURE`로 닫는다. + +### 4.3 owner와 provider를 돌려준다 + +recipe를 `src/bootstrap/` 아래로 복사한 뒤 `src/bootstrap/product-composition.ts`: + +```ts +import { + createCookieSessionOwner, + createSessionCookieCredentialProviders, +} from "./cookie-session-owner.ts"; + +export function composeProductSessionOwner( + context: ProductSessionOwnerContext, +): ProductSessionOwner { + const api = new URL(context.config.API_BASE_URL); + return createCookieSessionOwner({ + sessionUrl: new URL("api/session", api).href, + signOutUrl: new URL("api/session/sign-out", api).href, + // 백엔드 Envelope: { success: true, data: { subject } } + subjectFrom: (body) => { + const data = (body as { data?: { subject?: unknown } } | null)?.data; + return typeof data?.subject === "string" ? data.subject : null; + }, + beginSignIn: async () => context.page.assign(new URL("/login", context.page.href()).href), + fetch: context.fetch, + readCookie: context.readCookie, + }); +} + +export function composeProduct(context: ProductCompositionContext) { + return { + capabilities: {}, + credentialProviders: createSessionCookieCredentialProviders({ + readCookie: context.readCookie, + }), + } satisfies ProductComposition; +} +``` + +- 위 경로(`api/session` 등)는 예시다. 4.1에서 만든 엔드포인트 주소를 쓴다. +- provider는 세션 상태를 묻지 않는다. 쿠키가 증명이고 서버가 판정한다. 서버의 401은 owner에게 간다. + +### 4.4 페이지와 API는 같은 host여야 한다 + +- `XSRF-TOKEN` 쿠키는 그 쿠키를 준 host에서만 스크립트가 읽는다. 페이지 host와 API host가 다르면 쓰기가 늘 실패한다. +- 운영: 프록시 하나 뒤에 페이지와 API를 같은 origin으로 둔다. +- local: 쿠키는 포트를 가리지 않는다. 그래서 `localhost:3000`의 페이지가 `localhost:8080`이 준 쿠키를 읽는다. 백엔드 local 프로필은 CORS `allow-credentials: true`다. +- 백엔드는 세션 쿠키를 `Secure`로만 준다. 브라우저가 `http://localhost`를 안전한 출처로 볼 때만 저장된다. 저장되지 않으면 https 개발 서버를 쓴다. + +--- + +## 5. owner가 지킬 상태 전이 + +정본: `src/application/ports/auth-session-port.ts`의 `SessionState`와 `SessionGateway.recover` 주석. 두 recipe 모두 이를 따른다. + +| `recover()` 답 | 답할 때의 상태 | +|---|---| +| `"restored"` | `authenticated`, subject 있음 | +| `"no-session"` | `unauthenticated` (또는 `integration-failed`). `recovery-pending`이 아니다 | +| reject | 바꾸지 않는다. 사용자가 다시 시도한다 | + +- 같은 사용자의 토큰 갱신은 상태도 subject도 바꾸지 않는다. 바꾸면 서버 상태 캐시가 비워진다. +- 계약을 어기고 `"no-session"` 뒤에도 `recovery-pending`이면 화면은 owner가 다시 알릴 때까지 로그인 버튼을 보인다. + +--- + +## 6. 확인 + +- `corepack pnpm test:recipes`: 두 recipe의 단위 테스트와, 템플릿 조립 루트에 실제로 붙인 테스트(`tests/recipes/session-owners-runtime.test.ts`). +- 아직 없는 것: 실제 Keycloak·Redis session 백엔드에 붙인 e2e. 처음 붙일 때 손으로 확인한다. + - `jwt`: 로그인 한 번, `EXTERNAL_BEARER` operation 한 번이 200. + - `redis-session`: 로그인 한 번, `SESSION_COOKIE_WRITE` operation 한 번이 성공하고 요청에 `X-XSRF-TOKEN`이 있다. + +--- + +## 7. 틀리면 + +- **"로그인 연동이 필요합니다"** (`integration-failed`) + - `AUTH_MODE`가 `external`인데 `composeProductSessionOwner`가 `null`을 돌려준다. + - OIDC 설정이 틀렸다: `OIDC_ISSUER`·`OIDC_CLIENT_ID`가 비었다, 원격 issuer가 HTTP다, `apiOrigins`가 origin이 아니다, `redirectStorage`가 없다. +- **Keycloak이 `Invalid parameter: redirect_uri`를 보인다**: client `redirectUris`에 앱 기본 주소가 없다. +- **토큰 교환에서 CORS 오류**: client `webOrigins`에 앱 origin이 없다. +- **로그인했는데 API가 401**: 백엔드 응답의 `error.code`를 본다(목록: `clean-architecture-backend-template/src/adapter/inbound/web/README.md`의 `SecurityErrorClassifier`). + - `AUTH_AUDIENCE_MISMATCH`: 3.1의 audience mapper가 없다. + - `AUTH_ISSUER_MISMATCH`: `OIDC_ISSUER`와 `APP_SECURITY_JWT_ISSUER`가 다르다. 컨테이너 안의 백엔드는 `localhost`로 Keycloak에 닿지 못한다는 점도 본다(백엔드 `application-local.yml` 주석). + - `AUTH_JWKS_UNAVAILABLE` (503): 백엔드가 Keycloak에 닿지 못한다. +- **401 뒤 바로 로그아웃된다**: refresh token이 없거나(client 설정), 갱신한 토큰도 401이다. 후자는 갱신으로 풀리지 않는 거부(audience, issuer)다. +- **부팅 뒤 계속 "세션을 복구하고 있습니다"** (쿠키 모드): 세션 엔드포인트가 응답하지 않거나 200·401 말고 다른 status를 준다. +- **쓰기가 `AUTH_INTEGRATION_FAILURE`이고 요청이 0번** (쿠키 모드): `XSRF-TOKEN` 쿠키가 없다. 세션 엔드포인트가 CSRF 토큰을 읽지 않았거나, 페이지와 API host가 다르다. +- **쓰기가 403** (쿠키 모드): 헤더 값이 쿠키와 다르거나, 백엔드가 `APP_SESSION_CSRF_HEADER_NAME`을 바꿨다. 바꿨다면 프로필과 provider의 헤더 이름을 같이 바꾼다. 템플릿이 허용하는 이름은 `x-xsrf-token`, `x-csrf-token`이다(`src/contracts/rest-profiles.ts`의 `CREDENTIAL_HEADER_NAMES`). diff --git a/docs/manual/README.md b/docs/manual/README.md new file mode 100644 index 00000000..3b515366 --- /dev/null +++ b/docs/manual/README.md @@ -0,0 +1,89 @@ +# 개발 매뉴얼 + +이 폴더는 이 템플릿으로 만든 프로젝트에 **새 기능 하나를 추가하는 절차**를 적는다. +기능 하나는 화면(라우트와 페이지)과 그 화면이 쓰는 API 호출을 함께 뜻한다. + +시작은 `corepack pnpm create:feature `다. 이 명령이 모든 merge 게이트를 통과하도록 만든 가장 작은 기능을 만든다(브라우저 게이트는 드릴 밖, `docs/manual/reference/create-feature.md`). +그 뒤 이 매뉴얼의 단계대로 뼈대를 실제 기능으로 바꾼다. + +## 누가 읽는가 + +- 이 템플릿을 복사한 제품 팀의 프론트엔드 개발자. +- 기능을 만드는 AI 에이전트. 단계마다 "쓸 스킬"을 적었다. + - 스킬: Claude Code가 부르는 작업 지침의 이름이다. 사람이 읽을 때는 건너뛰어도 된다. + +전제: 루트 `README.md`의 "Start locally"대로 로컬에서 앱이 뜬다. + +## 읽는 순서 + +```text +README (이 문서) + → 01 작업 순서 (처음부터 끝까지 한 번) + → 02 결정표 (단계 중 "무엇을 고를지" 막힐 때) + → 03 기능 폴더 밖 파일 (폴더 밖을 고쳐야 할 때) + → 04 짝 백엔드에 처음 붙이기 (로그인이 필요한 API를 처음 부를 때) + → reference/ (명령 인자, 전역 ID, 패턴, 오류 메시지를 찾아볼 때) +``` + +| 문서 | 내용 | +|---|---| +| [`01-add-a-feature.md`](01-add-a-feature.md) | 0~11단계. 단계마다 정할 것, 판단 기준, 잡는 검사와 못 잡는 것, 쓸 스킬 | +| [`02-decision-tables.md`](02-decision-tables.md) | context 경계, 계약 출처, 재시도 의미, 결과 불명, 인증, 페이지 템플릿, 파일 업로드 | +| [`03-outside-feature-folder.md`](03-outside-feature-folder.md) | 기능 폴더 밖 파일. 생성 명령이 하는 것과 사람이 하는 것 | +| [`04-paired-backend-session.md`](04-paired-backend-session.md) | 짝 백엔드의 두 인증 모드(JWT·Keycloak, Redis session)에 맞는 세션 owner를 붙이는 법 | +| [`reference/create-feature.md`](reference/create-feature.md) | `create:feature`의 인자, 만드는 파일, 거부 조건, 출력 | +| [`reference/global-ids.md`](reference/global-ids.md) | 전역 ID 종류, 생성 명령이 만드는 값, 유일성 검사 | +| [`reference/patterns.md`](reference/patterns.md) | 기능 개발 패턴과 예제 위치. 예제가 없는 패턴은 "없음" | +| [`reference/errors.md`](reference/errors.md) | 생성·조립·레지스트리 검사의 실패 메시지와 고칠 파일 | + +## 자주 나오는 말 + +- **기능(feature)**: `src/features//` 폴더 하나. 그 기능의 테스트는 `tests/features//`에 둔다. +- **context**: 같은 URL 앞부분 아래에 있는 기능 묶음이다. 선언은 `src/contexts//context-module.ts`다. +- **라우트 루트**: context가 가진 URL 앞부분이다. 선언 파일의 `CONTEXT_ROUTE_PATH`가 그 값이다. +- **생성기**: `scripts/generate-product-feature-index.ts`. 기능·context 선언을 읽어 `src/.generated/`를 만든다. 모든 빌드·검사 명령이 먼저 돌린다. +- **조립**: 부팅이나 테스트 시작 때 설치된 기능의 계약·라우트·문구를 하나로 합치는 일. 중복이 있으면 여기서 실패한다. +- **게이트**: CI가 돌리는 검사 묶음이다. ID는 `FE-GATE-0NN` 꼴이고 정의는 `config/ci/gates.json`에 있다. +- **계약 패키지**: 백엔드 API의 모양과 신원(버전·digest·소스 리비전)을 담은 `@org-contracts/*` 패키지. +- **digest**: 패키지 내용의 해시다. 같은 버전 번호로 내용이 바뀌는 것을 막는다. + +## 공통 원칙 + +판단 원칙은 design-docs repo의 `conventions/feature-design-principles.md`(기능 설계 공통 원칙)에 있다. +프론트·백엔드 템플릿이 함께 쓰는 원칙이다. 이 매뉴얼은 원칙을 복사하지 않고 "(원칙 5)"처럼 번호로 가리킨다. + +## 이 폴더에 두는 것 + +- 이 템플릿의 파일 이름, 명령, 게이트 ID로 쓴 절차와 판단 기준. +- 실패 메시지와 고칠 파일. 메시지는 코드의 문자열을 그대로 옮긴다. + +## 이 폴더에 두지 않는 것 + +- **두 템플릿 공통 원칙.** design-docs의 원칙 문서에 둔다. +- **목록.** route ID, 오류 code, 게이트 목록을 여기에 적지 않는다. 정본 위치만 적는다(원칙 8). + - route ID: `src/features/installed-feature-contracts.ts`의 `ROUTE_REGISTRY` + - 게이트: `config/ci/gates.json` + - 백엔드 오류 code와 멱등성 응답: 백엔드 템플릿의 `clean-architecture-backend-template/docs/web/http-contract.md` +- **다른 repo의 계약 표.** 백엔드 멱등성 응답 표는 위 파일 §2가 정본이다. 위치만 적는다. +- **작업 이력.** `docs/reviews/`와 `docs/superpowers/`는 복사한 프로젝트가 지울 수 있다. 이 매뉴얼은 그 문서에 기대지 않는다. + +지금 구조가 아닌 설명은 링크하지 않는다. + +- `docs/architecture/frontend-ports-adapters-and-boundaries.md`의 "7. 권장 목표 디렉터리 구조". + - 목표안이다. 지금 기능 폴더 구조와 다르다. + - 지금 구조는 `docs/architecture/layers.md`가 정본이다. +- `docs/architecture/starter-experience.md`의 예전 "폴더 밖 수정" 4행 표와 "governance는 바뀌지 않는다" 문장(2026-11-01 리뷰 시점 판). + - 그 판은 실제로 고쳐야 하는 파일을 다 적지 않았다. + - 지금 판의 "Adding a feature" 절 표가 정본이다. 03 문서가 이 표를 링크한다. +- 참조 기능 페이지의 경로 문자열과 route 입력 cast. + - 지금은 고쳐졌다. 그래도 이 매뉴얼의 예시는 route ID와 `buildRouteUrl`로만 쓴다. + +## 문서와 코드가 다를 때 + +코드가 맞다. 이 매뉴얼은 주장이고, 근거는 코드·설정·실행 결과다. + +`docs/README.md` §1에서 이 폴더를 링크하면 `verify:documentation`(FE-GATE-017)이 이 폴더 문서에 적힌 경로·명령·게이트 ID가 있는지 검사한다. +폴더 링크는 그 폴더 바로 아래 `.md`만 검사한다. `reference/`도 검사하려면 따로 링크한다. +설명이 코드와 맞는지는 검사하지 않는다. + +플랫폼 규칙(예산·실행·검증·텔레메트리)의 근거는 `docs/architecture/`의 `scale-architecture.md`에 있다. 이 매뉴얼은 `scale-architecture.md` §24처럼 절 번호로 가리킨다. diff --git a/docs/manual/reference/create-feature.md b/docs/manual/reference/create-feature.md new file mode 100644 index 00000000..93dc002f --- /dev/null +++ b/docs/manual/reference/create-feature.md @@ -0,0 +1,165 @@ +# create:feature 참조 + +모든 merge 게이트를 통과하는 가장 작은 기능을 만드는 명령이다. 정본은 `scripts/create-feature.ts`이고, `--with-create`가 더하는 부분은 `scripts/create-feature-write-slice.ts`다. +`test:feature-scaffold`가 생성한 기능으로 `config/ci/gates.json`의 merge 단계 명령을 돌려 확인한다. 브라우저 게이트(FE-GATE-008·009의 브라우저 명령)와 `test:system`은 빼고 돈다. 뺀 명령과 이유는 `scripts/lib/feature-scaffold-drill.ts`에 있다. +템플릿 문자열이 두 파일 안에 있고, 참조 기능을 import하지 않는다. 그래서 참조 기능을 지운 프로젝트에서도 동작한다. + +## 사용법 + +```bash +corepack pnpm create:feature [--context ] [--with-create [--keyed]] [--package @scope/name@x.y.z --digest sha256:<64 hex> --revision ] +``` + +| 인자 | 규칙 | +|---|---| +| `` | 케밥 표기, 40자 이하. 기존 기능·context ID와 겹치면 거부 | +| `--context` | 기존 context ID. 없으면 `-context`를 새로 만든다 | +| `--with-create` | 짝 백엔드 `new-feature.sh`의 작성(`POST /`)·상세(`GET //{id}`)와 그 페이지를 더한다. 작성은 `NEVER` | +| `--keyed` | `--with-create`와 함께만. 작성을 `KEYED`로 만든다. 백엔드 create를 멱등성 executor 뒤에 둔 뒤에 쓴다 | +| `--package` | `@scope/name@<정확한 버전>`. `--digest`, `--revision`과 함께만 | +| `--digest` | `sha256:` + 소문자 hex 64자리 | +| `--revision` | 소스 리비전. 소문자 hex 7~64자리 | + +- ``: ID에서 끝의 `-feature`를 뗀 것이다. `invoice-feature`면 `invoice`. 모든 전역 ID의 접두어가 된다. +- API 경로: 짝 백엔드 `new-feature.sh`와 같은 규칙이다. ``의 camel 표기 뒤에 s, x, ch, sh로 끝나면 `es`, 자음+y로 끝나면 y를 `ies`로, 그 밖에는 `s`를 붙인다. `invoice` → `/invoices`, `purchase-order` → `/purchaseOrders`, `company` → `/companies`. 백엔드의 `api-base-path`는 `API_BASE_URL`에 붙인다. +- 패키지 인자가 없으면 자리표시자 신원을 쓰고 표준 오류로 경고한다. +- 패키지 인자가 있으면 계약 조립기와 같은 신원 검사(`composeContractContributions`)로 형식을 확인한다. + +## 하는 일 + +```text +인자 파싱 (틀리면 사용법 출력, 종료 코드 2) + → 생성기로 선언을 읽고, 설치된 라우트·topic·문구 키를 읽는다 + → 계획: ID 검사, 충돌 검사, topic 생성, navigationOrder 계산 + → 쓰기: 쓸 경로와 기능 폴더가 하나라도 있으면 아무것도 쓰지 않고 거부 + → 생성기 실행: 거부하면 만든 파일을 모두 지운다 + → 출력: 만든 파일, 다음 할 일 (종료 코드 0) +``` + +실패하면 `create:feature: <메시지>`를 표준 오류에 쓰고 종료 코드 1로 끝난다. 메시지는 [errors.md](errors.md#생성-명령-createfeature)에 있다. + +## 만드는 파일 + +기능 폴더 `src/features//`: + +- `feature-module.ts`: 선언 헤더(`FEATURE_MODULE_ID`, `FEATURE_CONTEXT_ID`)와 `FEATURE_MODULE` +- `feature-runtime.ts`: 실행 쪽. `feature-module.ts`가 동적으로만 import한다 +- `context-routes.ts`: context가 적재하는 라우트 +- `contracts/-feature-contract.ts`: 라우트, 무효화, 계약 패키지 신원 +- `contracts/-schemas.ts`: zod 스키마와 `zodValidator` 검증기 +- `contracts/-mapper.ts`: 와이어 값 → 화면 값 +- `contracts/-schema-metadata.ts`: 스키마 메타데이터(FE-REG-SCHEMA 행) +- `contracts/-contract-contribution.ts`: HTTP descriptor와 계약 기여. FE-REG-API 행은 여기서 뽑는다 +- `contracts/-message-catalog.ts`: ko-KR·en-US 문구 +- `application/-feature-api.ts`: input, gateway port, `ApplicationFeatureInputs` 보강 +- `adapters/-http-gateway.ts`: HTTP gateway +- `adapters/create--feature-input.ts`: 조립 기여(`needs: ["http", "telemetry"]`) +- `presentation/-feature-runtime.ts`: 지연 로드 페이지 표 +- `presentation/-routes.ts`: route ID → URL 함수(`buildRouteUrl`) +- `presentation/use--items.ts`: 쿼리 바인딩 +- `presentation/-list-page.tsx`: `CollectionPage` 목록 페이지. 결과 수는 `meta.page.total` + +`--with-create`가 더하는 파일: + +- `presentation/-route-codecs.ts`: 상세 라우트 params codec +- `presentation/use--item.ts`: 상세 쿼리 +- `presentation/use--create.ts`: 작성 뮤테이션 정책(`commandMutationIdentity`) +- `presentation/-form.ts`: 폼 스키마. 이름 길이는 요청 스키마의 상수(`_NAME_MAX_LENGTH` = 백엔드 `NAME_MAX_LENGTH` 100)를 쓴다 +- `presentation/-detail-page.tsx`: `DetailPage` +- `presentation/-create-page.tsx`: `FormPage`. 저장하면 상세를 연다. 결과 불명이면 `AsyncSurface`를 보인다 + +`domain/`은 만들지 않는다. 업무 규칙이 생기면 사람이 만든다. + +기능 테스트 폴더 `tests/features//`: + +- `-test-app.tsx`: 앱 전체를 조립해 로그인하고 URL로 들어가는 도우미. 페이지 테스트가 같이 쓴다 +- `-feature-input.test.ts`: input 단위 테스트 +- `-list-page.test.tsx`: 라우터를 거치는 페이지 테스트(목록, `meta.page.total`, 빈 목록, 실패 후 다시 시도) +- `-http-gateway.test.ts`: 짝 백엔드 본문을 손으로 적은 gateway 테스트. 하네스의 재시도 상한은 앱 기본값 2다 +- `-create-page.test.tsx`(`--with-create`): 201 저장 뒤 상세, 400 `_INVALID` 필드 오류와 다시 저장, 응답을 잃은 저장(`NEVER`는 다시 보내기 없음, `KEYED`는 같은 키로 다시 보내기) + +기능 폴더 밖: + +- `src/contexts/-context/context-module.ts`: 새 context일 때만 +- `artifacts/tests/a11y-manual/.md`: 라우트마다 pending 기록 + +## 뼈대 모양 + +- 라우트 1개: 파라미터·검색값 없는 목록, `session-required`, `feature-boundary`. +- GET 1개: `SAFE`, `EXTERNAL_BEARER`, 응답은 Envelope 안의 항목 배열. 목록 값은 `{ items, total }`이다. +- `--with-create`: 라우트 `_DETAIL`(`<목록>/items/:Id`)·`_CREATE`(`<목록>/new`), operation `_GET_ITEM`·`_CREATE_ITEM`. + - 작성 `NEVER`: `retryBudget: 0`, 멱등 키 없음. 응답을 잃으면 결과 불명이고 다시 보내기 버튼이 없다. + - 작성 `KEYED`(`--keyed`): `commandRecovery` `IDEMPOTENCY_REPLAY`, `retryBudget: 1`(503 `IDEMPOTENCY_UNAVAILABLE` 뒤 같은 키로 한 번). + - 둘 다 `acceptedStatuses: [201]`, `refusedBeforeWrite: ["_INVALID"]`, `classifyStatus`는 401·403·429를 `NOT_APPLIED`로 본다. 값과 이유는 [02 결정표 3절](../02-decision-tables.md#3-재시도-의미). +- 모든 operation이 `responseEnvelope: "ENVELOPE_V1"`이다. +- 쿼리 1개: `LIST_STANDARD` profile. +- 무효화 topic 1개, namespace 1개, edge 1개. +- 빈 배열 응답은 공유 빈 상태 화면으로 그린다. `tests/e2e/accessibility.spec.ts`는 이 목록 조회에 빈 목록을 Envelope 모양으로 답하고, 경고 상자가 없는지 본 뒤 axe를 돌린다. 그래서 생성한 라우트는 빈 상태 화면으로 검사된다. + +한도·마감 같은 숫자는 `scripts/create-feature.ts`의 템플릿이 정본이다. + +생성된 문구는 자리 채움이다. ko-KR 설명 문구가 "제품 문구로 바꾸세요"라고 적혀 있다. 제품 문구로 바꾼다. + +## 하지 않는 일 + +- 레지스트리 기준선, governance, 중앙 카탈로그를 고치지 않는다. 고칠 필요가 없다. +- `README.md`나 문서를 고치지 않는다. +- `tests/mocks/` 공유 파일을 고치지 않는다. +- `package.json`, `src/features/product-capabilities.ts`, `src/bootstrap/product-composition.ts`, `src/contracts/product-contracts.ts`를 고치지 않는다. +- a11y 기록에 서명하지 않는다. +- 실제 계약 패키지를 설치하지 않는다. + +## 출력 + +표준 출력: + +```text +create:feature: in (new context), route at + created <파일> ... + +Next: + 1. Before a release, have a person review and sign artifacts/tests/a11y-manual/.md (FE-GATE-028). ... + 2. Run the merge gates: corepack pnpm ci:gate -- FE-GATE- for each gate of the merge stage ... + The feature's own tests: node scripts/run-vitest.ts run tests/features/ ... + The registry baseline does not change: ... +``` + +패키지 인자가 없을 때 표준 오류: + +```text +create:feature warning: no --package was given, so src/features//contracts/-feature-contract.ts pins the placeholder contract identity. ... +``` + +이 경고가 나오면 [03 문서의 "자리표시자 계약 신원 교체"](../03-outside-feature-folder.md#자리표시자-계약-신원-교체)를 릴리스 전에 한다. + +## 되돌리기 + +생성한 기능을 지우려면 만든 것을 지우고 생성기를 다시 돌린다. + +```bash +rm -r src/features/ tests/features/ artifacts/tests/a11y-manual/.md +rm -r src/contexts/-context # 새 context를 만들었을 때만 +corepack pnpm generate:feature-index +node scripts/write-dev-release-manifest.ts # dev manifest에서 그 기능의 계약 패키지를 뺀다 +``` + +생성 명령은 `public/release-manifest.json`(dev server가 내주는 manifest)의 `contractSet`에 기능의 계약 패키지를 더한다. 기능과 함께 커밋한다. 낡으면 `tests/unit/dev-release-manifest.test.ts`가 다시 쓰는 명령을 말하며 실패하고, `corepack pnpm dev`는 `CONTRACT_SET_PACKAGE_MISSING`·`CONTRACT_SET_PACKAGE_UNEXPECTED`로 부팅하지 못한다. + +## 이 명령을 지키는 검사 + +- `tests/unit/create-feature.test.ts` (`test:unit`, FE-GATE-005) + - 렌더 결과만 본다. 저장소를 건드리지 않는다. + - 접두어, 참조 기능 이름이 없음, topic 형식과 충돌, `navigationOrder`, 거부 조건, 덮어쓰기 거부와 되돌리기. + - 백엔드 경로 규칙, `--with-create`·`--keyed`의 descriptor 값, 모든 operation의 Envelope 선언. + - 생성한 context 선언을 임시 폴더에 써서 생성기의 선언 읽기(`createFileSystemDeclarationSource`)로 읽고, 그 모듈을 import해 라우트 루트가 기능 라우트를 모두 받는지 앱 모듈 조립으로 확인한다. +- `test:feature-scaffold` (FE-GATE-020) + - 저장소 복사본에 기능 둘(기본 하나, `--with-create --keyed` 하나)을 만들고 커밋한 뒤 게이트를 돈다. + - 타입, lint, 아키텍처, 레지스트리, i18n, 디자인 시스템, 진단, 문서, unit, component, integration, 기능 테스트, 커버리지, CI 계약, 빌드. +- `test:sample-removal` (FE-GATE-020) + - 참조 기능을 지운 복사본에서 이 명령(`--with-create`)으로 기능을 만들고 같은 게이트를 다시 돈다. 명령과 쓰기 slice가 참조 기능에 기대지 않는다는 증거다. + +## 알려진 한계 + +- `--context reference-context`로 참조 context에 넣은 기능은 경로가 `/examples/reference-resources/`다. 참조 기능을 지우면 context가 남고 그 경로가 제거 드릴의 잔여 검사에 걸린다. 남길 기능은 제품 context에 둔다. +- 드릴은 브라우저 테스트(FE-GATE-008·009의 `test:e2e`, `test:a11y` 등)와 `test:system`을 돌리지 않는다. `check:bundle`(FE-GATE-012)은 돈다. +- 새 context는 앱이 하나일 때만 만든다. 앱이 여럿이면 `--context`로 기존 context를 고른다. diff --git a/docs/manual/reference/errors.md b/docs/manual/reference/errors.md new file mode 100644 index 00000000..5ba0d59e --- /dev/null +++ b/docs/manual/reference/errors.md @@ -0,0 +1,199 @@ +# 실패 메시지와 고칠 파일 + +기능을 만들 때 흔히 보는 실패 메시지다. 메시지는 코드의 문자열을 그대로 옮겼다. `<...>`는 실제 값이 들어가는 자리다. + +찾는 법: 메시지 앞부분으로 이 문서를 검색한다. 없으면 `git grep '<메시지 앞부분>' -- src scripts`로 코드를 찾는다. 코드가 정본이다. + +메시지가 어느 단계에서 나오는지: + +```text +create:feature → 명령이 파일을 쓰기 전에 거부 +generate:feature-index → 모든 빌드·검사 명령이 먼저 돌린다 +조립·모듈 로드 → 테스트, 빌드, 앱 부팅 어디서든 +check:registries → FE-GATE-010 +lint / check:architecture / check:i18n → FE-GATE-002, FE-GATE-010 +문서·접근성 → FE-GATE-017, FE-GATE-009, FE-GATE-028 +릴리스 승인·공급망 → FE-GATE-027, FE-GATE-012 +제거 드릴 → FE-GATE-020 +``` + +``는 기능 ID에서 끝의 `-feature`를 뗀 것이다. + +--- + +## 생성 명령 (create:feature) + +모두 `create:feature: ` 뒤에 나온다. 종료 코드는 1이다(인자 오류는 2). + +| 메시지 | 원인 | 고칠 곳 | +|---|---|---| +| `feature id "" must be kebab-case (lower-case words joined by single hyphens), at most 40 characters` | ID 형식 | 명령 인자 | +| `context id "" must be kebab-case (lower-case words joined by single hyphens), at most 64 characters` | `--context` 형식 | 명령 인자 | +| `feature id is already a feature or context` | 같은 ID가 있다 | 다른 ID | +| `feature id would prefix its ids with "", which already uses` | 접두어가 기존 기능과 같다 | 다른 ID | +| `context already exists; pass --context to add the feature to it` | 새로 만들 context가 이미 있다 | `--context `를 준다 | +| `context id is a feature id` | context ID가 기능 ID와 같다 | 다른 `--context` | +| `src/contexts has a directory without a context declaration` | 선언 없는 context 폴더 | `src/contexts//context-module.ts`를 만들거나 폴더를 지운다 | +| `another context already owns the route root /*` | 같은 라우트 루트를 다른 context가 가진다 | 다른 ID, 또는 그 context에 `--context`로 넣는다 | +| `a new context needs exactly one deployable app (declared: ); pass --context ` | 앱이 여럿이라 새 context의 소속을 정할 수 없다 | `--context` | +| `route (, ) collides with installed route (, )` | route ID·경로·chunk가 겹친다 | 다른 ID | +| `message keys already exist: ` | 문구 키가 겹친다 | 다른 ID | +| `generated topic is already installed; run the command again` | 무작위 topic이 우연히 겹쳤다 | 명령을 다시 돌린다 | +| `contract package @ is not a pinned identity: ` | 패키지 신원 형식. `` 예: `: package version must be exact SemVer`, `: package digest`, `: package sourceRevision`, `: packageId` | `--package`, `--digest`, `--revision` | +| `--package, --digest and --revision go together. ...` | 셋 중 일부만 줬다 | 셋을 함께 준다 | +| `--package must be @scope/name@. ...` | 버전 없는 패키지 이름 | `@scope/name@1.2.3` 꼴 | +| `--keyed needs --with-create. ...` | `--keyed`만 줬다 | `--with-create --keyed` | +| `refusing to overwrite: ` | 쓸 파일이나 기능 폴더가 이미 있다 | 그 경로를 확인하고 지우거나 다른 ID | +| `the feature index generator rejected the feature, nothing was kept:` | 생성기가 거부했다. 만든 파일은 모두 지웠다 | 뒤따르는 생성기 메시지(아래 절) | + +--- + +## 생성기 (generate:feature-index) + +| 메시지 | 원인 | 고칠 곳 | +|---|---|---| +| `Feature belongs to undeclared context ` | context 선언이 없거나 `FEATURE_CONTEXT_ID` 오타 | `src/contexts//context-module.ts`, 또는 `src/features//feature-module.ts` | +| `Context belongs to undeclared app ` | `CONTEXT_APP_ID` 오타 | `src/contexts//context-module.ts` | +| ` must export a literal ` | 헤더를 상수 참조나 식으로 썼다. 생성기는 글자로 읽는다 | 그 파일. `export const = "<값>";` 꼴 | +| ` must export a positive integer ` | 예산 값이 정수 리터럴이 아니다 | 그 파일 | +| `src/features/ has no feature-module.ts; add one or mark the directory with NOT_A_FEATURE` | 기능 폴더에 선언 파일이 없다 | `feature-module.ts`를 만들거나, 기능이 아닌 샘플 폴더면 `NOT_A_FEATURE` 파일을 둔다 | +| `src/features/ has both feature-module.ts and NOT_A_FEATURE; …` | 기능이 아니라고 표시한 폴더에 선언 파일이 있다 | 기능으로 설치하려면 `NOT_A_FEATURE`를 지운다. 설치하지 않으려면 `feature-module.ts`를 지운다 | +| `Duplicate generated feature ids: ` | 두 폴더가 같은 `FEATURE_MODULE_ID` | 한쪽 `feature-module.ts` | +| `Duplicate context id: ` | 두 폴더가 같은 `CONTEXT_MODULE_ID` | 한쪽 `context-module.ts` | +| `Context feature cardinality exceeds budget ` | context의 기능 수가 예산을 넘었다 | `CONTEXT_MAX_FEATURES`, 또는 새 context | +| `App context cardinality exceeds budget ` | 앱의 context 수가 예산을 넘었다 | `src/apps//app-module.ts`의 `APP_MAX_CONTEXTS` | + +--- + +## 조립·모듈 로드 + +테스트, 빌드, 앱 부팅 어디서든 나온다. 한 기능의 실수가 거의 모든 게이트를 같이 실패시킨다. 첫 메시지를 본다. + +### 인증 프로필 + +| 메시지 | 원인 | 고칠 곳 | +|---|---|---| +| `/: unknown authProfileId ` (계약 조립 오류의 `reason`) | 없는 인증 프로필 | `contracts/-contract-contribution.ts`의 `frontend.authProfileId`. 제품 프로필이면 `src/contracts/product-contracts.ts` | +| `/: with cookie profile must require x-csrf-token or x-xsrf-token` (계약 조립 오류의 `reason`) | 쿠키 인증 프로필로 쓰기 요청을 보내는데 프로필이 CSRF 헤더를 요구하지 않는다 | `src/contracts/product-contracts.ts`의 그 프로필 `requiredCredentialHeaders`. 짝 백엔드는 `x-xsrf-token` | +| `Product REST auth profile reuses a template profile id.` | 제품 프로필 ID가 템플릿 것과 같다 | `src/contracts/product-contracts.ts` | + +### 계약·스키마·mapper + +| 메시지 | 원인 | 고칠 곳 | +|---|---|---| +| 부팅 화면 `CONTRACT_SET_PACKAGE_MISSING` / `CONTRACT_SET_PACKAGE_UNEXPECTED`(`corepack pnpm dev`, dev server를 쓰는 브라우저 테스트) | dev manifest `public/release-manifest.json`의 계약 패키지가 설치된 기능과 다르다. 기능을 손으로 더하거나 지웠다 | `node scripts/write-dev-release-manifest.ts`로 다시 쓰고 커밋한다. `tests/unit/dev-release-manifest.test.ts`가 같은 어긋남을 잡는다 | +| `Invalid or duplicate schema definition: ` | 스키마 ID 중복 또는 메타 형식 | `contracts/-schema-metadata.ts`. 접두어를 붙인다 | +| `duplicate operation: ` (계약 조립 오류의 `reason`) | operation ID 중복 | `contracts/-contract-contribution.ts`. 접두어를 붙인다 | +| `FE-REG-API..requestSchema references unknown FE-REG-SCHEMA.schemaId=` | descriptor의 입력 스키마 ID가 스키마 메타데이터에 없다 (`responseSchema`, `problemSchema`도 같은 꼴. 실패 본문 행은 `boundary: "api-problem"`) | `contracts/-schema-metadata.ts` | +| `: row , used as ` (`tests/unit/schema-metadata-policy.test.ts`) | 스키마 메타 행의 `boundary`가 그 스키마가 쓰인 자리와 다르다. `no FE-REG-SCHEMA row`는 쓰이는데 행이 없다 | `contracts/-schema-metadata.ts` | +| `Unregistered route codec: ` | URL 함수가 기능 codec을 `buildRouteUrl`에 넘기지 않았다 | `presentation/-routes.ts` | +| `contract package is declared, but no loaded contribution pins it` | 계약 `contractPackages`에 적은 패키지를 계약 기여가 쓰지 않는다 | `contracts/-contract-contribution.ts`의 `source` | +| ` contributes contract package , which no installed feature declares in contracts.contractPackages` | 계약 기여의 신원과 계약 선언의 신원이 다르다 | 둘 다 `_CONTRACT_PACKAGE` 하나를 쓰게 한다 | +| `contract package is declared with conflicting identities` | 두 기능이 같은 패키지를 다른 버전·digest로 선언했다 | 두 기능의 `_CONTRACT_PACKAGE`를 맞춘다 | + +계약 조립 실패의 메시지는 `Installed contract contribution is not composable: `이다. `reason`은 오류 객체(`ContractContributionError`)의 `reason` 속성에도 있다. + +| `reason` | 원인 | 고칠 곳 | +|---|---|---| +| `: TEMPLATE_FIXTURE REFERENCE_FEATURE_V1 belongs to reference-feature only; pin an EXTERNAL_PACKAGE` | 참조 기능 전용 출처를 다른 기능이 썼다 | `contracts/-contract-contribution.ts`의 `source`를 `EXTERNAL_PACKAGE`로 | +| `duplicate operation: ` | 두 기여가 같은 operation ID | 접두어를 붙인다 | +| `duplicate contributionId: ` | 두 기여가 같은 `contributionId` | `contracts/-contract-contribution.ts` | +| `/: unknown authProfileId ` | V3 `frontend.authProfileId`가 없는 프로필 | V3 `frontend.authProfileId` | +| `/: retry budget contradicts NEVER retry semantics` | `NEVER`인데 `retryBudget`가 0이 아니다 | V3 `frontend.retryBudget` | +| `/: KEYED commands require a recovery descriptor` | `KEYED`인데 `commandRecovery`가 없다 | V3 `commandRecovery` | +| `/: is a read; its retrySemantics is SAFE or IDEMPOTENT, not <값>` | 읽기에 `KEYED`나 `NEVER`를 적었다 | V3 `retrySemantics`. 재시도를 막으려면 `frontend.retryBudget: 0` | +| `/: command operations require a command effect descriptor` | 쓰기에 `commandEffect`가 없다 | V3 `commandEffect` | +| `/: read operations carry no command descriptors` | GET에 `commandEffect`·`commandRecovery`를 적었다 | 둘 다 `null` | +| `/: responseEnvelope NONE, but in the same contribution reads ENVELOPE_V1; ...` | 한 계약 기여 안에서 operation 하나만 응답 모양이 다르다. 손으로 더한 operation에 `responseEnvelope` 줄을 빠뜨린 경우다 | 그 operation에 `responseEnvelope: "ENVELOPE_V1" as const`를 적는다. 정말 다른 백엔드면 기여를 나눈다 | +| `: package version must be exact SemVer` | 버전 범위(`^1.2.0`)나 형식 오류 | `_CONTRACT_PACKAGE.version` | + +### 라우트·context + +| 메시지 | 원인 | 고칠 곳 | +|---|---|---| +| `Duplicate route registry key: ` | route ID 중복 | 계약 `routes`. 접두어를 붙인다 | +| `Duplicate route runtime contract key: ` | `routeRuntimeContracts` 중복 | 계약 `routeRuntimeContracts` | +| `Route () of feature is not under the route root of its context (): the router would answer NOT_FOUND.` | 라우트가 context 루트 밖 | 계약 `routes.*.path`, 또는 `CONTEXT_ROUTE_PATH` | +| `Route () of feature is not under the route root of its context (): context () takes that URL.` | 다른 context의 루트 아래 | 같은 곳 | +| `Route handle loaded by context is not a contract route of its features ().` | `context-routes.ts`의 handle이 계약에 없는 route ID | `src/features//context-routes.ts` | + +### 문구·서버 상태 + +| 메시지 | 원인 | 고칠 곳 | +|---|---|---| +| `Duplicate message key: ` | 문구 키 중복 | `contracts/-message-catalog.ts`. 접두어를 붙인다 | +| `Duplicate invalidation topic: ` | topic 중복. 복사한 topic | 계약 `invalidation`. topic을 새로 만든다 | +| `Duplicate invalidation namespace: ` | namespace 중복 | `defineQueryNamespaceIdentity` 이름 | +| `Query invalidation topic is invalid.` | topic 형식이 `qinv.` + 26자가 아니다 | `defineQueryInvalidationTopic` 값 | +| `Orphan invalidation topic: ` | edge가 없는 topic | 계약 `invalidation.edges` | +| `Unregistered server-state profile: ` | 없는 profile | 쿼리 바인딩의 `profileId` | +| `commandMutationIdentity: is a GET; a mutation binds a write operation` | 뮤테이션 정책에 읽기 descriptor를 넘겼다 | 정책의 `commandMutationIdentity(...)` 인자를 쓰기 descriptor로 | + +### 조립 기여 + +| 메시지 | 원인 | 고칠 곳 | +|---|---|---| +| `feature needs , which the host did not provide` | 템플릿이 만들지 않는 capability | `src/bootstrap/product-composition.ts`의 `capabilities`, 또는 `needs` | +| `feature adapter contribution installed an input for ` | 기여의 `featureId`와 만든 input의 `featureId`가 다르다 | `adapters/create--feature-input.ts` | +| `duplicate feature adapter contribution: ` | 두 기여가 같은 기능 ID | 복사한 기여 파일 | +| `Feature installed an input for ` | 지연 로드한 기능이 다른 기능의 input을 냈다 | `adapters/create--feature-input.ts` | + +--- + +## 레지스트리 (check:registries) + +모두 `Registry governance failed:` 다음 줄에 나온다. + +| 메시지 | 원인 | 고칠 곳 | +|---|---|---| +| `FE-REG-ROUTE. duplicates path= from ` | 경로 중복 (`chunkId=`도 같은 꼴) | 계약 `routes` | +| `FE-REG-ROUTE..loadingSurface value does not match ` | 로딩 화면 이름이 케밥 표기가 아니다 | 계약 `routes.*.loadingSurface` | +| `FE-REG-ROUTE.. has unknown value ` | `access`·`errorSurface`가 정해진 값이 아니다 | 계약 `routes` | +| `FE-REG-ROUTE..paramsSchema references unknown FE-REG-SCHEMA.schemaId=` | 라우트 스키마 ID를 기능이 등록하지 않았다 (`searchSchema`도 같은 꼴) | 계약 스키마 메타 | +| `FE-REG-API. has no executable consumer for operationId=` | 계약의 operation을 기능 `adapters/`·`application/`에서 쓰지 않는다 | 쓰지 않으면 descriptor를 지운다 | +| `missing registry source : (reason: )` | 레지스트리 source를 읽다가 오류가 났다. 계약 조립 실패면 ``이 위 `reason` 표의 값이다. 읽지 못한 레지스트리는 `removed` 증거를 요구하지 않는다 | ``이 가리키는 곳 | +| `breaking change missing evidence: ` | 행을 빼거나 바꿨는데 승인이 없다 | `update:registry-baseline` 또는 `config/contracts/registry-change-evidence.json` | +| `stale breaking evidence : no breaking change in the current diff has this changeId. ...` | 지금 diff와 맞지 않는 증거 행 | 그 행을 지운다 | +| `registry baseline approval digest mismatch: approved= actual=` | 기준선 파일을 손으로 고쳤다 | `update:registry-baseline`으로 다시 찍는다 | + +--- + +## 경계·lint·문구 + +| 메시지 | 원인 | 고칠 곳 | +|---|---|---| +| `check:architecture` 출력의 규칙 이름 (`feature-presentation-does-not-know-outbound-adapters` 등) | 금지된 import | 규칙 뜻은 `docs/architecture/layers.md`의 "Rules" 표가 정본 | +| `Screen words come from the message catalog: use message(key) (0929/08-02).` | 화면에 문자를 직접 썼다 | 문구 catalog에 키를 더하고 `message(key)` | +| `en-US catalog keys do not match ko-KR` (`I18n contract failed:` 다음) | 두 locale의 키가 다르다 | `contracts/-message-catalog.ts` | +| `en-US: interpolation parameters do not match` | `{name}` 자리가 locale마다 다르다 | 같은 파일 | + +--- + +## 문서·접근성 + +| 메시지 | 원인 | 고칠 곳 | +|---|---|---| +| `artifacts/tests/a11y-manual/ has no record for route IDs: ` (`verify:documentation`) | 라우트의 a11y 기록 파일이 없다 | 기존 pending 기록을 복사해 제목과 `Route ID`를 바꾼다 | +| `Manual accessibility record format is invalid:` 다음 `artifacts/tests/a11y-manual/.md: missing record` (FE-GATE-009) | 같은 원인 | 같은 곳 | +| `Manual accessibility evidence is incomplete:` 다음 `: ` (FE-GATE-028) | 서명하지 않은 기록 | [03 문서](../03-outside-feature-folder.md#수동-접근성-검토-서명) | +| `release IDs do not match` (FE-GATE-028) | 라우트마다 다른 릴리스로 검토했다 | 같은 릴리스 후보로 다시 검토한다 | +| ` names paths that do not exist: ` (`verify:documentation`) | 문서가 없는 경로를 적었다 | 그 문서 | + +--- + +## 릴리스 승인·공급망 + +| 메시지 | 원인 | 고칠 곳 | +|---|---|---| +| `release admission refused for :` 다음 `contractPackages.: pins the placeholder identity create:feature writes; pin the published package's version, digest and revision` (FE-GATE-027) | 자리표시자 계약 신원으로 공개 대상 승인 | [03 문서 "자리표시자 계약 신원 교체"](../03-outside-feature-folder.md#자리표시자-계약-신원-교체) | +| `high-risk dependency missing review: add:@` (`generate:supply-chain`) | production 의존성을 더했는데 검토 기록이 없다 | `config/security/dependency-change-evidence.json` | + +--- + +## 제거 드릴 + +| 메시지 | 원인 | 고칠 곳 | +|---|---|---| +| ` removal failed:` 다음 `fixture-id-residue: residue: ` (`test:sample-removal`) | 기능을 지운 뒤에도 `src`·`tests`에 기능 ID를 담은 파일이 남았다 | 그 파일을 기능 폴더 안으로 옮기거나, 기능 ID를 담지 않게 한다 | +| `No installed feature declares FEATURE_MODULE_ID ""` | `--feature=`에 없는 기능 ID | 명령 인자 | +| `feature scaffold failed:` 다음 `: ` (`test:feature-scaffold`) | 생성한 기능이 게이트 하나를 통과하지 못했다 | `scripts/create-feature.ts`의 템플릿. 제품 팀이 아니라 템플릿을 고칠 일이다 | diff --git a/docs/manual/reference/global-ids.md b/docs/manual/reference/global-ids.md new file mode 100644 index 00000000..d4c97522 --- /dev/null +++ b/docs/manual/reference/global-ids.md @@ -0,0 +1,64 @@ +# 전역 ID + +전역 ID는 기능 하나가 아니라 설치된 기능 전체가 함께 쓰는 공간의 이름이다. +두 기능이 같은 값을 쓰면 조립·레지스트리 검사에서 충돌하거나, 아무 검사 없이 조용히 섞인다. + +규칙은 하나다(원칙 5). + +- 모든 전역 ID에 기능 접두어를 붙인다. +- 무작위 값(무효화 topic)은 복사하지 않고 새로 만든다. + +`create:feature`는 이 규칙대로 값을 만든다. 아래 표의 "생성 값" 열은 `invoice-feature`로 만들었을 때다. +접두어 꼴: `` = `invoice`, `` = `INVOICE`, `` = `Invoice`. + +## 표 + +"검사 없음"은 이 커밋에서 유일성 검사를 찾지 못했다는 뜻이다. 접두어만이 충돌을 막는다. + +| ID | 어디에 있나 | 생성 값 | 겹치면 | +|---|---|---|---| +| 기능 ID | `feature-module.ts`, 계약 `featureId`, `ApplicationFeatureInputs` 키, `FEATURE_OVERRIDES` 키 | `invoice-feature` | 생성 명령·생성기가 거부 (`Duplicate generated feature ids`) | +| context ID | `context-module.ts`, `FEATURE_CONTEXT_ID` | `invoice-context` | 생성 명령·생성기가 거부 (`Duplicate context id`) | +| route ID | 계약 `routes`, `routeRuntimeContracts`, 문구 키 | `INVOICE_LIST` | 조립 (`Duplicate route registry key`) | +| 라우트 경로 | 계약 `routes.*.path` | `/invoice` (새 context), `/<루트>/invoice` (기존 context) | `check:registries` (`duplicates path=`) | +| `chunkId` | 계약 `routes` | `route-invoice-list` | `check:registries` (`duplicates chunkId=`) | +| `moduleId` | `routeRuntimeContracts`, 지연 페이지 표 | `invoice-list-page` | `check:registries` (FE-REG-ROUTE-RUNTIME) | +| `loadingSurface` | 계약 `routes` | `invoice-list` | 검사 없음 (형식만 본다) | +| operation ID | descriptor, gateway | `INVOICE_LIST_ITEMS` | 계약 조립 (`duplicate operation`) | +| API 경로 | descriptor `pathTemplate` | `/invoices` | 검사 없음. 백엔드 계약을 따른다 | +| 스키마 ID | 스키마 메타데이터, zod 검증기 | `InvoiceNoRequest`, `InvoiceItemListPayload`, `InvoiceProblem` | 모듈 로드 (`Invalid or duplicate schema definition`) | +| `contributionId` | 계약 기여 | `invoice-feature-http-v1` | 계약 조립 (`duplicate contributionId`) | +| `policyId` | descriptor `frontend` | `INVOICE_LIST_V1` | 검사 없음 | +| `diagnosticsOperation` | descriptor `frontend` | `invoice.list` | 검사 없음 | +| 쿼리 namespace | 계약 `invalidation.namespaces`, 쿼리 바인딩 | `invoice-item` (버전 1) | 조립 (`Duplicate invalidation namespace`) | +| 무효화 topic | 계약 `invalidation.topics`, 뮤테이션 `invalidate` | `qinv.` + 무작위 26자 | 생성 명령이 설치된 topic과 비교, 조립 (`Duplicate invalidation topic`) | +| 쿼리·뮤테이션 `definitionId` | 쿼리 바인딩 | `invoice-item-list-v1` | 검사 없음 | +| 문구 키 | 기능 문구 catalog | `route.INVOICE_LIST.title`, `invoice.list.title` 등 | 생성 명령, 조립 (`Duplicate ko-KR message key`) | +| telemetry `kind` | application input | `invoice.list.failed` | 검사 없음 | +| `owner` | 스키마 메타데이터 | `feature-frontend-invoice-feature` | 검사 없음 | +| 인증 프로필 ID | descriptor `frontend.authProfileId` | `EXTERNAL_BEARER` (템플릿 것을 씀) | 제품 프로필이 템플릿 ID를 쓰면 모듈 로드 (`reuses a template profile id`) | +| `navigationOrder` | 계약 `routes` | 설치된 최댓값 + 10 | 검사 없음. 같은 숫자가 둘이어도 통과 | + +메시지 전체와 고칠 파일은 [errors.md](errors.md)에 있다. + +## 손으로 ID를 더할 때 + +뼈대에 operation·라우트·topic을 더하면 생성 명령이 다시 돌지 않는다. 아래를 직접 지킨다. + +- 접두어를 붙인다. `NoRequest`, `ItemList` 같은 일반 이름을 쓰지 않는다. +- 무효화 topic은 새로 만든다. + - 형식: `qinv.` + 소문자·숫자 26자. + - `scripts/create-feature.ts`의 `randomTopicSuffix`가 같은 형식으로 만든다. + - 다른 기능이나 참조 기능의 값을 복사하지 않는다. +- route ID는 `_<화면>` 꼴로 짓는다(`INVOICE_DETAIL`). 라우트를 더하면 a11y 기록 파일도 더한다(`artifacts/tests/a11y-manual/.md`). +- 문구 키는 ko-KR과 en-US에 같은 키를 넣는다. `check:i18n`이 비교한다. + +## 정본 위치 + +설치된 값의 목록은 이 문서에 두지 않는다. 코드에서 본다. + +- 라우트: `src/features/installed-feature-contracts.ts`의 `ROUTE_REGISTRY` +- 무효화 topic·namespace: 같은 파일의 `INVALIDATION_REGISTRY` +- 문구 키: `src/presentation/i18n/catalog.ts`의 `KO_MESSAGES` +- 템플릿 인증 프로필: `src/contracts/rest-profiles.ts`의 `REST_AUTH_PROFILES` +- 레지스트리 스냅샷: `config/contracts/registry-baseline.json` diff --git a/docs/manual/reference/patterns.md b/docs/manual/reference/patterns.md new file mode 100644 index 00000000..2c2ba0ee --- /dev/null +++ b/docs/manual/reference/patterns.md @@ -0,0 +1,137 @@ +# 기능 개발 패턴 + +기능을 만들 때 쓰는 패턴과, 그 패턴의 정의와 예제가 어디 있는지 적는다. + +- **정의**: 플랫폼(기능 밖)에서 패턴을 제공하는 파일. +- **예제**: 복사해 볼 수 있는 기능 코드. `생성 뼈대`는 `create:feature`가 만드는 코드다. `쓰기 slice`는 `create:feature --with-create`가 더 만드는 코드다(짝 백엔드 Envelope 모양). `참조 기능`은 src/features/reference-feature/다(Envelope가 아닌 problem details 모양). 참조 기능은 지울 수 있으므로 그 경로는 백틱 없이 적는다. 백틱 경로는 문서 검사(`verify:documentation`)가 존재를 확인한다. +- 예제가 없는 패턴은 **없음**이라고 적었다. 그 패턴은 정의를 읽고 직접 쓴다. + +참조 기능은 예제일 뿐이다. 복사해 이름을 바꾸지 않는다. 모양을 보고 생성 뼈대에 옮긴다. + +## 기능 조립 + +| 패턴 | 정의 | 예제 | 검사 | +|---|---|---|---| +| 기능 모듈 등록 | `src/features/feature-module.ts` (`defineFeatureModule`, `defineFeatureRuntime`), 생성기 | 생성 뼈대 `feature-module.ts`, `feature-runtime.ts` | 생성기, 기능 ID와 계약 `featureId` 일치 | +| context 소속 선언 | `src/contexts/bounded-context-module.ts` | 참조 기능의 src/contexts/reference-context/context-module.ts | 생성기(없는 context, 예산), 앱 모듈(루트 밖 라우트) | +| context 전용 레이아웃 | `docs/architecture/starter-experience.md` "Product home and layouts" | `tests/helpers/fixture-layout-product.tsx` (테스트 fixture) | `tests/component/context-layouts.test.tsx` | +| 앱 홈 대신하기 | `src/contracts/routes.ts`의 `FEATURE_REPLACEABLE_PLATFORM_ROUTE_IDS` | 없음 (기능 예제) | 조립 (두 기능이 `APP_HOME`을 선언하면 실패) | +| 조립 기여(`needs`) | `src/features/feature-adapter-contribution.ts` | 생성 뼈대 `adapters/create--feature-input.ts` | 조립 (없는 capability, 다른 기능의 input) | +| 제품 capability | `src/features/product-capabilities.ts`(타입), `src/bootstrap/product-composition.ts`(값), `src/bootstrap/product-composition-contract.ts` | `recipes/frontend-capabilities/indexeddb-feature-capability.ts` | `check:types` | +| 기능 끄기 | `config/runtime/.json`의 `FEATURE_OVERRIDES` | `config/runtime/local.json` | 참조 기능의 tests/component/product-feature-switch.test.tsx | + +## 라우트 + +| 패턴 | 정의 | 예제 | 검사 | +|---|---|---|---| +| 라우트 선언 | `src/contracts/routes.ts`, `src/contracts/route-runtime-contract.ts` | 생성 뼈대 계약 `routes`, `routeRuntimeContracts` | 조립(중복 route ID), `check:registries`(경로·chunk 중복) | +| context 라우트 적재 | `src/platform/routing/context-route-module.ts` | 생성 뼈대 `context-routes.ts` | context 적재(계약에 없는 handle) | +| route ID로 URL 만들기 | `src/presentation/routes/route-codecs.ts`의 `buildRouteUrl` | 생성 뼈대 `presentation/-routes.ts`, 참조 기능 `presentation/reference-routes.ts` | 타입(기능의 route ID만 받음) | +| 파라미터·검색값 codec | `src/presentation/routes/route-codecs.ts` | 쓰기 slice `presentation/-route-codecs.ts`(상세 params), 참조 기능 `presentation/reference-route-codecs.ts` | 해석 실패 시 잘못된 경로 화면 | +| URL 검색값 읽기 | `src/presentation/routes/route-input.tsx`의 `useRouteInput` + 검색값 codec | 참조 기능 `presentation/reference-routes.ts` | 해석 실패 시 잘못된 경로 화면 | +| URL 검색값을 바꾸는 폼 | `buildRouteUrl`의 `search`, 디자인 시스템 `SearchField`, `CollectionPage`의 `toolbar` | 기능 예제 없음. 아래 짧은 예 | 라우터를 거치는 페이지 테스트 | + +### URL 검색값을 바꾸는 폼 (짧은 예) + +검색값의 정본은 URL이다. 입력 중인 글자만 state에 둔다. + +```text +사용자가 검색어를 입력한다 (state의 draft만 바뀐다) + → 제출하면 navigate(목록 URL + ?q=...) + → 라우터가 검색값 codec으로 q를 읽는다 + → 목록 쿼리 입력이 바뀌어 GET을 다시 보낸다 +``` + +준비: + +- 목록 라우트의 `searchSchema`와 `routeRuntimeContracts`의 `searchCodec`. +- 그 codec을 `context-routes.ts` handle의 `codecs`와 URL 함수(`buildRouteUrl`의 세 번째 인자)에 함께 넘긴다. +- 검색값을 읽는 hook. 참조 기능 `reference-routes.ts`의 `useReferenceListFilters`가 예제다. + +```tsx +// 공지 기능의 목록 페이지. noticeRouteUrl은 생성된 -routes.ts의 URL 함수다. +const navigate = useNavigate(); +const listQuery = useNoticeListQuery(); // URL 검색값 읽기 +const [draft, setDraft] = useState(listQuery.q ?? ""); +const search = (q: string) => + void navigate(noticeRouteUrl("NOTICE_LIST", q.trim() ? { search: { q: q.trim() } } : {})); + + { event.preventDefault(); search(draft); }}> + setDraft(event.currentTarget.value)} + onClear={() => { setDraft(""); search(""); }} + /> + + + } + /* heading, resultCount, children은 생성된 목록 페이지와 같다 */ +/> +``` + +## API와 검증 + +| 패턴 | 정의 | 예제 | 검사 | +|---|---|---|---| +| HTTP 계약 | `src/contracts/external-contract-runtime.ts` | 생성 뼈대 `contracts/-contract-contribution.ts` | 계약 조립, `check:registries` (FE-REG-API 행은 `src/contracts/api-operations.ts`의 `projectApiOperationRows`가 뽑는다) | +| 스키마 메타데이터 | `src/contracts/schema-registry.ts`의 `SchemaDefinition` | 생성 뼈대 `contracts/-schema-metadata.ts` | `check:registries` (FE-REG-SCHEMA) | +| 배포된 계약 패키지 출처 | 같은 파일의 `EXTERNAL_PACKAGE` | 생성 뼈대(자리표시자 또는 `--package` 신원). 실제 `@org-contracts/*` 패키지를 import하는 예제는 없음 | 계약 조립(신원 형식), 릴리스 승인(자리표시자) | +| 런타임 검증기 | `src/contracts/zod-validator.ts`의 `zodValidator` | 생성 뼈대 `contracts/-schemas.ts` | 스키마 ID 중복 | +| 검증 생략 | `src/contracts/unvalidated-payload.ts`의 `unvalidatedPayload` | 없음 (기능 예제) | 이유가 비면 throw, `listUnvalidatedPayloads`가 목록을 보임 | +| DTO → 화면 값 mapper | `src/contracts/boundary-mapper.ts`의 `BoundaryMappingResult` | 생성 뼈대 `contracts/-mapper.ts` | 타입 검사 | +| gateway port + HTTP 어댑터 | `src/adapters/http/index.ts`의 `createFeatureHttpBinding`, `defineFeatureHttpOperationForRoutes` | 생성 뼈대 `adapters/-http-gateway.ts` | 음성 타입 fixture (operation ID, route ID, 입력) | +| 문제 응답 → 업무 실패 | `mapProblem` (HTTP 바인딩) | 쓰기 slice `adapters/-http-gateway.ts`(400 `_INVALID` → 이름 칸), 참조 기능 `adapters/reference-http-gateway.ts` (409, 422) | 기능 테스트 | +| 결과와 실패 | `src/contracts/result.ts`, `src/contracts/errors.ts` | 생성 뼈대 `application/-feature-api.ts` | `FailureKind` 닫힌 어휘(타입) | +| 실패 → 화면 행동 | `src/contracts/errors.ts`의 `action` | 참조 기능 `presentation/use-reference-failure-action.ts` | 페이지 테스트 | +| 파일 업로드 (짝 백엔드 Fileserver) | `src/adapters/http/index.ts`의 `createFileserverUploadClient` (`POST /v1/files`) | 없음 (기능 예제). 조립은 [02 결정표 7절](../02-decision-tables.md#7-파일-업로드) | `tests/integration/fileserver-upload.test.ts` | + +## 서버 상태 + +| 패턴 | 정의 | 예제 | 검사 | +|---|---|---|---| +| 쿼리 바인딩 | `src/contracts/server-state.ts`의 `bindQuery`, `src/presentation/adapters/query/application-query.ts` | 생성 뼈대 `presentation/use--items.ts` | profile ID (실행 때). `owner`·`operationId`는 읽는 곳이 없는 `@deprecated` 칸이라 적지 않는다 | +| 무효화 topic | `src/contracts/query-invalidation.ts` | 생성 뼈대 계약 `invalidation` | 조립(중복, 고아 topic) | +| 멱등 키 쓰기 | V3 `retrySemantics: "KEYED"`, `commandRecovery`, 뮤테이션 정책(`src/contracts/server-state.ts`의 `commandMutationIdentity`로 operation ID와 키 여부를 descriptor에서 받는다) | 쓰기 slice `--keyed`(`contracts/-contract-contribution.ts`, `presentation/use--create.ts`), 참조 기능 생성 명령(`use-reference-feature.ts`, `reference-feature-contract-contribution.ts`) | 계약 조립(복구 descriptor 필수), 타입(descriptor 상수 이름), 기능 테스트 | +| 결과 불명 화면 | `src/presentation/components/async-surface.tsx`의 `onReconcileUnknownEffect`, `onResendUnknownEffect` | 쓰기 slice `presentation/-create-page.tsx`, 참조 기능 `presentation/reference-resource-form-page.tsx` | 기능 테스트만(쓰기 slice는 `-create-page.test.tsx`) | +| 수정·삭제 명령 | 같은 V3 계약 (`PUT`, `PATCH`, `DELETE`) | 없음 (참조 기능은 생성 명령만 있다) | — | +| 낙관적 갱신 | `useApplicationMutation`의 `optimistic` 옵션 (`application-query.ts`) | 없음 | 런타임 테스트만 | +| 페이지 넘김 | `src/adapters/query-cache/index.ts`의 `createCursorPaginationRuntime` | 없음 (참조 기능은 커서 필터만, 다음 커서 없음) | 런타임 테스트만 | +| 로컬 저장(IndexedDB) | `recipes/frontend-capabilities/indexeddb-feature-capability.ts` + `product-composition.ts` | `src/features/local-draft-feature/` (`NOT_A_FEATURE`, 기능이 아닌 샘플) | 계약 테스트 | + +## 화면 + +| 패턴 | 정의 | 예제 | 검사 | +|---|---|---|---| +| 페이지 템플릿 | `src/presentation/templates/page-templates.tsx` | 생성 뼈대 `CollectionPage`, 참조 기능 페이지 4개 | `page-templates-own-layout-only` | +| 비동기 상태 화면 | `src/presentation/components/async-surface.tsx`의 `AsyncSurface` | 생성 뼈대 목록 페이지 | 페이지 테스트 | +| 폼 | `src/presentation/forms/use-app-form.ts`의 `useAppForm` | 쓰기 slice `presentation/-form.ts`와 `-create-page.tsx`, 참조 기능 `presentation/reference-resource-form.ts`와 폼 페이지 | 페이지 테스트(서버 필드 오류, 이탈 확인) | +| 화면 문구 | `src/presentation/i18n/index.ts`, 기능 문구 catalog | 생성 뼈대 `contracts/-message-catalog.ts` | `lint`(문구 literal), `check:i18n`(ko-KR·en-US 키) | +| 권한 분기 | 라우트 `access`, 서버 403 → 실패 | 참조 기능 403 화면 테스트 | 가드 테스트. 역할·권한 힌트 예제는 없음 | + +## 테스트 + +| 패턴 | 정의 | 예제 | 검사 | +|---|---|---|---| +| 응답 시나리오 | `tests/mocks/handlers/http-scenarios.ts`의 `createHttpScenarioHandler` | 생성 뼈대 페이지 테스트 | `test:coverage` | +| 보낸 요청(헤더·본문) 확인 | MSW `setupServer().events.on("request:start")` | [01 문서 10단계](../01-add-a-feature.md#10단계-테스트)의 짧은 예. 핸들러에서 모으는 방법은 참조 기능 `reference-production-vertical.test.tsx`의 504 재전송 테스트 | `test:coverage` | +| 같은 멱등 키 재전송 | 시나리오 `in-flight-409` + 위 요청 모으기 | 01 문서 10단계 | `test:coverage` | + +## 관측 + +| 패턴 | 정의 | 예제 | 검사 | +|---|---|---|---| +| 기능 telemetry | `src/platform/telemetry/telemetry-port.ts`의 `TelemetryPort`, `failOpenTelemetryPort` | 생성 뼈대 `application/-feature-api.ts` | 기능 테스트 | + +같은 이름의 다른 타입 `src/application/ports/telemetry-port.ts`의 `TelemetryPort`는 기능에서 쓰지 않는다. + +## 기능 사이 + +| 패턴 | 정의 | 예제 | 검사 | +|---|---|---|---| +| 기능 간 협력 | 금지 규칙만 있다 | 없음 | `check:architecture` (`features-do-not-import-other-features`) | + +두 기능이 같은 것을 써야 하면 기능끼리 import하지 않는다. 공유할 것은 `src/contracts`나 `src/application`처럼 기능 밖 공유 폴더에 둘 수 있는지 먼저 본다. 공유 경로를 안내하는 예제는 없다. diff --git a/docs/operations/adapter-remediation-dispositions.json b/docs/operations/adapter-remediation-dispositions.json index d0e9edca..3c8140f9 100644 --- a/docs/operations/adapter-remediation-dispositions.json +++ b/docs/operations/adapter-remediation-dispositions.json @@ -113,7 +113,7 @@ "previous": "PARTIAL", "disposition": "FIXED", "summary": "A source lease that arrives after the delivery ended is closed exactly once by a compensator.", - "evidence": ["tests/unit/presigned-transfer.test.ts"] + "evidence": ["tests/unit/presigned-transfer-delivery.test.ts"] }, { "id": "TR-03", @@ -123,7 +123,7 @@ "markers": ["X-AUDIT-01", "X-AUDIT-02"], "evidence": [ "tests/unit/abortable-operation.test.ts", - "tests/unit/image-cdn-runtime.test.ts", + "tests/unit/image-cdn-browser-probe.test.ts", "tests/unit/resumable-upload-fetch-transport.test.ts" ] }, @@ -132,7 +132,7 @@ "previous": "PARTIAL", "disposition": "FIXED", "summary": "Teardown proves quiescence of the raw provider registry, not only of the wrappers that bound it.", - "evidence": ["tests/unit/resumable-upload-runtime.test.ts"] + "evidence": ["tests/unit/resumable-upload-runtime-teardown.test.ts"] }, { "id": "TR-05", diff --git a/docs/operations/adapter-remediation-ledger.md b/docs/operations/adapter-remediation-ledger.md index 94e784cd..78819d06 100644 --- a/docs/operations/adapter-remediation-ledger.md +++ b/docs/operations/adapter-remediation-ledger.md @@ -3,8 +3,19 @@ > Source of truth for the execution state of every confirmed finding in > [`docs/reviews/adapters/`](../reviews/adapters/README.md). > -> Plan: [2026-08-13 adapter remediation](../superpowers/plans/2026-08-13-adapter-remediation.md). +> Plan: 2026-08-13 adapter remediation, a work-history plan under docs/superpowers/plans +> that a copied project may delete (README, "Files you can delete after copying"). > Baseline revision: `develop` / `4dc033cf33a5b6173bbf960d5eb464a406dc4c92`. +> +> Test paths are given at their current location. Two suites moved after +> these runs: `ci-artifact-contract.test.ts` from `tests/unit/` to +> `tests/system/ci-runner/`, and `provider-guardian-transaction.test.ts` from +> `tests/unit/` to `tests/integration/`. Three suites were split on +> 2026-09-18 (`5cc41467`, `ec7f20e2`) and the third re-review rows follow the +> tests that moved: TR-02 to `presigned-transfer-delivery.test.ts`, TR-03's +> image probe to `image-cdn-browser-probe.test.ts`, TR-04 to +> `resumable-upload-runtime-teardown.test.ts` (all in `tests/unit/`). The run +> commands in the earlier sections keep the file each run used. ## Containment state (plan Task 1, Step 1) @@ -44,7 +55,7 @@ Captured on the baseline revision before any source change. ### `test:unit` failure attribution -The single failing file is `tests/unit/ci-artifact-contract.test.ts`. All 19 failures come from +The single failing file is `tests/system/ci-runner/ci-artifact-contract.test.ts`. All 19 failures come from child-process, cgroup, and filesystem-permission behavior of the sandboxed execution environment, not from adapter code. Verbatim causes recorded from the run log: @@ -77,9 +88,9 @@ Rollout state starts at `NOT_STARTED`; documented-unimplemented items start at | N-03 | Live V3 path | `corepack pnpm exec vitest run tests/unit/http-execution-v3.test.ts -t "retry-time fence"` | `fix: preserve command effect certainty across retries` | `FIXED_NOT_RELEASED` | command effect verdict regression | Red reproduced `SCOPE_FENCED` with `NOT_STARTED` after one dispatched attempt → green `MAYBE_APPLIED`; lattice table 9/9; `check:types` PASS; `lint` PASS | | N-04 | Live composition teardown | `corepack pnpm exec vitest run tests/unit/telemetry.test.ts tests/unit/runtime-adapters.test.ts` | `fix: terminate telemetry work on disposal` | `FIXED_NOT_RELEASED` | telemetry delivery loss after teardown change | Red 10 failed (5 lifecycle + 5 capacity) → green 34/34; `check:diagnostics` PASS; `check:types` PASS; `check:architecture` PASS; `lint` PASS | | N-05 | Rollout blocker (sidecar not composed) | `corepack pnpm exec vitest run tests/unit/conditional-validator-store.test.ts` | `fix: harden bounded state sidecars` | `FIXED_NOT_RELEASED` | persisted validator key incompatibility | Red collision case (two valid bindings sharing one delimiter-joined key) → green; key is now a bounded validated tuple encoded with `JSON.stringify` | -| N-06 | Legacy V2 rollback seam | `corepack pnpm exec vitest run tests/integration/http-client.test.ts` | `fix: harden the legacy HTTP rollback path` | `FIXED_NOT_RELEASED` | legacy keyed command rejection spike | Red 4 invalid-key cases → green; rejection happens before credentials and fetch (0 credential calls, 0 fetches) | -| N-07 | Legacy V2 rollback seam | `corepack pnpm exec vitest run tests/integration/http-client.test.ts tests/integration/auth-recovery.test.ts` | `fix: harden the legacy HTTP rollback path` | `FIXED_NOT_RELEASED` | legacy credential timeout regression | Red never-settling owner → green; credential wait races the existing attempt controller so no extra timer is added; ownership maps to REQUEST_TIMEOUT / REQUEST_ABORTED / AUTH_INTEGRATION_FAILURE with zero fetches | -| N-08 | Legacy V2 rollback seam | `corepack pnpm exec vitest run tests/unit/bounded-json-compatibility.test.ts` | `fix: harden the legacy HTTP rollback path` | `FIXED_NOT_RELEASED` | legacy JSON failure-code drift | Green 7/7 including throwing cancel/releaseLock; `readBoundedJson` now delegates to `bounded-body-reader` with the legacy codes preserved | +| N-06 | Legacy V2 rollback seam | The V2 client test tests/integration/http-client.test.ts (deleted with the V2 client on 2026-11-03) | `fix: harden the legacy HTTP rollback path` | `FIXED_NOT_RELEASED` | legacy keyed command rejection spike | Red 4 invalid-key cases → green; rejection happens before credentials and fetch (0 credential calls, 0 fetches) | +| N-07 | Legacy V2 rollback seam | The V2 client tests tests/integration/http-client.test.ts and tests/integration/auth-recovery.test.ts (deleted with the V2 client on 2026-11-03) | `fix: harden the legacy HTTP rollback path` | `FIXED_NOT_RELEASED` | legacy credential timeout regression | Red never-settling owner → green; credential wait races the existing attempt controller so no extra timer is added; ownership maps to REQUEST_TIMEOUT / REQUEST_ABORTED / AUTH_INTEGRATION_FAILURE with zero fetches | +| N-08 | Legacy V2 rollback seam | The V2 bounded JSON test tests/unit/bounded-json-compatibility.test.ts (deleted with the V2 client on 2026-11-03) | `fix: harden the legacy HTTP rollback path` | `FIXED_NOT_RELEASED` | legacy JSON failure-code drift | Green 7/7 including throwing cancel/releaseLock; `readBoundedJson` now delegates to `bounded-body-reader` with the legacy codes preserved | | N-09 | Live cross-context host | `corepack pnpm exec vitest run tests/unit/cross-tab-invalidation.test.ts` | `fix: harden bounded state sidecars` | `FIXED_NOT_RELEASED` | cross-tab invalidation drop | Red foreign-area pulse accepted → green 13/13; localStorage captured once and `StorageEvent.storageArea` compared by object identity; pulse key registered as `CACHE_INVALIDATION_PULSE`; `check:registries` PASS | | N-10 | Cursor runtime `AVAILABLE_NOT_COMPOSED` | `corepack pnpm exec vitest run tests/unit/cursor-pagination-runtime.test.ts` | `fix: harden bounded state sidecars` | `FIXED_NOT_RELEASED` | pagination abort semantics change | Red never-settling loader → green `PAGINATION_ABORTED` with the late page ignored | | N-11 | Live composition | `corepack pnpm exec vitest run tests/unit/telemetry.test.ts -t capacity` | `fix: terminate telemetry work on disposal` | `FIXED_NOT_RELEASED` | capacity rejection on valid composition | Red 5/5 capacity cases → green; ceilings documented in VD-07 §7-4 | @@ -183,7 +194,7 @@ Captured after every correctness task landed. | `git diff --check` | 0 | clean | | `corepack pnpm test:component` | 0 | 126 passed | | `corepack pnpm test:integration` | 0 | 52 passed | -| `corepack pnpm test:reference-feature` | 0 | 26 passed | +| test:reference-feature (the reference sample's script) | 0 | 26 passed | | `corepack pnpm test:recipes` | 0 | 17 passed | | `corepack pnpm test:unit` | 1 | 1585 passed / 19 failed tests; the 19 are the unchanged pre-existing `ci-artifact-contract` sandbox failures | | `corepack pnpm check:registries` | 0 | 11 registries PASS | @@ -208,7 +219,7 @@ No finding remains `NOT_STARTED`. | Gate | Status | Attribution | | --- | --- | --- | -| `tests/unit/ci-artifact-contract.test.ts` | 19 failed | Identical to the baseline capture. Sandbox child-process, cgroup and `/tmp` permission behavior; unrelated to adapters. Count did not change across any task. | +| `tests/system/ci-runner/ci-artifact-contract.test.ts` | 19 failed | Identical to the baseline capture. Sandbox child-process, cgroup and `/tmp` permission behavior; unrelated to adapters. Count did not change across any task. | | `corepack pnpm test:browser-capabilities` (webkit) | 6 failed / 24 passed | WebKit cannot launch: missing `libevent-2.1-7t64` and `libavif16`. Chromium passes. **UNVERIFIED**, not PASS. | | `corepack pnpm test:browser-file-storage-removal` | exit 1 | The reduced-removal-fixture prunes the CI contract to 77/89/102 while `scripts/contracts/ci-gates.ts:481` demands exactly 81/93/105. That file, the CI contract and `scripts/lib/removal-fixture.ts` are **unchanged since the baseline revision** (`git diff --name-only 4dc033c..HEAD` outside `src/`, `tests/` and `docs/` lists only the two Service Worker build scripts), so this is pre-existing, not a regression from this work. | | `corepack pnpm test:realtime-removal` | exit 1 | Same pre-existing reduced-fixture arithmetic. | @@ -250,7 +261,7 @@ down, and this section is left as written so the two passes stay comparable. | LIVE-03 | High | `FIXED` | `f4bfdf0` | Same suite — the composed HTTP registry was clearable and a post-composition mutation of a source policy changed `totalDeadlineMs` from 10000 to 999999. | | LIVE-04 | Medium | `FIXED` | `f4bfdf0` | Same integration suite — a non-cooperative fetch and reader held the port result open; a body that finished after the deadline was admitted as SUCCESS. | | LIVE-05 | High | `FIXED` | `f4bfdf0` | Same suite — a DEADLINE timeout emitted no `api.request.failed`. | -| LEG-01 | High | `FIXED` | `ca210d3` | `tests/integration/legacy-http-credential-authority.test.ts` — a recovery that answered after the deadline called `onUnauthenticated` once; it now calls it zero times, and only an adopted no-session result notifies. | +| LEG-01 | High | `FIXED` | `ca210d3` | The V2 client's credential authority test (deleted with the V2 client on 2026-11-03) — a recovery that answered after the deadline called `onUnauthenticated` once; it now calls it zero times, and only an adopted no-session result notifies. | | LEG-02 | High | `FIXED` | `ca210d3` | Same suite — a bearer profile dispatched with no `Authorization` at all. | | OPT-NET-01 | Medium | `FIXED` | `ca210d3` | `tests/unit/legacy-and-optional-network-remediation.test.ts` — a loader rejection with a live signal became `PAGINATION_ABORTED`. | | OPT-NET-02 | Low | `FIXED` | `ca210d3` | Same suite — `defineMutationIntent` accepted control characters the executor rejected. | @@ -329,15 +340,15 @@ Run on the landed tree. Only what actually passed is claimed as passing. | `tests/unit` + `tests/integration`, no exclusions | — | 1643 passed / 1747; the 104 failures are the four environmental files below | | `corepack pnpm test:component` | 0 | 126 passed | | `corepack pnpm test:recipes` | 0 | 17 passed | -| `corepack pnpm test:reference-feature` | 0 | 26 passed | +| test:reference-feature (the reference sample's script) | 0 | 26 passed | ### Environmental failures, not claimed as green | Gate | Status | Attribution | | --- | --- | --- | -| `tests/unit/ci-workflow-generation.test.ts` | 82 failed / 325 passed | Identical on the pre-change baseline (`git stash` comparison). The subprocess gates it spawns cannot run in this sandbox. | -| `tests/unit/ci-artifact-contract.test.ts` | fails | Unchanged pre-existing sandbox, cgroup and `/tmp` permission behaviour. | -| `tests/unit/security-followup.test.ts`, `tests/unit/provider-guardian-transaction.test.ts`, `tests/unit/risk-coverage.test.ts` | flaky under full-suite load | Historical baseline result. All three passed in a fresh process (78 passed together). | +| tests/unit/ci-workflow-generation.test.ts | 82 failed / 325 passed | Identical on the pre-change baseline (`git stash` comparison). The subprocess gates it spawns cannot run in this sandbox. | +| `tests/system/ci-runner/ci-artifact-contract.test.ts` | fails | Unchanged pre-existing sandbox, cgroup and `/tmp` permission behaviour. | +| `tests/unit/security-followup.test.ts`, `tests/integration/provider-guardian-transaction.test.ts`, `tests/unit/risk-coverage.test.ts` | flaky under full-suite load | Historical baseline result. All three passed in a fresh process (78 passed together). | > Current classification update (2026-09-18): the provider guardian transaction > suite moved to `tests/integration/provider-guardian-transaction.test.ts`. @@ -356,7 +367,7 @@ fixture with a single directory symlink at `/node_modules`: - `scripts/lib/removal-fixture.ts` - `scripts/check-supply-chain-provider-fixtures.ts` - `tests/integration/security-followup-archive.test.ts` -- `tests/unit/ci-artifact-contract.test.ts` +- `tests/system/ci-runner/ci-artifact-contract.test.ts` Each fixture then runs `pnpm` inside itself. pnpm does not recognise the modules directory it finds there and purges it; with `CI=true` it does so without a @@ -379,12 +390,12 @@ files above plus the two flaky-under-load ones: | File | Failed | Attribution | | --- | ---: | --- | -| `tests/unit/ci-workflow-generation.test.ts` | 82 | Identical on the pre-change baseline (`git stash` comparison). Its subprocess gates cannot run in this sandbox. | -| `tests/unit/ci-artifact-contract.test.ts` | 19 | Unchanged pre-existing sandbox, cgroup and `/tmp` permission behaviour. | +| tests/unit/ci-workflow-generation.test.ts | 82 | Identical on the pre-change baseline (`git stash` comparison). Its subprocess gates cannot run in this sandbox. | +| `tests/system/ci-runner/ci-artifact-contract.test.ts` | 19 | Unchanged pre-existing sandbox, cgroup and `/tmp` permission behaviour. | | `tests/unit/security-followup.test.ts` | 2 | Passes in isolation. | -| `tests/unit/provider-guardian-transaction.test.ts` (historical path; now `tests/integration/provider-guardian-transaction.test.ts`) | 1 | Historical baseline: passed in isolation; current suite is classified as process integration. | +| `tests/integration/provider-guardian-transaction.test.ts` | 1 | Historical baseline: passed in isolation; current suite is classified as process integration. | -1619 passed / 1723 total, and `tests/unit/removal-fixture.test.ts`, +1619 passed / 1723 total, and tests/unit/removal-fixture.test.ts, `tests/unit/supply-chain.test.ts` and `tests/integration/security-followup-archive.test.ts` — the three that had to be excluded before — now pass in the full run. @@ -425,9 +436,9 @@ than authored. | RT-01 | `PARTIAL` | `FIXED` | `tests/unit/realtime/stream-coordinator.test.ts` — an authority that re-entered `close()` from inside its own invocation got `{ok:true}` while its effect was pending; the task is registered before the collaborator is called. | | RT-02 | `NEW` | `FIXED` | Same suite — a throwing `scheduleTimeout` started a recovery that overlapped the running apply and made `close()` reject with a native `TypeError`; an uninstallable deadline now fails closed inside the result contract. | | TR-01 | `PARTIAL` | `FIXED` | `tests/unit/presigned-transfer.test.ts` — a stateful issuer could show an allowed header set to the forbidden-header check and store `Authorization`; the registration and everything nested in it is snapshotted before validation. | -| TR-02 | `PARTIAL` | `FIXED` | Same suite — a source lease that resolved after an abort was never closed; a compensator sharing the holder's close-once latch closes it exactly once. | -| TR-03 | `PARTIAL` | `FIXED` | `tests/unit/abortable-operation.test.ts`, `tests/unit/image-cdn-runtime.test.ts`, `tests/unit/resumable-upload-fetch-transport.test.ts` — the outcome depended on a hard-coded four-microtask drain, and a throwing scheduler rejected `probe()`/`execute()` natively while leaking a caller listener. The primitive now settles once by observation order, and all four consumers use it with construction-time bound timer snapshots. | -| TR-04 | `PARTIAL` | `FIXED` | `tests/unit/resumable-upload-runtime.test.ts` — a provider outliving its attempt deadline let `dispose()` report a drained runtime and close the checkpoint store; raw provider work is now its own registry and both must be quiescent. | +| TR-02 | `PARTIAL` | `FIXED` | `tests/unit/presigned-transfer-delivery.test.ts` — a source lease that resolved after an abort was never closed; a compensator sharing the holder's close-once latch closes it exactly once. | +| TR-03 | `PARTIAL` | `FIXED` | `tests/unit/abortable-operation.test.ts`, `tests/unit/image-cdn-browser-probe.test.ts`, `tests/unit/resumable-upload-fetch-transport.test.ts` — the outcome depended on a hard-coded four-microtask drain, and a throwing scheduler rejected `probe()`/`execute()` natively while leaking a caller listener. The primitive now settles once by observation order, and all four consumers use it with construction-time bound timer snapshots. | +| TR-04 | `PARTIAL` | `FIXED` | `tests/unit/resumable-upload-runtime-teardown.test.ts` — a provider outliving its attempt deadline let `dispose()` report a drained runtime and close the checkpoint store; raw provider work is now its own registry and both must be quiescent. | | TR-05 | `PARTIAL` | `FIXED` | `tests/unit/resumable-upload-http-control-plane.test.ts` — a stateful `sessionId` passed the regex and returned `../../unsafe`; the decoder validates an owned snapshot read exactly once. | | SW-01 | `PARTIAL` | `FIXED` | `tests/unit/service-worker-runtime.test.ts` — a single 1 MiB chunk was retained before the 257-byte ceiling was compared, a declared oversize left the body open and the reader lock was never released. | | SW-02 | `PARTIAL` | `FIXED` | `tests/unit/service-worker-web-push-remediation.test.ts` — the generator emitted `/assets/bad@name-abcdefgh.js` and the decoder then refused the manifest it had just produced; both share one canonical path predicate and the generator self-validates its output. | @@ -449,6 +460,11 @@ compensators and physical-work registries — so the budget is reset to **54,600 gzip bytes against a measured **53,810**, rather than the failure being carried forward as if it were green. +The budget has since moved with later fixes. On 2026-11-03 it was set to +**57,800** gzip bytes against a measured **56,053** (measured + 3%, rounded up +to 100 B). The rule and the current values are in +`docs/architecture/optional-adapter-recipes.md`. + ### Regenerated evidence (this commit) | Command | Exit | Result | @@ -465,7 +481,7 @@ forward as if it were green. The full `tests/unit` + `tests/integration` run is **1,845 passed / 1,864**, 128 of 129 files green. Every one of the 19 failures is in -`tests/unit/ci-artifact-contract.test.ts` and is the pre-existing sandbox, +`tests/system/ci-runner/ci-artifact-contract.test.ts` and is the pre-existing sandbox, cgroup, RLIMIT and `/tmp` permission behaviour already recorded above — the same file failed identically before this work. No adapter test fails. diff --git a/docs/operations/api-contract-and-server-state-recovery.md b/docs/operations/api-contract-and-server-state-recovery.md index dfc7fba4..c4576711 100644 --- a/docs/operations/api-contract-and-server-state-recovery.md +++ b/docs/operations/api-contract-and-server-state-recovery.md @@ -15,8 +15,8 @@ 현재 reference REST → Schema → Mapper → TanStack Query vertical은 V3 contract executor(`src/adapters/http/http-execution-v3.ts`)로 `COMPOSED`다. 조합 위치는 `src/bootstrap/runtime-adapters.ts`의 `createContractHttpExecutor`다. 이 문서의 -"current v1"은 V2 client(`src/adapters/http/client.ts`) 시절에 쓴 말이다. V2는 -기본 조합에 없다(`createRuntimeHttpClient` 호출처 없음). +"current v1"은 V2 client 시절에 쓴 말이다. V2 client는 2026-11-03에 지웠다. +HTTP 경로는 V3 하나다. 2026-09-25 코드 기준 상태: @@ -27,7 +27,7 @@ executor(`src/adapters/http/http-execution-v3.ts`)로 `COMPOSED`다. 조합 위 | bounded response decoder | 구현됨. 선언 길이 → 스트림 바이트 → JSON 구조 → 스키마 순 | `src/adapters/http/bounded-body-reader.ts`, `bounded-json.ts`, `http-execution-v3.ts` `admitResponse` | | typed schema/mapper | 구현됨. 계약별 input/output/problem validator와 feature mapper | `src/contracts/external-contract-runtime.ts`, `src/adapters/http/feature-http-binding.ts` | | strict query/mutation definition과 concurrency coordinator | 구현됨 | `src/contracts/server-state.ts` `bindQuery`·`BoundMutation`, `src/presentation/adapters/query/application-query.ts` | -| 결과 불명 command의 같은 키 재전송 | 구현됨. 사용자가 누를 때만 보낸다 | `application-query.ts` `resendUnknownEffect` (6.3) | +| 결과 불명 command의 같은 키 재전송 | 구현됨. 사용자가 누를 때만 보낸다. 키 없는 command(`NEVER`)에는 재전송을 주지 않는다 | `application-query.ts` `resendUnknownEffect` (6.3) | | cursor pagination | runtime만 있다. 설치된 operation이 쓰지 않는다 | `src/adapters/query-cache/cursor-pagination-runtime.ts` | | conditional request | validator store만 조합됐다. V3는 `If-None-Match`/`If-Match`를 보내지 않는다 | `src/adapters/query-cache/conditional-validator-store.ts` | | GraphQL reference adapter | 구현 안 됨 | 없음 | @@ -157,7 +157,7 @@ V3는 자격증명이 없거나(`UNAUTHENTICATED`), auth owner가 장애거나 fetch 없이 끝난다(`src/bootstrap/runtime-adapters.ts` `attachCredentials`, `src/adapters/http/http-execution-v3.ts` credential patch 처리). 전송 0회 미인증은 diagnostics에만 남고 `api.request.failed`에는 세지 않는다(03-07). 그래도 무자격 -전송이 보이면 V3가 아닌 경로(V2 client 직접 조합, 외부 SDK)를 먼저 의심한다. +전송이 보이면 V3가 아닌 경로(외부 SDK 직접 호출)를 먼저 의심한다. 점검: @@ -188,7 +188,9 @@ diagnostics에만 남고 `api.request.failed`에는 세지 않는다(03-07). 그 `correlation_id`로 쓰려면 `Access-Control-Expose-Headers`에도 넣는다 (`src/adapters/http/feature-http-binding.ts` `projectExecutionOutcome`, `src/bootstrap/runtime-adapters.ts` `createHttpObservationProjector`). telemetry에는 - 넣지 않는다. + 넣지 않는다. 반사값이 없으면(마감 초과, 연결 끊김, 헤더를 노출하지 않는 서버나 + 게이트웨이) `requestId`는 요청에 보낸 값이다(V3 결과의 `sentRequestId`). 결과 + 불명 쓰기 화면은 이 값을 "지원 참조"로 보인다(0929/03-04). ## 6. REST incident @@ -254,6 +256,8 @@ diagnostics에만 남고 `api.request.failed`에는 세지 않는다(03-07). 그 다시 보내기"는 그 intent와 같은 `Idempotency-Key`로 보낸다. 입력이 바뀌면 새 key다. 자동 재전송은 없다(`src/presentation/adapters/query/application-query.ts` `submit`·`resendUnknownEffect`, 화면 `src/presentation/components/async-surface.tsx`). + 키가 없는 command(`NEVER`)는 서버가 두 번째 요청을 가려내지 못하므로 재전송 버튼을 + 그리지 않는다(`canResendUnknownEffect`, 0929/03-03). 5. backend status/receipt로 `COMMITTED`면 cache reconcile/invalidate한다. 화면의 "변경됨으로 확인"이 이 경로다. 6. `NOT_APPLIED`가 증명된 경우만 정책에 따라 retry한다. 화면은 근거 없는 diff --git a/docs/operations/browser-file-storage-recovery.md b/docs/operations/browser-file-storage-recovery.md index 81765b77..dc245541 100644 --- a/docs/operations/browser-file-storage-recovery.md +++ b/docs/operations/browser-file-storage-recovery.md @@ -34,11 +34,29 @@ cleanup 결과를 확인하지 못하면 성공 값이 아니라 실패로 답 않는다(05-01, `reconcile`의 `holdTransactionLock`). 결함이 아니다. - `failedTransactions`: 이번에 정리하지 못해 journal에 남긴 row 수다. 나머지 row와 orphan GC는 계속 돈다(05-02). 같은 row가 계속 실패하면 §7을 본다. + - `corruptTransactions`: 읽을 수 없어 건너뛴 journal row 수다. 0이 아니면 + 저장소 손상이다. 예전에는 이런 row 하나가 목록 전체를 실패시켜 authority의 + 모든 partition에서 reconcile과 GC가 멈췄다. 이제 나머지 row와 orphan GC는 + 계속 돌고, 관측은 `OBJECT_RECONCILE` `DEGRADED` / `CORRUPT_DATA`로 남는다 + ([0929] 05-01). reconcile은 그 row를 지우지 않는다. 그 partition이 승인된 + purge로 통째로 지워질 때 함께 지워지는 것은 partition 키(`logicalKey`)를 + 읽을 수 있는 row뿐이다(§7). 승인된 LOGOUT/ACCOUNT_DELETION purge는 그런 + row를 보면 그 partition을 지운다(2026-11-03 05-01). + - `unattributedCorruptTransactions`: 위 수 가운데 `logicalKey`까지 읽을 수 + 없는 row 수다. 어느 partition에도 속하지 않아 partition 삭제도 지우지 + 못한다. 그래서 따로 세고 `DEGRADED` 관측에서 뺀다(2026-11-03 05-03). 예전에는 + 이런 row 하나가 reconcile마다 `DEGRADED`를 남겨 경보가 늘 켜졌다. 같은 수로 + 남아 있으면 할 일이 없다. 수가 늘면 키 없는 row를 쓴 writer(다른 release, + 외부 도구)를 찾는다. 이 row도 수동으로 지우지 않는다(3번). 그 row의 + staging은 partition 디렉터리 안에 있어 그 partition이 지워지면 함께 + 지워지지만, 이 row는 purge의 partition 삭제 조건에 들지 않는다. 3. journal row를 수동으로 삭제하지 않는다. row가 사라지면 stale staging을 추적할 근거가 사라지고 quota만 누수된다. 4. OPFS root나 journal database를 통째로 삭제하거나 schema를 downgrade하지 않는다. rollback은 새 v2 write admission을 닫고 v1+v2 reader를 유지하는 것으로 - 수행한다. + 수행한다. runtime이 스스로 지우는 것은 승인된 purge가 손상이나 끝나지 않은 + transaction 때문에 끝나지 못할 때의 그 partition 디렉터리 하나와 그 partition의 + journal row뿐이다(§7). ## 1. 공통 원칙 @@ -50,6 +68,10 @@ incident 중에도 다음 작업은 금지한다. 하나만 지운다(§5 "database 전체 삭제" 참고). - origin의 모든 `caches.keys()` 삭제 - user-authored/unsynced IndexedDB 또는 OPFS data 자동 purge + - OPFS의 예외도 하나다. authority가 승인한 LOGOUT/ACCOUNT_DELETION이 손상된 + row나 staging, 또는 그 partition의 끝나지 않은 put·delete 때문에 끝나지 못할 + 때, runtime이 그 partition 디렉터리 하나와 그 partition의 journal row만 + 지운다(§7 recovery). - schema version downgrade - 무한 reload/update loop - filename, path, record/object key, URL/query, digest, body를 incident log에 복사 @@ -428,12 +450,63 @@ VD-15 목표 runtime을 먼저 구현한다. - `COMMITTED` + file missing/corrupt: reconstructable만 server rehydrate; user-created private는 read-only/export/recovery - stale staging/orphan chunk는 grace period와 bounded mark/sweep 후 제거 -- `LOGOUT`/`ACCOUNT_DELETION` purge는 객체를 모두 지운 뒤 그 partition의 chunk를 +- `LOGOUT`/`ACCOUNT_DELETION` purge는 객체를 모두 지운 뒤 그 partition의 journal + row를 센다. 하나라도 있으면(다른 tab에서 진행 중인 put·delete, crash가 남긴 + `PREPARING`·`FILES_READY`, 키는 읽히는 손상 row) sweep 대신 아래 partition + 삭제로 간다(2026-11-03 05-01). 예전에는 이 row를 보지 않고 `COMPLETED`를 + 돌려줬다. 그래서 진행 중 put의 객체가 purge 뒤에도 읽혔고, `FILES_READY` row는 + 다음 reconcile이 commit해 객체로 되살렸다. row가 없으면 그 partition의 chunk를 grace 없이 sweep한다(05-04, `opfs-byte-store-adapter.ts` `enforcePolicies`). - journal이나 staging receipt가 참조하는 chunk는 이때도 지우지 않는다. report의 - `chunkSweep`이 `COMPLETED`여야 bytes가 지워진 것이다. `DEADLINE_REACHED`면 같은 + staging receipt가 참조하는 chunk는 이때도 지우지 않는다. 이 두 reason에서는 + report의 `chunkSweep`이 `COMPLETED`이거나 `partitionDeleted`가 있을 때 그 + partition의 bytes가 지워진 것이다. `DEADLINE_REACHED`면 같은 purge를 다시 호출하고, `STAGING_STATE_UNREADABLE`이면 읽을 수 없는 staging부터 - 처리한다 + 처리한다. 다른 탭이 바꾸고 있던 객체를 지우지 못하면 report는 + `moreObjectsAvailable: true`이고 `chunkSweep`이 없다. 이때도 같은 purge를 다시 + 호출한다([0929] 05-02) +- 손상이나 끝나지 않은 transaction 때문에 끝나지 못하는 `LOGOUT`/ + `ACCOUNT_DELETION` purge는 partition을 통째로 지운다([0929] 05-01, + 2026-11-03 05-01, `opfs-byte-store-adapter.ts` `enforcePolicies`). + - 조건: 정책이 그 reason을 허용하고, authority가 이번 purge의 proof를 내주고 + consumer가 소비했을 때(IndexedDB의 database 전체 삭제와 같은 승인). 그리고 + 다음 중 하나를 만났을 때: 목록에서 건너뛴 손상 object row, 손상 row 때문에 + `CORRUPT_DATA`로 끝난 remove나 chunk sweep, `STAGING_STATE_UNREADABLE`, 그 + partition 키를 가진 journal row(`countPartitionTransactions`가 1 이상). + TTL·SESSION_END·UNTIL_SYNCED·PRESSURE는 손상 row를 건너뛰고 세기만 한다. + - 범위: worker가 origin mutation lease를 쥔 채 + `authorities///` 디렉터리를 + 지우고, 이어서 journal에서 그 partition 키로 시작하는 object·journal·chunk + reference row와 budget row를 지운다. 값을 읽지 않고 키로 찾으므로 키가 남은 + 손상 row도 지워진다. journal row는 `logicalKey` 인덱스로 찾으므로 그 값까지 + 깨진 row는 남는다(§0 2번 `unattributedCorruptTransactions`). scope binding + row는 남긴다. 다른 partition은 건드리지 않는다. + - 결과: `partitionDeleted: true`, `moreObjectsAvailable: false`, 건너뛴 row 수 + `corruptObjects`. 이 report면 그 partition의 bytes는 모두 지워진 것이다. + `chunkSweep`은 없다. 디렉터리는 지웠는데 journal 정리가 실패하면 실패를 + 반환한다. 같은 purge를 다시 호출하면 이어서 끝난다. + - 다른 tab의 put·delete와의 순서: 모든 put·delete는 journal `begin`부터 끝날 + 때까지 partition lock(Web Lock + `:partition:::`)을 + shared로 쥐고, partition 삭제는 디렉터리·journal 두 단계를 그 lock을 + exclusive로 쥔 채 한다. 그래서 진행 중이던 put은 삭제 전에 끝나고 삭제가 + 그 결과까지 지운다. 삭제가 기다리는 동안 새로 온 put은 삭제 뒤에 돈다 + ([0929] 05-01, `opfs-byte-store-adapter.ts` `withPartitionLock`). + origin lease는 put의 BEGIN~FINISH만 막으므로 이 lock이 없을 때는, 삭제의 + 디렉터리 단계가 다른 tab put의 BEGIN보다 먼저 끝나면 그 put이 새 디렉터리에 + 파일을 쓰고 journal 단계가 그 row를 지워 파일을 치울 주체가 없었다(commit + 전이면 manifest·staging receipt·chunk, commit 뒤면 manifest·chunk가 남음). + 삭제 전체가 put의 FINISH~commit 사이에 들어가는 경우는 그때도 put이 + `CONFLICT`로 실패하고 bytes가 남지 않았다. 막는 테스트: + `tests/unit/opfs-worker-runtime.test.ts` "leaves no partition bytes when an + approved purge meets another tab's put parked before …"(5가지 순서). + - 한계: 삭제는 진행 중인 put·delete를 기다린다. source가 멈춘 put은 put idle + bound(05-07)까지 삭제를 붙잡는다. purge의 `signal`을 abort하면 기다림을 + 멈추고 `ABORTED`를 반환한다. 삭제 뒤에 줄 선 put·delete도 자기 `signal`로 + 기다림을 멈춘다. 어느 쪽이든 partition lock 기다림은 + `mutationLockWaitTimeoutMs`(기본 10분)에서 `BLOCKED`(retryable)로 끝난다 + (2026-11-03 05-02). purge가 journal row를 센 뒤에 시작한 put, 삭제가 + lock을 요청한 뒤 온 put의 데이터는 남는다(point-in-time). purge 전에 그 + partition의 쓰기를 멈추는 것이 composition의 몫이다. - lock/worker 문제면 OPFS write off → approved capped fallback 또는 online-only - scope binding mismatch면 affected scope를 read-only로 격리하고 registry/ composition을 forward fix; 다른 token path로 bytes를 이동하거나 추측 복구 금지 @@ -464,7 +537,7 @@ bounded inspect/cleanup은 아직 없다. Service Worker의 waiting/client-drain 활성화는 page controller의 `requestActivation()` 핸드셰이크로 구현돼 있다 (`src/adapters/service-worker/service-worker-page-controller.ts`). 템플릿에는 이를 부르는 화면이 없다. Service Worker는 제품이 static selection -(`src/features/installed-runtime-capabilities.ts`)을 `ACTIVE`로 바꾼 경우에만 아래 +(`src/features/product-capabilities.ts`)을 `ACTIVE`로 바꾼 경우에만 아래 worker 절차를 적용한다. ### 신호 @@ -513,7 +586,8 @@ Service Worker를 별도 선택한 조합에서만 추가. 워커의 fetch 가 스위치는 없다. 끄는 경로는 아래 둘이다. - 페이지가 부팅하면: runtime config에 `CAPABILITY_OVERRIDES.SERVICE_WORKER: - "DISABLED"`를 넣는다. 재빌드는 필요 없다. 다음 부팅 때 page controller가 scope와 + "DISABLED"`를 넣는다. 재빌드는 필요 없다. 사본을 고쳐 검사한 뒤 바꾸는 절차는 + `docs/runbooks/FE-RB-001.md`에 있다. 다음 부팅 때 page controller가 scope와 script가 정확히 일치하는 등록만 unregister하고, 새 등록은 하지 않는다 (`src/contracts/runtime-capabilities.ts` `resolveRuntimeCapabilities`, `service-worker-page-controller.ts` `start()`의 `disabledCleanup` 분기). 소유 @@ -529,11 +603,33 @@ Service Worker를 별도 선택한 조합에서만 추가. 워커의 fetch 가 없어서 그동안의 요청은 모두 네트워크로 간다. 다음 load부터는 제어받지 않는다. 브라우저 확인: `tests/e2e/service-worker-recovery.spec.ts`. - 이 경로가 동작하려면 `service-worker.js`를 `Cache-Control: no-cache`로 서빙해야 - 한다. `verify:hosting-headers`는 파일이 있는지만 보고 이 헤더는 보지 않는다 - (`scripts/lib/hosting-probe.ts` `checkPublicServiceWorkers`). -- 새 워커는 install에서 `skipWaiting()`하지 않는다(`service-worker-entry.ts`). - 활성화는 페이지의 `requestActivation()`으로만 일어나므로, 새 worker 활성화를 - 멈추려고 따로 할 일은 없다. + 한다. 워커를 싣는 빌드(`ACTIVE`·`REMOVE_REGISTRATION`)에서는 + `verify:hosting-headers` live 모드가 `/service-worker.js`를 요청해 이 헤더를 + 확인하고, 다르면 FAIL이다(`config/hosting/cache-policy.json` `serviceWorker`, + `scripts/verify-hosting-headers.ts`). fixture 모드는 선언끼리만 대조하므로 + `UNVERIFIED`다. 하위 경로 base URL은 live probe가 아직 받지 않는다 + (`scripts/lib/hosting-probe.ts` `classifyLiveHostingBaseUrl`, 리뷰 0929/13-06). + 그때는 이 헤더를 손으로 확인한다. +- 새 워커는 install에서 `skipWaiting()`하지 않고 waiting에 머문다 + (`service-worker-entry.ts`). 활성화는 두 경로로 일어난다: 페이지의 + `requestActivation()`이 성공하거나, 그 scope의 탭이 모두 닫힌다(브라우저 기본 + 동작). 새로고침만으로는 활성화되지 않는다. 템플릿에는 `requestActivation()`을 + 부르는 화면이 없으므로 기본 경로는 뒤쪽이다. 따라서 결함 있는 워커가 waiting에 + 있으면 탭을 모두 닫았다 다시 연 사용자부터 그 워커를 쓴다. 기다리지 말고 다음 + release로 교체하거나 `REMOVE_REGISTRATION` release를 배포한다. +- 활성화를 기다리는 동안 소유 캐시는 release 수만큼 쌓인다. 캐시를 지우는 곳은 + activate 하나이고, 현재 캐시와 마커가 가장 높은 직전 캐시 1개만 남긴다 + (`service-worker-lifecycle.ts` `onActivate`). 새 release가 waiting 워커를 + 밀어내도 밀려난 워커의 후보 캐시는 지우지 않는다. 예: 탭 하나를 연 채 A 활성 + 상태에서 B, C를 받으면 소유 캐시는 A·B·C 3개다. 탭을 모두 닫아 C가 활성화되면 + C·A 2개로 줄어든다(리뷰 1103/06-04 실험 L2, chromium·webkit). 캐시 하나는 + 사전 캐시 크기(상한 5 MiB, `src/contracts/service-worker.ts`)다. origin 쿼터에 + 닿으면 다음 install이 `QUOTA_EXCEEDED`로 실패하고, 저장소가 부족하면 브라우저가 + origin 저장소 전체(IndexedDB·OPFS 포함)를 지울 수 있다. 사용자가 탭을 오래 + 열어 두고 release가 잦은 제품은 `requestActivation()`을 부르는 화면을 붙여 + waiting 기간을 줄인다. install이 밀려난 캐시를 지우지 않는 이유: install하는 + 워커는 활성 워커의 캐시 이름을 모르고, 마커 쓰기에 실패한 활성 캐시는 마커가 + 없어 후보와 구별되지 않는다. - 제거는 `ACTIVE → REMOVE_REGISTRATION → PURGE_OWNED_RESOURCES → null` 순서로 release를 나눈다(`src/contracts/service-worker.ts` `InstalledServiceWorkerSelection`). 소유 캐시는 `PURGE_OWNED_RESOURCES` release의 @@ -541,6 +637,14 @@ Service Worker를 별도 선택한 조합에서만 추가. 워커의 fetch 가 old controlled client가 drain되기 전에는 이 release를 배포하지 않는다. 캐시가 사라지면 그 탭의 워커는 요청을 네트워크로 넘기고(`service-worker-entry.ts` fetch 리스너의 `cached ?? fetch(request)`), 서버에 없는 옛 청크는 404가 된다. +- 자기 해제 `service-worker.js`를 내보내는 것은 `REMOVE_REGISTRATION` release뿐이다 + (`scripts/build-frontend.ts`). `PURGE_OWNED_RESOURCES` release에는 워커 파일이 + 없다. 페이지가 부팅하면 page controller가 unregister를 다시 하지만, 부팅을 막는 + 워커는 걷어내지 못한다. `null` release는 아무것도 하지 않아 옛 워커가 계속 + 등록·제어한다(리뷰 1103 실험 L3: `ACTIVE` 다음 바로 `null`, update 검사는 404로 + 실패). 그래서 `REMOVE_REGISTRATION` release는 제품이 지원하는 최대 미방문 기간 + 이상 유지한 뒤 다음 단계로 넘어간다. 그 뒤에 옛 워커가 남은 사용자가 보이면 + `REMOVE_REGISTRATION` release를 다시 배포한다(0929/06-06). hosting/CDN purge는 두 branch와 분리된 provider 절차로 실행한다. diff --git a/docs/operations/ci-quality-gates.md b/docs/operations/ci-quality-gates.md index 24b9231a..2fbbbfc7 100644 --- a/docs/operations/ci-quality-gates.md +++ b/docs/operations/ci-quality-gates.md @@ -40,7 +40,7 @@ Playwright 설정의 `testDir`를 모아 비교한다(`scripts/lib/ungated-tests 한다. 게이트가 이미 돌리는 파일을 이 목록에 남겨 두면 실패한다. package script도 같은 방식으로 확인한다(`scripts/lib/ungated-scripts.ts`). -`check:*`·`verify:*`·`test:*`·`drill:*`·`review:*` 스크립트는 게이트 명령에서 +`check:*`·`verify:*`·`test:*`·`drill:*`·`review:*`·`scan:*` 스크립트는 게이트 명령에서 package script 그래프로 닿거나, 게이트가 이미 돌리는 Vitest 경로만 다시 돌려야 한다. 둘 다 아니면 `config/ci/ungated-scripts.json`에 이유와 함께 적는다. 게이트가 닿는 스크립트를 이 목록에 남겨 두면 실패한다. 두 목록에 남은 항목과 이유는 각 @@ -64,7 +64,7 @@ package script 그래프로 닿거나, 게이트가 이미 돌리는 Vitest 경 | 기준선 | 파일 | 갱신 방법 | 검사 위치 | |---|---|---|---| | CI 계약 크기·게이트 모양 | `config/ci/contract-baseline.json` | `update:ci-contract-baseline` (`CI_CONTRACT_BASELINE_OWNER`·`_REASON` 필수) | `scripts/contracts/ci-gates.ts` `assertCiContractBaseline` | -| registry 스냅샷과 승인 | `config/contracts/registry-baseline.json`, `registry-baseline.approval.json` | `update:registry-baseline` (`REGISTRY_BASELINE_OWNER`·`_REASON` 필수). 기준선을 새로 찍지 않고 breaking 변경을 유지하려면 `config/contracts/registry-change-evidence.json`에 항목을 추가 | `scripts/check-registries.ts`의 baseline 비교 | +| registry 스냅샷과 승인 | `config/contracts/registry-baseline.json`, `registry-baseline.approval.json` | `update:registry-baseline` (`REGISTRY_BASELINE_OWNER`·`_REASON` 필수). 기준선을 새로 찍지 않고 breaking 변경을 유지하려면 `config/contracts/registry-change-evidence.json`에 항목을 추가(`changeId`, 그 변경 뒤 값 `after`(삭제는 생략, 값은 JSON 그대로이고 키·원시값 배열 순서는 상관없다), `versionBump`·`migration`·`compatibilityWindow`·`rollback`·`owner`). 같은 칸을 다시 바꾸면 `after`가 달라 새 항목이 필요하다. 지금 diff의 breaking 변경과 changeId가 맞지 않는 항목이 있으면 게이트가 그 항목을 나열하며 실패한다. `update:registry-baseline`은 새 기준선이 설명하는 항목을 모두 지운다(지운 항목은 git 이력에 남는다) | `scripts/check-registries.ts`의 baseline 비교 | | 커버리지 모듈 수 하한 | `config/testing/risk-coverage.json`의 `repositoryBaseline` | 직접 수정. 지운 production 모듈 수만큼 줄인다(`scripts/test-sample-removal.ts`가 같은 계산을 한다) | `scripts/lib/risk-coverage.ts` "repository module baseline" | | 기능 끄기 설정 | `config/runtime/.json`의 `FEATURE_OVERRIDES` | 직접 수정. 지운 기능의 키를 뺀다(`scripts/test-sample-removal.ts`가 같은 일을 한다) | 없음. 남은 키는 조용히 무시된다(리뷰 09-09) | | 의존성 목록 | `config/security/dependency-baseline.json`, `dependency-baseline.approval.json` | `update:dependency-baseline` (`DEPENDENCY_BASELINE_OWNER`·`_REASON` 필수) | `scripts/generate-supply-chain.ts` | @@ -126,11 +126,16 @@ DOCUMENTATION_READY (off-chain) `DOCUMENTATION_READY`(`verify:documentation`)가 검사하는 범위는 좁다 (`scripts/verify-documentation-readiness.ts`). -- diagram 리뷰 ledger(`docs/architecture/review-ledger.json`)와 - `review-evidence.md`가 같은 경로·해시·점수를 담는지 -- README와 `docs/accessibility/manual-checklist.md`가 설치된 route ID를 모두 - 적는지 +- 설치된 라우트마다 수동 접근성 기록 `artifacts/tests/a11y-manual/.md`가 + 있는지. 없으면 route ID를 적고 실패한다 - README가 빌드와 승인 단계가 읽는 환경 변수를 모두 적는지 +- 입구 문서가 실제 `src` 최상위 폴더와 `.dependency-cruiser.json` 규칙 이름을 + 적는지 +- `docs/README.md` 1절의 현재 계약 문서에 적힌 repo 경로·링크·package script· + FE-GATE ID가 실제로 있는지 +- 2026-07-18 diagram 리뷰 기록의 두 사본(`docs/architecture/review-ledger.json`, + `review-evidence.md`)이 같은 해시·점수를 담는지. 원본 diagram은 repo 밖에 + 있으므로 이 항목은 구조가 바뀌어도 통과한다 문서의 다른 내용(수치, 목록, 설명)이 코드와 맞는지는 검사하지 않는다(리뷰 14-07). @@ -323,9 +328,69 @@ the `promoted-release` artifact of the promotion job, extracts its against the `archive_sha256` of `immutable_build` (`scripts/verify-ci-candidate-archive.ts`), and each drill command passes `--release-root .release/promoted-release` (`config/ci/gates.json`). The CI -contract rejects a production drill gate that builds or omits the release root -(`scripts/contracts/ci-gates.ts`, 13-03). Run locally without `--release-root`, -a drill checks the local build. Browser boot, live API traffic, smoke after a provider +contract rejects a production gate command that builds or omits the release root +(`scripts/contracts/ci-gates.ts`, 13-03, 1101/13-01). Run locally without +`--release-root`, a drill checks the local build. + +The hosting gate FE-GATE-019 also reads `.release/promoted-release`: it checks +that archive's `dist` and requires the live host to serve a +`release-manifest.json` with the candidate's `buildId` and `releaseId`, so a +host still serving an earlier release fails (1101/13-01). Because a rebuild in +the same run shares those names, the served `config.json` must also equal the +candidate's outside the two emergency switches and the served `index.html` must +name the candidate's entry script (1103/13-01). The workflow deploys +nothing itself. Between `promotion` and `production_gate` sits the `deployment` +job, the project's deployment slot. It is empty by default: it reports +`deployed=false`, FE-GATE-019 does not probe the host and ends `UNVERIFIED` +(exit 3), and the production stage stays open. To fill it, set `deployment` +in the product-owned `config/ci/product-gates.json` and run `corepack pnpm +generate:ci-workflow` (1103/12-07): + +```json +{ + "schemaVersion": 1, + "deployment": { + "script": "deploy:desktop", + "environment": [ + { "name": "DEPLOY_HOST", "value": "${{ vars.DEPLOY_HOST }}" }, + { "name": "DEPLOY_SSH_KEY", "value": "${{ secrets.DEPLOY_SSH_KEY }}" } + ] + }, + "mergeGates": [] +} +``` + +The template renders the rest of the slot: it downloads the `promoted-release` +transfer, extracts it to `.release/promoted-release` against the candidate +digest, then runs the script, which deploys `.release/promoted-release/dist`. +`environment` takes only `vars.*` and `secrets.*` values. The template ships +this file empty and never changes it, so a template sync does not meet it; +`config/ci/gates.json` stays the template's, and its contract baseline counts +the template contract only. A slot filled in both files is refused. + +`mergeGates` adds the product's own checks, such as a contract check against +the paired backend: `{ "id": "PRODUCT-GATE-001", "name": "backend-contract", +"script": "check:backend-contract" }`. Ids are `PRODUCT-GATE-NNN`; the +`FE-GATE-NNN` ids, their commands, artifacts and readiness formula stay the +template's. Each runs as `corepack pnpm '; + const PATHS = { + index: "/", + runtimeConfig: "/config.json", + releaseManifest: "/release-manifest.json", + appRoute: "/__probe/deep-link", + }; + const IDENTITY = { buildId: "gitea-42-1", releaseId: "refs/tags/v1.2.0-42-1" }; + const CONFIG = JSON.stringify({ + APP_ENV: "production", + AUTH_MODE: "external", + API_BASE_URL: "https://api.frontend.example.test/", + BUILD_ID: IDENTITY.buildId, + RELEASE_ID: IDENTITY.releaseId, + CAPABILITY_OVERRIDES: {}, + FEATURE_OVERRIDES: {}, + }); + const CANDIDATE = { ...IDENTITY, runtimeConfig: CONFIG, indexHtml: INDEX }; + const RELEASE: Record = { + "/": [200, INDEX], + "/config.json": [200, CONFIG], + "/release-manifest.json": [200, JSON.stringify({ schemaVersion: 2, ...IDENTITY })], + "/assets/index-A1.js": [200, ""], + }; + const host = (routes: Record) => async (url: URL) => { + const [status, body] = routes[url.pathname] ?? [404, "Not Found"]; + const response = new Response(body, { status, headers: { "cache-control": "no-cache" } }); + Object.defineProperty(response, "url", { value: url.href }); + return response; + }; + const base = new URL("https://frontend.example.test/"); + const probe = (routes: Record, alpn: string | null = "h2") => + probeLiveRelease(base, PATHS, CANDIDATE, { + fetcher: host(routes), + negotiateAlpn: async () => alpn, + alpnProtocols: ["h2"], + }); + const failed = async (routes: Record, alpn?: string | null) => + (await probe(routes, alpn)).results + .filter((result) => !result.passed) + .map((result) => `${result.surface} ${result.header}`); + + it("passes a host that answers every route with the release's index.html", async () => { + expect(await failed({ ...RELEASE, "/__probe/deep-link": [200, INDEX] })).toEqual([]); + }); + + it("fails a host without the fallback", async () => { + expect(await failed(RELEASE)).toEqual(["appRoute http-status", "appRoute entry-script"]); + }); + + it("fails a fallback that answers 200 with a page that is not the release's index.html", async () => { + expect( + await failed({ ...RELEASE, "/__probe/deep-link": [200, "

Not found

"] }), + ).toEqual(["appRoute entry-script"]); + }); + + // 1101/13-01. Headers alone pass for whatever release the host serves, + // usually the previous one when nothing deployed this candidate. + it("fails a host that still serves an earlier release", async () => { + const earlier = JSON.stringify({ schemaVersion: 2, buildId: "gitea-41-1", releaseId: "refs/tags/v1.1.0-41-1" }); + expect( + await failed({ + ...RELEASE, + "/__probe/deep-link": [200, INDEX], + "/release-manifest.json": [200, earlier], + }), + ).toEqual(["releaseManifest build-id", "releaseManifest release-id"]); + }); + + // 1103/13-01. The manifest names come from the CI run, so a release rebuilt + // in the same run with the local profile (APP_ENV=local, AUTH_MODE=demo, a + // loopback API) passed. The candidate's config.json is the one release + // admission (FE-GATE-027) admitted, so the served one must equal it. + it("fails a host whose config.json is not the candidate's", async () => { + const local = JSON.stringify({ + ...JSON.parse(CONFIG), + APP_ENV: "local", + AUTH_MODE: "demo", + API_BASE_URL: "http://localhost:8080/", + }); + const { results } = await probe({ + ...RELEASE, + "/__probe/deep-link": [200, INDEX], + "/config.json": [200, local], + }); + expect(results.filter(({ passed }) => !passed)).toEqual([ + expect.objectContaining({ + surface: "runtimeConfig", + header: "build-fields", + observed: ["API_BASE_URL", "APP_ENV", "AUTH_MODE"], + }), + ]); + }); + + // FE-RB-001 changes the two emergency switches without a rebuild; the + // probe after it must still pass. + it("passes a host whose config.json differs only in the emergency switches", async () => { + const switched = JSON.stringify({ + ...JSON.parse(CONFIG), + CAPABILITY_OVERRIDES: { realtime: "DISABLED" }, + FEATURE_OVERRIDES: { "platform-examples-feature": false }, + }); + expect( + await failed({ ...RELEASE, "/__probe/deep-link": [200, INDEX], "/config.json": [200, switched] }), + ).toEqual([]); + }); + + it("fails a host whose config.json is unreadable", async () => { + expect( + await failed({ ...RELEASE, "/__probe/deep-link": [200, INDEX], "/config.json": [200, ""] }), + ).toEqual(["runtimeConfig build-fields"]); + }); + + // 1103/13-01. A build of other sources under the same run names serves its + // own entry script; the fallback check compared the host only with itself. + it("fails a host whose index.html names another entry script than the candidate's", async () => { + const other = ''; + expect( + await failed({ + ...RELEASE, + "/": [200, other], + "/__probe/deep-link": [200, other], + "/assets/index-B2.js": [200, ""], + }), + ).toEqual(["index candidate-entry-script"]); + }); + + // 1103/13-02. The split initial chunks assume HTTP/2 + // (docs/architecture/static-delivery.md); over HTTP/1.1 they queue. + it("fails a host that does not negotiate a declared protocol", async () => { + const release: Record = { ...RELEASE, "/__probe/deep-link": [200, INDEX] }; + expect(await failed(release, "http/1.1")).toEqual(["transport alpn"]); + expect(await failed(release, null)).toEqual(["transport alpn"]); + }); + + it("fails when the served release manifest is unreadable", async () => { + expect( + await failed({ + ...RELEASE, + "/__probe/deep-link": [200, INDEX], + "/release-manifest.json": [200, "maintenance"], + }), + ).toEqual(["releaseManifest build-id", "releaseManifest release-id"]); + }); +}); + +// 1103/06-03. The worker's install requires each precached asset's exact +// Content-Type (CACHEABLE_ASSET_CONTENT_TYPES) and refuses the whole release on +// one mismatch. A page still uses a font served as octet-stream, so only the +// worker notices. The live probe requests one built asset per extension. +describe("hashed asset content types (1103/06-03)", () => { + const base = new URL("https://frontend.example.test/"); + const DIST_FILES = [ + "index.html", + "config.json", + "assets/index-A1.js", + "assets/chunk-B2.js", + "assets/index-C3.css", + "assets/inter-D4.woff2", + "assets/notes-E5.txt", + "robots.txt", + ]; + const host = + (types: Readonly>, requested: string[] = []) => + async (url: URL) => { + requested.push(url.pathname); + const extension = /\.[^./]+$/u.exec(url.pathname)?.[0] ?? ""; + const type = types[extension]; + const response = new Response("", { + status: type ? 200 : 404, + headers: type ? { "content-type": type } : {}, + }); + Object.defineProperty(response, "url", { value: url.href }); + return response; + }; + const CORRECT = { + ".js": "text/javascript; charset=utf-8", + ".css": "text/css", + ".woff2": "font/woff2", + }; + + it("requests one built asset per cacheable extension and passes correct types", async () => { + const requested: string[] = []; + const results = await probeAssetContentTypes(base, DIST_FILES, host(CORRECT, requested)); + expect(requested).toEqual([ + "/assets/index-C3.css", + "/assets/chunk-B2.js", + "/assets/inter-D4.woff2", + ]); + expect(results.map((result) => [result.surface, result.passed])).toEqual([ + ["hashedAsset.css", true], + ["hashedAsset.js", true], + ["hashedAsset.woff2", true], + ]); + }); + + it("fails a host that serves CSS as text/plain", async () => { + const results = await probeAssetContentTypes( + base, + DIST_FILES, + host({ ...CORRECT, ".css": "text/plain" }), + ); + expect(results.filter((result) => !result.passed)).toEqual([ + expect.objectContaining({ + surface: "hashedAsset.css", + header: "content-type", + expected: ["text/css"], + observed: "text/plain", + }), + ]); + }); + + it("fails a font served as octet-stream and an asset the host does not serve", async () => { + const results = await probeAssetContentTypes( + base, + DIST_FILES, + host({ ".js": "application/javascript", ".woff2": "application/octet-stream" }), + ); + expect( + results.filter((result) => !result.passed).map((result) => [result.surface, result.observed]), + ).toEqual([ + ["hashedAsset.css", "HTTP 404"], + ["hashedAsset.woff2", "application/octet-stream"], + ]); + }); + + it("accepts for JavaScript what the hashedAsset surface declares", async () => { + const policy = JSON.parse(await readFile("config/hosting/cache-policy.json", "utf8")) as { + surfaces: { hashedAsset: { contentTypes: string[] } }; + }; + expect(acceptedAssetContentTypes(".js")).toEqual(policy.surfaces.hashedAsset.contentTypes); + expect(acceptedAssetContentTypes(".woff2")).toEqual(["font/woff2"]); + }); +}); + +// 1101/13-01. FE-GATE-019 checks the promoted candidate it downloaded, not a +// local rebuild, and an empty deployment slot proves nothing about the host. +describe("verify-hosting-headers on a promoted release root (1101/13-01)", () => { + async function verify( + distFiles: Readonly>, + env: Readonly> = {}, + editFixture?: (responses: Record>) => void, + ) { + const root = await mkdtemp(path.join(tmpdir(), "hosting-release-root-")); + try { + await mkdir(path.join(root, "config/hosting"), { recursive: true }); + for (const file of ["cache-policy.json", "security-headers.json", "response-headers.fixture.json"]) { + await copyFile(`config/hosting/${file}`, path.join(root, "config/hosting", file)); + } + if (editFixture) { + const fixturePath = path.join(root, "config/hosting/response-headers.fixture.json"); + const fixture = JSON.parse(await readFile(fixturePath, "utf8")) as { + responses: Record>; + }; + editFixture(fixture.responses); + await writeFile(fixturePath, JSON.stringify(fixture)); + } + for (const [file, content] of Object.entries(distFiles)) { + await mkdir(path.dirname(path.join(root, "candidate/dist", file)), { recursive: true }); + await writeFile(path.join(root, "candidate/dist", file), content); + } + const environment: NodeJS.ProcessEnv = { ...process.env, ...env }; + if (!("HOSTING_BASE_URL" in env)) delete environment["HOSTING_BASE_URL"]; + if (!("RELEASE_DEPLOYED" in env)) delete environment["RELEASE_DEPLOYED"]; + const result = spawnSync( + process.execPath, + [path.resolve("scripts/verify-hosting-headers.ts"), "--", "--release-root", "candidate"], + { cwd: root, encoding: "utf8", env: environment }, + ); + const record = JSON.parse( + await readFile(path.join(root, "artifacts/release/hosting-headers.json"), "utf8"), + ) as { mode: string; results: { surface: string; header: string; passed: boolean }[] }; + return { + status: result.status, + stderr: result.stderr, + mode: record.mode, + failed: record.results + .filter((entry) => !entry.passed) + .map((entry) => `${entry.surface} ${entry.header}`), + }; + } finally { + await rm(root, { recursive: true, force: true }); + } + } + const DIST = { + "index.html": '', + "release-manifest.json": JSON.stringify({ buildId: "gitea-42-1", releaseId: "r-42" }), + "assets/index-A1.js": "", + }; + + it("checks the dist inside --release-root, with no local build present", async () => { + const result = await verify({ ...DIST, "assets/index-A1.js.map": "{}" }); + expect(result.failed, result.stderr).toEqual(["sourceMap public"]); + expect(result.status).toBe(1); + }); + + it("ends UNVERIFIED without probing the host when the deployment slot is empty", async () => { + const result = await verify(DIST, { + HOSTING_BASE_URL: "https://frontend.example.test/", + RELEASE_DEPLOYED: "false", + }); + expect(result.failed, result.stderr).toEqual([]); + expect(result.mode).toBe("fixture"); + expect(result.status).toBe(3); + expect(result.stderr).toContain("deployment slot"); + }); + + // 1103/13-02. The bundle budget counts gzip bytes; an uncompressed entry + // script means about three times as many bytes on the wire. + it("declares compression for hashed assets and HTTP/2 for the host", async () => { + const policy = JSON.parse(await readFile("config/hosting/cache-policy.json", "utf8")) as { + transport?: { alpnProtocols?: string[] }; + surfaces: Record; + }; + expect(policy.transport?.alpnProtocols).toEqual(["h2"]); + expect(policy.surfaces["hashedAsset"]?.contentEncodings).toEqual( + expect.arrayContaining(["br", "gzip"]), + ); + }); + + it("fails a hashed asset served without a declared content encoding", async () => { + const result = await verify(DIST, {}, (responses) => { + delete responses["hashedAsset"]?.["content-encoding"]; + }); + expect(result.failed, result.stderr).toEqual(["hashedAsset content-encoding"]); + expect(result.status).toBe(1); + }); +}); diff --git a/tests/unit/http-execution-v3.test.ts b/tests/unit/http-execution-v3.test.ts index 4f240ce1..06757200 100644 --- a/tests/unit/http-execution-v3.test.ts +++ b/tests/unit/http-execution-v3.test.ts @@ -761,6 +761,48 @@ describe("descriptor-driven HTTP execution lifetime", () => { await expect(result).resolves.toMatchObject({ kind: "CANCELLED" }); }); + // 1103/10-04 ②. A signal is shared by many requests (a screen, a session + // scope). Every abort listener an execution adds to the caller's and the + // scope's signal is removed when it ends, however it ends. + it.each(["an answer", "a caller abort"] as const)( + "removes the listeners it added to the caller and scope signals after %s", + async (ending) => { + const caller = new AbortController(); + const scopeLifetime = new AbortController(); + const watched = [caller.signal, scopeLifetime.signal].map((signal) => ({ + add: vi.spyOn(signal, "addEventListener"), + remove: vi.spyOn(signal, "removeEventListener"), + })); + const executor = createContractHttpExecutor({ + baseUrl: "https://api.example/", + maxRetryAttempts: 0, + attachCredentials: () => ({ kind: "READY", headers: {} }), + fetcher: vi.fn(async () => Response.json([])), + }); + + const result = executor.execute(installed, { limit: 20 }, { + routeId: ROUTE_ID, + scope: { ...scope, signal: scopeLifetime.signal }, + signal: caller.signal, + }); + if (ending === "a caller abort") caller.abort(); + + await expect(result).resolves.toMatchObject({ + kind: ending === "an answer" ? "SUCCESS" : "CANCELLED", + }); + for (const { add, remove } of watched) { + const added = add.mock.calls + .filter(([type]) => type === "abort") + .map(([, listener]) => listener); + const removed = remove.mock.calls + .filter(([type]) => type === "abort") + .map(([, listener]) => listener); + expect(added).toHaveLength(1); + expect(removed).toEqual(added); + } + }, + ); + it("treats an unreadable forbidden-body probe as a transport failure", async () => { const body = new ReadableStream({ pull(controller) { diff --git a/tests/unit/http-operation-v2-v3-parity.test.ts b/tests/unit/http-operation-v2-v3-parity.test.ts deleted file mode 100644 index bb6fe398..00000000 --- a/tests/unit/http-operation-v2-v3-parity.test.ts +++ /dev/null @@ -1,56 +0,0 @@ -import { describe, expect, it } from "vitest"; - -import type { - ApiOperation, - RestOperationV2, -} from "../../src/contracts/api-operations.ts"; -import { INSTALLED_CONTRACT_CONTRIBUTIONS } from "../../src/features/installed-contract-contributions.ts"; -import { API_OPERATIONS } from "../../src/features/installed-feature-contracts.ts"; - -// 07-03 (D-7). FE-REG-API governs the V2 rows while the V3 descriptors are -// what executes. Until V2 is generated from V3, both copies must agree. -const RETRY_SEMANTICS_FOR_REPLAY_POLICY = Object.freeze({ - SAFE: "SAFE", - IDEMPOTENT: "IDEMPOTENT", - KEYED_COMMAND: "KEYED", - NON_REPLAYABLE: "NEVER", -} as const); - -const v3ByOperationId = new Map( - INSTALLED_CONTRACT_CONTRIBUTIONS.flatMap((contribution) => - contribution.http.map( - (descriptor) => [descriptor.contract.operationId, descriptor] as const, - ), - ), -); -const v2Rows = (Object.values(API_OPERATIONS) as readonly ApiOperation[]).filter( - (operation): operation is RestOperationV2 => operation.contractVersion === 2, -); - -describe("HTTP operation V2 rows and V3 descriptors", () => { - it("declare the same method, path, statuses, limit, auth profile and replay policy", () => { - for (const row of v2Rows) { - const descriptor = v3ByOperationId.get(row.operationId); - expect(descriptor, `${row.operationId} has no V3 descriptor`).toBeDefined(); - if (!descriptor) continue; - expect( - { - method: descriptor.contract.method, - path: descriptor.contract.pathTemplate, - successStatuses: [...descriptor.contract.acceptedStatuses], - maxResponseBytes: descriptor.frontend.responseByteLimit, - authProfileId: descriptor.frontend.authProfileId, - retrySemantics: descriptor.contract.retrySemantics, - }, - row.operationId, - ).toEqual({ - method: row.method, - path: row.path, - successStatuses: [...row.successStatuses], - maxResponseBytes: row.maxResponseBytes, - authProfileId: row.authProfileId, - retrySemantics: RETRY_SEMANTICS_FOR_REPLAY_POLICY[row.replayPolicy], - }); - } - }); -}); diff --git a/tests/unit/image-cdn-runtime.test.ts b/tests/unit/image-cdn-runtime.test.ts index cc9f3b48..4fa90623 100644 --- a/tests/unit/image-cdn-runtime.test.ts +++ b/tests/unit/image-cdn-runtime.test.ts @@ -5,6 +5,7 @@ import type { ImageCapabilityVerifier, ImagePresetReference, ImageProbeRequest, + ImageResourceProbePort, PublicImmutableImageAsset, } from "../../src/application/ports/browser-transfer/image-cdn.ts"; import { @@ -1537,6 +1538,97 @@ describe("image probe cost (01-11)", () => { expect(peak).toBe(2); }); + describe("one asset resolved by several calls at once (2026-11-01 01-04)", () => { + const unavailable = { + ok: false as const, + error: { + code: "UNAVAILABLE" as const, + operation: "IMAGE_RESOLVE" as const, + retryable: true, + recovery: "RETRY" as const, + }, + }; + const sharedAsset = (probe: ImageResourceProbePort["probe"]) => { + const runtime = createImageCdnRuntime({ + policies: policies(), + probe: { probe }, + maxConcurrentProbes: 2, + }); + const accepted = runtime.assets.acceptPublicImmutable(publicAsset()); + if (!accepted.ok) throw new Error("accept failed"); + return (signal = new AbortController().signal) => + runtime.presentation.resolve({ asset: accepted.value, preset, signal }); + }; + const gated = () => { + let open = () => {}; + const gate = new Promise((resolve) => { + open = resolve; + }); + return { gate, open }; + }; + + it("probes once and lets the other calls reuse the pass", async () => { + const { gate, open } = gated(); + // Only the first probe waits for the gate; a duplicate probe would + // answer at once and show up as an extra call. + const probe = vi.fn(async (request: ImageProbeRequest) => { + if (probe.mock.calls.length === 1) await gate; + return receipt(request); + }); + const resolve = sharedAsset(probe); + + const pending = Array.from({ length: 5 }, () => resolve()); + await vi.waitFor(() => expect(probe).toHaveBeenCalled()); + open(); + const results = await Promise.all(pending); + + expect(results.every((result) => result.ok)).toBe(true); + expect(probe).toHaveBeenCalledTimes(1); + }); + + it("probes again for a waiting call when the running probe fails", async () => { + const { gate, open } = gated(); + const probe = vi.fn(async (request: ImageProbeRequest) => { + if (probe.mock.calls.length > 1) return receipt(request); + await gate; + return unavailable; + }); + const resolve = sharedAsset(probe); + + const first = resolve(); + const waiting = resolve(); + await vi.waitFor(() => expect(probe).toHaveBeenCalled()); + open(); + + expect((await first).ok).toBe(false); + expect((await waiting).ok).toBe(true); + expect(probe).toHaveBeenCalledTimes(2); + }); + + it("lets a waiting call abort without ending the running probe", async () => { + const { gate, open } = gated(); + const probe = vi.fn(async (request: ImageProbeRequest) => { + await gate; + return receipt(request); + }); + const resolve = sharedAsset(probe); + + const running = resolve(); + await vi.waitFor(() => expect(probe).toHaveBeenCalled()); + const controller = new AbortController(); + const waiting = resolve(controller.signal); + controller.abort(); + + expect(await waiting).toMatchObject({ + ok: false, + error: { code: "ABORTED" }, + }); + open(); + expect((await running).ok).toBe(true); + expect(probe).toHaveBeenCalledTimes(1); + }); + }); + it("gives a waiting caller's slot back when it aborts before its turn", async () => { const releases: (() => void)[] = []; const probe = vi.fn(async (request: ImageProbeRequest) => { diff --git a/tests/unit/indexeddb-opfs-journal.test.ts b/tests/unit/indexeddb-opfs-journal.test.ts index e5d79ee5..bd193f6e 100644 --- a/tests/unit/indexeddb-opfs-journal.test.ts +++ b/tests/unit/indexeddb-opfs-journal.test.ts @@ -170,8 +170,9 @@ async function commitObject( transactionId: string, objectId: string, byteLength: number, + targetScope = scope, ): Promise { - const input = beginInput(transactionId, objectId, byteLength); + const input = beginInput(transactionId, objectId, byteLength, targetScope); const begun = await journal.begin(input); if (!begun.ok) throw new Error(`begin failed for ${objectId}`); const token = begun.value.fencingToken; @@ -488,7 +489,7 @@ describe("IndexedDB OPFS journal", () => { }); }); - it("reopens after versionchange and rejects corrupt persisted journal rows", async () => { + it("reopens after versionchange and skips a corrupt persisted journal row", async () => { const { factory, journal } = createHarness(); expect( await journal.getCommittedObject(scope, "object_12345678"), @@ -504,9 +505,18 @@ describe("IndexedDB OPFS journal", () => { startedAtEpochMs: 1, corrupt: true, }); - expect(await journal.listIncomplete(10)).toMatchObject({ - ok: false, - error: { code: "CORRUPT_DATA" }, + // [0929] 05-01. The row is counted, not returned and not deleted. + expect(await journal.listIncomplete(10)).toEqual({ + ok: true, + value: { + transactions: [], + moreAvailable: false, + corruptRows: 1, + unattributedRows: 1, + }, + }); + expect(factory.readRaw("opfs-journal", "transaction_88888888")).toMatchObject({ + corrupt: true, }); }); @@ -642,7 +652,7 @@ describe("IndexedDB OPFS journal", () => { expect(tracker.aborts).toEqual([]); }); - it("pages incomplete transactions and validates a row before the page limit", async () => { + it("pages incomplete transactions and counts a corrupt row on the page that reaches it", async () => { const { factory, journal } = createHarness(); for (const index of [1, 2, 3]) { const id = `transaction_page000${index}`; @@ -666,18 +676,27 @@ describe("IndexedDB OPFS journal", () => { expect(whole.value.transactions).toHaveLength(3); expect(whole.value.moreAvailable).toBe(false); - // A corrupt row one past the requested page still fails the read. The - // journal validates a row before it checks the limit, so a page that is - // already full does not hide the next row's damage behind `moreAvailable`. + // [0929] 05-01. A corrupt row no longer fails the read: one bad row used to + // stop reconcile and GC for the whole authority. It is skipped and counted. + // A full page stops before the next row, so a row one past the page is + // counted once, by the page that reaches it, and `moreAvailable` says so. factory.seed("opfs-journal", { transactionId: "transaction_page9999", startedAtEpochMs: 9_000, corrupt: true, }); - expect(await journal.listIncomplete(3)).toMatchObject({ - ok: false, - error: { code: "CORRUPT_DATA", recovery: "READ_ONLY" }, + const full = await journal.listIncomplete(3); + expect(full).toMatchObject({ + ok: true, + value: { moreAvailable: true, corruptRows: 0 }, }); + expect(full.ok && full.value.transactions).toHaveLength(3); + const past = await journal.listIncomplete(10); + expect(past).toMatchObject({ + ok: true, + value: { moreAvailable: false, corruptRows: 1 }, + }); + expect(past.ok && past.value.transactions).toHaveLength(3); }); it("pages committed objects and reports where the next page resumes", async () => { @@ -820,3 +839,183 @@ describe("05-06 a journal from a newer release", () => { }); }); }); + +describe("[0929] 05-01 a corrupt row is skipped and counted; a partition's rows go only together", () => { + const scopeKeyOf = (target: OpfsStorageScope) => + `${target.authorityToken}|${target.namespaceToken}|${target.partitionToken}`; + const corruptObjectRow = (target: OpfsStorageScope, objectId: string) => ({ + logicalKey: `${scopeKeyOf(target)}|${objectId}`, + scopeObjectKey: `${scopeKeyOf(target)}|${objectId}`, + scopeKey: scopeKeyOf(target), + objectId, + preparedObject: { corrupt: true }, + }); + + it("lists the committed objects past a corrupt row, counts it and keeps it", async () => { + const { factory, journal } = createHarness(); + await commitObject(journal, "transaction_obj00001", "object_aaaa0001", 1); + await commitObject(journal, "transaction_obj00002", "object_bbbb0002", 1); + factory.seed("opfs-objects", corruptObjectRow(scope, "object_aaaa0001")); + + const page = await journal.listCommittedObjects({ scope, limit: 10 }); + expect(page).toMatchObject({ + ok: true, + value: { corruptRows: 1, moreAvailable: false, nextObjectId: null }, + }); + expect( + page.ok && page.value.objects.map((o) => o.descriptor.objectId), + ).toEqual(["object_bbbb0002"]); + expect( + factory.readRaw("opfs-objects", `${scopeKeyOf(scope)}|object_aaaa0001`), + ).toMatchObject({ preparedObject: { corrupt: true } }); + }); + + // 2026-11-03 05-03. The partition delete finds journal rows by their + // `logicalKey`. A damaged row that still has one goes with its partition; a + // row without one belongs to no partition, so no delete takes it. The page + // tells the two apart so an operator can. + it("tells a damaged journal row its partition delete takes from one no partition owns", async () => { + const { factory, journal } = createHarness(); + // Opens the database the seeds below write into. + expect(await journal.listIncomplete(10)).toMatchObject({ ok: true }); + factory.seed("opfs-journal", { + transactionId: "transaction_keyed001", + logicalKey: `${scopeKeyOf(scope)}|object_aaaa0001`, + startedAtEpochMs: 1, + phase: "GARBLED", + }); + factory.seed("opfs-journal", { + transactionId: "transaction_keyless1", + startedAtEpochMs: 2, + corrupt: true, + }); + + expect(await journal.listIncomplete(10)).toEqual({ + ok: true, + value: { + transactions: [], + moreAvailable: false, + corruptRows: 2, + unattributedRows: 1, + }, + }); + expect(await journal.removePartition(scope)).toMatchObject({ ok: true }); + + expect( + factory.readRaw("opfs-journal", "transaction_keyed001"), + ).toBeUndefined(); + expect( + factory.readRaw("opfs-journal", "transaction_keyless1"), + ).toMatchObject({ corrupt: true }); + expect(await journal.listIncomplete(10)).toEqual({ + ok: true, + value: { + transactions: [], + moreAvailable: false, + corruptRows: 1, + unattributedRows: 1, + }, + }); + }); + + it("counts the unfinished rows of one partition, a damaged one included (2026-11-03 05-01)", async () => { + const { factory, journal } = createHarness(); + await commitObject(journal, "transaction_obj00001", "object_aaaa0001", 1); + expect(await journal.countPartitionTransactions(scope)).toEqual({ + ok: true, + value: 0, + }); + expect( + await journal.begin( + beginInput("transaction_live0002", "object_bbbb0002", 1), + ), + ).toMatchObject({ ok: true }); + expect( + await journal.begin( + beginInput( + "transaction_kept0003", + "object_kept_0003", + 1, + otherPartition, + ), + ), + ).toMatchObject({ ok: true }); + // A row whose keys still read but whose value does not. + factory.seed("opfs-journal", { + ...(factory.readRaw("opfs-journal", "transaction_live0002") as object), + transactionId: "transaction_bad00004", + logicalKey: `${scopeKeyOf(scope)}|object_dddd0004`, + phase: "GARBLED", + }); + + expect(await journal.countPartitionTransactions(scope)).toEqual({ + ok: true, + value: 2, + }); + expect(await journal.countPartitionTransactions(otherPartition)).toEqual({ + ok: true, + value: 1, + }); + expect(await journal.removePartition(scope)).toMatchObject({ ok: true }); + expect(await journal.countPartitionTransactions(scope)).toEqual({ + ok: true, + value: 0, + }); + }); + + it("removes every row keyed to one partition, the corrupt one included, and none of another", async () => { + const { factory, journal } = createHarness(); + await commitObject(journal, "transaction_obj00001", "object_aaaa0001", 1); + await commitObject(journal, "transaction_obj00002", "object_bbbb0002", 1); + await commitObject( + journal, + "transaction_obj00003", + "object_kept_0003", + 1, + otherPartition, + ); + expect( + await journal.begin( + beginInput("transaction_live0004", "object_cccc0004", 1), + ), + ).toMatchObject({ ok: true }); + factory.seed("opfs-objects", corruptObjectRow(scope, "object_aaaa0001")); + + expect(await journal.removePartition(scope)).toEqual({ + ok: true, + value: undefined, + }); + + expect(await journal.listCommittedObjects({ scope, limit: 10 })).toEqual({ + ok: true, + value: { + objects: [], + nextObjectId: null, + moreAvailable: false, + corruptRows: 0, + }, + }); + expect( + factory.readRaw("opfs-journal", "transaction_live0004"), + ).toBeUndefined(); + expect(factory.readRaw("opfs-budgets", scopeKeyOf(scope))).toBeUndefined(); + expect(await journal.isChunkReferenced(scope, "b".repeat(64))).toEqual({ + ok: true, + value: false, + }); + + const kept = await journal.listCommittedObjects({ + scope: otherPartition, + limit: 10, + }); + expect( + kept.ok && kept.value.objects.map((o) => o.descriptor.objectId), + ).toEqual(["object_kept_0003"]); + expect( + await journal.isChunkReferenced(otherPartition, "b".repeat(64)), + ).toEqual({ ok: true, value: true }); + expect( + factory.readRaw("opfs-budgets", scopeKeyOf(otherPartition)), + ).toMatchObject({ committedBytes: 1 }); + }); +}); diff --git a/tests/unit/legacy-and-optional-network-remediation.test.ts b/tests/unit/legacy-and-optional-network-remediation.test.ts index 723da17a..886c8abb 100644 --- a/tests/unit/legacy-and-optional-network-remediation.test.ts +++ b/tests/unit/legacy-and-optional-network-remediation.test.ts @@ -142,8 +142,12 @@ describe("OPT-NET-02 shared idempotency key validation", () => { } }); + // 백엔드 1101/02-01. The paired backend's IdempotencyKeyHeader grammar is + // the same: [\x21-\x7E]{1,256}, never trimmed. A key it refuses with + // 400 IDEMPOTENCY_KEY_INVALID never left this client. it("accepts the bounded visible-ASCII values both sides allow", () => { for (const value of [ + "k", "key-1", "a".repeat(256), "0f8fad5b-d9cb-469f-a165-70867728950e", diff --git a/tests/unit/local-build-environment.test.ts b/tests/unit/local-build-environment.test.ts new file mode 100644 index 00000000..18c60e42 --- /dev/null +++ b/tests/unit/local-build-environment.test.ts @@ -0,0 +1,51 @@ +import { describe, expect, it } from "vitest"; + +import { + ciBuildEnvironmentFailures, + LOCAL_BUILD_IDENTITY, + localBuildEnvironment, +} from "../../scripts/lib/build-environment.ts"; +import visualConfig from "../../playwright.visual.config.ts"; + +/** + * 1103/11-08. The workflow sets CI=true and the CI build identity for every + * job. A build a test makes of a copy is a local build: it used to inherit + * CI=true and be checked as a release build. Inside vitest, whose config + * drops VITE_COMMIT_SHA (11-07), that failed with "missing required CI build + * environment: VITE_COMMIT_SHA"; the visual goldens' build failed on its + * local commit id "local". + */ +const CI_JOB = Object.freeze({ + CI: "true", + VITE_BUILD_ID: "gitea-41-1", + RELEASE_ID: "refs/heads/fix/example-41-1", + CI_RUNNER_IMAGE: `local/runner@sha256:${"a".repeat(64)}`, + SOURCE_DATE_EPOCH: "1793700000", + PATH: "/usr/bin", +}); + +describe("local build environment (1103/11-08)", () => { + it("is not checked as a CI build, whatever CI identity the job has", () => { + const local = localBuildEnvironment(CI_JOB); + + expect(ciBuildEnvironmentFailures(local)).toEqual([]); + expect(local).not.toHaveProperty("CI"); + expect(local).not.toHaveProperty("VITE_BUILD_ID"); + expect(local["PATH"]).toBe("/usr/bin"); + }); + + it("keeps a CI job's own release build checked", () => { + expect(ciBuildEnvironmentFailures(CI_JOB)).toContain( + "missing required CI build environment: VITE_COMMIT_SHA", + ); + }); + + it("starts the visual goldens' build as a local build inside a CI job", () => { + const webServer = visualConfig.webServer; + const env = Array.isArray(webServer) ? undefined : webServer?.env; + + // Playwright merges a web server's env over the runner's process.env. + expect(ciBuildEnvironmentFailures({ ...CI_JOB, ...env })).toEqual([]); + expect(env).toMatchObject(LOCAL_BUILD_IDENTITY); + }); +}); diff --git a/tests/unit/navigation-policy.test.ts b/tests/unit/navigation-policy.test.ts index 35f492da..c4903c86 100644 --- a/tests/unit/navigation-policy.test.ts +++ b/tests/unit/navigation-policy.test.ts @@ -43,6 +43,16 @@ describe("installed route registry", () => { allowed: false, action: "show-sign-in", }); + // 1101/10-03. A session still being recovered waits; showing sign-in + // there would bounce a returning user out of a page they may enter. + expect(decideRouteAccess(route.routeId, "recovery-pending")).toEqual({ + allowed: false, + action: "wait-for-session", + }); + expect(decideRouteAccess(route.routeId, "authenticated")).toEqual({ + allowed: true, + action: "none", + }); } }); diff --git a/tests/unit/no-skipped-tests-reporter.test.ts b/tests/unit/no-skipped-tests-reporter.test.ts new file mode 100644 index 00000000..044cbd82 --- /dev/null +++ b/tests/unit/no-skipped-tests-reporter.test.ts @@ -0,0 +1,98 @@ +import { readFileSync } from "node:fs"; + +import { describe, expect, it } from "vitest"; + +import vitestConfig from "../../vitest.config.ts"; +import { + isNarrowedRun, + unrequestedSkips, +} from "../../scripts/lib/no-skipped-tests-reporter.ts"; + +// 10-04. A skipped or todo test must fail the run, unless the caller asked +// for a narrower run on purpose. + +function testModule( + relativeModuleId: string, + tests: readonly (readonly [string, string])[], +) { + return { + relativeModuleId, + children: { + *allTests() { + for (const [fullName, state] of tests) { + yield { fullName, result: () => ({ state }) }; + } + }, + }, + }; +} + +describe("unrequestedSkips", () => { + it("names every test that did not run, whatever skipped it", () => { + expect( + unrequestedSkips([ + testModule("tests/unit/a.test.ts", [ + ["runs", "passed"], + ["it.skip", "skipped"], + ["it.todo", "skipped"], + ]), + testModule("tests/unit/b.test.ts", [ + ["fails", "failed"], + ["context.skip()", "skipped"], + ]), + ] as never), + ).toEqual([ + "tests/unit/a.test.ts > it.skip", + "tests/unit/a.test.ts > it.todo", + "tests/unit/b.test.ts > context.skip()", + ]); + }); + + it("is empty when every test ran", () => { + expect( + unrequestedSkips([ + testModule("tests/unit/a.test.ts", [ + ["runs", "passed"], + ["fails", "failed"], + ]), + ] as never), + ).toEqual([]); + }); +}); + +describe("isNarrowedRun", () => { + const whole = { testNamePattern: undefined, tagsFilter: undefined }; + const spec = { + testLines: undefined, + testIds: undefined, + testNamePattern: undefined, + testTagsFilter: undefined, + }; + + it("treats a run of whole files as not narrowed", () => { + expect(isNarrowedRun(whole, [spec, spec] as never)).toBe(false); + expect(isNarrowedRun(whole, [] as never)).toBe(false); + }); + + it.each([ + ["-t ", { ...whole, testNamePattern: /name/u }, spec], + ["--tags-filter", { ...whole, tagsFilter: ["slow"] }, spec], + ["file:line", whole, { ...spec, testLines: [12] }], + ["test ids", whole, { ...spec, testIds: ["abc_0"] }], + ["a per-file name pattern", whole, { ...spec, testNamePattern: /x/u }], + ["a per-file tag filter", whole, { ...spec, testTagsFilter: ["a"] }], + ])("treats %s as a run narrowed on purpose", (_label, config, narrowed) => { + expect(isNarrowedRun(config, [spec, narrowed] as never)).toBe(true); + }); +}); + +describe("wiring", () => { + it("refuses .only locally as well as in CI", () => { + expect(vitestConfig.test?.allowOnly).toBe(false); + }); + + it("adds the reporter to every run that goes through run-vitest.ts", () => { + const runner = readFileSync("scripts/run-vitest.ts", "utf8"); + expect(runner).toContain("./lib/no-skipped-tests-reporter.ts"); + }); +}); diff --git a/tests/unit/observability-cardinality.test.ts b/tests/unit/observability-cardinality.test.ts index 3de676c0..91c5de07 100644 --- a/tests/unit/observability-cardinality.test.ts +++ b/tests/unit/observability-cardinality.test.ts @@ -44,6 +44,53 @@ describe("observability cardinality policy", () => { ).toEqual({ success: false, reason: "invalid-context" }); }); + // 1103/03-05. The effect certainty is a closed five-value dimension in + // both sinks. + it.each(["NOT_APPLICABLE", "NOT_STARTED", "NOT_APPLIED", "APPLIED_CONFIRMED", "MAYBE_APPLIED"])( + "admits effect_certainty %s in diagnostics and failure telemetry", + (effect) => { + expect(DIAGNOSTIC_CONTEXT_CARDINALITY.effect_certainty).toBe("bounded"); + expect( + projectDiagnosticRecord({ + level: "warn", + eventId: "http.request.completed", + context: { effect_certainty: effect }, + }).success, + ).toBe(true); + expect( + projectTelemetryEvent("api.request.failed", { + error_kind: "PROBLEM", + http_status_group: "4xx", + attempt_count_bucket: "1", + route_id: "TEST_ROUTE", + effect_certainty: effect, + }).success, + ).toBe(true); + }, + ); + + it.each(["maybe", "UNKNOWN", "MAYBE_APPLIED_ON_RETRY"])( + "rejects effect_certainty %j in both sinks", + (effect) => { + expect( + projectDiagnosticRecord({ + level: "warn", + eventId: "http.request.completed", + context: { effect_certainty: effect }, + }), + ).toEqual({ success: false, reason: "invalid-context" }); + expect( + projectTelemetryEvent("api.request.failed", { + error_kind: "PROBLEM", + http_status_group: "4xx", + attempt_count_bucket: "1", + route_id: "TEST_ROUTE", + effect_certainty: effect, + }), + ).toEqual({ success: false, reason: "invalid-attribute-value" }); + }, + ); + it("allows request correlation only in bounded diagnostics evidence", () => { const projected = projectDiagnosticRecord({ level: "info", diff --git a/tests/unit/oklch-contrast.test.ts b/tests/unit/oklch-contrast.test.ts new file mode 100644 index 00000000..2e714586 --- /dev/null +++ b/tests/unit/oklch-contrast.test.ts @@ -0,0 +1,50 @@ +import { describe, expect, it } from "vitest"; + +import { + contrastRatio, + parseOklch, + readCustomProperties, + resolveColor, +} from "../../scripts/lib/oklch-contrast.ts"; + +const color = (value: string) => { + const parsed = parseOklch(value); + if (!parsed) throw new Error(`not an oklch value: ${value}`); + return parsed; +}; + +describe("oklch contrast", () => { + it("gives 21:1 for white on black", () => { + expect(contrastRatio(color("oklch(1 0 0)"), color("oklch(0 0 0)"))).toBeCloseTo(21, 1); + }); + + // UI-01: the old light focus ring measured 2.33:1 on white in Chromium. + it("matches the ratio the browser measured for the old focus ring", () => { + expect( + contrastRatio(color("oklch(0.72 0.16 225)"), color("oklch(1 0 0)")), + ).toBeCloseTo(2.33, 1); + }); + + it("reads percentages and a missing hue", () => { + expect(parseOklch("oklch(50% 0.1 none)")).toEqual({ l: 0.5, c: 0.1, h: 0 }); + expect(parseOklch("color-mix(in oklab, red, blue)")).toBeNull(); + }); + + // 12-04: valid CSS the browser draws the same as the unitless form. + it("reads a hue in deg and a negative hue, and refuses alpha", () => { + expect(parseOklch("oklch(52% 0.15 230deg)")).toEqual({ l: 0.52, c: 0.15, h: 230 }); + expect(parseOklch("oklch(0.5 0.1 -30)")).toEqual({ l: 0.5, c: 0.1, h: -30 }); + expect(parseOklch("oklch(0.5 0.1 230 / 0.9)")).toBeNull(); + }); + + it("follows var() chains and refuses values it cannot draw", () => { + const properties = readCustomProperties(` + --palette-white: oklch(1 0 0); + --color-panel: var(--palette-white); + --color-mixed: color-mix(in oklab, var(--palette-white) 50%, transparent); + `); + expect(resolveColor("--color-panel", properties)).toEqual({ l: 1, c: 0, h: 0 }); + expect(resolveColor("--color-mixed", properties)).toBeNull(); + expect(resolveColor("--color-missing", properties)).toBeNull(); + }); +}); diff --git a/tests/unit/opfs-byte-store.test.ts b/tests/unit/opfs-byte-store.test.ts index 68653d46..fb60e1e3 100644 --- a/tests/unit/opfs-byte-store.test.ts +++ b/tests/unit/opfs-byte-store.test.ts @@ -217,6 +217,7 @@ function createJournal(): OpfsJournalPort & { const page: OpfsJournalPage = { transactions: all.slice(0, limit), moreAvailable: all.length > limit, + corruptRows: 0, }; return browserDataSuccess(page); }, @@ -232,6 +233,7 @@ function createJournal(): OpfsJournalPort & { objects: values.slice(0, request.limit), nextObjectId: null, moreAvailable: values.length > request.limit, + corruptRows: 0, }); }, async isChunkReferenced(_scope, digestHex) { @@ -241,6 +243,20 @@ function createJournal(): OpfsJournalPort & { ), ); }, + async countPartitionTransactions(scope) { + return browserDataSuccess( + [...transactions.values()].filter( + (transaction) => + transaction.scope.namespaceToken === scope.namespaceToken && + transaction.scope.partitionToken === scope.partitionToken, + ).length, + ); + }, + async removePartition() { + objects.clear(); + transactions.clear(); + return browserDataSuccess(undefined); + }, }; } @@ -310,6 +326,10 @@ function createWorker( skippedUnsafe: false, }); }, + async removePartition() { + physical.clear(); + return browserDataSuccess(undefined); + }, close() {}, }; return Object.assign(worker, overrides); @@ -695,7 +715,11 @@ describe("OPFS byte-store coordinator", () => { preparedObject: committedObject("object_12345678", storagePolicy, 100), }); vi.spyOn(journal, "listIncomplete").mockResolvedValueOnce( - browserDataSuccess({ transactions: [row], moreAvailable: false }), + browserDataSuccess({ + transactions: [row], + moreAvailable: false, + corruptRows: 0, + }), ); const worker = createWorker(); const cleanupTransaction = vi.spyOn(worker, "cleanupTransaction"); diff --git a/tests/unit/opfs-worker-runtime.test.ts b/tests/unit/opfs-worker-runtime.test.ts index 3899f8e3..e319754c 100644 --- a/tests/unit/opfs-worker-runtime.test.ts +++ b/tests/unit/opfs-worker-runtime.test.ts @@ -11,7 +11,10 @@ import type { BrowserStoragePolicy, ByteSource, } from "../../src/application/ports/browser-file-storage/shared.ts"; -import { browserDataSuccess } from "../../src/adapters/browser-file-storage/result.ts"; +import { + browserDataFailure, + browserDataSuccess, +} from "../../src/adapters/browser-file-storage/result.ts"; import { createOpfsByteStoreAdapter } from "../../src/adapters/storage/opfs/opfs-byte-store-adapter.ts"; import { createIndexedDbOpfsJournal } from "../../src/adapters/storage/opfs/indexeddb-opfs-journal.ts"; import { @@ -35,6 +38,11 @@ import { type OpfsWorkerRuntime, } from "../../src/adapters/storage/opfs/opfs-worker-runtime.ts"; import { MemoryIndexedDbFactory } from "../helpers/memory-indexeddb.ts"; +import { + MemoryDirectory, + MemoryFile, + type MemoryNode, +} from "../helpers/memory-opfs.ts"; const scopeA: OpfsStorageScope = Object.freeze({ namespace: "durable-objects", @@ -68,123 +76,6 @@ const runtimePolicy = resolveOpfsRuntimePolicy({ orphanGracePeriodMs: 60_000, }); -type MemoryNode = MemoryDirectory | MemoryFile; - -class MemoryFile { - readonly kind = "file"; - bytes = new Uint8Array(); - lastModified = 0; - reads = 0; -} - -class MemoryDirectory { - readonly kind = "directory"; - readonly children = new Map(); - - async getDirectoryHandle( - name: string, - options: FileSystemGetDirectoryOptions = {}, - ): Promise { - const current = this.children.get(name); - if (current instanceof MemoryDirectory) { - return current as unknown as FileSystemDirectoryHandle; - } - if (current || !options.create) throw notFound(); - const created = new MemoryDirectory(); - this.children.set(name, created); - return created as unknown as FileSystemDirectoryHandle; - } - - async getFileHandle( - name: string, - options: FileSystemGetFileOptions = {}, - ): Promise { - const current = this.children.get(name); - if (current instanceof MemoryFile) { - return fileHandle(current); - } - if (current || !options.create) throw notFound(); - const created = new MemoryFile(); - this.children.set(name, created); - return fileHandle(created); - } - - async removeEntry( - name: string, - options: FileSystemRemoveOptions = {}, - ): Promise { - const current = this.children.get(name); - if (!current) throw notFound(); - if ( - current instanceof MemoryDirectory && - current.children.size > 0 && - !options.recursive - ) { - throw new DOMException("Directory is not empty.", "InvalidModificationError"); - } - this.children.delete(name); - } - - async *entries(): AsyncIterableIterator< - [string, FileSystemDirectoryHandle | FileSystemFileHandle] - > { - for (const [name, node] of this.children) { - yield [ - name, - node instanceof MemoryDirectory - ? (node as unknown as FileSystemDirectoryHandle) - : fileHandle(node), - ]; - } - } - - has(path: readonly string[]): boolean { - let current: MemoryNode = this; - for (const segment of path) { - if (!(current instanceof MemoryDirectory)) return false; - const next = current.children.get(segment); - if (!next) return false; - current = next; - } - return true; - } -} - -function fileHandle(file: MemoryFile): FileSystemFileHandle { - return { - kind: "file", - name: "memory", - async getFile() { - file.reads += 1; - const blob = new Blob([Uint8Array.from(file.bytes)]); - Object.defineProperty(blob, "lastModified", { - value: file.lastModified, - }); - return blob as File; - }, - async createWritable() { - let pending = Uint8Array.from(file.bytes); - return { - async write(data: FileSystemWriteChunkType) { - if (!(data instanceof Uint8Array)) { - throw new TypeError("The test writer accepts Uint8Array only."); - } - pending = Uint8Array.from(data); - }, - async close() { - file.bytes = pending; - file.lastModified = Date.now(); - }, - async abort() {}, - } as unknown as FileSystemWritableFileStream; - }, - } as FileSystemFileHandle; -} - -function notFound(): DOMException { - return new DOMException("Entry was not found.", "NotFoundError"); -} - const PHYSICAL_GENERATION_A = "a".repeat(32) as OpfsPhysicalGenerationId; function beginRequest( @@ -649,8 +540,14 @@ function referenceJournal(referenced: ReadonlySet): OpfsJournalPort { complete: unused, rollback: unused, listCommittedObjects: unused, + countPartitionTransactions: unused, + removePartition: unused, async listIncomplete() { - return browserDataSuccess({ transactions: [], moreAvailable: false }); + return browserDataSuccess({ + transactions: [], + moreAvailable: false, + corruptRows: 0, + }); }, async isChunkReferenced(_scope, digestHex) { return browserDataSuccess(referenced.has(digestHex)); @@ -1105,6 +1002,7 @@ describe("R-5.5 stored objects are checked against their own chunk size", () => return browserDataSuccess({ transactions: [transaction], moreAvailable: false, + corruptRows: 0, }); }, async commitPut() { @@ -2373,8 +2271,47 @@ describe("05-04 a LOGOUT or ACCOUNT_DELETION purge leaves no partition bytes beh }, ); - it("never sweeps the chunk of a put that runs while the purge does", async () => { - const { tab } = sharedRootTabs(); + // 1101/13.6. A journal may hand back a page shorter than the limit (the port + // does not promise full pages). A purge that walked two such pages and + // removed everything is finished: it must say so and sweep the chunks. + it("finishes a purge that walked more than one journal page", async () => { + const { root, idb, tab } = sharedRootTabs(); + const journal = createIndexedDbOpfsJournal({ + authorityToken: scopeA.authorityToken, + factory: idb.factory, + keyRange: idb.keyRange, + }); + const purged = tab("p", { + ...authority, + journal: { + ...journal, + listCommittedObjects: (request) => + journal.listCommittedObjects({ ...request, limit: 1 }), + }, + }); + expect(await putBytes(purged, "object_secret_1", [1, 2, 3])).toMatchObject({ ok: true }); + expect(await putBytes(purged, "object_secret_2", [4, 5])).toMatchObject({ ok: true }); + + expect( + await purged.maintenance.enforcePolicies({ reason: "ACCOUNT_DELETION" }), + ).toMatchObject({ + ok: true, + value: { + inspectedObjects: 2, + removedObjects: 2, + moreObjectsAvailable: false, + chunkSweep: "COMPLETED", + }, + }); + expect(filesUnder(root, scopeA)).toEqual([]); + }); + + // 2026-11-03 05-01 X1. The purge used to walk past a put that began before + // it, report a completed sweep and leave that object readable. A put or + // delete of the partition that has not finished now sends the purge to the + // partition delete, which waits for it and then takes it. + it("waits for a put that began before the purge and takes it with the partition", async () => { + const { root, tab } = sharedRootTabs(); const purger = tab("p", authority); const writer = tab("w", authority); expect(await putBytes(purger, "object_secret_1", [1, 2, 3])).toMatchObject({ ok: true }); @@ -2391,14 +2328,669 @@ describe("05-04 a LOGOUT or ACCOUNT_DELETION purge leaves no partition bytes beh stalled.release(); expect(await put).toMatchObject({ ok: true }); - expect(await purge).toMatchObject({ ok: true, value: { removedObjects: 1 } }); - expect(await openedBytes(writer, "object_late_0001")).toEqual({ + const report = await purge; + expect(report).toMatchObject({ + ok: true, + value: { + removedObjects: 1, + moreObjectsAvailable: false, + partitionDeleted: true, + }, + }); + expect(report.ok && report.value.chunkSweep).toBeUndefined(); + expect(filesUnder(root, scopeA)).toEqual([]); + expect(await openedBytes(writer, "object_late_0001")).toBe("NOT_FOUND"); + }); + + // 2026-11-03 05-01 X2, X2b, X3. A put that stopped before it finished leaves + // its journal row and its staged files. The purge reported a completed sweep + // over them; the next reconcile then committed a FILES_READY put, so the + // account's file came back as a readable object. + it.each([ + ["stopped before commit (FILES_READY)", "commitPut", false], + ["stopped while uploading (PREPARING)", "markFilesReady", false], + ["whose journal row is damaged", "commitPut", true], + ] as const)( + "takes the partition when an approved purge finds a put %s", + async (_label, failingStep, damageRow) => { + const { root, idb, tab } = sharedRootTabs(); + const journal = createIndexedDbOpfsJournal({ + authorityToken: scopeA.authorityToken, + factory: idb.factory, + keyRange: idb.keyRange, + }); + const writerWorker = loopbackGateway( + createOpfsWorkerRuntime({ + root: root as unknown as FileSystemDirectoryHandle, + crypto: globalThis.crypto, + policy: runtimePolicy, + leaseManager: exclusiveLeases(), + dedicatedWorker: true, + supportsSynchronousAccessHandles: false, + }), + ); + const unavailable = async () => + browserDataFailure("UNAVAILABLE", "INDEXEDDB_WRITE", { + retryable: true, + recovery: "RETRY", + }); + // The tab crashes at this step: the journal write never lands and, + // before commit, its compensation never runs either. + const writer = tab("w", { + journal: { ...journal, [failingStep]: unavailable } as OpfsJournalPort, + worker: { + ...writerWorker, + abortPreparedPut: async () => + browserDataFailure("UNAVAILABLE", "OBJECT_WRITE", { + retryable: true, + recovery: "RETRY", + }), + }, + }); + const purger = tab("p", authority); + expect(await putBytes(purger, "object_secret_1", [1, 2, 3])).toMatchObject({ ok: true }); + expect(await putBytes(writer, "object_dead_0001", [9, 9, 9])).toMatchObject({ + ok: false, + }); + expect(idb.readRaw("opfs-journal", "transaction_w_1")).toBeDefined(); + if (damageRow) { + idb.seed("opfs-journal", { + ...(idb.readRaw("opfs-journal", "transaction_w_1") as object), + phase: "GARBLED", + }); + } + + const report = await purger.maintenance.enforcePolicies({ + reason: "ACCOUNT_DELETION", + }); + + expect(report).toMatchObject({ + ok: true, + value: { moreObjectsAvailable: false, partitionDeleted: true }, + }); + expect(filesUnder(root, scopeA)).toEqual([]); + expect(idb.readRaw("opfs-journal", "transaction_w_1")).toBeUndefined(); + // Nothing is left for a later reconcile to bring back. + expect(await purger.maintenance.reconcile()).toMatchObject({ + ok: true, + value: { committedTransactions: 0, corruptTransactions: 0 }, + }); + expect(await openedBytes(purger, "object_dead_0001")).toBe("NOT_FOUND"); + expect(filesUnder(root, scopeA)).toEqual([]); + }, + ); + + // [0929] 05-02. Another tab overwrites the object the purge is removing, so + // the purge's remove ends in CONFLICT. That purge is not finished and must + // not claim a completed chunk sweep. The overwrite finishes between the + // purge's listing and its remove: one still running when the purge checks + // the journal sends it to the partition delete instead (2026-11-03 05-01). + it("reports a purge that skipped a changing object as unfinished", async () => { + const { root, idb, tab } = sharedRootTabs(); + const journal = createIndexedDbOpfsJournal({ + authorityToken: scopeA.authorityToken, + factory: idb.factory, + keyRange: idb.keyRange, + }); + const stalled = stalledSource(); + let overwrite: ReturnType | undefined; + const purger = tab("p", { + ...authority, + journal: { + ...journal, + async listCommittedObjects(request) { + const page = await journal.listCommittedObjects(request); + stalled.release(); + await overwrite; + return page; + }, + }, + }); + const writer = tab("w", authority); + expect(await putBytes(writer, "object_secret_1", [1, 2, 3])).toMatchObject({ ok: true }); + overwrite = writer.objects.put({ + objectId: "object_secret_1", + expectedGeneration: 1, + mediaType: "application/octet-stream", + source: stalled.source, + }); + await stalled.streaming; + const purge = purger.maintenance.enforcePolicies({ reason: "ACCOUNT_DELETION" }); + + expect(await overwrite).toMatchObject({ ok: true }); + const first = await purge; + expect(first).toMatchObject({ + ok: true, + value: { inspectedObjects: 1, removedObjects: 0, moreObjectsAvailable: true }, + }); + expect(first.ok && first.value.chunkSweep).toBeUndefined(); + + expect( + await purger.maintenance.enforcePolicies({ reason: "ACCOUNT_DELETION" }), + ).toMatchObject({ + ok: true, + value: { + removedObjects: 1, + moreObjectsAvailable: false, + chunkSweep: "COMPLETED", + }, + }); + expect(filesUnder(root, scopeA)).toEqual([]); + }); + + // [0929] 05-01. A journal row the purge cannot read used to fail the whole + // purge, so not even the readable objects went and the partition's bytes + // stayed for good. The row is now skipped and counted, and an approved + // LOGOUT or ACCOUNT_DELETION that cannot finish because of it removes the + // partition directory and that partition's journal rows instead. + const corruptObjectRow = (scope: OpfsStorageScope, objectId: string) => { + const scopeKey = [ + scope.authorityToken, + scope.namespaceToken, + scope.partitionToken, + ].join("|"); + return { + logicalKey: `${scopeKey}|${objectId}`, + scopeObjectKey: `${scopeKey}|${objectId}`, + scopeKey, + objectId, + preparedObject: { corrupt: true }, + }; + }; + + it.each(["LOGOUT", "ACCOUNT_DELETION"] as const)( + "removes the partition when a corrupt object row stops an approved %s purge", + async (reason) => { + const { root, idb, tab } = sharedRootTabs(); + const purged = tab("p", authority); + const kept = tab("k", { ...authority, scope: scopeP2 }); + expect(await putBytes(purged, "object_secret_1", [1, 2, 3])).toMatchObject({ ok: true }); + expect(await putBytes(purged, "object_secret_2", [4, 5])).toMatchObject({ ok: true }); + expect(await putBytes(kept, "object_kept_0001", [7, 7])).toMatchObject({ ok: true }); + idb.seed("opfs-objects", corruptObjectRow(scopeA, "object_secret_2")); + + const report = await purged.maintenance.enforcePolicies({ reason }); + expect(report).toEqual({ + ok: true, + value: { + inspectedObjects: 1, + removedObjects: 1, + releasedBytes: 3, + moreObjectsAvailable: false, + deadlineReached: false, + corruptObjects: 1, + partitionDeleted: true, + }, + }); + expect(filesUnder(root, scopeA)).toEqual([]); + expect(await openedBytes(kept, "object_kept_0001")).toEqual({ + generation: 1, + bytes: [7, 7], + }); + // The partition starts over: its journal rows went with its files. + expect(await putBytes(purged, "object_secret_2", [9])).toMatchObject({ + ok: true, + value: { generation: 1 }, + }); + expect(await openedBytes(purged, "object_secret_2")).toEqual({ + generation: 1, + bytes: [9], + }); + }, + ); + + it("never removes a corrupt partition for a purge the authority refused", async () => { + const { root, idb, tab } = sharedRootTabs(); + const writer = tab("w", authority); + expect(await putBytes(writer, "object_secret_1", [1, 2, 3])).toMatchObject({ ok: true }); + expect(await putBytes(writer, "object_secret_2", [4, 5])).toMatchObject({ ok: true }); + idb.seed("opfs-objects", corruptObjectRow(scopeA, "object_secret_2")); + const refused = tab("r", { + requestMaintenanceAuthority: () => ({ authorized: false as const }), + consumeMaintenanceAuthority: () => true, + }); + + expect( + await refused.maintenance.enforcePolicies({ reason: "ACCOUNT_DELETION" }), + ).toMatchObject({ ok: false, error: { code: "POLICY_REJECTED" } }); + expect(filesUnder(root, scopeA)).not.toEqual([]); + expect(await openedBytes(writer, "object_secret_1")).toEqual({ generation: 1, - bytes: [5], + bytes: [1, 2, 3], }); }); + + it("reconciles the other rows and sweeps orphans past a corrupt journal row", async () => { + const { root, idb, tab } = sharedRootTabs(); + const store = tab("r"); + expect(await putBytes(store, "object_secret_1", [1, 2, 3])).toMatchObject({ ok: true }); + const journal = createIndexedDbOpfsJournal({ + authorityToken: scopeA.authorityToken, + factory: idb.factory, + keyRange: idb.keyRange, + }); + // A put that died before it wrote anything leaves a PREPARING row. + expect( + await journal.begin({ + transactionId: "transaction_left_0001", + mutation: "PUT", + scope: scopeA, + objectId: "object_left_0001", + expectedGeneration: null, + targetGeneration: 1, + targetByteLength: 1, + targetStoragePolicy: storagePolicy, + startedAtEpochMs: 2, + }), + ).toMatchObject({ ok: true }); + idb.seed("opfs-journal", { + transactionId: "transaction_corrupt1", + startedAtEpochMs: 1, + corrupt: true, + }); + const orphan = "0".repeat(64); + await seedChunk(root, scopeA, orphan); + + expect(await store.maintenance.reconcile()).toMatchObject({ + ok: true, + value: { + inspectedTransactions: 1, + failedTransactions: 0, + corruptTransactions: 1, + deletedOrphanChunks: 1, + orphanGcStatus: "COMPLETED", + }, + }); + expect(root.has(chunkFilePath(scopeA, orphan))).toBe(false); + expect(idb.readRaw("opfs-journal", "transaction_left_0001")).toBeUndefined(); + expect(idb.readRaw("opfs-journal", "transaction_corrupt1")).toMatchObject({ + corrupt: true, + }); + }); + + // 2026-11-03 05-03 X4. A damaged journal row without a readable partition + // key outlives every approved partition delete. It used to keep each + // reconcile DEGRADED for good, with nothing the runbook lets anyone do. It + // is now counted apart and kept out of the partition damage signal; a row + // its partition delete would take still raises it. + it("reports a damaged journal row no partition owns apart from partition damage", async () => { + const { root, idb, tab } = sharedRootTabs(); + const outcomes: string[] = []; + const store = tab("s", { + ...authority, + observer: (observation) => { + if ( + observation.operation === "OBJECT_RECONCILE" && + observation.outcome !== "STARTED" + ) { + outcomes.push(`${observation.outcome}:${observation.failureCode ?? ""}`); + } + }, + }); + expect(await putBytes(store, "object_secret_1", [1, 2, 3])).toMatchObject({ ok: true }); + idb.seed("opfs-objects", corruptObjectRow(scopeA, "object_secret_2")); + idb.seed("opfs-journal", { + transactionId: "transaction_corrupt1", + startedAtEpochMs: 1, + corrupt: true, + }); + + expect( + await store.maintenance.enforcePolicies({ reason: "ACCOUNT_DELETION" }), + ).toMatchObject({ ok: true, value: { partitionDeleted: true } }); + expect(filesUnder(root, scopeA)).toEqual([]); + expect(idb.readRaw("opfs-journal", "transaction_corrupt1")).toMatchObject({ + corrupt: true, + }); + + expect(await store.maintenance.reconcile()).toMatchObject({ + ok: true, + value: { corruptTransactions: 1, unattributedCorruptTransactions: 1 }, + }); + expect(outcomes).toEqual(["SUCCEEDED:"]); + + idb.seed("opfs-journal", { + transactionId: "transaction_keyed001", + logicalKey: `${scopeA.authorityToken}|${scopeA.namespaceToken}|${scopeA.partitionToken}|object_secret_3`, + startedAtEpochMs: 2, + phase: "GARBLED", + }); + expect(await store.maintenance.reconcile()).toMatchObject({ + ok: true, + value: { corruptTransactions: 2, unattributedCorruptTransactions: 1 }, + }); + expect(outcomes.at(-1)).toBe("DEGRADED:CORRUPT_DATA"); + }); + + it("removes a partition directory only under the origin mutation lease", async () => { + const root = new MemoryDirectory(); + const leases = exclusiveLeases(); + const runtime = createOpfsWorkerRuntime({ + root: root as unknown as FileSystemDirectoryHandle, + crypto: globalThis.crypto, + policy: runtimePolicy, + leaseManager: leases, + dedicatedWorker: true, + supportsSynchronousAccessHandles: false, + }); + await seedChunk(root, scopeA, "0".repeat(64)); + await seedChunk(root, scopeP2, "0".repeat(64)); + const partitionPath = (scope: OpfsStorageScope) => [ + "authorities", + scope.authorityToken, + scope.namespaceToken, + scope.partitionToken, + ]; + const held = await leases.acquire(); + let settled = false; + const removal = runtime + .handleRequest({ + requestId: "request_remove_partition", + protocolVersion: OPFS_WORKER_PROTOCOL_VERSION, + kind: "REMOVE_PARTITION", + scope: scopeA, + }) + .finally(() => { + settled = true; + }); + await new Promise((resolve) => setTimeout(resolve, 10)); + expect(settled).toBe(false); + expect(root.has(partitionPath(scopeA))).toBe(true); + + held.release(); + expect(await removal).toMatchObject({ ok: true, kind: "REMOVE_PARTITION" }); + expect(root.has(partitionPath(scopeA))).toBe(false); + expect(root.has(partitionPath(scopeP2))).toBe(true); + expect(leases.held).toBe(false); + }); + + // [0929] 05-01. The origin lease covers a put only from BEGIN to FINISH, and + // the partition delete runs in two steps: the directory under that lease, + // then the journal rows. Another tab's put that had begun before the purge + // was not checked once it left the lease. Each case parks that put at a + // journal step past FINISH, and optionally lets the purge remove the + // directory before the put reaches BEGIN, so the rows go while it is parked. + it.each([ + ["markFilesReady", false], + ["commitPut", false], + ["markFilesReady", true], + ["commitPut", true], + ["complete", true], + ] as const)( + "leaves no partition bytes when an approved purge meets another tab's put parked before %s (directory removed before its BEGIN: %s)", + async (parkedStep, directoryFirst) => { + const { root, leases, idb, tab } = sharedRootTabs(); + const runtime = () => + createOpfsWorkerRuntime({ + root: root as unknown as FileSystemDirectoryHandle, + crypto: globalThis.crypto, + policy: runtimePolicy, + leaseManager: leases, + dedicatedWorker: true, + supportsSynchronousAccessHandles: false, + }); + const journal = createIndexedDbOpfsJournal({ + authorityToken: scopeA.authorityToken, + factory: idb.factory, + keyRange: idb.keyRange, + }); + const beforeBegin = checkpoint(); + const parked = checkpoint(); + const rowsPending = checkpoint(); + const writerWorker = loopbackGateway(runtime()); + const writer = tab("w", { + journal: { + ...journal, + [parkedStep]: async ( + ...input: Parameters + ) => { + await parked.pass(); + return await ( + journal[parkedStep] as (...args: typeof input) => unknown + )(...input); + }, + } as OpfsJournalPort, + worker: { + ...writerWorker, + async preparePut(input) { + if (directoryFirst) await beforeBegin.pass(); + return await writerWorker.preparePut(input); + }, + }, + }); + const purgerWorker = loopbackGateway(runtime()); + const purger = tab("p", { + ...authority, + worker: { + ...purgerWorker, + async removePartition(scope, signal) { + const removed = await purgerWorker.removePartition(scope, signal); + await rowsPending.pass(); + return removed; + }, + }, + }); + expect(await putBytes(purger, "object_secret_1", [1, 2, 3])).toMatchObject({ ok: true }); + idb.seed("opfs-objects", corruptObjectRow(scopeA, "object_secret_2")); + const settle = (step: Promise) => + Promise.race([ + step, + new Promise((resolve) => setTimeout(resolve, 100)), + ]); + + const put = putBytes(writer, "object_inflight1", [8, 8]); + let purge: ReturnType; + if (directoryFirst) { + // The put's journal row is PREPARING; it has written nothing yet. + await beforeBegin.reached; + purge = purger.maintenance.enforcePolicies({ reason: "ACCOUNT_DELETION" }); + await settle(rowsPending.reached); + beforeBegin.open(); + await parked.reached; + } else { + await parked.reached; + purge = purger.maintenance.enforcePolicies({ reason: "ACCOUNT_DELETION" }); + } + rowsPending.open(); + await settle(purge); + parked.open(); + const [report, written] = await Promise.all([purge, put]); + + // The put lies wholly before the partition delete, which then takes it. + expect(written).toMatchObject({ ok: true, value: { generation: 1 } }); + expect(report).toMatchObject({ + ok: true, + value: { partitionDeleted: true, moreObjectsAvailable: false }, + }); + expect(filesUnder(root, scopeA)).toEqual([]); + expect(idb.readRaw("opfs-journal", "transaction_w_1")).toBeUndefined(); + expect(await openedBytes(writer, "object_inflight1")).toBe("NOT_FOUND"); + }, + ); + + it("stops a partition delete that waits on another tab's put when the purge is aborted", async () => { + const { root, idb, tab } = sharedRootTabs(); + const purger = tab("p", authority); + expect(await putBytes(purger, "object_secret_1", [1, 2, 3])).toMatchObject({ ok: true }); + idb.seed("opfs-objects", corruptObjectRow(scopeA, "object_secret_2")); + const lockName = `${runtimePolicy.mutationLockName}:partition:${scopeA.authorityToken}:${scopeA.namespaceToken}:${scopeA.partitionToken}`; + const putHolding = checkpoint(); + // Stands in for a put of this partition in another tab. + const holder = navigator.locks.request(lockName, { mode: "shared" }, () => + putHolding.pass(), + ); + await putHolding.reached; + const controller = new AbortController(); + + const purge = purger.maintenance.enforcePolicies({ + reason: "ACCOUNT_DELETION", + signal: controller.signal, + }); + while ( + !(await navigator.locks.query()).pending?.some( + (lock) => lock.name === lockName && lock.mode === "exclusive", + ) + ) { + await new Promise((resolve) => setTimeout(resolve, 1)); + } + controller.abort(); + + expect(await purge).toMatchObject({ ok: false, error: { code: "ABORTED" } }); + expect(filesUnder(root, scopeA)).not.toEqual([]); + putHolding.open(); + await holder; + }); }); +// 2026-11-03 05-02. A put or delete queued behind a partition delete held the +// partition lock request without its caller's signal and without a bound, so +// cancelling it did nothing until the delete let go. +describe("05-02 a put or delete waiting on the partition lock", () => { + const lockName = (policy: typeof runtimePolicy) => + `${policy.mutationLockName}:partition:${scopeA.authorityToken}:${scopeA.namespaceToken}:${scopeA.partitionToken}`; + + afterEach(() => { + vi.useRealTimers(); + }); + + /** Another tab's partition delete holds the lock until `release`. */ + async function heldPartitionLock(policy: typeof runtimePolicy) { + const holding = checkpoint(); + const holder = navigator.locks.request( + lockName(policy), + { mode: "exclusive" }, + () => holding.pass(), + ); + await holding.reached; + return { + async release() { + holding.open(); + await holder; + }, + }; + } + + async function queuedOnPartitionLock( + policy: typeof runtimePolicy, + tick: () => Promise, + ) { + while ( + !(await navigator.locks.query()).pending?.some( + (lock) => lock.name === lockName(policy) && lock.mode === "shared", + ) + ) { + await tick(); + } + } + + const settledWithin = async (work: Promise, ms: number) => + await Promise.race([ + work, + new Promise<"STILL_WAITING">((resolve) => + setTimeout(() => resolve("STILL_WAITING"), ms), + ), + ]); + + it("ends a queued put and a queued delete as soon as their caller aborts", async () => { + const { tab } = sharedRootTabs(); + const store = tab("s"); + expect( + await store.objects.put({ + objectId: "object_kept_0001", + expectedGeneration: null, + mediaType: "application/octet-stream", + source: oneByteSource(), + }), + ).toMatchObject({ ok: true }); + const held = await heldPartitionLock(runtimePolicy); + const controller = new AbortController(); + + const put = store.objects.put({ + objectId: "object_aborted01", + expectedGeneration: null, + mediaType: "application/octet-stream", + source: oneByteSource(), + signal: controller.signal, + }); + const removal = store.objects.remove({ + objectId: "object_kept_0001", + expectedGeneration: 1, + signal: controller.signal, + }); + await queuedOnPartitionLock( + runtimePolicy, + () => new Promise((resolve) => setTimeout(resolve, 1)), + ); + controller.abort(); + + expect(await settledWithin(put, 200)).toMatchObject({ + ok: false, + error: { code: "ABORTED", operation: "OBJECT_WRITE" }, + }); + expect(await settledWithin(removal, 200)).toMatchObject({ + ok: false, + error: { code: "ABORTED", operation: "OBJECT_DELETE" }, + }); + await held.release(); + expect(await openedBytes(store, "object_aborted01")).toBe("NOT_FOUND"); + expect(await openedBytes(store, "object_kept_0001")).toEqual({ + generation: 1, + bytes: [6], + }); + }); + + it("ends a partition lock wait at the policy bound as a retryable BLOCKED", async () => { + const policy = resolveOpfsRuntimePolicy({ + ...runtimePolicy, + mutationLockWaitTimeoutMs: 300_000, + }); + const { tab } = sharedRootTabs(policy); + const store = tab("s"); + const held = await heldPartitionLock(policy); + vi.useFakeTimers({ toFake: ["setTimeout", "clearTimeout"] }); + + const put = store.objects.put({ + objectId: "object_blocked01", + expectedGeneration: null, + mediaType: "application/octet-stream", + source: oneByteSource(), + }); + await queuedOnPartitionLock(policy, () => vi.advanceTimersByTimeAsync(1)); + await vi.advanceTimersByTimeAsync(policy.mutationLockWaitTimeoutMs); + + expect(await put).toMatchObject({ + ok: false, + error: { code: "BLOCKED", operation: "OBJECT_WRITE", retryable: true }, + }); + vi.useRealTimers(); + await held.release(); + }); +}); + +/** A step that parks until opened and says when something reached it. */ +function checkpoint(): Readonly<{ + reached: Promise; + pass: () => Promise; + open: () => void; +}> { + let reach!: () => void; + const reached = new Promise((resolve) => { + reach = resolve; + }); + let open!: () => void; + const opened = new Promise((resolve) => { + open = resolve; + }); + return { + reached, + open, + async pass() { + reach(); + await opened; + }, + }; +} + describe("05-07 a put whose source stops lets go of the origin lock", () => { afterEach(() => { vi.useRealTimers(); @@ -2442,6 +3034,29 @@ describe("05-07 a put whose source stops lets go of the origin lock", () => { expect(await putB).toMatchObject({ ok: true, value: { generation: 1 } }); stalled.release(); }); + + // [0929] 05-09. The test above holds only while a queued writer outlasts a + // stalled one. That ordering was a comment; a policy that breaks it is now + // refused when it is resolved. + it.each([ + ["equal to", 60_000], + ["longer than", 120_000], + ])("rejects an idle bound %s the lock wait", (_, putIdleTimeoutMs) => { + expect(() => + resolveOpfsRuntimePolicy({ + ...runtimePolicy, + mutationLockWaitTimeoutMs: 60_000, + putIdleTimeoutMs, + }), + ).toThrow(TypeError); + expect( + resolveOpfsRuntimePolicy({ + ...runtimePolicy, + mutationLockWaitTimeoutMs: putIdleTimeoutMs + 1, + putIdleTimeoutMs, + }).putIdleTimeoutMs, + ).toBe(putIdleTimeoutMs); + }); }); describe("05-10 the object id grammar is the prepared-object grammar", () => { diff --git a/tests/unit/optional-runtime-host.test.ts b/tests/unit/optional-runtime-host.test.ts index 7087c022..d8883e0c 100644 --- a/tests/unit/optional-runtime-host.test.ts +++ b/tests/unit/optional-runtime-host.test.ts @@ -145,4 +145,32 @@ describe("optional runtime host", () => { await runtime.stop(); }, ); + + // 09-07. Only the Service Worker has a runtime this host starts. A selection + // nothing starts used to boot quietly while the platform overview counted + // it as active. The host only reads whether something is selected, so the + // selections below are placeholders, not valid contributions. + it.each([ + { + capability: "realtime", + selected: { realtime: Object.freeze([{}]) as unknown as ResolvedRuntimeCapabilities["realtime"] }, + }, + { + capability: "webWorkers", + selected: { webWorkers: Object.freeze([{}]) as unknown as ResolvedRuntimeCapabilities["webWorkers"] }, + }, + { + capability: "offlineCommands", + selected: { offlineCommands: {} as unknown as ResolvedRuntimeCapabilities["offlineCommands"] }, + }, + ])("refuses a selected $capability it has no runtime to start", ({ capability, selected }) => { + expect(() => + createOptionalRuntimeHost({ + capabilities: { ...capabilities, ...selected }, + routerBasePath: "/", + buildId: "build-1", + serviceWorkerHost: null, + }), + ).toThrow(new RegExp(`no runtime to start them: ${capability}\\.`)); + }); }); diff --git a/tests/unit/performance-budgets.test.ts b/tests/unit/performance-budgets.test.ts index 8d33d5d8..7cff0612 100644 --- a/tests/unit/performance-budgets.test.ts +++ b/tests/unit/performance-budgets.test.ts @@ -11,11 +11,12 @@ describe("performance budgets", () => { it("rejects initial and lazy JavaScript above their named limits", () => { const thresholds = { initialJsGzipBytes: 200, + initialJsFiles: 2, lazyChunkGzipBytes: 120, }; expect( evaluateBundleBudget( - { initialJsGzipBytes: 201, lazyChunks: [] }, + { initialJsGzipBytes: 201, initialJsFiles: 1, lazyChunks: [] }, thresholds, ).passed, ).toBe(false); @@ -23,11 +24,18 @@ describe("performance budgets", () => { evaluateBundleBudget( { initialJsGzipBytes: 100, + initialJsFiles: 1, lazyChunks: [{ path: "lazy.js", gzipBytes: 121 }], }, thresholds, ).passed, ).toBe(false); + expect( + evaluateBundleBudget( + { initialJsGzipBytes: 100, initialJsFiles: 3, lazyChunks: [] }, + thresholds, + ), + ).toMatchObject({ initialPassed: true, initialFilesPassed: false, passed: false }); }); it("fails lab evidence when context is absent or a metric is over budget", () => { diff --git a/tests/unit/pnpm-install-policy.test.ts b/tests/unit/pnpm-install-policy.test.ts new file mode 100644 index 00000000..ee45d517 --- /dev/null +++ b/tests/unit/pnpm-install-policy.test.ts @@ -0,0 +1,37 @@ +import { readFile } from "node:fs/promises"; + +import { describe, expect, it } from "vitest"; + +/** + * 0929/13-08. pnpm 11 reads its install policy from pnpm-workspace.yaml + * (13-09 moved it out of .npmrc, which pnpm 11 ignores). Nothing failed when a + * key was dropped or the release-age delay was shortened, so an unsupported + * Node version could install again, a new dependency could be saved with a ^ + * range, or a version published minutes ago could be installed. + */ +const PNPM_DEFAULT_MINIMUM_RELEASE_AGE_MINUTES = 1_440; + +describe("pnpm install policy (0929/13-08)", () => { + it("keeps engineStrict, exact saves and at least the default release-age delay", async () => { + const workspace = await readFile("pnpm-workspace.yaml", "utf8"); + const setting = (key: string) => + new RegExp(`^${key}:\\s*(\\S+)\\s*$`, "mu").exec(workspace)?.[1]; + + expect(setting("engineStrict")).toBe("true"); + expect(setting("saveExact")).toBe("true"); + const minimumReleaseAge = setting("minimumReleaseAge"); + if (minimumReleaseAge !== undefined) { + expect(Number(minimumReleaseAge)).toBeGreaterThanOrEqual(PNPM_DEFAULT_MINIMUM_RELEASE_AGE_MINUTES); + } + }); + + it("excludes only exact versions from the release-age delay", async () => { + const workspace = await readFile("pnpm-workspace.yaml", "utf8"); + const block = /^minimumReleaseAgeExclude:\n((?:\s+-\s+.+\n?)*)/mu.exec(workspace)?.[1] ?? ""; + const entries = block + .split("\n") + .map((line) => line.replace(/^\s+-\s+/u, "").replaceAll("'", "").trim()) + .filter(Boolean); + for (const entry of entries) expect(entry).toMatch(/^(?:@[^/@]+\/)?[^/@]+@\d+\.\d+\.\d+$/u); + }); +}); diff --git a/tests/unit/product-ci-overlay.test.ts b/tests/unit/product-ci-overlay.test.ts new file mode 100644 index 00000000..5eaa5b63 --- /dev/null +++ b/tests/unit/product-ci-overlay.test.ts @@ -0,0 +1,184 @@ +import { mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import path from "node:path"; + +import { afterEach, describe, expect, it } from "vitest"; + +import { loadCiGateContract } from "../../scripts/contracts/ci-gates.ts"; +import { + loadProductCiOverlay, + parseProductCiOverlay, + PRODUCT_CI_OVERLAY_PATH, +} from "../../scripts/contracts/product-ci-overlay.ts"; +import { renderCiWorkflow, workflowGateExecutionFailures } from "../../scripts/generate-ci-workflow.ts"; + +/** + * 1103/12-07. A product attached its deployment and its own merge checks by + * editing the template-owned config/ci/gates.json (3,000 lines) and the + * generated workflow, and met them again in every template sync. The product + * now writes them in config/ci/product-gates.json, which the template ships + * empty and never changes. + */ +const roots: string[] = []; + +afterEach(async () => { + await Promise.all(roots.splice(0).map((root) => rm(root, { recursive: true, force: true }))); +}); + +async function productRoot( + overlay: unknown, + extraScripts: Readonly> = {}, +): Promise { + const root = await mkdtemp(path.join(tmpdir(), "product-ci-overlay-")); + roots.push(root); + await mkdir(path.join(root, "config/ci"), { recursive: true }); + for (const file of ["config/ci/gates.json", "config/ci/contract-baseline.json"]) { + await writeFile(path.join(root, file), await readFile(file)); + } + const packageDocument = JSON.parse(await readFile("package.json", "utf8")) as { + scripts: Record; + }; + Object.assign(packageDocument.scripts, extraScripts); + await writeFile(path.join(root, "package.json"), JSON.stringify(packageDocument, null, 2)); + await writeFile(path.join(root, PRODUCT_CI_OVERLAY_PATH), JSON.stringify(overlay, null, 2)); + return root; +} + +const DEPLOYMENT = { + script: "deploy:desktop", + environment: [ + { name: "DEPLOY_HOST", value: "${{ vars.DEPLOY_HOST }}" }, + { name: "DEPLOY_SSH_KEY", value: "${{ secrets.DEPLOY_SSH_KEY }}" }, + ], +}; +const DEPLOY_SCRIPTS = { "deploy:desktop": "node scripts/deploy-desktop.ts" }; +const GATE = { id: "PRODUCT-GATE-001", name: "backend-contract", script: "check:backend-contract" }; +const GATE_SCRIPTS = { "check:backend-contract": "node scripts/check-backend-contract.ts" }; + +describe("product CI overlay (1103/12-07)", () => { + it("ships empty, so the template's own workflow is unchanged", async () => { + expect(await loadProductCiOverlay(process.cwd())).toEqual({ + schemaVersion: 1, + deployment: null, + mergeGates: [], + }); + }); + + it("fills the deployment slot with the promoted candidate and the product's script", async () => { + const root = await productRoot( + { schemaVersion: 1, deployment: DEPLOYMENT, mergeGates: [] }, + DEPLOY_SCRIPTS, + ); + + // The template baseline (config/ci/contract-baseline.json) is unchanged. + const contract = await loadCiGateContract(root); + const slot = contract.jobs.find(({ id }) => id === "deployment"); + expect(slot?.steps.map(({ kind }) => kind)).toEqual([ + "checkout", + "setup-node", + "frozen-install", + "download", + "extract", + "deploy", + ]); + expect(slot?.steps).toContainEqual(expect.objectContaining({ kind: "download", transferId: "promoted-release" })); + expect(slot?.steps.at(-1)).toEqual({ kind: "deploy", script: "deploy:desktop" }); + expect(slot?.environment).toEqual([ + { name: "CANDIDATE_ARCHIVE_SHA256", value: "${{ needs.immutable_build.outputs.archive_sha256 }}" }, + ...DEPLOYMENT.environment, + ]); + + const workflow = renderCiWorkflow(contract); + const job = workflow.slice(workflow.indexOf(" deployment:\n"), workflow.indexOf(" production_gate:\n")); + expect(job).toContain("corepack pnpm deploy:desktop"); + expect(job.match(/secrets\./gu)).toHaveLength(1); + }); + + it("refuses a slot filled in the template contract and in the overlay", async () => { + const root = await productRoot( + { schemaVersion: 1, deployment: DEPLOYMENT, mergeGates: [] }, + DEPLOY_SCRIPTS, + ); + const gatesPath = path.join(root, "config/ci/gates.json"); + const gates = JSON.parse(await readFile(gatesPath, "utf8")) as { + jobs: { id: string; steps: unknown[]; environment: unknown[] }[]; + }; + const slot = gates.jobs.find(({ id }) => id === "deployment")!; + slot.environment = [ + { name: "CANDIDATE_ARCHIVE_SHA256", value: "${{ needs.immutable_build.outputs.archive_sha256 }}" }, + ]; + slot.steps = [ + { kind: "download", transferId: "promoted-release", path: ".release/promoted" }, + { + kind: "extract", + archivePath: ".release/promoted/release-candidate.tar.gz", + targetRoot: ".release/promoted-release", + }, + { kind: "deploy", script: "deploy:desktop" }, + ]; + await writeFile(gatesPath, JSON.stringify(gates)); + + await expect(loadCiGateContract(root)).rejects.toThrow(/product-gates\.json/u); + }); + + it("refuses an overlay script that package.json does not define", async () => { + const root = await productRoot({ schemaVersion: 1, deployment: DEPLOYMENT, mergeGates: [GATE] }); + + await expect(loadCiGateContract(root)).rejects.toThrow( + /missing package scripts: deploy:desktop, check:backend-contract/u, + ); + }); + + it("runs product merge gates in a job of their own, apart from the template gates", async () => { + const root = await productRoot( + { schemaVersion: 1, deployment: null, mergeGates: [GATE] }, + GATE_SCRIPTS, + ); + const contract = await loadCiGateContract(root); + const { mergeGates } = await loadProductCiOverlay(root); + + const workflow = renderCiWorkflow(contract, mergeGates); + const job = workflow.slice(workflow.indexOf(" product_merge_gate:\n")); + expect(job).toContain(' - { gate: PRODUCT-GATE-001, name: backend-contract, script: "check:backend-contract" }'); + expect(job).toContain(" run: corepack pnpm ${{ matrix.script }}"); + expect(job).toContain(` if: ${"${{ gitea.event_name != 'workflow_dispatch' || inputs.stage != 'documentation' }}"}`); + expect(workflowGateExecutionFailures(contract, workflow, mergeGates)).toEqual([]); + // The template part of the workflow is the same bytes with or without the overlay. + expect(workflow.startsWith(renderCiWorkflow(contract).trimEnd())).toBe(true); + + expect(workflowGateExecutionFailures(contract, renderCiWorkflow(contract), mergeGates)).toEqual([ + "product gate is not executed by the product_merge_gate job: PRODUCT-GATE-001", + ]); + }); + + it.each([ + ["a template gate id", { mergeGates: [{ ...GATE, id: "FE-GATE-030" }] }, /PRODUCT-GATE-NNN/u], + ["a duplicate gate id", { mergeGates: [GATE, { ...GATE, name: "other" }] }, /duplicate product gate/u], + [ + "a binding to another job's output", + { + deployment: { + ...DEPLOYMENT, + environment: [{ name: "NONCE", value: "${{ needs.promotion.outputs.staging_root }}" }], + }, + }, + /vars\.\* or secrets\.\*/u, + ], + [ + "the candidate digest the template binds", + { + deployment: { + ...DEPLOYMENT, + environment: [{ name: "CANDIDATE_ARCHIVE_SHA256", value: "${{ vars.DIGEST }}" }], + }, + }, + /CANDIDATE_ARCHIVE_SHA256/u, + ], + ["a script that is not a plain name", { deployment: { ...DEPLOYMENT, script: "deploy; rm -rf ." } }, /script/u], + ["an unknown field", { gates: [] }, /unrecognized|Unrecognized/u], + ] as const)("refuses %s", (_name, change, diagnostic) => { + expect(() => + parseProductCiOverlay({ schemaVersion: 1, deployment: null, mergeGates: [], ...change }), + ).toThrow(diagnostic); + }); +}); diff --git a/tests/unit/product-composition-fixture.test.ts b/tests/unit/product-composition-fixture.test.ts new file mode 100644 index 00000000..3d301c44 --- /dev/null +++ b/tests/unit/product-composition-fixture.test.ts @@ -0,0 +1,668 @@ +import { readFile } from "node:fs/promises"; + +import { afterEach, describe, expect, it, vi } from "vitest"; + +import type { InstalledHttpOperationExecutor } from "../../src/adapters/http/index.ts"; +import type { + ProductComposition, + ProductCompositionContext, + ProductSessionOwner, + ProductSessionOwnerContext, +} from "../../src/bootstrap/product-composition-contract.ts"; +import { createRuntimeAdapters } from "../../src/bootstrap/runtime-adapters.ts"; +import { validateRuntimeConfig } from "../../src/bootstrap/runtime-config-schema.ts"; +import { runtimeConfigV2ArtifactSchema } from "../../src/contracts/release-artifacts.ts"; +import type { FeaturePlatformCapabilityId } from "../../src/features/feature-adapter-contribution.ts"; +import { TEST_LIST_HTTP_CONTRACT } from "../helpers/external-contract-fixture.ts"; + +/** + * 09-02 completion check. The two products' current needs — memento's + * `offsetUpload` and `runtime` capabilities and its BFF cookie XSRF write, + * tech-log's Studio CSRF, its product runtime-config key with its FE-REG-ENV + * row, and its BFF session owner installed before boot — expressed by filling + * only the two product-owned files: + * + * - `src/contracts/product-contracts.ts`: product auth profiles, config keys + * and their FE-REG-ENV rows + * - `src/bootstrap/product-composition.ts`: the session owner, capabilities and + * credential providers + * + * Both are replaced below by what a product would write in them. Everything + * else is the template as shipped; only the installed contract set (adds the + * operations) and the feature-input composer (to read the capability context + * a feature receives) are swapped, as in the 09-01 test. + */ + +declare module "../../src/features/feature-adapter-contribution.ts" { + interface FeaturePlatformCapabilities { + readonly offsetUpload: Readonly<{ + upload(path: string, body: Blob): Promise; + }>; + readonly runtime: Readonly<{ appEnvironment: string; apiBaseUrl: string }>; + readonly studioSource: "MOCK" | "HTTP"; + readonly studioHttp: InstalledHttpOperationExecutor; + } +} + +/** Fails to compile unless the capability interface takes product keys. */ +const PRODUCT_NEEDS: readonly FeaturePlatformCapabilityId[] = [ + "offsetUpload", + "runtime", + "studioSource", + "studioHttp", +]; + +const fixture = vi.hoisted(() => ({ + capabilities: undefined as Record | undefined, + sessionOwnerRequests: 0, + withProfile( + contract: T, + operationId: string, + authProfileId: string, + ): T { + return { + ...contract, + contract: { ...contract.contract, operationId }, + frontend: { ...contract.frontend, authProfileId }, + }; + }, +})); + +/** The product's `src/contracts/product-contracts.ts`. */ +vi.mock("../../src/contracts/product-contracts.ts", async () => { + const { z } = await import("../../src/contracts/zod.ts"); + const cookieProfile = ( + authProfileId: string, + header: readonly ("x-csrf-token" | "x-xsrf-token")[], + ) => + Object.freeze({ + authProfileId, + transport: "SAME_ORIGIN_COOKIE" as const, + credentials: "include" as const, + allowedCredentialHeaders: Object.freeze([...header]), + requiredCredentialHeaders: Object.freeze([...header]), + }); + return { + PRODUCT_RUNTIME_CONFIG_FIELDS: Object.freeze({ + TECH_LOG_STUDIO_SOURCE: z.enum(["MOCK", "HTTP"]).default("MOCK"), + }), + // tech-log added this row to the template's `env.ts`. + PRODUCT_ENV_REGISTRY: Object.freeze({ + TECH_LOG_STUDIO_SOURCE: Object.freeze({ + phase: "runtime", + classification: "public", + required: false, + defaultValue: "MOCK", + }), + }), + PRODUCT_REST_AUTH_PROFILES: Object.freeze({ + MEMENTO_BFF_READ: cookieProfile("MEMENTO_BFF_READ", []), + // The paired backend's default CSRF header (Spring CookieCsrfTokenRepository). + MEMENTO_BFF_WRITE: cookieProfile("MEMENTO_BFF_WRITE", ["x-xsrf-token"]), + TECH_LOG_STUDIO_BOOTSTRAP: cookieProfile("TECH_LOG_STUDIO_BOOTSTRAP", []), + TECH_LOG_STUDIO_SESSION: cookieProfile("TECH_LOG_STUDIO_SESSION", ["x-csrf-token"]), + }), + }; +}); + +const OPERATIONS = vi.hoisted(() => ({ + bffRead: ["MEMENTO_READ", "MEMENTO_BFF_READ"], + bffWrite: ["MEMENTO_WRITE", "MEMENTO_BFF_WRITE"], + studio: ["STUDIO_LIST", "TECH_LOG_STUDIO_SESSION"], + studioSession: ["STUDIO_SESSION", "TECH_LOG_STUDIO_BOOTSTRAP"], +} as const)); + +/** The product's `src/bootstrap/product-composition.ts`. */ +vi.mock("../../src/bootstrap/product-composition.ts", async () => { + const { TEST_DETAIL_HTTP_CONTRACT: detail } = await import( + "../helpers/external-contract-fixture.ts" + ); + const studioSession = fixture.withProfile(detail, ...OPERATIONS.studioSession); + + /** + * tech-log's BFF session owner (`bff-session-owner.ts`), which it put on the + * host global from the template's `create-runtime-composition.ts`. The + * session is an httpOnly cookie, so the owner asks the backend. + */ + function composeProductSessionOwner( + context: ProductSessionOwnerContext, + ): ProductSessionOwner { + fixture.sessionOwnerRequests += 1; + if (Reflect.get(context.config, "TECH_LOG_STUDIO_SOURCE") !== "HTTP") return null; + const fetcher = context.fetcher ?? fetch; + let state: "recovery-pending" | "authenticated" | "unauthenticated" = + "recovery-pending"; + const listeners = new Set<() => void>(); + const probe = async () => { + const response = await fetcher( + new URL("api/v1/studio/session", context.config.API_BASE_URL), + { method: "GET", credentials: "include" }, + ); + state = response.ok ? "authenticated" : "unauthenticated"; + for (const listener of listeners) listener(); + return response.ok ? ("restored" as const) : ("no-session" as const); + }; + void probe(); + return Object.freeze({ + readState: () => state, + readSubject: () => (state === "authenticated" ? "studio-user" : null), + subscribe(listener: () => void) { + listeners.add(listener); + return () => listeners.delete(listener); + }, + beginSignIn: async () => {}, + signOut: async () => {}, + attachCredential: async () => ({ headers: {} }), + recoverSession: probe, + notifyUnauthenticated() { + state = "unauthenticated"; + }, + }); + } + + function composeProduct(context: ProductCompositionContext) { + // tech-log: one Studio CSRF token per session, fetched through `http` with + // the credential-free bootstrap profile and dropped on 401/403. + let csrfToken: Promise | null = null; + const csrf = { + token(signal?: AbortSignal) { + csrfToken ??= context.http + .execute(studioSession, { entityId: "session" }, { + routeId: "STUDIO", + ...(signal === undefined ? {} : { signal }), + }) + .then((outcome) => { + if (outcome.kind !== "SUCCESS") throw new Error("no studio session"); + return outcome.value.id; + }); + return csrfToken.catch((error: unknown) => { + csrfToken = null; + throw error; + }); + }, + invalidate() { + csrfToken = null; + }, + }; + return { + capabilities: { + // memento: its resumable upload transport, fenced like every request. + offsetUpload: Object.freeze({ + async upload(path: string, body: Blob) { + const token = context.isScopeReady() + ? context.readCookie("XSRF-TOKEN") + : undefined; + if (token === undefined) return "NO_CREDENTIAL" as const; + const fetcher = context.fetcher ?? fetch; + const response = await fetcher( + new URL(path, context.config.API_BASE_URL), + { + method: "PATCH", + credentials: "include", + headers: { "x-xsrf-token": token }, + body, + }, + ); + return response.status; + }, + }), + // memento: runtime values its features read. + runtime: Object.freeze({ + appEnvironment: context.config.APP_ENV, + apiBaseUrl: context.config.API_BASE_URL, + }), + // tech-log: a product runtime-config key. Read untyped here only + // because the shipped `product-contracts.ts` declares no keys. + studioSource: Reflect.get(context.config, "TECH_LOG_STUDIO_SOURCE") as + | "MOCK" + | "HTTP", + // tech-log: Studio calls go through `http`; a 401/403 drops the token. + studioHttp: Object.freeze({ + async execute(...args: Parameters) { + const outcome = await context.http.execute(...args); + if (outcome.kind === "UNAUTHENTICATED" || outcome.kind === "FORBIDDEN") { + csrf.invalidate(); + } + return outcome; + }, + }) as InstalledHttpOperationExecutor, + }, + credentialProviders: { + // memento BFF: the cookie is the session; writes add the XSRF cookie. + MEMENTO_BFF_READ: () => ({ kind: "READY" as const, headers: {} }), + MEMENTO_BFF_WRITE: () => { + const token = context.readCookie("XSRF-TOKEN"); + return token === undefined + ? { kind: "UNAVAILABLE" as const } + : { kind: "READY" as const, headers: { "x-xsrf-token": token } }; + }, + // tech-log Studio: the token's own issuing call carries none. + TECH_LOG_STUDIO_BOOTSTRAP: () => ({ kind: "READY" as const, headers: {} }), + TECH_LOG_STUDIO_SESSION: async (_operation, { signal }) => ({ + kind: "READY" as const, + headers: { "x-csrf-token": await csrf.token(signal) }, + }), + }, + } satisfies ProductComposition; + } + return { composeProduct, composeProductSessionOwner }; +}); + +vi.mock("../../src/features/installed-contract-contributions.ts", async (importOriginal) => { + const original = + await importOriginal(); + const fixtures = await import("../helpers/external-contract-fixture.ts"); + const { TEST_CONTRACT_CONTRIBUTION: contribution } = fixtures; + const source = contribution.source; + if (source.kind !== "EXTERNAL_PACKAGE") throw new Error("fixture source changed"); + return { + ...original, + createInstalledContractRegistry: () => { + const registry = original.createInstalledContractRegistry([ + ...original.EXPECTED_CONTRACT_SET_PACKAGES, + source.package, + ]); + registry.install(contribution.featureId, [ + { + ...contribution, + http: [ + fixture.withProfile(fixtures.TEST_LIST_HTTP_CONTRACT, ...OPERATIONS.bffRead), + fixture.withProfile(fixtures.TEST_LIST_HTTP_CONTRACT, ...OPERATIONS.bffWrite), + fixture.withProfile(fixtures.TEST_LIST_HTTP_CONTRACT, ...OPERATIONS.studio), + fixture.withProfile(fixtures.TEST_DETAIL_HTTP_CONTRACT, ...OPERATIONS.studioSession), + ] as typeof contribution.http, + }, + ]); + return registry; + }, + }; +}); + +vi.mock("../../src/features/installed-feature-adapters.ts", async (importOriginal) => { + const original = + await importOriginal(); + return { + ...original, + createInstalledFeatureLoaders: ( + ...args: Parameters + ) => { + fixture.capabilities = { ...args[0] }; + return original.createInstalledFeatureLoaders(...args); + }, + }; +}); + +const CONFIG_DOCUMENT = { + APP_ENV: "local", + API_BASE_URL: "http://localhost:8080", + TELEMETRY_ENABLED: false, + AUTH_MODE: "demo", + CONFIG_SCHEMA_VERSION: "2.0", + RELEASE_MANIFEST_URL: "/release-manifest.json", + CAPABILITY_OVERRIDES: { + REALTIME: "DEFAULT", + WEB_WORKER: "DEFAULT", + SERVICE_WORKER: "DEFAULT", + OFFLINE_COMMANDS: "DEFAULT", + }, + FEATURE_OVERRIDES: {}, +} as const; + +const release: Parameters[0]["release"] = { + schemaVersion: 2, + appVersion: "0.1.0", + buildId: "build-a", + commitSha: "abc123", + configSchemaVersion: "2.0", + contractSet: { + setAlgorithm: "CA_CONTRACT_SET_V1", + setDigest: `sha256:${"0".repeat(64)}`, + packages: [], + }, + assetManifestHash: "hash-a", + releaseId: "release-a", + builtAt: "2026-07-25T00:00:00Z", + routeChunks: { "route-home": "assets/home.js" }, +}; + +let current: Awaited> | undefined; +afterEach(() => { + current?.infrastructure.dispose(); + current = undefined; + fixture.capabilities = undefined; + fixture.sessionOwnerRequests = 0; +}); + +async function compose( + options: Readonly<{ + cookie?: string; + studioStatus?: number; + authMode?: "demo" | "external"; + studioSource?: "MOCK" | "HTTP"; + studioSessionStatus?: number; + host?: Record; + }> = {}, +) { + const validated = validateRuntimeConfig({ + ...CONFIG_DOCUMENT, + AUTH_MODE: options.authMode ?? CONFIG_DOCUMENT.AUTH_MODE, + TECH_LOG_STUDIO_SOURCE: options.studioSource ?? "HTTP", + }); + if (!validated.success) throw new Error(JSON.stringify(validated.issues)); + const fetcher = vi.fn(async (input: RequestInfo | URL, _init?: RequestInit) => { + const url = String(input); + if (url.endsWith("/api/v1/studio/session")) { + return new Response(null, { status: options.studioSessionStatus ?? 200 }); + } + if (url.endsWith("/api/test-entities/session")) { + return Response.json({ id: "studio-csrf", name: "session" }); + } + if (url.includes("/api/test-entities?") && options.studioStatus !== undefined) { + return Response.json( + { type: "about:blank", title: "Forbidden", status: options.studioStatus }, + { status: options.studioStatus }, + ); + } + return Response.json([{ id: "entity-1", name: "Entity" }]); + }); + current = await createRuntimeAdapters({ + runtime: { + config: validated.data, + configSchema: "V2", + build: { + buildId: "build-a", + commitSha: "abc123", + routerBasePath: "/", + runtimeConfigUrl: "/config.json", + }, + validationDurationMs: 0, + }, + release, + host: { + ...options.host, + ...(options.cookie === undefined ? {} : { document: { cookie: options.cookie } }), + }, + fetcher: fetcher as unknown as typeof fetch, + }); + const capabilities = fixture.capabilities; + if (!capabilities) throw new Error("feature capabilities were not composed"); + return { + capabilities, + http: capabilities.http as InstalledHttpOperationExecutor, + studioHttp: capabilities.studioHttp as InstalledHttpOperationExecutor, + fetcher, + }; +} + +const list = (operation: readonly [string, string]) => + fixture.withProfile(TEST_LIST_HTTP_CONTRACT, ...operation); + +function sent(fetcher: ReturnType, index: number) { + const [url, init] = fetcher.mock.calls[index] as [RequestInfo | URL, RequestInit]; + return { url: String(url), credentials: init.credentials, headers: new Headers(init.headers) }; +} + +describe("09-02 product needs through the product-owned files only", () => { + it("adds product capabilities next to the template's own", async () => { + const { capabilities } = await compose(); + + expect(Object.keys(capabilities).sort()).toEqual( + [...PRODUCT_NEEDS, "http", "telemetry"].sort(), + ); + expect(capabilities.runtime).toEqual({ + appEnvironment: "local", + apiBaseUrl: "http://localhost:8080/", + }); + expect(capabilities.studioSource).toBe("HTTP"); + }); + + it("memento: offsetUpload sends the XSRF cookie while the scope is ready", async () => { + const { capabilities, fetcher } = await compose({ cookie: "XSRF-TOKEN=xsrf-1" }); + const offsetUpload = capabilities.offsetUpload as { + upload(path: string, body: Blob): Promise; + }; + + await expect(offsetUpload.upload("/api/uploads/1", new Blob(["chunk"]))).resolves.toBe(200); + expect(sent(fetcher, 0).headers.get("x-xsrf-token")).toBe("xsrf-1"); + }); + + it("memento: BFF reads go out signed out, with the cookie and no header", async () => { + const { http, fetcher } = await compose(); + + const outcome = await http.execute(list(OPERATIONS.bffRead), { limit: 1 }, { routeId: "R" }); + + expect(outcome.kind).toBe("SUCCESS"); + expect(sent(fetcher, 0).credentials).toBe("include"); + expect([...sent(fetcher, 0).headers.keys()]).not.toContain("x-xsrf-token"); + }); + + it("memento: BFF writes carry the XSRF cookie and fail closed without it", async () => { + const withCookie = await compose({ cookie: "theme=dark; XSRF-TOKEN=xsrf-1" }); + await expect( + withCookie.http.execute(list(OPERATIONS.bffWrite), { limit: 1 }, { routeId: "R" }), + ).resolves.toMatchObject({ kind: "SUCCESS" }); + expect(sent(withCookie.fetcher, 0).headers.get("x-xsrf-token")).toBe("xsrf-1"); + current?.infrastructure.dispose(); + + const without = await compose(); + await expect( + without.http.execute(list(OPERATIONS.bffWrite), { limit: 1 }, { routeId: "R" }), + ).resolves.toMatchObject({ + kind: "AUTH_INTEGRATION_FAILURE", + reason: "CREDENTIAL_OWNER_UNAVAILABLE", + }); + expect(without.fetcher).not.toHaveBeenCalled(); + }); + + it("tech-log: Studio calls fetch the CSRF token once and then send it", async () => { + const { studioHttp, fetcher } = await compose(); + + for (let call = 0; call < 2; call += 1) { + await expect( + studioHttp.execute(list(OPERATIONS.studio), { limit: 1 }, { routeId: "STUDIO" }), + ).resolves.toMatchObject({ kind: "SUCCESS" }); + } + + expect(fetcher.mock.calls.map((_, index) => sent(fetcher, index).url)).toEqual([ + "http://localhost:8080/api/test-entities/session", + "http://localhost:8080/api/test-entities?limit=1", + "http://localhost:8080/api/test-entities?limit=1", + ]); + expect(sent(fetcher, 0).headers.has("x-csrf-token")).toBe(false); + expect(sent(fetcher, 2).headers.get("x-csrf-token")).toBe("studio-csrf"); + }); + + it("tech-log: a 403 drops the Studio token so the next call fetches a new one", async () => { + const { studioHttp, fetcher } = await compose({ studioStatus: 403 }); + + for (let call = 0; call < 2; call += 1) { + await expect( + studioHttp.execute(list(OPERATIONS.studio), { limit: 1 }, { routeId: "STUDIO" }), + ).resolves.toMatchObject({ kind: "FORBIDDEN" }); + } + + const sessionFetches = fetcher.mock.calls.filter(([url]) => + String(url).endsWith("/session"), + ); + expect(sessionFetches).toHaveLength(2); + }); + + it("tech-log: the product config key joins the strict document", () => { + const parsed = (document: Record) => validateRuntimeConfig(document); + + expect(parsed({ ...CONFIG_DOCUMENT, TECH_LOG_STUDIO_SOURCE: "HTTP" })).toMatchObject({ + success: true, + data: { TECH_LOG_STUDIO_SOURCE: "HTTP" }, + }); + expect(parsed(CONFIG_DOCUMENT)).toMatchObject({ + success: true, + data: { TECH_LOG_STUDIO_SOURCE: "MOCK" }, + }); + expect(parsed({ ...CONFIG_DOCUMENT, TECH_LOG_STUDIO_SOURCE: "LIVE" })).toMatchObject({ + success: false, + issues: [{ path: "TECH_LOG_STUDIO_SOURCE" }], + }); + expect(parsed({ ...CONFIG_DOCUMENT, TECH_LOG_TYPO: "HTTP" })).toMatchObject({ + success: false, + issues: [{ path: "TECH_LOG_TYPO", code: "unrecognized_keys" }], + }); + // The build scripts read the same schema (generate-runtime-config.ts). + expect( + runtimeConfigV2ArtifactSchema.parse({ ...CONFIG_DOCUMENT, TECH_LOG_STUDIO_SOURCE: "HTTP" }), + ).toMatchObject({ TECH_LOG_STUDIO_SOURCE: "HTTP" }); + }); + + it("tech-log: the config key's FE-REG-ENV row joins ENV_REGISTRY", async () => { + // check:registries and vite.config.ts read this same object. + const { ENV_REGISTRY } = await import("../../src/contracts/env.ts"); + + expect(ENV_REGISTRY).toMatchObject({ + APP_ENV: { phase: "runtime", classification: "public", required: true }, + TECH_LOG_STUDIO_SOURCE: { + phase: "runtime", + classification: "public", + required: false, + defaultValue: "MOCK", + }, + }); + }); + + it("tech-log: the BFF session owner is the session from boot, in external mode only", async () => { + const session = async (options: Parameters[0]) => { + const { fetcher } = await compose(options); + const port = current?.outputPorts.session; + if (!port) throw new Error("not composed"); + await vi.waitFor(() => expect(port.getState()).not.toBe("recovery-pending")); + const state = port.getState(); + current?.infrastructure.dispose(); + current = undefined; + return { state, fetcher }; + }; + + const signedIn = await session({ authMode: "external" }); + expect(signedIn.state).toBe("authenticated"); + expect(sent(signedIn.fetcher, 0)).toMatchObject({ + url: "http://localhost:8080/api/v1/studio/session", + credentials: "include", + }); + await expect( + session({ authMode: "external", studioSessionStatus: 401 }), + ).resolves.toMatchObject({ state: "unauthenticated" }); + // The product's owner comes before the host's global owner. + await expect( + session({ authMode: "external", host: { __CA_FRONTEND_AUTH_OWNER__: hostOwner() } }), + ).resolves.toMatchObject({ state: "authenticated" }); + // The product returns none: the host's owner, or no owner, as before. + await expect( + session({ + authMode: "external", + studioSource: "MOCK", + host: { __CA_FRONTEND_AUTH_OWNER__: hostOwner() }, + }), + ).resolves.toMatchObject({ state: "unauthenticated" }); + await expect( + session({ authMode: "external", studioSource: "MOCK" }), + ).resolves.toMatchObject({ state: "integration-failed" }); + expect(fixture.sessionOwnerRequests).toBe(5); + + // Demo mode keeps its own session and does not ask the product. + fixture.sessionOwnerRequests = 0; + await expect(session({})).resolves.toMatchObject({ state: "unauthenticated" }); + expect(fixture.sessionOwnerRequests).toBe(0); + }); +}); + +/** A host-published owner that is signed out. */ +function hostOwner() { + return { + readState: () => "unauthenticated", + readSubject: () => null, + subscribe: () => () => {}, + beginSignIn: async () => {}, + signOut: async () => {}, + attachCredential: async () => ({ headers: {} }), + recoverSession: async () => "no-session", + notifyUnauthenticated() {}, + }; +} + +/** + * The template files tech-log edited (af3d8e6 sync) for the needs above. They + * stay template-owned; this fixture reaches the same result without them. + */ +const TECH_LOG_EDITED_TEMPLATE_FILES = [ + "src/contracts/env.ts", + "src/bootstrap/create-runtime-composition.ts", + "src/bootstrap/runtime-config-schema.ts", + "src/bootstrap/runtime-adapters.ts", +]; +/** Stand in for an installed feature and observe its capabilities; not product code. */ +const INSTALLED_FEATURE_SEAMS = [ + "src/features/installed-contract-contributions.ts", + "src/features/installed-feature-adapters.ts", +]; + +describe("09-02 the fixture replaces product-owned files only", () => { + const source = (file: string) => readFile(new URL(`../../${file}`, import.meta.url), "utf8"); + + it("mocks the two product-owned files and none tech-log edited", async () => { + const mocked = [ + ...(await source("tests/unit/product-composition-fixture.test.ts")).matchAll( + /vi\.(?:doMock|mock)\(\s*"\.\.\/\.\.\/(src\/[^"]+)"/g, + ), + ].flatMap((match) => (match[1] === undefined ? [] : [match[1]])); + const product = [...new Set(mocked)] + .filter((file) => !INSTALLED_FEATURE_SEAMS.includes(file)) + .sort(); + + expect(product).toEqual([ + "src/bootstrap/product-composition.ts", + "src/contracts/product-contracts.ts", + ]); + for (const file of product) { + expect(await source(file), file).toContain("Product-owned."); + } + for (const file of TECH_LOG_EDITED_TEMPLATE_FILES) { + expect(await source(file), file).not.toContain("Product-owned."); + } + }); +}); + +const EMPTY_PRODUCT = { + PRODUCT_RUNTIME_CONFIG_FIELDS: {}, + PRODUCT_REST_AUTH_PROFILES: {}, + PRODUCT_ENV_REGISTRY: {}, +}; + +describe("09-02 a product row cannot take a template name", () => { + afterEach(() => { + vi.doUnmock("../../src/contracts/product-contracts.ts"); + vi.resetModules(); + }); + + it.each([ + { + registry: "auth profiles", + load: () => import("../../src/contracts/rest-profiles.ts"), + product: { ...EMPTY_PRODUCT, PRODUCT_REST_AUTH_PROFILES: { ANONYMOUS: {} } }, + error: "Product REST auth profile ANONYMOUS reuses a template profile id.", + }, + { + registry: "runtime config", + load: () => import("../../src/contracts/release-artifacts.ts"), + product: { ...EMPTY_PRODUCT, PRODUCT_RUNTIME_CONFIG_FIELDS: { APP_ENV: {} } }, + error: "Product runtime config key APP_ENV is a template key.", + }, + { + registry: "FE-REG-ENV", + load: () => import("../../src/contracts/env.ts"), + product: { ...EMPTY_PRODUCT, PRODUCT_ENV_REGISTRY: { APP_ENV: {} } }, + error: "Product env key APP_ENV is a template key.", + }, + ])("refuses to load ($registry)", async ({ load, product, error }) => { + vi.resetModules(); + vi.doMock("../../src/contracts/product-contracts.ts", () => product); + + await expect(load()).rejects.toThrow(error); + }); +}); diff --git a/tests/unit/product-extension-typecheck.test.ts b/tests/unit/product-extension-typecheck.test.ts new file mode 100644 index 00000000..c12f3b0b --- /dev/null +++ b/tests/unit/product-extension-typecheck.test.ts @@ -0,0 +1,213 @@ +import { spawnSync } from "node:child_process"; +import { existsSync } from "node:fs"; +import { cp, mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import path from "node:path"; + +import { afterAll, describe, expect, it } from "vitest"; + +import { linkFixtureNodeModules } from "../../scripts/lib/fixture-node-modules.ts"; +import { REMOVAL_FIXTURE_COPY_TARGETS } from "../../scripts/lib/removal-fixture.ts"; + +/** + * 1103/09-02. The product extension point has to hold on the typecheck path, + * not only at run time: `tests/unit/product-composition-fixture.test.ts` + * replaces the product-owned files with `vi.mock`, which no `tsc` ever sees. + * This fills them with real files in a copy of the repository, the way a + * product does, and runs the three typecheck programs of `check:types` over + * it: + * + * - a product capability typed in `src/features/product-capabilities.ts`, + * built in `product-composition.ts` and named in a feature's `needs`. The + * scripts' program reaches the feature but never `product-composition.ts`; + * - a product runtime-config key with a `.default()`, which the template's + * own tests must not have to spell out. + * + * Only product-owned files and the feature's own directory are written. + * + * The probe's names (`typecheck-probe-*`) are reserved for it: they are not + * the manual's example names, which a product may well use (1103 X2 #1). The + * capability type is appended to the product's own declaration, which a + * TypeScript interface merges, so a product that already declares + * capabilities keeps them. + */ +/** Appended to the product's own `product-capabilities.ts`. */ +const PRODUCT_CAPABILITY_TYPES = ` +export interface ProductFeaturePlatformCapabilities { + readonly typecheckProbeSettings: Readonly<{ pageSize(): number }>; +} +`; + +const PRODUCT_CONTRACTS = `import { z } from "./zod.ts"; + +/** Product-owned. Filled by the 1103/09-02 typecheck fixture. */ +export const PRODUCT_RUNTIME_CONFIG_FIELDS = Object.freeze({ + TYPECHECK_PROBE_PAGE_SIZE: z.int().min(1).max(100).default(20), +}); + +export const PRODUCT_ENV_REGISTRY = Object.freeze({ + TYPECHECK_PROBE_PAGE_SIZE: { + phase: "runtime", + classification: "public", + required: false, + defaultValue: "20", + }, +} as const); + +export const PRODUCT_REST_AUTH_PROFILES = Object.freeze({}); +`; + +const PRODUCT_COMPOSITION = `import type { + ProductComposition, + ProductCompositionContext, + ProductSessionOwner, + ProductSessionOwnerContext, +} from "./product-composition-contract.ts"; + +/** Product-owned. Filled by the 1103/09-02 typecheck fixture. */ +export function composeProductSessionOwner( + context: ProductSessionOwnerContext, +): ProductSessionOwner { + return null; +} + +export function composeProduct(context: ProductCompositionContext) { + const pageSize = context.config.TYPECHECK_PROBE_PAGE_SIZE; + return { + capabilities: { + typecheckProbeSettings: Object.freeze({ pageSize: () => pageSize }), + }, + credentialProviders: {}, + } satisfies ProductComposition; +} +`; + +const FEATURE_ID = "typecheck-probe-feature"; +const CONTEXT_ID = "typecheck-probe-context"; + +const FEATURE_MODULE = `import { defineFeatureModule } from "../feature-module.ts"; + +export const FEATURE_MODULE_ID = "${FEATURE_ID}"; +export const FEATURE_CONTEXT_ID = "${CONTEXT_ID}"; + +export const FEATURE_MODULE = defineFeatureModule({ + id: FEATURE_MODULE_ID, + contracts: { + featureId: FEATURE_MODULE_ID, + routes: {}, + routeRuntimeContracts: {}, + invalidation: { + topics: Object.freeze([]), + namespaces: Object.freeze([]), + edges: Object.freeze([]), + }, + topicVersions: Object.freeze([]), + contractPackages: Object.freeze([]), + }, + routes: {}, + // Both locales: with the sample features removed (test:sample-removal) + // this is the only catalog the message key types come from. + messages: { + "ko-KR": { "typecheckProbe.title": "타입 검사 탐침" }, + "en-US": { "typecheckProbe.title": "Typecheck probe" }, + }, + loadRuntime: async () => (await import("./feature-runtime.ts")).FEATURE_RUNTIME, +} as const); +`; + +const FEATURE_RUNTIME = `import { defineFeatureAdapterContribution } from "../feature-adapter-contribution.ts"; +import { defineFeatureRuntime } from "../feature-module.ts"; + +type TypecheckProbeInput = Readonly<{ pageSize(): number }>; + +declare module "../../application/ports/in/application-api.ts" { + interface ApplicationFeatureInputs { + "${FEATURE_ID}": TypecheckProbeInput; + } +} + +export const FEATURE_RUNTIME = defineFeatureRuntime({ + featureId: "${FEATURE_ID}", + schemas: {}, + adapters: [ + defineFeatureAdapterContribution({ + featureId: "${FEATURE_ID}", + needs: ["typecheckProbeSettings"] as const, + createInput: ({ typecheckProbeSettings }) => + Object.freeze({ + featureId: "${FEATURE_ID}", + input: Object.freeze({ pageSize: () => typecheckProbeSettings.pageSize() }), + }), + }), + ], + contractContributions: [], +} as const); +`; + +const CONTEXT_ROUTES = `import type { RouteObject } from "react-router-dom"; + +export const FEATURE_CONTEXT_ROUTES: readonly RouteObject[] = Object.freeze([]); +`; + +const CONTEXT_MODULE = `export const CONTEXT_MODULE_ID = "${CONTEXT_ID}"; +export const CONTEXT_APP_ID = "template-app"; +export const CONTEXT_ROUTE_PATH = "typecheck-probe/*"; +export const CONTEXT_MAX_FEATURES = 1; +`; + +const roots: string[] = []; + +afterAll(async () => { + await Promise.all(roots.map((root) => rm(root, { recursive: true, force: true }))); +}); + +describe("1103/09-02 a product filled through its own files typechecks", () => { + it("passes the app, node and test programs", async () => { + const root = await mkdtemp(path.join(tmpdir(), "product-extension-typecheck-")); + roots.push(root); + // The repository's one copy-target list for a fixture copy. A removal + // drill runs this test in a copy that has already lost some of them + // (test:optional-recipe-removal deletes recipes/). + expect(existsSync(path.resolve("src/features", FEATURE_ID)), FEATURE_ID).toBe(false); + for (const entry of REMOVAL_FIXTURE_COPY_TARGETS) { + if (!existsSync(path.resolve(entry))) continue; + await cp(path.resolve(entry), path.join(root, entry), { + recursive: true, + filter: (source) => !source.includes(`${path.sep}.generated`), + }); + } + await linkFixtureNodeModules(root); + const shipped = await readFile(path.resolve("src/features/product-capabilities.ts"), "utf8"); + const files: Readonly> = { + "src/features/product-capabilities.ts": `${shipped}${PRODUCT_CAPABILITY_TYPES}`, + "src/contracts/product-contracts.ts": PRODUCT_CONTRACTS, + "src/bootstrap/product-composition.ts": PRODUCT_COMPOSITION, + [`src/contexts/${CONTEXT_ID}/context-module.ts`]: CONTEXT_MODULE, + [`src/features/${FEATURE_ID}/feature-module.ts`]: FEATURE_MODULE, + [`src/features/${FEATURE_ID}/feature-runtime.ts`]: FEATURE_RUNTIME, + [`src/features/${FEATURE_ID}/context-routes.ts`]: CONTEXT_ROUTES, + }; + for (const [file, content] of Object.entries(files)) { + await mkdir(path.dirname(path.join(root, file)), { recursive: true }); + await writeFile(path.join(root, file), content); + } + + const generated = spawnSync( + process.execPath, + [path.resolve("scripts/generate-product-feature-index.ts"), `--root=${root}`], + { encoding: "utf8" }, + ); + expect(generated.stderr).toBe(""); + expect(generated.status).toBe(0); + + for (const project of ["tsconfig.app.json", "tsconfig.node.json", "tsconfig.test.json"]) { + const typecheck = spawnSync( + path.resolve("node_modules/.bin/tsc"), + ["--project", path.join(root, project)], + { encoding: "utf8" }, + ); + expect(typecheck.stdout + typecheck.stderr, project).toBe(""); + expect(typecheck.status, project).toBe(0); + } + }, 120_000); +}); diff --git a/tests/unit/product-feature-selection-build.test.ts b/tests/unit/product-feature-selection-build.test.ts index 987efb1c..2a8242a3 100644 --- a/tests/unit/product-feature-selection-build.test.ts +++ b/tests/unit/product-feature-selection-build.test.ts @@ -65,8 +65,8 @@ describe("VITE_PRODUCT_FEATURES=none build (09-02)", () => { expect(contextIndex).not.toContain("../features/"); const contributions = (await import( - pathToFileURL(path.join(root, "src/features/installed-contract-contributions.ts")).href - )) as typeof import("../../src/features/installed-contract-contributions.ts"); + pathToFileURL(path.join(root, "src/features/loaded-feature-runtimes.ts")).href + )) as typeof import("../../src/features/loaded-feature-runtimes.ts"); expect(contributions.INSTALLED_CONTRACT_CONTRIBUTIONS).toEqual([]); const manifest = (await import( pathToFileURL(path.join(root, "src/features/installed-product-manifest.ts")).href diff --git a/tests/unit/product-features.test.ts b/tests/unit/product-features.test.ts index d2b353ae..2810c80c 100644 --- a/tests/unit/product-features.test.ts +++ b/tests/unit/product-features.test.ts @@ -6,6 +6,7 @@ import { selectCompiledProductFeatures, } from "../../src/contracts/product-features.ts"; import { runtimeConfigV2ArtifactSchema } from "../../src/contracts/release-artifacts.ts"; +import { FEATURE_REPLACEABLE_PLATFORM_ROUTE_IDS } from "../../src/contracts/routes.ts"; import { COMPILED_PRODUCT_FEATURE_IDS, INSTALLED_PRODUCT_FEATURE_IDS, @@ -214,10 +215,12 @@ describe("route ownership", () => { expect(Object.values(ROUTE_FEATURE_OWNER)).toContain(featureId); } // Platform routes have no owner, so disabling a feature can never withdraw - // the shell's own navigation. + // the shell's own navigation. The exception is a route the platform lets + // one feature take over (09-03: a product's home). for (const routeId of ["APP_HOME", "NOT_FOUND", "EXAMPLES_PLATFORM"]) { - expect(ROUTE_FEATURE_OWNER[routeId], routeId).toBeUndefined(); expect(Object.keys(ROUTE_REGISTRY)).toContain(routeId); + if (FEATURE_REPLACEABLE_PLATFORM_ROUTE_IDS.includes(routeId)) continue; + expect(ROUTE_FEATURE_OWNER[routeId], routeId).toBeUndefined(); } }); diff --git a/tests/unit/product-index-entrypoints.test.ts b/tests/unit/product-index-entrypoints.test.ts index 85d7b97c..dea64a61 100644 --- a/tests/unit/product-index-entrypoints.test.ts +++ b/tests/unit/product-index-entrypoints.test.ts @@ -9,7 +9,6 @@ const GENERATE = "node scripts/generate-product-feature-index.ts && "; // Entry points the import walk below cannot see (tsc, vite, storybook). const NON_NODE_ENTRY_SCRIPTS = [ "dev", - "build:app-only", "storybook", "build:storybook", "check:types:app", diff --git a/tests/unit/product-runtime-capability-selection.test.ts b/tests/unit/product-runtime-capability-selection.test.ts new file mode 100644 index 00000000..7db973bf --- /dev/null +++ b/tests/unit/product-runtime-capability-selection.test.ts @@ -0,0 +1,67 @@ +import { readFile } from "node:fs/promises"; + +import { afterEach, describe, expect, it, vi } from "vitest"; + +/** + * 1103/09-05. The static optional-capability selection (§3.5) is the + * product's choice, so it lives in a product-owned file. Turning the Service + * Worker on is an edit there; `installed-runtime-capabilities.ts` stays the + * template's and only validates and projects what the product selected. + */ + +const source = (file: string) => + readFile(new URL(`../../${file}`, import.meta.url), "utf8"); + +const ACTIVE = Object.freeze({ + mode: "ACTIVE" as const, + scriptPath: "service-worker.js" as const, + handlers: Object.freeze(["PWA_STATIC_ASSETS" as const]), +}); + +afterEach(() => { + vi.doUnmock("../../src/features/product-capabilities.ts"); + vi.resetModules(); +}); + +async function installedWith(selection: Record) { + vi.resetModules(); + vi.doMock("../../src/features/product-capabilities.ts", () => ({ + PRODUCT_RUNTIME_CAPABILITY_SELECTION: Object.freeze({ + realtime: Object.freeze([]), + webWorkers: Object.freeze([]), + serviceWorker: null, + offlineCommands: null, + ...selection, + }), + })); + return (await import("../../src/features/installed-runtime-capabilities.ts")) + .INSTALLED_RUNTIME_CAPABILITIES; +} + +describe("1103/09-05 the optional runtime selection is product-owned", () => { + it("declares the selection in the product-owned file only", async () => { + const product = await source("src/features/product-capabilities.ts"); + const installed = await source("src/features/installed-runtime-capabilities.ts"); + + expect(product).toContain("Product-owned."); + // tests/e2e/support/service-worker-builds.ts premise 1 edits this line. + expect( + product.match(/const SERVICE_WORKER: InstalledServiceWorkerSelection \| null = /gu), + ).toHaveLength(1); + expect(installed).not.toContain("Product-owned."); + expect(installed).not.toMatch(/const (REALTIME|WEB_WORKERS|SERVICE_WORKER|OFFLINE_COMMANDS)\b/u); + }); + + it("projects the product's Service Worker selection", async () => { + const installed = await installedWith({ serviceWorker: ACTIVE }); + + expect(installed.serviceWorker).toEqual(ACTIVE); + expect(Object.isFrozen(installed)).toBe(true); + }); + + it("still validates what the product selected", async () => { + await expect( + installedWith({ webWorkers: Object.freeze([Object.freeze({ taskGroupId: "" })]) }), + ).rejects.toThrow(TypeError); + }); +}); diff --git a/tests/unit/product-session-owner-context.test.ts b/tests/unit/product-session-owner-context.test.ts new file mode 100644 index 00000000..769c4e3b --- /dev/null +++ b/tests/unit/product-session-owner-context.test.ts @@ -0,0 +1,273 @@ +import { afterEach, describe, expect, it, vi } from "vitest"; + +import type { ProductSessionOwnerContext } from "../../src/bootstrap/product-composition-contract.ts"; +import { + createSessionOwnerFetch, + SESSION_OWNER_FETCH_MAXIMUM_BYTES, +} from "../../src/bootstrap/session-owner-fetch.ts"; +import { createRuntimeAdapters } from "../../src/bootstrap/runtime-adapters.ts"; +import { validateRuntimeConfig } from "../../src/bootstrap/runtime-config-schema.ts"; + +/** + * 1103/09-03. A session owner is asked for at boot, before `http` exists, and + * the shipped context gave it a raw `fetcher`: a session probe or a token call + * that never answered left the session `recovery-pending` for good. The + * context now carries a fetch with one deadline over the whole exchange. + */ + +const fixture = vi.hoisted(() => ({ + context: undefined as ProductSessionOwnerContext | undefined, +})); + +vi.mock("../../src/bootstrap/product-composition.ts", () => ({ + composeProductSessionOwner(context: ProductSessionOwnerContext) { + fixture.context = context; + return null; + }, + composeProduct: () => ({ capabilities: {}, credentialProviders: {} }), +})); + +const never = () => new Promise(() => {}); + +/** A body that sends one chunk and then nothing. */ +function stalledBody(): ReadableStream { + return new ReadableStream({ + start(controller) { + controller.enqueue(new TextEncoder().encode("{")); + }, + }); +} + +describe("createSessionOwnerFetch", () => { + it("answers with the whole body read, status and headers kept", async () => { + const fetcher = vi.fn(async () => + Response.json({ sub: "user-1" }, { status: 201, headers: { "x-extra": "1" } }), + ); + const bounded = createSessionOwnerFetch({ fetcher, timeoutMs: 1_000 }); + + const response = await bounded("https://idp.example/token", { + method: "POST", + credentials: "omit", + }); + + expect(response.status).toBe(201); + expect(response.headers.get("x-extra")).toBe("1"); + await expect(response.json()).resolves.toEqual({ sub: "user-1" }); + const [, init] = fetcher.mock.calls[0] as unknown as [string, RequestInit]; + expect(init).toMatchObject({ + method: "POST", + credentials: "omit", + cache: "no-store", + redirect: "error", + }); + expect(init.signal).toBeInstanceOf(AbortSignal); + }); + + it("refuses to follow a redirect even when asked", async () => { + const fetcher = vi.fn(async () => new Response("{}")); + const bounded = createSessionOwnerFetch({ fetcher, timeoutMs: 1_000 }); + + await bounded("https://api.example/session", { + redirect: "follow", + } as unknown as Parameters[1]); + + expect((fetcher.mock.calls[0] as unknown as [string, RequestInit])[1].redirect).toBe("error"); + }); + + it("times out a request that never answers", async () => { + const bounded = createSessionOwnerFetch({ fetcher: never, timeoutMs: 20 }); + + await expect(bounded("https://api.example/session")).rejects.toMatchObject({ + name: "TimeoutError", + }); + }); + + it("times out a body that stops arriving: the deadline covers the body", async () => { + const bounded = createSessionOwnerFetch({ + fetcher: async () => new Response(stalledBody()), + timeoutMs: 20, + }); + + await expect(bounded("https://api.example/session")).rejects.toMatchObject({ + name: "TimeoutError", + }); + }); + + it("lets one call shorten the deadline but never extend it", async () => { + const shorter = createSessionOwnerFetch({ fetcher: never, timeoutMs: 10_000 }); + const started = Date.now(); + await expect( + shorter("https://api.example/session", { timeoutMs: 20 }), + ).rejects.toMatchObject({ name: "TimeoutError" }); + expect(Date.now() - started).toBeLessThan(5_000); + + const capped = createSessionOwnerFetch({ fetcher: never, timeoutMs: 20 }); + await expect( + capped("https://api.example/session", { timeoutMs: 60_000 }), + ).rejects.toMatchObject({ name: "TimeoutError" }); + }); + + it("stops when the caller aborts", async () => { + const bounded = createSessionOwnerFetch({ fetcher: never, timeoutMs: 10_000 }); + const caller = new AbortController(); + + const pending = bounded("https://api.example/session", { signal: caller.signal }); + caller.abort(); + + await expect(pending).rejects.toMatchObject({ name: "AbortError" }); + }); + + it("refuses a body over the cap and cancels it", async () => { + const cancel = vi.fn(); + const chunk = new Uint8Array(SESSION_OWNER_FETCH_MAXIMUM_BYTES); + const body = new ReadableStream({ + pull(controller) { + controller.enqueue(chunk); + }, + cancel, + }); + const bounded = createSessionOwnerFetch({ + fetcher: async () => new Response(body), + timeoutMs: 1_000, + }); + + await expect(bounded("https://api.example/session")).rejects.toBeInstanceOf(RangeError); + expect(cancel).toHaveBeenCalled(); + }); + + it("passes the fetcher's own rejection through", async () => { + const bounded = createSessionOwnerFetch({ + fetcher: async () => { + throw new TypeError("Failed to fetch"); + }, + timeoutMs: 1_000, + }); + + await expect(bounded("https://api.example/session")).rejects.toThrow("Failed to fetch"); + }); + + it("answers a body-less status without a body", async () => { + const bounded = createSessionOwnerFetch({ + fetcher: async () => new Response(null, { status: 204 }), + timeoutMs: 1_000, + }); + + const response = await bounded("https://api.example/sign-out", { method: "POST" }); + + expect(response.status).toBe(204); + expect(response.body).toBeNull(); + }); +}); + +const CONFIG = { + APP_ENV: "local", + API_BASE_URL: "http://localhost:8080", + REQUEST_TIMEOUT_MS: 150, + TELEMETRY_ENABLED: false, + AUTH_MODE: "external", + CONFIG_SCHEMA_VERSION: "2.0", + RELEASE_MANIFEST_URL: "/release-manifest.json", + CAPABILITY_OVERRIDES: { + REALTIME: "DEFAULT", + WEB_WORKER: "DEFAULT", + SERVICE_WORKER: "DEFAULT", + OFFLINE_COMMANDS: "DEFAULT", + }, + FEATURE_OVERRIDES: {}, +} as const; + +describe("the session owner context the composition root builds", () => { + let dispose: (() => void) | undefined; + afterEach(() => { + dispose?.(); + dispose = undefined; + fixture.context = undefined; + }); + + async function compose(host: Record, fetcher: typeof fetch) { + const validated = validateRuntimeConfig(CONFIG); + if (!validated.success) throw new Error(JSON.stringify(validated.issues)); + const adapters = await createRuntimeAdapters({ + runtime: { + config: validated.data, + configSchema: "V2", + build: { + buildId: "build-a", + commitSha: "abc123", + routerBasePath: "/", + runtimeConfigUrl: "/config.json", + }, + validationDurationMs: 0, + }, + release: { + schemaVersion: 2, + appVersion: "0.1.0", + buildId: "build-a", + commitSha: "abc123", + configSchemaVersion: "2.0", + contractSet: { + setAlgorithm: "CA_CONTRACT_SET_V1", + setDigest: `sha256:${"0".repeat(64)}`, + packages: [], + }, + assetManifestHash: "hash-a", + releaseId: "release-a", + builtAt: "2026-07-25T00:00:00Z", + routeChunks: { "route-home": "assets/home.js" }, + }, + host, + fetcher, + }); + dispose = () => adapters.infrastructure.dispose(); + const context = fixture.context; + if (!context) throw new Error("the session owner was not asked"); + return context; + } + + it("bounds the owner's fetch by REQUEST_TIMEOUT_MS", async () => { + const context = await compose({}, never as unknown as typeof fetch); + + await expect(context.fetch("http://localhost:8080/session")).rejects.toMatchObject({ + name: "TimeoutError", + }); + }); + + it("reads the page, its session storage and its cookies through the host", async () => { + const replaceState = vi.fn(); + const assign = vi.fn(); + const storage = new Map(); + const sessionStorage = { + getItem: (key: string) => storage.get(key) ?? null, + setItem: (key: string, value: string) => void storage.set(key, value), + removeItem: (key: string) => void storage.delete(key), + }; + const context = await compose( + { + location: { href: "http://localhost:5173/callback?code=c&state=s", assign }, + history: { state: { idx: 3 }, replaceState }, + sessionStorage, + document: { cookie: "theme=dark; XSRF-TOKEN=xsrf-1" }, + }, + (async () => new Response("{}")) as unknown as typeof fetch, + ); + + expect(context.page.href()).toBe("http://localhost:5173/callback?code=c&state=s"); + context.page.replaceUrl("/items?limit=1"); + // The router's own history state is kept, so its index survives. + expect(replaceState).toHaveBeenCalledWith({ idx: 3 }, "", "/items?limit=1"); + context.page.assign("https://idp.example/auth"); + expect(assign).toHaveBeenCalledWith("https://idp.example/auth"); + context.redirectStorage?.setItem("k", "v"); + expect(storage.get("k")).toBe("v"); + expect(context.readCookie("XSRF-TOKEN")).toBe("xsrf-1"); + }); + + it("fails closed when the host has no page", async () => { + const context = await compose({}, (async () => new Response("{}")) as unknown as typeof fetch); + + expect(context.redirectStorage).toBeUndefined(); + expect(() => context.page.href()).toThrow("page is unavailable"); + expect(() => context.page.assign("https://idp.example/auth")).toThrow("page is unavailable"); + expect(context.readCookie("XSRF-TOKEN")).toBeUndefined(); + }); +}); diff --git a/tests/unit/promotion-readiness.test.ts b/tests/unit/promotion-readiness.test.ts index 1d6e6b35..64620889 100644 --- a/tests/unit/promotion-readiness.test.ts +++ b/tests/unit/promotion-readiness.test.ts @@ -24,7 +24,9 @@ describe("promotion readiness formula", () => { it.each([ ["FE-GATE-001", "MERGE_READY"], - ["FE-GATE-012", "RELEASE_READY"], + // 15-01. The bundle budget blocks the merge, not only the release. + ["FE-GATE-012", "MERGE_READY"], + ["FE-GATE-014", "RELEASE_READY"], ["FE-GATE-021", "PROD_PROMOTION_READY"], ["FE-GATE-018", "FIELD_SLO_READY"], ["FE-GATE-017", "DOCUMENTATION_READY"], diff --git a/tests/unit/provider-process-trace.test.ts b/tests/unit/provider-process-trace.test.ts new file mode 100644 index 00000000..fa896234 --- /dev/null +++ b/tests/unit/provider-process-trace.test.ts @@ -0,0 +1,69 @@ +import { existsSync } from "node:fs"; +import { mkdtemp, readFile, rm } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import path from "node:path"; + +import { afterEach, describe, expect, it, vi } from "vitest"; + +import { + PROVIDER_PROCESS_TRACE_VARIABLE, + providerProcessTraceEnvironment, + traceOwnProviderProcess, + traceSpawnedProviderProcess, +} from "../../scripts/lib/provider-process-trace.ts"; + +const roots: string[] = []; + +afterEach(async () => { + vi.unstubAllEnvs(); + vi.restoreAllMocks(); + await Promise.all(roots.splice(0).map((root) => rm(root, { recursive: true, force: true }))); +}); + +describe("provider process trace", () => { + it("records role, PIDs, argv and own cgroup, never the environment", async () => { + const root = await mkdtemp(path.join(tmpdir(), "provider-process-trace-")); + roots.push(root); + const target = path.join(root, "trace.jsonl"); + const credential = "trace-must-not-carry-this-credential"; + vi.stubEnv(PROVIDER_PROCESS_TRACE_VARIABLE, target); + vi.stubEnv("VULNERABILITY_PROVIDER_SECRET", credential); + + traceOwnProviderProcess("supervisor"); + traceSpawnedProviderProcess("bwrap", 4242, ["/usr/bin/bwrap", "--args", "0"]); + + const text = await readFile(target, "utf8"); + expect(text).not.toContain(credential); + const [own, spawned, ...rest] = text.trim().split("\n").map((line) => JSON.parse(line) as unknown); + expect(rest).toEqual([]); + // Exact key sets: a field added later (environment, say) fails here. + expect(own).toEqual({ + role: "supervisor", + pid: process.pid, + ppid: process.ppid, + argv: expect.arrayContaining([expect.any(String)]), + cgroup: expect.stringMatching(/^0::\//u), + }); + expect(spawned).toEqual({ + role: "bwrap", + pid: 4242, + ppid: process.pid, + argv: ["/usr/bin/bwrap", "--args", "0"], + }); + expect(providerProcessTraceEnvironment()).toEqual({ [PROVIDER_PROCESS_TRACE_VARIABLE]: target }); + }); + + it("is a no-op when unset and never fails the run on an unusable path", () => { + vi.stubEnv(PROVIDER_PROCESS_TRACE_VARIABLE, undefined); + const stderr = vi.spyOn(process.stderr, "write").mockImplementation(() => true); + traceOwnProviderProcess("supervisor"); + expect(providerProcessTraceEnvironment()).toEqual({}); + expect(stderr).not.toHaveBeenCalled(); + + const relative = `provider-process-trace-${process.pid}.jsonl`; + vi.stubEnv(PROVIDER_PROCESS_TRACE_VARIABLE, relative); + expect(() => traceSpawnedProviderProcess("guardian", 4242, ["/usr/bin/node"])).not.toThrow(); + expect(stderr).toHaveBeenCalledWith(expect.stringMatching(/must be absolute/u)); + expect(existsSync(relative)).toBe(false); + }); +}); diff --git a/tests/unit/public-response-cache-codec.test.ts b/tests/unit/public-response-cache-codec.test.ts index 5d5d8573..5c3dc7a1 100644 --- a/tests/unit/public-response-cache-codec.test.ts +++ b/tests/unit/public-response-cache-codec.test.ts @@ -157,6 +157,13 @@ describe("public cache codec and response validation (characterization)", () => expect(await stageCode([valid], response({ pragma: "no-cache" }))).toBe( "POLICY_REJECTED", ); + // 2026-11-01 02-04 (N26b, N26). Each directive or header on its own. + expect( + await stageCode([valid], response({ "cache-control": "no-cache" })), + ).toBe("POLICY_REJECTED"); + expect( + await stageCode([valid], response({ "set-cookie": "session=1" })), + ).toBe("POLICY_REJECTED"); expect( await stageCode([valid], response({ "www-authenticate": "Basic" })), ).toBe("POLICY_REJECTED"); diff --git a/tests/unit/public-response-cache-repair.test.ts b/tests/unit/public-response-cache-repair.test.ts index 1ad2757e..554ee1b6 100644 --- a/tests/unit/public-response-cache-repair.test.ts +++ b/tests/unit/public-response-cache-repair.test.ts @@ -1,7 +1,16 @@ import { describe, expect, it } from "vitest"; import type { PublicCacheAsset } from "../../src/application/ports/browser-file-storage/cache-storage-ports.ts"; -import { createDefaultPublicCachePolicy } from "../../src/adapters/cache-storage/public-cache-policy.ts"; +import { + activePointerRequest, + controlCacheName, + markerRequest, +} from "../../src/adapters/cache-storage/public-cache-codec.ts"; +import { + createDefaultPublicCachePolicy, + resolvePublicCachePolicy, + type PublicCacheRuntimePolicy, +} from "../../src/adapters/cache-storage/public-cache-policy.ts"; import { createPublicResponseCacheAdapter } from "../../src/adapters/cache-storage/public-response-cache-adapter.ts"; import { MemoryCacheStorage, @@ -17,7 +26,10 @@ import { * yet earned the right to delete what still works. */ describe("public response cache repair is failure-atomic", () => { - async function stagedRelease(releaseRegistryId: string) { + async function stagedRelease( + releaseRegistryId: string, + observer?: (event: unknown) => void, + ) { const policy = createDefaultPublicCachePolicy( "https://assets.example.test", ); @@ -55,6 +67,7 @@ describe("public response cache repair is failure-atomic", () => { crypto: globalThis.crypto, mutationLock: immediateLock, policy, + ...(observer ? { observer } : {}), fetcher: async (request: Request) => { fetchLog.push(request.url); if (failFrom !== null && request.url === failFrom) { @@ -127,6 +140,128 @@ describe("public response cache repair is failure-atomic", () => { ).toMatchObject({ ok: true }); }); + it("reports a failed re-verification of a staged candidate as CACHE_STAGE (2026-11-01 02-03)", async () => { + const observations: Readonly<{ outcome?: string }>[] = []; + const release = await stagedRelease("reverify-unreadable", (event) => + observations.push(event as Readonly<{ outcome?: string }>), + ); + const cache = release.cacheStorage.caches.get(release.cacheName)!; + const realMatch = cache.match.bind(cache); + const assetUrls = new Set(release.assets.map((asset) => asset.absoluteUrl)); + cache.match = async (request: RequestInfo | URL) => { + const url = + request instanceof Request ? request.url : String(request); + if (assetUrls.has(url)) { + throw new DOMException("Storage is busy", "InvalidStateError"); + } + return await realMatch(request); + }; + observations.length = 0; + + const restaged = await release.adapter.admin.stageRelease(release.manifest); + + expect(restaged).toMatchObject({ + ok: false, + error: { code: "UNAVAILABLE", operation: "CACHE_STAGE" }, + }); + expect( + observations.filter(({ outcome }) => outcome === "FAILED"), + ).toEqual([ + expect.objectContaining({ + operation: "CACHE_STAGE", + failureCode: "UNAVAILABLE", + }), + ]); + }); + + it("reports a cached body that cannot be read during activation as retryable, not as damage (2026-11-03 02-02)", async () => { + const release = await stagedRelease("unreadable-body"); + const cache = release.cacheStorage.caches.get(release.cacheName)!; + const realMatch = cache.match.bind(cache); + const assetUrls = new Set(release.assets.map((asset) => asset.absoluteUrl)); + cache.match = async (request: RequestInfo | URL) => { + const url = + request instanceof Request ? request.url : String(request); + const stored = await realMatch(request); + if (!stored || !assetUrls.has(url)) return stored; + // The entry is there and its headers are intact; only reading the + // stored bytes fails, as a disk or browser I/O error does. + return new Response( + new ReadableStream({ + pull(controller) { + controller.error(new TypeError("disk read failed")); + }, + }), + { headers: stored.headers }, + ); + }; + const transient = (operation: string) => ({ + ok: false, + error: { + code: "UNAVAILABLE", + operation, + retryable: true, + recovery: "RETRY", + }, + }); + + expect( + await release.adapter.responses.matchActiveExact({ + absoluteUrl: release.assets[0]!.absoluteUrl, + }), + ).toMatchObject(transient("CACHE_LOOKUP")); + expect( + await release.adapter.admin.activateRelease( + release.manifest.releaseRegistryId, + release.manifest.manifestDigestHex, + ), + ).toMatchObject(transient("CACHE_ACTIVATE")); + // The stage fast path shares the verdict: an unreadable candidate is + // neither reused nor fetched again over the network. + const fetchesBefore = release.fetchLog.length; + expect( + await release.adapter.admin.stageRelease(release.manifest), + ).toMatchObject(transient("CACHE_STAGE")); + expect(release.fetchLog).toHaveLength(fetchesBefore); + + cache.match = realMatch; + expect( + await release.adapter.admin.activateRelease( + release.manifest.releaseRegistryId, + release.manifest.manifestDigestHex, + ), + ).toMatchObject({ ok: true }); + }); + + it("still reports stored bytes that no longer match as an integrity failure", async () => { + const release = await stagedRelease("mismatched-body"); + const cache = release.cacheStorage.caches.get(release.cacheName)!; + const index = cache.responses.findIndex( + (entry) => entry.request.url === release.assets[0]!.absoluteUrl, + ); + const entry = cache.responses[index]!; + cache.responses.splice(index, 1, { + request: entry.request, + response: new Response(new Uint8Array([9, 9, 9, 9]), { + headers: entry.response.headers, + }), + }); + + expect( + await release.adapter.admin.activateRelease( + release.manifest.releaseRegistryId, + release.manifest.manifestDigestHex, + ), + ).toMatchObject({ + ok: false, + error: { + code: "INTEGRITY_FAILED", + operation: "CACHE_ACTIVATE", + recovery: "REHYDRATE", + }, + }); + }); + it("keeps every healthy asset when one repair fetch fails", async () => { const release = await stagedRelease("partial-repair"); const cache = release.cacheStorage.caches.get(release.cacheName)!; @@ -205,3 +340,295 @@ describe("public response cache repair is failure-atomic", () => { ).toMatchObject({ ok: true }); }); }); + +/** + * 0929/02-01. The active pointer was checked against the policy of the build + * reading it, so lowering `retainedPreviousReleaseCount` or a damaged pointer + * stopped lookup, activation and cleanup for good. + */ +describe("public cache pointer after a policy change or damage (0929/02-01)", () => { + const origin = "https://assets.example.test"; + const policyRetaining = (retainedPreviousReleaseCount: number) => + resolvePublicCachePolicy({ + ...createDefaultPublicCachePolicy(origin), + retainedPreviousReleaseCount, + }); + const assetUrl = (releaseRegistryId: string) => + `${origin}/${releaseRegistryId}.js`; + const body = (releaseRegistryId: string) => + new TextEncoder().encode(`release ${releaseRegistryId}`); + + function adapterFor( + cacheStorage: MemoryCacheStorage, + policy: PublicCacheRuntimePolicy, + ) { + return createPublicResponseCacheAdapter({ + cacheStorage: cacheStorage as unknown as CacheStorage, + crypto: globalThis.crypto, + mutationLock: immediateLock, + policy, + fetcher: async (request: Request) => + new Response( + Uint8Array.from( + body(new URL(request.url).pathname.slice(1, -".js".length)), + ), + { + headers: { + "cache-control": "public", + "content-type": "application/javascript", + }, + }, + ), + }); + } + + async function manifestOf( + releaseRegistryId: string, + policy: PublicCacheRuntimePolicy, + ) { + const bytes = body(releaseRegistryId); + return await manifestFor( + releaseRegistryId, + [ + { + absoluteUrl: assetUrl(releaseRegistryId), + expectedByteLength: bytes.byteLength, + expectedContentType: "application/javascript", + integrity: { algorithm: "SHA-256", digestHex: await digestHex(bytes) }, + }, + ], + policy, + ); + } + + async function deploy( + adapter: ReturnType, + releaseRegistryId: string, + policy: PublicCacheRuntimePolicy, + ) { + const manifest = await manifestOf(releaseRegistryId, policy); + expect(await adapter.admin.stageRelease(manifest)).toMatchObject({ + ok: true, + }); + return await adapter.admin.activateRelease( + manifest.releaseRegistryId, + manifest.manifestDigestHex, + ); + } + + it("keeps working after retainedPreviousReleaseCount is lowered", async () => { + const cacheStorage = new MemoryCacheStorage(); + const before = policyRetaining(3); + const wide = adapterFor(cacheStorage, before); + for (const id of ["r1", "r2", "r3", "r4"]) { + expect(await deploy(wide, id, before)).toMatchObject({ ok: true }); + } + + const after = policyRetaining(1); + const narrow = adapterFor(cacheStorage, after); + + expect( + await narrow.responses.matchActiveExact({ absoluteUrl: assetUrl("r4") }), + ).toMatchObject({ ok: true, value: expect.anything() }); + expect(await deploy(narrow, "r5", after)).toMatchObject({ ok: true }); + expect(await narrow.admin.cleanupOwned()).toMatchObject({ ok: true }); + expect( + await narrow.responses.matchActiveExact({ absoluteUrl: assetUrl("r5") }), + ).toMatchObject({ ok: true, value: expect.anything() }); + }); + + it("replaces a damaged pointer on the next verified activation", async () => { + const cacheStorage = new MemoryCacheStorage(); + const policy = policyRetaining(1); + const adapter = adapterFor(cacheStorage, policy); + expect(await deploy(adapter, "r1", policy)).toMatchObject({ ok: true }); + const control = await cacheStorage.open(controlCacheName(policy)); + await control.put( + activePointerRequest(policy), + new Response('{"schemaVersion":1,"releaseRegis', { + headers: { "content-type": "application/json" }, + }), + ); + + // A release that was never staged is still refused. + const unstaged = await manifestOf("r9", policy); + expect( + await adapter.admin.activateRelease( + unstaged.releaseRegistryId, + unstaged.manifestDigestHex, + ), + ).toMatchObject({ ok: false }); + + expect(await deploy(adapter, "r2", policy)).toMatchObject({ ok: true }); + expect(await adapter.admin.cleanupOwned()).toMatchObject({ ok: true }); + expect( + await adapter.responses.matchActiveExact({ absoluteUrl: assetUrl("r2") }), + ).toMatchObject({ ok: true, value: expect.anything() }); + }); + + it("shows a damaged pointer and the candidates it leaves behind in inspect (2026-11-03 02-05)", async () => { + const cacheStorage = new MemoryCacheStorage(); + const policy = policyRetaining(1); + const adapter = adapterFor(cacheStorage, policy); + expect(await adapter.admin.inspect()).toMatchObject({ + ok: true, + value: { activePointer: "NONE", activeReleaseRegistryId: null }, + }); + expect(await deploy(adapter, "r1", policy)).toMatchObject({ ok: true }); + expect(await deploy(adapter, "r2", policy)).toMatchObject({ ok: true }); + expect(await adapter.admin.inspect()).toMatchObject({ + ok: true, + value: { activePointer: "READABLE", activeReleaseRegistryId: "r2" }, + }); + const control = await cacheStorage.open(controlCacheName(policy)); + await control.put( + activePointerRequest(policy), + new Response('{"schemaVersion":1,"releaseRegis', { + headers: { "content-type": "application/json" }, + }), + ); + + const inspected = await adapter.admin.inspect(); + + expect(inspected).toMatchObject({ + ok: true, + value: { + activePointer: "UNREADABLE", + activeReleaseRegistryId: null, + ownedCacheCount: 3, + unreadableOwnedCacheCount: 0, + }, + }); + expect( + inspected.ok + ? inspected.value.releaseCandidates + .map(({ releaseRegistryId, verified }) => ({ + releaseRegistryId, + verified, + })) + .sort((left, right) => + left.releaseRegistryId.localeCompare(right.releaseRegistryId), + ) + : null, + ).toEqual([ + { releaseRegistryId: "r1", verified: true }, + { releaseRegistryId: "r2", verified: true }, + ]); + + // A pointer that could not be read right now is not reported as damage. + const realMatch = control.match.bind(control); + control.match = async () => { + throw new DOMException("Storage is busy", "InvalidStateError"); + }; + expect(await adapter.admin.inspect()).toMatchObject({ + ok: false, + error: { code: "UNAVAILABLE", retryable: true }, + }); + control.match = realMatch; + }); + + it("does not clean up on a damaged pointer, which may name the release being served (2026-11-03 02-03)", async () => { + const cacheStorage = new MemoryCacheStorage(); + const policy = policyRetaining(1); + const adapter = adapterFor(cacheStorage, policy); + expect(await deploy(adapter, "r1", policy)).toMatchObject({ ok: true }); + expect(await deploy(adapter, "r2", policy)).toMatchObject({ ok: true }); + const control = await cacheStorage.open(controlCacheName(policy)); + await control.put( + activePointerRequest(policy), + new Response('{"schemaVersion":1,"releaseRegis', { + headers: { "content-type": "application/json" }, + }), + ); + const before = (await cacheStorage.keys()).sort(); + + expect(await adapter.admin.cleanupOwned()).toMatchObject({ + ok: false, + error: { code: "CORRUPT_DATA", operation: "CACHE_DELETE" }, + }); + expect((await cacheStorage.keys()).sort()).toEqual(before); + }); + + it("repairs a damaged release marker by staging the same manifest again (2026-11-03 02-03)", async () => { + const cacheStorage = new MemoryCacheStorage(); + const policy = policyRetaining(1); + const adapter = adapterFor(cacheStorage, policy); + expect(await deploy(adapter, "r1", policy)).toMatchObject({ ok: true }); + const releaseName = (await cacheStorage.keys()).find((name) => + name.includes("release:r1:"), + ); + if (!releaseName) throw new Error("release cache missing"); + const release = await cacheStorage.open(releaseName); + await release.put( + markerRequest(policy), + new Response('{"schemaVersion":1,"verif', { + headers: { "content-type": "application/json" }, + }), + ); + // REHYDRATE: the damaged candidate cannot be activated as it is ... + const manifest = await manifestOf("r1", policy); + expect( + await adapter.admin.activateRelease( + manifest.releaseRegistryId, + manifest.manifestDigestHex, + ), + ).toMatchObject({ + ok: false, + error: { code: "CORRUPT_DATA", recovery: "REHYDRATE" }, + }); + + // ... and staging it again is the recovery that hint promises. + expect(await deploy(adapter, "r1", policy)).toMatchObject({ ok: true }); + expect( + await adapter.responses.matchActiveExact({ absoluteUrl: assetUrl("r1") }), + ).toMatchObject({ ok: true, value: expect.anything() }); + }); + + // 2026-11-01 02-04 (N39). The cache name list is read before the pointer. + // An activation in between moves the pointer to a cache that list does not + // have yet; the lookup lists again rather than report it evicted. + it("lists caches again before it reports the active release evicted", async () => { + // The adapter captures `keys` when it is built, so the stale answer is + // armed through the storage itself. + class StaleOnceCacheStorage extends MemoryCacheStorage { + staleNames: string[] | null = null; + override async keys(): Promise { + const stale = this.staleNames; + this.staleNames = null; + return stale ?? (await super.keys()); + } + } + const cacheStorage = new StaleOnceCacheStorage(); + const policy = policyRetaining(1); + const adapter = adapterFor(cacheStorage, policy); + expect(await deploy(adapter, "r1", policy)).toMatchObject({ ok: true }); + const namesBeforeR2 = await cacheStorage.keys(); + expect(await deploy(adapter, "r2", policy)).toMatchObject({ ok: true }); + cacheStorage.staleNames = namesBeforeR2; + + expect( + await adapter.responses.matchActiveExact({ absoluteUrl: assetUrl("r2") }), + ).toMatchObject({ ok: true, value: expect.anything() }); + }); + + it("still stops activation when the pointer read fails transiently", async () => { + const cacheStorage = new MemoryCacheStorage(); + const policy = policyRetaining(1); + const adapter = adapterFor(cacheStorage, policy); + expect(await deploy(adapter, "r1", policy)).toMatchObject({ ok: true }); + const control = cacheStorage.caches.get(controlCacheName(policy))!; + const realMatch = control.match.bind(control); + control.match = async () => { + throw new DOMException("Storage is busy", "InvalidStateError"); + }; + + expect(await deploy(adapter, "r2", policy)).toMatchObject({ + ok: false, + error: { code: "UNAVAILABLE", operation: "CACHE_ACTIVATE" }, + }); + control.match = realMatch; + expect( + await adapter.responses.matchActiveExact({ absoluteUrl: assetUrl("r1") }), + ).toMatchObject({ ok: true, value: expect.anything() }); + }); +}); diff --git a/tests/unit/realtime/bounded-poll-coordinator.test.ts b/tests/unit/realtime/bounded-poll-coordinator.test.ts index acbddaa4..c2c9cfd3 100644 --- a/tests/unit/realtime/bounded-poll-coordinator.test.ts +++ b/tests/unit/realtime/bounded-poll-coordinator.test.ts @@ -1,12 +1,18 @@ import { describe, expect, it, vi } from "vitest"; import type { ClockPort } from "../../../src/application/ports/clock-port.ts"; -import { definePollLeasePolicy } from "../../../src/application/policies/bounded-polling.ts"; +import { + definePollLeasePolicy, + type BoundedPollOperation, +} from "../../../src/application/policies/bounded-polling.ts"; +import { createContractHttpExecutor } from "../../../src/adapters/http/index.ts"; import { createBoundedPollCoordinator, type BoundedPollAttemptResult, type BoundedPollEnvironment, + type BoundedPollObservation, } from "../../../src/adapters/realtime/polling/bounded-poll-coordinator.ts"; +import { TEST_LIST_HTTP_CONTRACT } from "../../helpers/external-contract-fixture.ts"; type Sleeper = { dueAt: number; @@ -117,20 +123,26 @@ const policy = definePollLeasePolicy({ fallbackReason: "CONVERGENCE", terminalStates: ["COMPLETED", "FAILED"], }); -const operation = { - operationId: "GET_JOB_STATUS", - contractVersion: 2, - protocol: "REST", - semantics: "QUERY", - method: "GET", - replayPolicy: "SAFE", - retry: "never", - maxResponseBytes: 1_024, - transportMaxAttempts: 1, - authRecoveryCount: 0, - maxCumulativeSleepMs: 0, - serverStream: false, -} as const; +const operation: BoundedPollOperation = Object.freeze({ + contract: Object.freeze({ + ...TEST_LIST_HTTP_CONTRACT.contract, + operationId: "GET_JOB_STATUS", + }), + frontend: Object.freeze({ + ...TEST_LIST_HTTP_CONTRACT.frontend, + responseByteLimit: 1_024, + retryBudget: 0 as const, + }), +}) as BoundedPollOperation; + +function withResponseByteLimit( + responseByteLimit: number, +): BoundedPollOperation { + return { + ...operation, + frontend: { ...operation.frontend, responseByteLimit }, + }; +} async function flush(): Promise { for (let turn = 0; turn < 12; turn += 1) { @@ -284,10 +296,7 @@ describe("bounded poll coordinator", () => { ); const coordinator = createBoundedPollCoordinator({ policy, - operation: { - ...operation, - maxResponseBytes: 4_096, - }, + operation: withResponseByteLimit(4_096), execute, environment: new MutableEnvironment(), clock, @@ -894,22 +903,47 @@ describe("bounded poll coordinator", () => { }); }); - it("ends a run whose executor throws with a retryable OFFLINE", async () => { + // 1103/04-04. A rejected executor means the request did not reach a server + // that answered. It is PROVIDER_UNAVAILABLE, retried within the lease like + // one the executor reports; OFFLINE comes only from the environment. + it("retries a throwing executor as PROVIDER_UNAVAILABLE within the lease", async () => { const clock = new ManualClock(); + const observations: BoundedPollObservation[] = []; + const execute = vi.fn(async (): Promise> => { + throw new TypeError("Failed to fetch"); + }); const coordinator = createBoundedPollCoordinator({ policy, operation, environment: new MutableEnvironment(), clock, - execute: async () => { - throw new TypeError("Failed to fetch"); - }, + random: () => 0.5, + execute, + observe: (observation) => observations.push(observation), }); - const running = coordinator.run(); - clock.advance(5_000); - await expect(running).resolves.toEqual({ + + let result: unknown = null; + void coordinator.run().then((value) => { + result = value; + }); + for (let turn = 0; turn < 120 && result === null; turn += 1) { + clock.advance(1_000); + await flush(); + } + + expect(execute).toHaveBeenCalledTimes(policy.maxAttempts); + expect( + observations + .filter((observation) => observation.kind === "ATTEMPT_FINISHED") + .map((observation) => observation.outcome), + ).toEqual([ + "PROVIDER_UNAVAILABLE", + "PROVIDER_UNAVAILABLE", + "PROVIDER_UNAVAILABLE", + ]); + expect(result).toMatchObject({ ok: false, - error: { kind: "OFFLINE", operation: "POLL", retryable: true }, + error: { kind: "POLL_BUDGET_EXHAUSTED", operation: "POLL" }, }); }); @@ -970,10 +1004,7 @@ describe("bounded poll coordinator", () => { const clock = new ManualClock(); const coordinator = createBoundedPollCoordinator({ policy, - operation: { - ...operation, - maxResponseBytes: 512, - }, + operation: withResponseByteLimit(512), environment: new MutableEnvironment(), clock, execute: async () => ({ @@ -1019,3 +1050,114 @@ describe("bounded poll coordinator", () => { expect(coordinator.getState()).toBe("CLOSED"); }); }); + +// 1103/04-01. The natural composition: `execute` runs the poll's descriptor on +// the app's V3 executor. The executor's own retries would turn one poll attempt +// into up to three requests, hidden from the poll's budget and observations. +describe("a poll attempt on the V3 executor", () => { + const pollPolicy = definePollLeasePolicy({ + operationId: TEST_LIST_HTTP_CONTRACT.contract.operationId, + owner: "reference-job", + minimumIntervalMs: 5_000, + successIntervalMs: 5_000, + maxIntervalMs: 60_000, + maxAttempts: 3, + maxElapsedMs: 600_000, + maxResponseBytes: 32_768, + visibility: "VISIBLE_ONLY", + fallbackReason: "STREAM_UNAVAILABLE", + terminalStates: [], + }); + const scope = Object.freeze({ + generation: 1, + fingerprint: "scope-1", + identities: Object.freeze({}) as never, + signal: new AbortController().signal, + isCurrent: () => true, + }); + + function pollOn(descriptor: BoundedPollOperation, clock: ManualClock) { + const requests: string[] = []; + const executor = createContractHttpExecutor({ + baseUrl: "https://api.example/", + // The app default (`MAX_RETRY_ATTEMPTS`). + maxRetryAttempts: 2, + attachCredentials: () => ({ kind: "READY", headers: {} }), + fetcher: async (request) => { + requests.push(String(request)); + return new Response( + JSON.stringify({ type: "about:blank", title: "down", status: 503 }), + { + status: 503, + headers: { "content-type": "application/problem+json" }, + }, + ); + }, + sleep: async () => undefined, + random: () => 0.5, + createRequestId: () => "req-1", + }); + const coordinator = createBoundedPollCoordinator({ + policy: pollPolicy, + operation: descriptor, + environment: new MutableEnvironment(), + clock, + random: () => 0.5, + execute: async ({ signal }) => { + const outcome = await executor.execute( + descriptor, + { limit: 20 }, + { routeId: "TEST_ROUTE", scope, signal }, + ); + return outcome.kind === "SUCCESS" + ? { + ok: true, + value: { kind: "VALUE", value: outcome.value, responseBytes: 1 }, + } + : { + ok: false, + error: { + kind: "PROVIDER_UNAVAILABLE", + operation: "POLL", + retryable: true, + }, + }; + }, + }); + return { coordinator, requests }; + } + + it("refuses the default read descriptor, whose executor retries", () => { + expect(TEST_LIST_HTTP_CONTRACT.frontend.retryBudget).toBe(2); + expect(() => + pollOn(TEST_LIST_HTTP_CONTRACT as BoundedPollOperation, new ManualClock()), + ).toThrow(TypeError); + }); + + it("sends one request per poll attempt with a poll descriptor", async () => { + const clock = new ManualClock(); + const pollOnly = Object.freeze({ + ...TEST_LIST_HTTP_CONTRACT, + frontend: Object.freeze({ + ...TEST_LIST_HTTP_CONTRACT.frontend, + retryBudget: 0 as const, + }), + }) as BoundedPollOperation; + const { coordinator, requests } = pollOn(pollOnly, clock); + + let result: unknown = null; + void coordinator.run().then((value) => { + result = value; + }); + for (let turn = 0; turn < 400 && result === null; turn += 1) { + clock.advance(1_000); + await flush(); + } + + expect(result).toMatchObject({ + ok: false, + error: { kind: "POLL_BUDGET_EXHAUSTED" }, + }); + expect(requests).toHaveLength(pollPolicy.maxAttempts); + }); +}); diff --git a/tests/unit/realtime/bounded-polling-policy.test.ts b/tests/unit/realtime/bounded-polling-policy.test.ts index abcea2b9..07cc4b78 100644 --- a/tests/unit/realtime/bounded-polling-policy.test.ts +++ b/tests/unit/realtime/bounded-polling-policy.test.ts @@ -4,8 +4,9 @@ import { BOUNDED_POLLING_CEILINGS, assertBoundedPollOperation, definePollLeasePolicy, - type BoundedPollOperationContract, + type BoundedPollOperation, } from "../../../src/application/policies/bounded-polling.ts"; +import { TEST_LIST_HTTP_CONTRACT } from "../../helpers/external-contract-fixture.ts"; const input = { operationId: "GET_JOB_STATUS", @@ -56,50 +57,66 @@ describe("bounded polling policy", () => { ).toThrow(TypeError); }); - it("admits only a one-request terminal replay-safe REST query", () => { + // 1103/04-01. The V3 executor retries a SAFE or IDEMPOTENT read + // `min(retryBudget, maxRetryAttempts, 2)` times, reading the budget from the + // descriptor it executes. A poll binds that descriptor, not a declaration. + function pollOperation( + contract: Partial = {}, + frontend: Partial = {}, + ): BoundedPollOperation { + return { + contract: { + ...TEST_LIST_HTTP_CONTRACT.contract, + operationId: "GET_JOB_STATUS", + ...contract, + }, + frontend: { + ...TEST_LIST_HTTP_CONTRACT.frontend, + retryBudget: 0, + responseByteLimit: 16_384, + ...frontend, + }, + } as BoundedPollOperation; + } + + it("admits a replay-safe read whose descriptor turns transport retry off", () => { const policy = definePollLeasePolicy(input); - const operation: BoundedPollOperationContract = { - operationId: "GET_JOB_STATUS", - contractVersion: 2, - protocol: "REST", - semantics: "QUERY", - method: "GET", - replayPolicy: "SAFE", - retry: "never", - maxResponseBytes: 16_384, - transportMaxAttempts: 1, - authRecoveryCount: 0, - maxCumulativeSleepMs: 0, - serverStream: false, - }; expect(() => - assertBoundedPollOperation(policy, operation), + assertBoundedPollOperation(policy, pollOperation()), ).not.toThrow(); expect(() => - assertBoundedPollOperation(policy, { - ...operation, - transportMaxAttempts: 2 as 1, - }), - ).toThrow(TypeError); - expect(() => - assertBoundedPollOperation(policy, { - ...operation, - maxResponseBytes: 8_192, - }), + assertBoundedPollOperation( + policy, + pollOperation({ method: "HEAD", retrySemantics: "IDEMPOTENT" }), + ), ).not.toThrow(); expect(() => - assertBoundedPollOperation(policy, { - ...operation, - maxResponseBytes: 0, - }), - ).toThrow(TypeError); + assertBoundedPollOperation( + policy, + pollOperation({}, { responseByteLimit: 8_192 }), + ), + ).not.toThrow(); + }); + + it.each([ + ["another operation", { operationId: "GET_OTHER_STATUS" }, {}], + ["one transport retry", {}, { retryBudget: 1 as const }], + ["two transport retries", {}, { retryBudget: 2 as const }], + ["a write method", { method: "POST" as const }, {}], + ["keyed retry semantics", { retrySemantics: "KEYED" as const }, {}], + ["never retry semantics", { retrySemantics: "NEVER" as const }, {}], + ["an empty response limit", {}, { responseByteLimit: 0 }], + [ + "a response limit over the poll ceiling", + {}, + { responseByteLimit: BOUNDED_POLLING_CEILINGS.maxResponseBytes + 1 }, + ], + ])("refuses a descriptor with %s", (_case, contract, frontend) => { + const policy = definePollLeasePolicy(input); + expect(() => - assertBoundedPollOperation(policy, { - ...operation, - maxResponseBytes: - BOUNDED_POLLING_CEILINGS.maxResponseBytes + 1, - }), + assertBoundedPollOperation(policy, pollOperation(contract, frontend)), ).toThrow(TypeError); }); }); diff --git a/tests/unit/realtime/fixture.ts b/tests/unit/realtime/fixture.ts index faac3734..fe64d75c 100644 --- a/tests/unit/realtime/fixture.ts +++ b/tests/unit/realtime/fixture.ts @@ -2,7 +2,7 @@ import { mappingSuccess, type InstalledBoundaryMapper, } from "../../../src/contracts/boundary-mapper.ts"; -import type { ApiOperation } from "../../../src/contracts/api-operations.ts"; +import type { ApiOperationRow } from "../../../src/contracts/api-operations.ts"; import { createRealtimePolicyRegistry, defineEventTypeId, @@ -102,33 +102,29 @@ export const TEST_MAPPERS = Object.freeze({ ReferenceRealtimeMapper: TEST_MAPPER, }); -const snapshotOperation: ApiOperation = Object.freeze({ +const snapshotOperation: ApiOperationRow = Object.freeze({ + operationId: "GET_REFERENCE_REALTIME_SNAPSHOT", + featureId: "sample-feature", method: "GET", path: "/api/reference-snapshot", - operationId: "GET_REFERENCE_REALTIME_SNAPSHOT", - auth: "external-session", - timeoutMs: 10_000, - idempotency: "safe", - retry: "never", - requestSource: "none", + authProfileId: "EXTERNAL_BEARER", + retrySemantics: "SAFE", + requestBody: "NONE", + responseBody: "REQUIRED_JSON", + responseEnvelope: "NONE", requestSchema: "NoRequest", responseSchema: "ReferenceRealtimeCheckpoint", - owner: "sample-owner", - contractVersion: 2, - protocol: "REST", - semantics: "QUERY", - replayPolicy: "SAFE", - idempotencyKeyPolicy: "NONE", - mapperId: "ReferenceRealtimeSnapshotMapper", - successStatuses: [200], - responseMediaTypes: ["application/json"], - maxResponseBytes: 16_384, - providerId: "PRIMARY_API", - authProfileId: "EXTERNAL_SESSION", - csrfProfileId: "NONE", - pathSchema: "NoRequest", - pathParameterNames: [], - maxEncodedSearchBytes: 0, + problemSchema: "ReferenceRealtimeProblem", + acceptedStatuses: [200], + emptyBodyStatuses: [], + unvalidated: [], + requestByteLimit: 0, + responseByteLimit: 32_768, + totalDeadlineMs: 10_000, + retryBudget: 2, + traffic: null, + commandEffect: null, + commandRecovery: null, }); export const TEST_API_OPERATIONS = Object.freeze({ diff --git a/tests/unit/realtime/live-poll-handoff-coordinator.test.ts b/tests/unit/realtime/live-poll-handoff-coordinator.test.ts index f3c1f9c5..410757d6 100644 --- a/tests/unit/realtime/live-poll-handoff-coordinator.test.ts +++ b/tests/unit/realtime/live-poll-handoff-coordinator.test.ts @@ -163,6 +163,25 @@ describe("live/poll authoritative writer handoff", () => { expect(highWatermark).toBe(1); }); + it("accepts an apply result only when it is frozen like realtimeSuccess builds it", async () => { + // Type-checks as RealtimeResult, but the handoff reuses the value + // it validated, so it requires a frozen result. + const plain: RealtimeResult = { ok: true, value: undefined }; + const results = [plain, realtimeSuccess(undefined)]; + const harness = createHarness({ + apply: vi.fn(async () => results.shift()!), + }); + const writer = harness.coordinator.currentWriter()!; + + await expect(writer.write("plain", 1)).resolves.toEqual( + realtimeFailure("MAPPING_CONTRACT_VIOLATION", "APPLY", false), + ); + await expect(writer.write("frozen", 1)).resolves.toMatchObject({ + ok: true, + value: { kind: "APPLIED", writer: "LIVE" }, + }); + }); + it("fails closed when a non-cooperative active writer fills the bounded tail", async () => { let firstSignal: AbortSignal | undefined; let firstIsCurrent: (() => boolean) | undefined; @@ -247,7 +266,7 @@ describe("live/poll authoritative writer handoff", () => { harness.clock.advance(100); await expect(closing).resolves.toMatchObject({ ok: false, - error: { kind: "IDLE_TIMEOUT", operation: "CLOSE" }, + error: { kind: "PROVIDER_UNAVAILABLE", operation: "CLOSE", retryable: true }, }); release?.(realtimeSuccess(undefined)); @@ -337,9 +356,11 @@ describe("live/poll authoritative writer handoff", () => { expect(harness.clock.sleepers).toHaveLength(1); harness.clock.advance(100); + // 1101/04-02. The prior writer's effect stalled (design 13.1), not the + // transport's IDLE_TIMEOUT. await expect(transition).resolves.toMatchObject({ ok: false, - error: { kind: "IDLE_TIMEOUT", operation: "RECOVER" }, + error: { kind: "APPLY_FAILED", operation: "RECOVER", retryable: true }, }); expect(harness.recover).not.toHaveBeenCalled(); expect(harness.coordinator.inspect()).toMatchObject({ @@ -348,6 +369,32 @@ describe("live/poll authoritative writer handoff", () => { }); }); + it("fails a probe activation closed when poll cannot quiesce before the bound", async () => { + const harness = createHarness({ + initial: "POLL", + apply: vi.fn(async ({ writer }) => + writer === "POLL" + ? await new Promise>(() => {}) + : realtimeSuccess(undefined), + ), + }); + void harness.coordinator.currentWriter()!.write("hung-poll", 4); + const live = expectProbe(harness.coordinator.beginLiveProbe()); + await flush(); + + const activation = live.activate(); + await flush(); + expect(harness.clock.sleepers).toHaveLength(1); + harness.clock.advance(100); + + await expect(activation).resolves.toMatchObject({ + ok: false, + error: { kind: "APPLY_FAILED", operation: "RECOVER", retryable: true }, + }); + expect(harness.recover).not.toHaveBeenCalled(); + expect(harness.coordinator.inspect().state).toBe("CLOSED"); + }); + it("keeps poll authoritative while probing, then recovers and drains live values serially", async () => { const firstLive = deferred>(); const order: string[] = []; @@ -531,9 +578,10 @@ describe("live/poll authoritative writer handoff", () => { expect(harness.clock.sleepers).toHaveLength(1); harness.clock.advance(100); + // 1101/04-02. The checkpoint authority did not answer in time. await expect(transition).resolves.toMatchObject({ ok: false, - error: { kind: "IDLE_TIMEOUT", operation: "RECOVER" }, + error: { kind: "PROVIDER_UNAVAILABLE", operation: "RECOVER", retryable: true }, }); expect(checkpointIsCurrent?.()).toBe(false); expect(harness.coordinator.inspect().state).toBe("CLOSED"); @@ -560,7 +608,7 @@ describe("live/poll authoritative writer handoff", () => { harness.clock.advance(100); await expect(closing).resolves.toMatchObject({ ok: false, - error: { kind: "IDLE_TIMEOUT", operation: "CLOSE" }, + error: { kind: "PROVIDER_UNAVAILABLE", operation: "CLOSE", retryable: true }, }); // RT-RR-03. A second close re-runs rather than replaying a cached verdict. // The writer is still hung, so it still reports a timeout. @@ -569,7 +617,7 @@ describe("live/poll authoritative writer handoff", () => { harness.clock.advance(100); await expect(second).resolves.toMatchObject({ ok: false, - error: { kind: "IDLE_TIMEOUT", operation: "CLOSE" }, + error: { kind: "PROVIDER_UNAVAILABLE", operation: "CLOSE", retryable: true }, }); }); @@ -597,7 +645,7 @@ describe("live/poll authoritative writer handoff", () => { harness.clock.advance(100); await expect(first).resolves.toMatchObject({ ok: false, - error: { kind: "IDLE_TIMEOUT", operation: "CLOSE" }, + error: { kind: "PROVIDER_UNAVAILABLE", operation: "CLOSE", retryable: true }, }); // The writer finishes after the first close gave up. @@ -635,7 +683,7 @@ describe("live/poll authoritative writer handoff", () => { harness.clock.advance(100); await expect(closing).resolves.toMatchObject({ ok: false, - error: { kind: "IDLE_TIMEOUT", operation: "CLOSE" }, + error: { kind: "PROVIDER_UNAVAILABLE", operation: "CLOSE", retryable: true }, }); harness.clock.advance(100); diff --git a/tests/unit/realtime/realtime-reconnect-coordinator.test.ts b/tests/unit/realtime/realtime-reconnect-coordinator.test.ts index 85d11551..abf6b80e 100644 --- a/tests/unit/realtime/realtime-reconnect-coordinator.test.ts +++ b/tests/unit/realtime/realtime-reconnect-coordinator.test.ts @@ -14,9 +14,12 @@ import { type RealtimeReconnectAttemptContext, type RealtimeReconnectAttemptSuccess, type RealtimeReconnectEnvironment, + type RealtimeReconnectObservation, type RealtimeReconnectOutcome, type RealtimeReconnectSession, type RealtimeRecoveryReconnectDirective, + realtimeFailure as publicRealtimeFailure, + realtimeSuccess as publicRealtimeSuccess, } from "../../../src/adapters/realtime/index.ts"; import { defineReconnectPolicy, @@ -31,6 +34,7 @@ import { createFetchSseConnection, readSseForReconnect, SSE_CONTINUE, + type FetchSseClosedOutcome, } from "../../../src/adapters/realtime/sse/fetch-sse-connection.ts"; import { createWebSocketConnection, @@ -1751,6 +1755,72 @@ class FakeWebSocket implements WebSocketFacade { } } +/** + * The smallest SSE bridge design 6.3 leaves to composition: the attempt ends + * at `onOpen` and the rest of the read is the session. + */ +function sseAttempt(fetcher: typeof fetch, clock: ManualClock) { + return async (context: RealtimeReconnectAttemptContext) => { + const connection = createFetchSseConnection({ + endpoint: "https://app.example.test/events", + applicationOrigin: "https://app.example.test", + recoveryMode: "CURSOR", + fetcher, + clock, + }); + const open = deferred<"OPEN">(); + const reading = readSseForReconnect(connection, { + resumeCursor: null, + signal: context.signal, + onOpen: () => { + open.resolve("OPEN"); + return realtimeSuccess(undefined); + }, + onEvent: () => realtimeSuccess(SSE_CONTINUE), + onComment: () => context.markValidHeartbeatOrEvent(), + }); + const first = await Promise.race([open.promise, reading]); + if (first !== "OPEN") { + return first.result.ok + ? failed(realtimeFailure("PROTOCOL_MISMATCH", "CONNECT", false)) + : (first as RealtimeReconnectOutcome); + } + return opened( + Object.freeze({ + waitClosed: () => reading, + classifyClosed: ( + receipt: RealtimeReconnectOutcome, + ) => + receipt.result.ok + ? failed( + realtimeFailure("PROTOCOL_MISMATCH", "RECEIVE", false), + ) + : (receipt as RealtimeReconnectOutcome), + close: () => connection.close(), + }), + ); + }; +} + +async function advanceUntil( + clock: ManualClock, + settled: () => boolean, +): Promise { + // Ten simulated seconds outlast policy()'s whole elapsed budget. + for (let elapsed = 0; elapsed < 10_000 && !settled(); elapsed += 50) { + clock.advance(50); + await flush(); + } +} + +function observationLabel({ + kind, + failureKind, + reason, +}: RealtimeReconnectObservation): string { + return [kind, failureKind, reason].filter(Boolean).join(":"); +} + describe("transport failures through the reconnect coordinator", () => { it.each([ ["NETWORK_LOST", 1_006], @@ -2017,4 +2087,265 @@ describe("transport failures through the reconnect coordinator", () => { expect(clock.sleepCalls).toEqual([10_000, 3_000, 10_000]); }, ); + + // navigator.onLine stays true when only the server is down, so no online + // event ever arrives (0929/04-01). The SSE adapter reports a rejected fetch + // or read as PROVIDER_UNAVAILABLE, as WebSocket does; OFFLINE comes only + // from the environment signal (1103/04-04). + it("retries an SSE fetch rejection with backoff while the browser stays online", async () => { + const clock = new ManualClock(); + const fetcher = vi + .fn() + .mockRejectedValue(new TypeError("Failed to fetch")); + const observed: string[] = []; + const coordinator = createRealtimeReconnectCoordinator({ + policy: policy(), + environment: new MutableOnlineEnvironment(true), + clock, + random: () => 0.5, + confirmTransportBarrier: confirmationSucceeded, + attempt: sseAttempt(fetcher, clock), + observe: (observation) => observed.push(observationLabel(observation)), + }); + + let result: RealtimeResult | null = null; + void coordinator.run().then((value) => { + result = value; + }); + await advanceUntil(clock, () => result !== null); + + expect(fetcher).toHaveBeenCalledTimes(3); + // Full-jitter backoff; 10_000 is each read's connect timeout. + expect(clock.sleepCalls.filter((ms) => ms !== 10_000)).toEqual([ + 50, 100, + ]); + expect(result).toEqual({ + ok: false, + error: { + kind: "PROVIDER_UNAVAILABLE", + operation: "CONNECT", + retryable: true, + }, + }); + expect(observed).toEqual([ + "ATTEMPT_STARTED", + "RETRY_SCHEDULED:PROVIDER_UNAVAILABLE", + "ATTEMPT_STARTED", + "RETRY_SCHEDULED:PROVIDER_UNAVAILABLE", + "ATTEMPT_STARTED", + "RUN_ENDED:PROVIDER_UNAVAILABLE:EXHAUSTED", + ]); + }); + + it("reconnects after an open SSE stream's reader rejects while the browser stays online", async () => { + const clock = new ManualClock(); + let stream: ReadableStreamDefaultController | undefined; + const fetcher = vi + .fn() + .mockResolvedValueOnce( + new Response( + new ReadableStream({ + start(controller) { + stream = controller; + controller.enqueue(new TextEncoder().encode(": ping\n\n")); + }, + }), + { status: 200, headers: { "content-type": "text/event-stream" } }, + ), + ) + .mockRejectedValue(new TypeError("Failed to fetch")); + const observed: string[] = []; + const coordinator = createRealtimeReconnectCoordinator({ + policy: policy(), + environment: new MutableOnlineEnvironment(true), + clock, + random: () => 0.5, + confirmTransportBarrier: confirmationSucceeded, + attempt: sseAttempt(fetcher, clock), + observe: (observation) => observed.push(observationLabel(observation)), + }); + + let result: RealtimeResult | null = null; + void coordinator.run().then((value) => { + result = value; + }); + await flushUntil(() => observed.includes("SESSION_OPENED")); + await flush(); + // Healthy past stableOpenMs, then a proxy restart drops the stream. + clock.advance(1_000); + await flush(); + stream!.error(new TypeError("network error")); + await advanceUntil(clock, () => result !== null); + + expect(fetcher).toHaveBeenCalledTimes(3); + expect(result).toEqual({ + ok: false, + error: { + kind: "PROVIDER_UNAVAILABLE", + operation: "CONNECT", + retryable: true, + }, + }); + expect(observed).toEqual([ + "ATTEMPT_STARTED", + "SESSION_OPENED", + "SESSION_CLOSED", + "RETRY_SCHEDULED:PROVIDER_UNAVAILABLE", + "ATTEMPT_STARTED", + "RETRY_SCHEDULED:PROVIDER_UNAVAILABLE", + "ATTEMPT_STARTED", + "RUN_ENDED:PROVIDER_UNAVAILABLE:EXHAUSTED", + ]); + }); + + it.each(["before", "after"] as const)( + "waits for the online event when the browser goes offline %s the SSE fetch rejects", + async (order) => { + const clock = new ManualClock(); + const environment = new MutableOnlineEnvironment(true); + const fetcher = vi + .fn() + .mockImplementationOnce(async () => { + if (order === "before") environment.emit(false); + throw new TypeError("Failed to fetch"); + }) + .mockResolvedValueOnce(new Response(null, { status: 403 })); + const coordinator = createRealtimeReconnectCoordinator({ + policy: policy(), + environment, + clock, + random: () => 0.5, + confirmTransportBarrier: confirmationSucceeded, + attempt: sseAttempt(fetcher, clock), + }); + + let result: RealtimeResult | null = null; + void coordinator.run().then((value) => { + result = value; + }); + await flushUntil(() => fetcher.mock.calls.length === 1); + await flush(); + if (order === "after") environment.emit(false); + await flush(); + // Twenty offline minutes fire any retry timer that was armed. + clock.advance(20 * 60_000); + await flush(); + expect(fetcher).toHaveBeenCalledTimes(1); + expect(result).toBeNull(); + + environment.emit(true); + await advanceUntil(clock, () => result !== null); + expect(fetcher).toHaveBeenCalledTimes(2); + expect(result).toEqual({ + ok: false, + error: { kind: "FORBIDDEN", operation: "CONNECT", retryable: false }, + }); + }, + ); +}); + +describe("results that composition code hands the reconnect coordinator", () => { + // Composition code may import only the adapter barrel. Each case passes a + // value that type-checks as RealtimeReconnectOutcome. + it("retries a failure built with the barrel's realtimeFailure", async () => { + const clock = new ManualClock(); + const last = publicRealtimeFailure("CONNECT_TIMEOUT", "CONNECT"); + let attempts = 0; + const coordinator = createRealtimeReconnectCoordinator({ + policy: policy({ maxAttempts: 1 }), + environment: new MutableOnlineEnvironment(true), + clock, + random: () => 0.5, + confirmTransportBarrier: () => publicRealtimeSuccess(undefined), + attempt: () => ({ + result: + ++attempts === 1 + ? publicRealtimeFailure("CONNECT_TIMEOUT", "CONNECT") + : last, + }), + }); + + const running = coordinator.run(); + await flush(); + expect(clock.sleepCalls).toEqual([50]); + clock.advance(50); + + await expect(running).resolves.toBe(last); + expect(attempts).toBe(2); + }); + + const unfrozenFailure: RealtimeReconnectOutcome = { + result: { + ok: false, + error: { + kind: "CONNECT_TIMEOUT", + operation: "CONNECT", + retryable: true, + }, + }, + }; + const unfrozenError: RealtimeReconnectOutcome = { + result: Object.freeze({ + ok: false, + error: { + kind: "CONNECT_TIMEOUT", + operation: "CONNECT", + retryable: true, + }, + } as const), + }; + + it.each([ + ["a plain failure object", unfrozenFailure], + ["a frozen failure around a plain error", unfrozenError], + ] as const)( + "ends the run without a retry when an attempt returns %s", + async (_label, outcome) => { + const clock = new ManualClock(); + let attempts = 0; + const coordinator = createRealtimeReconnectCoordinator({ + policy: policy(), + environment: new MutableOnlineEnvironment(true), + clock, + confirmTransportBarrier: confirmationSucceeded, + attempt: () => { + attempts += 1; + return outcome; + }, + }); + + const running = coordinator.run(); + await flush(); + expect(clock.sleepCalls).toEqual([]); + await expect(running).resolves.toEqual( + realtimeFailure("PROTOCOL_MISMATCH", "CONNECT", false), + ); + expect(attempts).toBe(1); + }, + ); + + it("ends the run when classifyClosed returns a plain success object", async () => { + const clock = new ManualClock(); + const coordinator = createRealtimeReconnectCoordinator({ + policy: policy(), + environment: new MutableOnlineEnvironment(true), + clock, + confirmTransportBarrier: confirmationSucceeded, + attempt: () => + opened( + Object.freeze({ + classifyClosed: (): RealtimeReconnectOutcome => ({ + result: { ok: true, value: undefined }, + }), + close: vi.fn(), + waitClosed: closedSuccessfully, + }), + ), + }); + + await expect(coordinator.run()).resolves.toEqual( + realtimeFailure("PROTOCOL_MISMATCH", "CONNECT", false), + ); + expect(clock.sleepCalls).toEqual([]); + }); }); diff --git a/tests/unit/realtime/realtime-stream-registry.test.ts b/tests/unit/realtime/realtime-stream-registry.test.ts index dfb7ed62..f4c5f78d 100644 --- a/tests/unit/realtime/realtime-stream-registry.test.ts +++ b/tests/unit/realtime/realtime-stream-registry.test.ts @@ -1,5 +1,11 @@ import { describe, expect, it } from "vitest"; +import { projectApiOperationRows } from "../../../src/contracts/api-operations.ts"; +import { + composeContractContributions, + type HttpMethod, + type RetrySemantics, +} from "../../../src/contracts/external-contract-runtime.ts"; import { createRealtimePolicyRegistry, defineEventTypeId, @@ -20,6 +26,7 @@ import { TEST_SCHEMA_CODECS, createTestRealtimeRegistry, } from "./fixture.ts"; +import { TEST_CONTRACT_CONTRIBUTION } from "../../helpers/external-contract-fixture.ts"; describe("realtime policy registry", () => { it("deep-snapshots registrations and resolves only stream-owned event types", () => { @@ -209,6 +216,105 @@ describe("realtime policy registry", () => { }); }); +/** + * 1103/04-03, 07-02, 10-04. Recovery sends the snapshot operation on every + * reconnect, so it must be a read that may be sent again: GET with SAFE or + * IDEMPOTENT. A HEAD carries no checkpoint body. The row is the FE-REG-API + * projection of a composed descriptor, so a renamed projected field breaks + * this table too. + */ +describe("realtime snapshot operation binding", () => { + const projected = projectApiOperationRows( + composeContractContributions([TEST_CONTRACT_CONTRIBUTION]).contributions, + ); + const methods: readonly HttpMethod[] = [ + "GET", + "HEAD", + "POST", + "PUT", + "PATCH", + "DELETE", + ]; + const retries: readonly RetrySemantics[] = [ + "SAFE", + "IDEMPOTENT", + "KEYED", + "NEVER", + ]; + const register = ( + recovery: "CURSOR" | "SNAPSHOT_ONLY", + apiOperations: Readonly>, + ) => { + const baseline = createTestRealtimeRegistry(); + const stream = baseline.listStreams()[0]!; + return createRealtimePolicyRegistry({ + streams: [ + { + ...stream, + recovery: + recovery === "CURSOR" + ? stream.recovery + : { + mode: "SNAPSHOT_ONLY", + snapshotOperationId: "GET_REFERENCE_REALTIME_SNAPSHOT", + checkpointCodecId: "ReferenceRealtimeCheckpoint", + barrier: "CONNECT_BUFFER", + }, + }, + ], + eventTypes: [baseline.listEventTypes()[0]!], + bindings: { + ...bindings(), + apiOperations: apiOperations as ReturnType< + typeof bindings + >["apiOperations"], + }, + }); + }; + const snapshotRow = (method: HttpMethod, retrySemantics: RetrySemantics) => ({ + GET_REFERENCE_REALTIME_SNAPSHOT: { + ...projected.TEST_LIST_ENTITIES!, + operationId: "GET_REFERENCE_REALTIME_SNAPSHOT", + method, + retrySemantics, + }, + }); + const cases = methods.flatMap((method) => + retries.map((retrySemantics) => ({ + method, + retrySemantics, + accepted: + method === "GET" && + (retrySemantics === "SAFE" || retrySemantics === "IDEMPOTENT"), + })), + ); + + it.each(cases)( + "$method $retrySemantics as the snapshot operation: accepted=$accepted", + ({ method, retrySemantics, accepted }) => { + for (const recovery of ["CURSOR", "SNAPSHOT_ONLY"] as const) { + const install = () => + register(recovery, snapshotRow(method, retrySemantics)); + if (accepted) { + expect(install().findStream(STREAM_ID)?.recovery.mode).toBe(recovery); + } else { + expect(install, recovery).toThrow( + recovery === "CURSOR" + ? "Realtime cursor recovery profile is invalid." + : "Realtime snapshot recovery profile is invalid.", + ); + } + } + }, + ); + + it("refuses a snapshot operation id with no FE-REG-API row", () => { + expect(() => register("CURSOR", {})).toThrow( + "Realtime cursor recovery profile is invalid.", + ); + }); +}); + function bindings() { return { schemaCodecs: TEST_SCHEMA_CODECS, diff --git a/tests/unit/realtime/stream-coordinator.test.ts b/tests/unit/realtime/stream-coordinator.test.ts index 671a8f96..6bd1012d 100644 --- a/tests/unit/realtime/stream-coordinator.test.ts +++ b/tests/unit/realtime/stream-coordinator.test.ts @@ -31,9 +31,11 @@ import { describe("transport-independent realtime stream coordinator", () => { it("keeps the stream DRAINING until a non-cooperative effect settles", async () => { const wedged = deferred>(); + const observations: RealtimeObservation[] = []; const harness = createHarness({ apply: async () => wedged.promise, taskLimits: { effectTimeoutMs: 5, drainTimeoutMs: 5 }, + observe: (observation) => observations.push(observation), }); await harness.initialize(); @@ -44,11 +46,19 @@ describe("transport-independent realtime stream coordinator", () => { resumeCursor: "cursor-00000001", }), ); - // Bounded for the caller, and explicitly non-retryable. + // Bounded for the caller, and explicitly non-retryable. A stalled effect + // is an apply failure (design 13.1), not a transport IDLE_TIMEOUT. expect(applied).toMatchObject({ ok: false, - error: { kind: "IDLE_TIMEOUT", operation: "APPLY", retryable: false }, + error: { kind: "APPLY_FAILED", operation: "APPLY", retryable: false }, }); + expect(observations).toContainEqual( + expect.objectContaining({ + operation: "APPLY", + outcome: "FAILED", + reason: "APPLY_FAILED", + }), + ); expect(harness.coordinator.lifecycle(STREAM_ID)).toBe("DRAINING"); // DRAINING refuses new admission rather than queueing behind the wedge. @@ -65,7 +75,11 @@ describe("transport-independent realtime stream coordinator", () => { // close() cannot claim quiescence while the task is still running. await expect(harness.coordinator.close()).resolves.toMatchObject({ ok: false, - error: { kind: "IDLE_TIMEOUT", operation: "CLOSE" }, + error: { + kind: "PROVIDER_UNAVAILABLE", + operation: "CLOSE", + retryable: false, + }, }); // Only actual settlement ends DRAINING. @@ -79,6 +93,7 @@ describe("transport-independent realtime stream coordinator", () => { it("bounds non-cooperative recovery and rejects its late checkpoint", async () => { const wedged = deferred>(); let recoveries = 0; + const observations: RealtimeObservation[] = []; const harness = createHarness({ recover: async () => { recoveries += 1; @@ -87,6 +102,7 @@ describe("transport-independent realtime stream coordinator", () => { : wedged.promise; }, taskLimits: { recoveryTimeoutMs: 5, drainTimeoutMs: 5 }, + observe: (observation) => observations.push(observation), }); await harness.initialize(); @@ -94,10 +110,23 @@ describe("transport-independent realtime stream coordinator", () => { STREAM_ID, "SEQUENCE_GAP", ); + // A recovery source that does not answer in time is unavailable + // (design 13.1), not a transport IDLE_TIMEOUT. expect(recovered).toMatchObject({ ok: false, - error: { kind: "IDLE_TIMEOUT", operation: "RECOVER", retryable: false }, + error: { + kind: "PROVIDER_UNAVAILABLE", + operation: "RECOVER", + retryable: false, + }, }); + expect(observations).toContainEqual( + expect.objectContaining({ + operation: "RECOVER", + outcome: "FAILED", + reason: "PROVIDER_UNAVAILABLE", + }), + ); expect(harness.coordinator.lifecycle(STREAM_ID)).toBe("DRAINING"); const beforeLateCommit = harness.coordinator.getResumeState(STREAM_ID); @@ -1000,7 +1029,7 @@ describe("realtime physical task ownership", () => { // close() arrives long before the effect deadline. const closed = await harness.coordinator.close(); expect(closed.ok).toBe(false); - expect(closed.ok ? null : closed.error.kind).toBe("IDLE_TIMEOUT"); + expect(closed.ok ? null : closed.error.kind).toBe("PROVIDER_UNAVAILABLE"); expect(harness.coordinator.lifecycle(STREAM_ID)).toBe("DRAINING"); applyGate.resolve(realtimeSuccess(undefined)); @@ -1121,7 +1150,7 @@ describe("realtime physical task ownership", () => { await expect(applying).resolves.toMatchObject({ ok: false, - error: { kind: "IDLE_TIMEOUT", operation: "APPLY" }, + error: { kind: "APPLY_FAILED", operation: "APPLY" }, }); await expect(recovering).resolves.toMatchObject({ ok: false, @@ -1300,7 +1329,7 @@ describe("RT-01 reentrant close cannot pass the registration window", () => { expect(closeResult?.ok).toBe(false); expect(closeResult?.ok ? null : closeResult?.error.kind).toBe( - "IDLE_TIMEOUT", + "PROVIDER_UNAVAILABLE", ); applyGate.resolve(realtimeSuccess(undefined)); @@ -1336,7 +1365,7 @@ describe("RT-01 reentrant close cannot pass the registration window", () => { expect(closeResult?.ok).toBe(false); expect(closeResult?.ok ? null : closeResult?.error.kind).toBe( - "IDLE_TIMEOUT", + "PROVIDER_UNAVAILABLE", ); recoveryGate.resolve(realtimeSuccess(snapshotCommit("0"))); @@ -1414,7 +1443,7 @@ describe("RT-02 a throwing scheduler stays inside the result contract", () => { // A drain that could not be bounded is not proof of quiescence. expect(closed.ok).toBe(false); - expect(closed.ok ? null : closed.error.kind).toBe("IDLE_TIMEOUT"); + expect(closed.ok ? null : closed.error.kind).toBe("PROVIDER_UNAVAILABLE"); applyGate.resolve(realtimeSuccess(undefined)); await applying; diff --git a/tests/unit/realtime/websocket-connection.test.ts b/tests/unit/realtime/websocket-connection.test.ts index e01ab249..aad6dc46 100644 --- a/tests/unit/realtime/websocket-connection.test.ts +++ b/tests/unit/realtime/websocket-connection.test.ts @@ -650,6 +650,63 @@ describe("WebSocket connection generation", () => { releaseFirst?.(); }); + // 1101/04-03. Each subscription may apply at most maxEventsPerSecond events + // in a one-second window (the lower of the client ceiling and the server's + // advertised limit). One more requests recovery and closes the generation. + it("closes a subscription that exceeds its per-second event ceiling", async () => { + const runtime = setup({ ceilings: { maxEventsPerSecond: 2 } }); + await openConnection(runtime); + runtime.connection.subscribe({ + subscriptionId: "subscription.0001", + streamId: "orders.v1", + scopeBinding: "scope.0001", + stateBearing: true, + checkpoint: { + streamEpoch: "stream-epoch.0001", + lastAppliedSequence: "10", + cursor: "cursor.0010", + }, + }); + runtime.socket.message( + serverFrame({ + type: "SUBSCRIBED", + subscriptionId: "subscription.0001", + streamEpoch: "stream-epoch.0001", + acceptedCursor: "cursor.0010", + nextExpectedSequence: "11", + }), + ); + await flush(); + const event = serverFrame({ + type: "EVENT", + subscriptionId: "subscription.0001", + envelope: { + protocol: "REALTIME_EVENT_V1", + streamId: "orders.v1", + }, + }); + const deliver = async (count: number) => { + for (let index = 0; index < count; index += 1) { + runtime.socket.message(event); + for (let turn = 0; turn < 5; turn += 1) await flush(); + } + }; + + await deliver(2); + runtime.clock.current += 1_000; + await deliver(2); + expect(runtime.onEvent).toHaveBeenCalledTimes(4); + expect(runtime.connection.inspect().status).toBe("OPEN"); + + await deliver(1); + expect(runtime.onEvent).toHaveBeenCalledTimes(4); + expect(runtime.connection.inspect().status).toBe("CLOSED"); + expect(runtime.recoveries).toContainEqual({ + subscriptionId: "subscription.0001", + reason: "EVENT_RATE_EXCEEDED", + }); + }); + it("rejects an event routed through the wrong logical subscription", async () => { const runtime = setup(); await openConnection(runtime); diff --git a/tests/unit/registry-compatibility.test.ts b/tests/unit/registry-compatibility.test.ts index 8d335f7d..04236396 100644 --- a/tests/unit/registry-compatibility.test.ts +++ b/tests/unit/registry-compatibility.test.ts @@ -1,3 +1,5 @@ +import { readFileSync } from "node:fs"; + import { describe, expect, it } from "vitest"; import { @@ -60,6 +62,125 @@ describe("registry compatibility evidence", () => { ).toBe("breaking"); }); + // 0929/07-02. Changes the governance contract already describes are graded + // by it; anything else stays fail-closed. + describe("changes the declared contract describes", () => { + function registry( + contract: Readonly>, + rows: Readonly>>>, + ) { + return { + schemaVersion: 2, + registries: [{ registryId: "FE-REG-TEST", contract, rows }], + }; + } + const nullable = { + breakingFields: ["path", "schema"], + fieldTypes: { + path: "string", + label: "string|null", + order: "integer|null", + schema: "string|null", + }, + }; + + it.each([ + ["a label hidden", { label: "Home" }, { label: null }, "behavior-change", "field-changed"], + ["a label shown", { label: null }, { label: "Home" }, "behavior-change", "field-changed"], + ["an order set", { order: null }, { order: 2 }, "behavior-change", "field-changed"], + ["a nullable breaking field set", { schema: null }, { schema: "Params" }, "breaking", "field-changed"], + ["a value outside the declared type", { order: null }, { order: "2" }, "breaking", "field-type-changed"], + ])("grades %s by the declared field type", (_label, before, after, impact, kind) => { + const diff = diffRegistrySnapshots( + registry(nullable, { A: { path: "/a", ...before } }), + registry(nullable, { A: { path: "/a", ...after } }), + ); + expect(diff.changes.map((change) => [change.kind, change.impact])).toEqual([ + [kind, impact], + ]); + }); + + it("keeps a null transition breaking when no field type is declared", () => { + expect( + diffRegistrySnapshots( + registry({ breakingFields: ["path"] }, { A: { path: "/a", label: "Home" } }), + registry({ breakingFields: ["path"] }, { A: { path: "/a", label: null } }), + ).impact, + ).toBe("breaking"); + }); + + it.each([ + ["one more allowed value", { kind: ["one"] }, { kind: ["one", "two"] }, "additive"], + ["an allowed value removed", { kind: ["one", "two"] }, { kind: ["two", "three"] }, "breaking"], + ["a newly restricted field", { kind: ["one"] }, { kind: ["one"], mode: ["a"] }, "breaking"], + ["a restriction dropped", { kind: ["one"], mode: ["a"] }, { kind: ["one"] }, "breaking"], + ])("grades %s in allowedValues", (_label, before, after, impact) => { + const diff = diffRegistrySnapshots( + registry({ breakingFields: ["path"], allowedValues: before }, { A: { path: "/a" } }), + registry({ breakingFields: ["path"], allowedValues: after }, { A: { path: "/a" } }), + ); + expect(diff.impact).toBe(impact); + }); + }); + + // 1101/16-01 (decision 1). Every feature with server state adds a topic, so + // adding one must not need a new baseline. The committed baseline is used + // as it stands: after the sample's removal its graph may be empty. + describe("the invalidation graph in the committed baseline", () => { + type Graph = { topics: unknown[]; namespaces: unknown[]; edges: unknown[] }; + type Snapshot = { + registries: Array<{ registryId: string; rows: Record }>; + }; + const baseline = JSON.parse( + readFileSync("config/contracts/registry-baseline.json", "utf8"), + ) as Snapshot; + const namespace = { namespaceId: "added-namespace", namespaceVersion: 1 }; + const topicId = "qinv.01k9zaddedtopic000000000"; + function withGraph(snapshot: Snapshot, edit: (graph: Graph) => void): Snapshot { + const copy = structuredClone(snapshot); + const graph = copy.registries.find( + ({ registryId }) => registryId === "FE-REG-QUERY-INVALIDATION", + )?.rows["invalidation-graph"]; + if (!graph) throw new Error("baseline has no invalidation graph"); + edit(graph); + return copy; + } + const extended = withGraph(baseline, (graph) => { + graph.topics.push(topicId); + graph.namespaces.push(namespace); + graph.edges.push({ topicId, namespace }); + }); + + it("grades a topic, namespace and edge added to the graph as additive", () => { + const diff = diffRegistrySnapshots(baseline, extended); + expect(diff.changes.map(({ field, impact }) => [field, impact])).toEqual([ + ["edges", "additive"], + ["namespaces", "additive"], + ["topics", "additive"], + ]); + expect(diff.impact).toBe("additive"); + }); + + it.each([ + ["a topic removed", (graph: Graph) => graph.topics.splice(graph.topics.indexOf(topicId), 1)], + ["an edge removed", (graph: Graph) => graph.edges.pop()], + [ + "a namespace version changed", + (graph: Graph) => { + graph.namespaces[graph.namespaces.length - 1] = { ...namespace, namespaceVersion: 2 }; + }, + ], + [ + "an edge moved to another topic", + (graph: Graph) => { + graph.edges[graph.edges.length - 1] = { topicId: "qinv.01k9zothertopic000000000", namespace }; + }, + ], + ])("keeps %s breaking", (_label, edit) => { + expect(diffRegistrySnapshots(extended, withGraph(extended, edit)).impact).toBe("breaking"); + }); + }); + it("verifies the approved digest and complete breaking evidence", () => { const before = snapshot({ A: { path: "/before" } }); const after = snapshot({ A: { path: "/after" } }); @@ -89,6 +210,7 @@ describe("registry compatibility evidence", () => { changes: [ { changeId, + after: "/after", versionBump: "2", migration: "dual-read", compatibilityWindow: "one release", @@ -99,4 +221,85 @@ describe("registry compatibility evidence", () => { }).passed, ).toBe(true); }); + + // 0929/07-01. Evidence is for one value, not for every later change of the + // same row and field. + describe("evidence bound to the value it explains", () => { + const evidence = (extra: Readonly>) => ({ + changes: [ + { + changeId: "FE-REG-TEST:A:path:field-changed", + versionBump: "2", + migration: "dual-read", + compatibilityWindow: "one release", + rollback: "restore previous registry snapshot", + owner: "platform", + ...extra, + }, + ], + }); + const moved = diffRegistrySnapshots( + snapshot({ A: { path: "/a" } }), + snapshot({ A: { path: "/entries" } }), + ); + + it("rejects evidence written for another value of the same field", () => { + expect(validateBreakingEvidence(moved, evidence({ after: "/items" })).failures).toEqual([ + 'breaking change FE-REG-TEST:A:path:field-changed evidence explains after="/items", the change is after="/entries"', + ]); + }); + + it("requires the explained value", () => { + expect(validateBreakingEvidence(moved, evidence({})).failures).toEqual([ + "breaking change FE-REG-TEST:A:path:field-changed evidence needs after (the canonical JSON value it explains)", + ]); + }); + + it("compares canonical values, so key and primitive order do not matter", () => { + const reordered = diffRegistrySnapshots( + snapshot({ A: { path: { b: ["y", "x"], a: 1 } } }), + snapshot({ A: { path: { a: 2, b: ["x", "y"] } } }), + ); + expect( + validateBreakingEvidence(reordered, evidence({ after: { b: ["y", "x"], a: 2 } })).passed, + ).toBe(true); + }); + + // 0929/07-01 (2). A row that explains no breaking change of the current + // diff fails the gate, and the message names every such row. + it("fails on evidence rows that explain no breaking change of the current diff", () => { + const diff = diffRegistrySnapshots( + snapshot({ A: { path: "/a", owner: "one" } }), + snapshot({ A: { path: "/entries", owner: "two" } }), + ); + const row = (changeId: string, after?: string) => ({ + ...evidence(after === undefined ? {} : { after }).changes[0], + changeId, + }); + expect( + validateBreakingEvidence(diff, { + changes: [ + row("FE-REG-TEST:A:path:field-changed", "/entries"), + row("FE-REG-TEST:B:*:removed"), + row("FE-REG-TEST:A:owner:field-changed", "two"), + ], + }).failures, + ).toEqual([ + "stale breaking evidence FE-REG-TEST:B:*:removed: no breaking change in the current diff has this changeId. Delete the row (update:registry-baseline deletes the rows a new baseline explains)", + "stale breaking evidence FE-REG-TEST:A:owner:field-changed: no breaking change in the current diff has this changeId. Delete the row (update:registry-baseline deletes the rows a new baseline explains)", + ]); + }); + + it("needs no value for a removal", () => { + const removed = diffRegistrySnapshots( + snapshot({ A: { path: "/a" } }), + snapshot({}), + ); + expect( + validateBreakingEvidence(removed, { + changes: [{ ...evidence({}).changes[0], changeId: "FE-REG-TEST:A:*:removed" }], + }).passed, + ).toBe(true); + }); + }); }); diff --git a/tests/unit/registry-governance.test.ts b/tests/unit/registry-governance.test.ts index f939e3cf..e038d441 100644 --- a/tests/unit/registry-governance.test.ts +++ b/tests/unit/registry-governance.test.ts @@ -1,11 +1,12 @@ import { spawnSync } from "node:child_process"; -import { mkdtemp, readFile, rm } from "node:fs/promises"; +import { mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises"; import { tmpdir } from "node:os"; import path from "node:path"; import { describe, expect, it } from "vitest"; import { diffRegistrySnapshots, + registrySnapshotDigest, validateBreakingEvidence, verifyRegistryBaselineApproval, } from "../../scripts/lib/registry-compatibility.ts"; @@ -286,6 +287,7 @@ describe("registry governance manifest", () => { validateBreakingEvidence(diff, { changes: breakingChanges.map((change) => ({ changeId: change.changeId, + after: change.after, versionBump: "2", migration: `migrate ${tamperCase.name}`, compatibilityWindow: "one release", @@ -342,6 +344,84 @@ describe("registry governance manifest", () => { }); }); + // The baseline diff compares contracts and rows, not `source`, so a moved + // registry (15-01 moved FE-REG-API and FE-REG-SCHEMA) left the approved + // baseline naming a file that no longer holds it. Re-approve after a move. + it("names each registry's governed source in the approved baseline", async () => { + const governance = JSON.parse( + await readFile("config/contracts/registry-governance.json", "utf8"), + ) as { registries: Array<{ registryId: string; path: string }> }; + const baseline = JSON.parse( + await readFile("config/contracts/registry-baseline.json", "utf8"), + ) as { registries: Array<{ registryId: string; source: string }> }; + const sources = new Map( + baseline.registries.map(({ registryId, source }) => [registryId, source]), + ); + expect( + governance.registries + .filter(({ registryId, path: source }) => sources.get(registryId) !== source) + .map(({ registryId }) => registryId), + "run update:registry-baseline after moving a registry", + ).toEqual([]); + }); + + // 0929/07-01 (3). Re-approval makes the current snapshot the baseline, so it + // explains every change the evidence described. Git history keeps the rows. + it("deletes the evidence rows the new baseline explains when it re-approves", async () => { + const directory = await mkdtemp( + path.join(tmpdir(), "registry-baseline-update-"), + ); + const evidencePath = path.join( + directory, + "config/contracts/registry-change-evidence.json", + ); + try { + await mkdir(path.dirname(evidencePath), { recursive: true }); + await writeFile( + path.join(directory, "snapshot.json"), + JSON.stringify({ registries: [] }), + ); + await writeFile( + evidencePath, + JSON.stringify({ + schemaVersion: 1, + changes: [ + { + changeId: "FE-REG-TEST:A:*:removed", + versionBump: "2", + migration: "none", + compatibilityWindow: "none", + rollback: "restore A", + owner: "fixture-owner", + }, + ], + }), + ); + const result = spawnSync( + process.execPath, + [path.resolve("scripts/update-registry-baseline.ts"), "snapshot.json"], + { + cwd: directory, + encoding: "utf8", + env: { + ...process.env, + REGISTRY_BASELINE_OWNER: "fixture-owner", + REGISTRY_BASELINE_REASON: "fixture re-approval", + }, + }, + ); + + expect(result.status, result.stderr).toBe(0); + expect(JSON.parse(await readFile(evidencePath, "utf8"))).toEqual({ + schemaVersion: 1, + changes: [], + }); + expect(result.stdout).toContain("FE-REG-TEST:A:*:removed"); + } finally { + await rm(directory, { recursive: true, force: true }); + } + }); + it("rejects duplicate composite invalidation edges after projection", async () => { const directory = await mkdtemp( path.join(tmpdir(), "registry-governance-duplicate-"), @@ -374,4 +454,198 @@ describe("registry governance manifest", () => { await rm(directory, { recursive: true, force: true }); } }); + + // 0929/07-03. loadingSurface is a name, checked for its form, not a list. + it("rejects a route loading surface that is not a kebab-case name", async () => { + const directory = await mkdtemp( + path.join(tmpdir(), "registry-governance-routes-"), + ); + const artifact = path.join(directory, "registries.json"); + try { + spawnSync( + process.execPath, + [ + "scripts/check-registries.ts", + "--governance", + "tests/fixtures/registry/routes/governance.json", + "--artifact", + artifact, + ], + { encoding: "utf8" }, + ); + const { failures } = JSON.parse(await readFile(artifact, "utf8")) as { + failures: string[]; + }; + expect( + failures.filter((failure) => failure.includes(".loadingSurface ")), + ).toEqual([ + "ROUTES.FIRST.loadingSurface value Unknown loading does not match ^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$", + ]); + } finally { + await rm(directory, { recursive: true, force: true }); + } + }); + + it("names the load error of a registry source that exists but fails to import", async () => { + const directory = await mkdtemp(path.join(tmpdir(), "registry-source-error-")); + try { + await mkdir(path.join(directory, "src"), { recursive: true }); + await writeFile( + path.join(directory, "src/broken.ts"), + 'import { missingExport } from "./absent.ts";\nexport const ROWS = [missingExport];\n', + ); + await writeFile(path.join(directory, "src/absent.ts"), "export const other = 1;\n"); + await writeFile( + path.join(directory, "governance.json"), + JSON.stringify({ + schemaVersion: 1, + sourceDirectories: [], + registries: [ + { + registryId: "FIXTURE-BROKEN", + path: "src/broken.ts", + exportName: "ROWS", + owner: "fixture", + requiredFields: ["id"], + uniqueFields: ["id"], + }, + ], + compatibilityImpact: { + allowed: ["none", "additive", "behavior-change", "breaking"], + current: "none", + }, + }), + ); + const result = spawnSync( + process.execPath, + [ + path.resolve("scripts/check-registries.ts"), + "--governance", + "governance.json", + "--no-baseline", + "--artifact", + "out.json", + ], + { cwd: directory, encoding: "utf8" }, + ); + + expect(result.status).toBe(1); + expect(`${result.stdout}${result.stderr}`).toContain( + "missing registry source src/broken.ts: The requested module './absent.ts' does not provide an export named 'missingExport'", + ); + } finally { + await rm(directory, { recursive: true, force: true }); + } + }); + + // 1103/14-06. A contract contribution that fails to compose throws while + // the registry source loads. The gate names the cause the error carries in + // `reason` and does not also report the unloaded registries as deleted + // (`removed` evidence) or as unknown reference targets. + it("names a load error's reason and reports no cascade for the registries it did not load", async () => { + const directory = await mkdtemp(path.join(tmpdir(), "registry-source-reason-")); + const run = (extra: readonly string[]) => + spawnSync( + process.execPath, + [ + path.resolve("scripts/check-registries.ts"), + "--governance", + "governance.json", + "--artifact", + "out.json", + ...extra, + ], + { cwd: directory, encoding: "utf8" }, + ); + try { + await mkdir(path.join(directory, "src"), { recursive: true }); + await writeFile( + path.join(directory, "src/composed.ts"), + 'export const ROWS = { A: { id: "A" } };\n', + ); + await writeFile( + path.join(directory, "src/routes.ts"), + 'export const ROUTES = { R: { id: "R", target: "A" } };\n', + ); + await writeFile( + path.join(directory, "governance.json"), + JSON.stringify({ + schemaVersion: 1, + sourceDirectories: [], + registries: [ + { + registryId: "FIXTURE-COMPOSED", + path: "src/composed.ts", + exportName: "ROWS", + owner: "fixture", + keyField: "id", + requiredFields: ["id"], + fieldTypes: { id: "string" }, + }, + { + registryId: "FIXTURE-ROUTES", + path: "src/routes.ts", + exportName: "ROUTES", + owner: "fixture", + keyField: "id", + requiredFields: ["id", "target"], + fieldTypes: { id: "string", target: "string" }, + references: [ + { + field: "target", + registryId: "FIXTURE-COMPOSED", + targetField: "id", + }, + ], + }, + ], + }), + ); + const healthy = run(["--no-baseline"]); + expect(healthy.status, healthy.stderr).toBe(0); + const report = JSON.parse( + await readFile(path.join(directory, "out.json"), "utf8"), + ) as { registries: unknown[] }; + const baseline = { schemaVersion: 2, registries: report.registries }; + await writeFile(path.join(directory, "baseline.json"), JSON.stringify(baseline)); + await writeFile( + path.join(directory, "approval.json"), + JSON.stringify({ + schemaVersion: 1, + snapshotDigest: registrySnapshotDigest(baseline), + owner: "fixture", + reason: "fixture", + approvedAt: "2026-11-04T00:00:00.000Z", + }), + ); + await writeFile( + path.join(directory, "evidence.json"), + JSON.stringify({ schemaVersion: 1, changes: [] }), + ); + const withBaseline = [ + "--baseline", + "baseline.json", + "--approval", + "approval.json", + "--compatibility-evidence", + "evidence.json", + ]; + expect(run(withBaseline).status).toBe(0); + + await writeFile( + path.join(directory, "src/composed.ts"), + 'throw Object.assign(new Error("Installed contract contribution is not composable"), { reason: "notice-feature/NOTICE_LIST_ITEMS: unknown authProfileId NOTICE_NOPE" });\n', + ); + const broken = run(withBaseline); + const output = `${broken.stdout}${broken.stderr}`; + + expect(broken.status).toBe(1); + expect(output.trim().split("\n")).toEqual([ + "Registry governance failed:", + "missing registry source src/composed.ts: Installed contract contribution is not composable (reason: notice-feature/NOTICE_LIST_ITEMS: unknown authProfileId NOTICE_NOPE)", + ]); + } finally { + await rm(directory, { recursive: true, force: true }); + } + }); }); diff --git a/tests/unit/release-coherence.test.ts b/tests/unit/release-coherence.test.ts index d4edab6c..b3a21f76 100644 --- a/tests/unit/release-coherence.test.ts +++ b/tests/unit/release-coherence.test.ts @@ -6,8 +6,9 @@ import type { InstalledContractPackageIdentity } from "../../src/contracts/exter import { computeContractSetDigest } from "../../src/contracts/contract-set-canonical.ts"; import type { ReleaseArtifact, - RuntimeConfigArtifact, + runtimeConfigArtifactSchema, } from "../../src/contracts/release-artifacts.ts"; +import type { z } from "../../src/contracts/zod.ts"; import { compareReleaseToRuntime, RELEASE_TOKEN_REGISTRY, @@ -43,6 +44,12 @@ const releaseV1 = { routeChunks: {}, } as const satisfies ReleaseArtifact; +/** + * 1103/09-02. A runtime config document as written, before validation: a + * product key with a `.default()` may be left out of it. + */ +type RuntimeConfigDocument = z.input; + const runtimeV1 = { APP_ENV: "local", API_BASE_URL: "http://localhost:8080/", @@ -55,7 +62,7 @@ const runtimeV1 = { RELEASE_MANIFEST_URL: "/release-manifest.json", BUILD_ID: "build-a", RELEASE_ID: "release-a", -} as const satisfies RuntimeConfigArtifact; +} as const satisfies RuntimeConfigDocument; const runtimeV2 = { APP_ENV: "local", @@ -75,7 +82,7 @@ const runtimeV2 = { OFFLINE_COMMANDS: "DEFAULT", }, FEATURE_OVERRIDES: {}, -} as const satisfies RuntimeConfigArtifact; +} as const satisfies RuntimeConfigDocument; async function releaseV2With( packages: readonly InstalledContractPackageIdentity[], diff --git a/tests/unit/removal-fixture.test.ts b/tests/unit/removal-fixture.test.ts index 001b11e0..e48b8283 100644 --- a/tests/unit/removal-fixture.test.ts +++ b/tests/unit/removal-fixture.test.ts @@ -1,4 +1,5 @@ -import { mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises"; +import { existsSync } from "node:fs"; +import { mkdir, mkdtemp, readdir, readFile, rm, writeFile } from "node:fs/promises"; import { tmpdir } from "node:os"; import path from "node:path"; @@ -8,6 +9,10 @@ import { loadCiGateContract } from "../../scripts/contracts/ci-gates.ts"; import { assertNoRuntimeImports, pruneRemovalFixtureCiContract, + REMOVAL_FIXTURE_COPY_TARGETS, + REMOVAL_FIXTURE_DOCUMENT_TARGETS, + REMOVAL_FIXTURE_DOCUMENT_TESTS, + removalFixtureExcludedTests, removeRuntimeDependentTests, renderRemovalJunit, runtimeImportGraph, @@ -92,6 +97,25 @@ it("prunes removed command and evidence references and re-baselines the contract expect(packageDocument.scripts["check:ci"]).not.toMatch(/reduced/u); }); +// 1103/16-02. A product feature owns no CI script, so its removal prunes +// nothing. The baseline reason then ended in a blank ("removal fixture pruned +// ") and the baseline schema refused it before any gate ran. +it("re-baselines a removal that prunes no CI script", async () => { + const root = await copyCiContract("removal-fixture-no-scripts-"); + + await pruneRemovalFixtureCiContract({ + root, + removedScripts: new Set(), + removedEvidencePathFragments: [], + }); + + const baseline = JSON.parse( + await readFile(path.join(root, "config/ci/contract-baseline.json"), "utf8"), + ) as Record; + expect(baseline["reason"]).toBe("removal fixture pruned no CI scripts"); + await expect(loadCiGateContract(root)).resolves.toBeDefined(); +}); + it("rejects a contract that no longer matches its committed baseline", async () => { const root = await copyCiContract("removal-fixture-baseline-drift-"); const baselinePath = path.join(root, "config/ci/contract-baseline.json"); @@ -113,6 +137,47 @@ it("rejects pruning that leaves a reduced gate without commands", async () => { })).rejects.toThrow(/commandIds|too small|at least 1/i); }); +// 1103/02-06. Three FE-GATE-020 drills copied the repository without its +// documents and still ran the tests that read them, so each failed its `test` +// check on ENOENT whatever it removed. Only the sample drill excluded them. +describe("document tests in a removal fixture", () => { + it("leaves the document tests out exactly when the documents are not copied", () => { + expect(removalFixtureExcludedTests(REMOVAL_FIXTURE_COPY_TARGETS)) + .toEqual(REMOVAL_FIXTURE_DOCUMENT_TESTS); + expect(removalFixtureExcludedTests([ + ...REMOVAL_FIXTURE_COPY_TARGETS, + ...REMOVAL_FIXTURE_DOCUMENT_TARGETS, + ])).toEqual([]); + }); + + // This file also runs inside the capability fixtures, which hold neither + // the documents nor these tests; the two go together. + it("names tests that read the documents, present exactly where the documents are", async () => { + const documentsPresent = REMOVAL_FIXTURE_DOCUMENT_TARGETS.every((target) => existsSync(target)); + for (const test of REMOVAL_FIXTURE_DOCUMENT_TESTS) { + expect(existsSync(test), test).toBe(documentsPresent); + if (documentsPresent) { + await expect(readFile(test, "utf8")).resolves.toMatch(/README\.md|CHANGELOG\.md/u); + } + } + }); + + it("is the only exclusion list: every drill prepares its fixture through it", async () => { + const drills: string[] = []; + for (const name of await readdir("scripts")) { + if (!/^test-.*\.ts$/u.test(name)) continue; + const source = await readFile(path.join("scripts", name), "utf8"); + if (!source.includes("./lib/removal-fixture.ts")) continue; + drills.push(name); + expect(source, name).toContain("prepareRemovalFixture("); + for (const test of REMOVAL_FIXTURE_DOCUMENT_TESTS) { + expect(source, name).not.toContain(test); + } + } + expect(drills).toEqual(expect.arrayContaining(["test-sample-removal.ts", "test-feature-scaffold.ts"])); + }); +}); + describe("release evidence fixture copy", () => { it("keeps the release evidence and leaves the regenerated trees behind", async () => { const { copyReleaseEvidenceTree, RELEASE_EVIDENCE_REGENERATED_TREES } = diff --git a/tests/unit/request-builder.test.ts b/tests/unit/request-builder.test.ts deleted file mode 100644 index 9ff8e7c2..00000000 --- a/tests/unit/request-builder.test.ts +++ /dev/null @@ -1,74 +0,0 @@ -import { describe, expect, it } from "vitest"; - -import { buildRequestTarget } from "../../src/adapters/http/request-builder.ts"; -import type { ApiOperation } from "../../src/contracts/api-operations.ts"; - -const operation: ApiOperation = { - method: "GET", - path: "/api/resources/{resourceId}", - operationId: "GET_RESOURCE", - auth: "none", - timeoutMs: null, - idempotency: "safe", - retry: "runtime", - requestSource: "search", - requestSchema: "ResourceQuery", - responseSchema: "ResourcePayload", - owner: "test", -}; - -describe("deterministic HTTP request target", () => { - it("escapes path values and serializes optional/array search in key order", () => { - const result = buildRequestTarget( - "https://api.test/base/", - operation, - { resourceId: "folder/item" }, - { - tags: ["beta", "alpha"], - omitted: undefined, - limit: 20, - cursor: "next page", - }, - ); - - expect(result.success).toBe(true); - if (!result.success) return; - expect(result.url.href).toBe( - "https://api.test/base/api/resources/folder%2Fitem?cursor=next+page&limit=20&tags=beta&tags=alpha", - ); - }); - - it("fails closed when a path value or scalar search value is invalid", () => { - expect( - buildRequestTarget("https://api.test", operation, {}, {}), - ).toEqual({ success: false, code: "PATH_PARAMETER_MISSING" }); - expect( - buildRequestTarget( - "https://api.test", - operation, - { resourceId: "one" }, - { nested: { secret: true } }, - ), - ).toEqual({ success: false, code: "SEARCH_PARAMETER_INVALID" }); - expect( - buildRequestTarget( - "https://api.test", - operation, - { resourceId: "one", unexpected: "two" }, - {}, - ), - ).toEqual({ success: false, code: "PATH_PARAMETER_UNEXPECTED" }); - expect( - buildRequestTarget("http://api.test", operation, { resourceId: "one" }), - ).toEqual({ success: false, code: "BASE_URL_INVALID" }); - }); - - it.each([".", ".."])( - "rejects the dot segment %j instead of letting pathname normalization move the target", - (resourceId) => { - expect( - buildRequestTarget("https://api.test/base/", operation, { resourceId }), - ).toEqual({ success: false, code: "PATH_PARAMETER_INVALID" }); - }, - ); -}); diff --git a/tests/unit/rest-profile-contract.test.ts b/tests/unit/rest-profile-contract.test.ts index fba5a25d..b7c0abc7 100644 --- a/tests/unit/rest-profile-contract.test.ts +++ b/tests/unit/rest-profile-contract.test.ts @@ -1,158 +1,41 @@ +import { readdir, readFile } from "node:fs/promises"; +import path from "node:path"; + import { describe, expect, it } from "vitest"; -import { defineRestOperation } from "../../src/contracts/api-operations.ts"; import { composeContractContributions, ContractContributionError, } from "../../src/contracts/external-contract-runtime.ts"; import { - createRestProviderProfile, INSTALLED_REST_AUTH_PROFILES, installRestAuthProfileRegistry, - resolveRestSecurityProfiles, REST_AUTH_PROFILES, - validateRestProfileBindings, } from "../../src/contracts/rest-profiles.ts"; import { TEST_CONTRACT_CONTRIBUTION } from "../helpers/external-contract-fixture.ts"; -/** - * §24.12: the common REST profile contract must stay independently verifiable - * after the sample feature is removed, so this suite owns its own operation - * fixture instead of importing an installed feature contract. - */ -const SAMPLE_COMMAND = defineRestOperation({ - method: "POST", - path: "/api/sample-resources", - operationId: "CREATE_SAMPLE_RESOURCE", - auth: "external-session", - timeoutMs: null, - idempotency: "keyed", - retry: "runtime", - requestSource: "body", - requestSchema: "SampleCommand", - responseSchema: "SamplePayload", - owner: "platform-test-fixture", - contractVersion: 2, - protocol: "REST", - semantics: "COMMAND", - replayPolicy: "KEYED_COMMAND", - idempotencyKeyPolicy: "REQUIRED", - mapperId: "SampleMapper", - successStatuses: [200, 201], - responseMediaTypes: ["application/json"], - maxResponseBytes: 32_768, - providerId: "PRIMARY_API", - authProfileId: "REFERENCE_EXTERNAL_BEARER", - csrfProfileId: "NO_CSRF_BEARER", - pathSchema: "NoRequest", - pathParameterNames: [], - maxEncodedSearchBytes: 0, -}); - -const SAMPLE_OPERATIONS = Object.freeze({ - CREATE_SAMPLE_RESOURCE: SAMPLE_COMMAND, -}); - -describe("REST provider/auth/CSRF profiles", () => { - it("preserves the provider prefix and rejects unsafe endpoint forms", () => { - expect( - createRestProviderProfile( - "PRIMARY_API", - "https://api.test/base/", - ["omit"], - ), - ).toMatchObject({ - providerId: "PRIMARY_API", - baseUrl: "https://api.test/base/", - redirect: "error", - referrerPolicy: "no-referrer", - }); - expect(() => - createRestProviderProfile( - "PRIMARY_API", - "https://user:password@api.test/base/", - ), - ).toThrow("Invalid REST provider profile"); - expect(() => - createRestProviderProfile("PRIMARY_API", "http://api.test/base/"), - ).toThrow("Invalid REST provider profile"); - }); - - it("resolves bearer auth to omit credentials and no CSRF", () => { - const resolved = resolveRestSecurityProfiles( - SAMPLE_COMMAND, - createRestProviderProfile("PRIMARY_API", "https://api.test", ["omit"]), - ); - expect(resolved).toMatchObject({ - auth: { - transport: "BEARER_HEADER", - credentials: "omit", - allowedCredentialHeaders: ["authorization"], - }, - csrf: { mode: "NONE" }, - }); - }); - - it("validates every installed profile binding as a set", () => { - expect( - validateRestProfileBindings(SAMPLE_OPERATIONS, { - PRIMARY_API: ["omit"], - }), - ).toBe(true); - expect(() => - validateRestProfileBindings(SAMPLE_OPERATIONS, {}), - ).toThrow("Unregistered REST provider binding"); - }); -}); - -/** - * Q-6.7-9. Composition, the V3 executor and the V2 resolve must all answer - * from one validated installed registry. A raw record handed to resolve used - * to skip installation, so a bearer profile with ambient credentials passed. - */ describe("one installed REST auth profile registry", () => { - const provider = createRestProviderProfile("PRIMARY_API", "https://api.test", [ - "omit", - "same-origin", - ]); - - it("rejects a raw profile record that installation would refuse", () => { - const incoherent = { - REFERENCE_EXTERNAL_BEARER: { - ...REST_AUTH_PROFILES.REFERENCE_EXTERNAL_BEARER, - credentials: "same-origin" as const, - }, - }; + it("refuses a raw profile record that is incoherent", () => { expect(() => - resolveRestSecurityProfiles(SAMPLE_COMMAND, provider, incoherent), + installRestAuthProfileRegistry({ + EXTERNAL_BEARER: { + ...REST_AUTH_PROFILES.EXTERNAL_BEARER, + credentials: "same-origin" as const, + }, + }), ).toThrow(TypeError); }); - it("resolves through the installed registry", () => { - expect( - resolveRestSecurityProfiles( - SAMPLE_COMMAND, - provider, - INSTALLED_REST_AUTH_PROFILES, - ).auth, - ).toBe(INSTALLED_REST_AUTH_PROFILES.get("REFERENCE_EXTERNAL_BEARER")); - }); - - it("does not resolve an inherited profile id", () => { - expect(() => - resolveRestSecurityProfiles( - { ...SAMPLE_COMMAND, authProfileId: "toString" }, - provider, - REST_AUTH_PROFILES, - ), - ).toThrow("incoherent"); + it("does not answer for an inherited profile id", () => { + expect(INSTALLED_REST_AUTH_PROFILES.has("toString")).toBe(false); + expect(INSTALLED_REST_AUTH_PROFILES.get("toString")).toBeUndefined(); }); it("composes contributions against the registry it is given", () => { const registry = installRestAuthProfileRegistry({ ...REST_AUTH_PROFILES, CUSTOM_BEARER: { - ...REST_AUTH_PROFILES.REFERENCE_EXTERNAL_BEARER, + ...REST_AUTH_PROFILES.EXTERNAL_BEARER, authProfileId: "CUSTOM_BEARER", }, }); @@ -172,3 +55,142 @@ describe("one installed REST auth profile registry", () => { ).toBe(1); }); }); + +/** + * A cookie-authenticated write must carry a CSRF proof header: the browser + * attaches the cookie to any site's request, so the header is what tells the + * server the page itself sent it. The V2 client refused such a binding; the + * installed HTTP contract has to refuse it too. + */ +describe("cookie profiles on writes", () => { + const cookie = ( + authProfileId: string, + headers: readonly ("x-csrf-token" | "x-xsrf-token" | "x-tenant-context")[], + ) => ({ + authProfileId, + transport: "SAME_ORIGIN_COOKIE" as const, + credentials: "include" as const, + allowedCredentialHeaders: [...headers], + requiredCredentialHeaders: [...headers], + }); + const registry = installRestAuthProfileRegistry({ + ...REST_AUTH_PROFILES, + COOKIE_READ: cookie("COOKIE_READ", []), + COOKIE_WRITE: cookie("COOKIE_WRITE", ["x-xsrf-token"]), + COOKIE_CSRF: cookie("COOKIE_CSRF", ["x-csrf-token"]), + COOKIE_TENANT: cookie("COOKIE_TENANT", ["x-tenant-context"]), + }); + const withProfile = ( + index: number, + authProfileId: string, + method?: "GET" | "HEAD" | "POST" | "PUT" | "PATCH" | "DELETE", + ) => { + const row = TEST_CONTRACT_CONTRIBUTION.http[index]!; + return { + ...TEST_CONTRACT_CONTRIBUTION, + http: [ + { + contract: method ? { ...row.contract, method } : row.contract, + frontend: { ...row.frontend, authProfileId }, + }, + ], + }; + }; + // TEST_CONTRACT_CONTRIBUTION.http: [list (GET), detail (GET), create (POST)] + const compose = ( + index: number, + authProfileId: string, + method?: "GET" | "HEAD" | "POST" | "PUT" | "PATCH" | "DELETE", + ) => + composeContractContributions( + [withProfile(index, authProfileId, method)], + registry, + ).httpByOperationId.size; + + // 1103/07-02, 10-03. Every write method, not POST alone, and only the two + // CSRF header names count: another required header is not a CSRF proof. + it.each(["POST", "PUT", "PATCH", "DELETE"] as const)( + "refuses a %s whose cookie profile requires no CSRF header", + (method) => { + for (const authProfileId of ["COOKIE_READ", "COOKIE_TENANT"]) { + expect(() => compose(2, authProfileId, method)).toThrow( + expect.objectContaining({ + reason: `test-feature/TEST_CREATE_ENTITY: ${method} with cookie profile ${authProfileId} must require x-csrf-token or x-xsrf-token`, + }), + ); + } + }, + ); + + it.each(["POST", "PUT", "PATCH", "DELETE"] as const)( + "accepts a %s that requires x-csrf-token or x-xsrf-token", + (method) => { + expect(compose(2, "COOKIE_CSRF", method)).toBe(1); + expect(compose(2, "COOKIE_WRITE", method)).toBe(1); + }, + ); + + it.each(["GET", "HEAD"] as const)( + "accepts a cookie %s without a CSRF header", + (method) => { + expect(compose(0, "COOKIE_READ", method)).toBe(1); + }, + ); + + it("refuses a write whose cookie profile requires no CSRF header", () => { + expect(() => + composeContractContributions([withProfile(2, "COOKIE_READ")], registry), + ).toThrow( + expect.objectContaining({ + reason: + "test-feature/TEST_CREATE_ENTITY: POST with cookie profile COOKIE_READ must require x-csrf-token or x-xsrf-token", + }), + ); + }); + + it("accepts a write that requires a CSRF header, and a cookie read without one", () => { + expect( + composeContractContributions([withProfile(2, "COOKIE_WRITE")], registry) + .httpByOperationId.size, + ).toBe(1); + expect( + composeContractContributions([withProfile(0, "COOKIE_READ")], registry) + .httpByOperationId.size, + ).toBe(1); + }); +}); + +/** + * 1101/16-03. The only bearer profile is the platform's, not the sample's: + * `EXTERNAL_BEARER`. The old name stays for one release as a deprecated alias + * that resolves to the same transport and headers. + */ +describe("EXTERNAL_BEARER and its deprecated alias (16-03)", () => { + it("resolves the alias exactly like EXTERNAL_BEARER but for its id", () => { + expect(INSTALLED_REST_AUTH_PROFILES.get("EXTERNAL_BEARER")).toMatchObject({ + transport: "BEARER_HEADER", + requiredCredentialHeaders: ["authorization"], + }); + expect({ + ...INSTALLED_REST_AUTH_PROFILES.get("REFERENCE_EXTERNAL_BEARER"), + authProfileId: "EXTERNAL_BEARER", + }).toEqual(INSTALLED_REST_AUTH_PROFILES.get("EXTERNAL_BEARER")); + }); + + it("keeps the old name in src only on the alias line", async () => { + const files = (await readdir("src", { recursive: true })) + .filter((file) => /\.tsx?$/u.test(file)) + .map((file) => path.join("src", file)); + const lines: string[] = []; + for (const file of files) { + for (const line of (await readFile(file, "utf8")).split("\n")) { + if (line.includes("REFERENCE_EXTERNAL_BEARER")) { + lines.push(`${file}: ${line.trim()}`); + } + } + } + expect(lines).toEqual([ + 'src/contracts/rest-profiles.ts: REFERENCE_EXTERNAL_BEARER: Object.freeze({ ...EXTERNAL_BEARER, authProfileId: "REFERENCE_EXTERNAL_BEARER" }),', + ]); + }); +}); diff --git a/tests/unit/resumable-upload-fetch-transport.test.ts b/tests/unit/resumable-upload-fetch-transport.test.ts index 869e9752..add1791e 100644 --- a/tests/unit/resumable-upload-fetch-transport.test.ts +++ b/tests/unit/resumable-upload-fetch-transport.test.ts @@ -319,6 +319,33 @@ describe("resumable upload fetch transport", () => { expect(cancel).toHaveBeenCalledTimes(1); }); + // 2026-11-03 01-03 (N17). Without a usable wait the transport does not + // invite a retry (presigned-transfer-and-image-cdn.md, Retry-After). + it.each }>>([ + { label: "no Retry-After", headers: {} }, + { label: "Retry-After past the ceiling", headers: { "retry-after": "4" } }, + ])("classifies a 429 with $label as not retryable", async ({ headers }) => { + const fetcher = vi.fn(async () => + responseAt(ENDPOINTS.GET_STATUS, null, { status: 429, headers }), + ) as unknown as typeof fetch; + + const result = await createTransport(fetcher).execute({ + operation: "GET_STATUS", + body: {}, + signal: activeSignal, + }); + + expect(result).toEqual({ + ok: false, + error: { + code: "UNAVAILABLE", + operation: "UPLOAD_RECONCILE", + retryable: false, + recovery: "RESUME", + }, + }); + }); + it.each([500, 599])( "classifies HTTP %s as retryable; runtime attempt limits remain authoritative", async (status) => { diff --git a/tests/unit/resumable-upload-http-control-plane.test.ts b/tests/unit/resumable-upload-http-control-plane.test.ts index 5013148a..74c94677 100644 --- a/tests/unit/resumable-upload-http-control-plane.test.ts +++ b/tests/unit/resumable-upload-http-control-plane.test.ts @@ -334,6 +334,59 @@ describe("resumable upload HTTP control plane", () => { } }); + it("hands the runtime the Retry-After of a refused part issuance (2026-11-01 01-01)", async () => { + const control = createResumableUploadHttpControlPlane({ + transport: { execute: vi.fn() }, + partCapabilities: { + issueUploadPart: async () => + Object.freeze({ + ok: false as const, + error: Object.freeze({ + code: "UNAVAILABLE" as const, + operation: "PRESIGNED_TRANSFER" as const, + retryable: true, + recovery: "REISSUE_CAPABILITY" as const, + retryAfterMs: 5_000, + }), + }), + }, + }); + + const issued = await control.issuePartCapability({ + protocol: RESUMABLE_UPLOAD_PROTOCOL, + sessionId: "session_01", + requestBindingSha256: "b".repeat(64), + uploadBindingSha256: "c".repeat(64), + fingerprint: Object.freeze({ + algorithm: "SHA-256-PARTS-V1", + digestHex: "a".repeat(64), + byteLength: 4, + partSizeBytes: 4, + partCount: 1, + }), + mediaType: "application/octet-stream", + part: Object.freeze({ + partNumber: 1, + offset: 0, + byteLength: 4, + checksumSha256: "d".repeat(64), + }), + idempotencyKey: "upload-part-idempotency-01", + signal: activeSignal, + }); + + expect(issued).toEqual({ + ok: false, + error: { + code: "UNAVAILABLE", + operation: "UPLOAD_PART", + retryable: true, + recovery: "REISSUE_CAPABILITY", + retryAfterMs: 5_000, + }, + }); + }); + it("rejects unknown response fields so URLs cannot cross the DTO boundary", async () => { const fingerprint: UploadFileFingerprint = Object.freeze({ algorithm: "SHA-256-PARTS-V1", diff --git a/tests/unit/resumable-upload-runtime-contract.test.ts b/tests/unit/resumable-upload-runtime-contract.test.ts index 917f279b..0d9efc43 100644 --- a/tests/unit/resumable-upload-runtime-contract.test.ts +++ b/tests/unit/resumable-upload-runtime-contract.test.ts @@ -308,10 +308,13 @@ describe("resumable upload runtime server response validation", () => { }); await expect(upload(dependencies(harness))).resolves.toMatchObject({ ok: false, + // 0929/01-01. The server would issue the same capability again, so a + // new upload() only replays this refusal. error: { code: "POLICY_REJECTED", operation: "UPLOAD_PART", - recovery: "RESUME", + retryable: false, + recovery: "NONE", }, }); }); diff --git a/tests/unit/resumable-upload-runtime-recovery.test.ts b/tests/unit/resumable-upload-runtime-recovery.test.ts index 3df38960..35959762 100644 --- a/tests/unit/resumable-upload-runtime-recovery.test.ts +++ b/tests/unit/resumable-upload-runtime-recovery.test.ts @@ -11,6 +11,8 @@ import { browserDataSuccess, } from "../../src/adapters/browser-file-storage/result.ts"; import { sha256Hex } from "../../src/adapters/browser-transfer/presigned/incremental-sha256.ts"; +import { createResumableUploadFetchJsonTransport } from "../../src/adapters/browser-transfer/resumable-upload/fetch-json-transport.ts"; +import { createResumableUploadHttpControlPlane } from "../../src/adapters/browser-transfer/resumable-upload/http-control-plane-adapter.ts"; import { createPresignedUploadPartExecutor } from "../../src/adapters/browser-transfer/resumable-upload/presigned-upload-part-executor.ts"; import { createResumableUploadRuntime } from "../../src/adapters/browser-transfer/resumable-upload/resumable-upload-runtime.ts"; @@ -58,15 +60,35 @@ const putForbidden = () => function presignedRuntime( putStatuses: readonly number[], observer?: Readonly<{ record(observation: BrowserDataObservation): void }>, + faults: Readonly<{ + /** The BFF's answers to successive issuances; past the list, 200. */ + issueStatuses?: readonly number[]; + /** `Retry-After` sent with every refusal from either server. */ + retryAfter?: string; + maxRetryAfterMs?: number; + }> = {}, ) { const bytes = new Uint8Array([1, 2, 3, 4]); const checksum = sha256Hex(bytes); let issuance = 0; let puts = 0; + const sleeps: number[] = []; + const refusal = (status: number) => + new Response(null, { + status, + headers: + faults.retryAfter === undefined + ? {} + : { "Retry-After": faults.retryAfter }, + }); const fetcher = vi.fn( async (input: RequestInfo | URL, init?: RequestInit) => { if (String(input) === CONTROL_ENDPOINT) { issuance += 1; + const issueStatus = faults.issueStatuses?.[issuance - 1] ?? 200; + if (issueStatus !== 200) { + return responseWithUrl(refusal(issueStatus), CONTROL_ENDPOINT); + } const body = JSON.parse(String(init?.body)) as Readonly<{ binding: Readonly>; }>; @@ -94,7 +116,7 @@ function presignedRuntime( ETag: "\"part-etag-reissued\"", }, }) - : new Response(null, { status }), + : refusal(status), String(input), ); }, @@ -147,9 +169,16 @@ function presignedRuntime( checkpoints: new MemoryCheckpointStore(), mutationLock: noContentionLock, crypto, - policy: runtimePolicy({ maxRetries: 3 }), + policy: runtimePolicy({ + maxRetries: 3, + ...(faults.maxRetryAfterMs === undefined + ? {} + : { maxRetryAfterMs: faults.maxRetryAfterMs }), + }), now: () => NOW, - sleep: async () => {}, + sleep: async (milliseconds: number) => { + sleeps.push(milliseconds); + }, ...(observer ? { observer } : {}), }); return { @@ -157,6 +186,7 @@ function presignedRuntime( harness, issuance: () => issuance, puts: () => puts, + sleeps, }; } @@ -264,9 +294,180 @@ describe("resumable upload capability reissue (01-01)", () => { }); }); +/** + * 0929/01-01 ④. Both servers' 401/403 reach the runtime as the same + * PERMISSION_DENIED/UPLOAD_PART/REISSUE_CAPABILITY. A refused issuance means + * the session expired or the permission was revoked: no new call succeeds + * before re-authentication. A refused PUT means the signature expired: the + * runtime's next capability recovers it. + */ +describe("issuance refusal versus PUT refusal (0929/01-01)", () => { + it.each([ + ["the BFF refuses issuance with 401", "NONE", [401], [], 0], + ["the BFF refuses issuance with 403", "NONE", [403], [], 0], + ["the object store refuses every PUT with 403", "RESUME", [], [403, 403, 403, 403], 4], + ] as const)( + "%s → %s", + async (_scenario, recovery, issueStatuses, putStatuses, puts) => { + const real = presignedRuntime(putStatuses, undefined, { issueStatuses }); + + const result = await real.runtime.upload( + request("upload_key_permission_denied"), + ); + + expect(result).toMatchObject({ + ok: false, + error: { + code: "PERMISSION_DENIED", + operation: "UPLOAD_PART", + retryable: false, + recovery, + }, + }); + expect(real.puts()).toBe(puts); + }, + ); +}); + +describe("part-stage Retry-After (2026-11-01 01-01)", () => { + // 2026-11-03 01-03 (N2). A 503 carries the server's Retry-After as a 429 + // does (`statusFailure` in presigned/http-common.ts). + const stages = [ + { stage: "BFF issuance", status: 429, issueStatuses: [429], putStatuses: [] }, + { stage: "object-store PUT", status: 429, issueStatuses: [], putStatuses: [429] }, + { stage: "BFF issuance", status: 503, issueStatuses: [503], putStatuses: [] }, + { stage: "object-store PUT", status: 503, issueStatuses: [], putStatuses: [503] }, + ] as const; + + it.each(stages)( + "waits the server's Retry-After before retrying a $stage $status", + async ({ issueStatuses, putStatuses }) => { + const real = presignedRuntime(putStatuses, undefined, { + issueStatuses, + retryAfter: "5", + maxRetryAfterMs: 30_000, + }); + + const result = await real.runtime.upload( + request("upload_key_part_retry_after"), + ); + + expect(result).toMatchObject({ ok: true }); + expect(real.sleeps).toHaveLength(1); + expect(real.sleeps[0]).toBeGreaterThanOrEqual(5_000); + }, + ); + + it.each(stages)( + "does not retry a $stage $status whose Retry-After exceeds maxRetryAfterMs", + async ({ issueStatuses, putStatuses }) => { + const real = presignedRuntime(putStatuses, undefined, { + issueStatuses, + retryAfter: "5", + maxRetryAfterMs: 1_000, + }); + + const result = await real.runtime.upload( + request("upload_key_part_retry_after_over"), + ); + + // 2026-11-03 01-02. The server asked for a longer wait than the runtime + // gives, so the app is not invited to call again at once either. + expect(result).toMatchObject({ + ok: false, + error: { + code: "UNAVAILABLE", + operation: "UPLOAD_PART", + retryable: false, + recovery: "RESUME", + }, + }); + expect(real.sleeps).toEqual([]); + expect(real.issuance()).toBe(1); + }, + ); +}); + +/** + * 2026-11-03 01-02. A control-plane 429 past the ceiling ends the same way + * as a part-stage one, whichever of the two factories' `maxRetryAfterMs` is + * larger: the transport's (it decides `retryable`) or the runtime policy's + * (it decides whether to wait). + */ +describe("control-plane Retry-After past the ceiling (2026-11-03 01-02)", () => { + const API = "https://api.example"; + const endpoints = Object.freeze({ + CREATE_SESSION: `${API}/uploads/create`, + GET_STATUS: `${API}/uploads/status`, + COMPLETE: `${API}/uploads/complete`, + ABORT: `${API}/uploads/abort`, + }); + + it.each([ + { transportMaxRetryAfterMs: 30_000 }, + { transportMaxRetryAfterMs: 60_000 }, + ])( + "createSession 429 Retry-After: 45 with transport ceiling $transportMaxRetryAfterMs and policy ceiling 30000", + async ({ transportMaxRetryAfterMs }) => { + const fetcher = vi.fn(async (input: RequestInfo | URL) => + responseWithUrl( + new Response(null, { status: 429, headers: { "Retry-After": "45" } }), + String(input), + ), + ); + const sleeps: number[] = []; + const runtime = createResumableUploadRuntime({ + controlPlane: createResumableUploadHttpControlPlane({ + transport: createResumableUploadFetchJsonTransport({ + endpoints, + allowedOrigins: [API], + credentials: "same-origin", + fetcher: fetcher as unknown as typeof fetch, + timeoutMs: 100, + maxRequestBytes: 4_096, + maxResponseBytes: 4_096, + maxRetryAfterMs: transportMaxRetryAfterMs, + nowEpochMs: () => NOW, + }), + partCapabilities: { issueUploadPart: vi.fn() }, + }), + partExecutor: { uploadPart: vi.fn() }, + checkpoints: new MemoryCheckpointStore(), + mutationLock: noContentionLock, + crypto, + policy: runtimePolicy({ maxRetries: 3, maxRetryAfterMs: 30_000 }), + now: () => NOW, + sleep: async (milliseconds: number) => { + sleeps.push(milliseconds); + }, + }); + + const result = await runtime.upload( + request("upload_key_control_retry_after_over"), + ); + + expect(result).toEqual({ + ok: false, + error: { + code: "UNAVAILABLE", + operation: "UPLOAD_SESSION", + retryable: false, + recovery: "RESUME", + }, + }); + expect(fetcher).toHaveBeenCalledTimes(1); + expect(sleeps).toEqual([]); + }, + ); +}); + describe("resumable upload idempotency keys (01-04)", () => { const unavailable = ( - operation: "UPLOAD_SESSION" | "UPLOAD_PART" | "UPLOAD_COMPLETE", + operation: + | "UPLOAD_SESSION" + | "UPLOAD_PART" + | "UPLOAD_COMPLETE" + | "UPLOAD_ABORT", ) => browserDataFailure("UNAVAILABLE", operation, { retryable: true, @@ -420,6 +621,49 @@ describe("resumable upload idempotency keys (01-04)", () => { complete.mock.calls[0]?.[0].idempotencyKey, ); }); + + // 2026-11-03 01-03 (N10). The same key is how the server recognises an + // abort whose answer was lost as the same abort. + it("retries abort with the same key, within one abort() and from the next", async () => { + const harness = createControlHarness(); + const abort = vi.fn( + async ( + _input: Parameters[0], + ): ReturnType => + abort.mock.calls.length <= 2 + ? unavailable("UPLOAD_ABORT") + : browserDataSuccess({ state: "ABORTED" as const }), + ); + harness.control.abort = abort; + const checkpoints = new MemoryCheckpointStore(); + const runtime = createResumableUploadRuntime({ + controlPlane: harness.control, + // Every PUT fails, so upload() leaves an ACTIVE checkpoint to abort. + partExecutor: { uploadPart: async () => unavailable("UPLOAD_PART") }, + checkpoints, + mutationLock: noContentionLock, + crypto, + policy: runtimePolicy({ maxRetries: 1 }), + now: () => 1_000, + sleep: async () => {}, + }); + const key = "upload_key_abort_retry"; + expect((await runtime.upload(request(key))).ok).toBe(false); + + // Two attempts inside the first abort() both fail; the next abort() wins. + const failed = await runtime.abort({ uploadKey: key, signal: activeSignal }); + expect(failed).toMatchObject({ + ok: false, + error: { operation: "UPLOAD_ABORT" }, + }); + const retried = await runtime.abort({ uploadKey: key, signal: activeSignal }); + + expect(retried).toEqual({ ok: true, value: { state: "ABORTED" } }); + expect(abort).toHaveBeenCalledTimes(3); + const keys = abort.mock.calls.map(([input]) => input.idempotencyKey); + expect(keys[0]).toMatch(/\S/u); + expect(new Set(keys).size).toBe(1); + }); }); describe("resumable upload completed-result reporting (01-02)", () => { @@ -507,6 +751,56 @@ describe("resumable upload completed-result reporting (01-02)", () => { expect(checkpoints.rows.has(key)).toBe(false); }); + // 0929/01-02 (2026-11-03 리뷰 2절). The reconcile path finds the lost + // complete applied; a failed local cleanup must not cost the caller the + // resourceId, exactly as on the complete path above. + it("reports the reconciled resource even when the local checkpoint cleanup fails", async () => { + const harness = committingHarness("LOST"); + const checkpoints = new MemoryCheckpointStore(); + const remove = checkpoints.remove.bind(checkpoints); + let failRemove = false; + checkpoints.remove = async (input) => + failRemove + ? browserDataFailure("UNAVAILABLE", "UPLOAD_RECONCILE", { + retryable: true, + recovery: "RESUME", + }) + : await remove(input); + const runtime = createResumableUploadRuntime({ + controlPlane: harness.control, + partExecutor: executorFor(harness), + checkpoints, + mutationLock: noContentionLock, + crypto, + policy: runtimePolicy({ maxRetries: 0 }), + now: () => 1_000, + sleep: async () => {}, + }); + const key = "upload_key_reconcile_cleanup_fails"; + expect((await runtime.upload(request(key))).ok).toBe(false); + + failRemove = true; + const reconciled = await runtime.upload(request(key)); + + expect(reconciled).toEqual({ + ok: true, + value: { + state: "QUARANTINED", + resourceId: "resource_01", + byteLength: 4, + replayed: true, + }, + }); + // The stale row is the next call's to clean up, with the same resource. + expect(checkpoints.rows.has(key)).toBe(true); + failRemove = false; + expect(await runtime.upload(request(key))).toMatchObject({ + ok: true, + value: { resourceId: "resource_01", replayed: true }, + }); + expect(checkpoints.rows.has(key)).toBe(false); + }); + it("returns the resourceId when abort() finds the lost complete already applied", async () => { const harness = committingHarness("LOST"); const checkpoints = new MemoryCheckpointStore(); @@ -886,7 +1180,86 @@ describe("upload() failure recovery maps to one caller action (01-05)", () => { error: { code, operation, recovery }, }); if (!result.ok) expect(UPLOAD_ACTIONS.has(result.error.recovery)).toBe(true); + if (!result.ok && recovery === "NONE") { + expect(result.error.retryable).toBe(false); + } }); + + /** + * 0929/01-01. Paths whose recovery vocabulary alone pointed at the wrong + * action. `retryable` is part of the answer: `NONE` and `RESELECT` are never + * retried automatically. + */ + const vocabularyScenarios = { + "the selected file can no longer be read": async () => + await runtimeFor(createControlHarness()).upload({ + ...request("upload_key_unreadable_file"), + source: { + kind: "RANGE_READER", + reader: { + byteLength: 4, + async readRange() { + return browserDataFailure("NOT_READABLE", "FILE_READ", { + retryable: true, + recovery: "REOPEN", + }); + }, + }, + }, + }), + "the checkpoint store fails transiently": async () => { + const checkpoints = new MemoryCheckpointStore(); + checkpoints.read = async () => + browserDataFailure("UNAVAILABLE", "UPLOAD_RECONCILE", { + retryable: true, + recovery: "REOPEN", + }); + return await runtimeFor(createControlHarness(), { checkpoints }).upload( + request("upload_key_store_busy"), + ); + }, + "the BFF no longer knows the session's part": async () => + await runtimeFor( + createControlHarness({ + issueCapability: () => + browserDataFailure("NOT_FOUND", "PRESIGNED_TRANSFER"), + }), + ).upload(request("upload_key_forgotten_session")), + "the runtime is closed": async () => { + const runtime = runtimeFor(createControlHarness()); + runtime.close(); + return await runtime.upload(request("upload_key_closed")); + }, + "a capability outlives its session": async () => + await runtimeFor( + createControlHarness({ + issueCapability: (input, callIndex) => + browserDataSuccess({ + capability: Object.freeze({ id: `cap-${callIndex}` }), + uploadBindingSha256: input.uploadBindingSha256, + expiresAtEpochMs: 1_000 + 6_000, + }), + }), + ).upload(request("upload_key_long_capability")), + } as const; + + it.each([ + ["the selected file can no longer be read", "NOT_READABLE", "RESELECT", false], + ["the checkpoint store fails transiently", "UNAVAILABLE", "RESUME", true], + ["the BFF no longer knows the session's part", "NOT_FOUND", "RECONCILE", false], + ["the runtime is closed", "UNAVAILABLE", "NONE", false], + ["a capability outlives its session", "POLICY_REJECTED", "NONE", false], + ] as const)( + "%s → %s/%s (retryable %s) (0929/01-01)", + async (scenario, code, recovery, retryable) => { + const result = await vocabularyScenarios[scenario](); + + expect(result).toMatchObject({ + ok: false, + error: { code, recovery, retryable }, + }); + }, + ); }); describe("device clock skew on server lifetimes (01-06)", () => { @@ -998,6 +1371,93 @@ describe("resume after a policy change (01-08)", () => { }); }); +/** + * 1101/01-02 (2026-11-03 리뷰 2절). A resumed FILE_BYTE_SOURCE upload reads + * the whole stream again, but hashes only the parts it still has to send, + * as the RANGE_READER path already does. The manifest hashes every part once. + */ +describe("resumed stream upload hashing (1101/01-02)", () => { + const PARTS = Array.from({ length: 8 }, (_, index) => + Uint8Array.from([1, 2, 3, 4], (offset) => index * 4 + offset), + ); + const FILE = Uint8Array.from(PARTS.flatMap((part) => [...part])); + + const streamSource = () => + Object.freeze({ + kind: "FILE_BYTE_SOURCE" as const, + bytes: Object.freeze({ + byteLength: FILE.byteLength, + async *stream() { + for (let offset = 0; offset < FILE.byteLength; offset += 5) { + yield browserDataSuccess(FILE.slice(offset, offset + 5)); + } + }, + }), + }); + + /** Counts SHA-256 digests whose input is exactly one part's bytes. */ + function countingCrypto() { + let partDigests = 0; + const isPart = (data: Uint8Array) => + PARTS.some( + (part) => + part.byteLength === data.byteLength && + part.every((byte, index) => byte === data[index]), + ); + const counting = { + subtle: { + async digest(algorithm: AlgorithmIdentifier, data: Uint8Array) { + if (isPart(data)) partDigests += 1; + return await crypto.subtle.digest(algorithm, data); + }, + }, + } as unknown as Crypto; + return { crypto: counting, partDigests: () => partDigests }; + } + + it("hashes only the two parts the server has not accepted", async () => { + const harness = createControlHarness(); + const checkpoints = new MemoryCheckpointStore(); + const key = "upload_key_stream_resume_hash"; + const partial = await createResumableUploadRuntime({ + controlPlane: harness.control, + partExecutor: { + async uploadPart(input) { + return input.part.partNumber >= 7 + ? browserDataFailure("UNAVAILABLE", "UPLOAD_PART", { + recovery: "RESUME", + }) + : await executorFor(harness).uploadPart(input); + }, + }, + checkpoints, + mutationLock: noContentionLock, + crypto, + policy: runtimePolicy({ maxRetries: 0 }), + now: () => 1_000, + sleep: async () => {}, + }).upload({ ...request(key), source: streamSource() }); + expect(partial.ok).toBe(false); + expect(harness.accepted.size).toBe(6); + + const counted = countingCrypto(); + const resumed = await createResumableUploadRuntime({ + controlPlane: harness.control, + partExecutor: executorFor(harness), + checkpoints, + mutationLock: noContentionLock, + crypto: counted.crypto, + policy: runtimePolicy({ maxRetries: 0 }), + now: () => 1_000, + sleep: async () => {}, + }).upload({ ...request(key), source: streamSource() }); + + expect(resumed).toMatchObject({ ok: true, value: { state: "QUARANTINED" } }); + // 8 for the manifest, 2 for the parts sent. The old order made it 16. + expect(counted.partDigests()).toBe(10); + }); +}); + describe("upload part observation (01-10)", () => { it("records a part that succeeded on its second attempt as one UPLOAD_PART", async () => { const observations: BrowserDataObservation[] = []; diff --git a/tests/unit/retry-policy.test.ts b/tests/unit/retry-policy.test.ts deleted file mode 100644 index 3241bf0e..00000000 --- a/tests/unit/retry-policy.test.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { describe, expect, it } from "vitest"; - -import { - calculateBackoff, - parseRetryAfter, - retryDelay, - shouldRetry, -} from "../../src/adapters/http/retry-policy.ts"; - -describe("HTTP retry policy", () => { - it("uses capped exponential full jitter", () => { - expect(calculateBackoff(0, () => 0.5)).toBe(125); - expect(calculateBackoff(8, () => 1)).toBe(2_000); - }); - - it("parses retry-after and chooses the longer bounded delay", () => { - expect(parseRetryAfter("2", 0)).toBe(2_000); - expect(parseRetryAfter(" 2 ", 0)).toBe(2_000); - expect(parseRetryAfter("Thu, 01 Jan 1970 00:00:05 GMT", 1_000)).toBe( - 4_000, - ); - expect(retryDelay({ kind: "RATE_LIMITED", retryAfterMs: 500 }, 0, () => 0)).toBe( - 500, - ); - }); - - it("rejects Retry-After values that are not delta-seconds or an HTTP date", () => { - for (const value of ["", " ", "1e3", "1.5", "-1", "0x10", "2024-01-01"]) { - expect(parseRetryAfter(value, 0)).toBeNull(); - } - }); - - it("allows at most two retries for safe or keyed requests", () => { - const failure = { kind: "SERVER_FAILURE" }; - expect(shouldRetry({ idempotency: "safe" }, failure, 0)).toBe(true); - expect(shouldRetry({ idempotency: "keyed" }, failure, 1)).toBe(true); - expect(shouldRetry({ idempotency: "safe" }, failure, 2)).toBe(false); - expect(shouldRetry({ idempotency: "none" }, failure, 0)).toBe(false); - expect( - shouldRetry( - { idempotency: "safe" }, - { kind: "SERVER_FAILURE", httpStatus: 500 }, - 0, - ), - ).toBe(false); - }); - - // R3-1. 408/425 server failures share the 502/503/504 rule and honor - // Retry-After with the same 30s ceiling. - it("retries 408 and 425 server failures only for safe or keyed requests", () => { - for (const httpStatus of [408, 425]) { - const failure = { kind: "SERVER_FAILURE", httpStatus }; - expect(shouldRetry({ idempotency: "safe" }, failure, 0)).toBe(true); - expect(shouldRetry({ idempotency: "keyed" }, failure, 0)).toBe(true); - expect(shouldRetry({ idempotency: "none" }, failure, 0)).toBe(false); - expect( - shouldRetry({ idempotency: "safe", retry: "never" }, failure, 0), - ).toBe(false); - expect( - retryDelay({ ...failure, retryAfterMs: 1_500 }, 0, () => 0), - ).toBe(1_500); - expect( - shouldRetry( - { idempotency: "safe" }, - { ...failure, retryAfterMs: 31_000 }, - 0, - ), - ).toBe(false); - } - }); - - it("does not automatically wait beyond 30 seconds", () => { - expect( - shouldRetry( - { idempotency: "safe" }, - { kind: "RATE_LIMITED", retryAfterMs: 31_000 }, - 0, - ), - ).toBe(false); - }); -}); diff --git a/tests/unit/risk-coverage.test.ts b/tests/unit/risk-coverage.test.ts index d58c86fc..0c89a678 100644 --- a/tests/unit/risk-coverage.test.ts +++ b/tests/unit/risk-coverage.test.ts @@ -143,7 +143,7 @@ describe("repository-aware risk coverage", () => { summary, }); - expect(result.selectedTotal).toBe(14); + expect(result.selectedTotal).toBe(11); expect(result.repositoryTotal).toBeGreaterThan(result.selectedTotal); expect(result.uncoveredModules).toHaveLength( result.repositoryTotal - result.selectedTotal, diff --git a/tests/unit/route-runtime.test.ts b/tests/unit/route-runtime.test.ts index 5e4b3475..014a98c8 100644 --- a/tests/unit/route-runtime.test.ts +++ b/tests/unit/route-runtime.test.ts @@ -1,23 +1,58 @@ import { describe, expect, it } from "vitest"; import { + ROUTE_FEATURE_OWNER, ROUTE_REGISTRY, ROUTE_RUNTIME_CONTRACT, } from "../../src/features/installed-feature-contracts.ts"; -import { ROUTE_RUNTIME } from "../../src/features/installed-feature-runtimes.tsx"; import { PLATFORM_ROUTE_REGISTRY } from "../../src/contracts/routes.ts"; +import { PRODUCT_CONTEXT_MODULES } from "../../src/.generated/product-context-index.ts"; +import { PLATFORM_ROUTE_CODECS } from "../../src/presentation/routes/platform-route-codecs.ts"; import { parseRouteInput } from "../../src/presentation/routes/route-codecs.ts"; +import { PLATFORM_ROUTE_RUNTIME } from "../../src/presentation/routes/route-runtime.tsx"; describe("typed installed route catalog", () => { it("keeps contract and executable runtime contributions complete", () => { expect(Object.keys(ROUTE_RUNTIME_CONTRACT).sort()).toEqual( Object.keys(ROUTE_REGISTRY).sort(), ); - expect(Object.keys(ROUTE_RUNTIME).sort()).toEqual( + expect(Object.keys(PLATFORM_ROUTE_RUNTIME).sort()).toEqual( Object.keys(PLATFORM_ROUTE_REGISTRY).sort(), ); }); + // 15-01. Feature route codecs moved from the boot-time feature module to the + // context route handles; every codec a route names must still resolve. + it("resolves every route's codecs from the platform or its context route handle", async () => { + const featureCodecs = new Map>>(); + // Widened so the test still type-checks with no installed context + // (test:sample-removal), where the module type is `never`. + const contexts: readonly Readonly<{ + route?: Readonly<{ + loadRoutes(): Promise[]>; + }>; + }>[] = PRODUCT_CONTEXT_MODULES; + for (const context of contexts) { + for (const route of (await context.route?.loadRoutes()) ?? []) { + const handle = route.handle as + | Readonly<{ routeId: string; codecs?: Readonly> }> + | undefined; + if (handle) featureCodecs.set(handle.routeId, handle.codecs ?? {}); + } + } + for (const [routeId, runtime] of Object.entries(ROUTE_RUNTIME_CONTRACT)) { + const available = { + ...PLATFORM_ROUTE_CODECS, + ...(ROUTE_FEATURE_OWNER[routeId] === undefined + ? {} + : featureCodecs.get(routeId)), + }; + for (const codecId of [runtime.paramsCodec, runtime.searchCodec]) { + expect(Object.hasOwn(available, codecId), `${routeId}: ${codecId}`).toBe(true); + } + } + }); + it("accepts the platform not-found splat owner", () => { expect( parseRouteInput( diff --git a/tests/unit/runbook-drill.test.ts b/tests/unit/runbook-drill.test.ts index 38d85701..8bd5bfab 100644 --- a/tests/unit/runbook-drill.test.ts +++ b/tests/unit/runbook-drill.test.ts @@ -125,5 +125,10 @@ describe("runbook drill verdicts", () => { expect(source).not.toMatch(/assertion\([^;]*,\s*true\s*\)/u); expect(source).not.toMatch(/Asserted:\s*true\b/u); expect(source).not.toMatch(/injectedMountFailure\s*=\s*true/u); + // 0929/11-08. The drill records string verdicts now; the patterns above + // only knew the old boolean shape, so a constant "PASS" went unnoticed. + expect(source).not.toMatch(/assertion\([^;]*,\s*["']PASS["']\s*,?\s*\)/u); + expect(source).not.toMatch(/(?:Asserted|AsExpected):\s*["']PASS["']/u); + expect(source).not.toMatch(/verdict\(\s*true\s*\)/u); }); }); diff --git a/tests/unit/runtime-adapters-auth-profile.test.ts b/tests/unit/runtime-adapters-auth-profile.test.ts new file mode 100644 index 00000000..afea31ce --- /dev/null +++ b/tests/unit/runtime-adapters-auth-profile.test.ts @@ -0,0 +1,480 @@ +import { afterEach, describe, expect, it, vi } from "vitest"; + +import { DEMO_AUTHORIZATION_MARKER } from "../../src/adapters/auth/index.ts"; +import type { InstalledHttpOperationExecutor } from "../../src/adapters/http/index.ts"; +import { createRuntimeAdapters } from "../../src/bootstrap/runtime-adapters.ts"; +import { CREDENTIAL_HEADER_NAMES } from "../../src/contracts/rest-profiles.ts"; +import { TEST_LIST_HTTP_CONTRACT } from "../helpers/external-contract-fixture.ts"; +import { testRuntimeConfig } from "../helpers/runtime-config.ts"; + +/** + * 09-01. The composition root decides credentials for every V3 operation. An + * `ANONYMOUS` operation must go out exactly once with no credential header in + * every session state, and a profile that needs a credential must keep failing + * closed. This runs the real `createRuntimeAdapters`; only the installed + * contract set (adds the fixture) and the feature-input composer (to reach the + * `http` capability a feature would receive) are replaced. + */ + +const fixture = vi.hoisted(() => ({ + http: undefined as InstalledHttpOperationExecutor | undefined, + /** The fixture list operation under another id and auth profile. */ + withProfile( + contract: T, + operationId: string, + authProfileId: string, + ): T { + return { + ...contract, + contract: { ...contract.contract, operationId }, + frontend: { ...contract.frontend, authProfileId }, + }; + }, +})); + +vi.mock("../../src/features/installed-contract-contributions.ts", async (importOriginal) => { + const original = + await importOriginal(); + const { TEST_CONTRACT_CONTRIBUTION, TEST_LIST_HTTP_CONTRACT: list } = + await import("../helpers/external-contract-fixture.ts"); + const source = TEST_CONTRACT_CONTRIBUTION.source; + if (source.kind !== "EXTERNAL_PACKAGE") throw new Error("fixture source changed"); + return { + ...original, + // 15-01. The registry fills as feature runtimes load; this one starts with + // the fixture contribution, as if its feature had loaded. + createInstalledContractRegistry: () => { + const registry = original.createInstalledContractRegistry([ + ...original.EXPECTED_CONTRACT_SET_PACKAGES, + source.package, + ]); + registry.install(TEST_CONTRACT_CONTRIBUTION.featureId, [ + { + ...TEST_CONTRACT_CONTRIBUTION, + http: [ + list, + fixture.withProfile(list, "TEST_LIST_ENTITIES_BEARER", "EXTERNAL_BEARER"), + ] as typeof TEST_CONTRACT_CONTRIBUTION.http, + }, + ]); + return registry; + }, + }; +}); + +vi.mock("../../src/features/installed-feature-adapters.ts", async (importOriginal) => { + const original = + await importOriginal(); + return { + ...original, + createInstalledFeatureLoaders: ( + ...args: Parameters + ) => { + // The context has no `http` key with no installed feature + // (test:sample-removal), so it is read without its static type. + fixture.http = Reflect.get(args[0], "http") as typeof fixture.http; + return original.createInstalledFeatureLoaders(...args); + }, + }; +}); + +type Runtime = Parameters[0]["runtime"]; +type Release = Parameters[0]["release"]; +type Adapters = Awaited>; + +function runtimeFor(authMode: "demo" | "external"): Runtime { + return { + config: testRuntimeConfig({ + APP_ENV: "local", + API_BASE_URL: "http://localhost:8080", + TELEMETRY_ENABLED: false, + AUTH_MODE: authMode, + REQUEST_TIMEOUT_MS: 10_000, + MAX_RETRY_ATTEMPTS: 0, + RELEASE_MANIFEST_URL: "/release-manifest.json", + CONFIG_SCHEMA_VERSION: "2.0", + CAPABILITY_OVERRIDES: { + REALTIME: "DEFAULT", + WEB_WORKER: "DEFAULT", + SERVICE_WORKER: "DEFAULT", + OFFLINE_COMMANDS: "DEFAULT", + }, + FEATURE_OVERRIDES: {}, + }), + configSchema: "V2", + build: { + buildId: "build-a", + commitSha: "abc123", + routerBasePath: "/", + runtimeConfigUrl: "/config.json", + }, + validationDurationMs: 0, + }; +} + +const release: Release = { + schemaVersion: 2, + appVersion: "0.1.0", + buildId: "build-a", + commitSha: "abc123", + configSchemaVersion: "2.0", + contractSet: { + setAlgorithm: "CA_CONTRACT_SET_V1", + setDigest: `sha256:${"0".repeat(64)}`, + packages: [], + }, + assetManifestHash: "hash-a", + releaseId: "release-a", + builtAt: "2026-07-25T00:00:00Z", + routeChunks: { "route-home": "assets/home.js" }, +}; + +const ANONYMOUS_OPERATION = TEST_LIST_HTTP_CONTRACT; +const BEARER_OPERATION = fixture.withProfile( + TEST_LIST_HTTP_CONTRACT, + "TEST_LIST_ENTITIES_BEARER", + "EXTERNAL_BEARER", +); + +function externalOwner( + attachCredential: () => Promise = async () => ({ + headers: { authorization: "Bearer owner-token" }, + }), +) { + const listeners = new Set<() => void>(); + let subject = "user-a"; + return { + readState: () => "authenticated", + readSubject: () => subject, + subscribe(listener: () => void) { + listeners.add(listener); + return () => listeners.delete(listener); + }, + beginSignIn: async () => {}, + signOut: async () => {}, + attachCredential: vi.fn(attachCredential), + recoverSession: async () => "no-session", + notifyUnauthenticated: () => {}, + /** Another user signs in on this owner: the scope fences. */ + switchUser() { + subject = "user-b"; + for (const listener of listeners) listener(); + }, + }; +} + +let current: Adapters | undefined; +afterEach(() => { + current?.infrastructure.dispose(); + current = undefined; + fixture.http = undefined; +}); + +async function compose( + authMode: "demo" | "external", + host: Record = {}, + respond: () => Response = () => + Response.json([{ id: "entity-1", name: "Entity" }]), +) { + const fetcher = vi.fn(async (_input: RequestInfo | URL, _init?: RequestInit) => + respond(), + ); + current = await createRuntimeAdapters({ + runtime: runtimeFor(authMode), + release, + host, + fetcher: fetcher as unknown as typeof fetch, + }); + const http = fixture.http; + if (!http) throw new Error("The http capability was not composed"); + return { adapters: current, http, fetcher }; +} + +async function signInDemo(adapters: Adapters) { + await adapters.outputPorts.session.beginSignIn(); + await vi.waitFor(() => { + expect(adapters.infrastructure.serverStateScope.getPhase()).toBe("READY"); + }); +} + +function sentCredentialHeaders(init: RequestInit | undefined): string[] { + return [...new Headers(init?.headers).keys()].filter((name) => + (CREDENTIAL_HEADER_NAMES as readonly string[]).includes(name), + ); +} + +describe("09-01 ANONYMOUS operations through the composition root", () => { + it.each([ + { + state: "demo signed out", + setup: () => compose("demo"), + }, + { + state: "demo signed in", + setup: async () => { + const composed = await compose("demo"); + await signInDemo(composed.adapters); + return composed; + }, + }, + { + state: "external owner signed in", + setup: () => + compose("external", { __CA_FRONTEND_AUTH_OWNER__: externalOwner() }), + }, + { + state: "external mode without an owner", + setup: () => compose("external"), + }, + ])("sends once with no credential header ($state)", async ({ setup }) => { + const { http, fetcher } = await setup(); + + const outcome = await http.execute( + ANONYMOUS_OPERATION, + { limit: 1 }, + { routeId: "TEST_ROUTE" }, + ); + + expect(outcome.kind).toBe("SUCCESS"); + expect(fetcher).toHaveBeenCalledOnce(); + const [url, init] = fetcher.mock.calls[0] ?? []; + expect(String(url)).toBe("http://localhost:8080/api/test-entities?limit=1"); + expect(init?.credentials).toBe("omit"); + expect(sentCredentialHeaders(init)).toEqual([]); + }); + + it("does not hand an ANONYMOUS operation to the external owner", async () => { + const owner = externalOwner(); + const { http } = await compose("external", { + __CA_FRONTEND_AUTH_OWNER__: owner, + }); + + await http.execute(ANONYMOUS_OPERATION, { limit: 1 }, { routeId: "TEST_ROUTE" }); + + expect(owner.attachCredential).not.toHaveBeenCalled(); + }); + + it("still holds an ANONYMOUS operation while the scope is fenced", async () => { + const { http, fetcher, adapters } = await compose("demo"); + // The session change fences the scope synchronously; READY comes later. + void adapters.outputPorts.session.beginSignIn(); + + const outcome = await http.execute( + ANONYMOUS_OPERATION, + { limit: 1 }, + { routeId: "TEST_ROUTE" }, + ); + + expect(outcome).toMatchObject({ + kind: "CONTRACT_VIOLATION", + violation: { kind: "SCOPE_FENCED" }, + }); + expect(fetcher).not.toHaveBeenCalled(); + }); +}); + +describe("09-01 credentialed operations keep failing closed", () => { + it("refuses without a session instead of downgrading to anonymous", async () => { + const { http, fetcher } = await compose("demo"); + + const outcome = await http.execute( + BEARER_OPERATION, + { limit: 1 }, + { routeId: "TEST_ROUTE" }, + ); + + expect(outcome).toEqual({ + kind: "UNAUTHENTICATED", + effect: "NOT_APPLICABLE", + }); + expect(fetcher).not.toHaveBeenCalled(); + }); + + it.each([ + { + state: "external mode without an owner", + host: () => ({}), + }, + { + state: "an owner that fails to attach", + host: () => ({ + __CA_FRONTEND_AUTH_OWNER__: externalOwner(async () => { + throw new Error("owner down"); + }), + }), + }, + ])("reports the credential owner unavailable ($state)", async ({ host }) => { + const { http, fetcher } = await compose("external", host()); + + const outcome = await http.execute( + BEARER_OPERATION, + { limit: 1 }, + { routeId: "TEST_ROUTE" }, + ); + + expect(outcome).toMatchObject({ + kind: "AUTH_INTEGRATION_FAILURE", + reason: "CREDENTIAL_OWNER_UNAVAILABLE", + }); + expect(fetcher).not.toHaveBeenCalled(); + }); + + it("abandons the request when the session changes while the owner attaches", async () => { + const owner = externalOwner(async () => { + owner.switchUser(); + return { headers: { authorization: "Bearer owner-token" } }; + }); + const { http, fetcher } = await compose("external", { + __CA_FRONTEND_AUTH_OWNER__: owner, + }); + + const outcome = await http.execute( + BEARER_OPERATION, + { limit: 1 }, + { routeId: "TEST_ROUTE" }, + ); + + // A fence during the credential wait aborts the transport (Q-6.3-6). + expect(outcome).toMatchObject({ + kind: "TRANSPORT_FAILURE", + failure: { kind: "ABORTED_BY_SCOPE" }, + }); + expect(fetcher).not.toHaveBeenCalled(); + }); + + it("sends the session credential once signed in", async () => { + const { http, fetcher, adapters } = await compose("demo"); + await signInDemo(adapters); + + const outcome = await http.execute( + BEARER_OPERATION, + { limit: 1 }, + { routeId: "TEST_ROUTE" }, + ); + + expect(outcome.kind).toBe("SUCCESS"); + expect(fetcher).toHaveBeenCalledOnce(); + const init = fetcher.mock.calls[0]?.[1]; + expect(new Headers(init?.headers).get("authorization")).toBe( + DEMO_AUTHORIZATION_MARKER, + ); + }); +}); + +/** + * 1103/09-01. A server 401 is a verdict on the credential the request carried. + * An ANONYMOUS request carried none of the session's, so its 401 says nothing + * about the session: the signed-in user stays signed in and the server-state + * scope is not fenced. A request that carried the session's credential still + * signs out (R-3.2). + */ +describe("1103/09-01 a 401 is a session verdict only for the session's credential", () => { + const unauthorized = () => new Response(null, { status: 401 }); + + it("keeps a demo session signed in when an ANONYMOUS request gets 401", async () => { + const { http, fetcher, adapters } = await compose("demo", {}, unauthorized); + await signInDemo(adapters); + const scope = adapters.infrastructure.serverStateScope.getSnapshot(); + + const outcome = await http.execute( + ANONYMOUS_OPERATION, + { limit: 1 }, + { routeId: "TEST_ROUTE" }, + ); + + expect(outcome.kind).toBe("UNAUTHENTICATED"); + expect(fetcher).toHaveBeenCalledOnce(); + expect(sentCredentialHeaders(fetcher.mock.calls[0]?.[1])).toEqual([]); + expect(adapters.outputPorts.session.getState()).toBe("authenticated"); + expect(scope.isCurrent()).toBe(true); + }); + + it("does not tell the external owner about an ANONYMOUS request's 401", async () => { + const owner = externalOwner(); + const notifyUnauthenticated = vi.spyOn(owner, "notifyUnauthenticated"); + const { http } = await compose( + "external", + { __CA_FRONTEND_AUTH_OWNER__: owner }, + unauthorized, + ); + + const outcome = await http.execute( + ANONYMOUS_OPERATION, + { limit: 1 }, + { routeId: "TEST_ROUTE" }, + ); + + expect(outcome.kind).toBe("UNAUTHENTICATED"); + expect(owner.attachCredential).not.toHaveBeenCalled(); + expect(notifyUnauthenticated).not.toHaveBeenCalled(); + }); + + it("still tells the owner when the session's own credential gets 401", async () => { + const owner = externalOwner(); + const notifyUnauthenticated = vi.spyOn(owner, "notifyUnauthenticated"); + const { http } = await compose( + "external", + { __CA_FRONTEND_AUTH_OWNER__: owner }, + unauthorized, + ); + + const outcome = await http.execute( + BEARER_OPERATION, + { limit: 1 }, + { routeId: "TEST_ROUTE" }, + ); + + expect(outcome.kind).toBe("UNAUTHENTICATED"); + expect(owner.attachCredential).toHaveBeenCalledOnce(); + expect(notifyUnauthenticated).toHaveBeenCalledOnce(); + }); + + it("still signs a demo session out when its credential gets 401", async () => { + const { http, adapters } = await compose("demo", {}, unauthorized); + await signInDemo(adapters); + + await http.execute(BEARER_OPERATION, { limit: 1 }, { routeId: "TEST_ROUTE" }); + + expect(adapters.outputPorts.session.getState()).toBe("unauthenticated"); + }); +}); + +/** + * 03-02. An operation no loaded feature contributed is refused before the + * executor runs. That refusal must still leave the one diagnostic every V3 + * execution leaves, with the cause, so it is not invisible in the buffer. + */ +describe("03-02 an operation the registry does not hold", () => { + it("is refused without a fetch and leaves one diagnostic naming the cause", async () => { + const { http, fetcher, adapters } = await compose("demo"); + const completed = () => + adapters.outputPorts.diagnostics + .entries() + .filter((entry) => entry.eventId === "http.request.completed"); + const before = completed().length; + + const outcome = await http.execute( + fixture.withProfile(TEST_LIST_HTTP_CONTRACT, "TEST_NOT_INSTALLED", "ANONYMOUS"), + { limit: 1 }, + { routeId: "TEST_ROUTE" }, + ); + + expect(outcome).toMatchObject({ + kind: "CONTRACT_VIOLATION", + effect: "NOT_STARTED", + violation: { + kind: "FINAL_REQUEST_INVARIANT_FAILED", + reason: "CONTRACT_NOT_INSTALLED", + }, + }); + expect(fetcher).not.toHaveBeenCalled(); + expect(completed()).toHaveLength(before + 1); + expect(completed().at(-1)?.context).toMatchObject({ + route_id: "TEST_ROUTE", + operation_id: "TEST_NOT_INSTALLED", + outcome: "CONTRACT_VIOLATION", + error_kind: "FINAL_REQUEST_INVARIANT_FAILED", + reason: "CONTRACT_NOT_INSTALLED", + }); + }); +}); diff --git a/tests/unit/runtime-adapters-credential-order.test.ts b/tests/unit/runtime-adapters-credential-order.test.ts new file mode 100644 index 00000000..f47a84e9 --- /dev/null +++ b/tests/unit/runtime-adapters-credential-order.test.ts @@ -0,0 +1,420 @@ +import { afterEach, describe, expect, it, vi } from "vitest"; + +import type { InstalledHttpOperationExecutor } from "../../src/adapters/http/index.ts"; +import type { ProductCredentialProvider } from "../../src/bootstrap/product-composition-contract.ts"; +import { createRuntimeAdapters } from "../../src/bootstrap/runtime-adapters.ts"; +import { TEST_LIST_HTTP_CONTRACT } from "../helpers/external-contract-fixture.ts"; +import { testRuntimeConfig } from "../helpers/runtime-config.ts"; + +/** + * 09-02. The composition root alone decides the order a credential is looked + * for, so a product credential provider can never run outside the fences: + * + * scope fence -> ANONYMOUS profile -> product provider -> session -> scope fence again + * + * Each row runs the real `createRuntimeAdapters`. Replaced: the installed + * contract set (adds the fixture operations), the feature-input composer (to + * reach the `http` capability) and the product-owned composition file (the + * provider table under test). + */ + +const fixture = vi.hoisted(() => ({ + http: undefined as InstalledHttpOperationExecutor | undefined, + providers: {} as Record, + onCredentialRejected: undefined as ((binding: unknown) => void) | undefined, + withProfile( + contract: T, + operationId: string, + authProfileId: string, + ): T { + return { + ...contract, + contract: { ...contract.contract, operationId }, + frontend: { ...contract.frontend, authProfileId }, + }; + }, +})); + +vi.mock("../../src/features/installed-contract-contributions.ts", async (importOriginal) => { + const original = + await importOriginal(); + const { TEST_CONTRACT_CONTRIBUTION, TEST_LIST_HTTP_CONTRACT: list } = + await import("../helpers/external-contract-fixture.ts"); + const source = TEST_CONTRACT_CONTRIBUTION.source; + if (source.kind !== "EXTERNAL_PACKAGE") throw new Error("fixture source changed"); + return { + ...original, + createInstalledContractRegistry: () => { + const registry = original.createInstalledContractRegistry([ + ...original.EXPECTED_CONTRACT_SET_PACKAGES, + source.package, + ]); + registry.install(TEST_CONTRACT_CONTRIBUTION.featureId, [ + { + ...TEST_CONTRACT_CONTRIBUTION, + http: [ + list, + fixture.withProfile(list, "TEST_LIST_ENTITIES_BEARER", "EXTERNAL_BEARER"), + ] as typeof TEST_CONTRACT_CONTRIBUTION.http, + }, + ]); + return registry; + }, + }; +}); + +vi.mock("../../src/features/installed-feature-adapters.ts", async (importOriginal) => { + const original = + await importOriginal(); + return { + ...original, + createInstalledFeatureLoaders: ( + ...args: Parameters + ) => { + fixture.http = Reflect.get(args[0], "http") as typeof fixture.http; + return original.createInstalledFeatureLoaders(...args); + }, + }; +}); + +/** The product-owned file, filled the way a product fills it. */ +vi.mock("../../src/bootstrap/product-composition.ts", () => ({ + composeProductSessionOwner: () => null, + composeProduct: () => ({ + capabilities: {}, + credentialProviders: fixture.providers, + ...(fixture.onCredentialRejected === undefined + ? {} + : { onCredentialRejected: fixture.onCredentialRejected }), + }), +})); + +type Runtime = Parameters[0]["runtime"]; +type Adapters = Awaited>; + +function runtimeFor(authMode: "demo" | "external"): Runtime { + return { + config: testRuntimeConfig({ + APP_ENV: "local", + API_BASE_URL: "http://localhost:8080", + TELEMETRY_ENABLED: false, + AUTH_MODE: authMode, + REQUEST_TIMEOUT_MS: 10_000, + MAX_RETRY_ATTEMPTS: 0, + RELEASE_MANIFEST_URL: "/release-manifest.json", + CONFIG_SCHEMA_VERSION: "2.0", + CAPABILITY_OVERRIDES: { + REALTIME: "DEFAULT", + WEB_WORKER: "DEFAULT", + SERVICE_WORKER: "DEFAULT", + OFFLINE_COMMANDS: "DEFAULT", + }, + FEATURE_OVERRIDES: {}, + }), + configSchema: "V2", + build: { + buildId: "build-a", + commitSha: "abc123", + routerBasePath: "/", + runtimeConfigUrl: "/config.json", + }, + validationDurationMs: 0, + }; +} + +const release: Parameters[0]["release"] = { + schemaVersion: 2, + appVersion: "0.1.0", + buildId: "build-a", + commitSha: "abc123", + configSchemaVersion: "2.0", + contractSet: { + setAlgorithm: "CA_CONTRACT_SET_V1", + setDigest: `sha256:${"0".repeat(64)}`, + packages: [], + }, + assetManifestHash: "hash-a", + releaseId: "release-a", + builtAt: "2026-07-25T00:00:00Z", + routeChunks: { "route-home": "assets/home.js" }, +}; + +const ANONYMOUS_OPERATION = TEST_LIST_HTTP_CONTRACT; +/** The only non-anonymous profile the template installs. */ +const PROFILE_OPERATION = fixture.withProfile( + TEST_LIST_HTTP_CONTRACT, + "TEST_LIST_ENTITIES_BEARER", + "EXTERNAL_BEARER", +); + +function externalOwner() { + const listeners = new Set<() => void>(); + let subject = "user-a"; + return { + readState: () => "authenticated", + readSubject: () => subject, + subscribe(listener: () => void) { + listeners.add(listener); + return () => listeners.delete(listener); + }, + beginSignIn: async () => {}, + signOut: async () => {}, + attachCredential: vi.fn(async () => ({ + headers: { authorization: "Bearer owner-token" }, + })), + recoverSession: async () => "no-session", + notifyUnauthenticated: () => {}, + switchUser() { + subject = "user-b"; + for (const listener of listeners) listener(); + }, + }; +} + +let current: Adapters | undefined; +afterEach(() => { + current?.infrastructure.dispose(); + current = undefined; + fixture.http = undefined; + fixture.providers = {}; + fixture.onCredentialRejected = undefined; +}); + +async function compose( + authMode: "demo" | "external", + host: Record = {}, + respond: () => Response = () => + Response.json([{ id: "entity-1", name: "Entity" }]), +) { + const fetcher = vi.fn(async (_input: RequestInfo | URL, _init?: RequestInit) => + respond(), + ); + current = await createRuntimeAdapters({ + runtime: runtimeFor(authMode), + release, + host, + fetcher: fetcher as unknown as typeof fetch, + }); + const http = fixture.http; + if (!http) throw new Error("The http capability was not composed"); + return { adapters: current, http, fetcher }; +} + +const productToken: ProductCredentialProvider = async () => ({ + kind: "READY", + headers: { authorization: "Bearer product-token" }, +}); + +type Row = Readonly<{ + step: string; + /** Builds the product provider table; may close over the composed state. */ + providers: (owner: ReturnType) => Record; + authMode: "demo" | "external"; + /** Runs after composition, before the request. */ + before?: (adapters: Adapters) => void; + operation: typeof PROFILE_OPERATION; + outcome: Record; + sentAuthorization: string | null; + providerCalls: number; + ownerCalls: number; +}>; + +const ROWS: readonly Row[] = [ + { + step: "1 scope fence comes before the product provider", + providers: () => ({ EXTERNAL_BEARER: productToken }), + authMode: "demo", + // The session change fences the scope synchronously; READY comes later. + before: (adapters) => void adapters.outputPorts.session.beginSignIn(), + operation: PROFILE_OPERATION, + outcome: { kind: "CONTRACT_VIOLATION", violation: { kind: "SCOPE_FENCED" } }, + sentAuthorization: null, + providerCalls: 0, + ownerCalls: 0, + }, + { + step: "2 an ANONYMOUS profile never reaches a provider", + providers: () => ({ ANONYMOUS: productToken }), + authMode: "demo", + operation: ANONYMOUS_OPERATION, + outcome: { kind: "SUCCESS" }, + sentAuthorization: null, + providerCalls: 0, + ownerCalls: 0, + }, + { + step: "3 a registered provider answers before the session (signed out)", + providers: () => ({ EXTERNAL_BEARER: productToken }), + authMode: "demo", + operation: PROFILE_OPERATION, + outcome: { kind: "SUCCESS" }, + sentAuthorization: "Bearer product-token", + providerCalls: 1, + ownerCalls: 0, + }, + { + step: "3 a registered provider answers before the external owner", + providers: () => ({ EXTERNAL_BEARER: productToken }), + authMode: "external", + operation: PROFILE_OPERATION, + outcome: { kind: "SUCCESS" }, + sentAuthorization: "Bearer product-token", + providerCalls: 1, + ownerCalls: 0, + }, + { + step: "4 a profile without a provider still needs the session", + providers: () => ({}), + authMode: "demo", + operation: PROFILE_OPERATION, + outcome: { kind: "UNAUTHENTICATED", effect: "NOT_APPLICABLE" }, + sentAuthorization: null, + providerCalls: 0, + ownerCalls: 0, + }, + { + step: "5 the scope fence is checked again after the provider answers", + providers: (owner) => ({ + EXTERNAL_BEARER: async (...args) => { + owner.switchUser(); + return productToken(...args); + }, + }), + authMode: "external", + operation: PROFILE_OPERATION, + // A fence during the credential wait aborts the transport (Q-6.3-6). The + // composition root's own re-check behind it is not visible from here. + outcome: { kind: "TRANSPORT_FAILURE", failure: { kind: "ABORTED_BY_SCOPE" } }, + sentAuthorization: null, + providerCalls: 1, + ownerCalls: 0, + }, + { + step: "6 a provider that throws fails closed", + providers: () => ({ + EXTERNAL_BEARER: async () => { + throw new Error("product provider down"); + }, + }), + authMode: "demo", + operation: PROFILE_OPERATION, + outcome: { + kind: "AUTH_INTEGRATION_FAILURE", + reason: "CREDENTIAL_OWNER_FAILED", + }, + sentAuthorization: null, + providerCalls: 1, + ownerCalls: 0, + }, +]; + +describe("09-02 credential order in the composition root", () => { + it.each(ROWS)("$step", async (row) => { + const owner = externalOwner(); + const providerCalls = vi.fn(); + fixture.providers = Object.fromEntries( + Object.entries(row.providers(owner)).map(([profileId, provider]) => [ + profileId, + ((...args) => { + providerCalls(profileId); + return provider(...args); + }) satisfies ProductCredentialProvider, + ]), + ); + const { http, fetcher, adapters } = await compose( + row.authMode, + row.authMode === "external" ? { __CA_FRONTEND_AUTH_OWNER__: owner } : {}, + ); + row.before?.(adapters); + + const outcome = await http.execute( + row.operation, + { limit: 1 }, + { routeId: "TEST_ROUTE" }, + ); + + expect(outcome).toMatchObject(row.outcome); + expect(providerCalls).toHaveBeenCalledTimes(row.providerCalls); + expect(owner.attachCredential).toHaveBeenCalledTimes(row.ownerCalls); + if (row.sentAuthorization === null) { + for (const [, init] of fetcher.mock.calls) { + expect(new Headers(init?.headers).has("authorization")).toBe(false); + } + } else { + expect(fetcher).toHaveBeenCalledOnce(); + expect( + new Headers(fetcher.mock.calls[0]?.[1]?.headers).get("authorization"), + ).toBe(row.sentAuthorization); + } + }); +}); + +/** + * 1103/09-01. A 401 to a credential a product provider supplied is the + * provider's verdict, not the template session's: the session did not supply + * that credential. The product hears it through `onCredentialRejected`. + */ +describe("1103/09-01 a 401 to a product provider's credential", () => { + const unauthorized = () => new Response(null, { status: 401 }); + + it("leaves the session alone and tells the product", async () => { + const owner = externalOwner(); + const notifyUnauthenticated = vi.spyOn(owner, "notifyUnauthenticated"); + const rejected = vi.fn(); + fixture.providers = { EXTERNAL_BEARER: productToken }; + fixture.onCredentialRejected = rejected; + const { http, adapters } = await compose( + "external", + { __CA_FRONTEND_AUTH_OWNER__: owner }, + unauthorized, + ); + const scope = adapters.infrastructure.serverStateScope.getSnapshot(); + + const outcome = await http.execute( + PROFILE_OPERATION, + { limit: 1 }, + { routeId: "TEST_ROUTE" }, + ); + + expect(outcome.kind).toBe("UNAUTHENTICATED"); + expect(notifyUnauthenticated).not.toHaveBeenCalled(); + expect(scope.isCurrent()).toBe(true); + expect(rejected).toHaveBeenCalledExactlyOnceWith({ + operationId: "TEST_LIST_ENTITIES_BEARER", + authProfileId: "EXTERNAL_BEARER", + }); + }); + + it("keeps the outcome when the product hook throws", async () => { + fixture.providers = { EXTERNAL_BEARER: productToken }; + fixture.onCredentialRejected = () => { + throw new Error("product hook defect"); + }; + const { http } = await compose("demo", {}, unauthorized); + + const outcome = await http.execute( + PROFILE_OPERATION, + { limit: 1 }, + { routeId: "TEST_ROUTE" }, + ); + + expect(outcome.kind).toBe("UNAUTHENTICATED"); + }); + + it("does not call the product hook for the session's own credential", async () => { + const rejected = vi.fn(); + fixture.onCredentialRejected = rejected; + const owner = externalOwner(); + const notifyUnauthenticated = vi.spyOn(owner, "notifyUnauthenticated"); + const { http } = await compose( + "external", + { __CA_FRONTEND_AUTH_OWNER__: owner }, + unauthorized, + ); + + await http.execute(PROFILE_OPERATION, { limit: 1 }, { routeId: "TEST_ROUTE" }); + + expect(notifyUnauthenticated).toHaveBeenCalledOnce(); + expect(rejected).not.toHaveBeenCalled(); + }); +}); diff --git a/tests/unit/runtime-adapters-product-scope-participants.test.ts b/tests/unit/runtime-adapters-product-scope-participants.test.ts new file mode 100644 index 00000000..3df098c4 --- /dev/null +++ b/tests/unit/runtime-adapters-product-scope-participants.test.ts @@ -0,0 +1,153 @@ +import { afterEach, describe, expect, it, vi } from "vitest"; + +import type { ProductScopeParticipant } from "../../src/bootstrap/product-composition-contract.ts"; +import { createRuntimeAdapters } from "../../src/bootstrap/runtime-adapters.ts"; +import { testRuntimeConfig } from "../helpers/runtime-config.ts"; + +/** + * 2026-11-03 02-01. A product hands the template what must close with a + * session through `ProductComposition.scopeParticipants`, so it never edits + * `runtime-adapters.ts`. The real `createRuntimeAdapters` runs; only the + * product-owned file is replaced. + */ + +const fixture = vi.hoisted(() => ({ + participants: [] as ProductScopeParticipant[], + owner: undefined as Readonly<{ switchUser(subject: string): void }> | undefined, +})); + +vi.mock("../../src/bootstrap/product-composition.ts", () => ({ + composeProductSessionOwner: () => { + const listeners = new Set<() => void>(); + let subject = "user-a"; + const owner = { + readState: () => "authenticated", + readSubject: () => subject, + subscribe(listener: () => void) { + listeners.add(listener); + return () => listeners.delete(listener); + }, + beginSignIn: async () => {}, + signOut: async () => {}, + attachCredential: async () => ({ headers: {} }), + recoverSession: async () => "no-session", + notifyUnauthenticated: () => {}, + switchUser(next: string) { + subject = next; + for (const listener of listeners) listener(); + }, + }; + fixture.owner = owner; + return owner; + }, + composeProduct: () => ({ + capabilities: {}, + credentialProviders: {}, + scopeParticipants: fixture.participants, + }), +})); + +let current: Awaited> | undefined; +afterEach(() => { + current?.infrastructure.dispose(); + current = undefined; + fixture.participants = []; +}); + +async function compose() { + current = await createRuntimeAdapters({ + runtime: { + config: testRuntimeConfig({ + APP_ENV: "local", + API_BASE_URL: "http://localhost:8080", + TELEMETRY_ENABLED: false, + AUTH_MODE: "external", + REQUEST_TIMEOUT_MS: 10_000, + MAX_RETRY_ATTEMPTS: 0, + RELEASE_MANIFEST_URL: "/release-manifest.json", + CONFIG_SCHEMA_VERSION: "2.0", + CAPABILITY_OVERRIDES: { + REALTIME: "DEFAULT", + WEB_WORKER: "DEFAULT", + SERVICE_WORKER: "DEFAULT", + OFFLINE_COMMANDS: "DEFAULT", + }, + FEATURE_OVERRIDES: {}, + }), + configSchema: "V2", + build: { + buildId: "build-a", + commitSha: "abc123", + routerBasePath: "/", + runtimeConfigUrl: "/config.json", + }, + validationDurationMs: 0, + }, + release: { + schemaVersion: 2, + appVersion: "0.1.0", + buildId: "build-a", + commitSha: "abc123", + configSchemaVersion: "2.0", + contractSet: { + setAlgorithm: "CA_CONTRACT_SET_V1", + setDigest: `sha256:${"0".repeat(64)}`, + packages: [], + }, + assetManifestHash: "hash-a", + releaseId: "release-a", + builtAt: "2026-07-25T00:00:00Z", + routeChunks: { "route-home": "assets/home.js" }, + }, + host: {}, + }); + const owner = fixture.owner; + if (!owner) throw new Error("The product session owner was not asked"); + return { scope: current.infrastructure.serverStateScope, owner }; +} + +describe("product scope participants (2026-11-03 02-01)", () => { + it("closes each one, in order, on every identity change before READY", async () => { + const closed: string[] = []; + fixture.participants = [ + { label: "first", close: () => void closed.push("first") }, + { + label: "second", + async close() { + await Promise.resolve(); + closed.push("second"); + }, + }, + ]; + const { scope, owner } = await compose(); + expect(closed).toEqual([]); + + owner.switchUser("user-b"); + expect(scope.getPhase()).toBe("FENCED"); + await vi.waitFor(() => expect(scope.getPhase()).toBe("READY")); + expect(closed).toEqual(["first", "second"]); + + owner.switchUser("user-c"); + await vi.waitFor(() => expect(closed).toHaveLength(4)); + await vi.waitFor(() => expect(scope.getPhase()).toBe("READY")); + }); + + it("keeps the scope from READY when one fails, and still closes the rest", async () => { + const closed: string[] = []; + fixture.participants = [ + { + label: "broken", + close() { + throw new Error("cannot close"); + }, + }, + { label: "after", close: () => void closed.push("after") }, + ]; + const { scope, owner } = await compose(); + + owner.switchUser("user-b"); + + await vi.waitFor(() => expect(scope.getPhase()).toBe("FAILED")); + expect(closed).toEqual(["after"]); + }); +}); diff --git a/tests/unit/runtime-adapters.test.ts b/tests/unit/runtime-adapters.test.ts index c5234b33..62f0a561 100644 --- a/tests/unit/runtime-adapters.test.ts +++ b/tests/unit/runtime-adapters.test.ts @@ -1,20 +1,18 @@ import { describe, expect, it, vi } from "vitest"; -import { - createRuntimeAdapters, - createRuntimeHttpClient, -} from "../../src/bootstrap/runtime-adapters.ts"; +import { createRuntimeAdapters } from "../../src/bootstrap/runtime-adapters.ts"; import { createBrowserMutationIntentFactory } from "../../src/adapters/platform/browser-mutation-intent-factory.ts"; import { createApplication } from "../../src/application/create-application.ts"; import type { ApplicationFeatureId } from "../../src/application/ports/in/application-api.ts"; -import { INSTALLED_PRODUCT_FEATURE_IDS } from "../../src/features/installed-product-manifest.ts"; -import { TEST_HTTP_CONTRACT } from "../helpers/http-contract-fixture.ts"; +import { loadFeatureRuntime } from "../../src/features/feature-module.ts"; +import { INSTALLED_PRODUCT_FEATURE_MODULES } from "../../src/features/installed-product-manifest.ts"; +import { testRuntimeConfig } from "../helpers/runtime-config.ts"; type Runtime = Parameters[0]["runtime"]; type Release = Parameters[0]["release"]; const runtime: Runtime = { - config: { + config: testRuntimeConfig({ APP_ENV: "local", API_BASE_URL: "http://localhost:8080", TELEMETRY_ENABLED: false, @@ -30,7 +28,7 @@ const runtime: Runtime = { OFFLINE_COMMANDS: "DEFAULT", }, FEATURE_OVERRIDES: {}, - }, + }), configSchema: "V2", build: { buildId: "build-a", @@ -57,6 +55,20 @@ const release: Release = { routeChunks: { "route-home": "assets/home.js" }, }; + +/** + * 1103/09-04. The installed features that contribute an application API. The + * template's example screens call none: loading them + * installs no input. + */ +const API_FEATURE_IDS: readonly string[] = ( + await Promise.all( + INSTALLED_PRODUCT_FEATURE_MODULES.map(async (module) => + (await loadFeatureRuntime(module)).adapters.length > 0 ? [module.id] : [], + ), + ) +).flat(); + describe("runtime adapter composition", () => { it("creates validated intent and idempotency identities with independent UUID calls", () => { const randomUUID = vi @@ -365,7 +377,7 @@ describe("runtime adapter composition", () => { }); it("gives a feature switched off by FEATURE_OVERRIDES no application API (Q-6.9-5)", async () => { - const [disabledId, ...activeIds] = INSTALLED_PRODUCT_FEATURE_IDS; + const [disabledId, ...activeIds] = API_FEATURE_IDS; const adapters = await createRuntimeAdapters({ runtime: { ...runtime, @@ -379,15 +391,19 @@ describe("runtime adapter composition", () => { }); const application = createApplication( adapters.outputPorts, - adapters.featureInputs, + {}, + adapters.featureLoaders, ); expect(adapters.outputPorts.productFeatures.isActive(disabledId!)).toBe(false); + // 15-01. A switched-off feature gets no loader, so loading installs nothing. + await application.features.load(disabledId!); expect(application.features.has(disabledId!)).toBe(false); expect(() => application.features.get(disabledId as ApplicationFeatureId), ).toThrow(/not installed/u); for (const featureId of activeIds) { + await application.features.load(featureId); expect(application.features.has(featureId)).toBe(true); } adapters.infrastructure.dispose(); @@ -397,10 +413,16 @@ describe("runtime adapter composition", () => { const adapters = await createRuntimeAdapters({ runtime, release, host: {} }); const application = createApplication( adapters.outputPorts, - adapters.featureInputs, + {}, + adapters.featureLoaders, ); - for (const featureId of INSTALLED_PRODUCT_FEATURE_IDS) { + for (const featureId of API_FEATURE_IDS) { + // 15-01. Not loaded until the router asks for the feature's routes. + expect(() => + application.features.get(featureId as ApplicationFeatureId), + ).toThrow(/not loaded yet/u); + await application.features.load(featureId); expect(application.features.has(featureId)).toBe(true); expect( application.features.get(featureId as ApplicationFeatureId), @@ -473,53 +495,4 @@ describe("runtime adapter composition", () => { }), ); }); - - it("injects runtime timeout and max-attempt policy into HTTP execution", async () => { - const scheduled: Array<{ callback: () => void; milliseconds: number }> = []; - const scheduler = { - setTimeout: vi.fn((callback: () => void, milliseconds: number) => { - scheduled.push({ callback, milliseconds }); - return scheduled.length; - }), - clearTimeout: vi.fn(), - }; - const fetcher = vi.fn(async () => - Response.json( - { - success: false, - error: { code: "TEMPORARY" }, - meta: { requestId: "request-1", traceId: "trace-1" }, - }, - { status: 503 }, - ), - ); - const authSession = - (await createRuntimeAdapters({ - runtime, - release, - host: {}, - })).outputPorts.session; - const client = createRuntimeHttpClient( - { - runtime, - authSession, - fetcher, - clock: { now: () => 0, sleep: async () => {} }, - scheduler, - }, - TEST_HTTP_CONTRACT, - ); - - await client.execute({ - operationId: "LIST_ENTITIES", - routeId: "TEST_ROUTE", - }); - - expect(fetcher).toHaveBeenCalledOnce(); - expect(scheduler.setTimeout).toHaveBeenCalledWith( - expect.any(Function), - 4321, - ); - expect(scheduler.clearTimeout).toHaveBeenCalledOnce(); - }); }); diff --git a/tests/unit/schema-metadata-policy.test.ts b/tests/unit/schema-metadata-policy.test.ts new file mode 100644 index 00000000..287271f6 --- /dev/null +++ b/tests/unit/schema-metadata-policy.test.ts @@ -0,0 +1,166 @@ +import { describe, expect, it } from "vitest"; + +import type { RuntimeValidator } from "../../src/contracts/external-contract-runtime.ts"; +import type { SchemaDefinition } from "../../src/contracts/schema-registry.ts"; +import { ROUTE_REGISTRY } from "../../src/features/installed-feature-contracts.ts"; +import { + COMPOSED_CONTRACT_CONTRIBUTIONS, + SCHEMA_REGISTRY, +} from "../../src/features/loaded-feature-runtimes.ts"; + +/** + * 1103/07-03. FE-REG-SCHEMA rows state each HTTP schema's direction and + * unknown-field policy, and `docs/contracts/compatibility.md` builds the + * "adding a response field is additive" rule on `STRIP_UNKNOWN`. Nothing at + * run time reads those two fields, so they are checked here against the + * validators the installed HTTP descriptors run. + * + * The probe is an object with one key no schema declares, and the same object + * as the only item of an array, so it reaches the first object level of an + * object or list payload. A validator that rejects it with + * `unrecognized_keys` rejects unknown fields; one that reaches the object + * without that issue tolerates them. A nested object below that level is not + * probed. + */ +const PROBE_KEY = "__unknownFieldProbe"; + +type ProbedPolicy = "REJECT_UNKNOWN" | "STRIP_UNKNOWN" | "UNREACHED"; + +function probeUnknownFieldPolicy(validator: RuntimeValidator): ProbedPolicy { + const probe = { [PROBE_KEY]: true }; + for (const [value, objectPath] of [ + [probe, []], + [[probe], [0]], + ] as const) { + const result = validator.safeParse(value); + if (result.success) return "STRIP_UNKNOWN"; + const atObject = (path: readonly (string | number)[]) => + JSON.stringify(path) === JSON.stringify(objectPath); + if ( + result.issues.some( + (issue) => issue.code === "unrecognized_keys" && atObject(issue.path), + ) + ) { + return "REJECT_UNKNOWN"; + } + // Every issue sits at or above the probed object (wrong type, wrong + // shape): the validator never looked inside it, so try the next probe. + const unreached = result.issues.every( + (issue) => + issue.path.length <= objectPath.length && + issue.path.every((segment, index) => segment === objectPath[index]), + ); + if (!unreached) return "STRIP_UNKNOWN"; + } + return "UNREACHED"; +} + +const slots = COMPOSED_CONTRACT_CONTRIBUTIONS.contributions.flatMap( + ({ http }) => + http.flatMap(({ contract }) => [ + { + operationId: contract.operationId, + direction: "REQUEST" as const, + validator: contract.inputValidator, + }, + { + operationId: contract.operationId, + direction: "RESPONSE" as const, + validator: contract.outputValidator, + }, + // 1103/16-04. The failure body is read as a response too. + { + operationId: contract.operationId, + direction: "RESPONSE" as const, + validator: contract.problemValidator, + }, + ]), +); + +type Boundary = SchemaDefinition["boundary"]; + +/** + * 1103/16-04. Where each installed schema is used: an HTTP input, output or + * failure body, or a route's params or search. The row's `boundary` is + * derived from that set; a schema used in two places that no one boundary + * names (an output that is also an input) has no right answer and is listed. + */ +function usesBySchema(): ReadonlyMap> { + const uses = new Map>(); + const add = (schemaId: string | null, use: string) => { + if (schemaId === null) return; + const set = uses.get(schemaId) ?? new Set(); + set.add(use); + uses.set(schemaId, set); + }; + for (const { http } of COMPOSED_CONTRACT_CONTRIBUTIONS.contributions) { + for (const { contract } of http) { + add(contract.inputValidator.schemaId, "http-input"); + add(contract.outputValidator.schemaId, "http-output"); + add(contract.problemValidator.schemaId, "http-problem"); + } + } + for (const route of Object.values(ROUTE_REGISTRY)) { + add(route.paramsSchema, "route-params"); + add(route.searchSchema, "route-search"); + } + return uses; +} + +function boundaryFor(uses: ReadonlySet): Boundary | undefined { + const key = [...uses].sort().join("+"); + const boundaries: Readonly> = { + "http-input": "api-request", + "http-output": "api-response", + "http-problem": "api-problem", + "route-params": "route-params", + "http-input+route-params": "route-params", + "route-search": "route-search", + "http-input+route-search": "route-search-api-request", + }; + return boundaries[key]; +} + +// With no installed feature (after the sample is removed) there is nothing to +// probe, and both cases pass empty. +describe("FE-REG-SCHEMA policy of the installed HTTP schemas (1103/07-03)", () => { + it("declares the direction each schema is used in", () => { + const wrong = slots.flatMap(({ operationId, direction, validator }) => { + const declared = SCHEMA_REGISTRY[validator.schemaId]?.direction; + return declared === undefined || declared === direction + ? [] + : [`${operationId} ${validator.schemaId}: row ${declared}, used as ${direction}`]; + }); + + expect(wrong).toEqual([]); + }); + + it("gives every schema an operation or route uses a row at the boundary it is used", () => { + const wrong = [...usesBySchema()].flatMap(([schemaId, uses]) => { + const row = SCHEMA_REGISTRY[schemaId]; + const expected = boundaryFor(uses); + if (row === undefined) return [`${schemaId}: no FE-REG-SCHEMA row`]; + if (expected === undefined) { + return [`${schemaId}: used as ${[...uses].sort().join(" and ")}, which no boundary names`]; + } + return row.boundary === expected + ? [] + : [`${schemaId}: row ${row.boundary}, used as ${expected}`]; + }); + + expect(wrong).toEqual([]); + }); + + it("declares the unknown-field policy its validator applies", () => { + const wrong = slots.flatMap(({ operationId, validator }) => { + const declared = SCHEMA_REGISTRY[validator.schemaId]?.unknownFieldPolicy; + if (declared === undefined) return []; + const probed = probeUnknownFieldPolicy(validator); + return probed === declared + ? [] + : [`${operationId} ${validator.schemaId}: row ${declared}, validator ${probed}`]; + }); + + expect(wrong).toEqual([]); + }); +}); diff --git a/tests/unit/second-api-feature-registries.test.ts b/tests/unit/second-api-feature-registries.test.ts index e2a8ba94..2dc6ba0d 100644 --- a/tests/unit/second-api-feature-registries.test.ts +++ b/tests/unit/second-api-feature-registries.test.ts @@ -13,85 +13,138 @@ import { linkFixtureNodeModules } from "../../scripts/lib/fixture-node-modules.t * baseline stay as they are. This writes one such feature (plus the bounded * context it declares, so the check survives the sample's removal) into a copy * of the repository and runs the production generator and `check-registries`. + * 0929/07-03. The feature also owns a route with its own search schema and its + * own loading surface name, the values FE-REG-ROUTE once kept in a central + * allowlist. + * 1101/16-01. And an invalidation topic, namespace and edge: every feature + * with server state has them, and adding them is additive. */ const FEATURE_ID = "second-api-feature"; const CONTEXT_ID = "second-api-context"; +const TOPIC_ID = "qinv.01kb3m8q2v6t4r9s1n5p7c0w"; -const FEATURE_CONTRACT = `import { defineRestOperation } from "../../../contracts/api-operations.ts"; -import type { InstalledBoundaryMapper } from "../../../contracts/boundary-mapper.ts"; -import { mappingFailure, mappingSuccess } from "../../../contracts/boundary-mapper.ts"; -import { runtimeSchemaCodecFromValidator } from "../../../contracts/schema-registry.ts"; +const FEATURE_CONTRACT = `import { + PLACEHOLDER_CONTRACT_PACKAGE_DIGEST, + PLACEHOLDER_CONTRACT_PACKAGE_REVISION, + PLACEHOLDER_CONTRACT_PACKAGE_VERSION, +} from "../../../contracts/deployment-admission.ts"; +import type { + InstalledContractContribution, + InstalledHttpContract, +} from "../../../contracts/external-contract-runtime.ts"; +import { unvalidatedPayload } from "../../../contracts/unvalidated-payload.ts"; +import { defineQueryInvalidationTopic } from "../../../contracts/query-invalidation.ts"; +import { defineQueryNamespaceIdentity } from "../../../contracts/query-keys.ts"; const OWNER = "feature-frontend-second-api-feature"; +const SECOND_ITEM_TOPIC = defineQueryInvalidationTopic("${TOPIC_ID}"); +const SECOND_ITEM_NAMESPACE = defineQueryNamespaceIdentity("second-item", 1); const schema = (schemaId: string, boundary: string, direction: string) => Object.freeze({ schemaId, boundary, owner: OWNER, runtime: "zod", schemaVersion: 1, direction }); -const codec = (schemaId: string) => - runtimeSchemaCodecFromValidator({ - schemaId, - safeParse: (value: unknown) => Object.freeze({ success: true as const, data: value }), - }); +const unchecked = (schemaId: string) => + unvalidatedPayload(schemaId, "registry fixture: only check-registries reads it"); +const SECOND_CONTRACT_PACKAGE = Object.freeze({ + packageId: "@org-contracts/second-api", + version: PLACEHOLDER_CONTRACT_PACKAGE_VERSION, + digest: PLACEHOLDER_CONTRACT_PACKAGE_DIGEST, + runtimeProtocolVersion: 1 as const, + sourceRevision: PLACEHOLDER_CONTRACT_PACKAGE_REVISION, +}); + +const ROUTES = Object.freeze({ + SECOND_ITEM_LIST: Object.freeze({ + routeId: "SECOND_ITEM_LIST", + path: "/second-api/items", + paramsSchema: null, + searchSchema: "SecondItemListQuery", + access: "public", + loadingSurface: "second-item-list", + errorSurface: "feature-boundary", + chunkId: "route-second-item-list", + title: "Second items", + navigationLabel: null, + navigationOrder: null, + }), +}); + +// 15-01. Declaration half: what the shell reads at boot. export const SECOND_API_CONTRACT = Object.freeze({ featureId: "${FEATURE_ID}", - routes: {}, - routeRuntimeContracts: {}, - apiOperations: Object.freeze({ - GET_SECOND_ITEM: defineRestOperation({ - method: "GET", - path: "/api/second-items/{itemId}", - operationId: "GET_SECOND_ITEM", - auth: "none", - timeoutMs: null, - idempotency: "safe", - retry: "runtime", - requestSource: "none", - requestSchema: "SecondItemRequest", - responseSchema: "SecondItemPayload", - owner: OWNER, - contractVersion: 2, - protocol: "REST", - semantics: "QUERY", - replayPolicy: "SAFE", - idempotencyKeyPolicy: "NONE", - mapperId: "SecondItemMapper", - successStatuses: [200], - responseMediaTypes: ["application/json"], - maxResponseBytes: 16_384, - providerId: "PRIMARY_API", - authProfileId: "ANONYMOUS", - csrfProfileId: "NO_CSRF_BEARER", - pathSchema: "SecondItemParams", - pathParameterNames: ["itemId"], - maxEncodedSearchBytes: 0, + routes: ROUTES, + routeRuntimeContracts: Object.freeze({ + SECOND_ITEM_LIST: Object.freeze({ + routeId: "SECOND_ITEM_LIST", + moduleId: "second-item-list-page", + paramsCodec: "none", + searchCodec: "SecondItemListQuery", }), }), - invalidation: { topics: Object.freeze([]), namespaces: Object.freeze([]), edges: Object.freeze([]) }, - topicVersions: Object.freeze([]), - schemas: Object.freeze({ - SecondItemParams: schema("SecondItemParams", "api-request", "REQUEST"), - SecondItemRequest: schema("SecondItemRequest", "api-request", "REQUEST"), - SecondItemPayload: schema("SecondItemPayload", "api-response", "RESPONSE"), - }), - runtimeSchemas: Object.freeze({ - SecondItemParams: codec("SecondItemParams"), - SecondItemRequest: codec("SecondItemRequest"), - SecondItemPayload: codec("SecondItemPayload"), - }), - mappers: Object.freeze({ - SecondItemMapper: Object.freeze({ - mapperId: "SecondItemMapper", - mapperVersion: 1, - inputSchemaId: "SecondItemPayload", - outputContractId: "SecondItem", - owner: OWNER, - maxOutputItems: 1, - map: (value: unknown) => - value && typeof value === "object" ? mappingSuccess(value) : mappingFailure("MAPPING_INVARIANT_REJECTED"), - } satisfies InstalledBoundaryMapper), + invalidation: Object.freeze({ + topics: Object.freeze([SECOND_ITEM_TOPIC]), + namespaces: Object.freeze([SECOND_ITEM_NAMESPACE]), + edges: Object.freeze([ + Object.freeze({ topicId: SECOND_ITEM_TOPIC, namespace: SECOND_ITEM_NAMESPACE }), + ]), }), + topicVersions: Object.freeze([ + Object.freeze({ topicId: SECOND_ITEM_TOPIC, topicVersion: 1 }), + ]), + contractPackages: Object.freeze([SECOND_CONTRACT_PACKAGE]), } as const); + +// Runtime half, loaded with feature-runtime.ts. +export const SECOND_API_SCHEMAS = Object.freeze({ + SecondItemListQuery: schema("SecondItemListQuery", "route-search", "REQUEST"), + SecondItemParams: schema("SecondItemParams", "api-request", "REQUEST"), + SecondItemPayload: schema("SecondItemPayload", "api-response", "RESPONSE"), + // 1103/16-04. FE-REG-API's problemSchema references a row too. + SecondItemProblem: schema("SecondItemProblem", "api-problem", "RESPONSE"), +} as const); + +export const SECOND_API_CONTRIBUTION: InstalledContractContribution = Object.freeze({ + contributionId: "second-api-feature-http-v1", + featureId: "${FEATURE_ID}", + source: Object.freeze({ kind: "EXTERNAL_PACKAGE" as const, package: SECOND_CONTRACT_PACKAGE }), + http: Object.freeze([ + Object.freeze({ + contract: Object.freeze({ + operationId: "GET_SECOND_ITEM", + method: "GET" as const, + pathTemplate: "/api/second-items/{itemId}", + inputValidator: unchecked("SecondItemParams"), + outputValidator: unchecked("SecondItemPayload"), + problemValidator: unchecked("SecondItemProblem"), + acceptedStatuses: Object.freeze([200]), + emptyBodyStatuses: Object.freeze([]), + retrySemantics: "SAFE" as const, + requestBody: "NONE" as const, + responseBody: "REQUIRED_JSON" as const, + responseEnvelope: "ENVELOPE_V1" as const, + commandRecovery: null, + commandEffect: null, + projectRequest: (input: unknown) => + Object.freeze({ + pathValues: Object.freeze({ itemId: String((input as { itemId: string }).itemId) }), + queryEntries: Object.freeze([]), + body: null, + }), + }), + frontend: Object.freeze({ + policyId: "SECOND_ITEM_V1", + requestByteLimit: 0, + responseByteLimit: 16_384, + totalDeadlineMs: 10_000, + retryBudget: 0 as const, + authProfileId: "ANONYMOUS", + diagnosticsOperation: "second.item", + }), + }), + ]) as readonly InstalledHttpContract[], + events: Object.freeze([]), +}); `; const FEATURE_MODULE = `import { defineFeatureModule } from "../feature-module.ts"; @@ -103,11 +156,23 @@ export const FEATURE_CONTEXT_ID = "${CONTEXT_ID}"; export const FEATURE_MODULE = defineFeatureModule({ id: FEATURE_MODULE_ID, contracts: SECOND_API_CONTRACT, - routes: {}, - adapters: [], - runtimes: [], + routes: SECOND_API_CONTRACT.routes, messages: {}, - contractContributions: [], + loadRuntime: async () => (await import("./feature-runtime.ts")).FEATURE_RUNTIME, +} as const); +`; + +const FEATURE_RUNTIME = `import { defineFeatureRuntime } from "../feature-module.ts"; +import { + SECOND_API_CONTRIBUTION, + SECOND_API_SCHEMAS, +} from "./contracts/second-api-contract.ts"; + +export const FEATURE_RUNTIME = defineFeatureRuntime({ + featureId: "${FEATURE_ID}", + schemas: SECOND_API_SCHEMAS, + adapters: [], + contractContributions: [SECOND_API_CONTRIBUTION], } as const); `; @@ -132,39 +197,46 @@ afterAll(async () => { await Promise.all(roots.map((root) => rm(root, { recursive: true, force: true }))); }); -describe("adding a feature with an API operation (F-3, 09-07)", () => { - it("passes check-registries without edits outside the feature and its context", async () => { - const root = await mkdtemp(path.join(tmpdir(), "second-api-feature-")); - roots.push(root); - // scripts/check-diagnostics.ts is a FE-REG-TELEMETRY consumer path. - for (const entry of [ - "src", - "config/contracts", - "schemas/artifacts", - "scripts/check-diagnostics.ts", - ]) { - await cp(path.resolve(entry), path.join(root, entry), { recursive: true }); - } - await linkFixtureNodeModules(root); - const files: Readonly> = { - [`src/contexts/${CONTEXT_ID}/context-module.ts`]: CONTEXT_MODULE, - [`src/features/${FEATURE_ID}/feature-module.ts`]: FEATURE_MODULE, - [`src/features/${FEATURE_ID}/context-routes.ts`]: CONTEXT_ROUTES, - [`src/features/${FEATURE_ID}/contracts/second-api-contract.ts`]: FEATURE_CONTRACT, - [`src/features/${FEATURE_ID}/adapters/second-api-gateway.ts`]: FEATURE_GATEWAY, - }; - for (const [file, content] of Object.entries(files)) { - await mkdir(path.dirname(path.join(root, file)), { recursive: true }); - await writeFile(path.join(root, file), content); - } +/** A copy of the repository with the second feature written into it. */ +async function repositoryWithSecondFeature(featureContract = FEATURE_CONTRACT) { + const root = await mkdtemp(path.join(tmpdir(), "second-api-feature-")); + roots.push(root); + // scripts/check-diagnostics.ts is a FE-REG-TELEMETRY consumer path. + for (const entry of [ + "src", + "config/contracts", + "schemas/artifacts", + "scripts/check-diagnostics.ts", + ]) { + await cp(path.resolve(entry), path.join(root, entry), { recursive: true }); + } + await linkFixtureNodeModules(root); + const files: Readonly> = { + [`src/contexts/${CONTEXT_ID}/context-module.ts`]: CONTEXT_MODULE, + [`src/features/${FEATURE_ID}/feature-module.ts`]: FEATURE_MODULE, + [`src/features/${FEATURE_ID}/feature-runtime.ts`]: FEATURE_RUNTIME, + [`src/features/${FEATURE_ID}/context-routes.ts`]: CONTEXT_ROUTES, + [`src/features/${FEATURE_ID}/contracts/second-api-contract.ts`]: featureContract, + [`src/features/${FEATURE_ID}/adapters/second-api-gateway.ts`]: FEATURE_GATEWAY, + }; + for (const [file, content] of Object.entries(files)) { + await mkdir(path.dirname(path.join(root, file)), { recursive: true }); + await writeFile(path.join(root, file), content); + } - const generated = spawnSync( - process.execPath, - [path.resolve("scripts/generate-product-feature-index.ts"), `--root=${root}`], - { encoding: "utf8" }, - ); - expect(generated.stderr).toBe(""); - expect(generated.status).toBe(0); + const generated = spawnSync( + process.execPath, + [path.resolve("scripts/generate-product-feature-index.ts"), `--root=${root}`], + { encoding: "utf8" }, + ); + expect(generated.stderr).toBe(""); + expect(generated.status).toBe(0); + return root; +} + +describe("adding a feature with an API operation, a route and an invalidation topic (F-3, 09-07, 0929/07-03, 1101/16-01)", () => { + it("passes check-registries without edits outside the feature and its context", async () => { + const root = await repositoryWithSecondFeature(); const checked = spawnSync( process.execPath, @@ -176,8 +248,48 @@ describe("adding a feature with an API operation (F-3, 09-07)", () => { expect(checked.status).toBe(0); const report = JSON.parse( await readFile(path.join(root, "artifacts/quality/registries.json"), "utf8"), - ) as { registries: { registryId: string; rows: Record }[] }; + ) as { + registries: { registryId: string; rows: Record }[]; + compatibility: { changes: { registryId: string; field: string; impact: string }[] }; + }; const api = report.registries.find(({ registryId }) => registryId === "FE-REG-API"); expect(Object.keys(api?.rows ?? {})).toContain("GET_SECOND_ITEM"); + const routes = report.registries.find(({ registryId }) => registryId === "FE-REG-ROUTE"); + expect(routes?.rows.SECOND_ITEM_LIST).toMatchObject({ + searchSchema: "SecondItemListQuery", + loadingSurface: "second-item-list", + }); + const graph = report.registries.find( + ({ registryId }) => registryId === "FE-REG-QUERY-INVALIDATION", + ); + expect(graph?.rows["invalidation-graph"]).toMatchObject({ + topics: expect.arrayContaining([TOPIC_ID]), + }); + expect( + report.compatibility.changes + .filter(({ registryId }) => registryId === "FE-REG-QUERY-INVALIDATION") + .map(({ field, impact }) => [field, impact]), + ).toEqual([ + ["edges", "additive"], + ["namespaces", "additive"], + ["topics", "additive"], + ]); + }, 60_000); + + it("names the operation and the profile when the auth profile id is wrong (1103/09-07)", async () => { + const root = await repositoryWithSecondFeature( + FEATURE_CONTRACT.replace('authProfileId: "ANONYMOUS"', 'authProfileId: "SECOND_UNKNOWN"'), + ); + + const checked = spawnSync( + process.execPath, + [path.resolve("scripts/check-registries.ts")], + { cwd: root, encoding: "utf8" }, + ); + + expect(checked.status).toBe(1); + expect(checked.stderr).toContain( + `${FEATURE_ID}/GET_SECOND_ITEM: unknown authProfileId SECOND_UNKNOWN`, + ); }, 60_000); }); diff --git a/tests/unit/service-worker-build-output.test.ts b/tests/unit/service-worker-build-output.test.ts new file mode 100644 index 00000000..0ec124e3 --- /dev/null +++ b/tests/unit/service-worker-build-output.test.ts @@ -0,0 +1,194 @@ +import { spawnSync } from "node:child_process"; +import { + access, + mkdir, + mkdtemp, + readFile, + rm, + symlink, + writeFile, +} from "node:fs/promises"; +import { tmpdir } from "node:os"; +import path from "node:path"; + +import { afterAll, beforeAll, describe, expect, it } from "vitest"; + +import { generateRuntimeConfig } from "../../scripts/generate-runtime-config.ts"; +import { + type FixtureBuilds, + prepareFixtureBuilds, + removeFixtureBuilds, +} from "../e2e/support/fixture-builds.ts"; +import { + ACTIVE_VALUE, + turnOnServiceWorker, +} from "../e2e/support/service-worker-builds.ts"; + +/** + * 0929/06-01. Step 6 of `scripts/build-frontend.ts`, the Service Worker Vite + * build, must not change the app output. Vite copies `public/` into `outDir` + * unless the config turns it off, so the worker build replaced the profile + * `dist/config.json` from step 4 with `public/config.json` (local, demo auth, + * loopback API, root release manifest). The build and `verify-release` passed; + * only release admission refused it. + * + * The defect is in how two Vite runs share `dist`, not in one function, so this + * runs the real build over a temp copy with the worker on (one build, ~2s). + * A check of `publicDir === false` on the config object would only restate the + * fix, and the config cannot load without the inputs step 5 generates. + */ +const PROFILE = Object.freeze({ + APP_PROFILE: "production", + VITE_ROUTER_BASE_PATH: "/app/", +}); +// prepareFixtureBuilds sets VITE_BUILD_ID and RELEASE_ID to `-`. +const BUILD_ID = "sw-profile-active"; + +let builds: FixtureBuilds<"active"> | undefined; + +beforeAll(async () => { + builds = await prepareFixtureBuilds("sw-profile", [ + { + name: "active", + env: PROFILE, + edit: turnOnServiceWorker, + }, + ]); +}, 180_000); + +afterAll(async () => { + await removeFixtureBuilds(builds); +}); + +describe("Service Worker build output (0929/06-01, 0929/06-02)", () => { + it("keeps the profile runtime config step 4 wrote", async () => { + const dist = builds!.dist.active; + // The worker build really ran; otherwise nothing below tests step 6. + await access(path.join(dist, "service-worker.js")); + + const shipped: unknown = JSON.parse( + await readFile(path.join(dist, "config.json"), "utf8"), + ); + expect(shipped).toEqual( + await generateRuntimeConfig("production", { + ...process.env, + ...PROFILE, + VITE_BUILD_ID: BUILD_ID, + RELEASE_ID: BUILD_ID, + }), + ); + }); + + // 0929/06-02. Under /app/ the worker must precache /app/assets/... and know + // /app/config.json; root URLs 404 at install and the worker never installs. + it("gives the worker URLs under the router base path", async () => { + const generated = (await import( + path.join( + builds!.root, + ".generated/frontend-runtime/service-worker-assets.ts", + ) + )) as { SERVICE_WORKER_ASSETS: { assets: readonly { url: string }[] } }; + const urls = generated.SERVICE_WORKER_ASSETS.assets.map((asset) => asset.url); + expect(urls.length).toBeGreaterThan(0); + expect(urls.filter((url) => !url.startsWith("/app/assets/"))).toEqual([]); + + const worker = await readFile( + path.join(builds!.dist.active, "service-worker.js"), + "utf8", + ); + // Property names survive minification; the quote style does not. + expect( + /runtimeConfigUrl:\s*["'`]([^"'`]*)["'`]/u.exec(worker)?.[1], + ).toBe("/app/config.json"); + }); +}); + +// 0929/06-05. A new worker and the self-unregistering one are the only way to +// recover a client without a page. Served from an edge that caches root `.js` +// for long, they stay out of reach for that TTL, so a build that ships a +// worker has its script's Cache-Control checked like the page's. +describe("worker script hosting headers (0929/06-05)", () => { + async function verifyHosting(workerCacheControl: string) { + const root = builds!.root; + await rm(path.join(root, "dist"), { recursive: true, force: true }); + await symlink(builds!.dist.active, path.join(root, "dist")); + const fixture = JSON.parse( + await readFile("config/hosting/response-headers.fixture.json", "utf8"), + ) as { responses: Record> }; + fixture.responses["serviceWorker"]!["cache-control"] = workerCacheControl; + await writeFile( + path.join(root, "config/hosting/response-headers.fixture.json"), + JSON.stringify(fixture), + ); + const env: NodeJS.ProcessEnv = { ...process.env }; + delete env["HOSTING_BASE_URL"]; + const result = spawnSync(process.execPath, ["scripts/verify-hosting-headers.ts"], { + cwd: root, + encoding: "utf8", + env, + }); + const record = JSON.parse( + await readFile(path.join(root, "artifacts/release/hosting-headers.json"), "utf8"), + ) as { results: { surface: string; header: string; passed: boolean }[] }; + return { + status: result.status, + stderr: result.stderr, + failed: record.results + .filter((entry) => !entry.passed) + .map((entry) => `${entry.surface} ${entry.header}`), + }; + } + + it("leaves the declared worker headers UNVERIFIED, not failed", async () => { + const result = await verifyHosting("no-cache"); + expect(result.failed, result.stderr).toEqual([]); + expect(result.status).toBe(3); + }); + + it("fails when the worker script is served with a long TTL", async () => { + const result = await verifyHosting("public, max-age=31536000, immutable"); + expect(result.failed).toEqual(["serviceWorker cache-control"]); + expect(result.status).toBe(1); + }); +}); + +// 0929/06-04, 0929/11-03. The worker fixtures must also run in a product that +// already ships the worker: an inactive selection is turned on, and an ACTIVE +// one is kept so the specs exercise that product's own handlers. +describe("turnOnServiceWorker (0929/06-04, 0929/11-03)", () => { + const productActive = `{ + mode: "ACTIVE", + scriptPath: "service-worker.js", + handlers: ["PWA_STATIC_ASSETS", "OFFLINE_SYNC_WAKEUP"], +}`; + it.each([ + ["null", "null", ACTIVE_VALUE], + [ + "REMOVE_REGISTRATION", + `{ + mode: "REMOVE_REGISTRATION", + scriptPath: "service-worker.js", +}`, + ACTIVE_VALUE, + ], + ["ACTIVE", productActive, productActive], + ])("turns a %s selection on", async (_label, value, expected) => { + const root = await mkdtemp(path.join(tmpdir(), "sw-select-")); + try { + const file = path.join( + root, + "src/features/product-capabilities.ts", + ); + await mkdir(path.dirname(file), { recursive: true }); + const around = (selection: string) => + `const WEB_WORKERS = Object.freeze([]);\n\nconst SERVICE_WORKER: InstalledServiceWorkerSelection | null = ${selection};\n\nconst OFFLINE_COMMANDS: X | null = null;\n`; + await writeFile(file, around(value)); + + await turnOnServiceWorker(root); + + expect(await readFile(file, "utf8")).toBe(around(expected)); + } finally { + await rm(root, { recursive: true, force: true }); + } + }); +}); diff --git a/tests/unit/service-worker-runtime.test.ts b/tests/unit/service-worker-runtime.test.ts index 64cb3fd5..bd57ca01 100644 --- a/tests/unit/service-worker-runtime.test.ts +++ b/tests/unit/service-worker-runtime.test.ts @@ -768,6 +768,45 @@ describe("service worker worker-side protocol", () => { expect(fixture.scope.skipWaiting).toHaveBeenCalledTimes(1); }); + // 1101/06-04 (M3, M9). An activation nonce is single-use, and only a client + // the worker asked to drain can acknowledge it. + it("refuses a reused nonce and a drain reply from a client it did not ask", async () => { + const fixture = workerScope(); + const runtime = createServiceWorkerRuntime(fixture.scope as never, { + identity, + handlers: [], + manifest: null, + runtimeConfigUrl: "/runtime-config.json", + releaseManifestUrl: "/release-manifest.json", + }); + const message = (kind: "ACTIVATE_REQUEST" | "CLIENT_DRAINED") => + createServiceWorkerMessage({ + kind, + sourceBuildId: "page-build", + targetBuildId: "worker-build", + nonce: "activation-1", + }); + + const activation = runtime.onActivateRequest(message("ACTIVATE_REQUEST")); + let settled = false; + void activation.then(() => { + settled = true; + }); + await Promise.resolve(); + runtime.onClientMessage(message("CLIENT_DRAINED"), "client-a"); + runtime.onClientMessage(message("CLIENT_DRAINED"), "client-unasked"); + for (let turn = 0; turn < 10; turn += 1) await Promise.resolve(); + expect(settled).toBe(false); + expect(fixture.scope.skipWaiting).not.toHaveBeenCalled(); + + runtime.onClientMessage(message("CLIENT_DRAINED"), "client-b"); + await expect(activation).resolves.toBe("ACCEPTED"); + await expect( + runtime.onActivateRequest(message("ACTIVATE_REQUEST")), + ).resolves.toBe("REJECTED"); + expect(fixture.scope.skipWaiting).toHaveBeenCalledTimes(1); + }); + it("enumerates uncontrolled window clients before an activation drain", async () => { const fixture = workerScope(); const runtime = createServiceWorkerRuntime(fixture.scope as never, { @@ -1039,6 +1078,41 @@ describe("service worker static asset install", () => { return { result, put }; } + // 1101/06-04 (M1). The precache holds only public assets: no cookie or + // credential goes with the request, a redirect is refused rather than + // followed to another resource, and the HTTP cache is bypassed. + it("fetches each asset without credentials, redirects or the HTTP cache", async () => { + const fetcher = vi.fn( + async (_url: RequestInfo | URL, _init?: RequestInit) => + new Response(new Uint8Array([1]), { + status: 200, + headers: { "content-type": "text/javascript" }, + }), + ); + await expect( + installStaticAssets( + { + ...manifest, + assets: [{ ...manifest.assets[0]!, contentType: "text/javascript" }], + }, + { + caches: { + open: vi.fn(async () => ({ put: vi.fn(async () => {}) }) as unknown as Cache), + delete: vi.fn(async () => true), + }, + fetcher, + digest: vi.fn(async () => manifest.assets[0]!.sha256), + }, + ), + ).resolves.toMatchObject({ kind: "INSTALLED" }); + expect(fetcher).toHaveBeenCalledOnce(); + expect(fetcher.mock.calls[0]![1]).toMatchObject({ + cache: "no-store", + credentials: "omit", + redirect: "error", + }); + }); + it("installs JavaScript served under a JavaScript MIME synonym (R-6.5)", async () => { const { result, put } = installOne( new Response(new Uint8Array([1]), { @@ -1339,6 +1413,31 @@ describe("service worker static asset install", () => { await controller.stop(); }); + // 1101/06-04 (N8). A first install has no active worker to replace. It + // activates on its own, so it is never announced as an update waiting. + it("does not announce a first install as an update waiting", async () => { + const browser = pageContainer({ controlled: true }); + const controller = pageController(browser.container); + await expect(controller.start()).resolves.toMatchObject({ kind: "ACTIVE" }); + const updateWaiting = vi.fn(); + controller.onUpdateWaiting?.(updateWaiting); + const registration = browser.registration as unknown as EventTarget & { + installing: ServiceWorker | null; + waiting: ServiceWorker | null; + active: ServiceWorker | null; + }; + registration.active = null; + const first = fakeWorker([], "installing"); + registration.installing = first as unknown as ServiceWorker; + registration.dispatchEvent(new Event("updatefound")); + registration.installing = null; + registration.waiting = first as unknown as ServiceWorker; + setWorkerState(first, "installed"); + + expect(updateWaiting).not.toHaveBeenCalled(); + await controller.stop(); + }); + it("accepts a post-commit reply after the waiting worker was promoted (R-6.1)", async () => { const browser = pageContainer({ waiting: true }); const controller = pageController(browser.container); diff --git a/tests/unit/service-worker-web-push-remediation.test.ts b/tests/unit/service-worker-web-push-remediation.test.ts index 9a163265..dfb9efc9 100644 --- a/tests/unit/service-worker-web-push-remediation.test.ts +++ b/tests/unit/service-worker-web-push-remediation.test.ts @@ -125,6 +125,31 @@ describe("SW-02 the generator and the decoder share one path grammar", () => { } }); + // 0929/06-02. dist is served under the router base path; a root URL made + // the worker's install request /assets/... and fail under /app/. + it("puts every asset URL under the router base path", async () => { + const { collectStaticAssets } = await import( + "../../scripts/generate-service-worker-assets.ts" + ); + const root = await distWith({ + "assets/index-abcdefgh.js": "entry", + "assets/nested/chunk-abcdefgz.css": "style", + }); + + const manifest = await collectStaticAssets( + root, + "build-1", + "release-1", + "/app/", + ); + + expect(manifest.assets.map((asset) => asset.url)).toEqual([ + "/app/assets/index-abcdefgh.js", + "/app/assets/nested/chunk-abcdefgz.css", + ]); + expect(decodeStaticAssetManifest(manifest)).toMatchObject({ ok: true }); + }); + it.each([ { label: "an at sign", name: "bad@name-abcdefgh.js" }, { label: "a space", name: "bad name-abcdefgh.js" }, diff --git a/tests/unit/storage-registry.test.ts b/tests/unit/storage-registry.test.ts index 2942d532..44e03db1 100644 --- a/tests/unit/storage-registry.test.ts +++ b/tests/unit/storage-registry.test.ts @@ -11,7 +11,7 @@ import { type StorageKeyInput, } from "../../src/contracts/storage-keys.ts"; -type StorageFailureMode = "none" | "quota" | "security"; +type StorageFailureMode = "none" | "quota" | "firefox-quota" | "security"; function createStorage(options: { initial?: Readonly>; @@ -54,6 +54,10 @@ function throwFor(mode: StorageFailureMode): void { if (mode === "quota") { throw new DOMException("private quota detail", "QuotaExceededError"); } + if (mode === "firefox-quota") { + // Older Firefox names the quota error this way, with code 1014. + throw new DOMException("private quota detail", "NS_ERROR_DOM_QUOTA_REACHED"); + } if (mode === "security") { throw new DOMException("private security detail", "SecurityError"); } @@ -164,6 +168,55 @@ describe("storage registry", () => { ).toThrow("Unsupported client storage migration policy"); }); + // 05-01. The cross-context adapter writes raw wire JSON to this physical + // key. StoragePort must refuse the key instead of discarding that value as + // a corrupt envelope or overwriting it with one. + it("refuses the externally owned pulse key without touching its value", () => { + const pulse = STORAGE_REGISTRY.CACHE_INVALIDATION_PULSE; + const rawPulse = JSON.stringify({ protocolVersion: 1, topic: "t" }); + const { storage, values, setItem, removeItem } = createStorage({ + initial: { [pulse.physicalKey]: rawPulse }, + }); + const adapter = createBrowserStorageAdapter({ localStorage: storage }); + + expect(adapter.read("CACHE_INVALIDATION_PULSE")).toMatchObject({ + ok: false, + error: { code: "CACHE_INVALIDATION_PULSE_READ_UNAVAILABLE" }, + }); + expect(adapter.write("CACHE_INVALIDATION_PULSE", "hello")).toMatchObject({ + ok: false, + }); + expect(adapter.remove("CACHE_INVALIDATION_PULSE")).toMatchObject({ + ok: false, + }); + expect(setItem).not.toHaveBeenCalled(); + expect(removeItem).not.toHaveBeenCalled(); + expect(values.get(pulse.physicalKey)).toBe(rawPulse); + + expect(pulse.physicalKey).toBe("ca-frontend:cache-invalidation:v1:pulse"); + expect(pulse).toMatchObject({ backend: "external", valueCodec: "none" }); + expect(() => getStorageDefinition("CACHE_INVALIDATION_PULSE")).toThrow( + "Externally owned storage key: CACHE_INVALIDATION_PULSE", + ); + }); + + it("rejects a value codec on an externally owned key", () => { + expect(() => + defineStorageKey({ + logicalName: "EXTERNAL_WITH_CODEC", + scope: "cache", + name: "external-with-codec", + backend: "external", + classification: "opaque-cache", + schemaVersion: 1, + valueCodec: "opaque-string-v1", + ttl: null, + migration: "discard", + quotaFallback: "no-persist", + }), + ).toThrow("Externally owned storage keys have no StoragePort codec"); + }); + it("round-trips public preferences through the adapter", () => { const { storage: localStorage } = createStorage(); const adapter = createBrowserStorageAdapter({ localStorage }); @@ -220,6 +273,7 @@ describe("storage registry", () => { context: { operation: "write:COLOR_SCHEME", error_kind: "STORAGE_QUOTA_EXCEEDED", + reason: "QUOTA_EXCEEDED", }, }); expect(JSON.stringify(record.mock.calls)).not.toContain("dark"); @@ -228,6 +282,22 @@ describe("storage registry", () => { ); }); + // 2026-11-01 05-06. The second quota name was in the adapter's list but no + // test sent it, so dropping it went unseen. + it("falls back to memory on Firefox's quota error name too", () => { + const { storage: localStorage } = createStorage({ + writeFailure: "firefox-quota", + }); + const adapter = createBrowserStorageAdapter({ localStorage }); + + expect(adapter.write("COLOR_SCHEME", "dark")).toMatchObject({ + ok: false, + fallback: "memory", + error: { kind: "STORAGE_QUOTA_EXCEEDED" }, + }); + expect(adapter.read("COLOR_SCHEME")).toEqual({ ok: true, value: "dark" }); + }); + it("discards data from a previous schema version", () => { const { storage: localStorage, values, removeItem } = createStorage({ initial: { @@ -258,7 +328,7 @@ describe("storage registry", () => { }); it.each([ - ["malformed JSON", "{private malformed value"], + ["malformed JSON", "{private malformed value", "VALUE_REJECTED"], [ "invalid envelope", JSON.stringify({ @@ -267,11 +337,12 @@ describe("storage registry", () => { value: "dark", unexpected: "private", }), + "VALUE_REJECTED", ], - ["oversized record", "x".repeat(512)], + ["oversized record", "x".repeat(512), "SIZE_LIMIT_EXCEEDED"], ])( "removes a %s once and suppresses it when native cleanup fails", - (_label, raw) => { + (_label, raw, reason) => { const physicalKey = STORAGE_REGISTRY.COLOR_SCHEME.physicalKey; const { storage, getItem, removeItem } = createStorage({ initial: { [physicalKey]: raw }, @@ -294,6 +365,16 @@ describe("storage registry", () => { }); expect(getItem).toHaveBeenCalledOnce(); expect(removeItem).toHaveBeenCalledOnce(); + // 05-02. A discarded value must not read as "storage unavailable". + expect(record).toHaveBeenCalledWith({ + level: "warn", + eventId: "storage.operation.failed", + context: { + operation: "discard:COLOR_SCHEME", + error_kind: "STORAGE_UNAVAILABLE", + reason, + }, + }); expect(JSON.stringify(record.mock.calls)).not.toMatch( /private|malformed|unexpected/, ); @@ -335,6 +416,41 @@ describe("storage registry", () => { expect(removeItem).toHaveBeenCalledWith(expiring.physicalKey); }); + // 2026-11-01 05-06. A record is expired at its expiry instant, not after it. + it.each([ + [100, undefined], + [101, "private-expiring"], + ])("reads a record expiring at %i at time 100 as %s", (expiresAt, value) => { + const expiring = defineStorageKey({ + logicalName: "EXPIRING_PREFERENCE", + scope: "preference", + name: "expiring", + backend: "localStorage", + classification: "public-preference", + schemaVersion: 1, + valueCodec: "opaque-string-v1", + ttl: 10, + migration: "discard", + quotaFallback: "memory", + }); + const { storage } = createStorage({ + initial: { + [expiring.physicalKey]: serializedEnvelope("private-expiring", { + expiresAt, + }), + }, + }); + const adapter = createBrowserStorageAdapter({ + localStorage: storage, + now: () => 100, + resolveDefinition: definitionResolver({ + EXPIRING_PREFERENCE: expiring, + }), + }); + + expect(adapter.read("EXPIRING_PREFERENCE")).toEqual({ ok: true, value }); + }); + it("prioritizes a failed-write memory envelope over stale persistent data and expires it", () => { let timestamp = 100; const expiring = defineStorageKey({ @@ -500,6 +616,11 @@ describe("storage registry", () => { code: "CHUNK_RELOAD_GUARD_WRITE_SIZE_LIMIT_EXCEEDED", }, }); + expect(record).toHaveBeenCalledWith( + expect.objectContaining({ + context: expect.objectContaining({ reason: "SIZE_LIMIT_EXCEEDED" }), + }), + ); expect(setItem).not.toHaveBeenCalled(); expect(JSON.stringify({ result, calls: record.mock.calls })).not.toContain( secret, diff --git a/tests/unit/tanstack-cache-coordinator.test.ts b/tests/unit/tanstack-cache-coordinator.test.ts index aa8aa888..dc89ac2e 100644 --- a/tests/unit/tanstack-cache-coordinator.test.ts +++ b/tests/unit/tanstack-cache-coordinator.test.ts @@ -11,6 +11,7 @@ import { indexInvalidationRegistry, } from "../../src/contracts/query-invalidation.ts"; import { + createBoundQueryKey, createRuntimeIdentityRegistry, defineQueryNamespaceIdentity, type QueryNamespaceIdentity, @@ -344,6 +345,60 @@ describe("TanStack cross-context cache coordinator", () => { coordinator.dispose(); }); + /** + * 03-01 (E7). A save invalidates topics, and a topic reaches only registered + * namespaces. A bound query under any other namespace (a typo, a bumped + * version, a namespace left out of the registry) silently never refreshes, + * so the coordinator reports it once per namespace. + */ + it("reports a bound query whose namespace no registered topic reaches (03-01)", async () => { + const queryClient = createClient(); + const record = vi.fn(); + const coordinator = createTanStackCacheCoordinator({ + queryClient, + invalidationIndex: invalidationIndex(), + topicVersions: topicVersions(), + diagnostics: { record }, + }); + const typo = defineQueryNamespaceIdentity("resource-x", 1); + const bumpedOnly = defineQueryNamespaceIdentity("resource-a", 2); + const declaredStatic = defineQueryNamespaceIdentity("lookup-static", 1); + + queryClient.setQueryData(realBoundQueryKey(NAMESPACE_A), "registered"); + queryClient.setQueryData(realBoundQueryKey(typo), "typo"); + queryClient.setQueryData( + createBoundQueryKey(typo, "scope-fingerprint-0002", 1, "identity-token-again"), + "typo again", + ); + queryClient.setQueryData(realBoundQueryKey(bumpedOnly), "bumped"); + queryClient.setQueryData(["legacy-key", 1], "not a bound query"); + await queryClient.prefetchQuery({ + queryKey: realBoundQueryKey(declaredStatic), + queryFn: async () => "static lookup", + meta: { invalidation: "NONE" }, + }); + await new Promise((resolve) => setTimeout(resolve, 0)); + + expect(record).toHaveBeenCalledTimes(2); + expect(record).toHaveBeenCalledWith({ + level: "warn", + eventId: "cache.operation.failed", + context: { + operation: "unregistered-query-namespace", + error_kind: "QUERY_CACHE_FAILURE", + }, + }); + coordinator.dispose(); + + // A disposed coordinator stops watching the cache. + queryClient.setQueryData( + realBoundQueryKey(defineQueryNamespaceIdentity("resource-y", 1)), + "after dispose", + ); + await new Promise((resolve) => setTimeout(resolve, 0)); + expect(record).toHaveBeenCalledTimes(2); + }); + it("rejects an unregistered topic before opening a mutation lease", () => { const coordinator = createTanStackCacheCoordinator({ queryClient: createClient(), diff --git a/tests/unit/task3-selective-integration.test.ts b/tests/unit/task3-selective-integration.test.ts index 9a000c10..fcc47b9b 100644 --- a/tests/unit/task3-selective-integration.test.ts +++ b/tests/unit/task3-selective-integration.test.ts @@ -1,7 +1,9 @@ import { spawn } from "node:child_process"; +import { writeFileSync } from "node:fs"; import { lstat, mkdir, mkdtemp, readFile, readdir, rename, rm, writeFile } from "node:fs/promises"; import { tmpdir } from "node:os"; import path from "node:path"; +import { pathToFileURL } from "node:url"; import { afterEach, describe, expect, it } from "vitest"; @@ -15,6 +17,14 @@ import { generateCiWorkflow } from "../../scripts/generate-ci-workflow.ts"; import { validatePackageScriptGraph } from "../../scripts/lib/package-script-graph.ts"; const roots: string[] = []; +/** + * Test watchdog only, as in tests/integration/provider-guardian-transaction.test.ts. + * It bounds a hang. The wrapper has no protocol deadline for EOF, and a loaded + * host can take longer than a second just to start a child. + */ +const PROCESS_WATCHDOG_MS = 5_000; +/** The extra pipe on which spawnLoadedScopeWrapper reports the wrapper loaded. */ +const SCOPE_WRAPPER_LOADED_FD = 3; afterEach(async () => { await Promise.all(roots.splice(0).map((root) => rm(root, { recursive: true, force: true }))); @@ -154,23 +164,24 @@ describe("selective Task 3 contract closure", () => { const reportPath = path.join(root, "raw.json"); await writeFile(reportPath, "partial\n"); const identity = await lstat(reportPath); - const child = spawn(process.execPath, [ - path.resolve("scripts/lib/provider-scope-wrapper.ts"), + const child = spawnLoadedScopeWrapper(await mkdtemp(path.join(tmpdir(), "provider-scope-loader-")), [ "1", reportPath, String(identity.dev), String(identity.ino), - ], { stdio: ["pipe", "pipe", "pipe"] }); + ]); const completion = waitForChildResult(child); + await waitForScopeWrapperLoaded(child); + // Time to exit on its own, which it must not do before EOF. await new Promise((resolve) => setTimeout(resolve, 75)); expect(child.exitCode).toBeNull(); await expect(readFile(reportPath, "utf8")).resolves.toBe("partial\n"); - child.stdin.end(); - const result = await within(completion, 1_000, "provider scope EOF close"); + child.stdin!.end(); + const result = await within(completion, PROCESS_WATCHDOG_MS, "provider scope EOF close"); expect(result).toEqual({ code: 125, signal: null }); await expect(lstat(reportPath)).rejects.toMatchObject({ code: "ENOENT" }); await expect(readdir(root)).resolves.toEqual([]); - }); + }, PROCESS_WATCHDOG_MS * 3); it("tracks npm run-script dependencies instead of bypassing the graph", () => { expect(validatePackageScriptGraph({ root: "npm run-script missing" }, "root")) @@ -224,6 +235,43 @@ describe("selective Task 3 contract closure", () => { }); }); +/** + * 1103/10-01. Starts the unchanged scope wrapper through a loader that writes + * one byte to an extra pipe once the import has finished: by then the wrapper + * has opened its liveness channel and attached the EOF handler. Closing stdin + * at a fixed 75 ms put the child's whole start-up inside the EOF limit, and a + * loaded host failed the test with "EOF close timed out". The wrapper reads its + * launch identity from argv after the main module, so the loader takes the + * wrapper's place there. + */ +function spawnLoadedScopeWrapper( + loaderDirectory: string, + launchArguments: readonly string[], +): ReturnType { + roots.push(loaderDirectory); + const loader = path.join(loaderDirectory, "provider-scope-loaded.mjs"); + writeFileSync(loader, [ + 'import { closeSync, writeSync } from "node:fs";', + `await import(${JSON.stringify( + pathToFileURL(path.resolve("scripts/lib/provider-scope-wrapper.ts")).href, + )});`, + `writeSync(${SCOPE_WRAPPER_LOADED_FD}, "1");`, + `closeSync(${SCOPE_WRAPPER_LOADED_FD});`, + "", + ].join("\n")); + return spawn(process.execPath, [loader, ...launchArguments], { + stdio: ["pipe", "pipe", "pipe", "pipe"], + }); +} + +async function waitForScopeWrapperLoaded(child: ReturnType): Promise { + const loaded = (child.stdio as readonly unknown[])[SCOPE_WRAPPER_LOADED_FD] as NodeJS.ReadableStream; + await within(new Promise((resolve, reject) => { + loaded.once("data", () => resolve()); + loaded.once("end", () => reject(new Error("provider scope wrapper exited before it loaded"))); + }), PROCESS_WATCHDOG_MS, "provider scope wrapper start-up"); +} + async function waitForChildResult( child: ReturnType, ): Promise> { diff --git a/tests/unit/telemetry.test.ts b/tests/unit/telemetry.test.ts index c775767d..45a6c8a7 100644 --- a/tests/unit/telemetry.test.ts +++ b/tests/unit/telemetry.test.ts @@ -728,7 +728,7 @@ describe("collector keepalive budget (03-05)", () => { }); }); -describe("telemetry adapter send-rate limit (spec §27)", () => { +describe("telemetry adapter send-rate limit (scale-architecture.md §27)", () => { function harness(maxSendsPerMinute = 3) { let now = 0; const timers: Array<() => void> = []; diff --git a/tests/unit/two-feature-install-typecheck.test.ts b/tests/unit/two-feature-install-typecheck.test.ts index 756491d0..b19df20a 100644 --- a/tests/unit/two-feature-install-typecheck.test.ts +++ b/tests/unit/two-feature-install-typecheck.test.ts @@ -12,21 +12,14 @@ import { linkFixtureNodeModules } from "../../scripts/lib/fixture-node-modules.t * generated feature index, so the repository's own typecheck only ever sees * the features it ships. This installs two more into a copy of `src`, in a * context of their own so the check survives the sample's removal: one with a - * route, a runtime and both locales but no adapter, and one shaped differently - * on every composed axis (an adapter that needs telemetry, no routes, no - * runtime, one locale). It regenerates the index - * with the production generator and runs the app typecheck over the copy. + * route, route codecs and both locales but no adapter, and one shaped + * differently on every composed axis (an adapter that needs telemetry, no + * routes, no codecs, one locale). Each declares its executable half in a + * separate \`feature-runtime.ts\` loaded through \`loadRuntime\` (15-01). It + * regenerates the index with the production generator and runs the app + * typecheck over the copy. */ -const SECOND_FEATURE_MODULE = `import { defineFeatureAdapterContribution } from "../feature-adapter-contribution.ts"; -import { defineFeatureModule } from "../feature-module.ts"; - -type SecondFeatureInput = Readonly<{ ping(): string }>; - -declare module "../../application/ports/in/application-api.ts" { - interface ApplicationFeatureInputs { - "second-feature": SecondFeatureInput; - } -} +const SECOND_FEATURE_MODULE = `import { defineFeatureModule } from "../feature-module.ts"; export const FEATURE_MODULE_ID = "second-feature"; export const FEATURE_CONTEXT_ID = "two-feature-context"; @@ -37,7 +30,6 @@ export const FEATURE_MODULE = defineFeatureModule({ featureId: FEATURE_MODULE_ID, routes: {}, routeRuntimeContracts: {}, - apiOperations: {}, // Frozen empty arrays type as \`readonly never[]\`, not \`readonly []\`. invalidation: { topics: Object.freeze([]), @@ -45,24 +37,39 @@ export const FEATURE_MODULE = defineFeatureModule({ edges: Object.freeze([]), }, topicVersions: Object.freeze([]), - schemas: {}, - runtimeSchemas: {}, - mappers: {}, + contractPackages: Object.freeze([]), }, routes: {}, + messages: { "en-US": { "secondFeature.title": "Second feature" } }, + loadRuntime: async () => (await import("./feature-runtime.ts")).FEATURE_RUNTIME, +} as const); +`; + +const SECOND_FEATURE_RUNTIME = `import { defineFeatureAdapterContribution } from "../feature-adapter-contribution.ts"; +import { defineFeatureRuntime } from "../feature-module.ts"; + +type SecondFeatureInput = Readonly<{ ping(): string }>; + +declare module "../../application/ports/in/application-api.ts" { + interface ApplicationFeatureInputs { + "second-feature": SecondFeatureInput; + } +} + +export const FEATURE_RUNTIME = defineFeatureRuntime({ + featureId: "second-feature", + schemas: {}, adapters: [ defineFeatureAdapterContribution({ - featureId: FEATURE_MODULE_ID, + featureId: "second-feature", needs: ["telemetry"] as const, createInput: () => Object.freeze({ - featureId: FEATURE_MODULE_ID, + featureId: "second-feature", input: Object.freeze({ ping: () => "pong" }), }), }), ], - runtimes: [], - messages: { "en-US": { "secondFeature.title": "Second feature" } }, contractContributions: [], } as const); `; @@ -111,18 +118,18 @@ export const FEATURE_MODULE = defineFeatureModule({ searchCodec: "none", }, }, - apiOperations: {}, invalidation: { topics: [], namespaces: [], edges: [] }, topicVersions: [], - schemas: {}, - runtimeSchemas: {}, - mappers: {}, + contractPackages: [], }, routes: ROUTES, - adapters: [], - runtimes: [{ featureId: FEATURE_MODULE_ID, routeCodecs: {}, routeRuntime: {} }], messages: { "ko-KR": MESSAGES, "en-US": MESSAGES }, - contractContributions: [], + loadRuntime: async () => ({ + featureId: FEATURE_MODULE_ID, + schemas: {}, + adapters: [], + contractContributions: [], + }), } as const); `; @@ -152,6 +159,7 @@ describe("installing a second feature (09-01)", () => { "src/features/routed-feature/feature-module.ts": ROUTED_FEATURE_MODULE, "src/features/routed-feature/context-routes.ts": SECOND_FEATURE_ROUTES, "src/features/second-feature/feature-module.ts": SECOND_FEATURE_MODULE, + "src/features/second-feature/feature-runtime.ts": SECOND_FEATURE_RUNTIME, "src/features/second-feature/context-routes.ts": SECOND_FEATURE_ROUTES, }; for (const [file, content] of Object.entries(files)) { diff --git a/tests/unit/ungated-scripts.test.ts b/tests/unit/ungated-scripts.test.ts index ea917d96..99387efe 100644 --- a/tests/unit/ungated-scripts.test.ts +++ b/tests/unit/ungated-scripts.test.ts @@ -10,6 +10,7 @@ import { UNGATED_SCRIPTS_PATH, } from "../../scripts/lib/ungated-scripts.ts"; import { gatedTestPaths } from "../../scripts/lib/ungated-tests.ts"; +import { EXTREME_SCALE_GATES } from "../../scripts/verify-extreme-scale.ts"; /** * 12-04. Test files had an orphan check; package scripts did not. A `check:*` @@ -64,6 +65,17 @@ describe("ungated verification scripts", () => { }, ); + // 1101/12-05: the exclusion said only that the check can tell a developer + // the local copy is stale, which read as a reason to delete it. It stays + // because verify:extreme-scale runs it; if that stops, it can go. + it("names verify:extreme-scale as the user of check:feature-index", async () => { + const { exclusions } = await repositoryInputs(); + expect(EXTREME_SCALE_GATES).toContain("check:feature-index"); + expect( + exclusions.find(({ script }) => script === "check:feature-index")?.reason, + ).toContain("verify:extreme-scale"); + }); + it("rejects a check script that no gate reaches", () => { expect(ungatedScriptFailures(fixture)).toEqual([ `verification script is not reached by any CI gate command and is not in ${UNGATED_SCRIPTS_PATH}: check:orphan`, @@ -71,6 +83,20 @@ describe("ungated verification scripts", () => { ]); }); + // 12-05: scan:security:fixture stayed in package.json after FE-GATE-013 + // replaced it with check:security:fixtures, because scan: was not a + // verification family. + it("rejects a scan script that no gate reaches", () => { + expect( + ungatedScriptFailures({ + ...fixture, + scripts: { ...fixture.scripts, "scan:orphan": "node scripts/scan.ts" }, + }), + ).toContainEqual( + `verification script is not reached by any CI gate command and is not in ${UNGATED_SCRIPTS_PATH}: scan:orphan`, + ); + }); + it("counts a Vitest subset as gated only when a gate runs every path", () => { const failures = ungatedScriptFailures(fixture); expect(failures.join("\n")).not.toContain("check:subset"); diff --git a/tests/unit/visual-regression-tolerance.test.ts b/tests/unit/visual-regression-tolerance.test.ts new file mode 100644 index 00000000..ddd5ef8b --- /dev/null +++ b/tests/unit/visual-regression-tolerance.test.ts @@ -0,0 +1,26 @@ +import { describe, expect, it } from "vitest"; + +import visualConfig from "../../playwright.visual.config.ts"; + +// 11-03. Measured on this template's goldens: undoing the UI-04 fix changed +// 1,146 px of the wide shell, and the compact golden drifted 175 px from the +// code without failing. A 0.2% share of the image allowed 2,592 px on the +// wide shell, 985 px on the compact shell and 7,781 px on the platform +// overview, so the allowance grew with the page instead of covering only +// rasterization noise (VD-08 item 8). +const SMALLEST_MEASURED_REGRESSION_PX = 175; + +describe("visual regression tolerance", () => { + const screenshot = visualConfig.expect?.toHaveScreenshot; + + it("does not scale with the image size", () => { + expect(screenshot?.maxDiffPixelRatio).toBeUndefined(); + }); + + it("stays below the smallest real change measured", () => { + expect(screenshot?.maxDiffPixels).toBeGreaterThanOrEqual(0); + expect(screenshot?.maxDiffPixels).toBeLessThan( + SMALLEST_MEASURED_REGRESSION_PX, + ); + }); +}); diff --git a/tests/unit/web-push-worker-runtime.test.ts b/tests/unit/web-push-worker-runtime.test.ts index 0e3bc6d2..75877c65 100644 --- a/tests/unit/web-push-worker-runtime.test.ts +++ b/tests/unit/web-push-worker-runtime.test.ts @@ -7,7 +7,10 @@ import { import { createPushAssociationFenceStore } from "../../src/adapters/web-push/push-association-fence-store.ts"; import { createWebPushNotificationRegistry } from "../../src/adapters/web-push/notification-registry.ts"; import { createPushEventAdapter } from "../../src/adapters/web-push/inbound/push-event-adapter.ts"; -import { createNotificationClickAdapter } from "../../src/adapters/web-push/inbound/notification-click-adapter.ts"; +import { + createNotificationClickAdapter, + type WindowClientFacade, +} from "../../src/adapters/web-push/inbound/notification-click-adapter.ts"; import { createWebPushServiceWorkerRuntime } from "../../src/adapters/web-push/service-worker-runtime.ts"; import type { TimeoutScheduler } from "../../src/adapters/web-push/runtime-support.ts"; import { @@ -365,6 +368,90 @@ describe("Web Push worker runtime", () => { expect(focus).not.toHaveBeenCalled(); }); + // 06-01. A registry path is an app path: an accepted click opens it + // under the base path, and the handoff keeps the app path for the router. + it("opens an accepted click's route under the base path", async () => { + const store = await activeFence(); + const messages: unknown[] = []; + const openWindow = vi.fn( + async (url: string): Promise => ({ + url, + focus: async () => {}, + postMessage() {}, + }), + ); + let windows: readonly WindowClientFacade[] = []; + const adapter = createNotificationClickAdapter({ + fenceStore: store, + registry, + origin: "https://app.example.test", + appRootUrl: "https://app.example.test/app/", + now: () => now, + clients: { + matchControlledWindowClients: async () => windows, + openWindow, + }, + }); + const click = () => + adapter.handle({ + notification: { data: clickData(), close() {} }, + waitUntil() {}, + }); + + await expect(click()).resolves.toEqual({ ok: true, value: undefined }); + expect(openWindow.mock.calls).toEqual([ + ["https://app.example.test/app/inbox"], + ]); + + windows = [ + { + url: "https://app.example.test/app/current", + focus: async () => {}, + postMessage(message) { + messages.push(message); + }, + }, + ]; + await expect(click()).resolves.toEqual({ ok: true, value: undefined }); + expect(messages).toEqual([ + expect.objectContaining({ path: "/inbox" }), + ]); + }); + + // 1103/06-02. The click joins the base path and the registry path, then + // the URL parser resolves dot segments, so `/app/` + `/../admin` opens + // `/admin`. The registry takes only a path that parsing leaves unchanged. + it.each(["/../admin", "/%2e%2e/admin", "/%2E%2E/admin", "/./inbox", "/inbox/.."])( + "refuses a registry path that parsing would rewrite: %s", + (path) => { + expect(() => + createWebPushNotificationRegistry([ + { + notificationType: "INBOX_ACTIVITY", + routeIntent: "OPEN_INBOX", + title: "새 알림이 있습니다", + body: "앱을 열어 최신 내용을 확인하세요.", + path, + }, + ]), + ).toThrow(TypeError); + }, + ); + + it("keeps a registry path with a query", () => { + expect( + createWebPushNotificationRegistry([ + { + notificationType: "INBOX_ACTIVITY", + routeIntent: "OPEN_INBOX", + title: "새 알림이 있습니다", + body: "앱을 열어 최신 내용을 확인하세요.", + path: "/inbox?filter=unread", + }, + ]).routePath("OPEN_INBOX"), + ).toBe("/inbox?filter=unread"); + }); + describe("a rejected click opens the app root (Q-6.6-11, D-14)", () => { async function rejectedClick( options: Readonly<{ at?: number; data?: unknown }>, diff --git a/tests/unit/zod-validator.test.ts b/tests/unit/zod-validator.test.ts new file mode 100644 index 00000000..31178ab2 --- /dev/null +++ b/tests/unit/zod-validator.test.ts @@ -0,0 +1,66 @@ +import { describe, expect, it } from "vitest"; + +import { invokeValidator } from "../../src/contracts/external-contract-runtime.ts"; +import { unvalidatedPayload } from "../../src/contracts/unvalidated-payload.ts"; +import { z } from "../../src/contracts/zod.ts"; +import { zodValidator } from "../../src/contracts/zod-validator.ts"; + +/** + * 1101/07-03. The one zod adapter lives in src/contracts, so every feature + * imports it instead of copying it, and it outlives the sample feature. + */ +describe("zodValidator", () => { + const validator = zodValidator( + "Entity", + z.object({ id: z.string().min(1), tags: z.array(z.string()) }).strip(), + ); + + it("returns a copy of the parsed value, not the caller's object", () => { + const source = { id: "a", tags: ["x"] }; + const result = validator.safeParse(source); + + expect(result).toEqual({ success: true, data: source }); + if (!result.success) throw new Error("expected success"); + expect(result.data.tags).not.toBe(source.tags); + expect(Object.isFrozen(result)).toBe(true); + }); + + it("reports issues with array paths and string codes", () => { + expect(validator.safeParse({ id: "", tags: [1] })).toEqual({ + success: false, + issues: [ + { path: ["id"], code: "too_small" }, + { path: ["tags", 0], code: "invalid_type" }, + ], + }); + }); + + it("checks its input, so it carries no skip marker", () => { + expect(validator.schemaId).toBe("Entity"); + expect(validator.validation).toBeUndefined(); + }); +}); + +describe("unvalidatedPayload", () => { + const skipped = unvalidatedPayload<{ id: string }>( + "EntityPayload", + "generated client types are trusted", + ); + + it("names the skip on the validator itself", () => { + expect(skipped).toMatchObject({ + schemaId: "EntityPayload", + validation: "NONE", + unvalidatedReason: "generated client types are trusted", + }); + }); + + it("accepts any value as a copy", () => { + const source = { anything: [1] }; + const invocation = invokeValidator(skipped, source); + + expect(invocation).toEqual({ outcome: "VALID", value: source }); + if (invocation.outcome !== "VALID") throw new Error("expected VALID"); + expect(invocation.value).not.toBe(source); + }); +}); diff --git a/tests/visual/__snapshots__/platform.visual.spec.ts-snapshots/app-shell-compact-pseudo-drawer-chromium-visual-linux.png b/tests/visual/__snapshots__/platform.visual.spec.ts-snapshots/app-shell-compact-pseudo-drawer-chromium-visual-linux.png index 9d5a75a5..03f375b5 100644 Binary files a/tests/visual/__snapshots__/platform.visual.spec.ts-snapshots/app-shell-compact-pseudo-drawer-chromium-visual-linux.png and b/tests/visual/__snapshots__/platform.visual.spec.ts-snapshots/app-shell-compact-pseudo-drawer-chromium-visual-linux.png differ diff --git a/tests/visual/__snapshots__/platform.visual.spec.ts-snapshots/app-shell-wide-light-chromium-visual-linux.png b/tests/visual/__snapshots__/platform.visual.spec.ts-snapshots/app-shell-wide-light-chromium-visual-linux.png index 55ad48e8..866717e6 100644 Binary files a/tests/visual/__snapshots__/platform.visual.spec.ts-snapshots/app-shell-wide-light-chromium-visual-linux.png and b/tests/visual/__snapshots__/platform.visual.spec.ts-snapshots/app-shell-wide-light-chromium-visual-linux.png differ diff --git a/tests/visual/__snapshots__/platform.visual.spec.ts-snapshots/design-system-gallery-dark-chromium-visual-linux.png b/tests/visual/__snapshots__/platform.visual.spec.ts-snapshots/design-system-gallery-dark-chromium-visual-linux.png index a4b9b7c9..ba71b3c7 100644 Binary files a/tests/visual/__snapshots__/platform.visual.spec.ts-snapshots/design-system-gallery-dark-chromium-visual-linux.png and b/tests/visual/__snapshots__/platform.visual.spec.ts-snapshots/design-system-gallery-dark-chromium-visual-linux.png differ diff --git a/tests/visual/__snapshots__/platform.visual.spec.ts-snapshots/platform-overview-light-chromium-visual-linux.png b/tests/visual/__snapshots__/platform.visual.spec.ts-snapshots/platform-overview-light-chromium-visual-linux.png index 653a2b13..ff0a7948 100644 Binary files a/tests/visual/__snapshots__/platform.visual.spec.ts-snapshots/platform-overview-light-chromium-visual-linux.png and b/tests/visual/__snapshots__/platform.visual.spec.ts-snapshots/platform-overview-light-chromium-visual-linux.png differ diff --git a/tests/visual/__snapshots__/platform.visual.spec.ts-snapshots/state-surfaces-light-chromium-visual-linux.png b/tests/visual/__snapshots__/platform.visual.spec.ts-snapshots/state-surfaces-light-chromium-visual-linux.png index 731f3789..41181671 100644 Binary files a/tests/visual/__snapshots__/platform.visual.spec.ts-snapshots/state-surfaces-light-chromium-visual-linux.png and b/tests/visual/__snapshots__/platform.visual.spec.ts-snapshots/state-surfaces-light-chromium-visual-linux.png differ diff --git a/tests/visual/fonts.conf b/tests/visual/fonts.conf new file mode 100644 index 00000000..c2f1f11d --- /dev/null +++ b/tests/visual/fonts.conf @@ -0,0 +1,37 @@ + + + + + /usr/share/fonts/truetype/noto + /usr/share/fonts/opentype/noto + /usr/share/fonts/truetype/liberation + /var/cache/fontconfig + fontconfig + + + /etc/fonts/conf.d + + + + true + true + hintslight + false + rgb + lcddefault + + diff --git a/tests/visual/fonts.setup.ts b/tests/visual/fonts.setup.ts new file mode 100644 index 00000000..db03d79f --- /dev/null +++ b/tests/visual/fonts.setup.ts @@ -0,0 +1,68 @@ +import { + expect, + test, + type Page, +} from "../support/browser/strict-browser-test.ts"; +import { VISUAL_TEST_FONT_INSTALL_ARGUMENTS } from "../../scripts/lib/visual-test-fonts.ts"; + +// 11-02. The goldens were captured with these four faces. `fonts.conf` shows +// Chromium only the directories that hold them; this check runs before the +// screenshots so a missing or substituted font fails here with an install +// hint instead of as a whole-page pixel diff. Probes sit in the real page so +// they get its CSS (`--font-sans`) and `lang`, which decide the fallbacks. +const expectedFaces = { + latin: "Noto Sans", + korean: "Noto Sans CJK KR", + "korean-800": "Noto Sans CJK KR Black", + code: "Liberation Mono", +}; + +const installHint = [ + "Visual tests must draw with the fonts the goldens were captured with.", + // 1103/11-02. The CI browser step installs the same list. + `Debian/Ubuntu: sudo ${VISUAL_TEST_FONT_INSTALL_ARGUMENTS}`, + "tests/visual/fonts.conf reads them from the Debian/Ubuntu font directories; other OSes have no Linux goldens.", +].join("\n"); + +async function drawnFaces(page: Page) { + await page.goto("/"); + await expect(page.getByRole("heading", { level: 1 })).toBeVisible(); + await page.evaluate(() => { + const probes = document.createElement("div"); + probes.innerHTML = ` +

Clean Architecture Frontend

+

플랫폼구성화면상태

+

플랫폼구성화면상태

+ const value = 42;`; + document.body.append(probes); + }); + + const cdp = await page.context().newCDPSession(page); + await cdp.send("DOM.enable"); + await cdp.send("CSS.enable"); + const { root } = await cdp.send("DOM.getDocument"); + const drawn: Record = {}; + for (const probe of Object.keys(expectedFaces)) { + const { nodeId } = await cdp.send("DOM.querySelector", { + nodeId: root.nodeId, + selector: `[data-font-probe="${probe}"]`, + }); + const { fonts } = await cdp.send("CSS.getPlatformFontsForNode", { nodeId }); + drawn[probe] = fonts.map((font) => font.familyName).join(" + "); + } + return drawn; +} + +test("visual fonts match the goldens", async ({ page }) => { + let drawn: Record; + try { + drawn = await drawnFaces(page); + } catch (error) { + // With no font at all the renderer crashes, so the page never draws. + throw new Error( + `${installHint}\nThe font probe page did not render: ${String(error)}`, + { cause: error }, + ); + } + expect(drawn, installHint).toEqual(expectedFaces); +}); diff --git a/tests/visual/platform.visual.spec.ts b/tests/visual/platform.visual.spec.ts index 2ef4aad5..c7f95d78 100644 --- a/tests/visual/platform.visual.spec.ts +++ b/tests/visual/platform.visual.spec.ts @@ -3,6 +3,10 @@ import { test, type Page, } from "../support/browser/strict-browser-test.ts"; +import { + ROUTE_FEATURE_OWNER, + ROUTE_REGISTRY, +} from "../../src/features/installed-feature-contracts.ts"; // 11-02. `main` is drawn before the route chunk arrives; a screenshot taken // then pins the loading surface instead of the page. @@ -10,10 +14,50 @@ async function expectRouteHeading(page: Page, title: string) { await expect(page.getByRole("heading", { level: 1 })).toHaveText(title); } +/** `toHaveScreenshot` takes a stylesheet only as a file; a tag does the same. */ +async function hide(page: Page, css: string) { + if (css !== "") await page.addStyleTag({ content: css }); +} + +/** + * 1103/12-01. These goldens are the template's own drawing: the shell, the + * home page and the platform overview. Those screens also draw whatever + * features are installed, so one `create:feature` failed this merge gate and + * only re-capturing template-owned PNGs made it pass. The screenshots leave + * the installed features' parts out (`display: none`, so a longer list does + * not move the rest): every link to a feature route, with its list item, and + * the overview sections that count or list the installed features. Their + * number and order are the component tests' subject; the shell's own CSS + * still fails here. + */ +const FEATURE_ROUTE_PATHS = Object.values(ROUTE_REGISTRY) + .filter((route) => ROUTE_FEATURE_OWNER[route.routeId] !== undefined) + .map((route) => route.path); +const WITHOUT_FEATURE_LINKS = + FEATURE_ROUTE_PATHS.length === 0 + ? "" + : `${FEATURE_ROUTE_PATHS.flatMap((path) => [ + `li:has(> a[href="${path}"])`, + `a[href="${path}"]`, + ]).join(",\n")} { display: none !important; }`; +const WITHOUT_INSTALLED_FEATURE_SECTIONS = `${[ + "platform-summary-title", + "platform-routes-title", + "platform-contracts-title", + "platform-features-title", +] + .map((id) => `section[aria-labelledby="${id}"]`) + .join(",\n")} { display: none !important; } +section[aria-labelledby="platform-release-title"] .platform-metric:nth-child(4) dd { + /* The contract-set digest: a feature's contract package changes it. */ + visibility: hidden !important; +}`; + test("wide application shell visual contract", async ({ page }) => { await page.setViewportSize({ width: 1440, height: 900 }); await page.goto("/"); await expectRouteHeading(page, "Clean Architecture Frontend"); + await hide(page, WITHOUT_FEATURE_LINKS); await expect(page).toHaveScreenshot("app-shell-wide-light.png", { fullPage: true, }); @@ -26,6 +70,7 @@ test("compact drawer and pseudo-locale visual contract", async ({ page }) => { await page.locator("#locale-preference").selectOption("en-XA"); await page.locator(".app-shell__menu-button").click(); await expect(page.locator(".ui-drawer")).toHaveJSProperty("open", true); + await hide(page, WITHOUT_FEATURE_LINKS); await expect(page).toHaveScreenshot("app-shell-compact-pseudo-drawer.png", { fullPage: true, }); @@ -59,6 +104,15 @@ test("platform composition overview visual contract", async ({ page }) => { await expect( page.locator("section[aria-labelledby='platform-capabilities-title']"), ).toBeVisible(); + // 1103/15-01. The contract tables fill in after the title; wait for them so + // the hidden sections are drawn in their final state either way. + await expect(page.locator("main [aria-busy='true']")).toHaveCount(0); + await expect( + page + .locator("section[aria-labelledby='platform-release-title'] dt") + .filter({ hasText: "계약 집합 다이제스트" }), + ).toBeVisible(); + await hide(page, WITHOUT_INSTALLED_FEATURE_SECTIONS); await expect(page.getByRole("main")).toHaveScreenshot( "platform-overview-light.png", ); diff --git a/vite.config.ts b/vite.config.ts index 6acd6049..06854dbb 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,3 +1,7 @@ +import { existsSync } from "node:fs"; +import { createRequire } from "node:module"; +import path from "node:path"; + import { defineConfig, loadEnv } from "vite"; import react from "@vitejs/plugin-react"; import tailwindcss from "@tailwindcss/vite"; @@ -59,23 +63,200 @@ function assertRuntimeConfigUnderBase( } } -export default defineConfig(({ mode }) => { +type ModuleGraph = Readonly<{ + getModuleInfo(id: string): Readonly<{ + importedIds: readonly string[]; + dynamicallyImportedIds: readonly string[]; + }> | null; +}>; + +function staticClosure( + graph: ModuleGraph, + roots: readonly string[], + within: (id: string) => boolean = () => true, +): Set { + const reached = new Set(); + const pending = [...roots]; + for (let next = pending.pop(); next !== undefined; next = pending.pop()) { + if (reached.has(next) || !within(next)) continue; + reached.add(next); + pending.push(...(graph.getModuleInfo(next)?.importedIds ?? [])); + } + return reached; +} + +/** + * 15-01. Two chunk groups that keep moving the feature runtime halves out of + * the initial JavaScript from costing more than it saves. + * + * - `feature-declarations`: every installed feature's declaration, the static + * graph under src/features/ that the generated feature index reaches + * (feature-module.ts, its route contract and messages). A declaration is + * shared by the boot graph and its own feature's lazy runtime and pages, + * and rolldown otherwise gives each such set of importers a chunk of its + * own: one more initial file per feature, which doubled what a feature + * added to the initial JavaScript. + * - `feature-platform`: the boot modules the runtime halves also import (HTTP + * executor, contract runtime, zod). Left to rolldown they split into one + * initial chunk per set of importers; the per-file gzip overhead and the + * compression lost across files cost more than the runtime code removed. + * Modules that the boot-failure screen needs are left out, so + * render-boot-failure.tsx never depends on this chunk: it must still render + * when a module of the application graph throws while evaluating (09-03). + * + * Both only regroup modules the boot already loads; nothing lazy becomes + * initial. If feature-declarations comes out empty, the per-feature bound in + * tests/unit/feature-shape-growth.test.ts fails. feature-platform only moves + * the platform total (about 2 KB at 15-01), which the bundle budget + * (FE-GATE-012) checks. + */ +function createFeatureChunkGroups(root: string) { + const at = (file: string) => path.join(root, file); + const featuresRoot = `${at("src/features")}${path.sep}`; + let groups: ReadonlyMap | undefined; + const classify = (graph: ModuleGraph): ReadonlyMap => { + const index = graph.getModuleInfo(at("src/.generated/product-feature-index.ts")); + const declarations = staticClosure(graph, index?.importedIds ?? [], (id) => + id.startsWith(featuresRoot), + ); + const runtimes = staticClosure( + graph, + [...declarations].flatMap((id) => graph.getModuleInfo(id)?.dynamicallyImportedIds ?? []), + ); + const boot = staticClosure(graph, [at("src/bootstrap/boot.tsx")]); + const bootFailure = staticClosure(graph, [at("src/bootstrap/render-boot-failure.tsx")]); + const result = new Map(); + for (const id of declarations) result.set(id, "feature-declarations"); + for (const id of runtimes) { + if (boot.has(id) && !bootFailure.has(id) && !declarations.has(id)) { + result.set(id, "feature-platform"); + } + } + return result; + }; + return (id: string, graph: ModuleGraph): string | null => { + groups ??= classify(graph); + return groups.get(id) ?? null; + }; +} + +/** + * 1103/15-07. react-router publishes its production build under + * dist/production, but its exports map points every condition at + * dist/development. A production bundle carried the router's development + * warnings (ENABLE_DEV_WARNINGS): 604 gzip bytes of initial JavaScript at + * 15-07 and warnings in the production console. A build resolves the two + * entries react-router-dom imports to the production files next to the + * development entry. If an upgrade moves them, the build stops here rather + * than silently shipping the development build again; + * tests/unit/build-environment-bundle.test.ts checks the bundle. Remove this + * when the package exports a production condition. + */ +function reactRouterProductionAliases(root: string) { + const projectRequire = createRequire(path.join(root, "package.json")); + const routerRequire = createRequire(projectRequire.resolve("react-router-dom")); + const production = path.join(path.dirname(routerRequire.resolve("react-router")), "..", "production"); + const aliases = [ + { find: /^react-router$/u, replacement: path.join(production, "index.mjs") }, + { find: /^react-router\/dom$/u, replacement: path.join(production, "dom-export.mjs") }, + ]; + const missing = aliases.filter(({ replacement }) => !existsSync(replacement)); + if (missing.length > 0) { + throw new Error( + `react-router production build not found: ${missing.map(({ replacement }) => replacement).join(", ")}`, + ); + } + return aliases; +} + +export default defineConfig(({ command, mode }) => { assertDeclaredBuildVariables(mode); const base = routerBasePath(process.env); assertRuntimeConfigUnderBase(process.env, base); return { base, plugins: [react(), tailwindcss(), viteModuleInventoryPlugin()], + // Development keeps the router's warnings. + resolve: command === "build" ? { alias: reactRouterProductionAliases(process.cwd()) } : {}, + server: { + watch: { + // Test and build output, never app source. Playwright writes trace + // resources (.html) under artifacts/ while a dev-server test runs; + // watched, each one made Vite reload every open page. + ignored: ["**/artifacts/**", "**/dist/**", "**/.tmp/**"], + }, + }, build: { manifest: true, sourcemap: false, - rollupOptions: { + rolldownOptions: { + /** + * 1101/08-08. The design-system modules have no top-level effects: + * they declare components, icons and token lists. Declared so, a + * primitive file none of whose exports a chunk uses is dropped from + * it, instead of riding the initial chunk because the app shell + * imports the index that re-exports it. The bundler drops an import + * kept only for its effect along with its module, so these files hold + * no such import; tests/unit/design-system-initial-chunk.test.ts + * checks both. Stylesheets load from bootstrap/main.tsx. + * + * Trade: at 08-08 the initial JavaScript fell by 2,718 gzip bytes + * and the initial chunks rose from 16 to 25. The entry preloads them + * in parallel, so over HTTP/2 they add no round trip. Over HTTP/1.1 + * they queue for six connections; 1101/14.4 measured that cost and + * why the chunks stay split ("초기 청크 수와 HTTP/1.1" in + * docs/operations/performance-evidence.md). + */ + treeshake: { + moduleSideEffects: [ + { + test: /[\\/]src[\\/]presentation[\\/]design-system[\\/].+\.tsx?$/, + sideEffects: false, + }, + ], + }, output: { - // 09-03. The entry now imports the app dynamically, so Vite's preload - // helper would land in the entry chunk and every lazy chunk would - // import the entry, whose hash changes with each build id. - manualChunks: (id: string) => - id.includes("vite/preload-helper") ? "preload-helper" : undefined, + codeSplitting: { + groups: [ + // 09-03. The entry now imports the app dynamically, so Vite's + // preload helper would land in the entry chunk and every lazy + // chunk would import the entry, whose hash changes with each + // build id. + { name: "preload-helper", test: /vite[\\/]preload-helper/ }, + // 1103/15-06. react-dom and scheduler (about 56 KB gzip) shared + // the boot-failure chunk with the build id, so a release that + // only changed the build id renamed half of the initial + // JavaScript (99,785 of 201,857 B) and returning visitors + // downloaded it again. In a chunk of their own they keep their + // name: the same change renames 44,297 B (boot, entry and the + // boot-failure screen, which hold or import the build id). + // The boot-failure screen still needs no module of the + // application graph (09-03): this chunk is a library leaf. + { + name: "react-dom", + test: /[\\/]node_modules[\\/](?:\.pnpm[\\/][^\\/]+[\\/]node_modules[\\/])?(?:react-dom|scheduler)[\\/]/, + includeDependenciesRecursively: false, + }, + // 1101/07-03. Every feature's schemas and runtime half import + // the shared zod adapter. Alone it becomes a chunk of its own + // once two features share it, and every route and runtime + // import then preloads one more file (about 50 gzip bytes of + // initial JavaScript for the second feature). Those imports + // already preload schema-registry.ts, so the adapter rides + // that lazy chunk. Both modules stay off the boot graph. + { + name: "schema-registry", + test: /[\\/]src[\\/]contracts[\\/](?:schema-registry|zod-validator)\.ts$/, + includeDependenciesRecursively: false, + }, + { + name: createFeatureChunkGroups(process.cwd()), + // The boot-failure screen's modules stay out of + // feature-platform even when a grouped module imports them. + includeDependenciesRecursively: false, + }, + ], + }, }, }, }, diff --git a/vite.service-worker.config.ts b/vite.service-worker.config.ts index 9ecce64b..156732ef 100644 --- a/vite.service-worker.config.ts +++ b/vite.service-worker.config.ts @@ -1,6 +1,7 @@ import { readFile } from "node:fs/promises"; import { defineConfig } from "vite"; +import { getBuildConfig } from "./src/contracts/env.ts"; import { SERVICE_WORKER_CACHE_SCHEMA_VERSION, SERVICE_WORKER_PROTOCOL_VERSION, @@ -67,11 +68,15 @@ const buildInput = resolveServiceWorkerBuildInput({ }); export default defineConfig({ + // 0929/06-01. `dist` already holds the app build, `public/` included. Copying + // `public/` again would put the local `public/config.json` back over the + // profile document step 4 wrote. + publicDir: false, build: { // §17.2.2: exactly one input, exactly one output, no additional chunk. emptyOutDir: false, sourcemap: false, - rollupOptions: { + rolldownOptions: { input: "src/adapters/service-worker/service-worker-entry.ts", output: { format: "es", @@ -91,8 +96,9 @@ export default defineConfig({ }), __CA_SERVICE_WORKER_ASSETS__: JSON.stringify(buildInput.assets), __CA_SERVICE_WORKER_HANDLERS__: JSON.stringify(buildInput.handlers), + // 0929/06-02. The page's own default, which follows the router base path. __CA_RUNTIME_CONFIG_URL__: JSON.stringify( - process.env.VITE_RUNTIME_CONFIG_URL ?? "/config.json", + getBuildConfig(process.env).runtimeConfigUrl, ), __CA_RELEASE_MANIFEST_URL__: JSON.stringify( buildInput.releaseManifestUrl, diff --git a/vitest.config.ts b/vitest.config.ts index 9235ef63..7f09b61e 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -1,10 +1,26 @@ import { configDefaults, defineConfig } from "vitest/config"; +import { isNpmScopeEnvironmentName } from "./scripts/lib/package-script-graph.ts"; + // Tests must not inherit a caller's production React/runtime selection. // Package scripts also launch Vitest through scripts/run-vitest.ts, which owns // NODE_ENV before the Vitest process starts. Keeping the config deterministic // protects direct `vitest` invocations as well. process.env.NODE_ENV = "test"; +// 1101/15-05. `npx vitest` and npm-launched IDE runners set npm_config_prefix, +// _userconfig and _globalconfig. The CI gate preflight refuses those in a real +// runner (scripts/contracts/ci-gates.ts), so tests that run it, in process or +// as a child, failed for the caller's environment. Tests start without them. +for (const name of Object.keys(process.env)) { + if (isNpmScopeEnvironmentName(name)) delete process.env[name]; +} +// CI sets VITE_BUILD_ID and VITE_COMMIT_SHA for the whole workflow +// (.gitea/workflows/quality-gates.yml). Vite builds them into +// `import.meta.env`, so a test that composes the app against its local-build +// fixture release saw CONFIG_BUILD_MISMATCH in CI and passed everywhere else. +// Tests start with the local build identity. +delete process.env["VITE_BUILD_ID"]; +delete process.env["VITE_COMMIT_SHA"]; // tests/system needs CI-runner host facilities (see docs/testing/taxonomy.md). // It runs only when a caller names it, as `test:system` does; a bare `vitest` @@ -16,6 +32,10 @@ const systemTestsRequested = process.argv.some((argument) => export default defineConfig({ test: { globals: false, + // 10-04. Vitest refuses `.only` only when CI is set; locally it quietly + // drops the rest of the file. Refuse it everywhere. Skipped and todo + // tests are failed by scripts/lib/no-skipped-tests-reporter.ts. + allowOnly: false, setupFiles: ["./tests/setup.ts"], restoreMocks: true, clearMocks: true,