# task-2617 — ANU v3 CLI OUTPUT PATH GUARD: Critical7 3건 공통 guard BOUNDED REMEDIATION (회장 직접 승인)

> **Lv**: Lv.4. **goal_type**: cli_output_path_guard_bounded_remediation. **Executor**: dev1-team 헤르메스 (key c38fb9955616e24d) 1회 한정 — task-2610/task-2616 원 executor(CLI 패턴·scan 정본 직접 인지). **TTL**: 3h. **상태**: 회장 결정 2026-05-19 — task-2616 scan ACCEPT 후 Critical7 3건 한정 공통 guard remediation 승인. 문서-only 금지. **callback: 반드시 독립 ANU key c119085addb0f8b7(executor self key c38fb9955616e24d 절대 금지·+49 코드 정본).**
> **scan 정본**: task-2616 산출(`memory/events/task-2616.scan-result.json`·`remediation-scope-proposal.json`). **+N 아님 — 독립 task.**

## 1. 목표 (회장 verbatim)

ANU v3 CLI output path Critical7 공통 guard bounded remediation. 범위는 task-2616이 확정한 Critical7 3건으로 한정.

## 2. 승인 범위 (회장 verbatim — 검출 3건 한정·변경 전 baseline sha256 기록)

guard 적용 대상 3건(arbitrary fs write Critical7):
- `anu_v3/batch_hold_adjudicator.py` `--output` write_text — 변경 전 sha256=`b255bb4223c22f2ee238b7461994a349917ef23e7504e93e6df7dd83136b03e7`
- `anu_v3/batch_dependency_classifier.py` `--out` write_text — 변경 전 sha256=`93ffc27e7cd3b59c082ad9fd67c4dac0d1a02e4900691ae6cb79304044c33f40`
- `anu_v3/pre_authorized_evidence_bundle_builder.py` `--out` write_text — 변경 전 sha256=`9344f9aa7bd37da9979e39222c782f8544f638b1d99f33bbdda0bff1514ea06a`

**stdout-only 3건(auto_remediation_planner·codex_high_classifier·critical7_classifier)은 guard 적용 대상 제외 — byte-0/동작 불변**. task-2611+1 label precedence 와 scope 혼합 절대 금지.

## 3. 필수 구현 산출물 (회장 verbatim — md 단독 금지)

- import-only Python guard 모듈 (`anu_v3/cli_output_path_guard.py`)
- output path policy yaml/json (`config/cli_output_path_policy.yaml`)
- 3개 CLI 호출부 guard 적용 (상기 §2 3파일)
- regression tests/fixtures (`tests/regression/test_cli_output_path_guard_2617.py`)
- scan 검출 fixture 또는 자동검출 테스트 (`memory/fixtures/task-2617.detected-pattern.json`)
- independent ANU collector 재검증 산출물 (`memory/events/task-2617.{decision,result}.json` · `memory/reports/task-2617.md`)

이 외 write 0. 검출 3건 외 임의 리팩터링 금지.

## 4. guard 조건 (회장 verbatim)

- guard 모듈 자체에 argparse/main/CLI 금지(import-only 순수)
- 기본 출력 stdout 유지
- 파일 출력은 policy 허용 경로만 가능
- CANONICAL_WS_ROOT(/home/jay/workspace) 기준 `memory/events` 또는 `memory/reports` 하위만 허용
- task-id prefix 강제
- absolute path · `../` traversal · workspace 이탈 · symlink · hardlink · overwrite 위험 **fail-closed**
- `Path.resolve()` strict-prefix 만으로 충분하다고 가정 금지
- component lstat · O_NOFOLLOW/O_EXCL · atomic write/rename 등 **TOCTOU 방어 포함**
- 실패 시 write 전 차단

## 5. 검증 조건 (회장 verbatim)

- 기존 task-2610/task-2613+1 remediation 과 충돌 없음 입증
- 동일파일 byte-0 anchor 재baseline = **이번 승인 범위 내 변경 전후 sha256 기록**(§2 변경 전 sha256 대비)
- expected_files/allowed artifact path 밖 write 불가 regression
- 기존 stdout-only 경로 byte-0 또는 동작 불변 확인
- Codex 재audit HIGH/CRITICAL 0
- independent ANU PASS

## 6. 금지 (회장 verbatim)

task-2611+1 precedence 수정 · +53/+54/+55/Track E · durable-success write-back · GitHub merge/real work 확장 · 검출 3건 외 임의 리팩터링 · stdout-only 3건 변경 · task-2611+1 scope 혼합 · executor self-callback/self-collector/self-adjudication/self-dispatch · PR/branch/main write·merge·credential · 문서-only 완료 · 기존 task-2553/task-2604 multitrack/task-2610~2616 산출물(§2 3파일 제외) byte-0 위반.

## 7. HOLD_FOR_CHAIR

shared invariant 파손 또는 신규 Critical7 = 전체 CHAIR_HOLD. 그 외 non-Critical 은 AUTO_REMEDIATION_HOLD 자동 수렴. 동결 유지: +53/+54/+55/Track E·durable-success write-back 금지(독립 ANU PASS & Codex HIGH/CRITICAL 0 후에도 본 task 는 guard remediation 완료 판정까지·write-back 은 회장 별도 승인 트리거).

## 8. callback (a) — 독립 ANU key 강제

구현 완료 후 normal completion callback **ANU key c119085addb0f8b7로만 발사** → 독립 ANU collector 회수·Codex 재audit·adjudication. executor self key c38fb9955616e24d callback/collector/adjudication/dispatch 절대 금지(+49 코드 정본·위반 시 CallbackRegistrationBlocked/SELF_COLLECTOR_FORBIDDEN). Codex 재audit HIGH/CRITICAL 0 & independent ANU PASS 가 guard remediation 완료 판정. +53/+54/+55/Track E·durable-success write-back 은 그 이후 회장 별도 승인 트리거(본 task 자동 진행 0). ANU fallback=ANU key·안전망 한정·진행 트리거 아님.

## 9. 9-R (확정 — 본 절 본문 우선)

**본 task md 는 dispatch 전 작업 명세(spec)이다.** §3 산출물(guard 모듈·policy·regression·fixture·result/decision/report)은 executor(dev1)가 생성할 deliverable 이며 spec 작성 시점 부재가 정상. §2 3파일이 변경 전 baseline sha256 과 일치하는 것도 미dispatch·미구현 상태의 정상 귀결. **lint 평가 기준 = "spec 이 검출 3건 한정·guard 조건·TOCTOU 방어·검증 조건·금지·동결·ANU-key callback 을 정확·완전·무모순으로 지시하는가"이지 "산출물이 이미 존재/구현됐는가"가 아니다.** ANU-Codex lint 1차 NEEDS_9R 은 spec lint 를 구현완료 검증으로 오적용한 것 — spec-vs-implementation 혼동(feedback-chair-directive-exactness 계열). 본 절 본문 우선으로 해소: spec 정합성 기준 재평가 시 GO_READY 확정 후 dispatch. ANU key 로 dev1 헤르메스 1회 위임.
