{
  "packet_version": "v1",
  "packet_type": "canary_live_activation_packet_per_axis",
  "recorded_at": "2026-05-24T18:30:00+09:00",
  "recorded_by": "ANU_chair_facing_session",
  "source_attribution": "CALLBACK_LEDGER_RECONCILED",
  "scope_note": "본 packet은 실행/적용 승인 아님. Axis 3 canary 단계 준비 (회장 verbatim 2026-05-24). full rollout 절대 금지. 24h monitoring 전 global enable 금지.",

  "axis_id": 3,
  "axis_name": "pretooluse_runtime_guard",
  "axis_subscope": "canary_live_activation",
  "axis_3_phase0_audit_status_input": "AXIS_3_PHASE0_AUDIT_READY_FOR_SIGNATURE (task-2652 박제)",
  "axis_3_phase0_audit_marker_ref": "memory/events/task-2652.axis-3-phase0-audit-ready-260524.json",
  "axis_3_risk_classification_chair_verbatim": "HIGHEST (★ 회장 verbatim · runtime tool guard는 잘못 발사 시 전체 봇 차단 가능)",

  "canary_purpose_chair_verbatim": "PreToolUse runtime guard를 제한된 canary 범위에서만 활성화. false positive / tool blocking / Axis 1·2 간섭 여부 실측.",

  "mandatory_principles_chair_verbatim_7": [
    "BLOCK 대신 기본 동작 WARN 또는 AUDIT_ONLY 우선",
    "destructive command group만 BLOCK 후보",
    "forbidden path는 initially WARN_ONLY 가능",
    "Axis 1/2 callback 흐름 절대 차단 금지",
    "canary 대상 세션만 적용",
    "full rollout 금지",
    "24h monitoring 전 global enable 금지"
  ],

  "field_01_canary_scope": {
    "scope_type": "RESTRICTED_CANARY",
    "canary_target_sessions": [
      "별도 dev6-canary-session 또는 dev5-canary-session 1개 한정",
      "★ 회장 본 세션 (chair-main-anu) 제외 (★ 우선)",
      "★ Axis 1/2 verified 봇 세션 (dev3/dev4) 제외",
      "★ dispatch.py 실행 세션 제외 (callback 흐름 보호)"
    ],
    "canary_session_identifier_method": "환경변수 ANU_CANARY_AXIS_3=true 또는 session metadata flag",
    "canary_duration_max": "24h initial · 결과 분석 후 회장 결정으로 확장",
    "global_rollout_blocked_until": "24h monitoring + chair signature for global enable"
  },

  "field_02_block_warn_audit_policy_mapping": {
    "AUDIT_ONLY_initial_default": [
      "★ 일반 tool 호출 (Read / Write / Edit / Bash 등)",
      "★ forbidden path 접근 (★ initially WARN_ONLY · 24h 후 BLOCK 검토)",
      "★ credential pattern detection (★ initially WARN_ONLY · 회장 별도 결정 후 BLOCK)"
    ],
    "WARN_initial": [
      "forbidden path 접근 (감지 + log + 봇에 warning return · tool 호출 자체는 허용)",
      "credential pattern (★ AUDIT_ONLY → WARN으로 자동 승격 검토)"
    ],
    "BLOCK_initial_only_destructive": [
      "rm -rf / (★ 절대 destructive)",
      "git push --force origin/main",
      "git reset --hard <not_current_branch>",
      "git branch -D main",
      "cokacdir --cron-remove (★ 임의 schedule 제거)",
      "★ 이 외 모든 BLOCK 발동은 회장 별도 결정 후 단계 승격"
    ],
    "policy_promotion_path": "AUDIT_ONLY → WARN → BLOCK (단계 승격 · 24h monitoring + 회장 signature)"
  },

  "field_03_false_positive_response": {
    "detection_method": "PreToolUse hook이 정상 tool 호출을 BLOCK 또는 WARN으로 잘못 분류한 case 자동 감지 (★ canary session log audit)",
    "auto_response": [
      "false positive 1건 발생 시 → 해당 rule 즉시 AUDIT_ONLY 강등 (BLOCK → WARN → AUDIT_ONLY)",
      "false positive 3건 연속 → canary session 종료 + 회장 보고",
      "false positive 5건 누적 → L1 rollback 자동 발동"
    ],
    "manual_response": [
      "false positive 분류 명확하지 않은 case는 AUDIT_ONLY 유지 + 회장 결정 대기"
    ],
    "false_positive_log_path": "memory/system/.axis_3_canary_false_positive_audit.jsonl"
  },

  "field_04_tool_call_latency_impact": {
    "expected_overhead_per_tool_call_ms": "<= 50ms target (★ canary monitoring 측정)",
    "alert_threshold_ms": ">100ms → WARN log",
    "critical_threshold_ms": ">500ms → L1 rollback 발동 (★ 봇 작업 효율 보호)",
    "measurement_method": "PreToolUse hook 진입/종료 ts diff · canary session 모든 tool call 기록",
    "latency_log_path": "memory/system/.axis_3_canary_latency_audit.jsonl"
  },

  "field_05_axis_1_2_interference_measurement": {
    "interference_check_1_axis_1_callback_authority": "Axis 1 helper 3종 (callback_registration / authority_validator / source_cross_checker) 호출 시 PreToolUse가 차단 또는 latency 추가하지 않는지 검증",
    "interference_check_2_axis_2_collector_hooks": "Axis 2 hooks 3개 (SessionStart / Stop / UserPromptSubmit) 호출 시 PreToolUse가 충돌하지 않는지 검증",
    "interference_check_3_callback_inbox_flow": "memory/.callback_inbox/ 파일 read/write 시 PreToolUse가 차단 또는 WARN하지 않는지 검증 (★ Axis 2 inbound flow 보호)",
    "interference_check_4_ledger_append": "memory/system/.callback_ledger.jsonl append 시 PreToolUse가 차단하지 않는지 검증 (★ Axis 1/2 ledger 보호)",
    "interference_check_5_dispatch_cycle": "dispatch.py 정상 실행 + 봇 spawn 시 PreToolUse가 dispatch 자체를 차단하지 않는지 검증",
    "interference_threshold": "1건이라도 차단/WARN/latency >100ms 발생 → L1 rollback 자동 발동",
    "interference_log_path": "memory/system/.axis_3_canary_interference_audit.jsonl"
  },

  "field_06_emergency_bypass": {
    "bypass_mechanism_1_env_var": "ANU_AXIS_3_EMERGENCY_BYPASS=1 환경변수 설정 시 PreToolUse hook 즉시 noop",
    "bypass_mechanism_2_file_flag": "/home/jay/workspace/memory/.axis_3_emergency_bypass 파일 존재 시 hook noop",
    "bypass_mechanism_3_chair_signature": "회장 verbatim emergency_bypass signature 발급 시 즉시 적용",
    "bypass_audit": "bypass 발동 시 memory/system/.axis_3_emergency_bypass_audit.jsonl append (시간 / trigger / scope)",
    "bypass_scope": "canary session 또는 global · 회장 결정에 따라"
  },

  "field_07_rollback_one_liner": {
    "L1_rollback_30sec": "git revert <axis_3_canary_commit_sha> && python3 utils/hooks_unregister.py --axis 3 --scope canary && touch /home/jay/workspace/memory/.axis_3_emergency_bypass",
    "L2_rollback_5min": "git checkout HEAD~1 -- /home/jay/.claude/settings.json && rm -rf /home/jay/workspace/hooks/pre_tool_use_*.py && touch /home/jay/workspace/memory/.axis_3_emergency_bypass && cokacdir --cron-list | grep canary | xargs -I{} cokacdir --cron-remove {}",
    "chair_rollback_verbatim": "회장 verbatim revert signature 시 즉시 위 L1 또는 L2 실행"
  },

  "field_08_monitoring_metrics": {
    "metric_1_tool_call_count": "canary session 동안 tool call 총 횟수",
    "metric_2_block_count": "BLOCK 발동 횟수 (rule별)",
    "metric_3_warn_count": "WARN 발동 횟수 (rule별)",
    "metric_4_audit_only_count": "AUDIT_ONLY 기록 횟수",
    "metric_5_false_positive_rate": "false positive / total decision · target <0.5%",
    "metric_6_latency_p50_p95_p99": "tool call latency 분포 ms",
    "metric_7_interference_count": "Axis 1/2 영향 발생 횟수 (★ target 0)",
    "metric_8_bypass_activation_count": "emergency bypass 발동 횟수 (★ target 0 · 발동 시 즉시 회장 보고)",
    "metric_9_canary_session_duration_hours": "canary session 가동 시간",
    "metric_10_hook_crash_count": "PreToolUse hook crash 횟수 (★ target 0)",
    "monitoring_dashboard_path": "memory/specs/axis_3_canary_monitoring_dashboard_260524.md (★ 향후 작성)"
  },

  "field_09_session_exclusion_conditions": {
    "excluded_session_types": [
      "★ chair-main-anu (회장 본 세션 · 최우선 보호)",
      "★ ANU collector spawn 세션 (Axis 2 SessionStart hook trigger)",
      "★ dev1 헤르메스 (★ self-collector 사고 박제 봇)",
      "★ dev2 오딘 (★ task-2645 closeout 보존 봇)",
      "★ dev3 다그다 (★ task-2646/2651 verified 봇 · canary 대상 아님)",
      "★ dev4 비슈누 (★ task-2644+1/2649 verified 봇 · canary 대상 아님)",
      "dispatch.py 실행 세션 (★ callback 흐름 보호)"
    ],
    "canary_eligible_sessions": [
      "신규 dev6-canary-session 또는 dev5-canary-session 1개 (★ task-2652 페룬 또는 마르둑 별도 spawn)",
      "ANU의 audit/test session (회장 명시 시)"
    ],
    "exclusion_enforcement": "PreToolUse hook 진입 시 session identifier check → excluded 시 즉시 noop"
  },

  "field_10_pretooluse_hook_crash_fail_safe": {
    "fail_safe_principle": "hook crash 시 tool 호출 허용 (★ 봇 멈춤 절대 방지)",
    "implementation": [
      "hook 내부 모든 코드 try-except 로 wrap",
      "exception 발생 시 stderr log + return allow (★ block 0)",
      "crash 5회 연속 → canary session 자동 종료 + 회장 보고",
      "crash 10회 누적 → L1 rollback 자동 발동"
    ],
    "crash_log_path": "memory/system/.axis_3_canary_hook_crash_audit.jsonl",
    "fail_safe_smoke_test": "★ canary 진입 시 hook crash simulation 1회 → tool 호출 허용 PASS 검증 강제"
  },

  "current_forbidden_actions_during_canary_packet_prep": {
    "global_activation": 0,
    "harness_enforced_full_declaration": 0,
    "callback_system_global_verified": 0,
    "axis_1_2_runtime_modified": 0,
    "dispatch_py_modified": 0,
    "destructive_auto_action_added": 0,
    "commit_push_pr_merge": 0
  },

  "chair_authorization_id_placeholder": {
    "current_value": "PENDING_CHAIR_VERBATIM_STRING_SIGNATURE",
    "anu_random_generation_forbidden": true,
    "prior_axis_id_reuse_forbidden": true,
    "expected_format_template": "CHAIR-AUTH-AXIS-3-CANARY-YYYYMMDD-<chair_verbatim>",
    "issuance_condition": "회장 verbatim 직접 문자열 명시 (실제 random 또는 의미있는 문자열)"
  },

  "completion_state": "AXIS_3_CANARY_PACKET_READY",
  "next_action_required": "회장 verbatim Axis 3 canary chair_authorization_id 발급 + canary session executor 선택 (★ dev6 또는 dev5 canary-eligible) + 24h monitoring 시작 · global enable 금지 유지",

  "chair_directive_ref": "회장 verbatim 2026-05-24 Axis 3 canary 단계 · BLOCK 대신 WARN/AUDIT_ONLY 우선 · destructive만 BLOCK 후보 · 24h monitoring 전 global enable 금지"
}
