[rustjava-checker-output-determinism-has-no-guard] feat(scripts): 검사기 출력 순서를 잠근다 — 습관을 규칙으로 - #85
Merged
Conversation
… 출력 순서를 잠근다 — 습관을 규칙으로
채택 제안 `2026-09-19-merge-drops-deterministic-order#p0`.
불변식 한 줄: `scripts/*.py` 의 어떤 `for`·컴프리헨션도 `sorted(...)` 밖에서
set 을 순회하지 않는다. AST 로 단언한다(재실행 0).
왜 정적인가 — 제안이 제시한 두 대안을 둘 다 쓰지 않았다:
* 두 PYTHONHASHSEED 재실행: set 은 해시 순서가 정렬 순서와 «다를 때만» 보이므로
사고의 경로 2개에서 2회 비교는 회차당 약 절반 눈을 감는다.
* `assert sorted`: 제안 자신이 적은 약점 — 다른 곳의 두 번째 출처를 못 잡는다.
그물 0 재현: 비결정성을 되돌린 채 파이썬 검사기 4종 rc 0 · cargo fmt rc 0.
양방향 2×2(제품 호출부): M1 check-merge-dropped-symbols.py:254 제거 → rc 1 ↔ 복원 rc 0 ·
M2 다른 파일 check-dod-ci-parity.py:215 → rc 1 ↔ 복원 rc 0.
정상 = `7 script(s): 0 unordered iteration(s)` · 0.06초.
대가: 새 CI 잡 하나(제안이 real weight 라 부른 그것) · 측정된 사각 1건 —
튜플 언패킹으로 받은 set 은 못 본다(`ci_runs, ci_tcs = parse_ci(...)` 에
정렬 없는 순회를 넣으면 rc 0 통과). 후속 제안 #p0 으로 남겼다.
DoD 10명령 rc 0.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…속을 좁게 검사하지 않는다 — join·*언팩을 더하고 거짓 단언을 지운다 게이트² request-changes(PR #85 · pin 8a633bc) 승계. 검수자가 반례 12개를 직접 만들어 쟀고, 그중 셋이 이 회차의 필수 수정이다. R1 — 넓은 약속·좁은 검사. `", ".join(myset)` 과 `print(*myset)` 이 rc 0 으로 통과했다: 2026-09-19 사고와 «같은 계급»(경로 set 이 한 줄로 찍힌다)인데 blind spot 에도 없었다. 검수자의 ⑴을 골라 `str.join` 의 첫 인자와 `ast.Starred`(Load)의 value 를 검사 대상에 더했다(순증 ~10줄). 그 둘은 set 이 `for` 없이 출력에 닿는 가장 흔한 두 철자라, 약속을 지키는 쪽이 범위를 좁히는 쪽보다 싸다. 약속 문구도 함께 고쳤다 — 「iteration」이 아니라 «for/컴프리헨션 · str.join · *-언팩 이 셋»이라고 적는다(출력 줄도 동일). R2 — docstring 의 dict 단언이 거짓이었다. `dict.fromkeys(myset)` 뒤 `for k in d:` 는 통과한다. 그 줄을 지웠다. `fromkeys` 만 두 줄로 잡지 않았다 — 진짜 계급은 «컨테이너를 통한 순서 오염»이고, 가족 중 하나만 잡으면 없는 프로그램을 있는 것처럼 보이게 한다(= R2 가 지적한 실패 그대로다). 오늘 scripts/ 의 fromkeys 0건 ⇒ 문안 결함이지 live 오검이 아니다. R3 — 빚 한 줄. 이 repo 는 python 린터·포매터·테스트가 0 이다(추적 파일 중 pyproject|setup.cfg|.pre-commit|tox.ini|ruff|flake8|requirements 0건 · rust.yml 의 python 은 검사기 5회 실행뿐, lint step 없음) ⇒ 이 파일을 기계로 보는 것은 CI 잡 하나뿐이다. 하네스는 만들지 않았다 — 적었다. 그 밖(검수자 기록분)도 docstring 에 넣었다: 이름에 스코프가 없어 `found` 충돌이 틀린 red 를 낸다 · 메서드형 집합연산 · while/pop 드레인 · 죽은 줄 제거. 양방향(제품 호출부 글롭): join·* 반례 rc 1(줄 지목) ↔ sorted() 씌우면 무검출 (오탐 0) ↔ 반례 제거 rc 0. 원 M1·M2 회귀 재확인(각 rc 1 ↔ 복원 rc 0). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…— 승인된 원장 2파일 합집합 REPORT.md·STATE.md 두 원장 파일만 충돌했다(코드 파일 충돌 0). 양쪽 항목 전건 보존 · 시간순 (origin/main `2b2a5b1c` 15:48 먼저, 이 회차 `3dbaaaf4` 13:54 뒤) 합집합으로 해소했다. 기여 불변 확인: diff <(git diff --numstat 5d732b1 HEAD) <(git diff --numstat origin/main <tree>) rc=0. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
채택 제안
2026-09-19-merge-drops-deterministic-order#p0(docs/worklog/2026-09-19-merge-drops-deterministic-order.json).불변식 한 줄
scripts/*.py의 어떤for·컴프리헨션도sorted(...)밖에서 set 을 순회하지 않는다 —scripts/check-script-output-order.py가 AST 로 단언한다. 재실행 0 · 0.06초.먼저 쟀다 — 해소 안 됐다
scripts/·rust.yml최종 커밋 =35f34797(그 한 줄 수정 자신). 잠금 없음.PYTHONHASHSEED= 산문(REPORT·STATE·worklog)과 주석뿐, 어떤 검사에도 없다.cargo fmt --all -- --checkrc 0.왜 «정적»인가 — 제안의 두 대안을 둘 다 쓰지 않았다
PYTHONHASHSEED재실행: set 은 해시 순서가 정렬 순서와 «다를 때만» 보인다 ⇒ 사고의 경로 2개에서 2회 비교는 회차당 약 절반 눈을 감는다(느린 것이 문제가 아니다).assert sorted: 제안 자신이 적은 약점 — 「다른 곳에 생긴 두 번째 출처를 못 잡는다」.양방향 2×2 — 전부 제품 호출부(사본 아님)
check-merge-dropped-symbols.py:254의sorted()제거check-dod-ci-parity.py:215sorted(only_ci)→only_ci정상 =
7 script(s): 0 unordered iteration(s) that could reach output· rc 0.대가 — 숨기지 않는다
script_output_order). 제안이 「real weight」라 부른 그것이고 값을 깎지 않았다 — 툴체인 없는 checkout +python3, 기존 doc 잡 4개와 같은 형상.ci_runs, ci_tcs = parse_ci(...). 거기에 정렬 없는for t in ci_tcs:를 넣으니 잠금이 rc 0 으로 통과했다. 지금 틀린 곳은 없지만 구멍은 진짜다 ⇒ 후속 제안#p0.제안보다 넓힌 곳 하나
target은 「scripts/ (all four checkers)」였는데 glob 은scripts/*.py다 — 한 단어 차이이고 포함된 7개 전건이 오늘 통과한다. 회차 간 diff 를 하는 것은 검사기만이 아니다.검증
cargo fmt·clippy·+beta clippy· wasm32 clippy ·cargo test --all· 파이썬 5종).dod_parity: 「명령 9개 · toolchain 2개로 «둘 다 일치»」.git diff origin/main --summary:old mode/new mode0.🤖 Generated with Claude Code