Skip to content

[ocr-lambda] 생기부 출결 행 변환 회귀 테스트 추가 - #516

Merged
s2yeons merged 1 commit into
developfrom
test/515-ocr-attendance-row-conversion
Oct 13, 2026
Merged

s2yeons merged 1 commit into
developfrom
test/515-ocr-attendance-row-conversion

Conversation

@s2yeons

@s2yeons s2yeons commented Oct 12, 2026

Copy link
Copy Markdown
Member

개요 💡

생기부 OCR 자동 입력 시 비교과 출결(결석·지각·조퇴·결과)에 질병·기타 값까지 포함되는 문제가 보고되었습니다. 원인은 서버 MiddleSchoolRecordParser.readAttendance()가 각 항목의 질병/미인정/기타 3칸을 합산하는 데 있으며, 감점 대상인 미인정 칸만 반영하도록 백엔드 수정이 별도로 필요합니다.

서버가 미인정 칸만 읽게 되면 ocr-lambda가 출결 행을 변환할 때 열이 한 칸만 밀려도 질병 값이 미인정 자리로 들어가 점수에 반영됩니다. 그런데 출결 행 변환에는 테스트가 없었기 때문에, 열 위치 보존을 회귀 테스트로 고정하였습니다. 이 PR은 테스트만 추가하며 런타임 동작은 변경하지 않습니다.

작업내용 ⌨️

  • achievementTextConverter.test.ts에 실제 생기부와 같은 2.출결상황 섹션과 헤딩 2줄(학년/수업일수, 질병/미인정/기타 ×4)을 갖춘 출결 표 입력을 구성하였습니다.
  • 12칸에 서로 다른 값을 넣어 convertAttendanceRow가 원본 열 순서 그대로 숫자 12개를 내보내는지 검증하는 테스트를 추가하였습니다.
  • 빈 칸과 스캔 잡음(., •)이 건너뛰어지지 않고 제자리에서 0으로 바뀌어 항상 숫자 12개가 되는지 검증하는 테스트를 추가하였습니다.
  • 출결 칸이 모두 비어 있고 특기사항이 개근이면 개근 줄로 내보내는지, 출결 칸에 값이 있으면 개근으로 덮지 않는지 검증하는 테스트를 추가하였습니다.
  • 변환 코드의 열 시작 위치를 일부러 한 칸 밀었을 때 새 테스트 4개가 모두 실패하는 것을 확인하였습니다. pnpm --filter @repo/ocr-lambda test(16개 통과), lint, check-types 모두 통과하였습니다.

관련 이슈 🚨

#515 (세부 작업 1~3)

이슈의 세부 작업 4~5(실제 생기부 PDF로 출결 행 셀 개수 확인, 그 결과에 따른 열 개수 검증 적용 여부 결정)는 실제 PDF 확인이 필요하여 이번 범위에서 제외하였고, 이슈는 열어 둡니다. 질병 포함 문제 자체는 서버 MiddleSchoolRecordParser 수정으로 해결되어야 하며 이 PR로는 해결되지 않습니다.

리뷰 요청사항 👀

테스트 입력은 출결 행이 15칸(학년, 수업일수, 12칸, 특기사항)으로 들어온다고 가정하고 만들었습니다. kordoc이 실제 PDF에서 병합 셀(colSpan)로 칸 수를 줄여 내보내는 경우가 있다면 이 가정이 맞지 않으므로, 실제 출결 표 구조를 확인해 보신 분이 있다면 의견 부탁드립니다.

@vercel
vercel Bot temporarily deployed to Preview – hellogsm-client-26 October 12, 2026 08:18 Inactive
@vercel

vercel Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated
hellogsm-client-26 Skipped Skipped Oct 12, 2026 8:18am UTC
hellogsm-client-26-admin Skipped Skipped Oct 12, 2026 8:18am UTC

Request Review

@vercel
vercel Bot temporarily deployed to Preview – hellogsm-client-26-admin October 12, 2026 08:18 Inactive
@s2yeons s2yeons self-assigned this Oct 12, 2026
@s2yeons
s2yeons requested a review from yeondon125 October 12, 2026 08:19

@pr-agent-demo pr-agent-demo 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.

Overview

  • ocr-lambda의 achievementTextConverter.test.ts에만 생기부 출결 행 변환 회귀 테스트를 추가한다.
  • 런타임 로직은 변경하지 않고, 2.출결상황 표의 열 순서 보존·빈 칸/스캔 잡음 처리·개근 조건부 출력을 고정한다.

Intent

  • 서버가 출결의 질병/미인정/기타 3칸 중 미인정만 반영하도록 수정될 때, ocr-lambda에서 열이 한 칸만 밀려도 질병·기타 값이 미인정 자리에 들어가는 회귀를 방지하기 위함.
  • 출결 12칸의 위치 보존, 빈 칸/잡음의 0 치환, 개근 처리 로직을 테스트로 고정한다.

Risk

  • 전체적으로 낮음: 테스트 파일 추가만.
  • 확인 필요: 출결 행 15칸(학년, 수업일수, 12칸, 특기사항) 가정과 실제 kordoc PDF/병합 셀(colSpan) 구조 일치 여부.
  • 이 PR은 질병 포함 감점 문제 자체는 해결하지 않으며, 서버 MiddleSchoolRecordParser 수정이 별도 필요.

0 inline comment(s)

@yeondon125 yeondon125 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.

수고하셨습니다.

@s2yeons
s2yeons merged commit 3b75b4d into develop Oct 13, 2026
5 checks passed
@s2yeons
s2yeons deleted the test/515-ocr-attendance-row-conversion branch October 13, 2026 04:59

This branch was previously deployed

2 inactive deployments
Preview – hellogsm-client-26 — a72d9bee Deployed Oct 12, 2026 by vercel[bot]
Preview – hellogsm-client-26-admin — a72d9bee Deployed Oct 12, 2026 by vercel[bot]
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