Skip to content

feat: Phase 1~3 — 프로젝트 기반, 플러그인 코어, 한국어 언어팩#3

Open
mapd3692 wants to merge 32 commits intomainfrom
feature/initial-project-setup
Open

feat: Phase 1~3 — 프로젝트 기반, 플러그인 코어, 한국어 언어팩#3
mapd3692 wants to merge 32 commits intomainfrom
feature/initial-project-setup

Conversation

@mapd3692
Copy link
Copy Markdown
Owner

개요

OpenClaw 공식 i18n 지원이 보류된 상황에서, 커뮤니티 언어팩을 /lang ko 한 줄로 설치할 수 있는 플러그인과 한국어 언어팩을 제공합니다.

변경 사항

Phase 1 — 프로젝트 기반 구축

  • README.md (한국어/영어 이중 언어), CONTRIBUTING.md
  • GitHub Actions CI (check-coverage.yml, validate-locale.yml)
  • 유틸리티 스크립트 (check-coverage.ts, extract-keys.ts)

Phase 2 — 플러그인 코어 (plugin/index.ts)

  • /lang 언어 목록 출력 / /lang <code> 설치
  • alias 정규화 (koko-KR), 버전 근접 매칭, 중복 설치 방지
  • onLoad 훅 자동 업데이트: OpenClaw 버전 변경 감지 시 백그라운드 자동 재패치
  • 설치 상태를 .i18n-plus-state.json에 기록

Phase 3 — 한국어 언어팩

  • locales/2026.3.13/ko-KR-community.js (15개 섹션, 번역률 98%)
  • locale-meta.jsonko-KR 버전 정보 등록

Codex 리뷰 반영

  • openclaw.plugin.json: id, configSchema 필드 추가
  • package.json: openclaw.extensions 배열 추가
  • check-coverage.ts: en-keys 파일 부재 시 에러 처리 (bogus coverage 방지)

테스트 플랜

  • openclaw plugins install -l ./plugin 성공 확인
  • /lang — 언어 목록 출력 확인
  • /lang ko — 설치 및 메인 번들 패치 확인
  • 브라우저 새로고침 후 설정에서 한국어 선택 확인
  • /lang ko 재실행 시 중복 패치 방지 확인
  • OpenClaw 업데이트 후 플러그인 재로드 시 자동 재패치 확인
  • 존재하지 않는 코드 입력 시 오류 메시지 확인
  • 공식 코드(de) 입력 시 안내 메시지 확인

🤖 Generated with Claude

mapd3692 and others added 5 commits March 18, 2026 22:15
- WORKPLAN.md: 작업계획서 추가
- README.md: 프로젝트 소개, 설치법, 사용법 문서
- CONTRIBUTING.md: 새 언어 추가 및 기여 가이드
- locale-meta.json: 언어 메타데이터 초기 스키마 (ko-KR 엔트리)
- plugin/: 플러그인 스켈레톤 (package.json, 매니페스트, 엔트리포인트)

Co-Authored-By: Claude Opus 4.6 <[email protected]>
locale-meta.json 다운로드, alias 정규화, 공식/커뮤니티 분기,
chunk 다운로드 및 메인 번들 패치, 중복 설치 방지, 결과 메시지 출력 구현.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
ko-KR-community.js chunk 파일 생성 (common, nav, settings, containers,
images, volumes, networks, stacks, endpoints, auth, docker, kubernetes,
monitoring, messages, wizard 섹션 포함, 번역률 98%).
locale-meta.json에 ko-KR 2026.3.13 버전 정보 등록.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
…rage baseline

- plugin/openclaw.plugin.json: id, configSchema 필드 추가 (플러그인 discovery/validation 필수)
- plugin/package.json: openclaw.extensions 배열 추가 (npm 설치 후 엔트리포인트 등록)
- scripts/check-coverage.ts: en-keys 파일 부재 시 경고 → 에러로 변경 (bogus coverage 방지)

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f2289cfbf4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@mapd3692 mapd3692 force-pushed the feature/initial-project-setup branch from f2289cf to ac67e46 Compare March 18, 2026 13:34
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ac67e46a65

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

