[feat] 카드 카탈로그 DB 정본화 — config 결합 제거 + 학습 보존 자동반영

카드 카탈로그(negodata)가 Q-table action space 를 정의하는 정본이 되고, 카드 변경이
config 수정·학습 손실 없이 agent 에 자동 반영되는 고리를 완성.

- action space 정리: 카탈로그 전체(NGC-001~011, 11장) 고정, 견적별 선택은 축소가 아니라
  available_mask(_selection_mask) 로 처리 — action_id↔카드 대응을 견적마다 일정하게 유지해
  Q-table 학습 일관성 보장. 구 인덱스 방식(selected[action_id]) 폐기.
- ① 카탈로그 DB 정본화: action_mapping.type=db 면 registry 가 card.nego_cards(user_id NULL,
  number 순) 조회로 action_to_card 동적 구성(파일은 폴백). port/adapter(card_catalog_*).
  _base=type:db. → negodata 카드 추가/삭제 시 config 수정 불필요.
- ② 차원 변경 학습 보존 마이그레이션: migrate_active_version_dim — 겹치는 셀 복사
  (append/truncate 안전) + 새 카드 fresh. model_store.load 가 차원 불일치 시 호출.
- ③ reload 엔드포인트: /v1/catalog-refresh(테넌트) · /v1/catalog-refresh-all(전역, 화이트리스트).
- ④ 브랜드: company_profile_repo — 자동 온보딩 고객사(company_id UUID)는
  company.companies.name 으로 {company_name} 채움. 데모 테넌트는 파일 유지.
- 크로스서비스: negodata card_service 가 공용 nego 카드 변경 시 agent_notify 로 전역 리로드 알림
  (best-effort, is_test skip). config 에 agent_base_url.
- 하니스 episodes 400→600(action 11 수렴). 테스트 갱신·추가로 agent 98/98.

알려진 갭(후속): per-company 카탈로그 스코프(회사 카드도 action space 포함), 카탈로그 중간
삭제 시 카드번호 기반 마이그레이션.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
HyeongBaeYangandClaude Fable 5 committed 2026-07-08 14:56:28 +09:00
1 parent c2760c804f
commit 18020a9e07
25 files changed
+553 -62

No files matched your search

+10 -3
View File
@@ -49,9 +49,14 @@ policy:
epsilon: 1.0e-6
action_mapping:
type: file
# 기본 9카드 — 자동 온보딩(신규 company_id) 테넌트가 물려받는 카드 공간(base 정책 162×9와 정합).
# 테넌트는 자사 카탈로그(card.nego_cards/tenant_action_cards)로 override 한다.
# 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"
@@ -62,6 +67,8 @@ action_mapping:
"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 편집 정본)를
+3 -1
View File
@@ -23,7 +23,7 @@ reward:
action_mapping:
type: file
action_to_card: # 동일 차원(9) 유지 → warm-start 가능. 합성 데모 코드(테넌트 B).
action_to_card: # 동일 차원(11) 유지 → warm-start 가능. 합성 데모 코드(테넌트 B).
"0": "NGC-B001"
"1": "NGC-B002"
"2": "NGC-B003"
@@ -33,6 +33,8 @@ action_mapping:
"6": "NGC-B007"
"7": "NGC-B008"
"8": "NGC-B009"
"9": "NGC-B010"
"10": "NGC-B011"
llm:
enabled: false
+3 -1
View File
@@ -8,7 +8,7 @@ company_id: null # P3 시드 시 company.companies.company_id(uuid)
action_mapping:
type: file
action_to_card: # 우리 중립 데모 카드 코드(합성). 실제 카드 코드 아님.
action_to_card: # 우리 중립 데모 카드 코드(합성). 실제 카드 코드 아님. 카탈로그 11장(_base 와 정합).
"0": "NGC-A001"
"1": "NGC-A002"
"2": "NGC-A003"
@@ -18,6 +18,8 @@ action_mapping:
"6": "NGC-A007"
"7": "NGC-A008"
"8": "NGC-A009"
"9": "NGC-A010"
"10": "NGC-A011"
llm:
enabled: false # P7 에서 테넌트별 자격증명 주입