fix(api): BUG-092 — clinician 대시보드 org-scope 시드 정합 + 응답 EmailStr 500 수정 - #99
Merged
Merged
Conversation
…l 스크립트 (ADR-049) - schemas/clinician.py: PatientListItem/PatientDetail email을 EmailStr->str. DB에 이미 저장된 email을 echo하는 응답측 재검증이 RFC 밖 주소(@demo, *.local, example.com 등 special-use 도메인)에서 목록/상세 전체 500을 유발 — DGX 라이브 발병 확인(2026-07-27). - scripts/seed_demo.py: 데모 환자를 clinician org로 배선. org-scope 필터 (ISS-022/PR #22) 하에서 NULL target_hospital_id 시드는 구조적 비가시. - scripts/backfill_bug092_target_hospital.py: 기존 NULL 행 backfill 도구 (idempotent, dry-run 지원). - services/clinician.py: 모듈 docstring을 org-scope 현행으로 정정(로직 무변경). - tests/repro/test_bug_092_org_scope_seed_mismatch.py: repro 3건 (로컬 PG 대상 3/3 passed).
dhkim-kr
force-pushed
the
fix/bug092-clinician-org-visibility
branch
from
July 27, 2026 06:30
2edddec to
759360c
Compare
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.
배경
PatientProfile.target_hospital_id == organization_id인 환자만 조회) 도입 후, 시드 환자가 전원target_hospital_id=NULL이라 대시보드가 구조적으로 비어 있던 결함의 후속 수정 세트.vp-*@sim.local·*@example.com등 special-use 도메인 이메일이 응답 스키마의EmailStr재검증에 걸려 GET /api/v1/clinician/patients 전체가 500 (pydantic ValidationError,services/clinician.py:124). 웹 대시보드는 '환자 목록을 불러오지 못했어요 (코드: INTERNAL_ERROR)' 상태.파일별 변경
apps/api/src/schemas/clinician.pyEmailStr→str(PatientListItem·PatientDetail)User.email을 echo하는 응답측 재검증 제거. 입력 검증(register)은EmailStr유지 — 보안 통제 변경 없음. 근거 주석 포함apps/api/scripts/seed_demo.py_make_persona에org_id전달,target_hospital_id배선apps/api/scripts/backfill_bug092_target_hospital.pyapps/api/src/services/clinician.pyapps/api/tests/repro/test_bug_092_org_scope_seed_mismatch.py검증
DATABASE_URL=<socket DSN> uv run pytest tests/repro/test_bug_092_org_scope_seed_mismatch.py→ 3/3 passed (PG 미가용 시 skip 설계)EmailStr제거가 직접 해소머지 후 필요한 후속 (다음 작업자)
cd ~/AI_Champion/neurosync && git pull && docker compose -f infra/deploy/docker-compose.dgx.yml build api && docker compose -f infra/deploy/docker-compose.dgx.yml up -d api→ 대시보드 500 해소 확인vp-*@sim.local,probe.*,*smoke*)이 의료진 대시보드에 노출됨 — 실환자만 보이게 할지 org 해제/필터링은 product 결정 대기Refs: BUG-092(error.md), ADR-049·ADR-051(discussion.md)