From f75a4556514507fdcdd4d2a9e09a564c92e3d403 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 12 Nov 2026 21:40:19 +0900 Subject: [PATCH] =?UTF-8?q?docs(claude):=20verify-api=EA=B0=80=20verify.sh?= =?UTF-8?q?=EB=A1=9C=20=EC=95=B1=EC=9D=84=20=EB=9D=84=EC=9A=B0=EA=B2=8C=20?= =?UTF-8?q?=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 문제: verify-api 서브에이전트는 desktop worktree에서 `flock /tmp/claude-gates/heavy.lock scripts/bootstrap-local.sh`를 직접 돌린다. bootstrap-local.sh의 ./gradlew에는 --no-daemon이 없어 desktop에 Gradle daemon이 남는다(여러 worktree를 받은 daemon이 compiler worker를 쌓아 메모리를 채운 일이 있다). 5단계가 따르라는 "4.1절의 정리법"은 operate.md에 없다. 고른 방법: `scripts/verify.sh app --on here`로 부른다. verify.sh가 공유 잠금을 잡고 GRADLE_OPTS로 daemon을 끈 채 같은 스크립트를 부른다. 앱은 compose로 떠 있으니 4단계 호출은 그대로다. 정리는 compose down과 git worktree remove만 적고, 못 지우면 보고에 남기게 한다. 버린 대안: bootstrap-local.sh의 ./gradlew에 --no-daemon을 붙이기 — 사람이 노트북에서 처음 돌릴 때는 daemon이 이득이라 스크립트 기본값은 두고, desktop 쪽 진입점(verify.sh)이 끈다. 검증: test_verify_api_runs_the_app_on_the_desktop_under_the_shared_lock을 새 절차로 바꿨다(verify.sh app --on here와 git worktree remove를 요구하고, 잠금만 두른 직접 호출과 "정리법"을 거절). 기준 verify-api.md에서 실패, 고친 파일에서 통과. test_claude_setup 16건 통과. --- .claude/agents/verify-api.md | 4 ++-- scripts/tests/test_claude_setup.py | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.claude/agents/verify-api.md b/.claude/agents/verify-api.md index 8b1d5faa..704e1c83 100644 --- a/.claude/agents/verify-api.md +++ b/.claude/agents/verify-api.md @@ -18,9 +18,9 @@ Gradle·Docker는 desktop에서만 돈다. 절차의 정본은 `docs/work/operat 1. desktop에 따로 worktree를 만든다. 기존 checkout `~/workspace/clean-architecture-backend-template`의 브랜치와 `stash@{0}`는 건드리지 않는다. 2. 로그 폴더 `~/<작업 이름>-logs/`를 만들고 `uptime`으로 부하를 본다. -3. worktree 루트에서 `flock /tmp/claude-gates/heavy.lock scripts/bootstrap-local.sh > ~/<작업 이름>-logs/bootstrap.log 2>&1; echo "rc=$?"`를 돌린다. 스크립트가 컴파일 → DB 기동 → 앱 기동 → health 200과 `status=UP`을 차례로 본다. +3. worktree 루트에서 `scripts/verify.sh app --on here > ~/<작업 이름>-logs/bootstrap.log 2>&1; echo "rc=$?"`를 돌린다. `verify.sh`가 공유 잠금을 잡고 Gradle daemon을 끈 채 `scripts/bootstrap-local.sh`를 부른다. 스크립트가 컴파일 → DB 기동 → 앱 기동 → health 200과 `status=UP`을 차례로 본다. 4. 앱이 떠 있는 동안 받은 endpoint를 `curl --silent --show-error --max-time 5 --write-out '\n%{http_code}'`로 부르고 응답을 로그 폴더에 남긴다. -5. 저장소 루트에서 `docker compose --profile '*' down`으로 내린다. 컨테이너가 만든 root 소유 폴더가 남으면 4.1절의 정리법을 따른 뒤 worktree를 지운다. +5. 저장소 루트에서 `docker compose --profile '*' down`으로 내리고 `git worktree remove`로 worktree를 지운다. 지우지 못하면 「남은 것」에 적는다. ## 돌려줄 것 diff --git a/scripts/tests/test_claude_setup.py b/scripts/tests/test_claude_setup.py index e06afa9e..961087a7 100644 --- a/scripts/tests/test_claude_setup.py +++ b/scripts/tests/test_claude_setup.py @@ -140,9 +140,13 @@ class SubagentTest(unittest.TestCase): def test_verify_api_runs_the_app_on_the_desktop_under_the_shared_lock(self) -> None: text = (AGENTS / "verify-api.md").read_text(encoding="utf-8") - for fragment in ("docs/work/operate.md", "flock /tmp/claude-gates/heavy.lock", "scripts/bootstrap-local.sh", - "stash@{0}", "down"): + # verify.sh takes the shared lock and turns the Gradle daemon off; a bare flock around the bootstrap script + # left a daemon behind on the desktop, and the cleanup it pointed at was in no manual. + for fragment in ("docs/work/operate.md", "scripts/verify.sh app --on here", "scripts/bootstrap-local.sh", + "stash@{0}", "down", "git worktree remove"): self.assertIn(fragment, text) + self.assertNotIn("heavy.lock scripts/bootstrap-local.sh", text) + self.assertNotIn("정리법", text) class SkillTest(unittest.TestCase):