# 시스템 생태계 건강검진

- 생성: `2026-09-18 18:14:48`
- 전체 상태: `FAIL`
- OK: `77` / WARN: `15` / FAIL: `3`

## 한눈 요약

```text
입력 → Agent → ToolSelector → ToolRegistry/Executor → Tool/Service → DB/Reports → 운영자 UI
```

## core_files

| 상태 | 항목 | 내용 |
|---|---|---|
| ✅ `OK` | `api.php` | found / 2026-09-18 09:05:02 |
| ✅ `OK` | `engine.php` | found / 2026-09-10 10:53:45 |
| ✅ `OK` | `engine_modules/agent/Agent.php` | found / 2026-06-26 23:00:18 |
| ✅ `OK` | `engine_modules/tools/ToolSelector.php` | found / 2026-09-18 09:05:02 |
| ✅ `OK` | `engine_modules/tools/bootstrap.php` | found / 2026-09-18 09:05:02 |
| ✅ `OK` | `engine_modules/tools/ToolRegistry.php` | found / 2026-09-18 17:20:52 |
| ✅ `OK` | `engine_modules/tools/ToolExecutor.php` | found / 2026-05-06 15:10:56 |
| ✅ `OK` | `engine_modules/tools/CallableGatePolicy.php` | found / 2026-05-26 19:32:30 |
| ✅ `OK` | `engine_modules/tools/PersonalExpenseTool.php` | found / 2026-05-02 12:30:40 |
| ✅ `OK` | `engine_modules/services/PersonalExpenseParseService.php` | found / 2026-09-18 17:48:05 |
| ✅ `OK` | `engine_modules/services/PersonalExpenseSaveService.php` | found / 2026-05-13 12:14:17 |
| ✅ `OK` | `tools/update_all_docs.php` | found / 2026-05-04 11:51:46 |
| ✅ `OK` | `tools/update_work_docs_from_ssh_answers.php` | found / 2026-05-03 16:27:06 |
| ✅ `OK` | `tools/php_function_call_inventory.php` | found / 2026-05-04 06:42:15 |
| ✅ `OK` | `tools/php_callable_surface_report.php` | found / 2026-05-04 09:41:07 |
| ✅ `OK` | `tools/php_callable_gate_check.php` | found / 2026-05-04 09:53:13 |
| ✅ `OK` | `tools/php_callable_gate_smoke.php` | found / 2026-05-04 09:53:52 |
| ✅ `OK` | `tools/codefix_write_policy_smoke.php` | found / 2026-05-04 10:32:46 |
| ✅ `OK` | `tools/system_gate_authority_enforcement_smoke.php` | found / 2026-05-04 11:51:06 |
| ✅ `OK` | `tools/php_object_call_graph.php` | found / 2026-05-04 06:49:19 |
| ✅ `OK` | `tools/php_object_call_graph_unresolved_triage.php` | found / 2026-05-04 06:47:44 |
| ✅ `OK` | `tools/php_object_call_graph_residual_report.php` | found / 2026-05-06 10:03:51 |

## tool_registry

| 상태 | 항목 | 내용 |
|---|---|---|
| ✅ `OK` | `registry_load` | class=ToolRegistry count=56 |
| ✅ `OK` | `bootstrap_failed_tools` | failed=0 |
| ✅ `OK` | `has_personal_expense` | registered |
| ✅ `OK` | `has_history_memo` | registered |
| ✅ `OK` | `has_history_search` | registered |
| ✅ `OK` | `has_payment` | registered |
| ✅ `OK` | `has_schedule` | registered |
| ✅ `OK` | `has_customer` | registered |
| ✅ `OK` | `has_worklog` | registered |
| ✅ `OK` | `has_code_map` | registered |

## patch_markers

