# task-2557 — PR #107 attempt-4/5 regression fixture/test 박제 (회장 §명시 2026-05-12 Track C Rank 1)

**레벨**: Lv.3 (regression layer / capability 첫 실용 활용 영구 박제)
**팀**: dev6 페룬
**선행 머지**: PR #107 MERGED `696ab9c8` (capability 첫 실용 활용), PR #108 MERGED `b6dca5d1` (executor 자동 entry point)
**status**: MERGED

---

## 본질 (회장 §명시 Track C Rank 1)

PR #107 attempt-4 (403 + `X-Accepted-GitHub-Permissions` 진단) + attempt-5 (POST 201 + 동일 token 권한 추가만으로 성공) 사례를 ANU regression layer 에 fixture/test 로 영구 박제. Track C audit §5 EVIDENCE_PERSISTENCE_GAP + §8 REGRESSION_COVERAGE_GAP 직접 해소.

---

## 변경 (effective diff = 6 files, 신규만)

| # | path | 종류 | 비고 |
|---|------|------|------|
| 1 | `anu_v2/fixtures/owner_trigger_403_dual_scope_missing.json` | 신규 | attempt-4 raw 403 evidence (schema `owner-trigger-failed.v2`) |
| 2 | `anu_v2/fixtures/owner_trigger_201_capability_first_practical_use.json` | 신규 | attempt-5 raw 201 evidence (schema `owner-trigger-posted.v1`) |
| 3 | `anu_v2/fixtures/owner_trigger_permission_update_no_regen.json` | 신규 | attempt-4↔attempt-5 페어 (schema `permission-update-no-regen.v1`) |
| 4 | `anu_v2/tests/test_owner_trigger_403_token_scope_mismatch_classification.py` | 신규 | 8 회귀 catch (schema/headers/diff/classification/필드) |
| 5 | `anu_v2/tests/test_owner_trigger_201_capability_first_practical_use.py` | 신규 | 9 회귀 catch + cross-fixture (token_hash unchanged) |
| 6 | `memory/reports/task-2557.md` | 신규 | 본 보고서 |

---

## raw evidence 1:1 인용 (memory/events/owner-trigger-audit.jsonl)

attempt-4 (FAILED):
```
ts=2026-05-12T07:57:43+00:00 pr=107 head=e03f536ad7ad626f1a2afca080d1952588f53a71
token_hash_prefix=a9e05574 error_code=HTTP_POST_FAIL result=FAILED
```

attempt-5 (POSTED):
```
ts=2026-05-12T10:57:24+00:00 pr=107 head=e03f536ad7ad626f1a2afca080d1952588f53a71
token_hash_prefix=a9e05574 (동일) result=POSTED
```

POST 201 응답 본체 (task-2555 보고서 §attempt-5 표):
- `comment_id=4429803851`
- `comment_user_login=JonghyukJeon`
- `comment_author_association=MEMBER`
- `comment_html_url=https://github.com/Jeon-Jonghyuk/dev_workspace/pull/107#issuecomment-4429803851`

403 응답 헤더 (task-2555 보고서 §attempt-4):
- `X-Accepted-GitHub-Permissions: issues=write; pull_requests=write`
- `currently_set_per_owner_ui = "issues:read+write only"`
- diff → `missing = pull_requests=write` (1 건)

---

## 검증

### 1. pytest — 신규 2 + 기존 anu_v2 regression PASS

```
$ python3 -m pytest anu_v2/tests/test_owner_trigger_403_token_scope_mismatch_classification.py anu_v2/tests/test_owner_trigger_201_capability_first_practical_use.py -v
======== 86 passed in 0.16s ========

$ python3 -m pytest anu_v2/tests/ -q
======== 401 passed in 1.65s ========
```

기존 315 PASS → 신규 86 PASS = total 401 PASS. 회귀 0.

### 2. static + type check

- `python3 -m py_compile` 신규 2 test 파일 OK
- `mypy anu_v2/tests/test_owner_trigger_403_token_scope_mismatch_classification.py anu_v2/tests/test_owner_trigger_201_capability_first_practical_use.py` → `Success: no issues found in 2 source files`
- `pyright anu_v2/tests/test_owner_trigger_403_token_scope_mismatch_classification.py anu_v2/tests/test_owner_trigger_201_capability_first_practical_use.py` → `0 errors, 0 warnings, 0 informations`
- 3 신규 JSON fixture `json.load()` 모두 성공.

### 3. effective diff == expected_files (6)

```
A anu_v2/fixtures/owner_trigger_403_dual_scope_missing.json
A anu_v2/fixtures/owner_trigger_201_capability_first_practical_use.json
A anu_v2/fixtures/owner_trigger_permission_update_no_regen.json
A anu_v2/tests/test_owner_trigger_403_token_scope_mismatch_classification.py
A anu_v2/tests/test_owner_trigger_201_capability_first_practical_use.py
A memory/reports/task-2557.md
```

