test(e2e): table-cell multi-paragraph regression + md2hwp schema pipeline - #25
test(e2e): table-cell multi-paragraph regression + md2hwp schema pipeline#25baekho-lim wants to merge 31 commits into
Conversation
… engine - AGENTS.md: Instructions for ChatGPT Codex and other AI agents - docs/md2hwp/DESIGN.md: Full architecture, fill_plan.json schema, gap analysis - .github/ISSUE_TEMPLATE/task.md: AI-consumable issue template - tools/md2hwp/fill_hwpx.py: HWPX template injection engine (3 strategies) - tools/md2hwp-ui/: Web preview server + HWPX-to-HTML renderer - testdata/hwpx_20260302_200059.hwpx: 재도전성공패키지 test template Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- CLAUDE.md: Add md2hwp section with collaboration model - AGENTS.md: Fix file paths (scripts/ -> tools/md2hwp/) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…rovements feat(md2hwp): implement phase2 p1 multi-paragraph and analyze mode
All 3 bugs fixed, 24 tests pass. Follow-up issues for remaining improvements.
chore(automation): add claude-codex loop state machine and guardrails
…refactor fix(md2hwp): resolve fallback scope and complete phase follow-up tests
fix/test(md2hwp): refine analyze placeholders and harden E2E assertions
…aragraphs fix(hwpx): preserve table-cell paragraph boundaries in markdown
Add compile_schema.py that converts user-friendly JSON schema to fill_plan.json with preflight validation (required fields, budget ratios, placeholder detection). Includes schema template, Claude web system prompt, and sample filled business plan. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… tracking - Restored 11 deleted testdata files to their original paths - Removed 바이탈루_사업계획서_최종.json from git tracking (public repo) - Added 바이탈루_*.json pattern to .gitignore Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
serithemage
left a comment
There was a problem hiding this comment.
코드 리뷰 (Codex 분석)
머지 전 차단/주요 이슈가 확인되어 Request Changes 드립니다. E2E 회귀 테스트 자체는 의도가 명확하고 잘 작성되었지만, compile_schema.py와 md2hwp-ui/server.py 쪽에 보안/안정성 이슈가 있습니다.
✅ 잘한 점
tests/e2e_test.go의TestE2EStage1_HWPXTableCellParagraphBreaks— 임시 HWPX를 직접 생성해 외부 fixture 의존성을 줄였고,<br>존재와 무구분 연결 문자열 부재를 함께 확인하여 회귀 포인트를 분명히 잡음.internal/parser/hwpx/parser_test.go:276,internal/cli/cli_test.go:241— 파서 레벨의 줄바꿈 보존과 Markdown 렌더링 레벨의<br>변환을 계층적으로 검증.internal/cli/convert.go:517formatTableCellText— 테이블 셀 내 개행 처리 규칙을 한 곳에 모아 가독성/재사용성 향상.tools/md2hwp/fill_hwpx.py+tests/test_fill_hwpx.py— XML 직접 조작, 빈 셀 생성, cellAddr 기반 탐색, multi-paragraph 삽입까지 테스트 폭이 넓음.
🚨 Critical
1. tools/md2hwp-ui/server.py:239 — Path Traversal 취약점
다운로드 엔드포인트가 URL에서 추출한 filename을 그대로 os.path.join(STATE[\"upload_dir\"], filename)에 결합합니다. ../가 들어오면 업로드 디렉터리 밖 임의 파일 접근이 가능합니다.
제안: basename만으로는 부족합니다. Path.resolve()로 절대경로화 후 os.path.commonpath([resolved, upload_dir])가 upload_dir과 일치하는지 검증하세요.
⚠️ Major
2. tools/md2hwp/compile_schema.py:223 — 인자 없이 실행하면 IndexError
__main__이 sys.argv[1]을 바로 읽기 때문에 PR 테스트 플랜에 적힌 python3 tools/md2hwp/compile_schema.py 명령이 즉시 IndexError로 죽습니다. argparse를 도입해 사용법/필수 인자를 명시적으로 검증해주세요.
3. tools/md2hwp/compile_schema.py:208 — 예산 비율 검증이 warning에 머묾
`현금 < 5%`, `현물 > 20%`를 warning으로만 처리하는데, 같은 PR의 `사업계획서_schema.json` 제약은 이를 필수로 명시합니다. 위반된 스키마도 그대로 컴파일되므로 두 조건은 `BLOCK` 에러로 승격해야 합니다.
4. tools/md2hwp/compile_schema.py:184 — 플레이스홀더 검사 범위 누락
플레이스홀더 검사가 `meta`와 `sections[*].paragraphs`만 훑습니다. 실제 치환 대상인 `폐업이력`, `추진일정`, `사업비`, `인력현황` 필드는 검사하지 않아 `OO`, `00개`, `0000원`이 남아도 preflight를 통과합니다. 스키마 전체를 재귀 순회하도록 확장 필요.
5. tools/md2hwp/compile_schema.py:90 — 폐업이력.companies 배열 중 첫 항목만 반영
`사업계획서_schema.json:63`은 최대 3개 기업을 허용하지만 컴파일 시 `companies[0]`만 반영하고 나머지는 조용히 버립니다. 명시적 경고 출력 또는 지원 범위를 문서/출력에 분명히 남겨주세요.
6. tools/md2hwp-ui/server.py:221 — 외부 절대경로 하드코딩
서버가 채움 작업에 `~/.claude/skills/md2hwp/scripts/fill_hwpx.py`를 호출합니다. 이 경로는 개발자 로컬 환경에 종속적이라 fresh clone, CI, 다른 팀원 환경에서 깨집니다. 저장소 상대경로의 `tools/md2hwp/fill_hwpx.py`를 호출하도록 변경 필요.
📝 Minor
7. PR 스코프와 설명 불일치
PR 본문은 (1) E2E 테스트, (2) compile_schema.py, (3) .gitignore, (4) testdata 복원 4가지만 언급하지만 실제 diff에는 .github/automation/*, .github/workflows/*, AGENTS.md, docs/md2hwp/DESIGN.md, tools/md2hwp-ui/* 전체, tools/md2hwp/fill_hwpx.py, 사업계획서_schema.json, 시스템프롬프트.md 등 대량 파일이 포함되어 있습니다. 기능별 PR 분리 또는 설명 보강을 권고합니다.
8. tools/md2hwp/compile_schema.py:247 — 출력 경로 하드코딩
결과를 항상 `/tmp/compiled_fill_plan.json`에 덮어써 다중 실행 시 충돌합니다. 입력 파일명 기반 출력 또는 명시적 `--out` 인자를 받아주세요.
🔍 추가 검토 필요
- "testdata 파일 11개 복원" 설명과 실제 diff 불일치: 최종 diff 기준으로 신규 testdata는 `testdata/hwpx_20260302_200059.hwpx`, `testdata/fill_plans/재도전성공패키지_sample.json` 2개만 확인됩니다. PR 설명이 브랜치 중간 커밋 기준인지, stale인지 확인 부탁드립니다.
🤖 Generated with Claude Code — Codex 협업 리뷰
Summary
TestE2EStage1_HWPXTableCellParagraphBreaks— PR feat: LLM 요청 타임아웃을 외부에서 설정 가능하도록 추가 #26 fix의 E2E regression test. 임시 HWPX를 자체 생성하므로 testdata 의존 없음. 셀 내 다중 단락이<br>로 렌더링되는지 검증.compile_schema.py추가 — 사용자 친화적 JSON 스키마 →fill_plan.json컴파일러 (preflight 검증 포함: 필수값, 예산비율, 플레이스홀더).gitignore업데이트 (__pycache__,.omx,testdata/md2hwp-outputs, 개인 사업계획서 JSON)Test plan
go test -v -run TestE2EStage1_HWPXTableCellParagraphBreaks ./tests/— 신규 regression test 통과 확인go test ./...— 기존 테스트 회귀 없음 확인python3 tools/md2hwp/compile_schema.py— compile_schema.py 동작 확인🤖 Generated with Claude Code