| 상태 | 항목 | 내용 |
|---|---|---|
| ⚠️ `WARN` | `Agent personal expense catch-all` | marker not found |
| ✅ `OK` | `Agent weather bi guard` | AGENT_WEATHER_SINGLE_BI_FALSE_POSITIVE_GUARD_V1 |
| ✅ `OK` | `Bootstrap registry cleanup` | ECOSYSTEM_BOOTSTRAP_REGISTRY_CLEANUP_V1 |
| ✅ `OK` | `Schedule history combo` | SCHEDULE_HISTORY_COMBO_ROUTE_V2 |
| ✅ `OK` | `History period filter` | HISTORY_SEARCH_PERIOD_FILTER_V2 |
| ✅ `OK` | `PersonalExpenseTool` | PERSONAL_EXPENSE_TOOL_V1 |
| ✅ `OK` | `CodeFix controlled write policy` | CODE_FIX_SYSTEM_CONTROLLED_WRITE_POLICY_V1 |
| ✅ `OK` | `Callable gate runtime policy` | CALLABLE_GATE_RUNTIME_POLICY_V1 |
| ✅ `OK` | `Callable gate ToolExecutor hook` | CALLABLE_GATE_TOOL_EXECUTOR_RUNTIME_HOOK_V1 |
| ✅ `OK` | `Callable gate Agent hook` | CALLABLE_GATE_AGENT_RUNTIME_HOOK_V1 |
| ✅ `OK` | `SystemGate authority fields` | SYSTEM_GATE_AUTHORITY_FIELDS_V2 |
| ✅ `OK` | `RouteDecision authority contract` | ROUTE_DECISION_AUTHORITY_CONTRACT_V2 |
| ✅ `OK` | `RouteSanity allowed tools enforcement` | ROUTE_SANITY_ALLOWED_TOOLS_ENFORCE_V2 |
| ✅ `OK` | `ToolSelector person domain split` | TOOL_SELECTOR_PERSON_DOMAIN_KEYWORD_SPLIT_V1 |
| ✅ `OK` | `ToolExecutor system gate allowed tools` | TOOL_EXECUTOR_SYSTEM_GATE_ALLOWED_TOOLS_V1 |
| ⚠️ `WARN` | `Agent system gate allowed tools` | marker not found |
| ✅ `OK` | `ToolSelector route module extraction` | TOOL_SELECTOR_ROUTE_MODULE_EXTRACTION_V1 |
| ✅ `OK` | `ToolSelector history route extraction` | TOOL_SELECTOR_HISTORY_ROUTE_EXTRACTION_V1 |
| ✅ `OK` | `ToolSelector code route pre intent` | TOOL_SELECTOR_CODE_ROUTE_PRE_INTENT_RULE_V1 |
| ✅ `OK` | `ToolSelector early log code route extraction` | TOOL_SELECTOR_EARLY_LOG_CODE_GUARD_ROUTE_EXTRACTION_V1 |
| ✅ `OK` | `ToolSelector worklog period route extraction` | TOOL_SELECTOR_WORKLOG_PERIOD_ROUTE_EXTRACTION_V1 |
| ✅ `OK` | `History period human record format` | HISTORY_PERIOD_HUMAN_RECORD_FORMAT_V2 |
| ✅ `OK` | `History period memo inbox source` | HISTORY_PERIOD_MEMO_INBOX_SOURCE_V1 |

## pending

| 상태 | 항목 | 내용 |
|---|---|---|
| ⚠️ `WARN` | `pending_count` | pending=184 |
| ✅ `OK` | `suspicious_personal_expense_pending` | count=0 |

## database

| 상태 | 항목 | 내용 |
|---|---|---|
| ✅ `OK` | `pdo` | connected |
| ✅ `OK` | `table_personal_memo_inbox` | rows=63 |
| ✅ `OK` | `table_personal_expense_records` | rows=2 |
| ✅ `OK` | `table_personal_expense_items` | rows=5 |
| ✅ `OK` | `table_incomes` | rows=308 |
| ✅ `OK` | `table_schedule_events` | rows=84 |
| ✅ `OK` | `table_calendar_projects` | rows=74 |

