feat: OCR 실행 이력 저장과 HR 검토 API 구현 - #112
Open
hywznn wants to merge 8 commits into
Open
Conversation
hywznn
force-pushed
the
feat/95-ocr-run-storage
branch
from
August 8, 2026 05:23
15a5af3 to
303cd8e
Compare
8 tasks
krestar
approved these changes
Aug 8, 2026
krestar
left a comment
Contributor
There was a problem hiding this comment.
Issue 요구사항 기준으로 OCR 실행 이력·멱등성·권한 격리·암호화 저장·HR 검토 흐름까지 전반적으로 잘 구현된 것 확인했습니다.
특히 HR 승인 전 Worker/Document 값이 자동 반영되지 않고, 민감정보가 암호화 및 감사로그에서 보호되는 점도 확인했습니다.
추가로 blocking할 이슈는 없어 Approve 하겠습니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
왜 필요한가요?
Refs #8
Closes #95
HR이 여권·외국인등록증 OCR을 요청하면 Server가 실행 이력을 안전하게 보관하고, AI 응답을 다시 검증한 뒤 HR 검토까지 통제해야 합니다. AI Runtime은 Server DB에 직접 접근하거나 업무 데이터를 자동 확정하지 않습니다.
구조 정리
main에 분리·병합했습니다.main의 Import MigrationV30·V31다음에는 #117이V32를 사용합니다.V33·V34를 사용하므로 [Worker Link][P0] 근로자 링크 전달 완료 기록·조회 API 구현 #117 병합 후 병합합니다.무엇이 바뀌나요?
실행 복구
DocumentOcrExecutionRequestedOutbox 이벤트를 같은 트랜잭션에 저장합니다.RUNNING이던 실행도 같은runtime_request_id로 재처리해 완료 또는 실패 상태로 수렴합니다.HR 검토
corrected_fields를 추가했습니다.APPROVE는 OCR 검토 완료를 의미하며 Worker·Document·Agent slot을 자동 수정하지 않습니다.Runtime 응답 검증
YYYY-MM-DD로 파싱합니다.SUCCEEDED인데 fields가 비었거나 Template 정보가 모순되면 거부합니다.주요 API
POST /api/v1/documents/{documentId}/ocr-runsGET /api/v1/documents/{documentId}/ocr-runs/{ocrRunId}GET /api/v1/documents/{documentId}/ocr-runs/latestPOST /api/v1/documents/{documentId}/ocr-runs/{ocrRunId}/review검토 요청 예시:
{ "expected_version": 2, "decision": "APPROVE", "corrected_fields": { "passport_number": "M12345678" } }응답의
result.fields는 AI 원본이고corrected_fields는 HR 수정값입니다.Migration
V33__create_document_ocr_run.sqlV34__prepare_document_ocr_run_rls.sql검증
main기반으로 OCR commit만 재구성./gradlew clean testmain에서 Migration·전체 테스트 재검증병합 전 남은 연동 조건
feat/DB_to_SERVER에 병합develop대상으로 PR 생성·검증위 조건 전까지
AI_OCR_ENABLED=false,DOCUMENT_OCR_ENABLED=false를 유지합니다. Server 코드는 준비되지만 실제 OCR 서비스 활성화는 별도 확인이 필요합니다.