fix(scripts): 이력 검사가 "리뷰 02-01"·"1라운드 06-01" 꼴을 잡는다

문제: check-work-docs.py --history는 날짜 접두어(MMDD/), RR 접두어,
묶음 이름, round 폴더, 번호만 쓴 결정, 커밋 sha만 이력 ID로 본다.
그래서 "리뷰 02-01 결정", "1라운드 06-01·06-03", "리뷰 README 13절"처럼
날짜 접두어 없이 쓴 리뷰 번호를 놓친다. 2026-11-06 docs/manual 이력
걷어내기 시험에서 --history가 0을 냈는데, 손으로 찾으니 16줄이 남아
있었다.

고른 방법: 패턴 셋을 더한다.
- 리뷰·라운드·review 낱말 뒤 20자 안에 홀로 선 NN-NN. 2026-11-01 같은
  날짜의 일부는 홀로 선 번호가 아니라 잡지 않는다
- 한국어 라운드 번호(1라운드, 라운드6)
- 리뷰 README 절 번호(리뷰 README 13절)
버린 대안: 앞말 없이 모든 NN-NN을 잡기. 장 번호·시각 범위 같은 보통
숫자까지 잡아 오탐이 많다.

위험·한계: 검사는 아는 꼴만 잡는다. 다른 꼴은 걷어낸 뒤 grep으로 한 번
더 읽는다(docs-writing.md 자주 하는 실수). 이 커밋 뒤 --history
docs/manual은 16줄을 내고 rc=1이 된다. 그 16줄은 이번에 고치지 않는다.
다음 cold-read 시험 과제다. 기본 모드(docs/work 본문, 루트 CLAUDE.md)는
0줄 그대로다.

검증:
- 고치기 전 python3 scripts/check-work-docs.py --history docs/manual
  결과 0줄, rc=0
- 고친 뒤 같은 명령 결과 16줄, rc=1. 2026-11-06 시험 세션이 손으로 찾은
  16줄과 같다
- 오탐 시험 12건(보통 문장 7, 이력 5)이 모두 기대대로 나왔다
- 기본 모드 rc=0, 본문 이력 0줄. desktop worktree에서도 같다
This commit is contained in:
DongHyeonka
2026-11-06 23:18:33 +09:00
parent 2c8a359d32
commit b872b0ea93
+9
View File
@@ -81,6 +81,15 @@ HISTORY_PATTERNS = [
("review round prefix (RR-, RR2-, ...)", re.compile(r"\bRR\d*-", re.ASCII)),
("fix bundle name (r2-05a, r9-a, r10-03)", re.compile(r"\br\d{1,2}-(?:\d{2}[a-z]?|[A-Za-z])\b", re.ASCII)),
("review round folder name (round6)", re.compile(r"\bround\d+\b", re.ASCII)),
# A finding number written after the word for review or round, with no folder date in front:
# "리뷰 02-01", "1라운드 06-01", "리뷰 README 13.2, 09-02", "review 2026-11-01 05-15". The number
# must stand alone, so a date such as 2026-11-01 is not a finding number by itself.
("finding number after a review or round word (리뷰 02-01)",
re.compile(r"(?:리뷰|라운드|(?<![A-Za-z])[Rr]eview)[^|()\n]{0,20}?(?<![\w./-])\d{2}-\d{2}(?![\w-])",
re.ASCII)),
("round number in Korean (1라운드, 라운드6)",
re.compile(r"(?<![\w.])\d{1,2} ?라운드|라운드 ?\d{1,2}(?![\w.])", re.ASCII)),
("review README section number (리뷰 README 13절)", re.compile(r"리뷰 README \d", re.ASCII)),
("decision named by number only",
re.compile(r"결정 ?(?:\d+|[①-⑳])(?!\s*(?:개|건|가지|번째))|owner decision \d+", re.ASCII)),
("old manual decision number (M-3)", re.compile(r"\bM-\d+\b", re.ASCII)),