## dirty_rows

| 상태 | 항목 | 내용 |
|---|---|---|
| ✅ `OK` | `incomes` | dirty_candidates=0 |
| ✅ `OK` | `schedule_events` | dirty_candidates=0 |
| ✅ `OK` | `calendar_projects` | dirty_candidates=0 |

## docs

| 상태 | 항목 | 내용 |
|---|---|---|
| ⚠️ `WARN` | `WORK_STATE.md` | mtime=2026-05-23 00:38:03 age_sec=10258605 |
| ⚠️ `WARN` | `WORK_REPORT.md` | mtime=2026-05-23 00:38:03 age_sec=10258605 |
| ⚠️ `WARN` | `repair_jobs/SSH_ANSWER_INDEX.md` | mtime=2026-05-23 00:38:03 age_sec=10258605 |
| ⚠️ `WARN` | `reports/auto_work_summary.md` | mtime=2026-05-23 00:38:03 age_sec=10258605 |
| ⚠️ `WARN` | `reports/personal_expense_pipeline_status.md` | mtime=2026-05-23 00:38:01 age_sec=10258607 |
| ⚠️ `WARN` | `reports/system_ecosystem_audit.md` | mtime=2026-05-23 00:38:03 age_sec=10258605 |

## ssh_answers

| 상태 | 항목 | 내용 |
|---|---|---|
| ⚠️ `WARN` | `latest_title` |  |
| ✅ `OK` | `recent_ok_count` | ok=0 |
| ✅ `OK` | `resolved_need_check_count` | resolved=6 |
| ⚠️ `WARN` | `recent_need_check_count` | need_check=2 |
| ↳ | `20260525_132825_git_tracking_candidate_plan_v1.txt` | {"file":"20260525_132825_git_tracking_candidate_plan_v1.txt","path":"\/volume1\/web\/gpt\/repair_jobs\/ssh_answers\/20260525_132825_git_tracking_candidate_plan_v1.txt","title":"20260525_132825_git_tracking_candidate_plan_v1.txt","created_at":"2026-05-25 13:28:25","judgment":"SYSTEM_CRITICAL_STATUS_AUDIT_V1_PASS_WITH_GIT_WARN","url":"repair_jobs\/ssh_answers\/20260525_132825_git_tracking_candidate_plan_v1.txt"} |
| ↳ | `20260525_132431_git_untracked_root_cause_probe_v1.txt` | {"file":"20260525_132431_git_untracked_root_cause_probe_v1.txt","path":"\/volume1\/web\/gpt\/repair_jobs\/ssh_answers\/20260525_132431_git_untracked_root_cause_probe_v1.txt","title":"20260525_132431_git_untracked_root_cause_probe_v1.txt","created_at":"2026-05-25 13:24:31","judgment":"SYSTEM_CRITICAL_STATUS_AUDIT_V1_PASS_WITH_GIT_WARN","url":"repair_jobs\/ssh_answers\/20260525_132431_git_untracked_root_cause_probe_v1.txt"} |

## routing_regression

| 상태 | 항목 | 내용 |
|---|---|---|
| ⚠️ `WARN` | `natural_query_expected_tool` | overall=FAIL total=4 ok=0 warn=0 fail=4 |
| ❌ `FAIL` | `life_memo_pending_no_pollution` | overall=FAIL total=4 ok=0 fail=4 |

## route_module_pipeline

| 상태 | 항목 | 내용 |
|---|---|---|
| ✅ `OK` | `toolselector_route_module_call_edges` | overall=OK total=30 ok=30 warn=0 fail=0 |

## system_gate_authority

| 상태 | 항목 | 내용 |
|---|---|---|
| ❌ `FAIL` | `allowed_tools_and_approval_enforced` | overall=FAIL total=8 ok=7 fail=1 |
| ↳ | `schedule` | 5월 히스토리 조회 |

## history_period_routes

