feat: ir-diff --summary / --max-lines 출력 가드 추가#695
Closed
planet6897 wants to merge 1 commit into
Closed
Conversation
PR edwardkim#659 (Task edwardkim#653) 머지 후 보강 영역. local/task653 (planet6897 의 미PR 브랜치) 에서 도입된 출력 가드 옵션을 stream/devel 정합 형식으로 이식. 기능: - `--summary`: 카테고리별 차이 카운트만 출력 (paragraph 헤더 + 개별 차이 라인 생략). 광범위 회귀 검증 시 출력량 폭증 방지. - `--max-lines <N>`: 출력 라인 수를 N 으로 제한, 초과 시 truncation 마커 ("이하 생략 (--max-lines N 도달)") 표시. `=== 비교 완료` 합계 라인은 항상 출력. 구현: - `ir_diff` 함수 내부에 `emit_header!` / `emit_diff!` 매크로 도입. - emit_header!: paragraph/섹션 헤더용. summary 모드에서는 출력 안 함. - emit_diff!: 차이 라인용. summary 모드에서는 카테고리 추출 후 BTreeMap 카운트. - 카테고리 추출: ":" 앞쪽 prefix 의 "]" 이후 부분 (controls[N].xxx → xxx). - 기존 println! 사이트 6곳을 매크로 호출로 교체. 차이 검출 로직 무변경. 검증: - cargo test --release 전체 22 스위트 0 failures. - 신규 통합 테스트 `tests/ir_diff_summary_mode.rs` 3건: - summary_mode_categorizes_diffs (요약 헤더 + 카운트 라인 + paragraph 헤더 부재) - max_lines_truncates (truncation 마커 + 합계 라인 보존) - no_flags_preserves_full_output (회귀 가드: 옵션 없으면 기존 형식 보존) - aift.hwpx vs aift.hwp 실측: 707 건 차이를 22 카테고리로 요약. 문서: - mydocs/manual/ir_diff_command.md: 옵션 표 + 사용 예 추가. - CLAUDE.md: 디버깅 워크플로우 ir-diff 예시 +2 줄.
39a33ae to
79a9dc3
Compare
edwardkim
added a commit
that referenced
this pull request
May 9, 2026
PR #659 (Task #653, ir-diff 표 속성/컨트롤 식별 비교) 머지 후 보강. 광범위 회귀 검증 시 ir-diff 출력량 폭증 문제 (aift.hwpx vs aift.hwp 1437 라인) 해결. 신규 옵션 (src/main.rs::ir_diff): - --summary: 카테고리별 차이 카운트만 출력 (paragraph 헤더 + 개별 차이 생략) - --max-lines <N>: 출력 라인 N 제한 + truncation 마커. 합계 라인은 가드 외부 보존 구현: - 두 매크로 (emit_header! / emit_diff!) 함수 내부 도입 - 기존 println! 6곳 매크로 치환 (비교 로직 무변경) - 카테고리 추출: ":" 앞쪽 prefix 의 "]" 이후 (controls[N].xxx → xxx) - summary 모드: BTreeMap 누적 후 count 내림차순 → 알파벳 정렬 회귀 가드: - tests/ir_diff_summary_mode.rs 신규 3 통합 테스트 - no_flags_preserves_full_output: 옵션 부재 시 기존 형식 100% 보존 확증 검증: - cargo test --release: lib 1166 + 통합 ALL GREEN, failed 0 - cargo test --release --test ir_diff_summary_mode: 3/3 PASS - cargo clippy --release: 신규 경고 0 - 수동 검증: --summary 22 카테고리 출력 / --max-lines 20 truncation / 옵션 부재 1436 라인 보존 (PR 본문 정합) 영향 범위: - ir-diff 차이 검출 로직 무변경 - 옵션 부재 시 기존 출력 형식 100% 보존 (회귀 가드 테스트 입증) - UI 무관 — 시각 판정 게이트 면제 정합 Co-Authored-By: Jaeook Ryu <jaeook.ryu@gmail.com> Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
edwardkim
added a commit
that referenced
this pull request
May 9, 2026
- mydocs/pr/archives/pr_695_review.md (검토 문서) - mydocs/pr/archives/pr_695_report.md (처리 보고서) - mydocs/orders/20260509.md: PR #695 행 + 본 사이클 패턴 라인 추가 처리 결과: - 옵션 A — 1 commit cherry-pick + no-ff merge (2ca126c) - 시각 판정 면제 (UI 무관 CLI 옵션 추가) - 회귀 가드 ir_diff_summary_mode 3/3 PASS + 수동 검증 PR 본문 정합 - closes 명시 없음 (PR #659 후속 보강 — 자동 close 매칭 부재) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Owner
|
@planet6897 PR 머지 완료되었습니다 (devel 처리 결과
검증
메모리 룰 정합
광범위 회귀 검증 효율 개선되었습니다. 처리 보고서: |
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.
요약
PR #659 (Task #653 — ir-diff 표 속성/컨트롤 식별 비교) 머지 후 보강.
local/task653(planet6897 의 미PR 브랜치) 에서 도입된 출력 가드 옵션을 stream/devel 정합 형식으로 이식.동기
rhwp ir-diff의 광범위 회귀 검증 시 (예: aift.hwpx vs aift.hwp 707 건 차이) 출력량 폭증으로 본질 영역 식별이 어렵다. 카테고리별 카운트 + 출력 라인 제한 모드를 추가하여 처음 검사 / 회귀 측정 효율 개선.기능
--summary카테고리별 차이 카운트만 출력. paragraph 헤더 + 개별 차이 라인 생략.
$ rhwp ir-diff samples/hwpx/aift.hwpx samples/aift.hwp --summary === 카테고리별 차이 요약 === 260건 char_shapes count 69건 ml 61건 indent 48건 tbl page_break 44건 ps_id ... === 비교 완료: 차이 707 건 ===--max-lines <N>출력 라인 수를 N 으로 제한. 초과 시 truncation 마커 표시.
=== 비교 완료합계 라인은 항상 출력 (가드 외부).$ rhwp ir-diff samples/hwpx/aift.hwpx samples/aift.hwp --max-lines 10 === IR 비교: aift.hwpx vs aift.hwp === --- 문단 0.0 --- " * 사업계획서 제출 시 상기 문구 삭제" [차이] cc: A=32 vs B=56 [차이] char_offsets[0]: A=8 vs B=32 ... ... 이하 생략 (--max-lines 10 도달) === 비교 완료: 차이 707 건 ===구현
src/main.rs::ir_diffsummary_mode/max_lines플래그 파싱 추가emit_header!/emit_diff!매크로 도입println!사이트 6곳을 매크로로 교체 (차이 검출 로직 무변경)":"앞쪽 prefix 의"]"이후 (예:controls[N].xxx→xxx)tests/ir_diff_summary_mode.rs(신규)3건 통합 테스트:
summary_mode_categorizes_diffs— 요약 헤더 + 카운트 라인 + paragraph 헤더 부재max_lines_truncates— truncation 마커 + 합계 라인 보존no_flags_preserves_full_output— 회귀 가드: 옵션 없으면 기존 형식 보존문서
mydocs/manual/ir_diff_command.md: 옵션 표 + 사용 예 추가CLAUDE.md: 디버깅 워크플로우 ir-diff 예시 +2 줄검증
영향 범위
Test plan
cargo test --release전체 22 스위트 0 failures--summaryaift 권위 케이스 707 건 → 22 카테고리 요약 정상--max-lines 20truncation 마커 + 합계 라인 보존 확인