# Complete - 01+browser_native_ws ## 완료 일시 2026-05-20 ## 요약 Browser native WebSocket 및 Node WebSocket `ws` 런타임 계약 정리 작업을 3회 리뷰 루프로 완료했다. 최종 판정은 PASS. ## 루프 이력 | Plan | Review | Verdict | 메모 | |------|--------|---------|------| | `plan_cloud_G08_0.log` | `code_review_cloud_G08_0.log` | FAIL | Browser/native split 자체는 통과했지만 `proto-socket/node`의 `ws` runtime 계약이 manifest/README에 명시되지 않았다. | | `plan_cloud_G08_1.log` | `code_review_cloud_G08_1.log` | FAIL | `ws` 계약 소스 변경은 통과했지만 active review stub의 구현-owned 섹션과 검증 출력이 비어 있었다. | | `plan_cloud_G08_2.log` | `code_review_cloud_G08_2.log` | PASS | Review 문서 회복과 검증 출력 기록이 완료됐고, 지정 검증을 재실행해 일치함을 확인했다. | ## 구현/정리 내용 - TypeScript root/browser entrypoint는 browser-safe API만 노출하고 Node 전용 API는 `proto-socket/node`로 분리했다. - Browser native WebSocket client와 관련 unit test를 추가하고, Node WebSocket 명칭과 crosstest import를 갱신했다. - `ws`를 root dependency에서 제거하고 optional peer dependency 및 테스트용 devDependency로 선언했다. - README에 Node WebSocket 사용자의 `ws` 설치 필요성과 browser/TCP-only 사용자의 불필요성을 명시했다. - 후속 review 문서의 구현 체크리스트, 설계 결정, 검증 출력 기록을 완료했다. ## 최종 검증 - `cd typescript && node -e "const fs=require('fs'); const p=JSON.parse(fs.readFileSync('package.json','utf8')); if (p.dependencies?.ws) throw new Error('ws must not be a root dependency'); if (p.devDependencies?.ws !== '^8.18.1') throw new Error('ws devDependency missing'); if (p.peerDependencies?.ws !== '^8.18.1') throw new Error('ws peerDependency missing'); if (p.peerDependenciesMeta?.ws?.optional !== true) throw new Error('ws peerDependency must be optional');"` - PASS; no output, exit code 0. - `cd typescript && npm run check` - PASS; `tsc --noEmit` exit code 0. - `cd typescript && npm test` - PASS; 5 test files and 33 tests passed. - `cd go && go run ./crosstest/go_typescript.go` - PASS; all go-server/typescript-client crosstests passed. - `rg --sort path -n 'from "ws"|node:|\bBuffer\b|ClientOptions|RawData' typescript/src/index.ts typescript/src/browser_ws_client.ts` - PASS; no output, exit code 1. ## 잔여 Nit - 없음 ## 후속 작업 - 없음