Skip to content

feat: 비개발 문서 분석 1차 구현 - #35

Closed
danjee2009 wants to merge 5 commits into
mainfrom
feat/#33-document-analysis-v1
Closed

danjee2009 wants to merge 5 commits into
mainfrom
feat/#33-document-analysis-v1

Conversation

@danjee2009

@danjee2009 danjee2009 commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

비개발 6직무의 문서가 기존 개발 포트폴리오 요약 경로로 처리되면 단일 그림·벡터 구성도·표의 원문 근거가 빠집니다. 문서 분석 1차 명세(07)에 따라 종류가 있는 PDF 최대 5개·합계 50쪽을 읽고, 검증한 인용으로 profile v2와 원질문 사이클을 연결합니다.

동작

  • 페이지 A~F 판정, 본문·표 원본/행 출처 보존, 반복 여백 로고 제외, 밀집 표·초장형 분할, 확대 재읽기를 추가합니다. 50단위는 배치 크기이며 뒤쪽 페이지를 자르는 호출 상한이 아닙니다.
  • 비전 전사/관계/요약을 구분하고 부분 실패는 unreadPages, profile 입력 예산 축약은 droppedPages로 기록합니다. 텍스트 가리기·원문 인용 일치·서버 출처 우선순위로 근거를 검증합니다. 요약·관계만으로는 인용을 인정하지 않습니다.
  • /profile의 jobRole/documents/supplements, 직무별 필수 문서·GitHub 규칙, UNREADABLE_DOCUMENT, profile v2 콜백을 연결합니다. 저장된 재료로만 비개발 질문 사이클을 생성합니다.
  • 옛 요청과 개발 직무는 기존 profile v1·모델 입력을 유지합니다. 개발 다중 문서는 기존 추출 경로와 요청 전체 15장 비전 상한을 공유합니다.
  • 구현 계약/가정은 docs/document-analysis-v1.md, 서버 계약은 docs/api.md에 기록했습니다.