mapd3692 and others added 7 commits March 18, 2026 22:42
/app/dist/control-ui/assets/는 OpenClaw 업그레이드 시 교체되어
.i18n-plus-state.json이 함께 삭제됨 → installedLocales가 빈 객체로
읽혀 autoUpdate()가 아무 동작도 하지 않는 버그 수정.
/app/data/는 영속적 데이터 디렉토리로 업그레이드 후에도 유지됨.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
중첩 객체 재귀 처리 후 keyValueRegex.lastIndex를 중첩 객체 끝
위치로 갱신하지 않아 외부 regex가 같은 범위를 재스캔 —
wizard.welcome과 welcome이 모두 집계되어 번역률이 부풀려지는 버그.
lastIndex = i 로 중첩 범위를 건너뛰도록 수정.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
en-keys 파일 없이 coverage CI가 즉시 exit 1로 실패하는 문제 해결.
ko-KR chunk에서 추출한 515개 키를 기준 파일로 커밋 —
이후 locale PR에서 coverage 검증이 정상 동작함.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
plain object export 방식으로는 OpenClaw가 명령어와 서비스를
인식하지 못해 /lang 등록 불가, autoUpdate() 미실행.
register(api) 함수로 전환하고 api.registerCommand(),
api.registerService()를 통해 올바르게 등록.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
check-coverage.ts와 동일한 버그 — 중첩 객체 재귀 후
keyValueRegex.lastIndex를 갱신하지 않아 내부 키가 부모 레벨에서
재매칭됨. --save로 저장하는 en-keys 베이스라인이 오염될 수 있음.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
translatedKeys.length를 그대로 사용하면 en-keys에 없는 stale 키도
카운트되어 coverage가 100%를 초과할 수 있음.
referenceSet과의 교집합(matched)만 카운트하도록 수정.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@mapd3692 mapd3692 force-pushed the feature/initial-project-setup branch from ac67e46 to d461d80 Compare March 18, 2026 13:45
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d461d80079

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

mapd3692 and others added 4 commits March 18, 2026 23:17
fork PR에서 pull_request 이벤트는 read-only GITHUB_TOKEN으로 실행됨.
issues.createComment / issues.updateComment 호출에 필요한
pull-requests: write, issues: write 권한을 워크플로우 레벨에 선언.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
1. isAlreadyPatched early-return 경로에서도 installedLocales 상태 저장:
   상태 파일 부재(경로 마이그레이션 후/수동 삭제) 시 /lang 재실행으로
   상태를 복구할 수 없던 문제 해결.

2. patchMainBundle이 boolean 반환하도록 변경:
   "zh-CN" 앵커가 없으면 false 반환 — 번들 수정 없이 성공 메시지를
   출력하던 문제 해결. 호출부에서 false 시 에러 메시지 출력.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
- tsconfig.json: module=CommonJS 설정으로 __dirname ESM 오류 수정
- package.json: ts-node/typescript/@types/node devDependencies 추가, npm scripts 추가
- package-lock.json: 재현 가능한 빌드를 위한 lockfile 추가
- .gitignore: node_modules, dist 제외

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
글로벌 ts-node/typescript 설치 대신 package.json 기반 npm ci를 사용.
스크립트 실행 명령도 npm run check-coverage로 통일하여
로컬 환경과 CI 환경의 실행 방식을 일치시킴.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@mapd3692
Copy link
Copy Markdown
Owner Author

@codex review ?

mapd3692 and others added 2 commits March 18, 2026 23:27
- getReferenceKeys: 오류 메시지의 잘못된 명령어 수정
  (--version 옵션은 존재하지 않음 → <chunk-file> --save <version>)
- coverage_markdown: \\n 리터럴 → 실제 줄바꿈(\n)으로 수정
  GITHUB_OUTPUT에 기록되는 마크다운이 올바른 형식으로 출력되도록 수정
- translatedCount 불필요한 중간 변수 제거 (matchedCount 직접 사용)

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
STATE_FILE 경로가 /app/dist/control-ui/assets/ → /app/data/로
변경된 이후 catch 블록 주석이 구 경로를 참조하고 있었음.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@mapd3692
Copy link
Copy Markdown
Owner Author

@codex review ?

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 18, 2026

📊 번역률 계산 결과

언어 코드 버전 번역 키 전체 키 번역률
한국어 ko-KR 2026.3.13 515 515 100%

