{"id":50558072,"url":"https://github.com/kipeum86/data-protection-agent","last_synced_at":"2026-06-04T09:01:26.475Z","repository":{"id":356485972,"uuid":"1230744085","full_name":"kipeum86/data-protection-agent","owner":"kipeum86","description":"Unified privacy research agent for EU GDPR · Korea PIPA · California (CCPA-as-amended-by-CPRA). 2,195 indexed authorities · 30+ citation audit checks · 234 tests · DOCX/HTML legal-opinion deliverables. Built for Claude Code; part of the KP Legal Orchestrator.","archived":false,"fork":false,"pushed_at":"2026-05-08T08:51:42.000Z","size":35802,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-08T10:29:07.907Z","etag":null,"topics":["agent","california-law","ccpa","claude-code","cpra","data-protection","eu-law","gdpr","korean-law","legal-research","legal-tech","pipa","privacy-law","rag","structured-rag"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kipeum86.png","metadata":{"files":{"readme":"README.ko.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-05-06T09:24:25.000Z","updated_at":"2026-05-08T08:51:46.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/kipeum86/data-protection-agent","commit_stats":null,"previous_names":["kipeum86/data-protection-agent"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/kipeum86/data-protection-agent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kipeum86%2Fdata-protection-agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kipeum86%2Fdata-protection-agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kipeum86%2Fdata-protection-agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kipeum86%2Fdata-protection-agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kipeum86","download_url":"https://codeload.github.com/kipeum86/data-protection-agent/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kipeum86%2Fdata-protection-agent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33897568,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-04T02:00:06.755Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","california-law","ccpa","claude-code","cpra","data-protection","eu-law","gdpr","korean-law","legal-research","legal-tech","pipa","privacy-law","rag","structured-rag"],"created_at":"2026-06-04T09:01:25.621Z","updated_at":"2026-06-04T09:01:26.465Z","avatar_url":"https://github.com/kipeum86.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n**[English](README.md)** · **[한국어](README.ko.md)**\n\n\u003e 최신 릴리즈: **[v1.0.0 — 최초 공개 릴리즈](docs/releases/RELEASE-v1.0.0.md)** (영/한 병기)\n\n# Data Protection Agent\n\n### KP Legal Orchestrator · EU·한국·캘리포니아 통합 개인정보 리서치 에이전트\n\n**3개 법역** · **2,195개 권위 인덱싱** · **30+ 인용 감사 체크** · **223개 테스트** · **8단계 리서치 워크플로우**\n\n[Claude Code](https://docs.anthropic.com/en/docs/claude-code/overview) 기반 · 구조화된 RAG · 프로덕션 검증 완료\n\n[![Claude Code](https://img.shields.io/badge/Claude_Code-Powered-blueviolet?logo=anthropic)](https://claude.ai/code)\n[![Python 3.11+](https://img.shields.io/badge/Python-3.11+-3776AB?logo=python\u0026logoColor=white)](https://python.org)\n[![법역](https://img.shields.io/badge/%EB%B2%95%EC%97%AD-EU_·_KR_·_US--CA-blue)](#지식베이스)\n[![권위 수](https://img.shields.io/badge/%EA%B6%8C%EC%9C%84-2%2C195-green)](#지식베이스)\n[![감사 체크](https://img.shields.io/badge/%EA%B0%90%EC%82%AC%20%EC%B2%B4%ED%81%AC-30%2B-orange)](#인용-감사기)\n[![테스트](https://img.shields.io/badge/%ED%85%8C%EC%8A%A4%ED%8A%B8-223-brightgreen)](#로컬-사전점검--ci)\n[![License](https://img.shields.io/badge/License-Apache_2.0-yellow)](#라이선스)\n\n\u003cbr/\u003e\n\n\u003e *\"Data structure is intelligence.\"*\n\u003e — 더 똑똑한 검색이 아니라, 더 똑똑한 데이터가 답이다.\n\n\u003c/div\u003e\n\n\u003e [!CAUTION]\n\u003e **본 도구는 법률 리서치 보조용이며, 법률 자문이 아닙니다.** 출력은 AI가 생성한 결과로, 내장 검증을 거쳤더라도 오류가 있을 수 있습니다. 모든 법적 인용은 사용 전에 반드시 독립적으로 확인해야 합니다. 구체적인 법률 사안에 대한 자문은 자격 있는 변호사에게 받으세요.\n\n\u003e [!TIP]\n\u003e **처음 오셨나요?** 슬래시 명령부터 보고 싶으시면 [빠른 시작](#빠른-시작), 이 도구가 무엇을 해결하고 왜 만들어졌는지 알고 싶으시면 [문제 정의](#문제-정의)부터 보세요.\n\n---\n\n## 프로젝트 계보\n\n이 에이전트는 **KP Legal Orchestrator 의 개인정보 리서치 모듈**로, 세 개의 지식베이스를 하나의 cross-jurisdictional 응답 표면으로 통합합니다:\n\n- **EU GDPR 서브-KB** *(이 레포 내 `kb/eu-gdpr/`; v1.0.0 시점에 superseded 된 GDPR-expert sibling 레포에서 흡수)* → GDPR + ePrivacy Directive + EU AI Act + Data Act + Data Governance Act · 1,029개 레코드\n- **한국 PIPA 서브-KB** *(이 레포 내 `kb/kr-pipa/`; v1.0.0 시점에 superseded 된 PIPA-expert sibling 레포에서 흡수)* → 개인정보 보호법 (PIPA) + 정보통신망법 + 신용정보법 + 위치정보법 + PIPC 가이드라인 · 929개 레코드\n- **California 서브-KB** *(이 레포 내 `sources/us-ca/`; 처음부터 in-tree 빌드)* → CCPA-as-amended-by-CPRA + CPPA 규정 + CIPA + CMIA + AADC + Customer Records Act + 인접 프라이버시 법령 · 237개 레코드\n\n\u003e **v1.0.0 (2026-05-08) 시점부터 모든 KB 컨텐츠는 이 레포의 `kb/` 아래에서 유지됩니다.** GDPR-expert + PIPA-expert sibling 레포는 historical reference 로 보존되지만 superseded 상태이며, 향후 모든 개발 (KB 업데이트 포함) 은 이 레포에서 이루어집니다. README 와 docs 가 자체 완결적이라 sibling 레포를 일일이 열어볼 필요 없습니다.\n\n이 레포가 세 지식베이스 위에 추가하는 레이어:\n\n| 레이어 | 단일 법역 레포에서는 만들 수 없는 이유 |\n|---|---|\n| **Cross-jurisdiction 라우팅** | 어떤 sub-KB(s) 가 질문에 해당하는지 결정. 단일 법역 레포는 국경을 넘는 라우팅 불가. |\n| **Cross-jurisdiction 인용 감사기** | 한 문단 안에 EU/KR/CA 권위가 섞이는 현상, 용어 drift (`controller` vs `business` vs `개인정보처리자`), \"법역에 따라 다름\" 같은 막연한 표현을 catch. |\n| **통합 응답 파이프라인** | 슬래시 명령 하나 (`/answer`) 로 intake → retrieval → grounding → composition → audit → write 8단계를 세 KB 모두에 걸쳐 엄격한 source-anchor 규율로 수행. |\n| **출력 컨트랙트 검증기** | 결과 메모(.md) + 메타데이터(.json) 의 머신 검증 가능한 스키마. 모든 key finding 은 `src_NNN` id 로 추적되고, 모든 source id 는 로컬 KB 권위로 resolve 되어야 함. |\n\n---\n\n## 목차\n\n- [프로젝트 계보](#프로젝트-계보)\n- [문제 정의](#문제-정의)\n- [솔루션](#솔루션)\n- [지식베이스](#지식베이스)\n- [동작 원리](#동작-원리)\n- [빠른 시작](#빠른-시작)\n- [출력 컨트랙트](#출력-컨트랙트)\n- [Source 신뢰도 모델](#source-신뢰도-모델)\n- [인용 감사기](#인용-감사기)\n- [레포 구조](#레포-구조)\n- [로컬 사전점검 + CI](#로컬-사전점검--ci)\n- [로드맵](#로드맵)\n- [KP Legal Orchestrator 의 일부로서](#kp-legal-orchestrator-의-일부로서)\n- [라이선스](#라이선스)\n- [면책사항](#면책사항)\n\n---\n\n## 문제 정의\n\n실무 개인정보 컴플라이언스는 단일 법역으로 끝나는 경우가 드뭅니다. 사용자 데이터를 다루는 SaaS 제품은 **GDPR (EU 사용자)**, **PIPA (한국 사용자)**, **CCPA-as-amended-by-CPRA (캘리포니아 소비자)** 분석을 동시에 요구하는 경우가 일상입니다. EU 전용 회사도 캘리포니아 마케팅 노출이 있고, 한국 전용 회사도 API 를 통해 EU 고객을 받습니다.\n\n기존 AI 프라이버시 도구들이 이 시나리오에서 무너지는 이유:\n\n- **설계상 단일 법역** — 대부분의 도구가 GDPR *또는* PIPA *또는* CCPA 만 다룹니다. 셋 다 다루는 도구는 거의 없고, cross-juris 질문은 수동 오케스트레이션을 강요합니다.\n- **권위를 조용히 섞어버림** — 다중 법역으로 강제하면, 일반 RAG 는 GDPR Article 22 와 CCPA opt-out 을 한 문단에 같은 개념인 것처럼 합쳐버립니다. 그러나 이는 같지 않습니다. \"Personal data\" (GDPR) 와 \"personal information\" (CCPA, PIPA) 은 호환되는 용어가 아니고, lawful basis (GDPR 제6조) 와 notice-at-collection (CCPA § 1798.100) 은 다른 법적 hook 입니다.\n- **인용 규율 상실** — flat PDF 위의 일반 RAG 는 조문 번호를 hallucinate 하고, 판례 holding 을 fabricate 하고, recital 을 binding 으로 잘못 분류하며, 연방법원 판결을 캘리포니아 주 precedent 로 오인합니다.\n- **품질 게이트 부재** — 답변이 실제로 primary law 에 grounded 되어 있는지 프로그램적으로 확인할 방법이 없습니다. 사용자가 유일한 방어선입니다.\n\n이게 잘못되면 비용이 큽니다. 규제기관, 원고, 기자들은 GDPR Recital 71 이 binding 으로 인용된 메모, § 1798.150 이 캘리포니아 유출 통지 statute 라고 주장한 메모 (실제로는 private right of action), 9th Circuit 의 CCPA 해석을 바인딩 캘리포니아 precedent 로 취급한 메모를 즉시 잡아냅니다.\n\n---\n\n## 솔루션\n\n```mermaid\nflowchart LR\n    Q[\"\u003cb\u003e사용자 질문\u003c/b\u003e\u003cbr/\u003e예: \u003ci\u003eAI 환불 거절에 대해 GDPR Art 22 / PIPA\u003cbr/\u003e제37조의2 / CCPA ADMT 규정 비교\u003c/i\u003e\"]\n\n    subgraph route[\"라우팅\"]\n        direction TB\n        R[\"\u003cb\u003eintake-and-routing\u003c/b\u003e 스킬\u003cbr/\u003e→ comparative 모드\u003cbr/\u003e→ EU + KR + US-CA\"]\n    end\n\n    subgraph kb[\"3개 Sub-KB (2,195 권위)\"]\n        direction LR\n        EU[\"\u003cb\u003eeu-gdpr\u003c/b\u003e\u003cbr/\u003e1,029 레코드\u003cbr/\u003eGDPR · ePrivacy · AI Act\u003cbr/\u003e· Data Act · DGA · EDPB · CJEU\"]\n        KR[\"\u003cb\u003ekr-pipa\u003c/b\u003e\u003cbr/\u003e929 레코드\u003cbr/\u003e개인정보 보호법 · 정보통신망법 ·\u003cbr/\u003e신용정보법 · 위치정보법 · PIPC\"]\n        CA[\"\u003cb\u003eus-ca\u003c/b\u003e\u003cbr/\u003e237 레코드\u003cbr/\u003eCCPA-as-amended-by-CPRA ·\u003cbr/\u003eCPPA 규정 · CalOPPA · CIPA · CMIA · AADC\"]\n    end\n\n    subgraph audit[\"품질 게이트 (30+ 체크)\"]\n        direction TB\n        SUB[\"3 sub-auditors\u003cbr/\u003e\u003ci\u003earticle id · case 조회 · 인용 무결성 ·\u003cbr/\u003efuture-effective · mirror 공시 · binding 오용\u003c/i\u003e\"]\n        XJ[\"Cross-jurisdiction auditor\u003cbr/\u003e\u003ci\u003erouting · 용어 · 라벨 · 막연한 인용\u003c/i\u003e\"]\n        VAL[\"출력 컨트랙트 검증기\u003cbr/\u003e\u003ci\u003e스키마 · source 앵커 · placeholder\u003c/i\u003e\"]\n        SUB --\u003e XJ --\u003e VAL\n    end\n\n    OUT[\"\u003cb\u003e출력 (2개 컨트랙트 파일)\u003c/b\u003e\u003cbr/\u003edata-protection-agent-result.md (9-section 메모)\u003cbr/\u003edata-protection-agent-meta.json (구조화 메타데이터)\"]\n\n    Q --\u003e R\n    R --\u003e EU \u0026 KR \u0026 CA\n    EU \u0026 KR \u0026 CA --\u003e SUB\n    VAL --\u003e OUT\n\n    style Q fill:#ede9fe,stroke:#7c3aed,color:#5b21b6\n    style route fill:#eff6ff,stroke:#2563eb\n    style kb fill:#f0fdf4,stroke:#16a34a\n    style audit fill:#fffbeb,stroke:#d97706\n    style OUT fill:#d1fae5,stroke:#059669,color:#065f46\n    style EU fill:#dbeafe,stroke:#3b82f6,color:#1e40af\n    style KR fill:#dbeafe,stroke:#3b82f6,color:#1e40af\n    style CA fill:#dbeafe,stroke:#3b82f6,color:#1e40af\n    style SUB fill:#fef3c7,stroke:#d97706,color:#92400e\n    style XJ fill:#fef3c7,stroke:#d97706,color:#92400e\n    style VAL fill:#fef3c7,stroke:#d97706,color:#92400e\n```\n\ndata-protection-agent 가 단일 법역 도구로는 불가능한 일을 합니다:\n\n1. **질문별로 라우팅** — `index/jurisdiction-routing.json` 을 사용해 적절한 sub-KB(s) 로. 모드: `ca_only` / `kr_only` / `eu_only` / `multi_jurisdiction` / `comparative` / `fallback_us` / `fallback`.\n2. **로컬 KB 에서만 retrieve** (웹 fetch X, training-data fallback X) — `unified-authority-index.json` (2,195 권위) + `unified-topic-index.json` (29개 큐레이션 토픽 매핑) 에 대한 결정론적 키워드 + 토픽 boost 스코어링.\n3. **모드별로 composition** — 엄격한 source-anchor 규율. 모든 key finding 은 `src_NNN` id 로 추적, 한 문단에 두 법역 권위가 섞이지 않음. comparative 모드는 side-by-side 매트릭스 + 법역별 라벨 commentary 를 사용.\n4. **프로그램적 감사** — 4개 auditor layer (3 sub-auditors + cross-jurisdiction) 에 걸친 30+ regex/구조 체크.\n5. **출력 컨트랙트 검증** — markdown 메모와 JSON 메타데이터 둘 다 머신 체크 후 완료 선언. CI 가 컨트랙트 위반 시 fail.\n6. **모르는 것을 기록** — 범위 밖 (Virginia CDPA, Brazil LGPD 등) 은 `coverage_gaps` 로 정직하게 flag, fabricate 안 함. 추측보다 loud-fail 을 선택.\n\n결과: 변호사가 규제기관 앞에서 defend 할 수 있는 리서치 산출물.\n\n---\n\n## 지식베이스\n\n3개 sub-KB 를 하나의 runtime tree 로 import. 각 sub-KB 는 풍부한 YAML frontmatter 가 붙은 per-section 마크다운 파일, 빠른 lookup 을 위한 JSON 인덱스, 그리고 (해당하는 경우) cross-reference 그래프를 가집니다.\n\n| Sub-KB | Source-of-truth | 레코드 | 주요 법령 | 권위 유형 |\n|:---|:---|---:|:---|:---|\n| `eu-gdpr` | in-tree (`kb/eu-gdpr/`) — v1.0.0 시점에 GDPR-expert 에서 흡수 | **1,029** | GDPR | Articles · Recitals · EDPB 문서 (guidelines/opinions/binding decisions) · CJEU 판례 · enforcement decisions |\n| `kr-pipa` | in-tree (`kb/kr-pipa/`) — v1.0.0 시점에 PIPA-expert 에서 흡수 | **929** | 개인정보 보호법 | 법조문 · 시행령 조문 · 정보통신망법 · 신용정보법 · 위치정보법 · PIPC 가이드라인 · 법원 판결 |\n| `us-ca` | local `sources/us-ca/` (처음부터 in-tree 빌드) | **237** | CCPA-as-amended-by-CPRA | CCPA 본법 · CPPA 규정 (11 CCR § 7000–7300) · CalOPPA · CIPA · CMIA · AADC · Customer Records Act · OAG 가이드 · 법원 판결 |\n| **합계** | | **2,195** | | |\n\n### 지식이 어떻게 들어오는가\n\n```mermaid\nflowchart LR\n    subgraph hist[\"Historical lineage\u003cbr/\u003e\u003ci\u003e(superseded sibling 레포, v1.0.0)\u003c/i\u003e\"]\n        direction TB\n        G[\"GDPR-expert\u003cbr/\u003e\u003ci\u003eEU 입법은 CELLAR API,\u003cbr/\u003eEDPB PDF, CJEU 판례 파일\u003c/i\u003e\"]\n        P[\"PIPA-expert\u003cbr/\u003e\u003ci\u003elaw.go.kr 구조화 데이터,\u003cbr/\u003ePIPC 가이드라인 PDF\u003c/i\u003e\"]\n    end\n\n    subgraph local[\"In-Tree Sources of Truth\"]\n        direction TB\n        KBEU[\"\u003cb\u003ekb/eu-gdpr/\u003c/b\u003e\u003cbr/\u003e\u003ci\u003elibrary/ + index/\u003cbr/\u003e(v1.0.0 에서 흡수)\u003c/i\u003e\"]\n        KBKR[\"\u003cb\u003ekb/kr-pipa/\u003c/b\u003e\u003cbr/\u003e\u003ci\u003elibrary/ + index/\u003cbr/\u003e(v1.0.0 에서 흡수)\u003c/i\u003e\"]\n        SRC[\"\u003cb\u003esources/us-ca/\u003c/b\u003e\u003cbr/\u003e\u003ci\u003elibrary/ + index/\u003cbr/\u003e+ build_california_kb.py\u003c/i\u003e\"]\n    end\n\n    IM[\"\u003cb\u003escripts/import_namespaced_kbs.py\u003c/b\u003e\u003cbr/\u003e(결정론적, idempotent — 통합 인덱스\u003cbr/\u003erefresh; sources/us-ca/ → kb/us-ca/ 복사)\"]\n\n    subgraph runtime[\"Runtime / Unified View\"]\n        direction TB\n        KBCA[\"kb/us-ca/\u003cbr/\u003e\u003ci\u003e(sources/us-ca/ 에서 생성)\u003c/i\u003e\"]\n        UI[\"index/\u003cbr/\u003e\u003ci\u003ejurisdiction-routing,\u003cbr/\u003eunified-authority-index,\u003cbr/\u003eunified-topic-index,\u003cbr/\u003eunified-source-registry\u003c/i\u003e\"]\n        KBCA --\u003e UI\n    end\n\n    G -.-\u003e KBEU\n    P -.-\u003e KBKR\n    SRC --\u003e IM\n    IM --\u003e KBCA\n    KBEU --\u003e UI\n    KBKR --\u003e UI\n\n    style hist fill:#f3f4f6,stroke:#9ca3af,color:#374151\n    style local fill:#f0fdf4,stroke:#16a34a\n    style runtime fill:#eff6ff,stroke:#2563eb\n    style IM fill:#fef9c3,stroke:#ca8a04,color:#713f12\n    style G fill:#e5e7eb,stroke:#6b7280,color:#374151\n    style P fill:#e5e7eb,stroke:#6b7280,color:#374151\n    style KBEU fill:#d1fae5,stroke:#059669,color:#065f46\n    style KBKR fill:#d1fae5,stroke:#059669,color:#065f46\n    style SRC fill:#d1fae5,stroke:#059669,color:#065f46\n    style KBCA fill:#dbeafe,stroke:#3b82f6,color:#1e40af\n    style UI fill:#dbeafe,stroke:#3b82f6,color:#1e40af\n```\n\n3개 sub-KB 모두 이 레포의 `kb/\u003cnamespace\u003e/` 아래에서 유지됩니다. EU/KR KB 컨텐츠는 v1.0.0 (2026-05-08) 시점에 GDPR-expert + PIPA-expert sibling 레포로부터 흡수되었으며, sibling 레포들은 이제 superseded 상태이지만 원래의 인제스트 파이프라인 (GDPR 의 CELLAR API, PIPA 의 law.go.kr) 은 historical reference 로 그쪽 README 에 그대로 남아 있습니다. California sub-KB 는 `sources/us-ca/` 에서 `scripts/build_california_kb.py` 로 로컬 빌드되어 importer 가 `kb/us-ca/` 로 복사합니다. 어떤 KB 변경 후에도 `scripts/import_namespaced_kbs.py --clean` 으로 통합 `index/` 트리를 regenerate.\n\n`index/` 의 통합 인덱스는 **생성물이며, 절대 수동 편집하지 않습니다**:\n\n| 파일 | 내용 |\n|---|---|\n| `index/jurisdiction-routing.json` | namespace 별 라우팅 용어 (intake-and-routing 이 사용) |\n| `index/unified-authority-index.json` | 2,195개 권위 전체 평면 리스트 (`unified_id`, `namespace`, `jurisdiction`, `source_grade`, `path` 포함) |\n| `index/unified-topic-index.json` | 29개 큐레이션 토픽 매핑 (CA 13 + KR 8 + EU 8) |\n| `index/unified-source-registry.json` | sub-KB 별 manifest (import 시각 + 레코드 수) |\n\n### 토픽 매핑 (총 29개)\n\n각 sub-KB 는 자주 묻는 프라이버시 질문을 controlling 권위로 매핑하는 토픽 인덱스를 ship 합니다. retriever 는 키워드 스코어링 위에 토픽 boost (+7) 를 적용하므로, \"PIPA 동의\" 같은 질문이 키워드만 높게 잡힐 `pipa-art1` (목적) 이 아니라 `pipa-art15` + `pipa-art22` 를 우선 surface 합니다.\n\n| 토픽 패밀리 | 커버리지 |\n|:---|:---|\n| 통지 / 동의 / 처리 근거 | 3법역 (GDPR Art 6/7/8, PIPA 제15·22조, CCPA § 1798.100 + 11 CCR § 7012) |\n| 정보주체 권리 | 3법역 (GDPR Arts 15-22, PIPA 제35-37조의2, CCPA § 1798.105/.110/.115) |\n| 민감정보 / 특별 카테고리 | 3법역 (GDPR Art 9, PIPA 제23-24조, CCPA § 1798.121) |\n| 유출 통지 | 3법역 (GDPR Art 33-34, PIPA 제34조 + 시행령 제39·40조, CCPA § 1798.150 + Civ § 1798.82) |\n| 국외 이전 | EU + KR (GDPR Chapter V, PIPA 제28조의8/9) |\n| 자동화된 결정 | 3법역 (GDPR Art 22, PIPA 제37조의2, CCPA 11 CCR § 7200-7222 ADMT regime) |\n| DPIA / 영향평가 | 3법역 (GDPR Art 35-36, PIPA 제33조, CCPA 11 CCR § 7150-7155) |\n| Enforcement / 벌칙 | 3법역 (GDPR Art 83/82/77, PIPA 제64조의2/64/39, CPPA enforcement) |\n| 미성년자 / 아동 | CA 가 가장 강함 (CCPA § 1798.120, 11 CCR § 7070-7071, AADC, SOPIPA) |\n| CCPA 고유 | Notice at collection · CalOPPA · CIPA tracking · Data Broker Delete Act |\n\n---\n\n## 동작 원리\n\n에이전트는 **8단계 워크플로우**를 실행합니다 — standalone `/answer` 호출이든 orchestrator subagent 디스패치든 동일한 경로:\n\n```mermaid\nsequenceDiagram\n    participant U as 사용자 / Orchestrator\n    participant SK as .claude/skills/\n    participant KB as 로컬 KB (kb/)\n    participant AU as Auditors\n    participant OUT as 출력 파일\n\n    U-\u003e\u003eSK: /answer \"\u003c질문\u003e\"\u003cbr/\u003e또는 Task(subagent_type=...)\n    SK-\u003e\u003eSK: 1. intake-and-routing\u003cbr/\u003e\u003ci\u003e모드 분류, sub-KB(s) 선택\u003c/i\u003e\n    SK-\u003e\u003eKB: 2. kb-retrieval\u003cbr/\u003e\u003ci\u003eretrieve_authorities.py + 토픽 boost\u003c/i\u003e\n    KB--\u003e\u003eSK: top-K 권위 + body\n    SK-\u003e\u003eSK: 3. trust-boundary\u003cbr/\u003e\u003ci\u003eKB 내용 = 데이터, 명령 X\u003c/i\u003e\n    SK-\u003e\u003eSK: 4. claim-grounding\u003cbr/\u003e\u003ci\u003e모든 material claim → local id\u003c/i\u003e\n    SK-\u003e\u003eSK: 5. result-memo-composition\u003cbr/\u003e\u003ci\u003e또는 multi-juris 면 comparative-composition\u003c/i\u003e\n    SK-\u003e\u003eAU: 6. quality-check\n    AU-\u003e\u003eAU: 4 sub-auditors + cross-juris\n    AU-\u003e\u003eAU: validate-output.py\n    AU--\u003e\u003eSK: pass / warn / fail\n    SK-\u003e\u003eOUT: 7. 컨트랙트 파일 2개 작성\n    Note right of OUT: data-protection-agent-result.md\u003cbr/\u003edata-protection-agent-meta.json\n```\n\n### 모드\n\n| 모드 | 사용 시점 | 출력 형태 |\n|:---|:---|:---|\n| `ca_only` | California 만 시그널 (CCPA, CPRA, CPPA, CIPA, CMIA 등) | 단일 법역 메모 |\n| `kr_only` | 한국만 (PIPA, 정보통신망법, 신용정보법, PIPC) | 단일 법역 메모 (한국어 가능) |\n| `eu_only` | EU 만 (GDPR, EDPB, AI Act, Data Act, ePrivacy) | 단일 법역 메모 |\n| `multi_jurisdiction` | 2+ 법역, 명시적 \"비교\" 의도 X | 법역별 라벨 section |\n| `comparative` | 2+ 법역, 비교 의도 (`compare`, `vs`, `비교`, `차이`) | 매트릭스 + 법역별 commentary |\n| `fallback_us` | California 외 미국 프라이버시 (Virginia CDPA, Colorado CPA 등) | Coverage-gap 메모 (KB 범위 밖) |\n| `fallback` | 도메인 밖 (프라이버시 X) | 보수적 메모 + 명시적 gap |\n\n모드는 intake 시점에 잠깁니다. 워크플로우 중간에 **silently 모드 전환 안 함**. 사용자 질문이 라우팅된 모드와 충돌하면, 에이전트는 `classification_warnings` 에 기록하고 `coverage_gaps` 에 불확실성을 surface — override 안 함.\n\n### 스킬 (10개 모듈러 instruction)\n\n각 스킬은 `disable-model-invocation: true` frontmatter — `CLAUDE.md` 참조를 통해 명시적으로 호출될 때만 LLM 이 로드. 토큰 예산을 타이트하게 유지하고 워크플로우를 규율적으로 만듦.\n\n| 스킬 | 역할 |\n|:---|:---|\n| [`intake-and-routing`](.claude/skills/intake-and-routing/SKILL.md) | 모드 분류 + 라우팅 블록 emit |\n| [`kb-retrieval`](.claude/skills/kb-retrieval/SKILL.md) | 결정론적 로컬 retrieval + source envelope 빌드 |\n| [`trust-boundary`](.claude/skills/trust-boundary/SKILL.md) | KB / web / MCP 의 모든 byte 를 데이터로 취급 (instruction X) |\n| [`claim-grounding`](.claude/skills/claim-grounding/SKILL.md) | 모든 material claim → 로컬 권위 id + currentness 체크 |\n| [`result-memo-composition`](.claude/skills/result-memo-composition/SKILL.md) | source 앵커가 붙은 9-section 표준 메모 작성 |\n| [`comparative-composition`](.claude/skills/comparative-composition/SKILL.md) | 다중 법역 라벨 section + side-by-side 매트릭스; 절대 섞지 않음 |\n| [`quality-check`](.claude/skills/quality-check/SKILL.md) | 인용 감사기 + 출력 검증기 + source-coverage 게이트 실행 |\n| [`citation-auditor`](.claude/skills/citation-auditor/SKILL.md) | `audit-unified.py` 의 슬래시 스킬 wrapper (CC 사용자 직접 호출 가능) |\n| [`output-mode-composition`](.claude/skills/output-mode-composition/SKILL.md) *(v21, vendored)* | `output_mode` 별로 `templates/modes/` 의 적절한 템플릿으로 dispatch |\n| [`legal-writing-formatter`](.claude/skills/legal-writing-formatter/SKILL.md) *(v21, vendored)* | 언어별 formatter profile 적용 + DOCX 렌더러와 협업 |\n\n---\n\n## 빠른 시작\n\n### Claude Code 안에서\n\n```text\n/answer 캘리포니아 법상 사업자가 개인정보 수집 시점 또는 그 이전에 통지를 제공해야 하는 시점은?\n```\n\n에이전트가 8단계 워크플로우를 수행하고 다음을 작성:\n\n- `outputs/data-protection-agent/data-protection-agent-result.md` (9-section 메모)\n- `outputs/data-protection-agent/data-protection-agent-meta.json` (구조화 메타데이터)\n\n`OUTPUT_DIR=...` 환경변수로 출력 디렉토리 override 가능. 프롬프트에 `mode=...` 를 넣어 리서치 모드 강제 가능 (예: `mode=comparative`).\n\n정식 의견서 형태의 DOCX 결과물 (표지 페이지 + 기밀 분류 banner + 자동 번호 헤딩 + 각주 변환) 이 필요한 경우:\n\n```text\n/answer 캘리포니아 법상 사업자가 개인정보 수집 시점 또는 그 이전에 통지를 제공해야 하는 시점은? output_mode=legal_opinion\n```\n\n또는 기존 canonical 메모를 DOCX 로 렌더링하려면 `--docx` 플래그. 자세한 내용은 [출력 모드 (v21)](#출력-모드-v21) 섹션 참조.\n\n### CLI 직접 호출 (LLM 없이)\n\nsibling 레포 + 로컬 sources 에서 KB refresh:\n\n```bash\npython3 scripts/import_namespaced_kbs.py --clean\n```\n\n질문에 대한 top-K 권위 retrieve — 결정론적 스코어링, synthesis X:\n\n```bash\npython3 scripts/retrieve_authorities.py \"GDPR Art 22 와 PIPA 제37조의2 비교\" --top-k 12\n```\n\n결정론적 research packet 작성 (LLM composition X; 파이프라인·테스트 용도):\n\n```bash\npython3 scripts/run_data_protection_agent.py \"\u003c질문\u003e\" --output-dir /tmp/out --print-summary\n```\n\ndraft 답변을 통합 4-layer auditor 로 audit:\n\n```bash\npython3 scripts/audit-unified.py outputs/data-protection-agent/data-protection-agent-result.md\n```\n\n출력 디렉토리를 v19 컨트랙트로 검증:\n\n```bash\npython3 scripts/validate-output.py outputs/data-protection-agent/\n```\n\n로컬 golden-set evaluator 실행 (legacy + v19 모드 13개 fixture):\n\n```bash\npython3 scripts/evaluate_golden_set.py --output-dir /tmp/golden --clean\n```\n\n### 테스트\n\n```bash\nPYTHONPATH=. pytest -q tests              # cross-cutting + e2e (123)\ncd sources/us-ca \u0026\u0026 PYTHONPATH=. pytest -q tests   # CA sub-auditor (49)\ncd sources/kr-pipa \u0026\u0026 PYTHONPATH=. pytest -q tests # KR sub-auditor (23)\ncd sources/eu-gdpr \u0026\u0026 PYTHONPATH=. pytest -q tests # EU sub-auditor (28)\n```\n\n총 **223개 테스트**, `main` 에서 모두 green.\n\n### 옵션: pre-commit auditor 훅\n\n```bash\ngit config core.hooksPath .githooks\n```\n\n훅이 staged `.md` 파일들을 통합 auditor 에 통과시킴. `error` finding 은 커밋 abort, `warn` 은 inline 출력. 비활성화: `git config --unset core.hooksPath`. 한 번만 skip: `git commit --no-verify`.\n\n---\n\n## 출력 컨트랙트\n\n성공한 모든 실행은 정확히 두 파일을 작성:\n\n```text\n$OUTPUT_DIR/data-protection-agent-result.md     # 9-section 메모\n$OUTPUT_DIR/data-protection-agent-meta.json     # 구조화 메타데이터\n```\n\n### 결과 메모 구조\n\n```markdown\n# Data Protection Agent - Result\n\n## Question        # 사용자 질문 verbatim\n## Route Context   # 모드, 법역, namespace (메타와 정확히 일치)\n## Short Answer    # 1-3문장, 최소 1개 src_NNN 앵커\n## Issues          # 이슈별: answer, sources, confidence, limits\n## Analysis        # Rule and Authority / Application / Counter-Analysis / Practical Next Step\n## Sources         # 권위 markdown 테이블\n## Coverage Gaps   # 또는 \"None.\"\n## Handoff Notes   # 또는 \"None.\"\n```\n\n`comparative` + `multi_jurisdiction` 모드에서는 Issues + Analysis 가 법역별 라벨 section + `## Comparison Matrix` 테이블로 대체 — **한 문단에 절대 섞지 않음**.\n\n### 메타 JSON 스키마 (필수 키)\n\n```json\n{\n  \"meta_version\": \"1.0\",\n  \"summary\": \"2-4문장 압축 요약 (~500 토큰 이하).\",\n  \"research_mode\": \"ca_only | kr_only | eu_only | multi_jurisdiction | comparative | fallback_us | fallback\",\n  \"mode_source\": \"self_classified | orchestrator\",\n  \"active_profile\": \"data-protection-agent\",\n  \"orchestrator_route_mode\": null,\n  \"fallback_reason\": null,\n  \"classification_warnings\": [],\n  \"co_running_agents\": [],\n  \"jurisdictions\": [\"EU\", \"KR\", \"US-CA\"],\n  \"namespaces\": [\"eu-gdpr\", \"kr-pipa\", \"us-ca\"],\n  \"domains\": [\"data_protection\"],\n  \"issue_map\": [...],\n  \"key_findings\": [...],\n  \"sources\": [...],\n  \"claim_checks\": [...],\n  \"comparison_matrix\": [...],\n  \"coverage_gaps\": [...],\n  \"handoff_notes\": [],\n  \"error\": null\n}\n```\n\n### Source envelope\n\n```json\n{\n  \"id\": \"src_001\",\n  \"authority_id\": \"us-ca:ca-civ-1798.100\",\n  \"namespace\": \"us-ca\",\n  \"jurisdiction\": \"US-CA\",\n  \"title\": \"General Duties of Businesses that Collect Personal Information\",\n  \"citation\": \"Cal. Civ. Code § 1798.100\",\n  \"pinpoint\": \"(a)(1)-(3)\",\n  \"grade\": \"A\",\n  \"authority_level\": \"binding\",\n  \"official_url\": \"https://cppa.ca.gov/pdf/20260101_ccpa_statute.pdf\",\n  \"local_path\": \"kb/us-ca/library/grade-a/ca-ccpa-statute/civ-1798.100.md\",\n  \"currentness\": {\n    \"status\": \"current\",\n    \"checked_as_of\": \"2026-05-08\",\n    \"effective_date\": \"2026-01-01\"\n  }\n}\n```\n\n`scripts/validate-output.py` 가 두 형태 모두 강제. CI 가 컨트랙트 위반에 fail. 검증기는 v19 이전 결정론적 runner 의 출력에 대해 **legacy_packet 모드**도 지원 — 구버전 packet 은 v19-strict 키 만족 불필요하지만, 누락된 v19 키는 warning 으로 surface 해서 사용자가 full 컨트랙트가 아님을 알 수 있게 함.\n\n---\n\n## 출력 모드 (v21)\n\n`research_mode` (어떤 sub-KB 를 조회할지) 와 `output_mode` (어떤 형식으로 산출할지) 는 **직교 (orthogonal) 한 두 축** 입니다. 디폴트 `output_mode` 는 `canonical` — v19 에서 도입한 9-section 리서치 메모. v21 은 client-facing DOCX 산출물용 `legal_opinion` 모드 + `legal-research-agent` 에서 vendor 한 4개 추가 템플릿을 더합니다.\n\n| `output_mode` | 청자 | 형식 | 렌더러 |\n|:---|:---|:---|:---|\n| `canonical` (디폴트) | 변호사 / 패럴리갈 | Markdown | — |\n| `legal_opinion` | 의뢰인 / GC / 사내 법무팀 | Markdown + 자동 DOCX | `scripts/render-legal-opinion-docx.py` |\n| `executive_brief` | 의사결정자 / 임원 | Markdown (+ 옵션 DOCX/HTML) | `scripts/render-docx.py` / `scripts/render-html.py` |\n| `comparative_matrix` | Cross-juris 비교 reader | Markdown (+ 옵션 DOCX/HTML) | `scripts/render-docx.py` / `scripts/render-html.py` |\n| `enforcement_case_law` | 소송 / enforcement 리스크 reader | Markdown (+ 옵션 DOCX/HTML) | `scripts/render-docx.py` / `scripts/render-html.py` |\n| `black_letter_commentary` | 학술 / 주석서 reader | Markdown (+ 옵션 DOCX/HTML) | `scripts/render-docx.py` / `scripts/render-html.py` |\n\n모든 output mode 는 **`--html` 플래그**로 HTML 렌더링도 가능 (v22 추가, vendored `scripts/render-html.py`, marko 기반, self-contained 스타일 문서 — browser/email/intranet circulation 용도). DOCX 와 HTML 은 독립적으로 작동, 조합 가능.\n\n`/answer` 한 번 호출로 4개 출력 형태 (`*.md` / `*-meta.json` / `*.docx` / `*.html`) 모두 생성하는 worked example: [`docs/rendering-examples.md`](docs/rendering-examples.md).\n\n`legal_opinion` 렌더러 (`scripts/render-legal-opinion-docx.py`) 는 한국어 디폴트 표지 페이지 컨벤션 (`수신인: 사내 법무팀 귀중`, 기밀 분류 `CONFIDENTIAL — INTERNAL LEGAL REVIEW`, 날짜 `YYYY년 M월 D일`) 과 영문 디폴트를 모두 ship 합니다. 모든 디폴트는 CLI 플래그로 override 가능. 언어별 formatter profile 은 `knowledge/legal-writing/` 에 위치:\n\n- `ko-legal-opinion-profile.md` — 한국어 의견서 typography + 톤\n- `en-formatter-profile.md` / `ko-formatter-profile.md` — 일반 formatter profile\n- `docx-ready-markdown-profile.md` — DOCX 렌더링 안전한 markdown 컨벤션\n- `formatter-index.md` — 어떤 profile 을 언제 쓰는지\n\n렌더러 + 스킬 스택은 family 내에 이미 존재하는 렌더링 인프라 재발명을 피하기 위해 **`legal-research-agent` 에서 verbatim 으로 vendor**. DPA 도메인 패치 (`legal-research-agent-*` 파일명을 `data-protection-agent-*` 로 rewrite, 작성자 디폴트 rewrite) 는 적용하되 렌더링·typography 로직은 unchanged.\n\n### CLI 예시\n\n```bash\n# Canonical 리서치 메모 → DOCX (영문, US letter)\npython3 scripts/render-docx.py \\\n  outputs/data-protection-agent/data-protection-agent-result.md \\\n  outputs/data-protection-agent/data-protection-agent-result.docx \\\n  --language en --jurisdiction us --overwrite\n\n# 정식 한국어 legal-opinion DOCX (표지 + 기밀 banner + 자동 번호 헤딩)\npython3 scripts/render-legal-opinion-docx.py \\\n  outputs/data-protection-agent/data-protection-agent-result.md \\\n  outputs/data-protection-agent/data-protection-agent-result.docx \\\n  --title \"AI 자동화 결정 — 3법역 검토\" \\\n  --recipient \"사내 법무팀 귀중\" \\\n  --date \"$(date +'%Y년 %-m월 %-d일')\" \\\n  --classification \"CONFIDENTIAL — INTERNAL LEGAL REVIEW\" \\\n  --author \"Data Protection Agent (data-protection-agent)\"\n\n# v22 HTML — 브라우저 viewable, self-contained, 외부 의존 없음\npython3 scripts/render-html.py \\\n  outputs/data-protection-agent/data-protection-agent-result.md \\\n  outputs/data-protection-agent/data-protection-agent-result.html \\\n  --title \"AI 자동화 결정 — 3법역 검토\" \\\n  --lang ko\n```\n\n`requirements.txt` 가 `python-docx\u003e=1.1.0` (DOCX) + `marko\u003e=2.0.0` (HTML) 핀.\n\n---\n\n## Source 신뢰도 모델\n\n3개 sub-KB 가 동일한 A/B/C/D 어휘를 공유 (각 sub-KB 의 `config/source-grades.json`):\n\n| Grade | 무엇 | 인용 시점 |\n|:---:|:---|:---|\n| **A** | 공식 primary 또는 현행 공식 가이드 — statutes, regulations, 공식 기관 결정, 법원 판결 | binding rule 의 단독 근거 |\n| **B** | 공식이지만 nonbinding, 설명적, 집행, 또는 secondary authority — 미러 backed primary authority 포함 (예: California Supreme Court 판결의 SCOCAL 미러) — 로컬 raw source 가 공식 PDF 가 아닌 경우 | Grade A 와 cross-verify; 미러 provenance 공시 필수 |\n| **C** | 코멘터리 또는 discovery-only — 학술, 실무자 블로그, 뉴스 | 편집적 컨텍스트만; high-confidence 결론의 단독 근거로 절대 X |\n| **D** | 제외 — 검증 안 된 요약, 마케팅 페이지 | 법적 명제에 인용 X |\n\n**미러 공시 룰:** Grade B 미러 backed primary authority (예: Stanford SCOCAL 의 California Supreme Court 판결 사본) 인용 시 다음 같은 괄호 disclosure 필수: `(local copy from SCOCAL mirror; official URL: https://courts.ca.gov/...)`. auditor 의 `mirror_cited_without_disclosure` 체크가 강제.\n\n**연방법원 / California precedent 룰:** California 프라이버시 법에 대한 연방법원 (9th Circuit, district court) 해석은 persuasive — California 주 binding precedent 아님. binding 으로 취급 시 auditor 의 `federal_court_as_ca_binding` warn 발생.\n\n**Recital 룰 (EU):** GDPR Recitals 는 interpretive aid, operative provision 아님. Recital 을 binding 의무로 인용 시 `recital_as_binding` warn. Recital 은 Article-level rule 을 보조해야지, 그 자리를 차지하면 안 됨.\n\n**PIPC 가이드라인 룰 (KR):** PIPC 가이드라인은 행정 해석, statute 아님. binding 으로 인용 시 `pipc_guideline_as_binding` warn. 개인정보 보호법 본법 조항이 binding 효력의 근거.\n\n---\n\n## 인용 감사기\n\n4-layer regex + 구조 auditor, ~30개 distinct 오류 패턴 catch. 전체 카탈로그 [`docs/auditors.md`](docs/auditors.md), 실제 I/O 가 있는 7개 worked 예시 [`docs/examples.md`](docs/examples.md).\n\n### 레이어\n\n| 레이어 | 경로 | 주요 체크 |\n|:---|:---|:---|\n| **CA sub-auditor** | `sources/us-ca/citation_auditor/california_citation.py` | Statute / regulation / case id 누락 · CPRA standalone framing · OAG FAQ as binding · enforcement as judicial precedent · federal court as CA binding · unpublished as controlling · 2026 regulation source required · mirror disclosure · future-effective cited as current · quote integrity |\n| **KR sub-auditor** | `sources/kr-pipa/citation_auditor/korea_citation.py` | Article id 누락 · 시행규칙 (정보통신망법) · PIPC 가이드라인 binding 오용 · 외부 한국법 인용 (KB 미커버) · future-effective bilingual triggers (영문 + 한글) · quote integrity |\n| **EU sub-auditor** | `sources/eu-gdpr/citation_auditor/europe_citation.py` | Article / Recital / Case id 누락 · ECLI 조회 · EDPB document number 조회 · Recital binding 오용 · EDPB non-binding doc binding 오용 · future-effective · quote integrity |\n| **Cross-jurisdiction** | `cross_jurisdiction_auditor/audit.py` | Citation routing (signal 없는 법역 권위 인용) · 용어 drift (`controller` vs `business` vs `개인정보처리자`) · 다중 법역 라벨 누락 · 막연한 법령 인용 |\n\n### 실행\n\n```bash\n# 단일 호출 통합 runner (권장) — 4 auditor 한 프로세스에서\npython3 scripts/audit-unified.py outputs/data-protection-agent/data-protection-agent-result.md\n\n# 또는 법역별\npython3 sources/us-ca/scripts/audit-california-citations.py \u003c answer.md\npython3 sources/kr-pipa/scripts/audit-korea-citations.py \u003c answer.md\npython3 sources/eu-gdpr/scripts/audit-europe-citations.py \u003c answer.md\npython3 scripts/audit-cross-jurisdiction.py \u003c answer.md\n```\n\n### Severity 모델\n\n| Severity | 의미 | 액션 |\n|:---:|:---|:---|\n| `error` | Statute / regulation / case id 미존재; unpublished 가 controlling 으로 인용 | **Block** — 발송 전 fix |\n| `warn` | Binding 오용, 용어 mismatch, 막연한 인용, quote-body mismatch, future-effective 가 현재형으로 | `coverage_gaps` 또는 issue limits 에 inline surface |\n| `pass` | findings 0 | Ship |\n\n통합 runner 는 `error` 가 하나라도 있으면 exit 1, 그 외 0. 법역별 runner 도 여전히 사용 가능하지만, 통합 runner 가 권장 디폴트.\n\n### 주요 체크\n\n- **Quote integrity (v18, 3 KB)** — 모든 더블쿼트 인용을 추출해서 인용된 권위의 KB body 에 실제 등장하는지 확인. 가장 흔한 LLM hallucination (정확한 citation id + fabricated quote) catch. KR variant 는 substring-only (한글은 whitespace word boundary 없음).\n- **Future-effective check (v17, 3 KB)** — `effective_date` 가 미래인 권위가 현재형 (\"currently requires\") + future-framing (\"will require\") 없이 인용되면 warn. KR 은 한+영 bilingual trigger (`현재`, `시행 중`, `해야 한다` + 영문).\n- **Recital-as-binding (EU)** — GDPR Recitals 는 interpretive aid. Recital 71 을 binding 의무로 인용 시 warn.\n- **EDPB-as-binding (EU)** — EDPB Guidelines / Opinions / Recommendations 는 non-binding; Art. 65 Binding Decision 만 binding. Guideline 을 binding 으로 인용 시 warn.\n- **Federal-court-as-CA-binding (CA)** — 9th Circuit 의 CCPA 해석은 persuasive, California 주 binding precedent 아님.\n- **Mirror disclosure (CA)** — California Supreme Court 판결의 SCOCAL 미러 사본은 미러 provenance 공시 필수.\n- **2026-regulation-source-required (CA)** — 2026-effective CCPA 규정 인용 시 공식 CPPA source URL 이 답변 텍스트 (메타데이터 X) 에 있어야 함.\n- **용어 drift (cross-juris)** — `controller` 는 GDPR; `business` 는 CCPA; `개인정보처리자` 는 PIPA. EU 용어를 California section 에 쓰면 warn.\n\n### 테스트 커버리지\n\n| 레이어 | 테스트 |\n|:---|---:|\n| CA sub-auditor | 49 |\n| KR sub-auditor | 23 |\n| EU sub-auditor | 28 |\n| Cross-cutting + e2e (golden-set parametrised) | 123 |\n| **합계** | **223** |\n\n---\n\n## 레포 구조\n\n```\ndata-protection-agent/\n├── CLAUDE.md, AGENTS.md       # Agent rules + trust boundary policy\n├── README.md, README.ko.md, CHANGELOG.md\n│\n├── kb/                        # 통합 runtime KB (생성물, 수동 편집 금지)\n│   ├── eu-gdpr/               #   ← in-tree (v1.0.0 에서 GDPR-expert 에서 흡수)\n│   ├── kr-pipa/               #   ← in-tree (v1.0.0 에서 PIPA-expert 에서 흡수)\n│   └── us-ca/                 #   ← 로컬 sources/us-ca/ 에서 importer 가 빌드\n│       └── index/{ca,kr,eu}-topic-index.json   # namespace 별 토픽 매핑\n│\n├── index/                     # 통합 인덱스 (생성물)\n│   ├── jurisdiction-routing.json\n│   ├── unified-authority-index.json    # 2,195 entries\n│   ├── unified-topic-index.json        # 29 topics\n│   └── unified-source-registry.json\n│\n├── sources/{us-ca,kr-pipa,eu-gdpr}/\n│   ├── citation_auditor/      # 법역별 regex auditor (~10 checks each)\n│   ├── scripts/               # 법역별 CLI + sanitize.py\n│   └── tests/\n│   (us-ca 는 추가로 library/, index/, config/, build_california_kb.py 보유)\n│\n├── cross_jurisdiction_auditor/\n│   └── audit.py               # 4 checks: routing · vocab · labels · vague refs\n│\n├── unified_auditor/\n│   └── run.py                 # importlib 기반 4 auditor aggregator\n│\n├── scripts/                   # Top-level CLI\n│   ├── import_namespaced_kbs.py\n│   ├── retrieve_authorities.py\n│   ├── run_data_protection_agent.py\n│   ├── evaluate_golden_set.py\n│   ├── audit-unified.py\n│   ├── audit-cross-jurisdiction.py\n│   ├── validate-output.py     # v19 출력 컨트랙트 검증기 (538 lines, stdlib only)\n│   ├── coverage-report-{,kr,eu,all}.py\n│   ├── who-cites.py, who-is.py, kb-diff.py, validate-kb-schema.py\n│\n├── tests/                     # Cross-cutting + e2e (123 tests)\n│   └── test_e2e_agent_pipeline.py    # v19 golden-fixture parametrised\n│\n├── templates/                 # v19 결과 메모 + 모드별 변형\n│   ├── result.md, meta.example.json\n│   └── modes/{single-jurisdiction,multi-jurisdiction,comparative-matrix,fallback}.md\n│\n├── .claude/\n│   ├── agents/data-protection-agent.md      # 에이전트 정의 (CLAUDE.md re-import)\n│   ├── commands/answer.md                   # /answer 슬래시 명령\n│   └── skills/                              # 8 skills\n│\n├── config/\n│   └── golden-set.json        # 13 fixtures (5 v19 + 8 legacy CA cases)\n│\n└── docs/\n    ├── auditors.md            # 30+ check 전체 카탈로그\n    ├── examples.md            # I/O 가 있는 7개 worked auditor 사례\n    ├── agent-protocol.md      # Runtime protocol 명세\n    ├── kb-operations-guide.md # Build / refresh / verify\n    ├── README.md              # docs/ 폴더 레이아웃 가이드\n    └── sub-kb-operations/     # sub-KB 별 운영 노트\n```\n\n\u003e 라운드별 plan 문서 (v3-v20) 는 `.local/planning/v{N}/` 에 저장되며 v18 이후 git tracked X. `CHANGELOG.md` 가 모든 라운드를 요약.\n\n---\n\n## 로컬 사전점검 + CI\n\n### 로컬 사전점검\n\npush 전에 전체 게이트를 로컬에서 실행:\n\n```bash\n# 4개 테스트 게이트 (모두 green 필수)\ncd sources/us-ca \u0026\u0026 PYTHONPATH=. pytest -q tests\ncd ../kr-pipa \u0026\u0026 PYTHONPATH=. pytest -q tests\ncd ../eu-gdpr \u0026\u0026 PYTHONPATH=. pytest -q tests\ncd ../.. \u0026\u0026 PYTHONPATH=. pytest -q tests\n\n# Golden set (13/13)\npython3 scripts/evaluate_golden_set.py --output-dir /tmp/golden --clean\n\n# KB schema 검증 (14 indexes, 2,414 items)\npython3 scripts/validate-kb-schema.py\n\n# main 대비 KB snapshot diff (의도하지 않은 churn catch)\npython3 scripts/kb-diff.py --base main\n```\n\n### CI\n\n`.github/workflows/ci.yml` 가 모든 push + PR 에서 11개 분리된 step 으로 실행 — 각 게이트가 PR check log 에서 자체 pass/fail 시그널을 가짐:\n\n1. Python 3.12 setup\n2. Requirements install\n3. CA KB build + validate\n4. KR/EU sibling 레포 graceful skip (CI runner 에 sibling 없을 때)\n5. CA sub-auditor 테스트\n6. KR sub-auditor 테스트 (sibling 없으면 skip)\n7. EU sub-auditor 테스트 (sibling 없으면 skip)\n8. Cross-cutting + e2e 테스트\n9. Golden set 평가\n10. KB schema 검증\n11. KB snapshot diff\n\nKR/EU step 은 sibling 레포가 runner 에 없을 때 graceful skip (sibling 레포가 vendor 되기 전 fresh PR CI 의 일반적 상황). CA path 는 항상 실행.\n\n---\n\n## 로드맵\n\n| 상태 | 항목 | 비고 |\n|:---:|:---|:---|\n| ✅ 완료 (v3-v20) | Sub-KB 통합, 30+ auditor 체크, 에이전트 응답 파이프라인, 29개 토픽 매핑, 13개 golden fixture, 출력 검증기, 223 테스트 | Production-ready |\n| ⏳ 검토 중 | LRA 스타일 `output_mode` 축 (executive_brief, compliance_checklist, enforcement_focused) | `research_mode` 축 (법역 라우팅) 은 잠겨있음; `output_mode` 는 별도 직교 축 |\n| ⏳ 검토 중 | KR 판례 import | 별도 sub-KB 빌드 필요 (v1.0.0 이전에 EU/KR KB 가 인제스트되던 방식과 유사) |\n| ⏳ 검토 중 | MCP 통합 | `korean-law` MCP 로 KR primary-source 라이브 fetch — `legal-research-agent` 에서 이미 사용 중 |\n| 🚫 범위 밖 | 다중 주 미국 프라이버시 (Virginia CDPA, Colorado CPA 등) | 각자 dedicated sub-KB 빌드 라운드 필요; 그전까지 `fallback_us` 로 flag |\n| 🚫 범위 밖 | LLM provider 통합을 코드로 | 에이전트는 Claude Code 안에서 실행; 슬래시 명령 실행 중 composition 은 LLM 안에 |\n\n---\n\n## KP Legal Orchestrator 의 일부로서\n\n이 레포는 KP Legal Orchestrator 그래프의 **프라이버시 specialist** 입니다:\n\n```mermaid\nflowchart TB\n    O[\"\u003cb\u003eKP Legal Orchestrator\u003c/b\u003e\u003cbr/\u003e\u003ci\u003eintake + dispatch + handoff coordination\u003c/i\u003e\"]\n    \n    O --\u003e LRA[\"\u003cb\u003elegal-research-agent\u003c/b\u003e\u003cbr/\u003e일반 법률 질문\u003cbr/\u003e+ 게임 산업 규제\"]\n    O --\u003e DPA[\"\u003cb\u003edata-protection-agent\u003c/b\u003e\u003cbr/\u003e\u003ci\u003e이 레포\u003c/i\u003e\u003cbr/\u003eEU + KR + US-CA 프라이버시\"]\n    O --\u003e LWA[\"\u003cb\u003elegal-writing-agent\u003c/b\u003e\u003cbr/\u003e의견서 작성\u003cbr/\u003e+ DOCX 조립\"]\n    O --\u003e LTA[\"\u003cb\u003elegal-translation-agent\u003c/b\u003e\u003cbr/\u003eEN/KR 법률 번역\"]\n    O --\u003e CA[\"\u003cb\u003econtract-review-agent\u003c/b\u003e\u003cbr/\u003e계약 분석\"]\n    \n    DPA -.specialist handoff.-\u003e LRA\n    \n    style O fill:#1a237e,stroke:#1a237e,color:#ffffff\n    style DPA fill:#d1fae5,stroke:#059669,color:#065f46,stroke-width:3px\n    style LRA fill:#e3f2fd,stroke:#2196f3,color:#0d47a1\n    style LWA fill:#e3f2fd,stroke:#2196f3,color:#0d47a1\n    style LTA fill:#e3f2fd,stroke:#2196f3,color:#0d47a1\n    style CA fill:#e3f2fd,stroke:#2196f3,color:#0d47a1\n```\n\n**Subagent dispatch 컨트랙트.** Orchestrator 에서 호출되면, 에이전트는 `intake_payload` (질문 텍스트, 선택적 사전 분류 모드, 선택적 co-running agent 리스트, 출력 디렉토리) 를 읽고 두 컨트랙트 파일을 제공된 `output_dir` 에 작성. 에이전트는 다른 subagent 를 callback 호출 안 함; specialist handoff 은 메타의 `handoff_notes` 에 기록되어 orchestrator 가 후속 조치.\n\n**Standalone 사용.** `/answer` 직접 호출 시, 에이전트가 self-classify, `$OUTPUT_DIR` env (디폴트 `outputs/data-protection-agent/`) 에서 출력 디렉토리 선택, 동일한 두 컨트랙트 파일 + 한 줄 요약 생성.\n\n[`.claude/agents/data-protection-agent.md`](.claude/agents/data-protection-agent.md) 의 에이전트 정의는 `@`-import 로 `CLAUDE.md` 를 re-import 해서 standalone 과 subagent surface 가 절대 drift 안 하게 함.\n\n---\n\n## 라이선스\n\nApache 2.0 — [`LICENSE`](LICENSE) 참조.\n\n---\n\n## 면책사항\n\n이 도구는 **법률 리서치 보조 전용**이며, 법률 자문을 제공하지 않고, 변호사-의뢰인 관계를 형성하지 않으며, 자격 있는 법률 자문을 대체할 수 없습니다. 출력은 AI 가 생성한 결과이며, 내장 인용 감사기와 출력 검증기에도 불구하고 오류가 있을 수 있습니다. 본 도구가 생성한 모든 법적 인용은 전문적·규제적·소송 컨텍스트에서 의존하기 전에 **공식 source 를 통해 독립적으로 확인**해야 합니다. 프라이버시 법은 빠르게 진화합니다 — 시행일, 개정, 규제 가이드는 자주 변경됩니다.\n\n구체적인 법률 사안에 직면해 있다면, 해당 법역에서 자격을 갖춘 변호사에게 자문을 받으세요.\n\n---\n\n## 기여\n\nPR 을 열기 전에 [`CLAUDE.md`](CLAUDE.md) (에이전트 룰 + 법역 라우팅) 와 [`AGENTS.md`](AGENTS.md) (trust boundary 정책) 를 읽으세요. CI 가 통과해야 하고, 통합 auditor 가 새로운 example output 에 대해 `pass` (또는 `warn` 만) 를 보고해야 합니다.\n\n라운드별 개발 히스토리는 [`CHANGELOG.md`](CHANGELOG.md) 참조.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkipeum86%2Fdata-protection-agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkipeum86%2Fdata-protection-agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkipeum86%2Fdata-protection-agent/lists"}