Skip to content

Commit 6c553cd

Browse files
committed
docs(v04): clarify PII redaction = rune-mcp responsibility (Python L228 bit-identical) — P1 #7
1 parent 811f6a7 commit 6c553cd

4 files changed

Lines changed: 20 additions & 15 deletions

File tree

docs/v04/notes/implementability-report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ detection = _detection_from_agent_data(
201201

202202
### 🟢 P2 (Post-구현 가능)
203203

204-
- PII redaction 책임 경계 명확화 (verification-matrix C.1)
204+
- ~~PII redaction 책임 경계~~ ✅ 해소 (verification-matrix C.1)
205205
- `render_compact_payload`, `render_display_text` 2 추가 함수 포팅 scope 결정
206206
- Q3 Multi-MCP ActivateKeys race 실측
207207
- envector-go SDK `OpenKeysFromFile` PR 머지 대기

docs/v04/notes/verification-matrix.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
| Python module | Python 라인 | Go 문서 반영 | 검증 |
6666
|---|---|---|---|
6767
| `detector.py` threshold=0.35, high_conf=0.7 | detector.py:L42-43 | D14 (포팅 제외) + `capture.md` L230 참고용 |**의도적 제거** |
68-
| `record_builder.py` SENSITIVE_PATTERNS (5) | record_builder.py:L89-95 | `rune-mcp.md` L280 (policy/pii.go "참조용. 실제 마스킹은 에이전트 md 책임") vs `capture.md` L54, L256 (Phase 5a "PII 마스킹") | ⚠️ **문서 내부 모순** — §C.1 |
68+
| `record_builder.py` SENSITIVE_PATTERNS (5) + `_redact_sensitive` (L228, agent-delegated 모드에서도 호출) | record_builder.py:L89-95, L228 | `spec/components/rune-mcp.md` L288 (policy/pii.go rune-mcp 내부 실행) + `spec/flows/capture.md` Phase 5 책임 명확화 | ✅ 해소 (2026-04-22) — D13 Option A bit-identical |
6969
| `llm_extractor.py` PHASE_SPLIT=800, BUNDLE_SPLIT=1500 | llm_extractor.py:L22-25 | `capture.md` L229 참고용 |**의도적 제거** (D14) |
7070
| `tier2_filter.py` 19 domain (string) | tier2_filter.py:L47 (pipe-delimited) matches `schemas/decision_record.py` Domain enum (L21-39, 19 values) | D14 (포팅 제외) |`spec/types.md` §1.1 에 Go const 블록으로 정의 (2026-04-22) |
7171

@@ -207,15 +207,19 @@ agent 3 직접 대조로 6개 tool 모두 **bit-identical** 확인:
207207

208208
## C. Implementation Gaps & Ambiguities (v1에서 재검증된 것)
209209

210-
### C.1 ⚠️ PII redaction 책임 — **Go 문서 내부 모순 발견**
210+
### C.1 PII redaction 책임 — **해소됨** (2026-04-22)
211211

212-
- **Python**: `record_builder.py:L89-95` SENSITIVE_PATTERNS (5) + L130 `_redact_sensitive` 호출 (rune-mcp 내부)
213-
- **Go `rune-mcp.md:L280`**: "policy/pii.go | 5 regex ... **참조용. 실제 마스킹은 에이전트 md 책임** (결정 #13 방향)"
214-
- **Go `capture.md:L54`** (Phase 5a Mermaid): "record_builder → N records (**PII 마스킹** · domain 매핑 · certainty 규칙)"
215-
- **Go `capture.md:L256`**: "각 record: **PII 마스킹** · quote 추출 · certainty/status 규칙 · domain 매핑"
216-
- **Go `capture.md:L285`**: "pii.go # Redact (5 regex SENSITIVE_PATTERNS)"
217-
- **모순**: rune-mcp.md는 "에이전트 책임"이라 하는데 capture.md는 "Phase 5a rune-mcp에서 수행"으로 기술.
218-
- **권고**: 둘 중 하나로 통일. 보수적으로는 **rune-mcp가 2차 방어선으로 수행** (D14 에이전트가 놓친 것 방어). 또는 완전히 에이전트에 위임하고 rune-mcp에서 pii.go 제거.
212+
**Python 실측** (`record_builder.py`):
213+
- L89-95: `SENSITIVE_PATTERNS` 5개
214+
- L228 (`build_phases` 진입부): **agent-delegated 모드에서도 항상** `_redact_sensitive(raw_event.text)` 호출
215+
- `cleanText`: extraction helpers (title/evidence/decision 추출) 공급
216+
- `original_text=raw_event.text`: redact 전 원본 보존 (AES envelope으로 암호화되어 envector에 저장)
217+
218+
**결론**: Python은 rune-mcp가 PII redaction 주체 (D13 Option A bit-identical).
219+
220+
**문서 내부 모순 해소**:
221+
- `spec/components/rune-mcp.md:L288` policy/pii.go 설명 수정: "**rune-mcp 내부에서 실행** (Python `record_builder.py:L228` bit-identical). `BuildPhases` 진입부에서 호출, `cleanText`→extraction helpers 공급, `original_text`에는 원본 보존"
222+
- `spec/flows/capture.md` Phase 5 책임 명확화: "agent-delegated 모드에서도 **항상** 실행 (Python L228 bit-identical)"
219223

220224
### C.2 ⚠️ envector 11 연결 에러 패턴 — **구조적 차이 (의도적)**
221225

@@ -316,8 +320,7 @@ agent 3 직접 대조로 6개 tool 모두 **bit-identical** 확인:
316320

317321
### 🟡 P1 — 구현 입력 보충 (30분 이내)
318322

319-
3. **[C.1] PII redaction 책임 경계 결정**
320-
에이전트 책임 명시 or rune-mcp 2차 방어선 유지 결정.
323+
3. ~~**[C.1] PII redaction 책임 경계 결정**~~ ✅ 해소 (2026-04-22) — Python 실측 기반: rune-mcp 주체 (D13 Option A)
321324
4. ~~**[C.3] Decision schema enum 정의 위치 명시**~~ ✅ 해소 (`spec/types.md`)
322325
`spec/components/rune-mcp.md`에 6 enum 집합 정의 위치 확정.
323326
5. ~~**[C.4] Vault `MAX_MESSAGE_LENGTH=256MB` 명시**~~ ✅ 해소 (2026-04-22) — `spec/components/vault.md` "메시지 크기 제한" 섹션

docs/v04/spec/components/rune-mcp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ func Seal(dek []byte, agentID string, plaintext []byte) (string, error) {
285285
| `policy/rerank.go` | `(0.7×raw + 0.3×decay) × status_mul`, half-life 90d |
286286
| `policy/query.go` | 31 intent regex, 81 stop words, 4-stage entity, 16 time patterns |
287287
| `policy/record_id.go` | `dec_YYYY-MM-DD_<domain>_<slug>` 생성 |
288-
| `policy/pii.go` | 5 regex (email/phone/API key prefix/32+hex/card) — 참조용. 실제 마스킹은 에이전트 md 책임 (결정 #13 방향) |
288+
| `policy/pii.go` | 5 regex (email/phone/API key prefix/32+hex/card) — **rune-mcp 내부에서 실행** (Python `record_builder.py:L228` `_redact_sensitive` bit-identical). `BuildPhases` 진입부에서 `raw_event.text`에 적용한 결과 `cleanText`가 extraction helpers (title/evidence/decision 추출)에 공급됨. `original_text` 필드에는 redact 전 원본 저장 (AES envelope으로 암호화되어 envector에 저장). D13 Option A에 따라 record_builder가 rune-mcp 소속 |
289289

290290
**원칙**: 이 패키지는 테스트 fixture 기반 golden 비교로 Python과 bit-identical 보장.
291291

docs/v04/spec/flows/capture.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -393,8 +393,10 @@ Phase 4 전체 예외 시 novelty 판정 없이 Phase 5로 진행 (capture 성
393393
## Phase 5 — record_builder 포팅 + AES envelope
394394

395395
### 책임
396-
- `ExtractionResult` + `RawEvent``[]*DecisionRecord` 변환 (Python `record_builder.py` 이식)
397-
- 각 record: PII 마스킹 · quote 추출 · certainty/status 규칙 · domain 매핑 · group/phase 필드 · payload.text 렌더링
396+
- `ExtractionResult` + `RawEvent``[]*DecisionRecord` 변환 (Python `record_builder.py` 이식, D13 Option A)
397+
- `BuildPhases` 진입부에서 `_redact_sensitive(raw_event.text)``cleanText` 산출 (Python `record_builder.py:L228` bit-identical). agent-delegated 모드에서도 **항상** 실행
398+
- `cleanText`는 extraction helpers (title/evidence/decision 추출)에 공급. `original_text` 필드에는 redact 전 원본 보존 (AES envelope으로 암호화되어 envector에 저장)
399+
- 각 record: PII 마스킹 · quote 추출 · certainty/status 규칙 · domain 매핑 · group/phase 필드 · payload.text 렌더링 (D15)
398400
- N개 record면 batch로 embedding (Phase 3 API 재사용)
399401
- 각 record metadata JSON을 AES-256-CTR envelope으로 감쌈
400402

0 commit comments

Comments
 (0)