Skip to content

fix(ai-server): BUG-069~085 F1 자율대화 반복/안전-신뢰성 결함 수정 계열 - #80

Merged
dhkim-kr merged 3 commits into
Masterfrom
fix/ai-server-f1-autonomous-dialogue
Jul 25, 2026
Merged

dhkim-kr merged 3 commits into
Masterfrom
fix/ai-server-f1-autonomous-dialogue

Conversation

@dhkim-kr

@dhkim-kr dhkim-kr commented Jul 25, 2026

Copy link
Copy Markdown
Member

개요

F1 자율대화 반복 및 안전-신뢰성 결함(BUG-069085) 수정 계열. dialogue v5.1v5.6, handoff_generator
v4.1v4.5, clinical_slot v3v5, evidence_verifier 등 프롬프트 웨이브와 대응 회귀 테스트를 포함한다.
레거시 병원맵/RAG 관련 모듈(hira/kakao 어댑터, nearby_facilities, rag_chat, safety_matrix 등)은
apps/api 병원맵 라우트로 이관되며 함께 제거된다.

주의: apps/ai-server/src/services/f5_* 등 handoff/F5 관련 파일 다수가 기존 open draft PR #76
(review/f5-handoff-remediation)과 경로가 겹칠 수 있다 — 머지 전 확인 필요.

관심사별 변경

  • dialogue v5.1v5.6: 자기지시적 안도 금지, recap 귀속 rightmost-match, 종료멘트 1단계 (BUG-072085)
  • handoff_generator v4.1~v4.5: 부인 형식 보존, cite-or-"기록없음" 규율, placeholder/footer leak 제거 (BUG-069/070/071)
  • evidence_verifier: metadata-coherence/first-visit-trend/placeholder 체크 (BUG-069)
  • clinical_slot v3~v5, safety_classifier v2, sentiment_analyzer v2, domain_inference v2
  • BUG-067 role='ai' seam-map, BUG-068 handoff timeout 45→90s
  • 레거시 제거(201개): hira/kakao 어댑터, nearby_facilities, rag_chat, safety_matrix, continuous_test,
    구 시뮬레이션 하네스/오디오·OCR 픽스처, 구 test_* 스위트(신규 회귀 테스트로 대체)
  • 신규 회귀 테스트 25건 + deploy invariants/contracts/boot 3건 + 루트 EXP-030 오프라인 스모크

File changes (요약)

영역 파일 수 변경 요지 관련 doc ID
prompts/dialogue, handoff_generator, clinical_slot, evidence_verifier 등 (신규 버전) 25 프롬프트 웨이브 BUG-069~085
src/agents, src/routes (레거시 제거 + phr_ingest/safety_probe/temporal_compare 신규) ~40 병원맵 이관, 신규 유틸 BUG-067/068
tests/ (레거시 201개 삭제 + 신규 25건) ~226 회귀 스위트 재편 BUG-069~085
tests/test_denial_patient.py (루트, 신규) 1 EXP-030/CVR-046 오프라인 스모크 CVR-046

검증

항목 근거
오프라인 스위트 318 passed (integration_status_report.md)
라이브 qa 게이트 green
CVR-054 conditional-yes (735021f 커밋 로그)
REV-020 0-blocking

의존/머지 순서

contracts(#77) → ai-server(본 PR) → mobile/web (backend-api와 병행 가능). 머지 전 #76과의
apps/ai-server 경로 중복을 조율할 것.


스택 노트 (2026-07-25): 이 PR의 base는 feat/contracts-integration-alignment(#77)로 임시 전환되었습니다 — #77의 contracts 변경에 대한 머지-순서 의존 때문입니다. #77이 Master에 머지되면 GitHub이 이 PR을 자동으로 Master로 retarget합니다. (rebase 예정: 이 브랜치를 #77 위로 재배치)

dhkim-kr added 3 commits July 25, 2026 23:34
dialogue v5.1~v5.6(자기지시적 안도 금지, recap 귀속 rightmost-match,
종료멘트 1~2단계), handoff_generator v4.1~v4.5(부인 형식 보존,
cite-or-"기록없음" 규율, placeholder/footer leak 제거), clinical_slot
v3~v5, evidence_verifier(metadata-coherence/first-visit-trend/
placeholder 체크), safety_classifier v2, sentiment_analyzer v2,
domain_inference v2, orchestrator/input_normalizer/ocr/stt 신규
프롬프트. BUG-067 role='ai' seam-map, BUG-068 handoff timeout 45->90s.
레거시 hira/kakao 어댑터·nearby_facilities·rag_chat·safety_matrix·
continuous_test 등 201개 파일 제거(연동 이후 apps/api 소유로 이관/폐기).
BUG-069~085 각 결함별 회귀 테스트, deploy_boot/deploy_contracts/
deploy_invariants(ADR-040/041), dialogue self-referential relief,
load_simulations scale map. 루트 tests/test_denial_patient.py는
EXP-030/CVR-046 finding 5의 오프라인 스모크(harness.denial_patient,
표준 tests/ 위치, safety_classifier 키워드 비매칭 검증).
… set

Master #85 unified crisis hotlines to 109/119/112 (old 1577-0199 retired —
109 is the current national suicide-prevention integration number, so
exposing the old number is also a clinical accuracy issue). Update
TestCrisisHotlines to assert the canonical set instead of the retired
1577-0199, matching orchestrator.py's _CRISIS_MESSAGES (already Master-
aligned post-rebase). No production code change — test-only fix per
ADR-048/BUG-062 lineage.
@dhkim-kr
dhkim-kr changed the base branch from feat/contracts-integration-alignment to Master July 25, 2026 14:34
@dhkim-kr
dhkim-kr force-pushed the fix/ai-server-f1-autonomous-dialogue branch from 9f1b294 to 5da185a Compare July 25, 2026 14:34
@dhkim-kr
dhkim-kr merged commit f6d7946 into Master Jul 25, 2026
5 checks passed
dhkim-kr added a commit that referenced this pull request Jul 25, 2026
… BUG-065 comment-wording dup resolve

Master already carries the same BUG-065 fix (plain Boolean `is_minor`
column, no DB-side GENERATED expression) via #77-#80's rebase chain;
this branch's independent BUG-065 comment is functionally identical,
mechanical wording-only conflict — kept Master's canonical wording.
No schema/logic change.
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.

1 participant