{
  "packet_version": "v1",
  "packet_type": "chair_signature_packet_per_axis",
  "recorded_at": "2026-05-24T18:00:00+09:00",
  "recorded_by": "ANU_chair_facing_session",
  "source_attribution": "CALLBACK_LEDGER_RECONCILED",
  "scope_note": "이번 packet은 실행/적용 승인 아님. Axis 3 단독 서명 준비 단계 (회장 verbatim 2026-05-24). HARNESS_ENFORCED 전체 진입 아님. live activation 금지.",

  "axis_id": 3,
  "axis_name": "pretooluse_runtime_guard",
  "axis_source_task": "task-2643",
  "axis_source_pr_reference": "PR #146 (마지막 회장 보고 기준: head 33c51992 · CI 11/11 · mergeStateStatus CLEAN · 회장 단계 박제)",
  "axis_source_task_md": "/home/jay/workspace/memory/tasks/task-2643.md",
  "axis_runtime_guarded_status_input": "PENDING_VERIFICATION (★ Axis 2 hardening 완료 후 본 packet 작성 단계에서 실 status 검증 필요)",

  "axis_3_core_purpose": "PreToolUse runtime guard를 live에 연결하기 전 적용 범위 / rollback / smoke / forbidden path 확정",

  "field_01_activation_scope": {
    "scope_type": "AXIS_BOUNDED",
    "scope_description": "PreToolUse runtime guard hook + 관련 utils만 live path 반영. Axis 1/2 모듈 격리 유지.",
    "scope_modules_in": [
      "(PENDING_AUDIT) PreToolUse hook 파일 (예: hooks/pre_tool_use_runtime_guard.py)",
      "(PENDING_AUDIT) runtime guard 관련 utils (예: utils/runtime_guard_classifier.py)",
      "(PENDING_AUDIT) settings.json hooks.PreToolUse 항목"
    ],
    "scope_modules_out": [
      "Axis 1 (callback authority gate · utils/callback_registration.py 등 helper 3종 · 변경 0)",
      "Axis 2 (callback collector control plane · hooks 3 _v2 + utils 4 _v2 · 변경 0)",
      "dispatch.py (변경 0)"
    ],
    "axis_3_actual_modules_audit_required": "Axis 3 hardening task의 Phase 0에서 PR #146 head 33c51992 산출물 분석 + 실 모듈 list 확정 필요"
  },

  "field_02_activation_target_path": {
    "live_target_layout": "/home/jay/.claude/settings.json hooks.PreToolUse 항목 추가 + /home/jay/.claude/hooks/pre_tool_use_*.py + utils/runtime_guard_*.py canonical (★ Axis 2 hardening 교훈 적용: utils canonical 우선 · PYTHONPATH 의존 0)",
    "staged_to_live_mapping_template": [
      {"staged": "(PENDING_AUDIT) task-2643 staged hook path", "live": "/home/jay/.claude/hooks/pre_tool_use_runtime_guard.py"},
      {"staged": "(PENDING_AUDIT) task-2643 staged utils", "live": "/home/jay/workspace/utils/runtime_guard_*.py (★ canonical 직접 · worktree PYTHONPATH 0)"}
    ],
    "forbidden_target_paths_during_axis_3_signature": [
      "/home/jay/.claude/settings.local.json",
      "/usr/local/bin/cokacdir",
      ".github/**",
      "utils/callback_registration.py (★ Axis 1 helper · 변경 0)",
      "utils/callback_authority_validator.py (★ Axis 1)",
      "utils/callback_source_cross_checker.py (★ Axis 1)",
      "utils/callback_collector_helper_integration.py (★ Axis 2 canonical · 변경 0)",
      "utils/callback_adjudicator_v2.py (★ Axis 2 canonical · 변경 0)",
      "utils/callback_next_action_runner_v2.py (★ Axis 2 canonical · 변경 0)",
      "utils/source_attribution_guard_v2.py (★ Axis 2 canonical · 변경 0)",
      "hooks/session_start_anu_callback_collector_v2.py (★ Axis 2 · 변경 0)",
      "hooks/stop_anu_callback_collector_verifier_v2.py (★ Axis 2)",
      "hooks/user_prompt_submit_hook_callback_inbox_v2.py (★ Axis 2)",
      "dispatch.py"
    ]
  },

  "field_03_chair_authorization_id_placeholder": {
    "field_name": "chair_authorization_id",
    "current_value": "PENDING_CHAIR_VERBATIM_STRING_SIGNATURE",
    "anu_random_generation_forbidden": true,
    "axis_1_placeholder_literal_id_reused_forbidden": true,
    "axis_2_id_reused_forbidden": true,
    "expected_format_template": "CHAIR-AUTH-AXIS-3-YYYYMMDD-<chair_verbatim_string>",
    "issuance_condition": "회장 verbatim 직접 문자열 명시 (실제 random 또는 의미있는 문자열) · placeholder 그대로 박제 금지 (Axis 1 hygiene WARN doctrine 적용)"
  },

  "field_04_pretooluse_runtime_guard_purpose": {
    "guard_function": "tool 호출 시점 (Read/Write/Edit/Bash/etc.)에 runtime 보호 (forbidden path 차단 / credential expansion 감지 / destructive command 차단)",
    "guard_classification_dimensions": [
      "(PENDING_AUDIT) Phase 0에서 task-2643 spec에서 추출 필요",
      "후보: path-based forbidden / credential pattern detection / destructive command list / Critical7 trigger"
    ],
    "guard_failure_action_options": [
      "BLOCK (tool 호출 차단 + 봇에 reason return)",
      "WARN (tool 호출 허용 + warning log)",
      "AUDIT_ONLY (tool 호출 허용 + audit log only)"
    ]
  },

  "field_05_smoke_test_set_post_activation": [
    "SP1: PreToolUse hook이 정상 tool 호출 시 noop (Read/Write/Bash 일반 호출 통과)",
    "SP2: forbidden path 접근 시 BLOCK return (e.g. Read /home/jay/.env)",
    "SP3: credential pattern (e.g. ghp_/ghs_/PEM/AWS key) 포함 Write 시 BLOCK 또는 WARN",
    "SP4: destructive command (rm -rf · git push --force · git reset --hard) BLOCK 또는 WARN",
    "SP5: Axis 1/2 hook과 충돌 0 (SessionStart/Stop/UserPromptSubmit 동작 변화 0)",
    "SP6: dispatch.py 호출 시 PreToolUse가 dispatch 자체를 차단하지 않음 (★ 일반 dispatch cycle 통과)",
    "SP7: hook crash 시 봇 process 자체 멈추지 않음 (★ fail-safe: hook crash → tool 호출 허용 · audit log)"
  ],
  "smoke_pass_threshold": "SP1-SP7 모두 PASS (7/7) · 1건이라도 fail 시 L1 rollback",

  "field_06_rollback_plan": {
    "L1_rollback_trigger_30sec": [
      "PreToolUse hook unhandled exception (★ fail-safe로 tool 허용해야 봇 작동 보장)",
      "정상 tool 호출 false positive BLOCK (SP1 fail)",
      "forbidden path false negative (SP2 fail)"
    ],
    "L1_rollback_action": "git revert <axis_3_settings_patch_commit> + hooks.PreToolUse 항목 제거 + ANU 회장 보고",
    "L2_rollback_trigger_5min": [
      "Axis 3 적용 후 5분 내 첫 dispatch cycle에서 봇 봇 process 차단 발생",
      "Axis 1/2 regression baseline 변화 (회귀 발생)"
    ],
    "L2_rollback_action": "Axis 3 live revert + 회장 보고 + PreToolUse hooks RUNTIME_GUARDED 복귀",
    "chair_rollback_trigger": "회장 verbatim revert signature 즉시 rollback (회장 권한)"
  },

  "field_07_forbidden_paths_to_be_guarded_by_pretooluse": {
    "high_priority_forbidden_list_template": [
      "/home/jay/.env* (credential)",
      "/home/jay/.claude/settings.local.json (secrets)",
      "/usr/local/bin/cokacdir (live infra)",
      ".github/** (CI config)",
      "**/credentials*",
      "/home/jay/.ssh/** (★ ssh key)"
    ],
    "destructive_command_list_template": [
      "rm -rf /",
      "git push --force (★ origin/main 대상)",
      "git reset --hard <not_current_branch>",
      "git branch -D main",
      "cokacdir --cron-remove (★ 임의 schedule 제거)"
    ],
    "actual_list_to_be_finalized_in_axis_3_task": "task-2643 spec + 회장 verbatim approval 후 확정"
  },

  "field_08_axis_2_lessons_applied": {
    "lesson_1_canonical_path_first": "Axis 2 hardening 교훈: utils는 canonical /home/jay/workspace/utils/ 에 두고 PYTHONPATH 의존 0",
    "lesson_2_no_worktree_hardcoded_import": "hook 파일은 importlib spec_from_file_location 대신 표준 import 사용 권장",
    "lesson_3_chair_authorization_id_verbatim": "Axis 1 placeholder WARN 교훈: 회장 verbatim 실제 문자열 직접 명시 필수",
    "lesson_4_real_value_verification_8": "Axis 1 live activation 8 실제값 패턴 확장 적용 (real cron registration / argv_generated / cron_id_fired / schedule_history / cron-history owner key match / result artifact / ledger row / live_enforcement)",
    "lesson_5_dependency_hardening_carry": "live verified 시에도 dependency 검증 별도 carry 필수 (Axis 2 fragile wiring 교훈)"
  },

  "field_09_forbidden_during_axis_3_signature_packet_prep_12": [
    "Axis 1 helper 변경 (utils/callback_registration.py 등)",
    "Axis 2 hooks 3 / utils 4종 v2 변경 (read-only)",
    "dispatch.py 변경",
    "real auto-merge",
    "PR #141 pilot",
    "BOT App token 사용",
    "commit / push / PR / merge (단 Axis 3 hardening task 진입 시 별도 chair signature 범위 허용)",
    "live settings.json 수정 (★ Axis 3 packet 준비 단계 · live 적용은 별도 chair signature 필요)",
    "live cokacdir 수정",
    "HARNESS_ENFORCED 전체 선언",
    "callback system verified 전체 선언",
    "chair_authorization_id 임의 변형 (★ Axis 1/2 ID 재사용 절대 금지)"
  ],

  "field_10_axis_3_phase_0_audit_required_before_live": [
    "task-2643 task md 정독 + PR #146 head 33c51992 실 산출물 확인",
    "PreToolUse hook 파일 staged path 확정",
    "runtime guard 관련 utils 확정",
    "forbidden path / destructive command 실 list 확정",
    "Axis 1/2 모듈과 import 충돌 0 검증",
    "Axis 2 dependency hardening 교훈 적용 검증 (canonical path · PYTHONPATH 0)",
    "8 실제값 패턴 (Axis 1 verified pattern) 적용 가능성 분석"
  ],

  "completion_state": "AXIS_3_SIGNATURE_PACKET_READY",
  "next_action_required": "회장 verbatim per-axis signature (Axis 3 단독 · 실제 chair_authorization_id 문자열 직접 명시) · ANU random 생성 절대 금지 · Axis 1/2 ID 재사용 절대 금지 · Phase 0 audit 후 live activation 진행",

  "chair_directive_ref": "회장 verbatim 2026-05-24 Axis 3 chair signature packet 준비 (live activation 아님 · packet만) · adoption range + rollback + smoke + forbidden path 확정"
}
