feat: AI 텍스트 포맷 계약 + 마크다운 렌더러 도입 - #213
Merged
Merged
Conversation
shared/ui/Markdown — react-markdown+remark-gfm+rehype-sanitize(security.md §4.4
지정 조합, exact pin). 렌더러 본체는 React.lazy 청크로 분리해 메인 번들
+4.9KB 에 그친다(로딩 사이 fallback 은 종전과 동일한 plain text). GFM 계약
필드(코칭 모범답안·리라이트, 분석 산출물)에만 적용 — plain 계약 필드
(하이라이트 매칭·델타 스트리밍 표면)와 사용자 입력은 렌더하지 않는다.
분석 상세 모달에 '분석 원문 보기' 신설 — presigned 직접 fetch 는 내부
호스트라 불가하므로 Core 프록시(GET /api/documents/{id}/content) 경유.
오답노트 목록/드릴의 중복 패널은 ReviewBlock 으로 공용화. 테스트 +4.
GET /api/documents/{id}/content — presigned URL 은 내부(MinIO) 호스트라
브라우저가 직접 접근할 수 없어 Core 가 소유권 검증 후 원문 바이트를
중계한다(TTS 오디오 프록시와 동일 패턴). 테스트 3건.
plain text 계약 필드(피드백 요약·highlights·studyPlan·패널 detail·질문)는 마크다운 서식 기호 금지 — 하이라이트 부분 문자열 매칭·스트리밍 표시와의 충돌을 원천 차단. answer_coaching 의 model_answer/answer_rewrite 만 GFM 마크다운 허용(프론트가 sanitize 렌더).
messaging.md §5.4/§5.11 포맷 계약, frontend-types.md §6.5 신설(필드-렌더 매핑 표), design-system.md §2.14 프로즈 렌더링 규정 신설(+아이콘 §2.15 재번호·§3 인벤토리 등재), api-conventions.md 문서 원문 프록시 행.
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.
변경 사항
A5. 조사 결과 "전면 렌더러"가 아니라 필드별 포맷 계약이 정답이었다 — 계약상 마크다운은 분석 산출물 1곳뿐이고, highlights("글자 그대로 발췌" 계약)·델타 스트리밍·인라인 합성이 마크다운 렌더와 구조적으로 충돌한다.
계약 (양끝 명문화)
answerCoaching.modelAnswer/answerRewrite(STAR 골격·코드 가치 실재) + 분석 산출물(documentPath문서)messaging.md§5.4/§5.11 ·frontend-types.md§6.5(신설) ·design-system.md§2.14(신설)렌더러 (
frontend/)shared/ui/Markdown— react-markdown@10.1.0 + remark-gfm@4.0.1 + rehype-sanitize@6.0.0 (security.md §4.4 지정 조합, exact pin, coding-conventions §6: MIT, 활성 릴리스, remark 생태계 표준 — 대체재 marked+DOMPurify 는 문서 지정 조합이 아니고 sanitize 를 별도 조립해야 해 배제)ReviewBlock공용화)분석 원문 보기 (
backend/+frontend/)GET /api/documents/{id}/content신설(TTS 오디오 프록시 선례, 소유권 검증) + openapi/generated.ts 재생성검증