fix(v2): references reference_kind 도입 — 'index↔count' QA 모순 해소#176
Merged
Conversation
binary_search '적어도 K개' 류에서 K가 collection 크기에 묶인 cardinality(개수)
인데 references 메커니즘이 위치 인덱스 prose('가리키는 1-indexed 번호')만 방출해,
narrative 의 '목표 개수(인덱스 아님)' 서술과 'index↔count' 모순 → QA ambiguity
reject 되던 결함(taskB-run1 fail_qa 실측)의 해소.
- IOFieldSpec.reference_kind: Literal["index","cardinality"] 추가 (default "index").
index=위치 번호(현행·graph s/t·질의 인덱스), cardinality=크기에 묶인 개수/수량.
- _render_field / render_constraints: cardinality 분기('개수/수량 … 위치 인덱스가
아니다'). index 경로 무변경 → 기존 graph io_contract byte-identical, 무회귀.
- 생성기(_is_reference/_serialize_reference) 무수정 → 두 kind 생성 입력 byte-identical
(범위·symbolic_max 동일, 의미 prose 만 분기).
- DB 스키마/migration 영향 0: reference_kind 는 internal_meta 미포함=비-persist,
input_format(Text)·constraints[].description(기존 JSON 키) 문자열만 변동.
- formalizer 가이드에 cardinality 판별 규율 추가. describe_io_field 에 kind 마킹.
- 테스트 5종(prose 분기·byte-identical·default·describe). 게이트 903 passed/
mypy --strict 100/ruff green.
측정: binary_search P1 N=3 에서 cardinality references 설계 0회 발생(설계 변동성,
taskB 1/3→이번 0/3)이라 해당 실패 클래스 live 미재현 — 결정론적 렌더링은 단위
입증, LLM 의 cardinality emit 은 가이드+back-route QA 가 처리. 별개 실패 모드
(output_format↔description '누적↔단위' 용어 드리프트)는 후속 후보.
3 tasks
LsMin124
added a commit
that referenced
this pull request
Jun 25, 2026
… 드리프트 해소 (#177) formalizer 가 io_schema.output_format 을 LLM 자유 prose 로 저작하는데 일반(도메인) 모드엔 도메인-중립 규율이 없어(abstract 모드 전용이었음), 이른 시점에 오류 도메인 용어(예 '누적 수확량')를 쓰면 narrative 가 나중에 올바른 용어(예 '단위 수확량')를 독립 저작해 'output_format↔description' 모순 → QA ambiguity reject 되던 결함 (outputs/measure-refkind-after run1 fail_qa 실측)의 해소. - formalizer _SYSTEM_PROMPT(일반 모드): output_format 은 인쇄 구조(타입·개수·형식· 1/0-indexed·sentinel)만 서술하고 답의 도메인 의미는 narrative 가 단일 저작하도록 규율 추가. _EASY_SYSTEM_PROMPT 에도 간결 동일 규율(전 모드 일반화). - reference_kind(#176) 와 동일 버그 클래스: 이른/형식 레이어가 narrative 와 별개로 도메인 의미를 단정하던 드리프트 표면 제거 (single-IR consistency-by-construction). - DB/스키마/migration 무변경 (프롬프트 문자열 변경, output_format 은 input_format 과 같은 Text 컬럼 — 구조 불변). 측정: binary_search P1 N=3 출하율 1/3→3/3(outputs/measure-outfmt-after, $1.24). output_format 0/3 도메인 용어(전부 구조-중립; run2 는 '1-indexed 위치 의미는 지문이 정의한다' 명시=위임 내재화 증거). QA ambiguity 0·fail_synthesis 0·crash 0. N=3 은 작고 binary_search ship rate 노이즈 있으나(2/3→1/3→3/3) 중립화 메커니즘은 확증. 게이트 903 passed/mypy --strict 100/ruff green.
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.
요약
binary_search'적어도 K개' 류 문제에서K가 collection 크기에 묶인 **cardinality(개수)**인데,references메커니즘이 위치 인덱스 prose(가리키는 1-indexed 번호)만 방출했습니다. 그 결과 narrative의 "목표 개수(인덱스 아님)" 서술과 'index↔count' 모순이 발생해 QAambiguityblocker로 reject되던 결함(taskB-run1fail_qa실측)을 해소합니다.변경
IOFieldSpec.reference_kind: Literal["index","cardinality"]추가 (default"index").index= 위치 번호 (현행 · graph s/t · 질의 인덱스)cardinality= collection 크기에 묶인 개수/수량 (예: '적어도 K개'의 K)_render_field/render_constraints:cardinality분기 — "크기에 묶인 개수/수량 … 위치 인덱스가 아니다".index경로는 무변경 → 기존 graphio_contractbyte-identical, 무회귀._is_reference/_serialize_reference) 무수정 → 두 kind의 생성 입력 byte-identical (범위·symbolic_max동일, 의미 prose만 분기).describe_io_field에 kind 마킹.DB 영향: 없음
reference_kind는internal_meta에 미포함 = DB에 비-persist (역파싱 위험 0).cardinality선택 시에만input_format(Text)·constraints[].description(기존 JSON 키 내부) 문자열만 변동 — 일반 문제 텍스트가 run마다 다른 것과 동일, 스키마 무관.검증
index→ "가리키는 1-indexed 번호"(모순),cardinality→ "개수/수량 … 위치 인덱스가 아니다"(정합). 생성 byte-identical(20케이스)·K범위[1,N]·symbolic_max(N) 동일.측정 (정직 고지)
binary_search P1 N=3 에서
cardinalityreferences 설계가 0회 발생(formalizer 설계 변동성; taskB 1/3 → 이번 0/3)하여 해당 실패 클래스가 live 미재현. 따라서:cardinalityemit은 가이드 + back-route QA 루프가 처리.Test plan
pytest903 passed (cardinality prose 분기 · byte-identical · default · describe 마킹 5종)mypy --strict100 files cleanruffclean