Skip to content

[#48] AI 코드 문맥을 debug artifact에서 보호한다#62

Merged
opficdev merged 3 commits into
developfrom
feat/#48
Jul 17, 2026
Merged

[#48] AI 코드 문맥을 debug artifact에서 보호한다#62
opficdev merged 3 commits into
developfrom
feat/#48

Conversation

@opficdev

Copy link
Copy Markdown
Owner

🔗 연관된 이슈

🎯 의도

  • OpenAI에 전달하는 AI 코드 문맥과 debug artifact 표현의 분리
  • consumer repository 코드 원문과 제안 patch 원문의 artifact 저장 방지
  • 파일, 줄 범위, 크기, hash, 잘림 여부를 통한 추적 가능성 유지

📝 작업 내용

📌 요약

  • ai-prompt.json의 코드 문맥 원문을 metadata로 치환
  • ai-response.jsonpatch 원문을 metadata로 치환
  • 기존 OpenAI 요청, report Suggested Patch, secret redaction, debug artifact 비활성 동작 유지
  • README.md의 debug artifact 설명 정합성 갱신

🔍 상세

  • userPromptcontentfilePath, startLine, endLine, lineCount, contentByteLength, contentHash, truncated로 변환
  • non-JSON userPrompt를 원문 없이 byte length, hash, redaction 여부로 기록
  • AI response의 중첩 patchbyteLength, lineCount, hunkRanges로 변환
  • unified diff hunk header에서 oldStart, oldCount, newStart, newCount 추출
  • 코드 원문 미포함, metadata 유지, 기존 response 필드 보존 테스트 추가

📸 영상 / 이미지 (Optional)

  • 해당 없음

@opficdev opficdev self-assigned this Jul 17, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

본 풀 리퀘스트는 민감한 소스 코드 유출을 방지하기 위해 AI 프롬프트 및 응답 디버그 아티팩트(ai-prompt.json, ai-response.json)에서 원본 코드와 패치 내용을 제거하고 메타데이터(바이트 길이, 해시, 라인 수, 헌크 범위 등)로 치환하는 정제(Sanitization) 기능을 추가합니다. 리뷰어는 테스트 코드(tests/workflows/mergeRiskWatch.test.ts)에서 정제된 아티팩트 값과 정제되지 않은 OpenAI 요청 값을 직접 비교하여 테스트가 실패하게 되는 오류를 지적하였으며, 원문이 정상적으로 제거되고 메타데이터가 기록되었는지 검증하도록 구체적인 테스트 코드 수정을 제안했습니다.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread tests/workflows/mergeRiskWatch.test.ts Outdated
@opficdev
opficdev merged commit 5809cef into develop Jul 17, 2026
3 checks passed
@opficdev
opficdev deleted the feat/#48 branch July 17, 2026 09:56
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.

AI 코드 문맥을 debug artifact에서 보호한다

1 participant