From 676896955fde8f69979cfc542e20798a7bd60373 Mon Sep 17 00:00:00 2001 From: swrring Date: Thu, 16 Apr 2026 12:01:08 +0900 Subject: [PATCH] =?UTF-8?q?feat(process):=20=EC=A1=B0=EC=A7=81=20=ED=94=84?= =?UTF-8?q?=EB=A1=9C=EC=84=B8=EC=8A=A4=20=EA=B3=A0=EB=8F=84=ED=99=94=20?= =?UTF-8?q?=ED=86=B5=ED=95=A9=206=EA=B1=B4=20=EC=9D=BC=EA=B4=84=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84=20(PD=EB=8B=98=20=EC=A7=81=EC=A0=91=20?= =?UTF-8?q?=EC=A7=80=EC=8B=9C)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. git_fetch_throttle.sh: --ff-only 자동 merge 추가 (문서 반영 시차 해소) 2. hold_watch.sh: HOLD·긴급 파일 변경 감지 경고 (UserPromptSubmit hook) 3. change_digest.sh: SessionStart 변경 요약 자동 출력 (세션 간 소통) 4. P22 결정로그 발행 의무 신설 + 소통 허브 README 갱신 (발신 의무화) 5. P19 PD 지시 로그 활성·아카이브 2분할 구조 규칙화 (완료 항목 잔류 차단) 6. stale_check.sh: 상태 불일치 자동 감지 (안전망) settings.json: hold_watch.sh + change_digest.sh hook 등록, C16-1 3중 배치. Co-Authored-By: Claude Opus 4.6 (1M context) --- .claude/settings.json | 8 ++++++ .claude/skills/너드나비스-코어룰/SKILL.md | 33 +++++++++++++++++++++++ scripts/change_digest.sh | 27 +++++++++++++++++++ scripts/git_fetch_throttle.sh | 9 +++++-- scripts/hold_watch.sh | 32 ++++++++++++++++++++++ scripts/stale_check.sh | 33 +++++++++++++++++++++++ 개발실/.claude/settings.json | 8 ++++++ 공유/소통/README.md | 27 +++++++++++++++++++ 기획실/.claude/settings.json | 8 ++++++ 9 files changed, 183 insertions(+), 2 deletions(-) create mode 100644 scripts/change_digest.sh create mode 100644 scripts/hold_watch.sh create mode 100644 scripts/stale_check.sh diff --git a/.claude/settings.json b/.claude/settings.json index 5c4b8ea..f50351a 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -57,6 +57,10 @@ { "type": "command", "command": "bash scripts/inbox_scan.sh 2>/dev/null || true" + }, + { + "type": "command", + "command": "bash scripts/change_digest.sh 2>/dev/null || true" } ] } @@ -68,6 +72,10 @@ { "type": "command", "command": "bash scripts/git_fetch_throttle.sh 2>/dev/null || true" + }, + { + "type": "command", + "command": "bash scripts/hold_watch.sh 2>/dev/null || true" } ] } diff --git a/.claude/skills/너드나비스-코어룰/SKILL.md b/.claude/skills/너드나비스-코어룰/SKILL.md index 5366d33..d33985a 100644 --- a/.claude/skills/너드나비스-코어룰/SKILL.md +++ b/.claude/skills/너드나비스-코어룰/SKILL.md @@ -781,6 +781,16 @@ PD님이 각 부서 세션에서 직접 지시한 사항은 **부서가 자체 - **개발실장**: 개발실 PD 지시 로그 관리 책임 - **총괄PM**: 정기 모니터링 시 두 로그 확인 (P9 표준 절차) +### 로그 구조: 활성·아카이브 2분할 (2026-04-16 PD님 직접 지시) + +PD 지시 로그 테이블을 **2개 섹션**으로 분리한다: +- **`## 활성 지시`**: 상태가 `대기`·`진행중`·`보류`인 항목만 +- **`## 완료 아카이브`**: 상태가 `완료`·`취소`인 항목 + +세션 갱신(P21) 시 **활성 지시 테이블만** 스캔하여 보고. 완료 항목이 활성 테이블에 잔류하는 문제를 구조적으로 차단. + +항목이 `완료`/`취소`로 상태 변경되면 **즉시 아카이브 섹션으로 이동**한다. 이동 책임은 상태를 변경한 에이전트에게 있다. + ### 위반 시 - 로그 누락·갱신 누락 발견 즉시 소급 등록 - 반복 위반 시 교훈 섹션에 기록 @@ -843,6 +853,29 @@ PD님이 **"세션 갱신"**이라고 지시하면, 해당 세션의 에이전 - "동기화" - "sync" +## P22. 결정로그 발행 의무 (2026-04-16 PD님 직접 지시) + +세션에서 **의미 있는 결정**이 발생하면, 세션 종료 전에 자기 송신 채널(`공유/소통/{부서}→PM/` 또는 `공유/소통/PM→{부서}/`)에 **결정로그** 1건을 발행한다. 대화 안에서만 존재하는 결정사항은 조직 자산이 되지 못한다. + +### 발행 기준 +다음에 해당하면 결정로그 필수: +- 규칙(C·P) 신설·변경 +- 설계·아키텍처 결정 +- PD님 지시의 해석·적용 방향 결정 +- 타 부서에 영향 있는 변경 + +### 형식 +3줄 이내. YAML 프론트매터 `type: 결정로그`. 커밋 prefix `comm(dec):`. + +``` +- **배경**: (왜 이 결정이 필요했는가) +- **결정**: (무엇을 어떻게 결정했는가) +- **영향**: (어떤 부서·작업에 영향이 있는가) +``` + +### 수신 +SessionStart hook의 `change_digest.sh`가 자동 표시. 별도 pull 불필요. + --- ## 교훈 및 노하우 diff --git a/scripts/change_digest.sh b/scripts/change_digest.sh new file mode 100644 index 0000000..91a772d --- /dev/null +++ b/scripts/change_digest.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# SessionStart hook용 — 마지막 확인 이후 변경 요약 출력 +# 세션 간 소통 부재(문제 2) 해소: 커밋 메시지 자체가 소통 채널 역할 + +THROTTLE_DIR="$HOME/.claude/.nerdnavis_throttle" +mkdir -p "$THROTTLE_DIR" 2>/dev/null + +GIT_DIR=$(git rev-parse --git-dir 2>/dev/null) +[ -z "$GIT_DIR" ] && exit 0 + +REPO_HASH=$(echo "$GIT_DIR" | sha1sum 2>/dev/null | cut -d' ' -f1) +LAST_SEEN_FILE="$THROTTLE_DIR/last_seen_sha_$REPO_HASH" + +CURRENT=$(git rev-parse HEAD 2>/dev/null) +LAST_SEEN=$(cat "$LAST_SEEN_FILE" 2>/dev/null) + +if [ -n "$LAST_SEEN" ] && [ "$LAST_SEEN" != "$CURRENT" ]; then + DIGEST=$(git log --oneline "$LAST_SEEN".."$CURRENT" 2>/dev/null | head -10) + if [ -n "$DIGEST" ]; then + COUNT=$(echo "$DIGEST" | wc -l | tr -d ' ') + echo "📋 [변경 요약] 마지막 확인 이후 ${COUNT}건:" + echo "$DIGEST" + fi +fi + +echo "$CURRENT" > "$LAST_SEEN_FILE" +exit 0 diff --git a/scripts/git_fetch_throttle.sh b/scripts/git_fetch_throttle.sh index 1bc0948..3898822 100644 --- a/scripts/git_fetch_throttle.sh +++ b/scripts/git_fetch_throttle.sh @@ -26,8 +26,13 @@ date +%s > "$THROTTLE_FILE" CHANGES=$(git log --oneline HEAD..origin/main 2>/dev/null | head -5) if [ -n "$CHANGES" ]; then - echo "📌 [auto-sync] origin/main 변경 검출 (마지막 fetch 5분 이상 경과):" + echo "📌 [auto-sync] origin/main 변경 검출:" echo "$CHANGES" - echo "→ 권장: git merge origin/main --no-edit" + git merge origin/main --no-edit --ff-only 2>/dev/null + if [ $? -eq 0 ]; then + echo "✅ 자동 동기화 완료 (ff-only)" + else + echo "⚠️ 자동 merge 불가 — 세션 갱신으로 수동 해결 필요" + fi fi exit 0 diff --git a/scripts/hold_watch.sh b/scripts/hold_watch.sh new file mode 100644 index 0000000..9a203c7 --- /dev/null +++ b/scripts/hold_watch.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# UserPromptSubmit hook용 — HOLD·긴급 파일 변경 감지 경고 +# 기획실 Phase 3 HOLD 인지 실패 사례(2026-04-15)의 근본 방지 +# C10-3 HOLD 충돌 처리 자동화 + +REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null) +[ -z "$REPO_ROOT" ] && exit 0 + +THROTTLE_DIR="$HOME/.claude/.nerdnavis_throttle" +mkdir -p "$THROTTLE_DIR" 2>/dev/null +HOLD_HASH_FILE="$THROTTLE_DIR/hold_files_hash" + +# 현재 HOLD·긴급 파일 목록 수집 +HOLD_FILES=$(find "$REPO_ROOT" -maxdepth 2 \( -name '🛑_*' -o -name '⚠️_*' -o -name '🚨_*' \) 2>/dev/null | sort) + +if [ -z "$HOLD_FILES" ]; then + # HOLD 파일 없음 — 해시 초기화 + echo "" > "$HOLD_HASH_FILE" + exit 0 +fi + +CURRENT_HASH=$(echo "$HOLD_FILES" | sha1sum 2>/dev/null | cut -d' ' -f1) +PREV_HASH=$(cat "$HOLD_HASH_FILE" 2>/dev/null) + +if [ "$CURRENT_HASH" != "$PREV_HASH" ]; then + echo "🚨 [HOLD 감지] HOLD·긴급 파일 변경 발견:" + echo "$HOLD_FILES" | while read -r f; do + echo " → $(basename "$f")" + done + echo "$CURRENT_HASH" > "$HOLD_HASH_FILE" +fi +exit 0 diff --git a/scripts/stale_check.sh b/scripts/stale_check.sh new file mode 100644 index 0000000..96e6bde --- /dev/null +++ b/scripts/stale_check.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# P21 세션 갱신 보조 — PD 지시 로그 상태 불일치 자동 감지 +# "진행중"인데 산출물에 "완료"·"main 반영" 키워드가 있는 항목을 표면화 +# 완료 항목 잔류 문제(문제 3)의 안전망 + +REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null) +[ -z "$REPO_ROOT" ] && exit 0 + +TRACKING_DIR="$REPO_ROOT/공유/PD_지시_트래킹" +[ ! -d "$TRACKING_DIR" ] && exit 0 + +FOUND=0 +for LOG in "$TRACKING_DIR"/*_PD_지시_로그.md; do + [ ! -f "$LOG" ] && continue + DEPT=$(basename "$LOG" | sed 's/_PD_지시_로그.md//') + + # "활성 지시" 섹션만 스캔 (2분할 적용 후) + # 2분할 미적용 로그도 호환: 전체 스캔 fallback + STALE=$(grep -n "진행중" "$LOG" | grep -i "완료\|main 반영\|main 병합\|push 완료\|정식 편입" 2>/dev/null) + + if [ -n "$STALE" ]; then + COUNT=$(echo "$STALE" | wc -l | tr -d ' ') + if [ "$FOUND" -eq 0 ]; then + echo "⚠️ [상태 점검] 완료 추정이나 '진행중'인 항목 감지:" + FOUND=1 + fi + echo " ${DEPT}: ${COUNT}건" + fi +done + +[ "$FOUND" -eq 0 ] && exit 0 +echo " → 로그 상태 갱신 검토 필요" +exit 0 diff --git a/개발실/.claude/settings.json b/개발실/.claude/settings.json index 5c4b8ea..f50351a 100644 --- a/개발실/.claude/settings.json +++ b/개발실/.claude/settings.json @@ -57,6 +57,10 @@ { "type": "command", "command": "bash scripts/inbox_scan.sh 2>/dev/null || true" + }, + { + "type": "command", + "command": "bash scripts/change_digest.sh 2>/dev/null || true" } ] } @@ -68,6 +72,10 @@ { "type": "command", "command": "bash scripts/git_fetch_throttle.sh 2>/dev/null || true" + }, + { + "type": "command", + "command": "bash scripts/hold_watch.sh 2>/dev/null || true" } ] } diff --git a/공유/소통/README.md b/공유/소통/README.md index 642bcdf..3f49da2 100644 --- a/공유/소통/README.md +++ b/공유/소통/README.md @@ -84,11 +84,38 @@ due: <희망처리시점> # 없으면 생략 (C15: 기한 개념 배제, | `comm(ans):` | 응답 발송 | | `comm(rpt):` | 보고·상태 공유 | | `comm(mv):` | 완료 아카이브 이동 | +| `comm(dec):` | 결정로그 발행 | 예: `comm(req): PM→개발실 C21 초안 v2 검토 요청` --- +## 결정로그 (Decision Log) — 세션 간 소통 핵심 채널 + +> **2026-04-16 PD님 직접 지시로 신설.** 세션 간 소통 부재 근본 해결. + +### 목적 +각 세션에서 내린 **핵심 결정사항·노하우**를 대화 안에 묻히지 않게 파일로 남겨, 타 세션이 인지할 수 있도록 한다. + +### type: 결정로그 +YAML 프론트매터의 `type: 결정로그`로 분류. + +### 발행 의무 +- 세션에서 **의미 있는 결정**이 발생하면, 세션 종료 전에 자기 송신 채널에 결정로그 1건 발행 +- 형식: 3줄 이내 핵심만 (배경 1줄 + 결정 1줄 + 영향 1줄) +- 발행 후 커밋·push (C20 팀장 재량) + +### 파일 명명 +``` +YYYY-MM-DD_DEC번호_제목.md +예: 2026-04-16_DEC001_P21_세션갱신_프로토콜_신설.md +``` + +### 수신 자동화 +SessionStart hook의 `change_digest.sh`가 커밋 로그에서 `comm(dec):` 접두사를 포함한 변경을 자동 표시하므로, 수신 세션은 resume만으로 결정로그 존재를 인지. + +--- + ## C21(초안)과의 관계 - C21-1(작업 완료 즉시 push): 통신 파일 생성·응답 작성 시점에 **안건 단위로 1회 push** diff --git a/기획실/.claude/settings.json b/기획실/.claude/settings.json index 5c4b8ea..f50351a 100644 --- a/기획실/.claude/settings.json +++ b/기획실/.claude/settings.json @@ -57,6 +57,10 @@ { "type": "command", "command": "bash scripts/inbox_scan.sh 2>/dev/null || true" + }, + { + "type": "command", + "command": "bash scripts/change_digest.sh 2>/dev/null || true" } ] } @@ -68,6 +72,10 @@ { "type": "command", "command": "bash scripts/git_fetch_throttle.sh 2>/dev/null || true" + }, + { + "type": "command", + "command": "bash scripts/hold_watch.sh 2>/dev/null || true" } ] }