Skip to content

refactor(graphify): upstream /graphify 단일 진입점 전환 — 레거시 Graphify 레이어 제거#35

Open
pko89403 wants to merge 6 commits into
mainfrom
feature/graphify-upstream-entrypoint
Open

refactor(graphify): upstream /graphify 단일 진입점 전환 — 레거시 Graphify 레이어 제거#35
pko89403 wants to merge 6 commits into
mainfrom
feature/graphify-upstream-entrypoint

Conversation

@pko89403
Copy link
Copy Markdown
Owner

@pko89403 pko89403 commented Apr 24, 2026

한 줄 요약

  • 이 PR은 repo-local Graphify orchestration 레이어를 제거하고 upstream /graphify 스킬을 유일한 Graphify 모델로 전환합니다.

배경 / 문제

  • 기존 상태: repo-local Graphify 레이어(scripts, hooks, CI job, BUILD_INFO trust signal, staged verify/sync flow)가 upstream /graphify와 중복·충돌
  • 문제: upstream 업데이트 시 로컬 어댑터 유지보수 부담, 이중 오케스트레이션으로 인한 혼란
  • 이번 PR의 목표: upstream /graphify를 single source of truth으로, .graphifyignore로 corpus boundary 제어

PR 대시보드

항목 내용
유형 refactor / feat / chore
영향 범위 harness / docs / tests / CI / hooks
동작 변경 없음 (그래프 생성 결과 동일)
Breaking Change 없음
관련 이슈 SKI-11
기준 브랜치 main

변경 묶음별 리뷰 가이드

변경 묶음 파일/디렉토리 무엇이 바뀌었나 리뷰 포인트 실행 없이 보는 법
upstream 스킬 도입 .agents/skills/graphify/SKILL.md upstream v4 SKILL.md를 그대로 복사 원본 대비 변경 없음 확인 파일 전체 확인
graphify hooks .githooks/post-commit, .githooks/post-checkout upstream graphify hook install + raw/ 리마인더 커스텀 post-commit에 raw/ 감지 로직 확인 hook 스크립트 하단 참조
레거시 스크립트 제거 scripts/graphify_*.{sh,py}, scripts/hooks/graphify-*.sh 7개 스크립트 + 3개 hook 삭제 삭제된 파일 목록만 확인 git diff --stat
레거시 스킬 제거 .agents/skills/graphify-{manager,full}/ 2개 repo-local 스킬 삭제 삭제 확인 디렉토리 부재 확인
문서 정리 CLAUDE.md, AGENTS.md, README.md, README.ko.md "staged full-refresh" → upstream 용어로 통일 용어 일관성 diff에서 텍스트만 비교
Hook/CI 정리 .claude/settings.json, .codex/hooks.json, .github/workflows/ci.yml Graphify orchestration hook 제거, CI candidate job 제거 guard hook(pretool-block-graphify-out.sh) 유지 확인 설정 파일 diff
테스트 재작성 tests/test_graphify_harness.py 23개 contract test를 upstream-only 모델로 전환 테스트 커버리지 유지 테스트 이름과 assertion 확인
Eval 프레임워크 scripts/graphify_eval.py, tests/test_graphify_eval_*.py 그래프 품질 평가 도구 + 7개 fixture 추가 eval 로직, fixture 구조 eval script 진입점 확인
Codex awareness hook (후속 커밋) .codex/hooks.json, scripts/hooks/pretool-graphify-awareness.sh, CLAUDE.md, .agents/policies/local-adaptation.md upstream graphify codex install의 inline 명령을 repo-local 스크립트로 추출. stdin JSON을 파싱해 grep|rg|find|fd 계열 Bash에만 awareness emit word-boundary 정규식 정확성, graphify codex install 재실행 금지 안내 스크립트 20줄 + matcher JSON
그래프 재생성 graphify-out/graph.json, GRAPH_REPORT.md, graph.html upstream 파이프라인으로 재생성 (awareness hook 후 875 nodes, 1946 edges, 34 communities) node/edge 수 합리성 GRAPH_REPORT.md 요약

Before / After

Before

  • repo-local Graphify 레이어: code_update/full_refresh 모드 분리, BUILD_INFO trust signal, staged verify → sync 흐름
  • 7개 오케스트레이션 스크립트 + 3개 Claude hook + CI candidate job
  • 에이전트가 Graphify 작업 시 로컬 어댑터 경유 필수
  • graph 갱신은 수동 또는 Claude hook에 의존

