# task-2762 — P0B event-strategy LIVE owner_gate 시그니처 정합 micro-fix

## 목표 (1축만)
`scan_live_inbox_once` 의 `owner_gate_fn` 호출 계약과 `build_owner_gate_fn` 반환 `_gate` 시그니처를 정합시킨다. **이 1축 외 변경 금지.** 최소 수정.

## 배경 (결함 사실 — 회장 분류 2026-06-18)
WIRED_CANDIDATE 라이브 경로(`anu_pickup_driver.main` 2중 flag ON → `scan_live_inbox_once`)가 실제 `build_owner_gate_fn` 사용 시 항상 막힌다:
- `dispatch/anu_pickup_driver.py:1810` (scan_live_inbox_once): `gate = owner_gate_fn(p, executor_key=executor_key)` — **executor_key kwarg 전달**.
- `dispatch/anu_pickup_driver.py:1911` (main): `owner_gate_fn = build_owner_gate_fn(sealed_key_loader=..., executor_key="")`.
- `dispatch/anu_result_pickup_runner.py build_owner_gate_fn`: 반환 `def _gate(result_json_path)` — **위치인자 1개만**, executor_key kwarg 불수용 → 호출 시 `TypeError` → scan 의 except 포착 → 항상 `LIVE_PENDING_OWNER_PROOF`. callback fire 영구 미도달.
- 회귀테스트(`tests/regression/test_p0b_event_strategy_wiring_2760.py:258/276/303`)가 `owner_gate_fn=lambda *a, **k: _Gate(...)` permissive lambda 로 결함을 가렸고, 2a mock canary 도 mock owner_gate 사용으로 미노출. 2b′ 가 실 factory 로 라이브 첫 실행해 노출.

## 선호 수정 방향 (회장 verbatim)
1. **`build_owner_gate_fn` 반환 `_gate` 가 `executor_key` kwarg 를 안전하게 수용**하도록 보정하는 방향 우선 검토(scan 호출부 변경보다 우선). 즉 `_gate(result_json_path, *, executor_key=...)` 형태.
2. **self-key / self-collector 방어가 약해지면 안 된다.** owner proof 정책 확인 필수:
   - `owner_proof_pickup_gate` (anu_result_pickup_runner) ③단계: `if executor_key and runtime_key == executor_key:` → `FAIL_CLOSED_NON_ANU_KEY` (executor self-collector 차단). executor_key 는 **self-collector 방어 입력**이다.
3. **executor_key 를 무시할지, bound executor_key(factory)와 병합할지는 실제 owner proof 정책을 확인해 가장 보수적으로 결정**하라. 권고 분석: 비어있지 않은 call-time executor_key 가 들어오면 self-collector 체크에 반드시 반영(무시로 약화 금지). driver 경로는 둘 다 "" 이라 동작 동일해야 함(회귀 0). 단 구현은 executor가 코드 정책을 직접 확인해 결정.
4. **permissive-lambda식 무조건 통과(`lambda *a,**k: ready`)는 금지** — 실제 owner proof 평가가 일어나야 한다.

## 필수 테스트 (전부)
1. permissive lambda 가 **아니라 실제 `build_owner_gate_fn`** 을 사용한 `scan_live_inbox_once` 경로 테스트 추가.
2. 두 flag(주입/직접 호출 동등) 상태에서 `owner_gate_fn(p, executor_key=...)` 호출이 **TypeError 없이** owner gate 평가까지 도달.
3. gate ready(ANU owner proof) 케이스 → `LIVE_PENDING_OWNER_PROOF` 가 아니라 다음 단계(fire/move 경로)로 진행 가능.
4. self-key / foreign-key 케이스 → 여전히 fire 0 또는 pending 으로 **차단 유지**(self-collector 방어 보존 증명).
5. 기존 2a mock canary 관련 회귀(`test_p0b_event_strategy_2760.py`, `test_p0b_event_strategy_wiring_2760.py`)가 깨지지 않음.
6. 테스트에서 **real callback fire 발생 0** (fire_fn mock/미주입). systemd/cron/admin/activation side effect 0.

## 금지 (회장 verbatim)
- real callback fire 금지 · controlled adapter(permissive) 우회 금지 · activation 금지 · systemd enable 금지 · recurring cron 변경 금지 · admin override 금지 · ledger robustness/matching 착수 금지 · callback/result contract 확장 금지 · **expected scope 밖 수정 금지**.

## expected_files (이 외 변경 시 scope-violation)
- `dispatch/anu_result_pickup_runner.py` (build_owner_gate_fn 반환 _gate 시그니처 — 우선) **또는** `dispatch/anu_pickup_driver.py` (scan_live_inbox_once 호출부) 중 **정합에 필요한 최소 1곳**.
- `tests/regression/test_p0b_event_strategy_wiring_2760.py` (또는 신규 회귀 테스트 파일 1개) — 필수 테스트 추가.
- 그 외 파일·memory/·reports/·plans/ 혼합 금지 (runtime code PR only).

## forbidden_paths
- memory/, reports/, plans/, anu_callback/, envelope/, *.done, systemd unit, cron 설정, .env*, 그 외 dispatch 무관 모듈.

## doctrine (필수 준수)
- **runtime code PR only** — memory/reports/plans/artifact 혼합 금지(별도). 
- Gemini review 도착 후 **same-PR push/commit/amend 금지** (위반 시 Option A replacement 또는 OWNER_DECISION).
- **bot 의 `/gemini review` 코멘트 무효** — 인간 트리거만 유효. PR BLOCKED + Gemini 미도착 시 `GEMINI_REVIEW_TRIGGER_REQUIRED` 분류(Critical 아님).
- **long polling/CI 완료 대기 백그라운드 진입 금지.** PR open 후 CI/Gemini 직접 대기 금지 — 종료 전 ANU callback.
- **봇 종료 전 ANU callback 필수**(성공/실패/HOLD/blocked 무관). callback ≠ merge ≠ finish-task.
- **callback 은 독립 ANU key `c119085addb0f8b7` 로 발사**(executor self-key 금지·self-collector 금지). UTF-8 ≤3900 bytes envelope 만(task_id·result_path·report_path·sha256·collector_role=ANU·one-line summary).
- **merge 금지 · 2b′ 재실행 금지** — 별도 회장 승인 전까지. PR open 까지만.

## 산출물/보고 요구 (ANU callback envelope + report.md)
task id(task-2762) · 수정 파일 목록 · diff 요약 · owner_gate 시그니처 정합 방식 · **self-collector 방어 보존 근거** · 테스트 결과(6개) · CI/Gemini 상태 · real fire 0 · ACTIVE=false · 3 flag OFF 유지 · PR 번호.

## 목표 상태명
`P0B_EVENT_STRATEGY_OWNER_GATE_SIGNATURE_MICROFIX_PR_READY_ACTIVE_FALSE`

## allowed_resources (본 task의 capability)

```yaml
allowed_resources:
  paths:
    - "dispatch/anu_result_pickup_runner.py"
    - "dispatch/anu_pickup_driver.py"
    - "tests/regression/test_p0b_event_strategy_wiring_2760.py"
    - "tests/regression/test_p0b_event_strategy_2760.py"
    - "tests/regression/test_p0b_owner_gate_signature_2762.py"
  forbidden_paths:
    - "memory/**"
    - "reports/**"
    - "plans/**"
    - ".github/**"
    - "memory/events/*.cron-*"
    - ".env*"
    - "**/*.done"
  commands:
    - "pytest"
    - "python3 -m py_compile"
    - "python3 -m pytest"
  merge_policy: "manual"
  ttl_hours: 24
```
