Skip to content

dev → main: ABM 영구저장 + PDF 빌더 정합성 + Emerging 재설계 + 팀 문서 (2026-05-11)#209

Merged
bat1120 merged 423 commits into
mainfrom
dev
May 11, 2026
Merged

dev → main: ABM 영구저장 + PDF 빌더 정합성 + Emerging 재설계 + 팀 문서 (2026-05-11)#209
bat1120 merged 423 commits into
mainfrom
dev

Conversation

@bat1120

@bat1120 bat1120 commented May 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • ABM: simulation_abm 테이블 신설 + 영구저장 (alembic aa13d6029c4f), n_personas/daily_visits_mean/hourly_visits 24h 응답, PDF only 결과 흐름
  • PDF builder: winner pred priority 전체 적용 (quarterly_projection/scenarios/closure_risk/closure_rate/customer_segment/living_pop_forecast/shap_result), 화면 데이터로만 빌드 (estimation 제거), SHAP ↑/↓ pct 표기, 자기잠식 단위 일관화 (AI ×100 정규화), 매출 예측 차트 막대→꺽은선, 16동 랭킹 Top 4, 법률 분야/상세/권고만
  • Legal: z-score 폐점률, 영업구역 박스 제거, 14 specialist 안정화
  • Emerging signal: layout 재구조 (16동 비교 + tier strip), sparkline 8분기, peer_distribution 16동, 사용자 친화 라벨/색
  • Market: 4 spot 합집합 수집, 풀 cap 1000, top5 빨간 삼각형 + 번호 overlay, 자사 매장 별표 18px
  • FTC: brand_mapping FTC indutyMlsfcNm fallback (14 → 16K)
  • 시뮬 폼: 예상 월매출 입력 제거, ABM 시뮬 기간 1/3/7일 선택
  • Toast: dedupeKey 로 재시도 연타 스택 누적 회귀 방지
  • Test 수정: simulationStore (combined error/AbortError/fake-progress timer), Radar (8 agents), EmergingSignalCard (라벨)
  • Docs: TEAM_A1/A2/B1/B2/D1/D2 + README link 재정비

534 files / +143,234 / −55,737

Test plan

  • cd frontend && npx vitest run — 18 파일 / 118 통과
  • cd backend && pytest tests/ — alembic head aa13d6029c4f 적용 후
  • ABM 시뮬 실행 → 저장 → 히스토리에서 PDF 다운로드
  • foresee/ai/abm 3종 PDF 빌드 — winner pred 일치 / 단위 일관 확인
  • Emerging 탭 — 8분기 sparkline + 16동 peer bar 노출
  • 시뮬 폼 — 예상 월매출 칸 미노출 확인

🤖 Generated with Claude Code

yezin013 and others added 30 commits May 3, 2026 18:26
증상:
- "에이전트 근거" 탭 상단 신뢰도 Overview 레이더가 8각형으로 표시
  (전 커밋에서 inflow 카드는 추가됐지만 레이더 축은 8개 그대로)
- 같은 섹션 헤더 "8 에이전트 신뢰도 Overview" 도 수동 텍스트로 8 고정

원인:
- AgentConfidenceRadar.tsx 의 AGENT_ORDER 배열이 8개 (inflow 누락)
  → buildRadarData 가 8개 row 만 생성 → PolarAngleAxis 8축
- InsightTab.tsx 헤더가 "8 에이전트" 정수 하드코딩

수정:
- AGENT_ORDER 에 { id: 'inflow', label: '접근성' } 8번째로 삽입 (총 9개)
- InsightTab.tsx 레이더 헤더 "8 → 9 에이전트 신뢰도 Overview"

검증:
- AgentId 타입에 'inflow' 이미 등록됨 (별도 수정 불필요)
- tsc 0 에러

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
feat: simulation_foresee/ai 분리 + 로딩 폴리싱 + UI 잡탕
…옵션 + Floating Widget

