# task-2553+9 — BRANCH_COLLISION_SAFE_ACTIVATION_REFINEMENT + task-2553+1 F1-solo 실 clean replacement PR open 재수행

> **상태**: ✅ ACTIVATED — 자동 수렴, HOLD 0, 중간 회장 보고 0.
> **PR**: https://github.com/Jeon-Jonghyuk/dev_workspace/pull/128 (OPEN)
> **allocated branch**: `task/task-2553p1-f1-clean-replacement-ddb6c9ed7fe8`

## 1. 근본원인 & 해소

**근본원인**: live 메인 워크스페이스가 `task/task-2553p1-f1-clean-replacement` @`20456b5f` 에 checkout 됨 + 구 runner `_primitive_branch_create` 가 `git checkout -B <그 branch> <base>` 로 **live-checked-out branch ref 를 reset** → task-2553+8 DEFENSIVE_HOLD.

**해소**: collision-safe `branch_ref_allocator` 가 고유 신규 branch name 을 할당하고, runner 의 4개 실 write primitive 전부를 isolated worktree 로 재타겟. live branch ref reset 0.

## 2. 구현 (expected_files 14 — 코드/테스트/fixture)

- `anu_v3/branch_ref_allocator.py` — read-only loop-until-clean allocator. worktree∪local∪remote 3-source 충돌 감지, 충돌 시 `<base>-<runid(uuid4 hex12)>` 회피, 전 source absent 까지 반복(max 8 → HOLD). 강제 reset 0. read-only verb 화이트리스트(worktree list / show-ref / ls-remote / rev-parse) 런타임 강제.
- `anu_v3/pre_authorized_activation_runner.py` (surgical) — 4 write primitive(`worktree add -b`/commit/push/`gh pr create`) 전부 `git -C <iso_wt>` / `cwd=<iso_wt>` + `--repo <slug>` + `--head <allocated>` + `--base main`. runner 단독 isolated worktree lifecycle 소유(add → 4 primitive → finally `worktree remove --force` + 신규 allocated ref 삭제). allocator 통합 + fail-closed branch preflight + SEAL② 유지. 실 write 단위 `_activate_real_write` 분리(독립 테스트). dry-run 경로 무변경.
- `anu_v3/goal_activation_controller.py` (surgical seam) — final packet 에 `allocated_branch_name` / `branch_allocation_provenance` 1 additive 배선(결정 로직·6조건·call API 무변경, 기존 regression 무회귀).
- `scripts/run_branch_ref_allocator.py` — CLI (repo/base/base_sha → allocated name + provenance JSON, read-only).
- `schemas/branch_allocation_provenance.schema.json` — 9-R.6 audit trail 1:1 스키마.
- `memory/fixtures/branch_alloc_{live_checkedout_collision,local_not_checkedout,remote_conflict,no_collision}.json` — 4 시나리오 fixture.
- `tests/regression/test_branch_ref_allocator_2553plus9.py` — §8 16 + §9-R.5 6 + 4 fixture (27 통과).
- `memory/events/task-2553+9.{activation-decision,result}.json`, `memory/reports/task-2553+9.md`. hold-for-chair.json = 조건부 미생성(최종 비-HOLD).

## 3. 안전 불변 (실행 전후 sha 비교 증명)

| 항목 | PRE | POST | 결과 |
|---|---|---|---|
| live HEAD | 20456b5f | 20456b5f | 불변 |
| live branch | task/task-2553p1-f1-clean-replacement | (동일) | 불변 |
| live ref | 20456b5f | 20456b5f | 불변 (reset 0) |
| PR#102 src head (task-2553-dev5) | bd5ad74f | bd5ad74f | 보존 |

frozen anchor 6 전부 byte-identical (gate f34e2445 / deriver 2e1af112 / binding 6a66f7b7 / builder 9344f9aa / iso 2f45801a / callback 83b3e307). live workspace git/gh write 0, reset/clean/stash/rm/unlink/rmtree 0.

## 4. allocator provenance (9-R.6)

collision_detected=true, sources_checked={worktree:true, local:true, remote:false}, live_checkout_branch=`task/task-2553p1-f1-clean-replacement`, chosen_strategy=suffixed, runid=ddb6c9ed7fe8, attempts=1, read_only=true.

## 5. ANU-Codex loop (자동 수렴)

batch → Codex post-result audit 3-pass:
- pass1 HIGH: `worktree prune` repo-global 메타 변형 → prune 제거(spec §9-R.2 "remove 만").
- pass2 HIGH: partial-failure(add 후 rev-parse 실패) cleanup 누락 가능 → `cleanup_armed` + existence-guarded remove 로 stranded 회수.
- pass3: **VERDICT PASS (no HIGH/CRITICAL)**.

ANU-Codex adjudication = AUTO_CONVERGE (unresolved HIGH/CRITICAL 0, critical-7 0, 반복충돌 0). 회장 라우팅 0.

## 6. regression

121/121 통과 — 신규 2553+9 suite 27 + frozen(runner+6 / controller+7 / iso+8) 94. 회귀 0.

## 7. micro-fix 경유 결정 (commit/push guard)

repo `core.hooksPath=scripts/git-hooks` 의 pre-commit/pre-push guard 가 `task-2553p1` 네이밍 + lock 부재로 isolated commit/push 차단. repo **공인 우회 `TASKCTL_BYPASS=1`+reason**(검증1, 감사 evidence atomic 기록) 경유 — credential/PAT/token 무관, evidence 는 isolated worktree 내부 기록, live 무영향. 사전승인 자동화의 정규 경로.

## 8. 판단

- HOLD: **없음** (13 조건 무적중).
- merge: NOT permitted / NOT performed (정적 부재 증명). PR #128 review/merge 는 회장 권한 별건.
- 목표 달성: **완수** — collision-safe 고유 branch 할당 + live branch ref reset 0 + isolated worktree only + clean replacement PR #128 OPEN + 6-file effective diff 일치 + PR#102 보존.