검증

  • uv run ruff check --no-fix src tests
  • uv run ruff format --check src tests
  • uv run mypy src tests
  • uv run lint-imports: 2개 계약 유지
  • uv run pytest tests -q: 786 passed, 1 skipped
  • 개발 회귀 골든 변경 없음(rebase 전 test: 개발 직군 모델 입력 회귀 기준 고정 #34 기준). 생성 PDF·가짜 클라이언트·실제 Anthropic SDK의 모의 HTTP·FastAPI 접수/콜백으로 67개 검사를 추가했습니다. 전체 테스트 뒤 자체 리뷰에서 밀집 표 분할, 겹침 전사 제거, E형 라벨의 인용 제외, 직무 카테고리 설명·힌트를 보완했습니다.

선행 조건과 범위

  • 2026-10-18: 선행 PR #34는 같은 목적의 #40이 main에 먼저 병합되어 닫았습니다. 이 PR은 main(de97fcf) 위로 rebase하고 base를 main으로 바꿨습니다. rebase 후 다시 확인한 결과 ruff·format·mypy·import-linter를 통과했고 pytest tests -q 806 passed, 1 skipped입니다. #40의 개발 회귀 골든도 변경 없이 통과합니다.
  • 한국어 20쪽 유료 모델 비교 M-1은 미실행입니다. 명세의 사전 비용 확인 절차가 남아 있으므로 Draft로 제출합니다. 현재 검사는 실제 모델의 전사 정확도·처리 시간·실비 검증이 아닙니다.
  • Analysis 문서 분석 1차만 구현했습니다. API/auth/Web/Chat의 직군 확장, 테일러·채점 확장, 영상 분석과 배포는 포함하지 않습니다.
  • 이미지 전송 전의 전체 비식별화는 제공하지 않습니다. 읽은 텍스트 결과에 가리기를 적용합니다.

Resolves #33

@danjee2009
danjee2009 force-pushed the feat/#33-document-analysis-v1 branch from ed2f45f to b11f1e8 Compare October 18, 2026 02:14
@danjee2009
danjee2009 changed the base branch from test/#32-dev-role-regression to main October 18, 2026 02:14
@danjee2009 danjee2009 linked an issue Oct 18, 2026 that may be closed by this pull request
7 tasks
@danjee2009

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T23:48:15.635566Z 7625a23 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b11f1e84b8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +187 to +188
summaries = any(reading.summaries.get(f"{document.id}/p{page.number}") for page in document.pages)
if len(direct.strip()) >= 50 or vision or summaries: # noqa: PLR2004

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Do not count non-citable summaries as readable

When a required visual document produces only a summary—such as when both reads have low legibility and return an empty transcript—this predicate treats the document as readable even though summaries are explicitly excluded from evidence. The pipeline then invokes profile generation and may report INSUFFICIENT_EVIDENCE, or even succeed from optional repository evidence, instead of returning UNREADABLE_DOCUMENT before generation as required; readability should require direct text, table content, or a vision transcript.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

05ea43e에서 반영했습니다. _ensure_readable에서 읽기 요약 조건을 빼서, 직접 추출 텍스트·표(50자 이상)나 비전 전사가 없으면 필수 문서는 UNREADABLE_DOCUMENT로 생성 전에 끝납니다. 요약만 있는 경우의 회귀 테스트를 추가했고(수정 전 실패 확인), 전체 검사 807 passed입니다.

danjee2009 and others added 2 commits October 18, 2026 19:54
인용할 수 없는 읽기 요약을 읽기 가능 판정에서 빼서, 요약만 나온 필수 문서는
종합 데이터 생성 전에 UNREADABLE_DOCUMENT로 끝나게 한다(Codex 리뷰 P2).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#42(PDF 텍스트 복구)와 #35(비개발 문서 분석 1차)의 충돌을 해소한다.

- dto: ProfileJobRequest 문서 필드와 profile v2, documentExtraction 보고서를 함께 둔다.
  실패 코드는 UNREADABLE_DOCUMENT와 DOCUMENT_* 3종을 모두 유지한다.
- dispatch: 개발 경로 첫 PDF에 품질 검사·복구·정제 단계를 적용하고, 추가 개발 문서는
  원문 추출 뒤 정제만 거친다. 실패 코드 분기와 보고서 첨부를 합친다.
- ioc: 문서 분석 처리기와 복구 단계를 모두 주입한다. DocumentExtract는 정제 규칙이
  옮겨 간 Stage2TextClean을 받는다.
- docs/api.md: 두 계약을 모두 반영하고 복구·보고서 적용 범위와 코드 구분을 적는다.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@danjee2009 danjee2009 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

검토 범위: 비개발 문서 추출·가림 처리, 근거 검증, 프로필 생성 및 질문 사이클 연결. 전체 PR diff와 관련 파이프라인 경계를 확인했습니다. 테스트는 다시 실행하지 않았으며, 확인한 범위에서 추가 지적 사항은 없습니다.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7625a23f46

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +39 to +41
return any(
part.startswith((".env", "id_rsa")) or part.endswith((".tfstate", ".tfvars", ".tfvars.json", ".pem", ".key"))
for part in Path(path).parts

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Normalize path parts before filtering sensitive files

When a repository contains a case-variant secret filename such as .ENV.production, ID_RSA, or SERVER.PEM, these case-sensitive checks do not recognize it. The file consequently remains in path_index, allowing the exploration model to request its contents and potentially send credentials to the external model; normalize each path component (for example with casefold()) before applying the prefix and suffix checks.

Useful? React with 👍 / 👎.

Comment on lines +183 to +185
except (AnthropicTextClientError, ValueError, RuntimeError):
logger.warning("nondev.page_reader.unread document=%s page=%s", document.id, page.number)
return None, False

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Retry transient page-read failures

When the initial page-read call raises AnthropicTextClientError, ValueError, or RuntimeError, this returns needs_reread=False, so _read_region skips the advertised second attempt and immediately marks the page unread. A one-off exhausted API or runtime failure can therefore reject an otherwise readable visual-only required document as UNREADABLE_DOCUMENT; return a retry indication for recoverable initial-call failures, while still stopping after the reread attempt.

Useful? React with 👍 / 👎.

danjee2009 and others added 2 commits October 20, 2026 13:56
질문 사이클 충돌 해소:
- rules/tools: main의 세트별 범위(set_numbers)와 #35의 직무별 문자열 카테고리를 함께 둔다.
- generate: main의 SOLO 세트별 분할·잘림 재시도 구조를 기준으로 비개발 v2 경로를 얹는다.
  v2는 지금처럼 사이클 전체를 한 번에 만들고, 바뀐 _call(응답 객체·job_id)에 맞춰
  토큰 한도로 잘리면 같은 요청을 새 대화로 다시 보낸다. v2 세트별 분할은 적용하지 않았다.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- 비개발 저장소 트리 필터가 .ENV, ID_RSA, SERVER.PEM처럼 대소문자만 다른 비밀 파일도 거른다.
- 페이지 읽기 호출이 실패하면 명세(처리 3)대로 확대 재읽기를 1회 하고, 재읽기까지 실패하면 미판독으로 둔다.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
danjee2009 added a commit that referenced this pull request Oct 20, 2026
#35(872ee56)의 Codex P2 수정 2건을 옮긴다.
- 비개발 저장소 트리 필터가 .ENV, ID_RSA, SERVER.PEM처럼 대소문자만 다른 비밀 파일도 거른다.
- 페이지 읽기 호출이 실패하면 명세(처리 3)대로 확대 재읽기를 1회 하고, 재읽기까지 실패하면 미판독으로 둔다.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@danjee2009

Copy link
Copy Markdown
Member Author

#52(일반 직군 6종)가 이 PR(7625a23)을 통합했으므로 닫습니다.

  • 이 PR에 마지막으로 넣은 Codex P2 수정 2건(민감 파일 이름 대소문자 무시, 페이지 읽기 호출 실패 시 확대 재읽기 1회)은 #52에 옮겼습니다(d253548).
  • #52는 최신 main과 병합해 충돌을 해소했습니다(69ac49f).
  • 머지는 M-1 비용 검증을 마친 뒤 #52로 진행합니다.

🤖 Generated with Claude Code

@danjee2009 danjee2009 closed this Oct 20, 2026
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.

feat: 비개발 문서 분석 1차 구현

1 participant