feat(v2): 구조 IR 필드 GraphShape/indexing — F6~F8 단일 진실원천 (Phase 1 인프라) - #170
Merged
Conversation
단일 IR RFC(#169) Phase 1 의 read-side: 그래프 구조 사실을 직렬화기 상수/프롬프트 prose 에서 IR 필드로 끌어올려, 직렬화기가 READ 하고 투영이 파생하게 한다. 기본값=현 직렬화기 상수라 graph_shape=None·indexing=1 일 때 **byte-identical**(formalizer 가 변주하는 1b 까지 프로덕션 무위험). 스키마 (ipe/v1/schema/blueprint.py): - GraphShape(directed/self_loops/multi_edges/connectivity) — F6~F8. directed 는 오늘날 어디에도 결정 안 된 잠재 모순(F8: serializer 'u v w' / DijkstraVerifier directed 가정 / narrative '양방향' 자유서술 — 아무 게이트도 못 잡음)이라 필수 핀. - IOFieldSpec.graph_shape: GraphShape|None=None (옵셔널, 비-graph 무의미). - IOSchema.indexing: Literal[0,1]=1 (F9, _backbone 하드코딩을 IR 로 승격). 직렬화기/투영 (ipe/v2/generation/input_gen.py): - _serialize_weighted_edges/_tree_edges/_reference 가 graph_shape·indexing READ (self_loops→자기간선 허용, multi_edges=False→단순그래프 dedup, connected→ disconnected bias 무력화, indexing→정점 base). None/1 일 때 byte-identical. - render_input_format/render_constraints 가 graph_shape·indexing 에서 파생 (format prose 단일소스화). - render_structural_facts(io_schema) 신설 — narrative/QA 가 prose 규칙 대신 DATA 로 받을 구조 사실(1b 에서 소비). 게이트: 797 passed(+21) / mypy --strict 92 clean / ruff clean. 기존 전 suite 무수정 통과 = byte-identical 입증.
Merged
3 tasks
LsMin124
added a commit
that referenced
this pull request
Jun 24, 2026
…증 (Phase 1b, F8 폐쇄) (#171) 단일 IR RFC(#169) Phase 1 의 write-side: 1a(#170)가 깐 구조 IR 필드를 formalizer 가 실제로 EMIT 하고, narrative/faithfulness 가 prose 규칙 대신 투영된 구조 사실(DATA)로 검증한다. 모순 표면이 prompt 규칙(확률적)에서 graph_shape 단일 진실(구조적)로 이동. - formalizer: graph 구조 prose 규칙(self-loop 없음/다중간선/연결성) 삭제 → graph_shape 필드 EMIT 지령(directed/self_loops/multi_edges/connectivity). directed 는 F8(어디에도 결정 안 된 잠재 모순) 필수 핀 — 도메인 의미로 단/양방향 결정. - narrative: self-loop 금지 prose 삭제 → render_structural_facts 를 DATA 로 수령하고 그와 일치하게 서술(모순 시 faithfulness reject). - faithfulness: 구조 사실 DATA 공급 + 'narrative ↔ 구조 사실 모순 = distortion' 규율. - F8 verifier: 무수정. v1 DijkstraVerifier 는 v2 샘플('V E' 헤더)에 dormant(파서가 'V E s t' 4토큰 기대 → silent skip 실증) — F8 활성 표면은 format 계약↔golden↔ narrative 뿐이고 directed 가 거기 투영되므로 directed=True/False 모두 안전. 게이트: 816 passed(+6 신규 1b 프롬프트/데이터흐름 테스트) / mypy --strict 92 / ruff green. 출하율 측정은 PR 본문 참조.
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.
Summary
단일 IR RFC(#169) Phase 1 의 read-side(인프라). 그래프 구조 사실(F6~F8)과 인덱싱(F9)을 직렬화기 상수/프롬프트 prose 에서 IR 필드로 끌어올려, 직렬화기가 READ 하고 모든 투영이 그 단일 진실에서 파생하게 한다.
핵심 안전 속성 — byte-identical: 모든 신규 필드는 옵셔널이고 기본값이 현 직렬화기 상수와 동일하다.
graph_shape=None·indexing=1일 때 생성 바이트가 현행과 완전히 같다 → 기존 전 suite 가 무수정 통과(프로덕션 동작 불변). formalizer 가 이 필드들을 EMIT 하기 시작하는 1b 까지 무위험.변경
스키마 (
ipe/v1/schema/blueprint.py)GraphShape(directed/self_loops/multi_edges/connectivity)— F6~F8.directed는 오늘날 어디에도 결정 안 된 잠재 모순(serializeru v w방출 /DijkstraVerifierdirected 가정 / narrative '양방향' 자유서술 — 아무 게이트도 못 잡음 = F8)이라 필수 핀.IOFieldSpec.graph_shape: GraphShape | None = NoneIOSchema.indexing: Literal[0,1] = 1(F9 —_backbone하드코딩을 IR 로 승격)직렬화기 + 투영 (
ipe/v2/generation/input_gen.py)_serialize_weighted_edges/_tree_edges/_reference가graph_shape·indexing를 READ. self_loops→자기간선 허용, multi_edges=False→단순그래프 dedup, connectivity=connected→disconnected bias 무력화, indexing→정점 base.render_input_format/render_constraints가graph_shape·indexing에서 파생(format prose 단일소스화).render_structural_facts(io_schema)— 1b 에서 narrative/QA 가 prose 규칙 대신 DATA 로 소비할 구조 사실 투영.범위 밖 (Phase 1b, 별도 PR)
formalizer EMIT + 구조 prose 규칙 삭제 / narrative DATA 수령 / faithfulness 머신체크 / F8 verifier 정합 / N=9 P1 before·after 측정.
Test plan
pytest -m "not e2e"→ 797 passed (+21 신규: graph_shape 분기·0-indexed·구조사실 투영·스키마)ruff check ipe testscleanmypy --strict ipeclean (92 files)GraphShape(기본값)==None출력 동일 /self_loops·multi_edges·connectivity분기 /indexing=00-based /render_structural_facts4-fact 투영