대시보드 폴드아웃/드릴다운 정리 + 페르소나 역린·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:
Yun Chan 2026-06-27 02:30:46 +09:00
parent cb2aebd76c
commit 085460b5e0
327 changed files with 31226 additions and 1829 deletions

View file

@ -0,0 +1,48 @@
// 서연 래스터 아바타 렌더링 스크린샷 캡처(시각 튜닝용).
// 사용: node apps/web/scripts/avatar-shot.mjs
// URL 환경변수로 대상 변경 가능(기본 /dev/avatar-preview).
import { chromium } from "@playwright/test";
const BASE = process.env.BASE_URL || "http://localhost:5173";
const PATH = process.env.SHOT_PATH || "/dev/avatar-preview";
const OUT_DIR = process.env.OUT_DIR || "docs/avatar-art/seoyeon";
const browser = await chromium.launch();
const page = await browser.newPage({
viewport: { width: 1100, height: 1700 },
deviceScaleFactor: 2,
});
page.on("pageerror", (e) => console.error("pageerror:", e.message));
page.on("console", (m) => {
if (m.type() === "error") console.error("console:", m.text());
});
await page.goto(`${BASE}${PATH}`, { waitUntil: "domcontentloaded", timeout: 60000 });
// 이미지 로드 + 첫 호흡 사이클 대기
await page.waitForLoadState("networkidle", { timeout: 60000 }).catch(() => {});
await page.waitForTimeout(1800);
// 1) hero(대형 애니메이션 2종) 캡처
const hero = page.locator(".ap__hero").first();
if (await hero.count()) {
await hero.screenshot({ path: `${OUT_DIR}/render-hero.png` });
console.log("shot render-hero.png");
}
// 2) 표정 그리드(정적) 전체
const grid = page.locator(".ap__grid").first();
if (await grid.count()) {
await grid.screenshot({ path: `${OUT_DIR}/render-grid.png` });
console.log("shot render-grid.png");
}
// 3) 개별 hero 아바타(단일) 캡처 — 데이터 속성으로 단일 .vg-avatar 격리
const avatars = page.locator(".ap__hero .vg-avatar");
const n = await avatars.count();
for (let i = 0; i < n; i++) {
await avatars.nth(i).screenshot({ path: `${OUT_DIR}/render-hero-${i}.png` });
console.log(`shot render-hero-${i}.png`);
}
await browser.close();
console.log("done");

View file

@ -0,0 +1,148 @@
import { mkdir, rm, writeFile } from "node:fs/promises";
import path from "node:path";
import { pathToFileURL } from "node:url";
import { build } from "esbuild";
const appRoot = process.cwd();
const sourceEntry = path.join(appRoot, "src", "components", "avatar", "live2dModel.ts");
const tempDir = path.join(appRoot, "node_modules", ".tmp", "live2d-assets");
const bundledModule = path.join(tempDir, "live2dModel.bundle.mjs");
const publicRoot = path.join(appRoot, "public", "live2d", "personas");
function round(value) {
return Math.round(value * 1000) / 1000;
}
function json(value) {
return `${JSON.stringify(value, null, 2)}\n`;
}
function expressionToExp3(motion) {
return {
Type: "Live2D Expression",
Version: 3,
FadeInTime: round(motion.fadeInMs / 1000),
FadeOutTime: round(motion.fadeOutMs / 1000),
Parameters: motion.parameters.map((parameter) => ({
Id: parameter.id,
Value: round(parameter.value),
Blend: parameter.blend,
})),
Vignette: {
Label: motion.label,
Group: motion.group,
Duration: round(motion.durationMs / 1000),
},
};
}
function modelToModel3(model) {
const code = model.personaCode.toLowerCase();
return {
Version: 3,
Name: model.displayName,
Vignette: {
Schema: model.schemaVersion,
Renderer: model.renderer,
ModelId: model.modelId,
PersonaCode: model.personaCode,
DefaultExpression: model.defaultExpression,
Art: model.art,
Parameters: model.parameters,
GeneratedBy: "apps/web/scripts/generate-live2d-assets.mjs",
},
FileReferences: {
Expressions: model.expressions.map((motion) => ({
Name: motion.name,
File: motion.file,
})),
},
Groups: [
{
Target: "Parameter",
Name: "EyeBlink",
Ids: ["ParamEyeLOpen", "ParamEyeROpen"],
},
{
Target: "Parameter",
Name: "LipSync",
Ids: ["ParamMouthOpenY"],
},
],
HitAreas: model.hitAreas.map((area) => ({
Id: area.id,
Name: area.name,
})),
Model: {
Type: "VignetteSvgParameterRig",
File: `/live2d/personas/${code}/${code}.model3.json`,
},
};
}
await mkdir(tempDir, { recursive: true });
await build({
entryPoints: [sourceEntry],
outfile: bundledModule,
bundle: true,
platform: "node",
format: "esm",
logLevel: "silent",
});
const moduleUrl = `${pathToFileURL(bundledModule).href}?t=${Date.now()}`;
const { PERSONA_LIVE2D_MODELS } = await import(moduleUrl);
await rm(publicRoot, { recursive: true, force: true });
const index = {
schemaVersion: "vignette.live2d.assets.v1",
generatedAt: new Date(0).toISOString(),
personas: [],
};
for (const model of Object.values(PERSONA_LIVE2D_MODELS)) {
const code = model.personaCode.toLowerCase();
const modelDir = path.join(publicRoot, code);
const expressionsDir = path.join(modelDir, "expressions");
await mkdir(expressionsDir, { recursive: true });
await writeFile(path.join(modelDir, `${code}.model3.json`), json(modelToModel3(model)), "utf8");
await writeFile(
path.join(modelDir, "manifest.json"),
json({
schemaVersion: "vignette.live2d.persona.v1",
modelId: model.modelId,
personaCode: model.personaCode,
defaultExpression: model.defaultExpression,
model3: `${code}.model3.json`,
expressionCount: model.expressions.length,
expressions: model.expressions.map((motion) => ({
name: motion.name,
label: motion.label,
group: motion.group,
file: motion.file,
})),
}),
"utf8",
);
for (const motion of model.expressions) {
await writeFile(
path.join(modelDir, motion.file),
json(expressionToExp3(motion)),
"utf8",
);
}
index.personas.push({
code: model.personaCode,
modelId: model.modelId,
model3: `/live2d/personas/${code}/${code}.model3.json`,
expressionCount: model.expressions.length,
});
}
await writeFile(path.join(publicRoot, "index.json"), json(index), "utf8");
console.log(`Generated ${index.personas.length} persona Live2D asset sets in ${publicRoot}`);