test: 현재 코드 전용 자동화 테스트 진입점을 추가한다 - #10
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 820b5e2264
ℹ️ 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".
| const registry = new PluginRegistry(createCatalog()); | ||
|
|
||
| assert.deepEqual(registry.listToolsForPlugins([]), []); | ||
| assert.deepEqual(registry.listToolsForPlugins(["backend"]), [ |
There was a problem hiding this comment.
Add an unselected plugin to the selection test
If listToolsForPlugins regresses to returning every plugin whenever the selection is nonempty, this test still passes because backend is the catalog's only plugin; the empty-selection assertion does not exercise exclusion either. Add a second plugin/tool and verify that selecting backend omits it so this test actually protects the selected-plugin boundary.
Useful? React with 👍 / 👎.
| assert.equal(catalog.plugins[0]?.tools[0]?.description, "Check backend health"); | ||
| assert.equal(Object.isFrozen(catalog), true); | ||
| assert.equal(Object.isFrozen(catalog.plugins), true); | ||
| assert.equal(Object.isFrozen(catalog.plugins[0]?.tools), true); |
There was a problem hiding this comment.
Assert deep freezing of tool definitions
If catalog freezing regresses to cover only the root and collection arrays, all three assertions still pass while individual tool definitions and nested objects such as access, inputSchema, and execution remain mutable. Assert those leaf objects are frozen, or attempt a representative mutation, so the test named for deep-freeze behavior detects the unsafe partial implementation.
Useful? React with 👍 / 👎.
현재 코드 전용
npm test와 테스트 4개를 추가하고 Linux + Node.js 20을 필수 CI 기준으로 고정했습니다. 최신 head의 CI는 통과했으며 비작성자 리뷰가 남아 있습니다. Windows PowerShell은 선택적 로컬 호환성 확인입니다.연결된 작업 항목 및 계약
AGENTS.md의 로컬 검증, PRD 04의 현재 코드 전용 테스트 진입 조건develop@71f20692a302dd587bb699935824651e3c8a01a7feature/donghun-current-code-test-foundation820b5e22641030c715fb2029f2f7047152a6c8b1worud8457핵심 검토
기존 저장소에는 자동화된
test명령과 테스트 파일이 없어 현재 Discord·Diagnostic·YAML 코드의 회귀를 반복 검증할 수 없었습니다. 이제 현재 코드 전용 테스트를 한 명령으로 실행하고, Linux + Node.js 20에서 설치·테스트·정적 검사·빌드를 PR마다 검증합니다.필수 제품 검증의 정본 환경은 Linux + Node.js 20입니다. Windows PowerShell은 선택적 로컬 개발 호환성 확인이며 필수 CI를 대체하지 않습니다. 현재 테스트 기반의 통과만으로 #4/#7 제품 계약, P0 전체 검증 또는 병합 준비 완료를 주장하지 않습니다. 최신 head에 대한 비작성자 리뷰가 남아 있습니다.
변경 전과 변경 후
package.json:npm test가 테스트 TypeScript를 타입 검사한 뒤 현재 코드 테스트를 실행합니다.tests/run-tests.mjs:*.test.ts를 정렬해 직접 열거하고, 파일 0개·child process 시작 오류·테스트 실패를 non-zero로 처리합니다. PowerShell/Bash 전용 문법이나 셸 glob에 의존하지 않습니다.tsconfig.test.json: 제품 TypeScript와 테스트 파일을 함께 정적 검사합니다.tests/unit/current-code-foundation.test.ts: catalog 파싱·freeze, writable Tool 거부, 선택 plugin의 Tool 노출, 임시 표시/Discord 포매팅을 4개 테스트로 검증합니다..github/workflows/current-code-validation.yml: 기존 workflow가 없어 단일 Ubuntu/Node 20 job을 추가했습니다.develop대상 PR과developpush에서 실행하며 PR은 실제 head SHA를 checkout합니다. 실행 명령은npm ci,npm test,npm run typecheck,npm run build네 개입니다.contents: read, checkout 자격 증명 비보존, 10분 timeout을 적용합니다.이번 후속 커밋
820b5e2의 저장소 변경은 CI 파일 하나입니다. 기존 테스트 기반은c5400eb에 있습니다.src/**, 의존성,package-lock.json, PRD·스키마, PR #8 문서 브랜치를 변경하지 않았습니다. #4 출력 포트와 #7 Report Agent·정본 Discord 전달 구현은 별도 범위입니다.절충안 분석
기존
tsx와 Node 내장node:test를 사용해 새 프레임워크와 잠금 파일 변경을 피했습니다. Vitest 도입은 현재 필요한 기반보다 설정·의존성 변경이 크고, #4/#7에서 개별 러너를 만들면 실행 의미가 중복됩니다.CI는 Linux/Node 20 단일 job을 선택했습니다. Windows까지 필수 matrix에 넣으면 검증 비용이 늘고 선택적 호환성 확인이라는 기준과 맞지 않습니다. Node/tsx의 플랫폼 차이는 두 환경의 결과를 분리해 기록합니다. CI 명령 실패는 job 실패로 이어지며, 의존성 다운로드 장애는 테스트 회귀와 구분해 로그로 확인해야 합니다.
검증 근거
필수 제품 검증: Linux + Node.js 20
Actions 실행 34255016082과 Linux / Node.js 20 job은
completed / success입니다. checkout 로그의 SHA도 위 검증 head와 일치합니다.실제 환경은 Ubuntu 24.04.4, Node v20.20.2, npm 10.8.2입니다. 2026-09-08 17:06:01 UTC에 완료했습니다.
npm cinpm testnpm run typechecknpm run build선택적 로컬 호환성: Windows PowerShell
환경: Node v24.13.0, npm 11.19.1, 기존 worktree.
npm testnpm run typechecknpm run buildgit diff --check origin/develop...HEAD샌드박스에서는
tsx의os.userInfo()호출이uv_os_get_passwd returned ENOMEM으로 실패했습니다. 동일한npm test를 호스트에서 재실행해 통과했습니다. 로컬 의존성과 잠금 파일이 그대로여서 이번 세션에서는 로컬npm ci를 반복하지 않았습니다.유지하는 이전 검증 기록
c5400eb의 Windows 환경에서npm ci --offline --no-audit --no-fund통과: 56 packages.npm test는 4 pass, 1 fail, exit 1이었습니다. 이번 CI 변경에서 실패 주입을 다시 실행하지 않았습니다.fetch참조는 0건이었습니다. 현재 import 경로도 메모리 입력을 처리하는 순수 모듈입니다.위험 및 롤백
테스트는 메모리 fixture와 순수 모듈만 사용합니다. 실제 자격 증명, 프로세스 비밀정보 값, OpenAI, Discord, Prometheus, Loki, AMDB Backend를 사용하지 않습니다. CI의 저장소 checkout과 공개 npm 의존성 설치는 네트워크를 사용합니다. 제품용 secrets와 운영 source 설정은 주입하지 않습니다.
CI만 되돌리려면
820b5e2를 revert합니다. 테스트 기반 전체를 되돌리려면 CI와c5400eb의 테스트 스크립트·설정·파일을 함께 revert합니다. 제품 코드와 데이터 마이그레이션은 없습니다.병합 점검표
develop에 병합한 뒤 #9를 닫습니다. 자동 merge는 수행하지 않습니다.