Stage 4: GraphStore Protocol + find_neighbors _expand — Neo4j 확장 7종·소비자 스니핑 제거 (cov 86%)#28
Merged
Conversation
…hbors·Protocol 계약 테스트 - _graph_protocol.py: base 13종 + extended 7종(get_node_by_id 포함 — Neo4j 미구현 확인) 2-Protocol 분리 - test_find_neighbors_contract.py: R6 특성화 51건(3백엔드, self-loop 백엔드차 pin) - test_graph_protocol_contract.py: R5 계약, Neo4j extended 8건 xfail(strict)=D3 대상
- Neo4j extended 7종 계약을 정상/오류/엣지 실어서션으로 교체(존재확인→동작검증) - FakeNeo4jStore가 export_nodes/edges 직접 호출에 대응하도록 갱신
…핑 제거 - R6: local(151→59줄)·pg find_neighbors의 out/in 중복 → _expand(direction), pg 배치 prefetch 보존 - R5: Neo4jStore에 get_node_by_id·list_packs·find_by_relations·export_nodes/edges·upsert_*_batch 7종 구현(기존 흩어진 Cypher 재사용으로 output parity) - 소비자 hasattr/isinstance 스니핑 제거: content_pack_list·ontology_get_node·impact.analyse/lever_simulate·neo4j_export(죽은 _node_query 등 3헬퍼 삭제) - 남김(STOP&report): list_edges wide/narrow shape 비대칭(Stage 6 정규화 대상), query.py:697 shim(test-only 페이크 시그니처 가드 — 실제로 R5 무관, Stage 8 테스트 정리 시 제거)
- ontology_list_edges: R5로 Neo4j가 export_edges 획득 → narrow run_cypher 폴백 삭제, 4백엔드 wide-shape 통일(Stage 1 판단보류 비대칭 해소), 예외 시 실제 메시지 반환 - query.py:812 keyword_search isinstance 분기: Protocol 미포함 사유 주석(Stage 8 이관) - ontology_list_nodes else 내 도달불가 if pack_id 필터 제거
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.
프로그램 Stage 4/9. 그래프 스토어 인터페이스 균일화 + find_neighbors 중복 제거.
R6 — find_neighbors _expand 추출 (순수 리팩)
local(151→59줄)·pg의 out/in 방향 중복 블록을
_expand(direction)하나로 통합. pg의 레벨 단위 배치 prefetch(_batch_frontier_edges/_batch_node_props_multi) 보존. 백엔드 파라미터라이즈 계약 테스트(test_find_neighbors_contract.py)가 안전망.R5 — GraphStore Protocol + Neo4j 균일화
_graph_protocol.py:GraphStore(base 13종) +GraphStoreExtended(7종) @runtime_checkable Protocol부수 동작 변화 (PR 명기)
남긴 스니핑 (문서화)
원장
fable 검증
조건부 PASS → 후속 3건 반영: F1(list_edges 스니핑이 R5로 무력화된 것을 wide 통일로 명시화, red-first), F2(keyword_search 예외 주석), F3(죽은 코드). R6 순수 추출·배치 보존, R5 Cypher/shape parity, ontology_list_nodes 등가성 하드증거 확인. 시뮬레이션-CI 1504/0 failed.
프로세스
전 서브에이전트에 git 상태변경 명령 전면 금지(Stage 3 reset 사고 재발 방지) — 무사고.