Skip to content

[11/08 판정예정] fix(auto-distill): define "핵심" in the entail rubric (#1846) - #2064

Draft
seoseo-ai wants to merge 1 commit into
mainfrom
fix/1846-entail-core-definition
Draft

seoseo-ai wants to merge 1 commit into
mainfrom
fix/1846-entail-core-definition

Conversation

@seoseo-ai

Copy link
Copy Markdown
Collaborator

무엇

scripts/auto-distill/auto-distill.py의 ENTAIL_PROMPT에 "핵심"의 정의 단락을 추가합니다. 판정은 이진(yes/no) 그대로이고, 출력 형식({"supported":"yes|no","why":"15자 이내 사유"})과 entail() 파싱은 바뀌지 않았습니다. 축, 분기, 필드는 추가하지 않았습니다.

추가한 단락 (판정값 블록과 strict JSON만 출력하라. 사이):

"핵심"의 기준:
- 주장의 핵심이 인용문에 있으면 yes다.
- 날짜·파일명·줄번호·시각처럼 주장에 딸린 부수 정보가 인용문에 없어도 yes다.
- 주장이 단정한 결과·상태·완료가 인용문에 없으면 no다
  (목표를 완료로, 존재를 실행으로 바꿔 말한 경우가 여기 해당한다).

세 줄은 #1846의 수렴 코멘트("최종 수치 — 120건 완료", 2026-09-19)의 결론 절에서 그대로 옮겼습니다:

이 이슈는 프롬프트 한 단락 명시 로만 남긴다. 축·분기·필드 추가 없음.

- 주장의 핵심이 인용문에 있으면 yes다.
- 날짜·파일명·줄번호·시각처럼 주장에 딸린 부수 정보가 인용문에 없어도 yes다.
- 주장이 단정한 결과·상태·완료가 인용문에 없으면 no다
  (목표를 완료로, 존재를 실행으로 바꿔 말한 경우가 여기 해당한다).

머리줄 "핵심"의 기준:은 제가 붙였습니다. 앞의 판정값 목록과 구분하려는 목적이고, 세 줄 본문은 한 글자도 바꾸지 않았습니다. 머리줄 없이 가자는 판단이면 한 줄만 지우면 됩니다.

오너 결정(2026-09-29): "09-19 수렴안대로 entail 프롬프트에 '핵심' 명시 단락 추가".

왜

기존 루브릭의 "주장의 핵심 내용을 뒷받침한다"는 "핵심"이 무엇인지 정의하지 않았습니다. 그래서 haiku는 "구성요소가 하나라도 없으면 no"로, Jev는 "중심 주장만 있으면 yes"로 읽었습니다. 둘 다 이 문장을 타당하게 읽은 것입니다. 결과적으로 같은 세션도 어느 레인(claude/piri/codex)이 판정했느냐에 따라 AUTO.md가 달라질 수 있었습니다. 3분기 core/full 게이트는 층화 120건 실측에서 스트림의 28%를 사람 검토로 보내 기각됐습니다. 수렴안은 관측된 사유에서 바로 끌어낸 세 문장만 명시하는 것입니다.

  • 1행: "핵심"의 모호성 제거
  • 2행: 부수 정보 누락 때문에 생기는 오탐 차단 (kept → partial 21건의 사유)
  • 3행: 과잉 주장 포착 ("목표를 완료로", "존재를 실행으로" 2건)

검증

새 테스트 파일은 scripts/auto-distill/test_entail_prompt.py이고, CI의 python -m pytest scripts/auto-distill 단계가 디렉터리 단위로 자동 수집합니다. 테스트는 다음을 확인합니다.

  • 프롬프트에 정의 단락이 원문 그대로 들어 있는지, 위치가 판정값 뒤이고 출력 형식 앞인지
  • %s 자리가 정확히 2개이고 다른 %가 없는지, 판정 형식 줄이 그대로 1회 있는지
  • 가짜 모델 명령(sys.executable 기반, Claude JSON 봉투 형태)으로 entail()을 실행했을 때:
    • 모델이 받은 프롬프트에 정의가 포함되는지
    • yes는 kept, no는 not_entailed와 _entail_why로 처리되는지
    • " YES "는 대소문자·공백을 허용하는지
    • 알 수 없는 값은 entail_missing, 파싱 불가는 entail_unavailable(fail-closed)인지

모든 실행은 격리 환경에서 했습니다 (env -i HOME=$TMPDIR/h-1846 ..., Termux).

대상 수정 없음 (origin/main) 수정 있음
test_entail_prompt.py 3 failed / 6 passed (정의 관련 3건 RED, 파서 6건 GREEN) 9 passed
pytest scripts/auto-distill 전체 1 failed / 127 passed 27 failed / 116 passed
bash scripts/auto-distill.test.sh — PASS=110 FAIL=27
tests/test_scripts_test_collection.py + tests/test_changelog_fragments.py — 15 passed
python3 scripts/changelog_fragments.py check — ok
  • 수정 전후 모두 나오는 실패 1건 test_install.py::test_second_replacement_failure_rolls_back_first_file은 Termux 환경 문제로 기존부터 있던 것입니다.
  • 새로 생긴 실패 26건(FAILED 20 + SUBFAILED 6)은 전부 영수증 불일치입니다. 대상은 test_receipt.py, test_install.py, test_resolve_model_id.py이고 모두 evaluation receipt invalid: receipt subject SHA-256 does not match managed source(exit 3)로 실패합니다. auto-distill.py의 바이트가 바뀌면 설계상 반드시 이렇게 됩니다(아래 참조).

선결 조건: exact-source 영수증 재발급 (이슈 본문 "선결 조건" 절)

이슈 본문의 요구는 이렇습니다: "ENTAIL_PROMPT 수정은 auto-distill.py 변경이므로 docs/auto-distill.md:84-86 에 따라 새 exact-source 평가와 검토된 영수증이 필요하다." 이 PR은 영수증을 재발급하지 않았습니다. 재발급하려면 평가 노드에서 실제 모델을 호출해야 하고, 그건 별도 승인 대상입니다. 그래서 CI의 scripts/ python 단계는 영수증이 갱신될 때까지 red입니다. #1832의 첫 커밋과 같은 상태입니다.

python3 scripts/verify-auto-distill-receipt.py --source scripts/auto-distill/auto-distill.py --json
  sha256          60282ef96cbedcdaf67a27ef82ada48f6012c3f8260709d341e0cd1ce35cb702   (TM-3448: 124e89be…)
  surface_sha256  9894a32ba4d262512a8f44eb4f00a10486adcb7b01d7131816b646f85ebadc28   (TM-3448과 동일)

ENTAIL_PROMPT와 entail()은 surface_members 밖에 있어서 canon 표면 SHA는 바이트 단위로 같습니다. 다만 전체 파일 SHA가 바뀌었으므로 TM-3448 이후 영수증을 새로 발급해야 합니다. 절차는 기존 평가 노드의 run-exact-eval.sh(저장소 밖에 있음, sample-v4 / 47 cases)를 이 PR head b9336ec5의 소스로 실행한 뒤, resolve_model_id.py --envelope <eval.log>로 model_resolution을 채워 evaluation-receipt.json을 이 브랜치에 커밋하는 것입니다(#1848/#1849와 같은 흐름).

남은 범위: 120건 재측정 (그래서 Refs)

이슈의 채택 기준은 다음과 같습니다: "명시한 이진 프롬프트로 같은 120건 재측정, 스트림이 거의 움직이지 않으면서 위 2건이 잡히면 채택. 움직이면 기각."

  • 저장소를 확인한 결과, 이 120건 층화 표본과 entail 평가 하네스는 들어 있지 않습니다. entail/stratif/층화/run-exact-eval/sample-v4로 grep하면 auto-distill.py, test_retry_budget.py, 문서와 영수증 메타데이터만 나옵니다. 네트워크 없이 돌릴 수 있는 fixture 기반 평가는 없습니다.
  • 재측정에는 실제 haiku 호출이 필요해서 실행하지 않았습니다. 유료 API와 claude -p는 전혀 호출하지 않았습니다.
  • 운영자가 할 일은 다음과 같습니다. 09-19 측정에 쓴 오너 로컬 하네스(auto-distill-dryrun.jsonl의 kept[]와 auto-distill-quarantine.jsonl에서 층화 표본을 만드는 것, --limit 순서 편향을 고친 버전)에서 판정 프롬프트를 이 PR head의 ENTAIL_PROMPT로 바꿔 이진 판정만 같은 120건에 다시 돌립니다. 모델은 프로덕션과 같이 model_command.py의 --model haiku입니다. 그 뒤 09-19 결과와 짝지어 비교합니다(현행 통과→통과 / 폐기→폐기 유지율, "PR fix(distill): skip Honcho push when health probe fails #91 완료", "PoC 미실행" 2건 포착 여부). 하네스 스크립트가 저장소에 없어서 정확한 명령줄은 여기 적을 수 없습니다. 운영자가 확인해 주셔야 합니다.
  • 판정 기준: 스트림이 거의 움직이지 않고 2건이 잡히면 채택하고 Closes #1846로 닫습니다. 스트림이 크게 움직이면 이 PR은 기각입니다.

리스크

  • 동작 변경 가능성: 명시가 실제로는 haiku의 판정 분포를 옮길 수 있습니다. 그래서 위 재측정 전에는 머지/배포하지 않는 것이 이슈의 결정과 맞습니다.
  • 과잉 주장 규칙(3행)이 요약형 fact의 정상 통과분 일부를 no로 돌릴 가능성이 있습니다. 재측정의 "통과→폐기" 칸으로 확인할 수 있습니다.
  • 영수증을 재발급하기 전까지는 CI red이고, 설치 도구(install-auto-distill.sh)도 exit 3으로 설치를 거부합니다. 즉 실수로 배포될 경로는 fail-closed로 막혀 있습니다.
  • 라이브 노드, 서비스, 비밀정보는 건드리지 않았습니다.

Refs #1846

🤖 Generated with Claude Code

ENTAIL_PROMPT asked whether a quote supports "주장의 핵심 내용" without
defining the core. haiku read it as "every component must be quoted", Jev
as "the central claim is quoted" - both valid readings, so the same session
could yield a different AUTO.md depending on the judging lane.

The 3-branch core/full gate proposed in #1846 was measured on a stratified
120-item set (2026-09-19) and rejected: it sent 28% of the stream to human
review, mostly over incidental details (dates, file names, line numbers).
The issue converged on adding one explicit paragraph to the binary prompt:
core quoted -> yes; missing incidental detail -> still yes; an asserted
result/state/completion absent from the quote -> no.

Verdict stays binary; output format and entail() parsing are unchanged.
test_entail_prompt.py pins the paragraph verbatim, the two %s slots, the
strict-JSON verdict line, and entail()'s yes/no/unknown/unparseable
handling through a fake model command.

The full source SHA changes (canon surface_sha256 9894a32b does not), so
the TM-3448 exact-source receipt no longer matches: a fresh exact-source
evaluation and reviewed receipt are required before merge/deploy, and the
120-item binary re-measurement from the issue has not been run.

Refs #1846

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@seoseo-ai
seoseo-ai requested a review from jinon86 as a code owner September 29, 2026 06:40
@seoseo-ai
seoseo-ai marked this pull request as draft September 29, 2026 06:41
@seoseo-ai

Copy link
Copy Markdown
Collaborator Author

오너 결정 (2026-09-29 KST): 보류. 효과 대비 평가 노드 live eval(영수증 재발급)·120건 재측정 비용이 커서 지금은 진행하지 않고 draft로 유지합니다. 재개 시 PR 본문의 절차(run-exact-eval.sh → resolve_model_id.py → receipt 커밋)대로.

@jinon86

jinon86 commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

CI 실패 원인(로컬 재현 포함)

요약: 이 PR이 scripts/auto-distill/auto-distill.py를 수정했는데 커밋된 evaluation-receipt.json이 구버전 소스 기준이라, receipt 검증이 모든 경로에서 실패합니다.

근거 수치(head b9336ec5 기준):

항목 값
관리 소스 auto-distill.py 실측 SHA-256 60282ef96cbedcdaf67a27ef82ada48f6012c3f8260709d341e0cd1ce35cb702
evaluation-receipt.json의 subject.sha256 (미갱신) 124e89be288c7bd90508030aa920f12b37386b5b1210f91de6e50f8313a4b85a
main 소스 SHA-256 (= receipt 값과 일치) 124e89be288c7bd90508030aa920f12b37386b5b1210f91de6e50f8313a4b85a

scripts/verify-auto-distill-receipt.py:204("receipt subject SHA-256 does not match managed source")에서 전면 거부됩니다. 로컬 재현:

$ python3 scripts/verify-auto-distill-receipt.py \
    --source scripts/auto-distill/auto-distill.py \
    --receipt scripts/auto-distill/evaluation-receipt.json
evaluation receipt invalid: receipt subject SHA-256 does not match managed source   # exit 3

영향받는 체크(런 36532339629):

  • python-lint — test_install/test_receipt 다수 케이스가 subject 검증에서 조기 실패해, 테스트가 기대하는 'not signed as passed' / 'collateral damage' / 'resolved_id is' 메시지에 도달하기 전에 막힙니다.
  • validate-harness, validate-harness-shard (4) — 동일 원인.

참고: ENTAIL_PROMPT는 receipt의 surface_members에 없어 surface_sha256(9894a32b…)은 불변입니다. 즉 프롬프트 단락 자체는 문제가 없고, receipt가 소스 변경을 따라가지 못한 것이 유일한 원인입니다.

수정 방향

docs/auto-distill.md 명시 규칙: "changing even a comment in auto-distill.py changes the full SHA and therefore requires a fresh exact-source evaluation and a new reviewed receipt". 필드만 고치는 우회가 아니라, 수정된 소스로 exact-source 평가를 다시 수행해 새 reviewed receipt를 커밋해야 합니다. 커밋 전 확인:

python3 scripts/verify-auto-distill-receipt.py --source scripts/auto-distill/auto-distill.py --json   # 기대 sha 확인
python3 scripts/verify-auto-distill-receipt.py --source scripts/auto-distill/auto-distill.py --receipt scripts/auto-distill/evaluation-receipt.json

이 PR은 seoseo-ai 작성이라 타 계정은 브랜치를 수정할 수 없어, 재현 절차와 근거를 이 코멘트로 남깁니다.

@seoseo-ai

Copy link
Copy Markdown
Collaborator Author

오너 결정 (2026-10-08 KST, daegyo 세션): 보류 유지. 실측 결과 AUTO.md 산출물이 사실상 소비되지 않음 — Wiki AUTO.md 11개 전부 8/26~27 이후 갱신 없음, 약 920건 중 사람 판정 57건(승격 4), daegyo 로컬 후보 952건·판정 0, publish_wiki.py 예약 없음, daegyo 세션 289개 중 AUTO를 지식으로 읽은 세션 0. 판정 품질 개선보다 산출물을 실제로 쓰이게 하는 재설계가 먼저라 그쪽을 진행하고, 이 PR은 재설계 결과에 따라 재개/폐기 결정.

@jinon86

jinon86 commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

종료일 연장 (gwakga, 2026-10-24 KST): 10/23 판정 근거였던 #2186 4단계 측정이 무효로 판정됐습니다(assemble 사실 예산 버그로 auto-distill 주입 기회 0 — #2500, 수정 #2501 머지). 재측정 창은 2026-10-25 06:00 → 2026-11-08 06:00 KST이며, 그 결과로 이 PR의 재개/폐기를 오너가 판정합니다. 지표·명령은 #2186 최신 코멘트에 있습니다.

@jinon86 jinon86 changed the title [10/23 종료예정] fix(auto-distill): define "핵심" in the entail rubric (#1846) [11/08 판정예정] fix(auto-distill): define "핵심" in the entail rubric (#1846) Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants