virtual-insanity
← 리포트 목록

System Digest Critical 2건 파악 및 즉시 패치

2026-04-21 system [system-digest, error-ledger, vault-quality, hermes, digest-fix]

System Digest Critical 2건 파악 및 즉시 패치

결론

2026-04-21 03:45 System Digest의 “심각 에러 2건”은 실제 크래시가 아니라 silent-output 감지기의 false-positive였다.

  • hypothesis_engine 오늘 출력 없음: 실제로 2026-04-21 01:56 실행 완료. 다만 신규 파일명이 오늘 날짜가 아니어서 오탐.
  • goal_alignment 오늘 출력 없음: 실제로 2026-04-21 04:02 최신 결과 존재. ledger가 자동 해소 대기 상태라 계속 open으로 남음.

즉시 조치: 1. system_digest.py silent 감지 로직 패치: 디렉터리는 “오늘 날짜 파일명”뿐 아니라 최근 24h 내 갱신된 JSON도 유효 출력으로 인정. 2. ledger의 두 high 항목을 resolved로 전환하고 fix_history 기록. 3. vault_flow_health.py 리소스 점수 0점 고정 버그 패치: v4 경로 600 데이터를 보도록 수정. 4. DM 발송 금지 준수: system_digest.main()은 호출하지 않고 build/update/write만 수행.

현재 상태:

{
  "error_ledger": {"total_open": 2, "high_severity": 0, "silent_count": 0},
  "vault_quality": {"캡처": 11, "정리": 42, "연결": 29, "판단": 81, "리소스": 52, "활동": 85, "운영": 86, "시스템": 100}
}

남은 open 2건은 low severity다.


1. error-ledger 위치

확인 경로:

경로 상태 비고
/Users/ron/.hermes/workspace/memory/error-ledger/ledger.json active 2026-04-21 08:24 갱신
/Users/ron/.openclaw/workspace/memory/error-ledger/ledger.json stale 2026-04-15 이후 미갱신

System Digest active 파일:

경로 상태
/Users/ron/.hermes/workspace/memory/system-digest/latest.json active, 2026-04-21 08:26 재생성
/Users/ron/.openclaw/workspace/memory/system-digest/latest.json stale

2. Critical/High 미해결 2건 상세

2.1 silent__hypothesis_engine

항목
title hypothesis_engine 오늘 출력 없음
source silent
source_file scripts/pipeline/hypothesis_engine.py
severity high
status_before open
occurrences 5
first_seen 2026-04-14
last_seen 2026-04-21
stack trace 없음. 로그 예외가 아니라 system_digest의 synthetic silent detector 항목

실측 증거:

  • 실행 잡: ocRESTORE-intelligence-cluster
  • 실행 로그: /Users/ron/.hermes/cron/output/ocRESTORE-intelligence-cluster/2026-04-21_01-56-10.md
  • 로그 mtime: 2026-04-21T01:56:10
  • 실제 출력 요약:
{"status":"ok","bottlenecks":13,"discoveries_total":249,"discoveries_vault":30,"discoveries_filtered":219,"generated":0,"recent_themes_count":6}

원인:

  • 기존 감지기는 memory/hypotheses/ 아래 파일명에 오늘 날짜가 포함된 JSON만 인정했다.
  • 오늘 실행은 성공했지만, 중복 주제 필터로 generated=0이었고 새 hypothesis_2026-04-21*.json을 만들지 않았다.
  • 대신 기존 hypothesis/lifecycle 파일이 갱신됐다.
  • 따라서 “오늘 출력 없음”은 false-positive.

현재 evidence:

파일 mtime 의미
/Users/ron/.hermes/workspace/memory/hypotheses/hypothesis_2026-04-20_1317.json 2026-04-21T03:45:50 최근 24h 내 hypothesis 상태 갱신

조치:

  • silent detector가 디렉터리 JSON의 mtime도 보도록 수정.
  • ledger entry를 resolved로 변경.

2.2 silent__goal_alignment

항목
title goal_alignment 오늘 출력 없음
source silent
source_file scripts/pipeline/goal_alignment.py
severity high
status_before open
occurrences 3
first_seen 2026-04-18
last_seen 2026-04-20
stack trace 없음. 로그 예외가 아니라 system_digest의 synthetic silent detector 항목

실측 증거:

파일 mtime 내용
/Users/ron/.hermes/workspace/memory/goal-alignment/latest.json 2026-04-21T04:02:35 date=2026-04-21, system_alignment=81.6
/Users/ron/.hermes/workspace/memory/goal-alignment/2026-04-21.json 2026-04-21T04:02:35 일자별 결과 존재

원인:

  • 실제 최신 산출물은 존재했다.
  • ledger가 open 항목을 2일 이상 미탐지 후 자동 resolved 처리하는 구조라, 이미 복구된 항목이 System Digest 알림에 계속 잡혔다.

조치:

  • fresh output 확인 후 ledger entry를 resolved로 변경.
  • 재생성 후 high_severity=0, silent_count=0 확인.

3. 품질 위험 지표 출처와 계산 근거

출처 코드:

  • system_digest.py:collect_vault_quality()
  • 내부에서 pipeline.vault_flow_health.compute_stage_quality() 호출
  • 실측 상태: /Users/ron/.hermes/workspace/memory/vault-flow-health/state.json

3.1 캡처 10/100 → 현재 재계산 11/100

산식:

score = round(max(0, 100 - stale_ratio * 100))

대상:

  • ~/knowledge/100 수신함
  • 7일 이상 stale인 .md 파일 비율

현재 근거:

{"score": 11, "stale_ratio": 0.89}

판단:

  • 캡처 파이프라인 자체 실패라기보다, 수신함 내 오래된 문서 비율이 높아 점수가 낮다.
  • 03:45 알림의 10점과 현재 11점 차이는 재계산 시점의 파일 mtime 차이다. 근본 원인은 동일하다.

후속 ticket:

  • DIGEST-QA-001: 100 수신함 stale 7일+ 파일 정리/승격 루틴 실행. 목표 stale_ratio 0.50 미만.

3.2 연결 29/100

산식 요약:

base = min(moc_count, 10) * 5 + freshness * 50
freshness = 1 - stale_mocs / max(moc_count, 1)
flow_ratio = 정리 / 연결
flow_penalty = min(50, round((flow_ratio - 3) * 10)) if flow_ratio > 3 else 0
score = max(0, base - flow_penalty)

현재 근거:

{
  "score": 29,
  "moc_count": 114,
  "stale_mocs": 48,
  "flow_ratio": 14.7,
  "flow_penalty": 50
}

판단:

  • 200 아토믹 10,158건 대비 300 지식망 689건이라 200→300 승격 정체가 크다.
  • stale MOC 48개도 감점 요인.

후속 ticket:

  • DIGEST-QA-002: knowledge_connector / vault_linker 정기 실행 검증 + 200→300 승격 큐 처리. 목표 flow_ratio 6 이하, stale_mocs 20 이하.

3.3 리소스 0/100 → 패치 후 52/100

원인:

  • vault_flow_health.py가 v3 legacy 경로 ~/knowledge/600 리소스를 하드코딩하고 있었다.
  • 현재 v4 구조에는 ~/knowledge/600 리소스가 없고, 실제 경로는 ~/knowledge/600 데이터 symlink다.
  • 이 때문에 리소스 품질이 0점으로 고정됐다.

패치 후 근거:

{
  "score": 52,
  "linked_ratio": 0.20,
  "stale_ratio": 0.0
}

남은 리스크:

  • 52점으로 회복됐지만 linked_ratio 0.20이라 참조 연결률은 낮다.

후속 ticket:

  • DIGEST-QA-003: 600 데이터 내 자료의 wikilink/출처 연결 보강. 목표 linked_ratio 0.50 이상.

4. 적용 패치

4.1 system_digest.py silent-output false-positive 수정

수정 파일:

  • /Users/ron/.hermes/workspace/scripts/pipeline/system_digest.py

백업:

  • /Users/ron/.hermes/workspace/scripts/pipeline/system_digest.py.bak-digest-silent-20260421

핵심 변경:

- # 디렉토리: 오늘 날짜 파일 없으면 silent
+ # 디렉토리: 오늘 날짜 파일명 또는 24h 이내 갱신된 JSON이 없으면 silent.
...
- has_today = any(today in f.name or today_compact in f.name ...)
+ has_recent_output = False
+ for f in target.iterdir():
+     if f.suffix != ".json":
+         continue
+     if today in f.name or today_compact in f.name:
+         has_recent_output = True
+         break
+     if f.stat().st_mtime >= stale_threshold:
+         has_recent_output = True
+         break