- brain.py: plan slot 에 hourly array 추가 — thought batch LLM 호출 폐기 (~30s 절감, plan↔thought 의미 일치)
- runner.py: ext_commuter/ext_visitor 도 Tier S LLM plan 생성 (이전 제외 분기 제거)
- runner.py: SimulationResult.tier_s_meta 추가 — Tier S 50명 name/age/role/home_dong/plan 응답
- runner.py: SimulationResult.new_store_role_dist 추가 — 신규 매장 단독 방문자 role 분포
- brain.py prompt: ext_commuter 출근 직후 카페·점심 visit 슬롯 강제. ext_visitor 저녁 visit 룰
- config.py: gpt-4.1-mini PRICING 추가 + log_llm_call helper (per-call 토큰/비용 콘솔 출력)
- abm_simulation_service.py + main.py: 응답 dict 에 new_store_role_dist + tier_s_meta 노출
- main.py: cache_key v6 → v7 (옛 캐시 무효화)
- AbmPersonaMap.tsx: 신규 매장 방문자 구성 카드 추가 + 마포 전체 분포 라벨 (참고) 분리
- AbmPersonaMap.tsx: thought feed 행에 agent name 표시 + 클릭 시 plan 펼침 카드 + 지도 focus halo
- AbmPersonaMap.tsx: 시나리오 옵션 — 흐림 날씨 + 공휴일 (어린이날) 추가
- AbmFloatingWidget.tsx + useAbmCompletionToast.ts (신규): 백그라운드 ABM 시뮬 진행 팝업 + 완료 토스트

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ycle-catchup

# Conflicts:
#	backend/src/agents/legal/specialists.py
dev merge 후 DashboardHub 가 HubCard 에 loading prop 전달하지만 BaseProps 미정의.
tsc 4 errors 해결.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…tchup

feat(abm): plan/thought 통합 + ext_commuter LLM plan + 신규 매장 분포 + Floating Widget
분기별 비틀림(perturb_and_predict list[float]) + 비교 UX(Master-Detail)
설계. 슬라이더 5개 재구성: rent_1f/floating_pop 제거, cpi_index/opr_sale_mt_avg
추가. 상관관계 정보카드+툴팁, X축 'N분기 후' 라벨링 결정.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Phase 1 백엔드 배치(perturb list[float], 슬라이더 재구성, 캐시 재생성),
Phase 2 API schema 확장+ETag 회귀, Phase 3-5 프론트 타입/훅/컴포넌트
(Master-Detail, 비틀림 차트, 상관 인사이트), Phase 6 통합 검증.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…sale_mt_avg 추가

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- compute_correlations Returns 예시를 신규 슬라이더 키로 교체
- test_slider_features_has_four_sliders에 trend_score 단일 매핑 단언 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- 반환 타입 float → list[float] (길이 4, Q1~Q4 순)
- 분기별 개별 inverse_transform + np.expm1 + 음수 클립
- docstring Returns 섹션 갱신
- test_perturb_and_predict_returns_list_of_4_quarters 신규 추가 (TDD)
- 전체 21/21 테스트 PASS

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ne_total 제거

이전 commit c7d323a에서 cache key를 'baseline' → 'baseline_sales'로 리네임했으나
backend/src/api/sensitivity.py:116이 entry['baseline']을 읽고 있어 API가 깨짐.
spec(2026-05-03)에는 cache key 변경이 명시되지 않았고 API 응답 필드명만 baseline_sales.
원래 키 'baseline'으로 되돌리고, 사용하지 않는 baseline_total 변수와 cache 필드도 제거.
v3 자기회귀 모델 학습/추론 호환을 위해 model.py 확장.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- train.py: window_size=4, output_size=1, dilations=[1,2] 자기회귀 학습
- predict.py: v3 가중치(finetune_tcn_v3.pt) 로드 + 자기회귀 inference

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- _predict_quarters() helper: DMS/자기회귀 자동 분기 (output_size>=4 vs <4)
- perturb_and_predict / perturb_quarter_and_predict: target_idx 파라미터 추가
- run_batch: v3 가중치 로드 (window 12→4, output 4→1, dilations [1,2])
- 캐시 schema 확장: baseline_per_store + store_count 추가
  (분모는 store_quarterly.store_count / seoul_district_stores.store_count)
