Skip to content

fix(memory): resolve ccc_secure_fs from the installed hook tree (#952) - #956

Merged
jinon86 merged 1 commit into
mainfrom
fix/952-secure-fs-deploy
Aug 5, 2026
Merged

fix(memory): resolve ccc_secure_fs from the installed hook tree (#952)#956
jinon86 merged 1 commit into
mainfrom
fix/952-secure-fs-deploy

Conversation

@jinon86

@jinon86 jinon86 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Fixes #952

이슈 진단을 정정합니다

#952"setup.sh가 secure_fs.py를 배포하지 않는다" 고 적었는데 틀렸습니다. setup.sh:325가 이미 bridge/utils/secure_fs.py$CLAUDE_DIR/hooks/ccc_secure_fs.py로 복사하고 있습니다. 제가 배포 경로가 아닌 ~/.claude/utils/를 보고 "12노드 전부 없음"이라 판단한 것이 원인입니다.

실제 근본 원인

distill committer(local-memory-commit.py)는 spec_from_file_location으로 이 모듈을 로드합니다. 그래서 ~/.claude/hooks/sys.path에 올라가지 않습니다.

폴백 체인이 이렇게 갈립니다.

단계 코드 결과
1 from telegram_bot.utils.secure_fs import ... bridge editable install이 있는 노드만 성공
2 from ccc_secure_fs import ... hooks/가 sys.path에 없어 항상 실패
3 parents[1]/utils/secure_fs.py 설치 레이아웃에선 ~/.claude/utils/...없음

2단계가 설계 의도대로 작동하지 않고, 1단계로 우회되는 노드에서만 문제가 가려집니다.

실측:

노드 telegram_bot import distill 로그
gwakga 가능 (bridge/venv editable) 마지막 실패 2026-08-01
sogyo 불가 마지막 실패 2026-08-05 04:05

변경

3단계 폴백에서 형제 ccc_secure_fs.py를 먼저 탐색하고, 소스 체크아웃 경로를 두 번째 후보로 둡니다. 로딩 구조나 setup.sh는 건드리지 않습니다.

secure_fs_candidates = (
    Path(__file__).resolve().parent / "ccc_secure_fs.py",       # installed hook tree
    Path(__file__).resolve().parents[1] / "utils/secure_fs.py", # source checkout
)

검증

실제 버그가 나는 sogyo에서 직접 확인했습니다 (시스템 인터프리터에 telegram_bot 없음).

수정 전: 로드 실패: FileNotFoundError: [Errno 2] ... '/tmp/t952/utils/secure_fs.py'
수정 후: 로드 성공
  • 소스 체크아웃 레이아웃도 그대로 로드됩니다(회귀 없음)
  • bridge/tests/test_local_memory_transaction.py 13 passed

곽가에서 먼저 재현을 시도했을 때는 양쪽 다 성공해서 버그가 안 잡혔습니다. 곽가에만 editable install이 있어 1단계로 우회됐기 때문이고, 그래서 실패가 실제로 관측되는 노드에서 다시 검증했습니다.

영향

  • 배포 파일 변경 없음. 런타임 동작은 폴백 경로 하나가 더 시도되는 것뿐입니다.
  • telegram_bot이 노출된 노드는 여전히 1단계에서 끝나므로 동작이 바뀌지 않습니다.

🤖 Generated with Claude Code

The distill committer loads ccc_local_memory_transaction.py through
spec_from_file_location, so ~/.claude/hooks/ is never placed on sys.path.
The `from ccc_secure_fs import ...` fallback therefore only resolves on
nodes that also expose telegram_bot (an editable bridge install), and every
other node falls through to `parents[1]/utils/secure_fs.py` — a path that
does not exist in the installed layout.

Probe the sibling ccc_secure_fs.py first, keeping the source-checkout path
as the second candidate.

Verified on sogyo (no telegram_bot on the system interpreter):
  before: FileNotFoundError .../utils/secure_fs.py
  after:  module loads
Source-checkout layout still loads; tests/test_local_memory_transaction.py
13 passed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

@seoseo-ai seoseo-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

독립 리뷰 (seoseo-ai) — APPROVE

검토 결과

폴백 3단계에서 형제 ccc_secure_fs.py를 먼저 탐색하도록 후보를 추가한 최소 변경입니다. 로딩 구조와 setup.sh는 건드리지 않았습니다.

근본 원인 분석이 정확합니다. spec_from_file_location으로 로드하면 ~/.claude/hooks/sys.path에 오르지 않으므로 2단계 from ccc_secure_fs import가 무력화되고, 설치 레이아웃에서는 3단계 경로(parents[1]/utils/secure_fs.py)가 존재하지 않습니다. telegram_bot이 노출된 노드에서만 1단계로 우회되어 증상이 가려진다는 설명도 실측과 일치합니다.

검증 확인

  • 실제 실패 노드(sogyo)에서 before/after 대조 — 수정 전 FileNotFoundError, 수정 후 로드 성공. 재현 환경이 적절합니다(시스템 인터프리터에 telegram_bot 없음).
  • 소스 체크아웃 레이아웃 회귀 없음.
  • bridge/tests/test_local_memory_transaction.py 13 passed.
  • CI 전체 green (bridge-tests 3.11/3.12 · python-lint · codeql-python · validate-harness · secret-scan · wheel-smoke).

작성자가 곽가에서 먼저 재현했을 때 양쪽 다 성공해 버그가 안 잡혔던 점을 밝히고, 실패가 관측되는 노드에서 다시 검증한 과정도 기록돼 있습니다.

리스크

낮습니다. 폴백 후보가 하나 늘 뿐이고 기존 경로 우선순위는 보존됩니다. 배포 파일 변경이 없어 setup.sh 회귀 가능성도 없습니다.

이슈 #952의 초기 진단(배포 누락 / 12노드 전부)이 부정확했던 점도 이슈에 정정 코멘트로 남겨져 있습니다.

@jinon86
jinon86 merged commit 857afe6 into main Aug 5, 2026
8 checks passed
@jinon86
jinon86 deleted the fix/952-secure-fs-deploy branch August 5, 2026 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(memory,P1): setup.sh가 secure_fs.py를 배포하지 않아 local-memory commit이 전 노드에서 실패

2 participants