[System Report] Achieved 100% Search Accuracy: Breaking the Infinite Loop of Errors with CLAUDE.md [시스템 보고서] 검색 정확도 100% 달성: CLAUDE.md를 활용한 에러 무한 반복의 고리 끊기
[System Report] Achieved 100% Search Accuracy: Breaking the Infinite Loop of Errors with CLAUDE.md
[시스템 보고서] 검색 정확도 100% 달성: CLAUDE.md를 활용한 에러 무한 반복의 고리 끊기
1. The Challenge: The Infinite Loop of Errors
1. 도전 과제: 에러의 무한 반복
For weeks, our Hanja (Classical Chinese) RAG system suffered from a frustrating "93% similarity wall." No matter how many times we manually fixed the code, the same ranking errors kept returning.
몇 주 동안 우리 한자 RAG 시스템은 '93% 유사도의 벽'에 가로막혀 고전했습니다. 수십 번 코드를 수정했음에도 불구하고, 동일한 랭킹 오류가 반복해서 발생했습니다.
The AI agent would fix one thing but break the consistency elsewhere. We realized that fixing code was not the answer; we needed to establish a "Project Constitution."
AI 에이전트는 한 곳을 고치면 다른 곳의 일관성을 깨뜨렸습니다. 우리는 코드를 고치는 것이 답이 아니라, **'프로젝트 헌법'**을 세워야 한다는 것을 깨달았습니다.
2. The Solution: Implementing CLAUDE.md
2. 해결책: CLAUDE.md의 도입
To stop the cycle, we introduced CLAUDE.md, a set of immutable project standards that the AI must follow. This wasn't just a guide; it was a mandate for the "Golden Pipeline."
이 굴레를 끊기 위해 우리는 AI가 반드시 준수해야 하는 불변의 표준인 CLAUDE.md를 도입했습니다. 이것은 단순한 가이드가 아니라 '황금 파이프라인(Golden Pipeline)'을 위한 명령이었습니다.
[The Golden Pipeline Rules / 황금 파이프라인 규칙]
White Background Integration: Convert all transparency to solid white. (No more black background errors!)
흰색 배경 통합: 모든 투명도를 흰색 배경으로 합성합니다. (검은색 배경 오류 원천 차단)
Grayscale-First Order: Convert to Grayscale before JPEG compression to eliminate chroma noise.
흑백 선변환: 크로마 노이즈를 제거하기 위해 JPEG 압축 전 흑백 변환을 먼저 수행합니다.
Quality 95 Standard: Enforce a strict Quality 95 setting across both Ingestion and Search.
Quality 95 표준: 데이터 흡수와 검색 모두에 엄격한 Quality 95 설정을 강제합니다.
3. Solving the "Ghost Crop" Bug (The Cache Lock)
3. '유령 크롭' 버그 해결 (캐시 잠금)
The most elusive bug was the "Ghost Crop." Users saw a "Good Crop" during search, but the "Save" button would trigger a re-render, capturing a slightly shifted "Bad Crop" into the database.
가장 잡기 힘들었던 버그는 '유령 크롭'이었습니다. 사용자는 검색 시 '정상 크롭'을 보았지만, '저장' 버튼을 누르면 화면이 다시 그려지며 미세하게 어긋난 '불량 크롭'이 DB에 저장되었습니다.
We implemented a "Cache Lock." The search image is now frozen in memory (session_state). When the user clicks Save, the system pulls the exact same image used for the successful search.
우리는 **'캐시 잠금(Cache Lock)'**을 구현했습니다. 이제 검색된 이미지는 메모리(session_state)에 박제됩니다. 사용자가 저장을 누르면, 시스템은 성공적인 검색에 사용되었던 바로 그 이미지를 가져옵니다.
4. Results: Mathematical Perfection (100.00%)
4. 결과: 수학적 무결성 달성 (100.00%)
After a full physical purge of the database and a rebuild based on the new laws, we achieved the following results:
데이터베이스를 물리적으로 완전히 비우고 새로운 법전에 따라 재빌드한 결과, 다음과 같은 성과를 거두었습니다.
| Character (한자) | Old Accuracy (기존) | New Accuracy (신규) | Status (상태) |
| 充 (Chong) | 93.1% | 100.00% | Rank #1 |
| 衾 (Qin) | 90.5% | 100.00% | Rank #1 |
| 袞 (Gun) | 0% (Failed) | 99.99% | Rank #1 |
The discrepancy is gone. The system is no longer guessing; it is matching.
불일치는 사라졌습니다. 이제 시스템은 추측하지 않습니다. 정확히 일치시킵니다.
5. Conclusion: Laws for the AI Era
5. 결론: AI 시대를 위한 법전
In the era of AI-native development, the role of the developer is to be a Lawmaker. By codifying our insights into CLAUDE.md, we turned a struggling prototype into a robust, self-healing production system.
AI 네이티브 개발 시대에 개발자의 역할은 **'입법자'**가 되는 것입니다. 우리의 통찰력을 CLAUDE.md에 법전화함으로써, 우리는 불안정한 프로토타입을 견고하고 스스로 치유되는 프로덕션 시스템으로 진화시켰습니다.
댓글
댓글 쓰기