대시보드 폴드아웃/드릴다운 정리 + 페르소나 역린·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
This commit is contained in:
parent
cb2aebd76c
commit
085460b5e0
327 changed files with 31226 additions and 1829 deletions
157
scripts/watch-public-runtime.ps1
Normal file
157
scripts/watch-public-runtime.ps1
Normal file
|
|
@ -0,0 +1,157 @@
|
|||
param(
|
||||
[string]$Workspace = "D:\workspace\vignette",
|
||||
[int]$ApiPort = 8001,
|
||||
[int]$EnginePort = 9099,
|
||||
[string]$Python = "$env:LOCALAPPDATA\Programs\Python\Python311\python.exe",
|
||||
[string]$Cloudflared = "$env:LOCALAPPDATA\Microsoft\WinGet\Links\cloudflared.exe",
|
||||
[string]$CloudflaredConfig = "$env:USERPROFILE\.cloudflared\vignette-config.yml",
|
||||
[string]$PublicHealthUrl = "https://api-vignette.chanpaca.net/health",
|
||||
[string]$LogPath = "",
|
||||
[switch]$CheckOnly,
|
||||
[switch]$SkipPublicHealth,
|
||||
[switch]$SkipCloudflaredRestart
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
if (!$LogPath) {
|
||||
$LogPath = Join-Path $Workspace "public-runtime-watchdog.log"
|
||||
}
|
||||
|
||||
function Write-WatchdogLog {
|
||||
param([string]$Message)
|
||||
|
||||
$line = "{0} {1}" -f (Get-Date -Format "yyyy-MM-ddTHH:mm:ssK"), $Message
|
||||
Write-Output $line
|
||||
Add-Content -Path $LogPath -Value $line -Encoding UTF8
|
||||
}
|
||||
|
||||
function Test-JsonHealth {
|
||||
param(
|
||||
[string]$Name,
|
||||
[string]$Uri,
|
||||
[scriptblock]$IsHealthy,
|
||||
[int]$TimeoutSec = 10
|
||||
)
|
||||
|
||||
try {
|
||||
$response = Invoke-RestMethod -Uri $Uri -TimeoutSec $TimeoutSec
|
||||
$ok = [bool](& $IsHealthy $response)
|
||||
$detail = $response | ConvertTo-Json -Compress -Depth 5
|
||||
[pscustomobject]@{
|
||||
Name = $Name
|
||||
Ok = $ok
|
||||
Detail = $detail
|
||||
}
|
||||
} catch {
|
||||
[pscustomobject]@{
|
||||
Name = $Name
|
||||
Ok = $false
|
||||
Detail = $_.Exception.Message
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function Test-CloudflaredProcess {
|
||||
if ($SkipCloudflaredRestart) {
|
||||
return [pscustomobject]@{
|
||||
Name = "cloudflared"
|
||||
Ok = $true
|
||||
Detail = "skipped"
|
||||
}
|
||||
}
|
||||
|
||||
$configLeaf = Split-Path -Leaf $CloudflaredConfig
|
||||
$process = Get-CimInstance Win32_Process |
|
||||
Where-Object {
|
||||
$_.Name -eq "cloudflared.exe" -and
|
||||
$_.CommandLine -and
|
||||
$_.CommandLine -like "*$configLeaf*"
|
||||
} |
|
||||
Select-Object -First 1
|
||||
|
||||
[pscustomobject]@{
|
||||
Name = "cloudflared"
|
||||
Ok = $null -ne $process
|
||||
Detail = if ($process) { "pid=$($process.ProcessId)" } else { "not running" }
|
||||
}
|
||||
}
|
||||
|
||||
$startScript = Join-Path $PSScriptRoot "start-public-runtime.ps1"
|
||||
if (!(Test-Path $startScript)) {
|
||||
throw "Start script not found at $startScript"
|
||||
}
|
||||
|
||||
$checks = @(
|
||||
(Test-JsonHealth `
|
||||
-Name "engine" `
|
||||
-Uri "http://127.0.0.1:$EnginePort/health" `
|
||||
-IsHealthy { param($health) $health.ok -eq $true }),
|
||||
(Test-JsonHealth `
|
||||
-Name "api" `
|
||||
-Uri "http://127.0.0.1:$ApiPort/health" `
|
||||
-IsHealthy { param($health) $health.environment -eq "prod" -and $health.db -and $health.engine }),
|
||||
(Test-CloudflaredProcess)
|
||||
)
|
||||
|
||||
if (!$SkipPublicHealth) {
|
||||
$checks += Test-JsonHealth `
|
||||
-Name "public-api" `
|
||||
-Uri $PublicHealthUrl `
|
||||
-IsHealthy { param($health) $health.environment -eq "prod" -and $health.db -and $health.engine } `
|
||||
-TimeoutSec 20
|
||||
}
|
||||
|
||||
$failed = @($checks | Where-Object { -not $_.Ok })
|
||||
if ($failed.Count -eq 0) {
|
||||
Write-WatchdogLog "healthy: $($checks.Name -join ', ')"
|
||||
exit 0
|
||||
}
|
||||
|
||||
Write-WatchdogLog "unhealthy: $((($failed | ForEach-Object { "$($_.Name)=$($_.Detail)" }) -join '; '))"
|
||||
if ($CheckOnly) {
|
||||
exit 1
|
||||
}
|
||||
|
||||
$startArgs = @{
|
||||
Workspace = $Workspace
|
||||
ApiPort = $ApiPort
|
||||
EnginePort = $EnginePort
|
||||
Python = $Python
|
||||
Cloudflared = $Cloudflared
|
||||
CloudflaredConfig = $CloudflaredConfig
|
||||
}
|
||||
if ($SkipCloudflaredRestart) {
|
||||
$startArgs["SkipCloudflaredRestart"] = $true
|
||||
}
|
||||
|
||||
try {
|
||||
& $startScript @startArgs 2>&1 | ForEach-Object {
|
||||
Write-WatchdogLog "$_"
|
||||
}
|
||||
} catch {
|
||||
Write-WatchdogLog "restart failed: $($_.Exception.Message)"
|
||||
throw
|
||||
}
|
||||
|
||||
$apiAfter = Test-JsonHealth `
|
||||
-Name "api" `
|
||||
-Uri "http://127.0.0.1:$ApiPort/health" `
|
||||
-IsHealthy { param($health) $health.environment -eq "prod" -and $health.db -and $health.engine } `
|
||||
-TimeoutSec 20
|
||||
if (!$apiAfter.Ok) {
|
||||
throw "Public API still unhealthy after restart: $($apiAfter.Detail)"
|
||||
}
|
||||
|
||||
if (!$SkipPublicHealth) {
|
||||
$publicAfter = Test-JsonHealth `
|
||||
-Name "public-api" `
|
||||
-Uri $PublicHealthUrl `
|
||||
-IsHealthy { param($health) $health.environment -eq "prod" -and $health.db -and $health.engine } `
|
||||
-TimeoutSec 20
|
||||
if (!$publicAfter.Ok) {
|
||||
throw "Public API tunnel still unhealthy after restart: $($publicAfter.Detail)"
|
||||
}
|
||||
}
|
||||
|
||||
Write-WatchdogLog "restart verified"
|
||||
Loading…
Add table
Add a link
Reference in a new issue