fix: 셸 NFC 정규화 인자 등 안정성/스트레스 결함 근본 수정 - #3
Merged
Conversation
안정성/스트레스 테스트에서 발견한 인자 처리 결함을 디스크 실제 저장명 기준으로 해소. - disk_real_path(): 최상위 인자를 부모 readdir로 디스크 실제 엔트리명으로 교체. zsh glob/탭완성이 인자를 NFC로 정규화해도(nfd2nfc *.hwp) 디스크 NFD를 정상 변환. 역방향(NFC 디스크 + NFD 인자)의 거짓 '1개 변경' 카운트도 해소. - 같은 항목을 NFD/NFC 다른 철자로 중복 지정 시 dedup 실패(카운트 부풀림·이중 rename) 수정. - collect 'no warnings recursion': 아주 깊은 트리의 Deep recursion 경고 억제. - opendir 실패·빈/슬래시뿐 인자도 missing 집계 → 종료 코드 1 반영. - --force/--skip 동시 지정 경고(--skip 죽은 변수 해소), --help에 '-' 파일명 -- 안내.
disk_real_path 회귀 방지: NFC 인자→디스크 NFD 변환, NFC 디스크+NFD 인자 0개, NFD/NFC 철자 중복 dedup. 통과 18/18.
README 안전 섹션에 권한 없는 항목 건너뜀 안내, CHANGELOG에 스트레스 후속 수정 기록.
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 #1·#2 머지 후 가혹한 입력으로 안정성 테스트(직접 + 5개 차원 멀티 에이전트 스트레스 워크플로우, 10건 confirmed)를 수행해 발견한 결함을 수정합니다. 데이터 무결성(inode·내용·권한·mtime)·dry-run·대량 처리·인코딩·순환링크·idempotent는 손상/크래시/무한루프 없이 전부 합격이었고, 발견은 인자 처리에 집중됐습니다.
핵심 (근본 원인 1개)
nfd2nfc가 "인자 바이트의 basename"으로 변환을 판단하는데, 셸 정규화 때문에 디스크 실제 저장 이름과 달라질 수 있던 것이 공통 원인:
nfd2nfc *.hwp에서 인자를 NFC로 정규화해 넘김 → 디스크가 NFD인데 "이미 정규화됨"으로 스킵 → 변환 누락. (README 예시가 정확히 이 패턴)%seendedup 실패 → 카운트 부풀림·이중 rename.수정:
disk_real_path()— 최상위 인자를 부모readdir로 디스크 실제 저장명으로 교체. 셸이 어떻게 정규화하든*.hwp·탭완성·디렉토리 모두 정상 동작하고, dedup도 같은 바이트로 합쳐짐.그 외 (NIT 전부)
Deep recursion경고 억제(no warnings 'recursion').opendir실패(권한 없는 하위)·빈/슬래시뿐 인자도 부분 실패로 종료 코드 1 반영.--force/--skip동시 지정 경고(--skip죽은 변수 해소).--help에-로 시작하는 파일명은--뒤에 두라는 팁.✅ 검증
perl -c/shellcheck(4파일) /./test.sh18/18(신규 회귀 3개: NFC 인자 변환·거짓 카운트·중복 dedup)