fix(memory): resolve ccc_secure_fs from the installed hook tree (#952) - #956
Merged
Conversation
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
approved these changes
Aug 5, 2026
seoseo-ai
left a comment
Collaborator
There was a problem hiding this comment.
독립 리뷰 (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.py13 passed.- CI 전체 green (bridge-tests 3.11/3.12 · python-lint · codeql-python · validate-harness · secret-scan · wheel-smoke).
작성자가 곽가에서 먼저 재현했을 때 양쪽 다 성공해 버그가 안 잡혔던 점을 밝히고, 실패가 관측되는 노드에서 다시 검증한 과정도 기록돼 있습니다.
리스크
낮습니다. 폴백 후보가 하나 늘 뿐이고 기존 경로 우선순위는 보존됩니다. 배포 파일 변경이 없어 setup.sh 회귀 가능성도 없습니다.
이슈 #952의 초기 진단(배포 누락 / 12노드 전부)이 부정확했던 점도 이슈에 정정 코멘트로 남겨져 있습니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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에 올라가지 않습니다.폴백 체인이 이렇게 갈립니다.
from telegram_bot.utils.secure_fs import ...from ccc_secure_fs import ...hooks/가 sys.path에 없어 항상 실패parents[1]/utils/secure_fs.py~/.claude/utils/...→ 없음즉 2단계가 설계 의도대로 작동하지 않고, 1단계로 우회되는 노드에서만 문제가 가려집니다.
실측:
telegram_botimportbridge/venveditable)변경
3단계 폴백에서 형제
ccc_secure_fs.py를 먼저 탐색하고, 소스 체크아웃 경로를 두 번째 후보로 둡니다. 로딩 구조나 setup.sh는 건드리지 않습니다.검증
실제 버그가 나는 sogyo에서 직접 확인했습니다 (시스템 인터프리터에
telegram_bot없음).bridge/tests/test_local_memory_transaction.py13 passed곽가에서 먼저 재현을 시도했을 때는 양쪽 다 성공해서 버그가 안 잡혔습니다. 곽가에만 editable install이 있어 1단계로 우회됐기 때문이고, 그래서 실패가 실제로 관측되는 노드에서 다시 검증했습니다.
영향
telegram_bot이 노출된 노드는 여전히 1단계에서 끝나므로 동작이 바뀌지 않습니다.🤖 Generated with Claude Code