| 상태 | 항목 | 내용 |
|---|---|---|
| ❌ `FAIL` | `month_recent_history_period_list` | overall=FAIL total=4 ok=3 fail=1 |
| ↳ | `keyword_children_history` | 애들 히스토리 |

## history_period_sources

| 상태 | 항목 | 내용 |
|---|---|---|
| ✅ `OK` | `personal_memo_inbox_called` | overall=OK total=10 ok=10 fail=0 |

## history_period_answer_format

| 상태 | 항목 | 내용 |
|---|---|---|
| ✅ `OK` | `saved_record_human_readable_list` | overall=OK total=11 ok=11 fail=0 |

## function_call_inventory

| 상태 | 항목 | 내용 |
|---|---|---|
| ✅ `OK` | `php_functions_and_calls_visible` | files=1458 classes=601 functions=6267 calls=76514 |

## object_call_graph

| 상태 | 항목 | 내용 |
|---|---|---|
| ✅ `OK` | `object_method_resolution_visible` | scopes=6262 edges=11821 object=6692/7122 static=4686/4699 |

## object_call_graph_triage

| 상태 | 항목 | 내용 |
|---|---|---|
| ✅ `OK` | `unresolved_calls_classified` | unresolved=443 classified=443 high=295 medium=27 low=75 info=46 |

## object_call_graph_residual

| 상태 | 항목 | 내용 |
|---|---|---|
| ⚠️ `WARN` | `low_info_residual_accepted` | unresolved=443 high=295 medium=27 accepted=428 needs_review=15 |
| ↳ | `reports/php_object_call_graph_residual.json` | residual_needs_review |

## callable_surface

| 상태 | 항목 | 내용 |
|---|---|---|
| ✅ `OK` | `function_direct_call_policy` | functions=6267 callable=1804 blocked_or_internal=4463 |

## callable_gate

| 상태 | 항목 | 내용 |
|---|---|---|
| ✅ `OK` | `direct_call_gate_smoke` | overall=OK ok=3 fail=0 total=3 |

## codefix_write_policy

| 상태 | 항목 | 내용 |
|---|---|---|
| ✅ `OK` | `approved_write_gate` | overall=OK ok=4 fail=0 total=4 |

## run_events

| 상태 | 항목 | 내용 |
|---|---|---|
| ✅ `OK` | `latest_event_quality` | latest=2026-09-18 18:02:17 judgment=REQUEST_FINISHED has_error=false current_bytes=4480178 rotation_threshold_bytes=67108864 latest_bytes=8041 tail_max_bytes=8630 tail_errors=16 tail_empty_output=0 tail_repeated_inputs=9 tail_duplicate_rows=0 |

## runtime_logs

| 상태 | 항목 | 내용 |
|---|---|---|
| ⚠️ `WARN` | `active_log_size_guard` | oversized_active_logs py_rag_trace=488257997 |

## rag_index

| 상태 | 항목 | 내용 |
|---|---|---|
| ⚠️ `WARN` | `faiss_freshness` | index_too_old age_sec=12679606 |

## local_lm

| 상태 | 항목 | 내용 |
|---|---|---|
| ✅ `OK` | `recent_gateway_quality` | latest_gateway_call_ok latest=2026-09-18 18:15:12 source=python_gateway model=exaone-3.5-7.8b-instruct purpose=python_rag_lm_messages latest_ms=288 latest_tps=83.33 recent_total=160 recent_ok=160 recent_fail=0 avg_ok_ms=5486 max_ok_ms=20274 avg_tps=76.3 |

## 다음 추천

- WARN/FAIL 항목부터 확인한다.
- pending 찌꺼기, DB 오염 후보, 등록 누락 도구를 우선 처리한다.

## 관리 원칙

- 이 건강검진은 읽기 전용이다.
- 실제 수정/삭제/승인은 별도 승인 흐름으로만 처리한다.
- 작업 후 `update_all_docs.php`가 실행되면 이 문서도 자동 갱신된다.