- interface.py: _get_latest_store_count() 헬퍼 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
SensitivityResponse 확장:
- store_count: int | None (Optional, 기존 캐시 호환)
- baseline_per_store: list[float] | None (분기별 점포당 매출, 원)

프론트엔드(C1)는 점포당 단위로 baseline을 표시할 수 있게 됨.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- docs/superpowers/specs/*-handoff.md: 메신저 직접 전달용
- 루트 잡파일 (comparison/coverage/dong_codes/kakao_*/sq_review/tables/test*.txt 등)
- reports/, kill_port.ps1
- models/tcn_forecast/regen_*.py, weights/*.bak* (재생성 가능)
- models/emerging_district/weights.zip
- tools/sensitivity_preview.html, frontend/public/sensitivity_preview.html

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- v3 응답 신규 필드 노출 검증 (캐시에 baseline_per_store/store_count 있을 때)
- Optional 호환 검증 (기존 캐시 — 신규 필드 없을 때 None 반환)

26/26 PASS

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CustomerSegmentCard:
- DIMENSION_LABEL dict 추가 (50+ 키, 연령/성별/시간대/요일 raw → 한국어, _ratio suffix 양쪽 매칭)
- humanizeProfileSummary — backend 가 보내는 "20대+30대 time_06_11" raw 혼합 텍스트를 정규식 후처리 → "20대·30대 오전" 자연어
- 시간대는 "(6~11시)" 같은 시간 범위 빼고 단일 단어 (오전/점심/오후/저녁/야간/심야)

PeakHourCard:
- 헤더의 "living_pop_forecast · TCN" 모델 라벨 제거
- Disclaimer 의 "TCN 모델" jargon 제거

EmergingSignalCard:
- 모델명/jargon 통째 제거 — "emerging_district · LSTM AE" / "Anomaly Score (threshold p95 = 0.041 기준 정규화)" / "LSTM Autoencoder 비지도 학습" / "Mock" 영문
- humanizeSignalText — backend predict_fallback.py 의 raw 텍스트("11440660 CS100010: 서울시 공식 stage=LL → normal") 를 한국어 동/업종 + stage 코드 제거 + signal 결과 통째 제거 (신호등 박스에 이미 표시, 중복 회피)
- 신호등 박스 3개 모두 bg-secondary border 쿨그레이 통일 — 색 차이는 아이콘/라벨 텍스트 색만
- "정상" → "정상 상권" + ShieldCheck 아이콘
- 색 재매핑: 정상 상권=Teal Green(success), 신흥 상권=Deep Blue(primary), 쇠퇴 상권=Vivid Red(danger 유지)
- 게이지 라벨 "Anomaly Score" → "이상도", 3자리 → 2자리 소수, 축 라벨 "0.00 / 0.50 / 1.00" → "0 / 0.5 / 1"
- AlertCircle Mock 배지 → "데이터 신뢰도 검증 중" 한국어
- "signal" 영문 → "상권 신호" 한국어
- Disclaimer 사용자 친화 톤 — "분기별 상권 데이터 비교를 통한 상권 변화 조기 감지. 0.5 이상이면 평소와 다른 변화 신호"

PredictEmergingDistrictTab:
- PlaceholderPanel 의 modelName "emerging_district (LSTM Autoencoder)" 제거 + description 의 raw key("DistrictPredictionResult.emerging_signal 구현 후 활성화") → 사용자 친화
- p.district 가 raw code 로 올 가능성 대비 resolveDongName 휴머나이즈

constants:
- mapoDongs.ts: resolveDongName(code) 역방향 helper 추가
- bizToIndustry.ts: INDUSTRY_TO_BIZ_KO reverse map + resolveIndustryNameKo(code) 추가, 영문 키(restaurant/cafe) skip 후 한국어 첫 매칭만 등록
sim_debug/final/result/test/test2/verify/verify2/verify3.json 삭제
개발 중 테스트 산출물로 서비스 불필요

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- types/elasticity v3 schema (list[float] 4분기 + baseline_per_store/store_count)
- scenario/ 디렉토리 신설 (8개 컴포넌트 + baseline.ts 헬퍼)
  - AddCandidateModal (createPortal + focus trap + 16동×업종 자유 비교)
  - ScenarioCandidateList/Card (좌 280px + lg 미만 horizontal carousel, max 5 + toast)
  - ScenarioForecastChart (4분기 곡선 + 7-tier DELTA + Q1~Q4 categorical)
  - ScenarioDetailPanel + KpiHero + 합산 안내 + CorrelationInsightCard (|r|≥0.5)
  - PctElasticitySlider (4분기 spread mini-sparkline)
- hooks: useScenarioCandidates (sessionStorage persist), useElasticityComparison (Promise.allSettled)
- PredictScenarioSimTab Master-Detail 재구성 + toast lastErrorRef dedupe
- legacy ElasticitySlider/useElasticity/Deprecated alias 삭제 (IM3-144 회귀 슬릿 차단)
- 색상 SoT: DELTA/QUARTER 를 palette-catalog 12색 (chart-2/3 + muted-foreground opacity 변조)
- palette-catalog 문서 hex 표기 정합 (Console Pink/Danger Coral 등)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- HQCommandCenter 985줄 재구조 (조종석 레이아웃)
- HubCard / DashboardHub / App.tsx 라우팅 정합
- AbmPersonaMap / AgentMapVisualizer / VacancySpotMarker 색상 SoT 적용
- AnalyzeMarketTab / MarketTab tab 헤더 hierarchy 통일
- index.css 토큰 hex 정합

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
yezin013 and others added 29 commits May 6, 2026 17:29
feat(market): 4 spot 기준 경쟁점 표시 통일 + 시뮬 결정성 + AI 요약 레이아웃
toastStore.push 가 dedupeKey 있을 때 같은 key 의 기존 토스트 제거 후 새 토스트 추가 (replace + duration 재시작). 사용자가 같은 시뮬을 빠르게 재시도하면 success/error 토스트가 5+ 누적되던 문제 차단.

key 부여:
- simulation-success / simulation-error (useCompletionToast)
- abm-success / abm-error (useAbmCompletionToast)
- scenario-sim-error (PredictScenarioSimTab — 일시 오류 / 데이터 로드 실패 두 케이스 같은 key)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
증상: 새 시뮬 4동 선택 후 시나리오 페이지 진입 → 드롭다운 첫 열기에 5개 동 노출 → 동 변경 후 다시 열면 4개 정상.

근원: useScenarioCandidates 의 sessionStorage persist 가 시뮬 간 잔존. 이전 시뮬에서 동 X 로 변경한 후보가 새 시뮬 [E,F,G,H] 진입 시 candidate.dong=X 로 복원 → ScenarioDetailPanel 의 fallback 옵션이 X 를 5번째로 노출.

Fix 2단:
1. PredictScenarioSimTab effect — active candidate dongCode 가 availableDongs 에 없으면 첫 동으로 자동 update (root 차단)
2. ScenarioDetailPanel — fallback 옵션 제거. dongOptions = 항상 availableDongs 4개

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
배경:
  상권분석 탭 IndustryClosureTrendCard ("동 업종 폐업률 추세 8분기")
  vs 재무시뮬 탭 ClosureRatePanel ("과거 폐업률 4분기 평균")
  두 카드가 라벨이 모호해 같은 데이터로 오인될 위험. 단위·기간·필터링 모두 다름:
    · A (Market): store_quarterly DB · 동+업종 필터 · 분기별 8개
    · B (Financial): closure_rate.monthly_closure_rates · 동 전체 통합 · 4분기

Option 1 라벨 강화:
  · IndustryClosureTrendCard
    - title prefix: "{dong} · {industry} 폐업률 추세"
    - 부제: "8 분기 실측"
    - 출처 footnote: "store_quarterly DB (분기별, 업종별 필터)"
  · ClosureRatePanel
    - title: "{district} 동 전체 폐업률 (4분기)"
    - 출처 footnote: "동 전체 4분기 실측, 업종별 8분기와 다를 수 있음"

Option 4 ℹ️ 툴팁:
  · 양쪽 카드 헤더에 lucide Info 아이콘 + group-hover absolute tooltip
  · 호버 시 다른 패널과의 차이 안내 (단위/기간/필터링 다름)
  · z-20 + backdrop blur + 256px width

호출처 (MarketTab):
  · analysisDong (spot 1위 동 우선) + simResult.business_type 전달
  · ci.meta 가 frontend type 정의에 없어 SimulationOutput cast 로 business_type 추출

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
지도/대시보드:
- 경쟁점 = 공실 spot 1.5km + 행정동 매장 합집합 (kakao_id dedup)
- MAPO_ADSTRD_TO_KAKAO_DONG_NAMES 매핑 (kakao 행정/법정동 혼합 보정)
- spot bbox 인접 동 침범 매장 후처리 컷 (선택 4동 + 매핑 법정동만 통과)
- choropleth = winner(1위) 만 색칠, 나머지 회색
- IndicatorGrid: 생존률/폐업률 삭제 (8 → 6 핵심 지표)
- DistrictRankings: 폐업위험/BEP 컬럼 삭제

ABM:
- persona_pool 모듈 신설
- agents/personas/runner refactor

기타:
- legal/brand resolver/legal categories 보강
- refresh_kakao_missing_brands ingest 스크립트
- 2026-05-05/06 회고
- spotter ABM/status presentation pptx

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ip-20260506

chore: 대시보드/지도 UI 정비 + ABM persona pool + 회고/프레젠테이션
emerging_district/predict 가 매 호출마다 build_timeseries 재실행 (3.8s) →
load_emerging_data 가 closure_risk/TCN/SHAP 와 동일한 load_timeseries(TTL=300s)
사용하도록 변경. main.py 에 마포구 timeseries 사전 워밍 startup 핸들러 추가.

실측 (캐시 워밍 후, 4동 한식, /predict warm):
- emerging_ae 단독:    3.86s → 0.17s (-95.6%)
- generate() 한 동:    8.11s → 1.12s (-86.2%)
- /predict 4동 응답:   ~8s → 1.73s (-78.7%)

bench 스크립트 4개 동봉 (per_component / emerging_breakdown / parallel_generate
/ predict_endpoint) — before/after 재현 + 포트폴리오 트러블슈팅 자료.

회귀: pytest tests/test_sensitivity.py 26/26 PASS

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
세션 누적 staged WIP 정리 — 다음 영역의 누적 변경을 한 번에 보관:

- frontend: BEP 누적이익/예측 시뮬 탭/세그먼트 카드/PDF/스위처 등 표시 정비
- backend: customer_segment API, multi_query, evaluation 3종, schemas/services 잡 정비
- models/customer_revenue/predict.py: MLP 추론 경로 정비
- scripts/scan_option_b_cases.py: option B 케이스 스캐너 (untracked)

기능 단위 개별 커밋이 필요하면 추후 cherry-pick 으로 분할.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
v6 LLM-as-judge 의 거짓 양성 (market_analyst MAPE 0.1% 등) 발견 후
텍스트 분석에 따라 에이전트 유형별 측정 가능한 평가 방식으로 재설계.

평가 방식 변경 (v6 → v7):
  - market_analyst:    LLM-judge → grade 분류 정확도 (룰엔진 임계값)
  - demographic_depth: judge → 연령 직접 일치 (top_3_age_groups 1위)
  - synthesis:         judge → 정량 정합성 룰 (legal 보존·net_profit·grade-추천 모순·winner)
  - trend_forecaster:  6m future → QoQ 방향 일치
  - population:        judge 가중 → 연령·성별·피크 직접 일치
  - competitor_intel:  현행 (signal 룰엔진)
  - legal:             제외 — 별도 RAG benchmark

캐시 schema 보강 (raw 데이터 함께 저장):
  - population_node:    raw_metrics(age/gender/time distribution) — prefix v1→v2
  - market_analyst_node: raw_inputs(qoq/saturation/competitor_count) — prefix v1→v2
  - trend_forecaster:   기존 dong_trend.slope_pct 활용 (loader fix)

산출:
  - backend/scripts/eval/seed_eval_cache.py — 자동 batch 시뮬 (8 케이스)
  - backend/scripts/eval/run_all_agents_v7.py — 통합 실행 + v6/v7 비교 리포트
  - docs/team/agent-accuracy-v6-vs-v7.md — 발표용 평가 문서

최종 결과 (n=8~11): 6 에이전트 평균 87.55%
  - market_analyst 50%→87.5% (+37.5%p)
  - demographic_depth 83%→100% (+16.7%p)
  - trend_forecaster 67%→82% (+15.1%p)
  - synthesis 100%→97.7% (n 증가 안정화)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- App.tsx: 시뮬 입력 폼에 자사 브랜드 dropdown 추가 (동업종 다brand corp 케이스 — 더본 한식 등). availableBrands.length > 1 일 때만 노출, frcsCnt 정렬
- main.py: brand resolver 에 사용자 명시 선택 보존 로직 — input.brand_name 이 corp 의 해당 업종 후보 (top + alternatives) 안에 있으면 override 안 함
- HQCommandCenter.tsx: 자사 브랜드 프로필 탭에 framer-motion coverflow carousel — corp 운영 brand 전체 표시, 좌우 드래그 슬라이드
- GlobalNav / HQCommandCenter 헤더: brand_name → company_name 우선 표시
- DashboardHub.tsx: ABM 카드 게이팅 복구 (analyzeStatus !== 'done' 일 때 disabled, 회귀 fix)
- 3 dropdown (업종/dong/brand) 상호 배타 — 시각 overlap 차단
- legal/retriever/__init__/specialists 등 누적 변경분 통합
- docs/retrospective 2026-05-06/07 + ABM midterm pptx + run_server 스크립트 포함

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
# Conflicts:
#	backend/src/evaluation/demographic_depth_eval.py
#	backend/src/evaluation/population_eval.py
IM3-263: feat(evaluation): 7 LLM 에이전트 정확도 v7 재설계 + 캐시 schema 보강
backend/src/main.py (_collect_same_brand_locations):
- 옵션 A 카테고리 매칭 룰 완화 — kakao_store.category="기타" (분류 누락) 매장 통과
- 한신포차 같이 brand 매칭은 정확하지만 카테고리 미지정 케이스 해결
- misalign 차단(메가커피 vs 치킨 시뮬) 의도는 유지

frontend MarketMap.tsx:
- 별표 마커 크기 통일 18×18px (font 10) — 이전 디버그 확대(36px) 정리
- Layer 2 (competitors 자사 매칭) + Layer 3 (sameBrandLocations) 동일 사이즈

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
fix(map): 자사 매장 별표 표시 fix — '기타' 카테고리 통과 + 크기 축소
- interface.py: emerging_signal dict 에 quarter_history/peer_distribution
  2 필드 추가 — frontend 차트 placeholder 원인 해결 (AE 모델은 정상 산출,
  조립 단계에서 누락됐던 필드)
- EmergingFourDongTrendChart: "Q-7"~"Q-1" → "7분기 전"~"1분기 전",
  "16동 P25/50/75/90" → "하위 25% / 마포구 평균 / 상위 25% / 상위 10%"
- PredictEmergingDistrictTab: "4 동 변화도 시계열 (최근 8 분기)" →
  "동별 상권 변화도 추이" + 부제 "최근 2년 분기별 · 마포구 평균선 비교"
- EmergingSignalCard: sparkline 색을 트렌드(빨강/초록) → 동별 색
  (winner→4위 SERIES_COLORS) 로 변경, 라벨 "최근 8 분기 변화도" → "최근 2년 변화도"
- Sparkline: color?: string prop 추가 (미지정 시 기존 trend 색 fallback)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- /simulator: "타겟 고객" SectionLabel 아래에 ※ 안내 한 줄 — 연령/성별/시간대/요일
  선택 시 결과 화면에서 「타겟 고객 매출 기여 (예측)」 확인 가능함을 사전 고지
- /dashboard/predict?sub=customer_flow: anySegment 미수신 시 dashed border +
  muted 톤 안내 카드로 fallback — 기존엔 영역 자체가 사라져 사용자 혼란 발생

문구는 현재 페이지 톤 (text-[0.6875rem] muted-foreground) 에 맞춤.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- legal.py: FTC 폐점률 판정을 hardcode 10% → 업종 평균 z-score (mean+std baseline 캐시).
  외식업 평균 25-37% 인데 10% 임계로 거의 모든 brand 가 자동 danger 오판정되던 회귀.
  한신포차 12.9% (한식 평균 26.7%, z=-0.19) → safe.
- runner.py: trajectory_path 가드가 visits_log 채움까지 막아 peak_hours 항상 빈 list.
  trajectory_path 인자 미입력 시 frontend UI '—' 표시되던 회귀 fix.
- main.py /corp/operated-industries: user_id query param 폴백 추가. JWT interceptor
  실패 시 frontend 가 user.id 직접 전달 → biz_number 정상 resolve.
- App.tsx: 결과 → 뒤로가기 시 시뮬 폼 업종 안 막히던 race fix —
  sessionStorage 캐시 + lazy useState init + 빈 응답이 cache 덮어쓰지 않도록 가드 +
  brand.industry_medium fallback. 자사 brand dropdown 추가 + 동업종 다brand 보존.
- client.ts: getOperatedIndustries(userId) 시그니처 + 진단 console 로그.
- scripts/sync_kakao_category_with_ftc.py: kakao_store.category 를 FTC indutyMlsfcNm
  기준으로 일괄 보정. alias 확장 (3자 미만은 정확 매칭). dry-run + --commit 모드.
- docs/retrospective 2026-05-07 + ABM midterm pptx 빌드 스크립트 갱신.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
프론트 dropdown 값 (호프/카페/음식점/제과점/베이커리) 과 FTC 등록 표기
(주점/커피/한식/제과제빵) 불일치로 INDUSTRY_NOT_OPERATED 400 회귀.
_INDUSTRY_FTC_ALIAS dict 추가 + resolve_brand_for_industry 진입 시 정규화.

증상: 더본코리아 user가 "호프" 선택 → "주점" 매칭 못함 → 400
근본: 프론트 표기와 FTC indutyMlsfcNm 다름

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- README: 7건 정밀 수정 (코드 audit 기반)
  · ABM Tier LLM 모델 — Haiku/Flash-Lite → gpt-4.1-mini 통일 (main.py:2686 provider override 명시)
  · Cache 키 표 8 노드 — 실제 v{N}: prefix + 필드 (territory/spot/coord/store_area 등) + 파일:라인
  · ML 모델 표 — living_pop_forecast 행 추가 (predict_naive 24h × 분기 peak)
  · 환경변수 — EMBEDDING_MODE dead config / RATE_LIMIT_MAX·LOG_LEVEL main.py 직접 / CHROMA_* legacy 명시
  · Routes 12 → 17, FK 32 → 30, sub-routers main.py 38 → 40 / foresee 5 → 4
  · 법률 카테고리 — 코드 정의 13 vs 활성 8 (운영 5 비활성) 명확화

- orchestrator.py docstring — '9 룰 + 4 specialist → 13 dict' 오기재 → '5 입지 룰 + 3 specialist → 8 dict (운영 5 비활성)'
- corp_brand_resolver / vector_db / retriever / main / 그 외 누적 변경분 통합
- 자사 brand dropdown + ABM peak_hours fix + Legal z-score 폐점률 + customer-flow 가드 등 frontend 정합
- shock_scenarios 분석 스크립트 + 결과 JSON + 회고 문서 추가

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- 트랙 6명 담당 영역 표 + 별도 docs/team/TEAM_*.md 링크
- 5-Phase LangGraph 워크플로우 다이어그램
- 성과 지표 (AI 정확도 v6→v7, ML AUC, RAG MRR, 시스템 성능) 요약
- 빠른 시작·환경 변수·Database 스키마 카테고리 압축
- 865 → 292 줄 (다이어트)

NOTE: docs/team/TEAM_{B1,A1,A2,B2,C1,C2}_*.md 6개 참조 링크는 아직 작성 미완 — 문서 작성 후 자동 활성

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
README 의 docs/team/TEAM_*.md broken link 6개 해소 — 각 팀원이 작성한
상세 기술 문서 commit.

- TEAM_B1_예진_LangGraph.md       (36KB) — 5-Phase 워크플로우, 10 노드, AgentState 82 필드 등
- TEAM_A1_찬영_데이터.md          (17KB) — DB 78 ORM, ETL 5종, ABM 5,000 agents
- TEAM_B2_수지니_ML.md            (16KB) — TCN/LightGBM Ensemble, SHAP, Feature Engineering
- TEAM_C1_강민_프론트.md          (8KB)  — 12 Routes, 3-Pipeline, Recharts 20+
- TEAM_C2_혁_인프라.md            (5KB)  — Docker Compose, AWS RDS, Nginx
- TEAM_A2_봉환_RAG.md             (5KB)  — Legal RAG, BGE-m3 + Kiwi BM25, RRF

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- fabricated 5/6-모델 benchmark 제거
  - LSTM/GRU/Transformer/ARIMA RMSE 비교 → v1/v2/v3 3-way TCN 비교
  - closure_risk 6-모델 비교 → LGBM+TCN 단일 앙상블 (test AUC 0.6152)
- 실측 코드 대조 후 9개 ML 기능 정확히 문서화
  - TCN v3: window=4, n_channels=128, kernel=2, dilations=[1,2], output=1, 37f
  - 폐업위험도: AUC 비례 가중 (w_lgbm=0.4804, w_tcn=0.5196), q90/q70 자동 fit
  - SHAP: TreeExplainer(LGBM) + GradientExplainer(TCN), background randn, 23×2 한국어 템플릿
  - customer_revenue: 4-group softmax (16 outputs), 회귀 표기 수정
  - emerging_district: LSTM Autoencoder + 4-tier fallback + 4-class classifier (acc 0.8903)
- 누락분 추가
  - 시나리오 시뮬레이터 (5 슬라이더 ±30% × 156 조합 캐시)
  - 유동인구 naive lag-1 (MAE 665, MAPE 2.62%, R² 0.9964 — TCN 6변종 폐기)
  - closure_rate 개체 vs 집단 분리
  - interface.py 통합 dispatcher + bench/test 인프라
backend
- simulation_abm 테이블 + alembic aa13d6029c4f migration
- /history/abm CRUD (api + service)
- runner.py hourly_visits[24] 응답 추가, cache key v8 bump
- biz_mapper NTS API 실패 graceful fallback (검증 skip)
- chains/retriever sync engine + asyncio.to_thread (ProactorEventLoop 차단)
- persona_pool uuid_by_idx dict 캐시 (5K spawn 30-120s → 2.4s)

frontend
- HiddenPDFTemplate mode-aware (foresee/ai/abm + legacy)
- pdfPropsBuilder winner pred 우선 매핑 (qp/scenarios/closure/customer/living/shap)
- cannibalization 단위 percent 통일 (AI fraction → ×100)
- AI 동 랭킹 표 화면 동일 5컬럼 (BEP/차별화/코멘트 제거)
- 매출 예측 차트 막대 → LineChart + Q1~Q4 라벨
- Executive Summary 페이지 (foresee/ai/abm)
- ABM 시나리오 패널 시뮬 일수 1/3/7 가변
- ABM 새 spot 클릭 시 savedAbmId 초기화
- useSimulationDetail abm fetch 시 heavy keys strip (density/trajectory)
- useSimulationHistory ABM 통합 (3 endpoint allSettled merge)
- 시뮬 입력 폼 예상 월매출 input 제거

docs
- ml-models/ 폴더 통합 (timeseries/evaluation/imputation/competition)
- retrospective 2026-05-08, 2026-05-09 + project-review
- presentation Q&A prep + script

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- simulationStore: 양쪽 API 실패 시 error 메시지 결합, AbortError(양쪽) → idle 복귀, fake-progress timer(1%/s, cap 90) 복원 — real-progress 가 더 높을 때만 덮어쓰기
- AgentConfidenceRadar: AGENT_ORDER 에서 'synthesis' 제거 (8 에이전트 기준)
- EmergingSignalCard: sparkline 라벨 '최근 2년 변화도' → '최근 8 분기 변화도'

전체 18 파일 / 118 테스트 통과.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bat1120 bat1120 merged commit 82f104e into main May 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants