o2o-negosium-original/agent/tenants/_base/tenant.yaml
hbyang 1682481b01 [feat] agent: 협상 고도화 — LLM 표현/이해층 + 카드 전술 실행계층 + ktcommerce 정리
카드 재설계("멘트 카드 → 전술 카드"):
- tactics.py 신설: 카드번호→전술(카운터 산식) 레지스트리, min(counter,target) 클램프
- 카운터 수락=즉시 타결(pending_counter_price 일반화, 구 offer_1pct 흡수)
- 목표가 초과 타결 금지(성공스텝 진입 가드) + "카드 소진=실패" 폐지→종결 국면
- 선택형 와일드카드(WC-*) 발동 + card.wild_cards 멘트 DB 어댑터

LLM 계층:
- Phase 2 표현층 ScriptNaturalizer(카드 멘트 자연화, 마커·치환자·숫자 보존 검증)
- Phase 3 이해층 InputInterpreter(자유발화 NLU→기대입력, 한국어 가격 파서)
- OPENAI_API_KEY env override(server_configs) + 전역 자격증명 게이트

결정 스택(Phase 1):
- 협상 규칙 데이터화(negotiation.wildcard_*_ratio/max_counter_rounds)
- 선택카드 우선순위 prior(UCB 방문수 감쇠, Q-table 오염 없음)

버그픽스:
- 인하율 음수 표기 제거 + 인상/동일/인하 구분(discount_phrase)
- 자연화 강조마커 보존(볼드/색 소실 시 원본 폴백)
- 카드 시드 가격변수(prev_partner_price·target_mid_price·middle_price 등) 치환

정리:
- ktcommerce 테넌트 삭제 + 테스트 21파일 imarketkorea/_base 로 마이그레이션
- 실 LLM 호출 차단 conftest 가드

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-10 13:37:36 +09:00

86 lines
3.1 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 공유 베이스 정책 (계획서 D). 신규 테넌트 cold-start 의 기준값.
# 모든 값은 우리 플랫폼의 중립 기본값이다(CLEANROOM.md). 특정 고객 운영값 복제 아님.
# 실제 운영값은 각 테넌트 YAML/DB 에서 주입한다. 차원 개수만 기능적 설계, 값/라벨은 우리 선택.
tenant_id: _base
inherits_base: false # 베이스는 자기 자신을 상속하지 않음
name: "Shared Base Policy"
state:
revenue:
thresholds: [10000000, 50000000] # 플랫폼 중립 기본 구간
weights: [0.3, 0.6, 1.0]
descriptions: ["low", "mid", "high"]
distribution:
code_map: {A: 0, B: 1, C: 2} # 중립 예시 코드(테넌트가 자사 코드로 오버라이드)
weights: [0.3, 0.6, 1.0]
descriptions: ["channel_a", "channel_b", "channel_c"]
partner:
weights: [0.5, 1.0, 0.3] # single, multiple, none
descriptions: ["single", "multiple", "none"]
acceptance:
thresholds: [0.03, 0.09]
weights: [0.3, 0.6, 1.0]
descriptions: ["low", "mid", "high"]
price_zone:
weights: [1.0, 0.5] # at_or_below_anchor(우선협상), above_anchor(협상지속)
descriptions: ["at_or_below_anchor", "above_anchor"]
# state_space_size 는 차원 곱으로 자동 산출: 3×3×3×3×2 = 162
reward:
beta: 0.2
success_reward: 1.0
ongoing_reward: 0.0
failure_penalty: -0.5
penalty_lambda: 0.02
w1: 0.2
w2: 0.2
w3: 0.2
w4: 0.2
w5: 0.2
min_weight: 0.2
max_weight: 0.8
policy:
type: ucb
learning_rate: 0.1 # 표준 기본값
gamma: 0.95
params:
exploration_constant: 1.4142135623730951 # sqrt(2) — 표준 UCB 상수
epsilon: 1.0e-6
action_mapping:
# db: action_to_card 를 card.nego_cards 카탈로그(user_id NULL, number 순)에서 동적 구성 — 정본.
# 카드가 negodata 에서 추가/삭제되면 action space 가 자동 반영된다(config 수정 불필요).
# 아래 action_to_card 는 DB 카탈로그가 비어있을 때만 쓰는 폴백(정합용 스냅샷)이다.
# file: 아래 action_to_card 를 그대로 사용(데모/오프라인).
type: db
# [폴백] 카탈로그 11장(카드_기획문서 일반카드) 스냅샷 — action_id 0~10 ↔ NGC-001~NGC-011.
# Q-table action 차원 = 카탈로그 크기. 견적별 선택은 action space 축소가 아니라 available_mask 로 처리
# (선택 카드만 pickable) — action_id↔카드 대응을 견적마다 일정하게 유지해 학습 일관성 보장.
action_to_card:
"0": "NGC-001"
"1": "NGC-002"
"2": "NGC-003"
"3": "NGC-004"
"4": "NGC-005"
"5": "NGC-006"
"6": "NGC-007"
"7": "NGC-008"
"8": "NGC-009"
"9": "NGC-010"
"10": "NGC-011"
cards:
# file: scripts_cards.json(파일) 사용. backoffice_db: card.nego_cards.script(negodata 편집 정본)를
# 카드코드(action_to_card)로 조회, 없으면 파일 폴백. 테넌트가 자사 카드를 편집하면 backoffice_db 로 전환.
source_type: file
sync_interval_seconds: 300
connection: {}
llm:
enabled: true
resources:
language: ko
scripts_dir: resources