feat(api): F1~F3 연동 배선 + hospitals-map + DGX 배포 토폴로지 - #79
Merged
Merged
Conversation
This was referenced Jul 25, 2026
dhkim-kr
force-pushed
the
fix/backend-api-integration
branch
from
July 25, 2026 14:08
717d0e7 to
147ead9
Compare
dhkim-kr
changed the base branch from
Master
to
feat/contracts-integration-alignment
July 25, 2026 14:12
session_state DB 왕복(chat.py/sessions.py/session.py, ADR-046, PLAN-2026-W30-INTEG Phase 1), domain_routing panic->GAD7(Phase 2-1), survey plan/score 정본화(questionnaire.py, F3), safety/handoff SSOT 양방향 정렬(BUG-062~066/069/075/076/080/081), 병원맵 신규 라우트 (api/map.py, api/v1/facilities.py, services/facilities.py, services/map_page.py), DGX standalone compose(infra/deploy, ai-server 단독 24855) 반영. BUG repro 14건 + Phase1~3/CVR-051/hospitals-map 통합 테스트 동반.
…gration 0013 추가, ruff Master(c0622ce) 리베이스 중재: 병원찾기는 FR-049(ai-server 위임 nearby)가 canonical — FR-012(apps/api 직접 HIRA/facilities/map.py) 전량 제거. safety.py는 Master 핫라인 통일(109)과 BUG-062 CRISIS_CATEGORY_PRIORITY/to_safety_assessment를 함께 보존. 0001_initial_auth_schema.py: BUG-065 재발 — is_minor GENERATED 컬럼이 리베이스 후 되살아나 있어 재수정(plain Boolean, CURRENT_DATE 비-불변 표현식 제거). 0013 신규: fix/backend-api-integration이 Master 0011/0012 이전 지점에서 분기해 자체 마이그레이션 없이 병합됐던 세 항목(BUG-063 risk_events.status varchar(16)->32 + pending_reclassify CHECK, BUG-064 messages role CHECK에 'assistant' 추가, Phase 1 ADR-046 #2 sessions.session_state/clinical_escalation_required 컬럼)을 소스와 정합시키는 catch-up 마이그레이션. tests/test_integration_rev_coupling.py: ruff I001(fix)/E501×2 수정.
dhkim-kr
force-pushed
the
fix/backend-api-integration
branch
from
July 25, 2026 14:34
147ead9 to
2b24906
Compare
dhkim-kr
changed the base branch from
feat/contracts-integration-alignment
to
Master
July 25, 2026 14:34
This was referenced Jul 25, 2026
dhkim-kr
added a commit
that referenced
this pull request
Jul 25, 2026
…ion collision (#89) #78 (session_state_persistence/risk_events widen) and #85 (patient_demographics/ handoff_delivered_at) both merged into Master claiming revision IDs "0011" and "0012" independently. Alembic's ScriptDirectory silently overwrites same-ID entries in its revision map (last file loaded by directory-scan order wins, `util.warn` only) rather than erroring — the losing files (0011_patient_ demographics.py, 0012_handoff_delivered_at.py by observed load order) became permanently unreachable orphans, never applied by `alembic upgrade head` even though src/models/patient_profile.py and src/models/handoff.py already reference their columns. Renumbers #78's two files 0011->0013, 0012->0014 (chronologically merged after #85's 0011/0012 per `git show -s --format=%ci`), repoints down_revision accordingly, and retires 0013_f1f3_backend_integration_schema.py (#79's idempotent catch-up) as fully redundant now that 0013/0014 correctly chain. Verified via `alembic heads --verbose`/`alembic history` (ScriptDirectory, no DB connection): single head 0014, no "present more than once" warnings. Not pushed — local branch only, per repo git-ops-on-request convention.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
개요
apps/api BFF에 F1(session_state 왕복)~F3(survey plan/score) 연동을 배선하고, 병원맵(F-hospitals)
신규 라우트를 추가한다. safety/handoff SSOT 양방향 정렬, DGX standalone 배포 compose를 포함한다.
회귀 방지를 위한 repro/통합 테스트 스위트를 동반한다.
주의: infra/deploy/docker-compose.dgx.yml, .dockerignore는 기존 open PR #72
(deploy/backend-integration-surface)와 경로가 겹친다 — 머지 시 #72 정리 필요(아래 검증 참고).
관심사별 변경
081 14건) + Phase13/CVR-051/hospitals-map 통합 테스트File changes (요약)
검증
의존/머지 순서
contracts(#77) → db(#78) → backend-api(본 PR) → mobile/web. ai-server와 병행 가능하나 계약
변경(#77)이 선행되어야 함. 머지 전 #72와의 infra/deploy·.dockerignore 중복을 조율할 것.
Master(c0622ce) 리베이스 중재 (2026-07-25)
사용자 확정 결정: 병원찾기 canonical = FR-049(Master, ai-server 위임 nearby 경로).
본 PR의 FR-012(apps/api 직접 HIRA 프록시 + Kakao 지도 렌더)는 전량 폐기했다 —
services/facilities.py,services/map_page.py,api/map.py,api/v1/facilities.py,schemas/facilities.py및 관련 라우트 등록·테스트·.env.example의HIRA_SERVICE_KEY/KAKAO_MAP_JS_KEY/KAKAO_REST_API_KEY항목을 제거했다. Master의api/v1/nearby.py+services/ai_client.py::nearby_hospitals는 그대로 유지.충돌 표면별 중재:
.env.example,api/v1/__init__.pycore/config.pyservices/safety.pyCRISIS_CATEGORY_PRIORITY/to_safety_assessment(우리 쪽) 둘 다 보존services/ai_client.py,api/v1/sessions.pySurveyPlanRequest/TemporalSummarizeRequest,infer_instrument_with_caveat/_can_access_patient) 병합main.pymap_router등록 제거리베이스 과정에서 발견된 별도 결함도 함께 정리:
alembic/versions/0001_initial_auth_schema.py:is_minorGENERATED 컬럼(BUG-065)이리베이스 후 되살아나 있어 plain
Boolean으로 재수정.alembic/versions/0013_f1f3_backend_integration_schema.py신규: 본 브랜치가 Master의0011/0012 이전 지점에서 분기해 자체 마이그레이션 없이 병합됐던 BUG-063
(
risk_events.statusvarchar(16)→32 +pending_reclassifyCHECK), BUG-064(
messagesrole CHECK에'assistant'추가), Phase 1 ADR-046 feat(scaffold): Bootstrap monorepo (pnpm + uv) + 4 app skeletons #2(
sessions.session_state/clinical_escalation_required)을 소스와 정합.tests/test_integration_rev_coupling.py: ruff I001/E501×2 수정.검증: worktree 오프라인 스위트 173 passed / 60 skipped(BUG-058 Postgres 미연결, pre-existing)
/ 0 new failures, ruff 전체 통과(alembic 기존 7건 pre-existing 제외).
packages/shared-contracts의contracts.handoff는 #77(feat/contracts-integration-alignment, rebase 후)이 BUG-066report_markdown/evidence_packets shape를 이미 포함함을
git show로 확인(로컬 feat 브랜치6906b2c와 byte-diff 없음) — addendum 불필요.
CI 참고: 본 PR 단독 CI는 Master의
contracts.safety에SafetyAssessment가 아직 없어ImportError로 실패한다(#77의 pytest는 green) — 문서화된 머지 순서(contracts(#77) 선행)상예상된 실패이며 리베이스로 새로 만든 회귀가 아니다. #77 머지 후 재확인 필요.
스택 노트 (2026-07-25): 이 PR의 base는
feat/contracts-integration-alignment(#77)로 임시 전환되었습니다 — #77의 contracts 변경(SafetyAssessment 등)에 대한 머지-순서 의존 때문입니다. #77이 Master에 머지되면 GitHub이 이 PR을 자동으로Master로 retarget합니다.