After

  • upstream /graphify 단일 진입점 (/graphify ., /graphify . --update)
  • .graphifyignore로 corpus boundary 제어
  • pretool-block-graphify-out.sh guard hook만 유지 (에이전트 직접 편집 방지, Claude 전용 — Codex는 apply_patch 경로가 hook API 밖이라 원천 불가)
  • graphify hook install 기반 자동화:
    • post-commit: 코드 변경 → AST 자동 리빌드 (LLM 비용 없음) + raw/ 변경 시 리마인더 출력
    • post-checkout: 브랜치 전환 → 자동 리빌드
  • Codex graphify awareness hook (후속 커밋):
    • .codex/hooks.json PreToolUse Bash matcher → scripts/hooks/pretool-graphify-awareness.sh
    • upstream이 모든 Bash 호출에 awareness를 emit하는 반면, 이 스크립트는 grep/rg/find/fd 계열만 필터링해 Claude의 Glob|Grep matcher와 기능적 시맨틱 parity 확보 (Codex API가 Bash-only로 제한됨을 우회)
    • local-adaptation.md에 "graphify codex install 재실행 금지" 운영 규칙 명시 — 재실행 시 repo-local 스크립트 경로가 upstream inline command로 덮어써짐
  • 레거시 아티팩트(BUILD_INFO.json, VERIFY_FULL_REFRESH.json, manifest.json, cost.json) .gitignore에 추가

검증

항목 결과 근거
테스트 uv run pytest — 148 passed (최초 143, eval + awareness 추가 후 148)
린트 uv run ruff check .
타입체크 uv run mypy src — 30 files
graphify hook 동작 raw/ 변경 커밋 시 리마인더 출력 확인
awareness hook smoke grep/rg/find/fd/subshell/pipe → EMIT, ls/git/uv run pytest/ungrep/invalid JSON → SILENT (12/12)
pre-push scripts/hooks/pre-push.sh 내 143 test gate 통과

남은 리스크 / 후속 작업

  • graph 재생성 주기 정립 — 문서/논문 변경 시 수동 --update 필요 (hook이 리마인더로 안내)
  • main과 충돌 해소 (현재 CONFLICTING)
  • 운영 규칙: graphify codex install 재실행 금지. upstream awareness 메시지 내용 변경은 scripts/hooks/pretool-graphify-awareness.sh를 수동으로 갱신해 반영.
  • Codex API 제약: Codex PreToolUse는 Bash 전용, apply_patch/Write/Edit은 hook 범위 밖. 따라서 Claude의 pretool-block-graphify-out.sh와 동등한 파일 편집 차단은 Codex 측에서 불가. AGENTS.md(=CLAUDE.md) 지시 준수에 의존.
  • 주의할 점: graphify-out/graph.json diff가 크지만 upstream 재생성 결과이므로 내용 리뷰 불필요
  • 리뷰 시 특히 볼 부분: post-commit hook의 raw/ 리마인더 로직, guard hook 유지 여부, awareness hook의 정규식 word-boundary 처리

Codex and others added 6 commits April 24, 2026 10:23
Remove the entire repo-local Graphify orchestration layer:

Scripts removed:
- graphify_code_refresh.sh, graphify_prepare_corpus.sh
- graphify_full_refresh.py, graphify_semantic_adapter.py
- graphify_verify_full_refresh.py, graphify_sync_staged.sh
- graphify_ci_candidate.sh

Hooks removed:
- graphify-auto-refresh.sh, graphify-pretool.sh, graphify-mode-note.sh
- Claude/Codex hook registrations for Graphify

CI removed:
- graphify-full-refresh-candidate job

Tests removed:
- test_graphify_auto_refresh.py, test_graphify_producer.py
- test_graphify_workflow.py

Artifacts removed:
- graphify-out/BUILD_INFO.json
- build_info_full_refresh.json, full_refresh_graph.json fixtures

Docs updated:
- AGENTS.md, CLAUDE.md, README.md, README.ko.md now upstream-only
- .graphifyignore is the canonical corpus boundary
- Eval fixtures migrated from full_refresh to document_context
- Graph artifacts regenerated (883 nodes, 2349 edges, 33 communities)

All 148 tests pass. ruff/mypy clean.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Delete ephemeral artifacts from git: VERIFY_FULL_REFRESH.json,
  manifest.json, cost.json, .graphify_chunk_01.json
- Add graphify-out ephemeral files to .gitignore
- Remove dangling --ignore=test_graphify_auto_refresh.py from pre-push.sh
- Replace "staged Graphify full-refresh" with upstream wording in SPEC.md

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…eminder

- graphify hook install: AST rebuild on every commit (no LLM cost)
- post-checkout: rebuild on branch switch
- Custom raw/ reminder: prints update suggestion when docs/papers change

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codex hook API only supports Bash matcher, so upstream graphify emits
awareness on every Bash call. This script parses stdin JSON and fires
only for grep/rg/find/fd-class commands, matching Claude's Glob|Grep
semantics while staying within Codex's API constraint.

Reverts English upstream section appended to CLAUDE.md by
`graphify codex install`; folds only the new rule (graphify
query/path/explain) into the existing Korean 레이어 2 section. Warns
against re-running the upstream installer in local-adaptation.md
since it would overwrite the repo-local script reference.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Post-commit hook rebuilt graph.json/graph.html/GRAPH_REPORT.md after
the Codex awareness hook commit. 875 nodes, 1946 edges, 34 communities.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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