vignette/docs/ops/public-runtime-watchdog.md
Yun Chan 085460b5e0 대시보드 폴드아웃/드릴다운 정리 + 페르소나 역린·misconduct 반응 + 게이트웨이 격리·RAG 비차단 수정
SSOT 대시보드:
- 한신대 기술분석 PDF(19쪽) 정합성 분석 + 이번 세션 발견 섹션 추가
- 섹션 폴드아웃(접기)·상단 목차(드릴다운)·모두 펼치기/접기 — 내용 보존, 레이아웃만 정리

페르소나 반응 강화('저항·반응 조절' 핵심 차별):
- PersonaCard.triggers(역린) 필드 + CCD 핵심상처 파생 역린 블록
- L0에 무례·모욕·조롱 시 현실적 동맹 균열 반응 지침

버그·성능 수정(라이브/E2E로 포착):
- 게이트웨이 페르소나 격리: --append-system-prompt를 --system-prompt(교체)로 + --exclude-dynamic-system-prompt-sections (내담자 캐릭터 붕괴·개발맥락 누출 차단)
- RAG: 임베더 동기 로드(약 7-13초)를 _warm_rag_caches 백그라운드 warm으로(세션 생성 블로킹 회귀 수정)
- voice TTS RMS 데드힌트 제거, init_state OpennessParams 파라미터객체화
- 한국어 PII(날짜·금액·주소) 마스킹 보강
- 레이아웃 시각 게이트: 폼 컨트롤 값 스크롤 오탐 제외(7/7)

검증: 백엔드 84/84, E2E 42(데스크톱 27·모바일 11·아바타 4), 시각 게이트 7/7
2026-06-27 02:30:46 +09:00

100 lines
3 KiB
Markdown

# Public Runtime Watchdog
This runbook keeps the public Vignette runtime recoverable after Windows
reboot, update, or process crash. It covers:
- engine gateway: `http://127.0.0.1:9099`
- prod API: `http://127.0.0.1:8001`
- Cloudflare tunnel for `https://api-vignette.chanpaca.net`
## Secret Handling
Do not put secrets in scheduled task arguments.
The scripts use the existing runtime locations:
- API secrets stay in `apps/api/.env`.
- Cloudflared credentials stay under the current user's `.cloudflared` config.
- Claude CLI OAuth/config stays in the current Windows user profile.
The installer creates a per-user interactive scheduled task. It starts at user
logon and repeats as a watchdog. Fully unattended boot before any user logs in
requires an operator-managed service account or Task Scheduler credential; do
that in Windows, not by adding secrets to these scripts.
## Install Or Update
From the repo root:
```powershell
powershell -NoProfile -ExecutionPolicy Bypass -File scripts\install-public-runtime-task.ps1 -RunNow
```
The installer is idempotent. Re-running it updates the same task:
```powershell
powershell -NoProfile -ExecutionPolicy Bypass -File scripts\install-public-runtime-task.ps1 -IntervalMinutes 5
```
Task name:
```powershell
VignettePublicRuntimeWatchdog
```
## Manual Start
Use this when you want to force a runtime restore immediately:
```powershell
powershell -NoProfile -ExecutionPolicy Bypass -File scripts\start-public-runtime.ps1
```
`start-public-runtime.ps1` now verifies or starts the engine gateway before it
starts the prod API and cloudflared.
## Health Checks
```powershell
powershell -NoProfile -ExecutionPolicy Bypass -File scripts\watch-public-runtime.ps1 -CheckOnly
Invoke-RestMethod http://127.0.0.1:9099/health
Invoke-RestMethod http://127.0.0.1:8001/health
Invoke-RestMethod https://api-vignette.chanpaca.net/health
```
Optional real Claude CLI readiness smoke:
```powershell
Invoke-RestMethod http://127.0.0.1:9099/ready
```
`/ready` can consume a small Claude budget because it performs a real generation.
## Logs And Task State
```powershell
Get-ScheduledTask -TaskName VignettePublicRuntimeWatchdog
Get-ScheduledTaskInfo -TaskName VignettePublicRuntimeWatchdog
Get-Content .\public-runtime-watchdog.log -Tail 50
Get-Content .\apps\api\engine.public.err.log -Tail 50
Get-Content .\apps\api\api.public.err.log -Tail 50
Get-Content .\cloudflared.public.err.log -Tail 50
```
## Remove
```powershell
Unregister-ScheduledTask -TaskName VignettePublicRuntimeWatchdog -Confirm:$false
```
## Recovery Notes
If local health is good but public health fails, inspect the cloudflared process
and `C:\Users\<user>\.cloudflared\vignette-config.yml`.
If engine health fails, verify that `claude` runs for the same Windows user that
owns the scheduled task and that the user has completed Claude CLI login.
If API health fails with `environment`, `db`, or auth configuration errors,
inspect `apps/api/.env`; do not copy secret values into scripts or task
arguments.