🤖 자동 생성된 코멘트 — check-coverage.yml

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ab716536e1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

mapd3692 and others added 3 commits March 18, 2026 23:40
registerCommand: (name, opts) → registerCommand({ name, description, handler })
- 핸들러가 console.log 대신 { text: string }을 반환하도록 변경
- 이전 형태로는 채팅 응답이 표시되지 않아 /lang 명령어가 사실상 무동작

registerService: (name, { onStart }) → registerService({ id, start, stop })
- 이전 형태는 런타임에서 서비스 등록 자체가 실패하거나 무시됨
- 자동 업데이트 서비스가 OpenClaw 업그레이드 후 재패치를 수행하지 않는 문제 수정

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
pull_request 이벤트에서 fork/Dependabot PR은 read-only 토큰으로
issues.createComment 호출이 403으로 실패함.

동일 레포 PR에서만 코멘트 작성 스텝을 실행하도록 조건 추가:
  if: ... && github.event.pull_request.head.repo.full_name == github.repository

외부 기여자는 Actions 탭 로그에서 번역률 계산 결과를 확인할 수 있음.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
[email protected] dist/plugin-sdk/plugins/types.d.ts 기준 수정:

registerCommand handler:
  - (args: string[]) → (ctx: PluginCommandContext)
  - args 접근: args[0] → ctx.args?.trim().split(/\s+/)[0]
  - ctx.args는 단일 문자열 (명령어 이름 제외한 나머지 입력)
  - acceptsArgs: true 추가 (명령어가 인자를 받음을 명시)
  - 반환값: { text: string } → { text?: string } (ReplyPayload 기준)

registerService:
  - start/stop이 OpenClawPluginServiceContext를 받도록 _ctx 파라미터 추가
  - 타입 주석에 출처([email protected]) 명시

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@mapd3692
Copy link
Copy Markdown
Owner Author

@codex review plz

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 97b7153d14

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- plugin/index.ts: register 함수를 default export로도 내보내 OpenClaw 로더 호환
- plugin/index.ts: autoUpdate에서 메인 번들 미발견 시 상태 업데이트 건너뛰기
- validate-locale.yml: 괄호 카운팅 대신 new Function() 파싱으로 구조적 오류 감지

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eeb0c6f08c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- validate-locale.yml: new Function()에 ESM export 구문 제거 후 파싱하도록 수정
- plugin/index.ts: I18N_PLUS_BASE_URL 환경변수로 메타데이터 소스 오버라이드 지원

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@mapd3692
Copy link
Copy Markdown
Owner Author

@codex review plz

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9c0ba7726f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- plugin/index.ts: 하드코딩된 /app/... 경로를 런타임 stateDir에서 유도하도록 변경
  (Docker 및 네이티브 설치 모두 지원, 환경변수 폴백 포함)
