BurningTimesAi/scripts/manifest_archive.sh

56 lines
1.7 KiB
Bash
Raw Normal View History

#!/bin/bash
# post-commit hook — 활성 매니페스트 cross-check + archived 이동
# C35-9 Layer 3 근본 해결 2026-04-20
# M-1 수용: commit diff vs manifest target_files cross-check (부분집합 감지)
feat(BT·신설): 조직 신설 Phase 1 — git 저장소 교체 + 중앙 저장소 A안 분리 PD님 2026-04-21 직접 지시 5개 중 1·2·4 이행. ## 집행 내역 1. git remote: NerdNavisAi.git → BurningTimesAi.git 교체 (BT main + 본 worktree) - E:/NerdNavisAi 레포 원격은 원상 유지 (실측 확인) 2. 중앙 저장소 A안 분리: ~/.claude/burningtimes-{live,memory,audit}/ - nerdnavis-* 중앙 저장소에서 cp -r 복사 (원본 미변경) - .junction-marker 내용 BT로 갱신 3. 본 worktree .live junction 재연결 → burningtimes-live 4. audit junction 3종 신설: .burningtimes_{auditor_calls,warning_ignored,bypass_log} 5. scripts·setup 28파일 하드코딩 일괄 치환 (nerdnavis/NerdNavis/너드나비스/NERDNAVIS → burningtimes/BurningTimes/BURNINGTIMES) 6. paths.local.json.template BT 전용 재작성 (Unity·Framework 경로 __TBD__ placeholder) 7. .gitignore: .live.bak_*/ 패턴 추가 ## 보류 항목 (PD 재논의 예정) - 3. memory/org/ 내용 초기화 (PD 지시) - 5. Unity 프로젝트 경로 (PD 신규 경로 제공 전까지) - SKILL.md·CLAUDE.md 조직명 전환 및 P17·P29 처리 - 프로젝트/수상한잡화점/ 등 수상한잡화점 관련 일괄 정리 - 코어코드/NerdNavis.Framework/ → BT-프레임워크 이름 전환 - 공유/조직공지/ 너드나비스 맥락 공지 처리 - .claude/agents/*.md frontmatter skills 참조명 ## 감사 pm-auditor 사전 감사 통과 (Critical 0건, Major 2건 commit 전 정정 완료). 매니페스트: bt-org-split-phase1 (C35-9 PreToolUse 차단 해제). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 15:14:51 +00:00
MANIFEST_DIR="$HOME/.claude/burningtimes-audit/manifest"
ACTIVE_DIR="$MANIFEST_DIR/active"
ARCHIVED_DIR="$MANIFEST_DIR/archived"
[ ! -d "$ACTIVE_DIR" ] && exit 0
mkdir -p "$ARCHIVED_DIR" 2>/dev/null
# 본 commit의 수정 파일 목록
COMMIT_FILES=$(git diff-tree --no-commit-id --name-only -r HEAD 2>/dev/null)
[ -z "$COMMIT_FILES" ] && exit 0
# 활성 매니페스트 각각 cross-check + archived 이동
MOVED=0
for mf in "$ACTIVE_DIR"/*.md; do
[ -f "$mf" ] || continue
PLAN_ID=$(basename "$mf" .md)
# target_files 추출 (YAML frontmatter)
TARGET_FILES=$(awk '/^target_files:$/,/^[a-z_]+:/' "$mf" | grep -E '^ - ' | sed 's/^ - //')
# cross-check: commit_files 중 target_files 밖 파일
OUT_OF_SCOPE=()
while IFS= read -r cf; do
[ -z "$cf" ] && continue
if ! echo "$TARGET_FILES" | grep -qFx "$cf"; then
OUT_OF_SCOPE+=("$cf")
fi
done <<< "$COMMIT_FILES"
if [ "${#OUT_OF_SCOPE[@]}" -gt 0 ]; then
echo "⚠️ [manifest cross-check] $PLAN_ID" >&2
echo " target_files 밖 수정 ${#OUT_OF_SCOPE[@]}건:" >&2
for f in "${OUT_OF_SCOPE[@]}"; do
echo " - $f" >&2
done
echo " → M-1 사후 경고. 매니페스트 범위 축소 조작 가능성 점검 필요." >&2
fi
# archived 이동
if mv "$mf" "$ARCHIVED_DIR/" 2>/dev/null; then
echo "📦 [manifest archived] $PLAN_ID"
MOVED=$((MOVED + 1))
fi
done
[ "$MOVED" -gt 0 ] && echo "✅ [manifest] $MOVED건 archived 이동 완료"
exit 0