BurningTimesAi/scripts/verify_setup.ps1

173 lines
6.8 KiB
PowerShell
Raw Normal View History

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
# BurningTimes 조직 레포 - 신 PC 셋팅 검증 스크립트 (Windows / PowerShell)
#
# 목적: `setup/setup_windows.ps1` 실행 후, 본 PC가 조직 레포를 정상 사용할 수 있는 상태인지
# 파일 존재·OS 동작(reparse point)·실행 결과(JSON 파싱) 3축으로 검증.
#
# 사용: PowerShell에서
# .\scripts\verify_setup.ps1
# 또는 (상세 출력) .\scripts\verify_setup.ps1 -Verbose
#
# Exit code: 0 = OK, 1 = 결함 발견 (stderr에 항목 나열)
[CmdletBinding()]
param()
$ErrorActionPreference = "Stop"
$repoRoot = (Resolve-Path (Join-Path $PSScriptRoot "..")).Path
$fail = @()
$warn = @()
function Check([string]$name, [bool]$ok, [string]$detail) {
if ($ok) {
Write-Host "[OK] $name$detail"
} else {
Write-Host "[FAIL] $name$detail" -ForegroundColor Red
$script:fail += "$name :: $detail"
}
}
function Warn([string]$name, [string]$detail) {
Write-Host "[WARN] $name$detail" -ForegroundColor Yellow
$script:warn += "$name :: $detail"
}
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
Write-Host "=== BurningTimes 셋팅 검증 ==="
Write-Host "RepoRoot: $repoRoot"
Write-Host ""
# 1. paths.local.json 실파일·파싱·필수 키 (2026-04-18 worktree fallback 추가)
$pathsFile = Join-Path $repoRoot "paths.local.json"
if (-not (Test-Path $pathsFile)) {
# worktree 감지 — 공통 git dir 기반 메인 레포 루트 추론 (C34-15 worktree 안전성)
try {
$gitCommon = (& git -C $repoRoot rev-parse --git-common-dir 2>$null) | Out-String
$gitCommon = $gitCommon.Trim()
if ($gitCommon -and (Test-Path $gitCommon)) {
$mainRoot = Split-Path (Resolve-Path $gitCommon).Path -Parent
$altPaths = Join-Path $mainRoot "paths.local.json"
if (Test-Path $altPaths) {
$pathsFile = $altPaths
Warn "paths.local.json worktree fallback" "본 worktree 없음 → 메인 레포 경유: $pathsFile"
}
}
} catch {}
}
$paths = $null
if (Test-Path $pathsFile) {
try {
$raw = Get-Content $pathsFile -Raw -Encoding UTF8
$paths = $raw | ConvertFrom-Json
Check "paths.local.json 존재·JSON 파싱" $true $pathsFile
} catch {
Check "paths.local.json 존재·JSON 파싱" $false "JSON 파싱 실패: $_"
}
} else {
Check "paths.local.json 존재" $false "파일 없음(메인 레포도). setup_windows.ps1 선행 필요: $pathsFile"
}
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
$required = @("BURNINGTIMES_ROOT","UNITY_PROJECT_ROOT","FRAMEWORK_PKG_ROOT","TABLE_EXPORT_ROOT")
if ($paths) {
foreach ($k in $required) {
$v = $paths.$k
$ok = [bool]$v
Check "paths.local.json 키 [$k]" $ok ("값=" + ($v -as [string]))
}
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
# BURNINGTIMES_ROOT 실제 디렉토리 존재 여부
if ($paths.BURNINGTIMES_ROOT) {
Check "BURNINGTIMES_ROOT 디렉토리 존재" (Test-Path $paths.BURNINGTIMES_ROOT) $paths.BURNINGTIMES_ROOT
}
# Unity·Framework·TableExport는 경고 수준 (존재하지 않아도 일부 작업은 가능)
foreach ($k in @("UNITY_PROJECT_ROOT","FRAMEWORK_PKG_ROOT","TABLE_EXPORT_ROOT")) {
$v = $paths.$k
if ($v -and -not (Test-Path $v)) {
Warn "$k 디렉토리 미존재" "$v (해당 부서 작업 시 필요)"
}
}
}
# 3. 경로 추상화 적용 여부 (CLAUDE.md 계열에 구 하드코딩 경로 잔존 확인)
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
$hardcodePatterns = @("C:/Users/PC/Documents", "D:/BurningTimes/FilGoodBandits", "D:/BurningTimes/BurningTimes.Framework")
$scanTargets = @(
(Join-Path $repoRoot "CLAUDE.md"),
(Join-Path $repoRoot ".claude\skills")
) | Where-Object { Test-Path $_ }
$hits = @()
foreach ($t in $scanTargets) {
$files = if ((Get-Item $t).PSIsContainer) { Get-ChildItem $t -Recurse -File -Include *.md } else { @(Get-Item $t) }
foreach ($f in $files) {
$content = Get-Content $f.FullName -Raw -ErrorAction SilentlyContinue
foreach ($p in $hardcodePatterns) {
if ($content -match [regex]::Escape($p)) {
$hits += "$($f.FullName) :: '$p'"
}
}
}
}
if ($hits.Count -eq 0) {
Check "CLAUDE.md 계열 경로 추상화" $true "하드코딩 구 경로 미발견"
} else {
Warn "CLAUDE.md 계열 경로 추상화" ("잔존 " + $hits.Count + "건 — 변수화 후보")
foreach ($h in $hits) { Write-Host " - $h" -ForegroundColor DarkYellow }
}
# 4. .gitignore 핵심 규칙 (paths.local.json 무시)
$gi = Join-Path $repoRoot ".gitignore"
if (Test-Path $gi) {
$giText = Get-Content $gi -Raw
Check ".gitignore paths.local.json 제외" ($giText -match "paths\.local\.json") ".gitignore 라인 확인됨"
} else {
Check ".gitignore 존재" $false ".gitignore 파일 없음"
}
feat(#57 후속): 옵션 A Unity 프로젝트 SessionStart 자동 pull 구축 PD님 2026-04-20 승인 "옵션 A로 진행" 수용. PC별 클론 경로 상이 수용 + C30 이행 자동화 + C30 예외 명시 불요로 전환. [자진 고지 양축] - 개발팀장 축: #57 "C30 점검 불가" 자진 고지는 FilGoodBandits 상위만 확인한 오류. 실제 DeckBuilding/.git 실존 (NerdNavis/DeckBuilding.git) - PM 축: Agent 응답 환경 판정 주장을 재실측 없이 수용 (C27 변형 위반) - feedback_git_scope_shortcut.md 양축 재발 방지 기록 [집행 7종] - scripts/unity_project_sync.sh 신설 (Lock + stale cleanup + trap 제거 + C34-12 Degraded) - .claude/settings.json SessionStart hook 편입 - scripts/verify_setup.ps1 2.8 섹션 (UNITY 경로·git·sync 4축 검증) - SKILL.md C30-1 운용 세칙 정비 (수동 점검 → SessionStart hook 자동 이행, 외연 유지) - paths.local.json.template (기존 UNITY_PROJECT_ROOT 재활용) - feedback_git_scope_shortcut.md 신설 (양축) - MEMORY.md 인덱스 [pm-auditor 감사 정정] - Critical 2·Major 3·Minor 2·Improvement 2 전수 수용 - C34-15 5문항 체크 결과 대화로그 기재 - Lock cleanup 로직 포함 - feedback 양축 기록 [Unity MCP 편집 표준 워크플로우 v1 0단계 추가 — 개발팀장 후속 Task] 본 commit 후 별도 Task 위임 (Agent 경계 보호) [C30 예외 명시 자연 종결] PD 결정 3 (C30 예외 보류) → 자동 pull 구축으로 불요 전환 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 09:09:18 +00:00
# 2.8. Unity 프로젝트 자동 pull 설정 검증 (C30 자동 이행 · 2026-04-20 옵션 A PD 승인)
$pathsLocal = Join-Path $repoRoot "paths.local.json"
if (Test-Path $pathsLocal) {
try {
$pathsJson = Get-Content $pathsLocal -Raw | ConvertFrom-Json
$unityRoot = $pathsJson.UNITY_PROJECT_ROOT
if ($unityRoot) {
Check "Unity 프로젝트 경로 설정 (paths.local.json)" $true $unityRoot
if (Test-Path $unityRoot) {
$unityGit = Join-Path $unityRoot ".git"
if (Test-Path $unityGit) {
Check "Unity 프로젝트 git 레포 실체" $true $unityRoot
} else {
Warn "Unity 프로젝트 git 레포 아님" "$unityRoot — C30 수동 점검 대상 외 (C34-12 Degraded)"
}
} else {
Warn "Unity 프로젝트 경로 부재" "$unityRoot — paths.local.json UNITY_PROJECT_ROOT 재확인 필요"
}
} else {
Warn "UNITY_PROJECT_ROOT 미설정" "paths.local.json에 경로 지정 필요"
}
} catch {
Warn "paths.local.json 파싱 실패" $_.Exception.Message
}
} else {
Warn "paths.local.json 부재" "paths.local.json.template 복사 후 UNITY_PROJECT_ROOT 설정 필요 (C30 자동 pull 미작동)"
}
$unitySyncScript = Join-Path $repoRoot "scripts\unity_project_sync.sh"
Check "scripts/unity_project_sync.sh 존재" (Test-Path $unitySyncScript) $unitySyncScript
# 5. settings.json (조직 공용 승인) 존재
$settings = Join-Path $repoRoot ".claude\settings.json"
Check ".claude/settings.json (조직 공용 승인)" (Test-Path $settings) $settings
# 결과
Write-Host ""
Write-Host "=== 결과 요약 ==="
Write-Host "PASS: 상기 [OK] 표기"
if ($warn.Count -gt 0) {
Write-Host "WARN: $($warn.Count)건 — 블로커 아님" -ForegroundColor Yellow
}
if ($fail.Count -gt 0) {
Write-Host "FAIL: $($fail.Count)건 — 아래 항목 해결 필요" -ForegroundColor Red
foreach ($f in $fail) { Write-Host " - $f" -ForegroundColor Red }
exit 1
}
Write-Host "셋팅 검증 통과. 작업 착수 가능." -ForegroundColor Green
exit 0