# task-2775+3 — PR #255 same-branch 보정: active+epoch 부재 fail-closed를 fire-capable flag 조합으로 재결선 (ACTIVE=false)

상태명: `TASK2775_PLUS3_FLAG_BASED_WIRING_MICROFIX_APPROVED_FOR_DEV2_ACTIVE_FALSE`
담당: dev2-team (PR #255 / branch `task/task-2775-dev2` 소유)
회장 승인: 2026-06-26 — **PR #255 같은 브랜치 보정용 +3 micro-fix 1회**.
★ 이 승인은 **merge / activation / real fire / systemd enable·start / flag 생성 / canary / recurring /
backlog consumption 승인이 아님.** ACTIVE=false · systemd disabled · flags OFF 유지.

## 배경 (ANU read-only audit)
+2의 fail-closed가 `activation_intended=True`에서만 발동하는데, 실제 운영 경로(entrypoint
`python3 -m dispatch.anu_pickup_driver` → `__main__` → `main()`)는 **`activation_intended=False`**로 돈다
(`ACTIVATION_INTENDED_WIRING_GAP`). ANU read-only audit
(`memory/reports/task2775p3_flag_based_limited_signal_readonly_audit_260626.md`):
`PLUS3_FLAG_BASED_WIRING_MICROFIX_READY`. fire-capable 상태를 **driver 내부 flag 조합**으로 판별하면
운영 경로에 정확히 걸리고 test-2760(파일 미생성·main 미경유)과 충돌하지 않음.

## 핵심 목표
실제 systemd/entrypoint 운영 경로가 `activation_intended=False`로 돌아도, **driver 내부에서 fire-capable
상태를 flag 조합으로 판별**하여, `p0b_activation_epoch` **부재/손상** 시 **governor·launcher build 이전에
fire 0으로 단락**하고 `p0b_driver_enabled`를 **atomic disabled** 처리
(`NOOP_ACTIVE_EPOCH_MISSING_AUTO_DISABLED`).

## ★ 권위 신호 (혼동 금지 — 회장 verbatim)
- **`p0b_driver_enabled == enabled` AND `p0b_callback_launch_enabled == enabled`**.
- 주의: **`p0b_event_strategy_enabled`는 live 분기 게이트**다. **`p0b_callback_launch_enabled`는 callback
  실발사 최종 게이트**다. 이번 +3 목적은 *fire-capable 상태에서 epoch 기준선 부재 차단*이므로
  **callback launch flag**를 기준으로 한다.
- ★ **callback flag 단독도, driver flag 단독도 금지.** 반드시 **두 flag AND 조합**.

## 구현 원칙
1. main()의 `limited_activation_bound_gate()` 호출부에서 `is_activated_fn`을
   `lambda: is_activated(CANONICAL_ROOT) and read_callback_launch_enabled(CANONICAL_ROOT)` 형태로 결선.
2. `read_callback_launch_enabled`는 driver에서 **안전하게 lazy import**(`dispatch.anu_callback_launch_audit`).
3. 두 flag 모두 enabled + `p0b_activation_epoch` 부재/손상 → `NOOP_ACTIVE_EPOCH_MISSING_AUTO_DISABLED` + fire 0.
4. callback flag 없거나 disabled → **legacy / default-OFF 경로 무손상**.
5. 기존 epoch-scope N 카운트 · `processed_at` timezone-aware 파싱 · 부재/파싱실패 보수적 제외 정책 **유지**.
6. N / T / kill 순서와 fire 0 단락 **무회귀**.
7. **test-2760 수정 금지.**

## 범위 (엄수)
- **PR #255 같은 브랜치(`task/task-2775-dev2`) 위 commit 추가**. **새 PR 생성 금지**(불가 시 STOP).
- expected_files **2개만**:
  - `dispatch/anu_pickup_driver.py`
  - `tests/regression/test_limited_activation_bounds_2775.py`
- **수정 금지**: **test-2760** / governor / runner / launcher / owner-proof / freshness / systemd /
  `.github/**` / `scripts/finish-task.sh`.
- **금지**: merge / activation / real fire / `systemctl enable·start` / activation flag 생성 / canary 주입 /
  recurring 등록 / backlog consumption.

## STOP 조건 (하나라도 → STOP_REPORT, 우회 0)
- **test-2760에 `main()` 직접 호출 케이스가 발견**되는 경우(현 audit상 부재 추정이나 구현 중 발견 시 즉시 STOP).
- **`read_callback_launch_enabled`가 fire-capable 최종 게이트와 다르게 동작하는 증거**가 있는 경우.
- expected_files 밖 수정 필요 / test-2760 수정 불가피 / 새 PR 불가피.
- governor / runner / launcher / owner-proof / freshness / systemd / `.github/**` / finish-task 수정 필요.
- activation / real fire / canary / systemd enable·start가 필요해지는 경우.

## 필수 테스트 (test_limited_activation_bounds_2775.py)
- **production main 실제 경로**: driver flag ON + callback flag ON + epoch **부재** → auto disabled + fire 0 +
  **governor/launcher 미호출**.
- driver flag ON + callback flag ON + epoch **손상** → auto disabled + fire 0.
- **callback flag OFF + epoch 부재 → legacy/default 경로 무손상**.
- **driver flag OFF + callback flag ON → default-OFF 무손상**.
- 기존 active+epoch 정상 N/T/kill 테스트 **무회귀**.
- **test-2760 무손상**.
- **2775 bounds 전체 PASS** · `py_compile` PASS · expected_files 밖 수정 **0**.

## 결과 보고 (필수)
- PR #255 **유지 여부** · base/head SHA · **expected_files 2개 내 diff 증거**.
- **flag 조합별 L1 결과**(driverON+callbackON+epoch부재/손상 / callbackOFF / driverOFF).
- **test-2760 결과** · **2775 bounds 결과**.
- ACTIVE=false / systemd disabled / flags OFF / real fire 0 / canary 0 증거.
- **MERGE_CANDIDATE 가능 여부**.

## 완료 처리 + ANU callback (필수)
- 완료 시 `memory/events/task-2775+3.done` + `memory/reports/task-2775+3.md`.
- 봇 idle 전 **ANU callback 필수**(성공/실패/blocked 무관). collector=ANU, owner_key=`c119085addb0f8b7`,
  self-key 금지. callback prompt UTF-8 **≤3900 bytes** (`printf '%s' "$P" | wc -c`), envelope 만
  (task_id·PR#255·new head sha·result_path·report_path·one-line). **merge 절대 금지.**
- PASS 나와도 **머지 금지** — ANU 독립검증 → fresh-head Gemini → CI 확인 → MERGE_CANDIDATE로만 보고.
  회장 명시 승인 전까지 PR #255 open 유지.

## 진행
dev2는 flag 조합 기반 fail-closed 재결선 구현·테스트(real fire 0)·로컬검증 후 branch push로
**PR #255 갱신**, 보고서 + .done + ANU callback으로 마감. ANU가 이후 독립검증/Gemini/CI 확인 → 회장 머지 판단.

## allowed_resources (본 task의 capability)

```yaml
allowed_resources:
  paths:
    - "dispatch/anu_pickup_driver.py"
    - "tests/regression/test_limited_activation_bounds_2775.py"
    - "memory/reports/task-2775+3.md"
    - "memory/events/task-2775+3.done"
  forbidden_paths:
    - ".github/**"
    - "memory/events/*.cron-*"
    - "scripts/finish-task.sh"
    - "tests/regression/test_*2760*.py"
    - "utils/spawn_safety_governor.py"
    - "dispatch/anu_result_pickup_runner.py"
    - "dispatch/anu_callback_launch_audit.py"
    - "dispatch/anu_owned_callback_enforcement.py"
    - "memory/state/p0b_driver_enabled"
    - "memory/state/p0b_callback_launch_enabled"
  commands:
    - "pytest"
    - "python3 -m py_compile"
    - "git"
    - "gh"
  merge_policy: "manual"
  ttl_hours: 24
```

## goal_assertions (auto-generated)
- `python3 -m dispatch.anu_pickup_driver`
