Skip to content

[feat][hooks] GF-128 트레일러 삽입을 prepare-commit-msg로 이전 - #49

Open
coralstay wants to merge 13 commits into
mainfrom
task/GF-128
Open

coralstay wants to merge 13 commits into
mainfrom
task/GF-128

Conversation

@coralstay

Copy link
Copy Markdown
Owner

#48(GF-127) 위에 쌓인 PR입니다. #48을 먼저 병합해 주세요. 그 전까지는 이 PR diff에 GF-127 커밋도 함께 보입니다.

요약

  • 트레일러를 post-commit의 git commit --amend 대신 prepare-commit-msg에서 git interpret-trailers --in-place로 메시지 파일에 직접 쓴다. hooks/post-commit 삭제.
    • 커밋 해시가 한 번 바뀌던 문제, 재귀 가드, rebase 중 실패, 죽은 검증 마커가 함께 사라진다.
  • 중복 판정을 메시지 원문 줄 단위·키 기준(대소문자 무시)으로 바꿔 Task-Id/Co-Authored-By 중복을 없앴다.
  • AI-Tool/AI-Tool-Version/AI-Model → AI-Agent: <도구>/<버전> (<모델>) 한 줄. Verify-Bypassed 제거.
  • Signed-off-by는 AI 도구가 감지되지 않은 커밋에만 붙인다 (decision-30, DRAFT-22 보관).
  • 토큰 측정 대상 파일은 스테이징된 인덱스에서 구한다 (commit -a/commit <path>의 임시 인덱스 포함).

검증

  • python3 -m unittest discover -s tests → 129 tests OK, ruff check 통과
  • 수동: 사람 커밋 → Signed-off-by 있음 / 에이전트 커밋 → 없음, 앞 문단 Task-Id 중복 없음, git rebase 재생 exit 0·트레일러 추가 없음
  • 이 PR의 커밋들 자체가 새 훅으로 만들어졌고 트레일러 중복이 없다

알려진 한계

  • 훅 이후 git이 커밋을 중단하면(서명 실패, 빈 메시지) 그 턴이 귀속된 것으로 기록돼 재시도 커밋에서 토큰이 적게 잡힌다
  • README·hooks/readme.md·.gitmessage·일부 backlog 문서의 post-commit 설명은 GF-132/GF-134에서 정리

🤖 Generated with Claude Code