- plugin/index.ts: httpsGet()을 httpGet()으로 개선하여 http://와 https:// 모두 지원
  (로컬 개발 시 I18N_PLUS_BASE_URL=http://localhost:8080 사용 가능)
- scripts/extract-keys.ts: --save 시 *-community.js 파일 거부 로직 추가
  (en-keys 베이스라인이 커뮤니티 번역으로 오염되는 것을 방지)

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5551ab5d08

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- check-coverage.ts / extract-keys.ts: extractNestedKeys()에서 백틱/따옴표
  문자열 내부의 중괄호를 건너뛰도록 수정하여 depth 카운팅 오류 방지
- validate-locale.yml: aliases와 locale 코드가 officialLocales와 충돌하는지
  검사하여 런타임에서 도달 불가능한 커뮤니티 locale을 CI에서 사전 차단

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9fab1eb8bf

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- scripts/check-coverage.ts: translatedKeys 중복 제거 후 교집합 계산 (new Set().size)
  → 중복 키가 있는 locale chunk에서 coverage가 100% 초과 불가 보장
- .github/workflows/validate-locale.yml: version 엔트리에 coverage 필드 누락 시 오류 추가
  → /lang 명령어에서 번역률이 undefined로 표시되는 문제 CI에서 차단
- README.md: 플러그인 설치 후 Gateway 재시작 단계 명시 (한/영)
  → 첫 사용자가 /lang 미등록으로 혼란을 겪는 문제 방지
- scripts/en-keys/README.md: en-keys 베이스라인 파일 요구사항 문서화
  → 커뮤니티 chunk를 베이스라인으로 사용 시 coverage 순환 참조 문제 설명

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7abf45b2a7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- validate-locale.yml: exportName을 content.includes() 대신 export 클로즈 내 'as <name>' 패턴으로 검사
  - 번역 값 내에 exportName 문자열이 포함된 경우 오탐 발생 방지
  - export{...as ko_KR} 형태의 실제 export 구문에서만 식별자 일치를 확인

- validate-locale.yml: alias가 다른 커뮤니티 locale 코드와 충돌하는지 검사 추가
  - resolveAlias()에서 코드 정확 일치가 alias보다 우선하므로, 충돌 alias는 런타임 도달 불가
  - 공식 locale 충돌 검사(officialSet)에 더해 communityCodeMap으로 커뮤니티 간 충돌도 차단

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3c5d1ce1d1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- validate-locale.yml: locales/ 디렉토리의 모든 .js 파일 중 locale-meta.json에
  등록되지 않은 orphan 파일을 CI에서 차단 (Codex #2968101456)
- plugin/index.ts: isAlreadyPatched()에 expectedExportName 파라미터 추가하여
  exportName이 변경된 경우 기존 패치가 있어도 재패치하도록 수정 (Codex #2968101457)
  - autoUpdate() 및 installLanguage() 호출 시 versionInfo.exportName 전달

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 701441b9de

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@mapd3692
Copy link
Copy Markdown
Owner Author

🤖 Codex 코드리뷰 반영 완료 보고

Codex가 제기한 총 30개 인라인 리뷰 댓글을 모두 검토하고 코드 반영을 확인했습니다.

반영 현황 (1차~10차)

라운드 커밋 주요 수정 사항
1차 decde8f, 1ceef37, 73eb6d6 en-keys 기준 파일 추가, 상태 파일 경로 이동, 중첩 키 이중 카운팅 수정
2차 5e29ed5, b654983, d461d80 register(api) API 전환, extract-keys 이중 카운팅, referenceSet 교집합 커버리지
3차 7bf0670, 9c5d2f2 workflow 권한 추가, already-patched 상태 저장, 패치 앵커 검사
4차 41e9206, 2b0eae9 registerCommand/registerService API 교정, fork PR 코멘트 조건
5차 97b7153, eeb0c6f OpenClaw 공식 타입 명세 교정, default export, autoUpdate null 처리, 문법 검증
6차 9c0ba77 ESM export 파싱 수정, 로컬 개발 환경 지원
7차 5551ab5 런타임 경로 해결, http:// 프로토콜 지원, community chunk 거부
8차 7abf45b 커버리지 Set 중복 제거, coverage 필드 검증, README Gateway 재시작 안내
9차 3c5d1ce exportName 구문 검사 강화(export clause 정규식), alias 충돌 검사
10차 701441b orphan locale 파일 CI 검사, exportName 변경 시 재패치

코드 검토 결과

  • plugin/index.ts: register(api) API, export default, isAlreadyPatched() exportName 검사, 런타임 경로 해결, http/https 지원 모두 정상
  • scripts/check-coverage.ts: 문자열 리터럴 내 중괄호 무시, referenceSet 교집합 커버리지, en-keys 없으면 에러 종료
  • scripts/extract-keys.ts: 동일한 중괄호 처리, -community 파일 --save 거부
  • .github/workflows/validate-locale.yml: 문법 검증(ESM strip + new Function), export clause 정규식, officialLocale/커뮤니티 alias 충돌 검사, orphan 파일 검사
  • .github/workflows/check-coverage.yml: 권한 블록, fork PR 조건부 코멘트

현재 HEAD (701441b) 기준으로 모든 Codex 리뷰 항목이 완전히 반영되어 있습니다.


🤖 자동 검토 완료 — scheduled task

- README.md: npm 패키지(@openclaw-community/i18n-plus)가 아직 출시되지 않아
  404를 반환하므로, 해당 npm install 안내 제거. 소스 설치만 안내합니다.
- plugin/index.ts: stateDir(~/.openclaw)의 dirname()이 홈 디렉토리가 되어
  ~/dist/control-ui/assets 같은 잘못된 경로를 생성하던 버그 수정.
  stateDir은 상태 파일 경로 결정에만 사용하고, assets 경로는 환경변수
  OPENCLAW_CONTROL_UI_ASSETS 또는 Docker 기본값으로만 결정합니다.
- plugin/index.ts: 미사용 dirname import 제거
- plugin/index.ts: assets 경로 미발견 시 에러 메시지에 환경변수 설정 안내 추가

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 42cff50ae1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- validate-locale.yml: export 구문의 좌변 바인딩 선언 여부 검사 추가
  export{missing as ko_KR} 처럼 undeclared 식별자를 내보내는 경우
  new Function() 파서는 통과하지만 브라우저에서 모듈 로드 실패함.
  이제 as 왼쪽 로컬 식별자가 파일 내 var/const/let/function으로
  선언되어 있는지도 검사합니다.

- plugin/index.ts: PluginState에 localePackVersion 필드 추가
  설치 당시 locale-meta.json의 버전 키를 기록하여 autoUpdate()가
  OpenClaw 버전 변경 없이 정확한 pack 버전이 새로 추가된 경우도
  재패치 대상으로 인식합니다.
  (이전: openClawVersion 비교만으로 판단하여 fallback으로 설치 후
   exact pack 추가 시 영구적으로 갱신 누락되는 문제 수정)

- plugin/index.ts: findMainBundle()의 find 명령어에서 경로 따옴표 처리
  공백이 포함된 경로(macOS .app 번들 등)에서 find가 여러 인수로 분리되어
  null을 반환하던 문제 수정.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 02fd143ff3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

- plugin/index.ts: installLanguage()에서 chunk 다운로드 전에 findMainBundle() /
  isAlreadyPatched() 체크를 먼저 수행하도록 순서 재조정.
  이미 설치된 locale은 네트워크 없이 상태만 복구하고 반환하므로,
  GitHub 접근 불가 환경에서도 재실행이 정상 동작함.
- .github/workflows/check-coverage.yml: PR/push 트리거 paths에
  scripts/check-coverage.ts 및 scripts/en-keys/** 추가.
  커버리지 스크립트나 baseline 파일 변경 시에도 CI가 실행되도록 보장.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2f82372dfd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

plugin/index.ts Outdated
Comment on lines +449 to +450
if (isAlreadyPatched(indexJs, code, versionInfo.exportName)) {
// 번들은 이미 올바른 exportName으로 패치돼 있지만 상태 파일이 없을 수 있음
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Refresh already-patched locales when the chunk changes

installLanguage() returns from this isAlreadyPatched(...) branch before re-downloading the locale chunk, so any in-place hotfix that keeps the same OpenClaw version and exportName never reaches existing installs. That matters here because CONTRIBUTING.md explicitly allows “기존 번역 개선하기” by editing the existing chunk file in place; after such a typo/missing-key fix, rerunning /lang ko still reports success from the old local file, and autoUpdate() also skips it because state only tracks openClawVersion/localePackVersion rather than chunk content.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

반영했습니다. isAlreadyPatched() early-return 경로에서도 chunk 파일을 원격에서 새로 다운로드하여 덮어쓰도록 수정했습니다(12df569).

기존에는 메인 번들이 이미 패치돼 있으면 네트워크 호출 없이 상태만 복구하고 반환했기 때문에, exportName·버전이 동일한 인플레이스 번역 수정(오타 수정, 누락 키 추가 등)이 재설치해도 반영되지 않는 문제가 있었습니다.

변경 후에는 번들 패치(patchMainBundle())는 중복 실행하지 않되, chunk 파일 자체는 항상 최신 내용으로 갱신합니다. 네트워크 오류 시에는 기존 chunk를 그대로 유지하고 상태 복구만 수행합니다.

Comment on lines +5 to +9
paths:
- "locales/**"
- "locale-meta.json"
- "scripts/check-coverage.ts"
- "scripts/en-keys/**"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Trigger coverage CI when the package manifests change

This workflow now reruns for locale files, the coverage script, and scripts/en-keys, but it still skips PRs that only touch the root package.json or package-lock.json. Because the job always executes npm ci and npm run check-coverage, a manifest-only change like renaming the script or removing ts-node can break the coverage gate without ever exercising it in CI, so those dependency/script-entry files need to be in the paths filter too.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

반영했습니다. check-coverage.ymlpaths 트리거에 package.jsonpackage-lock.json을 추가했습니다(12df569).

해당 파일들이 변경되는 PR(의존성 추가·제거, scripts 항목 이름 변경 등)에서도 coverage CI가 실행되어 npm ci 실패나 npm run check-coverage 스크립트 진입점 변경을 사전에 감지할 수 있습니다.

Comment on lines +4 to +7
pull_request:
paths:
- "locales/**"
- "locale-meta.json"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Run locale validation on changes to the validator itself

All of the schema and chunk checks live inline in this workflow file, but the current paths filter only matches locales/** and locale-meta.json. A PR that edits .github/workflows/validate-locale.yml therefore skips the validator entirely, so a broken regex/YAML change can merge green and only fail on the next unrelated locale PR; the workflow file should trigger its own job.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

반영했습니다. validate-locale.ymlpaths 트리거에 .github/workflows/validate-locale.yml 자체를 추가했습니다(12df569).

기존에는 로케일 검증 로직이 담긴 워크플로우 파일만 변경된 PR이 CI를 건너뛰어, 깨진 정규식이나 YAML 오류가 다음 로케일 PR이 열릴 때까지 발견되지 않는 문제가 있었습니다. 이제 워크플로우 파일 수정 시에도 검증 job이 실행됩니다.

- plugin/index.ts: isAlreadyPatched() early-return 경로에서도 chunk 파일을
  네트워크에서 새로 다운로드하여 덮어씁니다. exportName·버전이 동일하더라도
  인플레이스 번역 수정(오타 수정 등)이 기존 설치에 반영되지 않던 문제 해결.
  patchMainBundle() 호출은 중복 실행하지 않음.

- .github/workflows/check-coverage.yml: paths 트리거에 package.json,
  package-lock.json 추가. 의존성·스크립트 항목만 변경된 PR도 coverage CI가
  실행되어 npm ci 실패나 스크립트 이름 변경을 사전에 감지할 수 있음.

- .github/workflows/validate-locale.yml: paths 트리거에
  .github/workflows/validate-locale.yml 자체를 추가. 검증 로직만 변경된 PR이
  CI를 건너뛰어 깨진 regex·YAML이 머지될 수 있던 문제 해결.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 12df5694c7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +332 to +336
writeFileSync(chunkDest, chunkContent, "utf-8");

const indexJs = findMainBundle();
if (!indexJs) {
console.warn(`[i18n-plus] ${entry.name} 메인 번들을 찾을 수 없어 자동 업데이트를 건너뜁니다.`);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid overwriting the active chunk before repatching the bundle

ko-KR-community.js is rewritten here before findMainBundle() / patchMainBundle() run. If an existing install needs a repatch (for example because exportName changed) but the upgraded Control UI bundle no longer contains the "zh-CN" anchor, this path continues with the old main bundle still pointing at the previous export while the chunk now contains the new one. That turns a previously working locale into an unloadable one after auto-update; the same write-before-patch ordering appears again in installLanguage().

Useful? React with 👍 / 👎.

Comment on lines +461 to +463
} catch {
// 네트워크 오류 시 기존 chunk를 그대로 사용 — 상태만 복구
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Fail reinstalls when the replacement chunk could not be written

In the isAlreadyPatched(...) branch, any download or writeFileSync() failure is swallowed here and the code immediately restores state + returns a success message below. If the locale chunk was manually deleted, the assets directory became read-only, or the fetch fails on a fresh node, /lang ko still reports success even though index-*.js points at a missing or stale ko-KR-community.js, so the language pack remains broken.

Useful? React with 👍 / 👎.

Comment on lines +147 to +148
const exportClausePattern = new RegExp('export\\s*\\{[^}]*\\b(\\w+)\\s+as\\s+' + escapedExport + '\\b[^}]*\\}');
const exportMatch = content.match(exportClausePattern);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Parse export clauses instead of matching raw file text

Fresh evidence against the previous fix: these regexes still scan raw content, so a chunk like var e={msg:`export{e as ko_KR}`};export{missing as wrong}; satisfies both the export-name check and the later declaration check even though the module never exports ko_KR. new Function(...) also passes because the bad export is stripped before parsing, so CI can still merge an unloadable locale file.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant