# task-2628 — ANU_V3_DEPENDENCY_CLOSURE_INDEPENDENT_VALIDATION (B안 선행)

- **task_id**: task-2628
- **work_level**: Lv.3 (anu_v3 core dependency closure 독립 검증 · import isolation)
- **dispatched_by**: ANU (회장 결정 2026-05-21 B안 — dependency closure 선행)
- **assignee**: dev6 페룬 (ANU v3 context 연속 — task-2623~2627)
- **base_audit_doc**: memory/events/task-2627.anu_v3_dependency_closure_audit.json
- **관계**: task-2627 callback reflection 의 **선행 dependency PR**. callback reflection 과 섞지 말 것.

---

## 0. PRE-DISPATCH SPEC (회장 verbatim 박제 · D-SPEC-EXACTNESS · paraphrase 금지)

회장 verbatim (2026-05-21):

> anu_v3 dependency closure는 B안으로 진행한다.
> 목표: callback enforcement가 의존하는 anu_v3 12개 모듈을 origin/main 반영 가능한 production dependency로 검증한다. 단, callback reflection과 섞지 말고 anu_v3 core dependency closure만 독립 task로 처리한다.

판정: task-2627 = REFLECTION_READY_BUT_NOT_INTEGRATION_READY 확정. 3 original risk closure PASS 인정하나 anu_v3 12개 origin/main 부재로 production integration 불가. main 반영 전 production enforcement 완료 판정 금지.

---

## 1. 대상 anu_v3 12개 (회장 verbatim · baseline blob 앵커)

- `anu_v3/active_dispatch_scanner.py` (143 lines · blob 474b2c5c)
- `anu_v3/authoritative_verdict_selector.py` (314 lines · blob 8be9bc04)
- `anu_v3/callback_4tuple_registry.py` (294 lines · blob e9b5c8b5)
- `anu_v3/callback_owner_validator.py` (184 lines · blob fcd91f33)
- `anu_v3/dispatch_callback_contract.py` (554 lines · blob db9a690a)
- `anu_v3/executor_callback_contract.py` (142 lines · blob c618f7eb)
- `anu_v3/runtime_batch_state_updater.py` (174 lines · blob 9e405cdf)
- `anu_v3/runtime_next_action_resolver.py` (154 lines · blob 7f93a3d6)
- `anu_v3/runtime_reconcile_checkpoint.py` (407 lines · blob 5a7151fc)
- `anu_v3/runtime_reconcile_checkpoint_recovery_layer.py` (81 lines · blob eea23b3e)
- `anu_v3/self_collector_guard.py` (194 lines · blob 3eca87b8)
- `anu_v3/task_artifact_detector.py` (135 lines · blob 9c2cde3d)

**baseline (ANU 사전 audit)**: 12개 전부 origin/main MISSING · main workspace untracked(NO_COMMIT) · working-tree only. ANU v3 이전 작업(task-2553/2604 계열) 산물 · BOT App token 부재로 push/merge 0.

---

## 2. 필수 확인 (회장 verbatim · 11항목)

1. 12개 파일의 실제 경로와 import graph 확정
2. direct / transitive dependency 구분
3. origin/main 부재 여부 확인
4. local-only / untracked / NO_COMMIT provenance 확인
5. 각 파일이 callback runtime enforcement에 필요한 최소 dependency인지 확인
6. 12개 외 추가 dependency가 있는지 import isolation 환경에서 확인
7. conftest.py sys.path 주입 없이 import 가능한지 검증
8. production ImportError 가능성 제거
9. credential / permission expansion 0
10. forbidden path 0
11. anu_v2 / replacement_pr_runner / merge_queue / task-2619 / task-2625 산출물 무변경

---

## 3. 필수 regression (회장 verbatim · 8건)

test 파일: `tests/regression/test_anu_v3_dependency_isolation_2628.py` (신규) · import isolation 중심 · 실 cron/발사 0 · subprocess 0

1. anu_v3 12개 단독 import test
2. conftest WORKSPACE_ROOT sys.path 제거 환경 import test
3. callback enforcement 모듈이 origin/main + anu_v3 12개만으로 import 가능한지 test
4. missing anu_v3 dependency가 있으면 FAIL
5. self_collector result가 authoritative로 승격되지 않는지 test
6. callback owner validator가 ANU-key / executor self-key를 구분하는지 test
7. dispatch callback contract schema validation test
8. runtime reconcile/checkpoint 계층이 file side effect 없이 dry-run 가능한지 test

---

## 4. 금지 (회장 verbatim)

- callback reflection 파일 수정 금지 (dispatch/callback enforcement — task-2627 영역)
- task-2627 worktree 수정 금지
- push / PR open / merge 금지, 회장 승인 전 금지
- credential raw exposure 금지
- OWNER PAT 조작 금지
- anu_v2 수정 금지
- replacement PR runner 수정 금지 (utils/replacement_pr_runner.py)
- merge queue 수정 금지 (utils/merge_queue_executor.py)
- task-2619 수정 금지
- task-2625 산출물 삭제 금지
- conftest false-pass를 근거로 PASS 판정 금지
- production enforcement 완료 판정 금지

---

## 5. expected_files

- `anu_v3/` 12개 (위 §1 목록 · git add 대상 — origin/main 반영 가능 상태로)
- `tests/regression/test_anu_v3_dependency_isolation_2628.py` (신규 · 8 regression)
- (추가 transitive dependency 발견 시) closure 재계산 후 회장 보고 — expected_files 밖 대규모 확장이면 CHAIR_HOLD

**callback enforcement(dispatch/) 파일은 read-only 참조만** (regression #3 검증용 · 수정 0 · task-2627 영역).

---

## 6. ★ import isolation 환경 (회장 핵심 — conftest false-pass 차단)

- conftest.py L18-20 `sys.path.insert(0, WORKSPACE_ROOT)` 가 working-tree untracked anu_v3 를 import 가능케 해 false-pass 유발.
- 본 task 의 import isolation regression 은 **conftest sys.path 주입 없이** (또는 fresh origin/main + anu_v3 12개만 있는 환경) import 검증.
- conftest false-pass 결과를 PASS 근거로 쓰지 말 것 (회장 verbatim).
- 12개 외 추가 anu_v3 dependency 가 import 실행에서 나오면 → closure 재계산 + 회장 보고.

---

## 7. baseline 3-way + artifact visibility

- 12개 anu_v3 working-tree blob (§1 앵커) 작업 시작 전 `git hash-object` 재확인.
- 12개는 origin/main 부재가 정상 (NO_COMMIT) — "파일 부재" HOLD 금지 (live workspace 기준 · feedback_artifact_visibility_contract).
- 봇은 12개를 git add 하여 origin/main 반영 가능 상태로 (단 push/PR/merge 0 · 회장 승인 대기).

---

## 8. 14단계 finalize + 8 직접 행동 (요약 · App token 부재 대응)

1. expected_files 정확 일치 (anu_v3 12 + test) 2. forbidden_paths 검증 (callback reflection/anu_v2/replacement/merge_queue/task-2619/task-2625 무변경) 3. regression 8건 PASS (import isolation 중심) 4. 전체 suite 회귀 0 5. lint/type check 6. commit (BOT identity · anu_v3 12 git add · token raw 0) 7. push 시도 (App token 부재 시 로컬 commit 유지) 8. PR (App token 부재 시 skip · ANU 콜백 보고) 9~13. (App token 부재 시 로컬 검증) 14. 자기 callback ANU key(c119085a) 시도 + result.json 9 fields

봇 직접 행동: forbidden 탐지 시 Critical7+halt · credential 평문 0 · BOT App token만 · self-collector NON_AUTHORITATIVE · callback ANU key 시도(self-key 위험 잔존 인지).

---

## 9. callback contract 9 fields (result.json) — 정책 (a) STANDARDIZED

callback_prompt_utf8_bytes / callback_prompt_chars / callback_cron_id / callback_registration_status / callback_role(COLLECTOR_ANU) / envelope_only_compliance / fallback_prompt_utf8_bytes / fallback_safety_net_registered / fallback_safety_net_role_single_purpose(RECOVERY_ONLY_NO_FINAL_REPORT_TRIGGER). callback prompt UTF-8 ≤3900 bytes envelope-only.

---

## 10. 완료 보고 (회장 verbatim · 9항목)

1. anu_v3 12개 파일 목록
2. import graph
3. origin/main missing 확인
4. provenance / NO_COMMIT 여부
5. import isolation regression 결과 (8건)
6. callback enforcement와의 dependency compatibility
7. forbidden / credential / scope 결과
8. PR 반영 가능 여부
9. 다음 단계: callback reflection PR 진행 가능 여부

---

## 11. 판정 기준 (회장 verbatim)

- 12개가 독립 regression과 import isolation을 통과하면 **ANU_V3_DEPENDENCY_READY**.
- 추가 dependency가 나오면 closure를 재계산하고 보고.
- expected_files 밖 대규모 확장이 필요하면 **CHAIR_HOLD**.
- 12개가 검증되기 전에는 task-2627 callback reflection을 main 반영하지 말 것.

---

## 12. doctrines (필수)

- anu_v3 core dependency closure 독립 처리 (callback reflection 과 분리 — B안)
- conftest false-pass 차단 (import isolation 환경 검증)
- closure 재계산 트리거 (12개 외 추가 dependency 발견 시)
- self-collector / self_collector result NON_AUTHORITATIVE
- baseline 3-way blob + artifact visibility (NO_COMMIT 정상)
- attempt-1 only · 추가 dependency 대규모 확장 시 CHAIR_HOLD
- 본 task 자체 callback self-key 위험 잔존 (reflection 미반영) → ANU 독립 재검증 필수

---

## allowed_resources (본 task의 capability)

```yaml
allowed_resources:
  paths:
    - "anu_v3/active_dispatch_scanner.py"
    - "anu_v3/authoritative_verdict_selector.py"
    - "anu_v3/callback_4tuple_registry.py"
    - "anu_v3/callback_owner_validator.py"
    - "anu_v3/dispatch_callback_contract.py"
    - "anu_v3/executor_callback_contract.py"
    - "anu_v3/runtime_batch_state_updater.py"
    - "anu_v3/runtime_next_action_resolver.py"
    - "anu_v3/runtime_reconcile_checkpoint.py"
    - "anu_v3/runtime_reconcile_checkpoint_recovery_layer.py"
    - "anu_v3/self_collector_guard.py"
    - "anu_v3/task_artifact_detector.py"
    - "anu_v3/__init__.py"
    - "tests/regression/test_anu_v3_dependency_isolation_2628.py"
    - "memory/events/task-2628.result.json"
    - "memory/reports/task-2628.md"
    - "memory/tasks/task-2628.md"
  forbidden_paths:
    - "dispatch/normal_fallback_callback_helper.py"
    - "dispatch/callback_owner_enforcer.py"
    - "dispatch/cron_dispatch_guard.py"
    - "dispatch/executor_completion_contract.py"
    - "dispatch/spec_template_validator.py"
    - "scripts/finish-task.sh"
    - "prompts/DIRECT-WORKFLOW.md"
    - "utils/replacement_pr_runner.py"
    - "utils/merge_queue_executor.py"
    - "anu_v2/**"
    - "memory/tasks/task-2619.md"
    - "memory/events/task-2625.*"
    - ".github/**"
    - ".env*"
    - "*.pem"
    - "*.key"
  commands:
    - "pytest"
    - "python3 -m py_compile"
    - "ruff"
    - "git"
  merge_policy: "manual"
  ttl_hours: 24
```

## 13. 산출물

- anu_v3 12개 git add (origin/main 반영 가능 상태 · 로컬 commit · push 0)
- `tests/regression/test_anu_v3_dependency_isolation_2628.py` (8 regression · import isolation)
- (추가 dependency 발견 시) closure 재계산 보고
- `memory/events/task-2628.result.json` (9 fields + 9항목 + ANU_V3_DEPENDENCY_READY 여부)
- `memory/reports/task-2628.md`

## 14. callback envelope (참고)

```
task_id=task-2628
result_path=memory/events/task-2628.result.json
report_path=memory/reports/task-2628.md
sha256=<task md sha256>
collector_role=ANU
owner_key=c119085addb0f8b7
canonical_root=/home/jay/workspace
summary=ANU_V3_DEPENDENCY_CLOSURE_INDEPENDENT_VALIDATION result · ANU_V3_DEPENDENCY_READY 여부 · 9항목 result.json 참조
```

끝