G7 증명과 G8 clean-head 승격 준비

This commit is contained in:
Yun Chan 2026-08-09 18:22:03 +09:00
parent 94c681d450
commit 5221f79e3f
52 changed files with 6876 additions and 506 deletions

View file

@ -87,15 +87,28 @@ powershell -NoProfile -ExecutionPolicy Bypass -File scripts\start-tailscale-runt
공개 API 복구 스크립트는 `docs/ops/public-runtime-watchdog.md`가 runbook이다. 로컬 개발 서버와 별개로
prod API 8001, web preview 5174, engine gateway 9099, cloudflared tunnel을 검사한다.
```powershell
powershell -NoProfile -ExecutionPolicy Bypass -File scripts\watch-public-runtime.ps1 -CheckOnly
powershell -NoProfile -ExecutionPolicy Bypass -File scripts\install-public-runtime-task.ps1 -RunNow
```
- shared branch worktree의 watchdog/start script를 직접 실행하지 않는다. 승인된 clean commit의 detached release
worktree를 만들고, 그 root 내부 registrar에 `-StableSourceRoot`를 명시해 두 task를 승격한다.
- Scheduled Task는 현재 Windows 사용자 기준 `AtLogOn` + 반복 watchdog이다. 사용자 로그인 전 headless boot service가 아니다.
- secret은 task 인자에 넣지 않는다. API secret은 `apps/api/.env`, cloudflared/Claude CLI credential은 사용자 profile에 둔다.
$releaseRoot = 'D:\workspace\vignette-public-runtime-<commit>'
$bootRegistrar = Join-Path $releaseRoot 'scripts\register-boot-task.ps1'
& powershell.exe -NoProfile -ExecutionPolicy Bypass -File $bootRegistrar -StableSourceRoot $releaseRoot
$watchdogInstaller = Join-Path $releaseRoot 'scripts\install-public-runtime-task.ps1'
& powershell.exe -NoProfile -ExecutionPolicy Bypass -File $watchdogInstaller -StableSourceRoot $releaseRoot -IntervalMinutes 5
- `VignettePublicRuntime`은 로그온 Docker/DB 복구, `VignettePublicRuntimeWatchdog`은 로그온+5분 반복 health/recovery다.
- 두 task action은 release root와 Git commit/tree, boot 또는 watchdog SHA-256, start script SHA-256을 고정한다.
등록 뒤 action marker와 working directory를 읽어 검증하기 전에는 `RunNow`를 호출하지 않는다.
- secret은 task 인자에 넣지 않는다. API secret은 stable release의 `apps/api/.env`, cloudflared/Claude CLI credential은
사용자 profile에 둔다. `.env` 내용을 console이나 evidence에 출력하지 않는다.
- 아직 DNS가 없는 future host는 기본 검사에 넣지 않는다. `api-vnet.18ka.net`처럼 실제로 열린 뒤에만 `-AdditionalPublicHealthUrls`로 명시 추가한다.
- 완료 판정은 parser/check-only가 아니라 실제 재부팅 또는 로그오프/로그온 뒤 `Get-ScheduledTaskInfo`, watchdog 로그의 `restart verified`, public health, 인증된 public `/turn` smoke까지 한 세트로 남겨야 한다.
- `watch-public-runtime-hidden.vbs`는 source를 직접 실행하지 않고 pin marker를 검증한 등록 task만 trigger한다.
- 완료 판정은 parser/check-only가 아니라 실제 재부팅 또는 로그오프/로그온 뒤 `Get-ScheduledTaskInfo`, stable release의
watchdog 로그, public health, process cwd/Git provenance, 인증된 public `/turn` smoke까지 한 세트로 남겨야 한다.
- detached worktree 생성, `.env`/`node_modules` 준비, source pin 검증, read-only `-CheckOnly` 전체 명령은 runbook을 따른다.
- G7 공개 증거 승격은 routine API-only 복구와 다르다. `-RequireFreshPublicProvenance` + `-ForceApiRestart`
API와 exact-config cloudflared를 둘 다 새 PID로 교체하고 commit/tree·Python/cloudflared/config SHA와 safe receipt를
결속한다. 이 모드에서 `-SkipCloudflaredRestart`는 금지되며, 정확한 명령은 runbook의 G7 fresh 절을 따른다.
### 수동 기동(대안)