Skip to content

[FEAT] 문서 참조 추출기 계약 회귀 테스트 보강 - #203

Merged
poketopa merged 4 commits into
developfrom
feat/202
Aug 20, 2026
Merged

poketopa merged 4 commits into
developfrom
feat/202

Conversation

@sun007021

Copy link
Copy Markdown
Member

관련 이슈

Closes #202

변경 배경

그래프 참조 계산 시점이 읽기에서 문서 쓰기와 backfill로 이동할 예정이다.

CrewDocumentReferenceExtractor의 현재 추출 계약을 먼저 회귀 테스트로 고정하지 않으면, 후속 작업에서 그래프 간선이 조용히 달라져도 알아채기 어렵다. production 추출 로직과 API 계약은 변경하지 않고 현재 동작만 테스트로 드러낸다.

변경 내용

  • 첫 등장 순서 유지와 중복 제거 계약 검증 추가
  • 대문자 hex UUID 정규화 검증 추가
  • ), ,, :, 등 허용 문장부호 경계 검증 추가
  • UUID 뒤 영문·숫자·_·~·- 접미 제외 검증 추가
  • http scheme과 URL 구성 문자 접두 제외 검증 추가
  • ?query, #fragment, /child 접미의 현재 동작 characterization
  • 마침표 접미와 공백이 있는 이미지 주소의 현재 동작 characterization
  • 이미지를 감싼 링크가 현재 제외되는 동작 characterization
  • 자기참조와 target 존재 여부가 추출 이후 단계의 책임임을 테스트로 명시
  • null, "", 공백, 줄바꿈·tab 입력 검증 보강

검증

  • 테스트 통과
    • Java 17 전체 테스트 123개 통과
    • failures 0, errors 0, skipped 0
    • CrewDocumentReferenceExtractorTest 15개 통과
  • 변경 동작 확인
    • src/main diff 0줄, production 파일 무변경 확인
    • git diff --check 통과
    • 기존 테스트 4개 중 3개는 동일하게 유지, extract_success_byEmptyContents만 입력 케이스 추가 방향으로 보강
    • 정규식 lookbehind·lookahead와 isMarkdownImage 분기를 직접 대조해 각 기대값이 현재 구현의 동작임을 확인

영향 및 참고사항

  • production extractor와 그래프 API는 변경하지 않았다.
  • 후속 쓰기 동기화와 backfill은 별도 정규식을 만들지 말고 extract(String)을 그대로 재사용해야 한다.
  • extractor는 문자열 문법과 중복 제거만 책임진다. 자기참조 제외, target 존재 여부, 세대 범위 판단은 source UUID와 저장소를 아는 이후 계층의 책임이다.
  • 아래 동작은 이번 범위에서 수정하지 않고 현재 상태 그대로 테스트에 고정했다. 제품 정책 검토가 필요하면 별도 이슈로 다룬다.
    • ?query, #fragment, /child가 붙어도 canonical URL prefix가 일치해 UUID를 반환한다.
    • UUID 바로 뒤에 마침표가 붙으면 UUID를 반환하지 않아, 한국어 본문에서 문장 끝 링크가 누락될 수 있다.
    • ![alt]( URL)처럼 여는 괄호 뒤에 공백이 있으면 이미지로 판별하지 못해 UUID를 반환한다.
    • [![alt](img)](URL)처럼 이미지를 감싼 링크는 이미지로 오판해 UUID를 반환하지 않는다.
    • URL 앞 문자가 URL 구성 문자면 매칭하지 않아, 참고:URL 형태가 누락된다.

@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 1598d3b1-6da4-4c04-8cb0-91a67537edab

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@poketopa poketopa left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

production 코드를 변경하지 않고 현재 추출 동작과 책임 경계를 충분히 테스트로 고정한 것을 확인했습니다. 관련 테스트와 전체 CI도 통과해 병합을 막을 사항은 없습니다. 다만 query·fragment·마침표·Markdown image 경계처럼 버그 가능성이 있는 동작은 장기 계약과 구분해 후속 이슈에서 검토하면 좋겠습니다.

@poketopa
poketopa merged commit c0bd336 into develop Aug 20, 2026
2 checks passed
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.

2 participants