修复隔离 Science 的 SSH Host 枚举与 Runtime 更新复用 - #67
Open
RerrentLinden wants to merge 2 commits into
Open
Conversation
RerrentLinden
marked this pull request as ready for review
July 21, 2026 07:45
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.
背景
本 PR 合并处理隔离 Claude Science 的两项相关问题:
Hostalias;You're up to date,实际却运行 App 内置旧 build,而官方实例已经运行 updater 下载的新 build。根因
SSH Host 枚举
现有受管 stub 只写入绝对路径
Include。系统 OpenSSH 会展开Include,但当前 Science Host picker 只扫描当前配置文件中的字面Host声明,因此隔离实例得到 0 个 alias。Runtime 更新语义
隔离实例使用虚拟身份和独立 data-dir;即使临时移除
--no-auto-update,更新状态仍返回not signed in to claude.ai。Science 页面把latest=null与更新错误合并显示为You're up to date,造成误报。官方实例实际执行 updater 下载到~/.claude-science/bin/claude-science的新版 executable,而 CSSwitch 原先始终优先启动 App 内置旧 executable。改动
SSH bridge
Include,同时投影系统配置中的安全、显式、顶层Hostalias;HostName、User、Port、IdentityFile、ProxyCommand、Match等连接参数;Science runtime
official_downloadedruntime 来源,只读检查精确路径~/.claude-science/bin/claude-science;SCIENCE_BINoverride > 官方已下载 runtime > App 内置 runtime > 用户明确授权的一次性 cache;--version校验;--no-auto-update,不登录、不检查或应用更新;安全与兼容边界
验证
PR 分支:
bash test/test_scripts.sh:全部通过;bash test/run-frontend.sh:全部通过;official_downloaded_runtime_wins_without_sharing_official_data通过;cargo fmt --all --check与git diff --check通过。对应 runtime 补丁在 fork
main上还完成了生产构建、ad-hoc resource seal、安装和实机验收:官方 8765 的 PID 保持不变,隔离 8990 使用独立 PID;二者 executable 均解析到官方已下载 runtime,隔离进程仍带独立--data-dir、8990/8991 端口与--no-auto-update,两端/health均返回 200。安装版状态页显示“官方已下载 Runtime;隔离实例仅复用程序文件”。本轮未发送真实 provider 推理请求。补充:upstream 当前缺少
test/__init__.py,Python 3.14 无法通过模块名导入既有test.*,因此使用python3 test/test_skill_runtime_boundary.py直跑并通过;本 PR 未夹带该无关基线修复。