초기 커밋 — 협상 AI 에이전트 정본: 엔진·데모 콘솔·측정 인프라·증빙

- server/: FastAPI 협상 엔진 (5라운드, Q-Table/UCB, 페르소나 계측, :53117)
- frontend/: 데모 콘솔 (React+Tailwind → nginx, /api 프록시)
- eval/·testdata/: 지표 8종 측정 하네스 + 재현 가능 테스트셋
- results/: 측정 증빙 (지표별 result+provenance, raw 원본 동결+SHA256)
  ① 86.0 · ② 76.0 · ③ 5.99% · ⑥ p95 3.61ms · ⑦ 611만/년 · ⑧ 91/100 · ⑨ 99.71 · ⑩ 97.99
- docker-compose.yml + run.sh: backend+frontend 일괄 기동

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0112XUWF4bc3gGrEt8vsYCzy
This commit is contained in:
민헌andClaude Fable 5 committed 2026-08-31 13:09:52 +09:00
commit dfb9ad6e66
268 files changed
+164241

No files matched your search

+72
View File
@@ -0,0 +1,72 @@
import type { DemoCase } from '../content/cases'
/**
* 가격 트랙 — 이 페이지의 시그니처.
* 앵커가·목표가·기존 공급가를 한 수평 트랙에 놓고, 제안가가 내려오는 과정을 마커로 보여준다.
* 파랑 구간(앵커 이하) = 구매측 최적 · 앰버 구간(목표가 초과) = 협상 여지.
*/
export function PriceTrack({ demoCase, priceTrail }: { demoCase: DemoCase; priceTrail: number[] }) {
const { anchor, target, item_price } = demoCase
const current = priceTrail.length ? priceTrail[priceTrail.length - 1] : null
// 트랙 범위: min(앵커, 최저 제안가) 아래 여유 3% ~ max(기존가, 최고 제안가) 위 여유 3%
// (제안가가 앵커보다 낮아도 마커가 트랙 밖으로 클리핑되지 않도록 동적 확장)
const hi = Math.max(item_price, ...(priceTrail.length ? priceTrail : [item_price])) * 1.03
const lo = Math.min(anchor, ...(priceTrail.length ? priceTrail : [anchor])) * 0.97
const pos = (v: number) => Math.min(Math.max(((v - lo) / (hi - lo)) * 100, 0), 100)
const Tick = ({ value, label, cls }: { value: number; label: string; cls: string }) => (
<div className="absolute top-0 h-full" style={{ left: `${pos(value)}%` }}>
<div className={`h-full w-px ${cls}`} />
<div className="absolute top-full mt-1 -translate-x-1/2 text-center">
<div className="text-[10px] leading-tight text-muted">{label}</div>
<div className="font-mono text-[11px] font-medium leading-tight">{value.toLocaleString()}</div>
</div>
</div>
)
return (
<div>
<div className="relative mb-9 mt-6 h-3 rounded-full bg-paper">
{/* 구간 채색: [lo~anchor]=파랑(최적) · [anchor~target]=연파랑(합의권) · [target~hi]=앰버(초과) */}
<div className="absolute inset-y-0 left-0 rounded-l-full bg-blue/70" style={{ width: `${pos(anchor)}%` }} />
<div
className="absolute inset-y-0 bg-blue-soft"
style={{ left: `${pos(anchor)}%`, width: `${pos(target) - pos(anchor)}%` }}
/>
<div
className="absolute inset-y-0 rounded-r-full bg-amber-soft"
style={{ left: `${pos(target)}%`, width: `${100 - pos(target)}%` }}
/>
<Tick value={anchor} label="앵커가" cls="bg-blue" />
<Tick value={target} label="목표가" cls="bg-ink/50" />
<Tick value={item_price} label="기존가" cls="bg-muted/60" />
{/* 과거 제안 흔적 */}
{priceTrail.slice(0, -1).map((p, i) => (
<div
key={i}
className="absolute top-1/2 size-1.5 -translate-x-1/2 -translate-y-1/2 rounded-full bg-ink/25"
style={{ left: `${pos(p)}%` }}
/>
))}
{/* 현재 제안가 마커 */}
{current != null && (
<div
className="track-marker absolute top-1/2 -translate-x-1/2 -translate-y-1/2"
style={{ left: `${pos(current)}%` }}
>
<div className="size-4 rounded-full border-[3px] border-ink bg-white shadow-sm" />
<div className="absolute bottom-full left-1/2 mb-1.5 -translate-x-1/2 whitespace-nowrap rounded bg-ink px-1.5 py-0.5 font-mono text-[11px] font-semibold text-white">
{current.toLocaleString()}
</div>
</div>
)}
</div>
{current == null && (
<p className="text-xs text-muted">첫 제안가를 입력하면 트랙 위에 표시됩니다.</p>
)}
</div>
)
}