-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
priority/mediumNice to haveNice to havesize/M<200 lines<200 linestech-debtTechnical debt cleanupTechnical debt cleanup
Description
Summary
타입 시스템을 우회하는 패턴이 다수 존재. 런타임 크래시 위험.
CRITICAL
as unknown as EvidenceDocument[] — 필드 불일치 런타임 크래시
위치: packages/cli/src/formatters/review-output.ts:488
topIssues와 EvidenceDocument는 필드 구조가 다름 (title vs issueTitle). double cast로 컴파일러 우회 후 존재하지 않는 필드 접근 시 런타임 에러.
수정: 명시적 매핑 함수로 변환.
MAJOR
| # | 이슈 | 위치 | 횟수 |
|---|---|---|---|
| 1 | as unknown as ProviderInstance double-cast |
core/l1/provider-registry.ts:43-204 |
24회 |
| 2 | as any 캐스트로 @clack/prompts 타입 체크 우회 |
cli/commands/init.ts:602,609 |
2회 |
| 3 | implicit any 콜백 매개변수 |
cli/init.ts, tui/ReviewersTab.tsx 등 |
20+곳 |
| 4 | JSON.parse 결과 zod 미검증 |
cli/index.ts:785, costs.ts, sessions.ts |
다수 |
| 5 | as Record<string, unknown> 반복 캐스트 |
web/EventLog.tsx, Config.tsx, ResultsScreen.tsx |
다수 |
| 6 | readJson<T> 스키마 없이 호출 시 as T 무검증 |
shared/utils/fs.ts:125-130 |
— |
MINOR
| # | 이슈 | 위치 |
|---|---|---|
| 7 | as { status?: number } unsafe cast |
github/poster.ts:70 |
| 8 | non-null assertion on regex capture | github/mapper.ts:89 |
| 9 | non-null assertion on Map.get() | cli/commands/agreement.ts:30-33 |
수정 방향
- provider-registry: AI SDK 타입에 어댑터 함수 추가 (24회 일괄 해소)
- JSON.parse: zod
.parse()또는.safeParse()적용 - readJson: 제네릭 대신 zod 스키마 파라미터 추가
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
priority/mediumNice to haveNice to havesize/M<200 lines<200 linestech-debtTechnical debt cleanupTechnical debt cleanup