# QA — MASLDPharmacoGeno

**Date**: 2026-05-01
**Project**: 2026-05-01-2-masld-pharmaco-geno

## 1. 구문 검사 (ast)

```
$ python3 -c "import ast; ast.parse(open('main.py').read()); print('OK ast.parse')"
OK ast.parse
```
PASS.

## 2. argparse / `--help`

```
$ python3 main.py --help
usage: masld-pharmaco-geno [-h] [--top TOP] [--korean-lean] [--write-outputs]
                           [--data-dir DATA_DIR]
...
```
PASS — argparse 정의 정상, 4개 옵션 모두 인식, exit code 0.

## 3. 데이터 파일 로드

6개 JSON 파일 (snps / drugs / outcomes / diets / ethnic / evidence) 모두 정상 로드.

```
data/diets.json     dict
data/drugs.json     dict
data/ethnic.json    dict
data/evidence.json  dict
data/outcomes.json  dict
data/snps.json      dict
OK json load
```
PASS.

## 4. 기본 실행 (`--top 50 --write-outputs`)

- return code: 0
- stdout: 557 lines
- outputs/ 작성 확인:
  - `outputs/top_hypothesis_cards.md`
  - `outputs/korean_lean_one_pager.md`
  - `outputs/aasld_abstract_draft.md`

PASS.

## 5. Korean lean focus mode (`--top 25 --korean-lean`)

- return code: 0
- stdout: 305 lines
- 필터링 확인: 모든 top cell이 East_Asian + Korean_LF_HC + canonical SNP(PNPLA3 / TM6SF2 / HSD17B13).
- focus boost +0.15 적용 확인 (top score ~1.084).

PASS.

## 6. 안전성 디스클레이머

- README.md: 명시적 디스클레이머 섹션 포함 (한글)
- main.py: `DISCLAIMER` 상수가 hypothesis card / 1-pager / abstract 모든 출력 상단에 출력됨
- 모든 evidence 수치가 SYNTHETIC임을 README와 출력 헤더에 명시

PASS.

## 7. 외부 네트워크 호출 부재 확인

```
$ grep -nE 'requests|httpx|urllib|http.client|socket\.' main.py
(no matches)
```
PASS — 표준 라이브러리만 사용.

## 8. 의도 부합 점검

| 명세 항목 | 구현 |
|---|---|
| SNP 5+ × 약물 8+ × outcome 5+ × 식이 4+ × ethnic 3+ | SNP 5 / 약물 9 / outcome 5 / 식이 5 / ethnic 3 ✓ |
| 5종 데이터 채굴 (mock) | pubmed_counts, gwas_supporting, trial_stratification, gnomad_freq, mechanism_plausibility ✓ |
| 미탐색 cell ranking (6 features) | novelty + mechanism + gwas + ethnic + N + strat bonus ✓ |
| 한국 lean focus mode | `--korean-lean` flag, BMI<25 cohort filter, KASL N estimate ✓ |
| top hypothesis card / 1-pager / AASLD abstract | 3종 markdown 모두 ✓ |
| 표준 라이브러리만 | argparse, json, dataclasses, itertools, os, sys만 사용 ✓ |
| 외부 API 금지 | 0건 ✓ |
| `--help` 의존성 없이 동작 | 확인 ✓ |

## 결과

**전체 PASS**. 재시도 없음.