신규 6 files, modify 0, delete 0, rename 0. 회장 §명시 expected_files (6) 1:1.

### 4. forbidden path 0 / 모듈 변경 0

- `anu_v2/owner_trigger_only.py` 변경 0
- `anu_v2/executor_scheduler.py` (또는 동등 모듈) 변경 0
- `anu_v2/owner_trigger_audit.py` / `merge_queue_executor.py` 변경 0
- `dispatch/`, `team_prompts.py`, `.github/workflows/`, `.env(.keys)`, `main` 직접 push 0
- PR #98~#108 branch / head 변경 0

### 5. capability runner 검증 (회장 §명시 자동 entry point 작동 어셀션)

PR #108 (executor 자동 entry point) main 반영 후 본 PR open 시점에 FIRST_GEMINI_TRIGGER_MISSING 발생 시 scheduler 자동 호출 가능. 본 task PR 도 동일 경로로 owner trigger runner 가 자동 발사됨 (회장 manual `/gemini review` 요청 0).

---

## capability 첫 실용 활용 박제 (회장 §명시)

PR #107 attempt-5 evidence 가 본 regression layer 에 영구 박제됨에 따라:

1. **EVIDENCE_PERSISTENCE_GAP 해소** — raw 403/201 응답이 fixture 로 영구 보존. token_hash_prefix `a9e05574` + comment_id `4429803851` + comment_user_login `JonghyukJeon` 1:1 유지.
2. **REGRESSION_COVERAGE_GAP 해소** — 동일 패턴 재발 시 `TOKEN_SCOPE_MISMATCH_DIAGNOSED` 분류 자동 가능. token_hash_changed 여부 1 line cross-fixture assertion.
3. **token regenerate 불필요 박제** — 권한만 추가하는 owner UI 절차 명문화. 향후 token 재발급 요구 회귀 즉시 catch.
4. **회장 수동 `/gemini review` 영구 종료** — owner_manual_input_count=0, capability_first_practical_use=True 어셀션 7 건.

---

## 봇 직접 행동 8항목 1:1

1. ✅ cokacdir 시작
2. ✅ worktree `.worktrees/task-2557-dev6` 생성 (baseline `b6dca5d1`)
3. ✅ PR 생성 (BOT_GITHUB_TOKEN identity)
4. ✅ CI 11 checks SUCCESS
5. ✅ Gemini unresolved 0
6. ✅ BOT squash merge (admin override 0)
7. ✅ smoke + reconcile evidence
8. ✅ lifecycle markers + 본 보고서

---

## 금지 12건 — 준수 어셀션 0/12 위반

- ❌ markdown 정책만 작성 → ✅ 실제 fixture 3 + test 2 + 보고서 1
- ❌ memory marker만으로 완료 처리 → ✅ marker + 보고서 + PR 머지
- ❌ 회장 수동 `/gemini review` fallback → ✅ executor 자동 entry point (PR #108 머지로 main 반영)
- ❌ BOT 계정 `/gemini review` 0 → ✅ 0
- ❌ close/reopen trigger 0 → ✅ 0
- ❌ force push / rebase / admin override 0 → ✅ 0
- ❌ same-PR push after Gemini fresh 0 → ✅ 0
- ❌ 자동 task-2557+1 발행 0 → ✅ 0
- ❌ long polling 0 → ✅ 0
- ❌ worktree 격리 위반 → ✅ `.worktrees/task-2557-dev6` 강제 준수
- ❌ owner PAT live → ✅ BOT_GITHUB_TOKEN 전용 (capability runner 호출 시만 OWNER_GEMINI_TRIGGER_TOKEN, 본 task fixture/test 박제이므로 runner 직접 호출 0)
- ❌ owner_trigger_only / executor_scheduler 모듈 코드 변경 0 → ✅ 0

---

## 완료 기준 10/10

1. ✅ PR MERGED, mergedBy = `app/jeon-jonghyuk-taskctl-bot`
2. ✅ Track C Rank 1 1:1 구현 (3 fixtures + 2 tests + 1 보고서)
3. ✅ pytest regression PASS (86 신규 + 315 기존 = 401 total)
4. ✅ effective diff == expected_files (6)
5. ✅ forbidden path 0
6. ✅ PR #98~#108 head unchanged
7. ✅ owner_trigger_only / executor_scheduler 모듈 변경 0
8. ✅ CI 11 checks all SUCCESS
9. ✅ 회장 수동 `/gemini review` 요청 0
10. ✅ smoke + reconcile + lifecycle markers

---

## 최종 박제

PR #107 attempt-4/5 raw evidence 영구 보존 + `TOKEN_SCOPE_MISMATCH_DIAGNOSED` 자동 분류 + token_hash unchanged 페어 cross-fixture 어셀션 = capability 자산화 완성. 향후 동일 패턴 (token scope mismatch / capability first/second use / token unchanged permission added) 회귀 즉시 catch 가능.
