# Team-Lead / Subagent Usage Contract — Gap Report (task-2553+56 TRACK A)

- **Mode**: read-only diagnosis (문서-only 아님 — `scripts/diag_team_lead_subagent_contract_2553plus56.py` + `tests/regression/test_team_lead_subagent_contract_2553plus56.py` 실 entrypoint 검증 동반)
- **git HEAD**: `20456b5f83fc039f2fd6f50f4b94095c29b41bfb` (전후 EQUAL, read-only)
- **Overall**: `BOUNDARY_ENFORCED_SUBAGENT_CONTRACT_GAPS` — PASS 2 · PARTIAL 3 · GAP 3
- **Verdict**: PARTIAL_ENFORCEMENT · **HOLD_FOR_CHAIR**: false (§6 공통 HOLD 스크린 8/8 무해당)

## 핵심 결론

팀장 **외부 권한/콜백/권위 경계**(check 4·6)는 코드로 fail-closed 강제된다.
subagent 산출이 권위가 되지 못하고 팀장 self-key callback 이 차단되는 것은
실 runtime guard(`authoritative_verdict_selector`·`callback_owner_validator`/
`callback_owner_enforcer`·`self_collector_guard`)로 보장된다 — 단,
**subagent 개념을 직접 지칭하지 않고** executor self-session = self-chain /
self-key 라는 상위 메커니즘을 통해 **전이적(transitive)** 으로만 강제된다
(check 2·3·5 = PARTIAL).

반면 **subagent 전용 구조 계약**(check 1·7·8)은 코드/스키마로 강제되지
않고 프롬프트 자연어 가이드(`서브에이전트(Task tool) 결과 규칙`, ≤500자
요약)에만 의존한다 — GAP.

## 8개 확인항목 결과

1. **team result `subagents_used`/`subagent_roles`/`subagent_outputs_summary` 필드** — **GAP**
   `anu_v3.goal_result_planner.build_final_packet` 16-field 패킷에 해당 필드
   0개. 프롬프트의 `서브에이전트(Task tool) 결과 규칙`은 자연어 요약 규칙일 뿐
   코드/스키마 강제 아님.
2. **subagent 산출 = evidence, authoritative 아님** — **PARTIAL**
   subagent 산출은 팀장(executor) self-session 을 경유 →
   `select_authoritative_verdict` 가 self_chain 으로 QUARANTINE. 권위 불가는
   보장되나 *subagent 전용 evidence kind/tag* 는 없음 (상위 self-chain 규칙에
   전이 의존).
3. **team lead verdict = proposed verdict** — **PARTIAL**
   팀장 verdict 는 self_chain 으로 구조적 비권위(`authoritative_verdict=None`).
   그러나 `proposed_verdict` 명시 필드/라벨링 코드 없음 — quarantine 으로
   *암묵* 표현될 뿐.
4. **ANU independent collector 만 authoritative** — **PASS**
   self-chain only → `authoritative_verdict=None`(FAIL/PENDING); independent
   ANU 레코드 추가 시 `AUTHORITATIVE_PASS` 승격. `derived_origin` 이 소유자
   identity 로 재계산(claimed_origin 무시) — fail-closed.
5. **subagent 직접 ANU callback/dispatch/write guard** — **PARTIAL**
   subagent 는 팀장/executor key 채널 사용 → 직접 ANU callback/self-dispatch
   는 executor-self-key guard 로 fail-closed(전이). `delegate_controller`
   `BLOCKED_TOOLS={delegate,clarify,memory,send_message}` 는 SDK delegate
   경로 한정. Task-tool subagent 경로의 직접 cokacdir/ANU write 를 막는
   **subagent 전용 guard 없음**.
6. **팀장 normal callback → ANU key** — **PASS**
   executor self-key collector → `CallbackRegistrationBlocked`(+49 코드 정본,
   fail-closed). 독립 ANU-key collector → 등록 허용. 코드 강제.
7. **expected_files/forbidden_files/regression/unresolved 기록** — **GAP**
   16-field 패킷에 `regression_result` 만 존재. `expected_files`/
   `forbidden_files`/`unresolved_findings` 는 team-result 스키마 미기록.
8. **subagent 결과 은닉/누락 시 WARN/HOLD 분류** — **GAP**
   어떤 guard/verdict 모듈에도 `SUBAGENT_RESULT_CONCEALED` 류 분류 없음.
   팀장의 subagent 결과 은닉/누락은 코드로 탐지 불가 → 자동 WARN/HOLD 불가.

## 갭 우선순위

- **HIGH**: check 8 (은닉 탐지 부재 — 무결성 사각). check 1/7 (구조 필드
  부재로 8 의 자동 분류 근거 데이터 자체가 없음).
- **MED**: check 5 (Task-tool subagent 직접 write 전용 guard 부재 — 현재는
  self-key 전이 차단에만 의존).
- **LOW(라벨링)**: check 2/3 (권위 차단은 보장, subagent/proposed 명시 라벨
  부재 — 가독성/감사성 개선 항목).

## 권고 (proposal-only, additive — 본 read-only 진단에서 enact 0)

상세: `memory/events/micro_fix_recommendation.json`. 요지 — team-result
스키마에 `subagents_used`/`subagent_roles`/`subagent_outputs_summary`/
`expected_files`/`forbidden_files`/`unresolved_findings`/`proposed_verdict`
additive 필드 + subagent 직접 cokacdir/ANU write 차단 전용 guard +
subagent 결과 누락 시 `SUBAGENT_RESULT_CONCEALED` → WARN/HOLD 분류기.
모두 별도 권한 작업(Track 외)에서 enact — 본 task 권한 경계 준수.
