Skip to content

Stage 5: 백엔드 동작 통일 B1/B2/B3 (BREAKING) — find_path·delete_node·workflow 전이#29

Merged
epruseal merged 2 commits into
mainfrom
fix/s5-contracts
Jul 5, 2026
Merged

Stage 5: 백엔드 동작 통일 B1/B2/B3 (BREAKING) — find_path·delete_node·workflow 전이#29
epruseal merged 2 commits into
mainfrom
fix/s5-contracts

Conversation

@epruseal

@epruseal epruseal commented Jul 5, 2026

Copy link
Copy Markdown
Owner

프로그램 Stage 5/9. 사용자 승인 BREAKING 변경 — 4개 그래프 백엔드가 같은 시그니처로 다르게 동작하던 3개 지점을 통일.

⚠️ BREAKING CHANGES (백엔드별 before→after)

B1 find_path(from_id, to_id, max_depth)

  • before: local/pg는 최대 2×max_depth 홉 도달 / kuzu는 max_depth 홉 / neo4j는 무방향(bidirectional)
  • after: 4백엔드 모두 max_depth = 최대 홉 수, out-edge only (local/pg의 2× 초과도달 제거, neo4j Cypher -[*1..N]--[*1..N]->)

B2 delete_node(node_id) → bool

  • before: local/pg는 엣지 삭제 rowcount 반환(엣지 0개 노드 삭제 시 False — QUIRK) / kuzu는 예외 없으면 항상 True / neo4j는 노드 count>0
  • after: 4백엔드 모두 "노드가 실제 삭제됐는지" 반환. 엣지 삭제는 유지(고아 방지)

B3 workflow.advance(run_id, status)

  • before: 전이 규칙 없음 — completed→pending 등 임의 전이 허용
  • after: VALID_TRANSITIONS 강제(실재 VALID_STATUSES 6종에서 도출), 위법·동일상태 전이는 ValueError. UPDATE 이전에 거부하므로 부분 쓰기 없음

안전성 — 호출자 감사 (독립 재검증됨)

find_path/delete_node/advance 모두 프로덕션 라이브 호출부 0건: 그래프 메서드 2개는 스토어 내부·테스트에서만, advance의 유일 호출부(workflow_advance MCP 툴)는 registry에서 주석처리된 dormant. bool 반환 분기·2×reach 기대 호출자 없음.

원장

시점 passed skipped cov
Stage 4 1504 3 86%
Stage 5 1578 3 85.9% (래칫 82)

fable 검증 PASS

RED→GREEN worktree 실증(fd246cd 44 failed → HEAD 76 passed), 호출자 감사 독립 재검증, 백엔드별 B1/B2/B3 정합성, 전이 가드 우회 불가 확인. 시뮬레이션-CI 1578/0 failed.

후속 (Stage 6로 이관)

kuzu delete_node가 node_type 무시하고 node_id만으로 DELETE — 타입 불일치 시 오삭제 가능(프로덕션 호출부 0이라 비블로킹). Stage 6 kuzu 방언 작업에서 node_type 조건 추가.

epruseal added 2 commits July 6, 2026 02:06
- B1 find_path: max_depth=최대 홉수·out-edge (현재 local/pg 2×·neo4j 무방향이라 RED)
- B2 delete_node: 노드 실제 삭제 여부 (현재 local/pg 엣지 rowcount QUIRK·kuzu 항상 True라 RED)
- B3 workflow.advance: VALID_TRANSITIONS 전이규칙 (현재 무규칙이라 RED)
- 호출자 감사: 3메서드 전부 프로덕션 호출부 0(스토어 내부+테스트+dormant MCP 툴), BREAKING 안전
…BREAKING)

- B1 find_path: local/pg의 2×max_depth 초과도달 제거 → 4백엔드 모두 max_depth=최대 홉수·out-edge only(neo4j Cypher 무방향→방향)
- B2 delete_node: local/pg의 엣지 rowcount 반환 QUIRK 제거·kuzu 항상 True 수정 → 4백엔드 모두 '노드 실제 삭제 여부' 반환
- B3 workflow.advance: VALID_TRANSITIONS(pending/running/approved/rejected/completed/failed 실재 상태에서 도출) 강제, 위법·동일상태 전이 거부
- _graph_protocol docstring 통일 계약 반영, parity quirk 테스트·find_path max_depth 테스트 신계약 갱신
- 호출자 감사: 3메서드 전부 프로덕션 라이브 호출부 0(BREAKING 안전)
@epruseal
epruseal merged commit fc6aebe into main Jul 5, 2026
1 check passed
@epruseal
epruseal deleted the fix/s5-contracts branch July 5, 2026 17:22
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.

1 participant