---
schema_version: "1.0"
task_id: task-2569
created: 2026-05-13
updated: 2026-05-13
approved_by: 회장 (drumband@gmail.com)
change_requires: 회장 승인 필수 — 변경 전 task 박제 후 회장 confirm 득
status: active
---

# Protection List — 워크스페이스 파일 보호 정책

> **박제 사유 (task-2569)**: 2026-05-13 task-2568 Phase B 진행 중 cleanup 스크립트
> 두 곳(`scripts/cleanup-workspace.py`, `scripts/file_cleanup.py`)에 보호 경로가 분산
> 하드코딩되어 있어 task md / 3-docs 소실 사건이 발생함. 본 파일은 단일 진실 소스(Single
> Source of Truth)로 도입되었으며, 모든 cleanup 스크립트는 이 파일을 로드하여 사용해야 한다.

---

## 사용처

본 정책이 적용되는 스크립트 목록:

- `scripts/cleanup-workspace.py` — `load_protection()` 함수로 `protection-list.json` 로드
- `scripts/file_cleanup.py` — `SafetyChecker.__init__()` 에서 `protection-list.json` 로드
- `scripts/cleanup-stale-tasks.sh` — audit log 기록 시 참조

---

## 변경 정책

**본 파일 및 `protection-list.json` 변경 시 반드시 회장 승인 필요.**

- 변경 이유를 task md에 박제 후 회장 confirm 득한 뒤 수정
- 임의 경로 추가/제거 금지
- cleanup 스크립트 코드 내 하드코딩 추가 금지 (이 파일에만 명시)

---

## protected_paths

절대 삭제 금지 디렉토리/파일 glob. cleanup 데몬/스크립트가 이 경로를 삭제 대상으로 선정해서는 안 된다.

```yaml
protected_paths:
  # task md — 모든 task 마크다운 파일
  - "memory/tasks/"

  # 3문서 디렉토리 — plan/context-notes/checklist
  - "memory/plans/tasks/"

  # 보고서 디렉토리
  - "memory/reports/"

  # 스펙/사양 문서
  - "memory/specs/"

  # 미팅 기록
  - "memory/meetings/"

  # 리서치 기록
  - "memory/research/"

  # 팀 역량 문서 (회장 명시 forbidden)
  - "memory/capabilities/"

  # event 취소 마커 — cleanup 금지
  - "memory/events/*.cancelled"

  # event escalated 마커 — cleanup 금지
  - "memory/events/*.done.escalated"

  # lock 파일 — 실행 중 task 잠금
  - ".tasks/locks/"

  # push 증거 파일
  - ".tasks/evidence/"
```

### 보호 파일 (절대 경로 기준)

```yaml
protected_files:
  - "CLAUDE.md"
  - "MEMORY.md"
  - ".env"
  - ".env.keys"
  - "task-timers.json"
  - "token-ledger.json"
  - "organization-structure.json"
```

---

## preserved_lifecycle_paths

cleanup이 30분 후라도 자동 escalate 처리 금지 경로 (AD-6 정책).

> **AD-6 근거**: PR merge 직후 done marker / reconcile-evidence.json 는 post-merge
> evidence consistency check 전까지 stale 취급되면 안 됨. 현재 done-watcher.sh의
> 30분 자동 escalated 정책이 이 경로에 적용되지 않도록 별도 보존.
> 실 watcher 수정은 별도 task로 escalate (본 task에서는 정책 명시만).

```yaml
preserved_lifecycle_paths:
  # PR merge 직후 done marker
  - "memory/events/*.done"

  # merge 증거 파일
  - "memory/events/*.reconcile-evidence.json"
```

---

## cleanup_audit_log_path

모든 cleanup 스크립트가 삭제 후보/실제 삭제/보호 스킵 기록을 남기는 단일 audit log 경로.

```yaml
cleanup_audit_log_path: "memory/logs/cleanup-audit.jsonl"
```

JSONL 포맷 (1줄 = 1 JSON 레코드):

```json
{"ts": 1715600000.0, "candidate": "memory/tasks/task-9999.md", "action": "skipped_protected", "reason": "protected_path: memory/tasks/"}
{"ts": 1715600001.0, "candidate": "memory/events/task-9999.done.clear", "action": "deleted", "reason": "age>30d"}
```

---

## 머신 파싱

본 파일의 머신 파싱 버전: `memory/specs/protection-list.json`

Python import 예시:

```python
import json
from pathlib import Path

cfg = Path("/home/jay/workspace/memory/specs/protection-list.json")
protection = json.loads(cfg.read_text(encoding="utf-8"))
protected_paths = protection["protected_paths"]
protected_files = protection["protected_files"]
```
