Commit graph

6 commits

Author SHA1 Message Date
Jeffrey (Dongkyu) Kim
4c1989fdb2 Add product-report proxy route for health food manufacturing data (I0030)
The existing health-food-ingredient route only covers individually-approved
ingredients (I-0040/I-0050), missing gazetted ingredients like psyllium husk
(차전자피). I0030 (건강기능식품 품목제조 신고사항) has 44k+ registered
products with raw materials, functionality, intake precautions, and standards.

The new /v1/mfds/food-safety/product-report route queries I0030 with
server-side PRDLST_NM and RAWMTRL_NM filters in parallel, deduplicates
by report number, and returns normalized results. Live-verified with
FOODSAFETYKOREA_API_KEY returning 차전자피 products with full precautions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 02:44:25 +09:00
Jeffrey (Dongkyu) Kim
9dd5438f5f Add health-food ingredient and inspection-fail proxy routes for food-safety
The existing food-safety skill only queried recall/sales-suspension records
(I0490), which was too edge-case for "can I eat this?" questions. This adds
two new foodsafetykorea.go.kr surfaces through k-skill-proxy:

- /v1/mfds/food-safety/health-food-ingredient (I-0040 + I-0050):
  official health food ingredient recognition, daily intake, precautions
- /v1/mfds/food-safety/inspection-fail (I2620):
  domestic inspection failure records with test results and standards

All three routes share the same FOODSAFETYKOREA_API_KEY with sample-feed
fallback. Python helper gains health-food-ingredient and inspection-fail
subcommands. SKILL.md updated with new surfaces, workflow, and CLI examples.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 02:22:50 +09:00
Jeffrey (Dongkyu) Kim
2550d19974 Route MFDS drug-safety and food-safety lookups through k-skill-proxy
Move direct API calls out of the skill Python scripts and into shared
proxy routes so end-users no longer need their own DATA_GO_KR_API_KEY
for MFDS surfaces. Adds mfds.js helper, proxy tests, and updates all
docs and setup guidance to reflect the hosted proxy workflow.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 00:07:18 +09:00
Jeffrey (Dongkyu) Kim
8cb90d76b2 Clarify invalid Foodsafety Korea key failures
Foodsafety Korea returns HTML with HTTP 200 for invalid recall API keys,
so the helper now converts non-JSON responses into a stable ApiError
instead of leaking a JSON parser failure. A regression test locks the
invalid-key path to the documented foodsafetykorea-key guidance.

Constraint: Upstream invalid-key responses return HTML with HTTP 200 instead of JSON errors
Rejected: Let JSONDecodeError bubble up | opaque CLI output for a predictable auth/config failure
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Keep Foodsafety Korea non-JSON responses mapped to stable user-facing ApiError text unless the upstream starts returning structured JSON failures
Tested: invalid-key CLI search warning, MFDS helper commands, Python unit tests, skill docs regression, npm run ci
Not-tested: live approved Foodsafety Korea API key success path (still depends on upstream key approval)
2026-04-09 00:05:10 +09:00
Jeffrey (Dongkyu) Kim
40e0ad31b7 Protect Foodsafety Korea recall lookups with HTTPS
Review feedback found the MFDS food-safety helper and published
examples were still sending Foodsafety Korea recall traffic over
plain HTTP even though the upstream host already supports HTTPS.
This follow-up swaps the sample and live recall URLs to HTTPS and
adds narrow regressions that lock both the helper constants and
documented sample links against transport regressions.

Constraint: Keep the change limited to the approved PR #86 transport-safety follow-up
Rejected: Broader MFDS helper refactor | unnecessary for the HTTPS-only fix
Confidence: high
Scope-risk: narrow
Reversibility: clean
Directive: Keep Foodsafety Korea recall URLs on HTTPS in both helper constants and published examples, including API-key paths
Tested: python3 scripts/mfds_drug_safety.py --help; python3 scripts/mfds_drug_safety.py interview --question '타이레놀이랑 판콜 같이 먹어도 되나요?' --symptoms '두드러기와 어지러움'; python3 scripts/mfds_food_safety.py --help; python3 scripts/mfds_food_safety.py interview --question '이 김밥 먹어도 되나요?' --symptoms '복통과 설사'; python3 scripts/mfds_food_safety.py search --query '대장균' --sample-recalls --limit 1; PYTHONPATH=.:scripts python3 -m unittest scripts.test_mfds_drug_safety scripts.test_mfds_food_safety; node --test scripts/skill-docs.test.js; npm run ci
Not-tested: Live Foodsafety Korea authenticated recall lookup with an approved API key
2026-04-08 23:08:30 +09:00
Jeffrey (Dongkyu) Kim
5793381517 Ship interview-first MFDS safety skills for drugs and food
The approved issue narrowed scope to two public-health skills: one for
official MFDS drug safety lookups and one for food safety / recall
lookups. This change adds both skills, bundles runnable Python helpers,
locks the docs and helper behavior with TDD regressions, and updates
repo docs so the interview-first safety flow is installed and verified
with the rest of k-skill.

Constraint: User-approved scope requires mandatory symptom follow-up before answering and forbids direct diagnosis
Constraint: Live MFDS data.go.kr success paths depend on upstream key approval/status; local verification on 2026-04-08 surfaced HTTP 403 with the available key
Rejected: Single generic health skill | weaker safety boundaries and less explicit user routing
Confidence: medium
Scope-risk: moderate
Reversibility: clean
Directive: Keep red-flag escalation and interview-first wording intact unless official clinical scope is expanded deliberately
Tested: python3 scripts/mfds_drug_safety.py --help; python3 scripts/mfds_drug_safety.py interview --question '타이레놀이랑 판콜 같이 먹어도 되나요?' --symptoms '두드러기와 어지러움'; python3 scripts/mfds_food_safety.py --help; python3 scripts/mfds_food_safety.py interview --question '이 김밥 먹어도 되나요?' --symptoms '복통과 설사'; python3 scripts/mfds_food_safety.py search --query '대장균' --sample-recalls --limit 1; PYTHONPATH=.:scripts python3 -m unittest scripts.test_mfds_drug_safety scripts.test_mfds_food_safety; node --test scripts/skill-docs.test.js; npm run ci
Not-tested: Successful authenticated MFDS live data.go.kr lookup path with a fully approved service key
2026-04-08 22:23:14 +09:00