feat(workspacedeps): core — bridge CloseSend, dependency catalog with runtime overlays, runner and discovery - #1135
Draft
sheepbox8646 wants to merge 6 commits into
Draft
Conversation
sheepbox8646
force-pushed
the
workspace-deps/01-core
branch
2 times, most recently
from
September 3, 2026 09:32
9191043 to
9010b53
Compare
CloseSend half-closes the exec stream so a process fed over stdin sees EOF while its output keeps streaming; Close still cancels. The bridge pool's seven eviction sites now go through Manager.resetBridge, which notifies OnBridgeReset subscribers so per-container caches can invalidate in one place. Tests run against the real in-process bridgesvc. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017sihinqYWYNmZ9K842WqDJ
Adds internal/workspacedeps/catalog: an embedded catalog of workspace dependencies (node, python, uv from the image; codex and claude-code as managed agent CLIs) with strict manifest decoding, validation, script lookup and a manifest digest. Agent entries are pinned and a test in cmd/internal/core asserts the pins equal the runtime protocol snapshots. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017sihinqYWYNmZ9K842WqDJ
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017sihinqYWYNmZ9K842WqDJ
…nd cache The runner feeds catalog scripts to `exec sh -s` over the bridge exec stream with a prelude that neutralises stdin, takes a per-dependency lock and switches `current` atomically; results come back through a temp file so stdout/stderr stay pure log streams. Discovery probes every dependency in one exec (state.json, toolkit fallback, PATH copy, --version or the optional version script) and the cache holds per-(bot,target) snapshots that invalidate on bridge reset. Tests run scripts through the real in-process bridgesvc. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017sihinqYWYNmZ9K842WqDJ
sheepbox8646
force-pushed
the
workspace-deps/01-core
branch
from
September 3, 2026 09:44
9010b53 to
2a0ac1c
Compare
… to the catalog Agent CLIs are no longer pinned to the server's protocol snapshot: the codex and claude-code manifests drop version.pin, install resolves the latest upstream release by default (or MEMOH_DEP_VERSION when set), and every dependency gains a check-update script. node, python and uv keep the image copy as their baseline but now ship install/update/remove scripts (LTS Node from nodejs.org, CPython via uv, uv from its releases) so a managed overlay can be installed over the image copy; the manifest model gains HasImageBaseline/Installable and lets an image-sourced dependency carry scripts. The catalog-vs-protocol pin test goes away with the pin. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017sihinqYWYNmZ9K842WqDJ
…npm 11 npm 11 skips a global package's install scripts unless they are allowed explicitly, so Claude Code's postinstall was silently skipped and the log filled with allowScripts warnings. Pass --allow-scripts for the package when npm is 11 or newer; npm 10 keeps its default behaviour. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017sihinqYWYNmZ9K842WqDJ
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.
变更内容
栈
workspace-deps第 1 层:纯后端基础设施,尚无调用方与行为变化。internal/workspace/bridge:ExecStream.CloseSend()半关闭 stdin 而不 cancel 流;测试跑在真实进程内bridgesvc上。internal/workspace:7 处grpcPool.Remove收敛为Manager.resetBridge,新增OnBridgeReset回调,作为容器相关缓存的唯一失效点。internal/workspacedeps/catalog://go:embed的依赖 catalog。五个条目同等对待:Codex、Claude Code 为 managed;Node.js、Python、uv 以镜像副本为底座、可安装 managed 覆盖层。每个条目带 install/update/remove/check-update 脚本(POSIX sh;npm、nodejs.org LTS、uv 安装 CPython、uv releases),安装先落 staging 再原子切换current,同版本重装不悬空;不钉版,version.pin对任何依赖只是可选的锁定;描述为中性文案,icon为 icon 库标识。严格 yaml 解码与校验。internal/workspacedeps:stdin 脚本 runner(prelude 消除 stdin 竞争、per-dep 锁、结果经临时文件回传)、平台探测、一次 exec 探完全部依赖的 discovery(state.json → toolkit → PATH,--version或可选 version 脚本)、per-(bot,target) 缓存。--allow-scripts=<pkg>,保持全局安装包 install 脚本照常执行。deps_docker_test.go(-tags dockertest)对真实memohai/workspace:debian镜像跑通五个依赖的 install → check-update → 同版本 update → remove;CI 对 catalog 脚本跑shellcheck -s sh。验证
go test ./internal/workspace/... ./internal/workspacedeps/...通过(runner/discovery 测试经真实bridgesvc执行本机sh)。golangci-lint0 issues;20 个脚本shellcheck零告警。🤖 Generated with Claude Code
https://claude.ai/code/session_017sihinqYWYNmZ9K842WqDJ