coralstay and others added 13 commits October 4, 2026 10:39
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Task-Id: GF-127
AI-Tool: claude-code
AI-Tool-Version: 2.1.285
Co-Authored-By: Claude <noreply@anthropic.com>
AI-Model: claude-opus-5-5
Tokens-Used: in=146189 out=507
Tool-Calls: 2
Hooks-Commit: c44d145
Signed-off-by: coralstay <231006716+coralstay@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Task-Id: GF-127
AI-Tool: claude-code
AI-Tool-Version: 2.1.285
Co-Authored-By: Claude <noreply@anthropic.com>
AI-Model: claude-opus-5-5
Tokens-Used: in=331273 out=1399
Tool-Calls: 3
Hooks-Commit: a6e7568
Signed-off-by: coralstay <231006716+coralstay@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Task-Id: GF-127
AI-Tool: claude-code
AI-Tool-Version: 2.1.285
Co-Authored-By: Claude <noreply@anthropic.com>
AI-Model: claude-opus-5-5
Tokens-Used: in=0 out=0 (no-attributed-turn)
Tool-Calls: 0 (no-attributed-turn)
Hooks-Commit: 6e017c6
Signed-off-by: coralstay <231006716+coralstay@users.noreply.github.com>
commit-msg의 검증을 동작 그대로 옮기고 commit-msg를 삭제한다.
--no-verify로 검증을 건너뛸 수 없게 된다. git revert가 만드는
Revert/Reapply "..." 제목은 형식·50자 규칙의 예외로 둔다.
스테일 마커는 거부 경로보다 먼저 지워 거부 시 마커가 남지 않는다.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Task-Id: GF-127
AI-Tool: claude-code
AI-Tool-Version: 2.1.285
Co-Authored-By: Claude <noreply@anthropic.com>
AI-Model: claude-opus-5-5
Tokens-Used: in=1694468 out=722
Tool-Calls: 18
Hooks-Commit: 100d70e
Signed-off-by: coralstay <231006716+coralstay@users.noreply.github.com>
gitformat.conf, post-commit, CI 워크플로 주석이 commit-msg를 검증
주체로 적고 있어 prepare-commit-msg로 바로잡는다.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Task-Id: GF-127
AI-Tool: claude-code
AI-Tool-Version: 2.1.285
Co-Authored-By: Claude <noreply@anthropic.com>
AI-Model: claude-opus-5-5
Tokens-Used: in=398817 out=59
Tool-Calls: 3
Hooks-Commit: a55bda8
Signed-off-by: coralstay <231006716+coralstay@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Task-Id: GF-127
AI-Tool: claude-code
AI-Tool-Version: 2.1.285
Co-Authored-By: Claude <noreply@anthropic.com>
AI-Model: claude-opus-5-5
Tokens-Used: in=0 out=0 (no-attributed-turn)
Tool-Calls: 0 (no-attributed-turn)
Hooks-Commit: e70c3aa
Signed-off-by: coralstay <231006716+coralstay@users.noreply.github.com>
AC #7의 증거가 될 테스트가 없었다. revert 제목 예외가 깨진
설정을 가리지 않는지도 함께 본다.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Task-Id: GF-127
AI-Tool: claude-code
AI-Tool-Version: 2.1.285
Co-Authored-By: Claude <noreply@anthropic.com>
AI-Model: claude-opus-5-5
Tokens-Used: in=668636 out=1978
Tool-Calls: 5
Hooks-Commit: 149cc6b
Signed-off-by: coralstay <231006716+coralstay@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Task-Id: GF-127
AI-Tool: claude-code
AI-Tool-Version: 2.1.285
Co-Authored-By: Claude <noreply@anthropic.com>
AI-Model: claude-opus-5-5
Tokens-Used: in=0 out=0 (no-attributed-turn)
Tool-Calls: 0 (no-attributed-turn)
Hooks-Commit: c74ba4e
Signed-off-by: coralstay <231006716+coralstay@users.noreply.github.com>
DRAFT-22를 이 decision과 GF-128 AC #10 갱신으로 처리하고 보관한다.
GF-128 착수.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Task-Id: GF-128
AI-Tool: claude-code
AI-Tool-Version: 2.1.285
Co-Authored-By: Claude <noreply@anthropic.com>
AI-Model: claude-opus-5-5
Tokens-Used: in=0 out=0 (no-attributed-turn)
Tool-Calls: 0 (no-attributed-turn)
Hooks-Commit: db96b3a
Signed-off-by: coralstay <231006716+coralstay@users.noreply.github.com>
post-commit의 --amend 대신 메시지 파일에 interpret-trailers
--in-place로 쓴다. 중복은 메시지 원문의 키(대소문자 무시)로
판정한다. AI-Tool/AI-Tool-Version/AI-Model을 AI-Agent 한 줄로
합치고 Verify-Bypassed를 없앴다. Signed-off-by는 AI 도구가
감지되지 않은 커밋에만 붙인다(decision-30).

토큰 측정 대상은 GIT_INDEX_FILE이 가리키는 커밋될 인덱스와
HEAD의 차이다. 귀속 기록은 트레일러를 쓴 뒤에 저장한다.
hooks/post-commit은 같은 커밋에서 삭제한다(AC #9).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Task-Id: GF-128
AI-Agent: claude-code/2.1.285 (claude-opus-5-5)
Tokens-Used: in=6721960 out=1760
Tool-Calls: 45
Hooks-Commit: 8c15c7a
검증마커의 유일한 소비자는 post-commit의 Verify-Bypassed
판정이었고, _GITFORMAT_AMEND_GUARD는 post-commit의 --amend
재귀를 끊는 장치였다. 둘 다 post-commit과 함께 쓸모를 잃어
마커 기록·무효화, gitformat.markerFile 키, 가드와 그 테스트를
지운다(AC #7).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Task-Id: GF-128
AI-Agent: claude-code/2.1.285 (claude-opus-5-5)
Tokens-Used: in=1343974 out=377
Tool-Calls: 7
Hooks-Commit: 937573d
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Task-Id: GF-128
AI-Agent: claude-code/2.1.285 (claude-opus-5-5)
Tokens-Used: in=0 out=0 (no-attributed-turn)
Tool-Calls: 0 (no-attributed-turn)
Hooks-Commit: ff6d252
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Task-Id: GF-128
AI-Agent: claude-code/2.1.285 (claude-opus-5-5)
Tokens-Used: in=0 out=0 (no-attributed-turn)
Tool-Calls: 0 (no-attributed-turn)
Hooks-Commit: 08e26e9
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