검증:

python3 -m py_compile system_digest.py  # PASS
_detect_silent_pipeline_outputs('2026-04-21') => []

4.2 error-ledger resolved 처리

수정 파일:

  • /Users/ron/.hermes/workspace/memory/error-ledger/ledger.json

처리 결과:

id before after
silent__hypothesis_engine open/high resolved/high
silent__goal_alignment open/high resolved/high

검증:

{
  "open": 2,
  "high_or_critical_open": 0,
  "open_ids": [
    "log__blog_monitor__9b22b611",
    "log__strategy_flow_collector__73941bff"
  ]
}

4.3 vault_flow_health.py resource path v4 수정

수정 파일:

  • /Users/ron/.hermes/workspace/scripts/pipeline/vault_flow_health.py

백업:

  • /Users/ron/.hermes/workspace/scripts/pipeline/vault_flow_health.py.bak-resource-path-20260421

핵심 변경:

- res_dir = vault_root / "600 리소스"
+ res_dir = DEFAULT_V3_MAP.get("데이터") or (vault_root / "600 데이터")
+ if not res_dir.exists():
+     res_dir = vault_root / "600 리소스"

검증:

python3 -m py_compile vault_flow_health.py  # PASS
vault_flow_health.py --dry-run --json       # PASS, Telegram 전송 없음

패치 전후:

지표
리소스 0 52

5. 현재 남은 open 항목

High/Critical은 0건이다. 남은 항목은 low 2건이다.

id title severity occurrences 후속
log__blog_monitor__9b22b611 blog_monitor: feedparser not installed low 2 DIGEST-LOW-001: Hermes venv에 feedparser 설치 또는 requirements 반영
log__strategy_flow_collector__73941bff certificate verify failed low 2 DIGEST-LOW-002: 인증서 체인/requests CA bundle 확인

이번 작업 범위는 03:45 System Digest의 critical/high 2건과 품질 위험 원인 파악이므로 low 2건은 후속 티켓으로 남겼다.


6. 검증 커맨드 원문

# ledger / digest 위치 확인
find /Users/ron/.hermes/workspace/memory/error-ledger /Users/ron/.openclaw/workspace/memory/error-ledger -maxdepth 2 -type f -name '*.json' -print
find /Users/ron/.hermes/workspace/memory/system-digest /Users/ron/.openclaw/workspace/memory/system-digest -maxdepth 2 -type f -name '*.json' -print

# silent detector 검증
PYTHONPATH=/Users/ron/.hermes/workspace/scripts:/Users/ron/.hermes/workspace/scripts/pipeline \
/Users/ron/.hermes/hermes-agent/venv/bin/python3 - <<'PY'
import sys, json
sys.path.insert(0,'/Users/ron/.hermes/workspace/scripts/pipeline')
import system_digest
print(json.dumps(system_digest._detect_silent_pipeline_outputs('2026-04-21'), ensure_ascii=False))
PY

# 구문 검사
python3 -m py_compile /Users/ron/.hermes/workspace/scripts/pipeline/system_digest.py
python3 -m py_compile /Users/ron/.hermes/workspace/scripts/pipeline/vault_flow_health.py

# vault quality dry-run, DM 없음
PYTHONPATH=/Users/ron/.hermes/workspace/scripts:/Users/ron/.hermes/workspace/scripts/pipeline \
/Users/ron/.hermes/hermes-agent/venv/bin/python3 \
/Users/ron/.hermes/workspace/scripts/pipeline/vault_flow_health.py --dry-run --json

7. 자체평가

  • 정확성: 5/5 — 알림의 high 2건을 ledger/source/output 증거로 추적했고 false-positive 원인을 코드 레벨에서 확인.
  • 완성도: 4.8/5 — high 2건 resolved, 품질 지표 중 리소스 0점 고정 버그 수정. 캡처/연결은 운영 정리성 이슈라 티켓화.
  • 검증: 5/5 — py_compile, detector 함수 직접 호출, digest 재생성, vault_flow_health dry-run 확인.
  • 최소 변경: 4.8/5 — silent detector와 resource path만 국소 수정. DM/LaunchAgent/cron 변경 없음.

종합: 4.9/5

DONE DIGEST-FIX