feat(workspacedeps): installation records, dependency service and HTTP API - #1137
Draft
sheepbox8646 wants to merge 6 commits into
Draft
feat(workspacedeps): installation records, dependency service and HTTP API#1137sheepbox8646 wants to merge 6 commits into
sheepbox8646 wants to merge 6 commits into
Conversation
sheepbox8646
force-pushed
the
workspace-deps/02-service-api
branch
from
September 3, 2026 08:00
37e76ad to
ce75591
Compare
sheepbox8646
force-pushed
the
workspace-deps/02-service-api
branch
from
September 3, 2026 09:32
ce75591 to
f3e877c
Compare
sheepbox8646
force-pushed
the
workspace-deps/02-service-api
branch
2 times, most recently
from
September 3, 2026 12:19
33a8263 to
91a9b5a
Compare
…store Adds migration 0146 (mirrored into 0001), team-scoped sqlc queries and a Store contract plus its Postgres implementation. The table records intent per (bot, workspace target, dependency); discovery corrects the observed columns and a stale reaper recovers interrupted operations. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017sihinqYWYNmZ9K842WqDJ
…rkflow Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017sihinqYWYNmZ9K842WqDJ
…ecks The service owns the install/update/reinstall/remove/rollback state machine over the runner, writes state.json and shims after each success, reconciles database intent against discovery (installed / missing / adopted) and exposes preflight for the enable-agent flow. Agent-class entries compare against the catalog pin; tool-class entries get a 24h upstream check worker with per-(dependency, platform) deduplication. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017sihinqYWYNmZ9K842WqDJ
Exposes the dependency service under /bots/{bot_id}/dependencies: list,
preflight, install/update/reinstall/remove as SSE log streams, rollback,
check-updates and a script preview. Adds the workspace_dependency.* error
codes with web locale strings, wires catalog/service/update worker/stale
reaper into the FX graph, runs an agent alignment scan after container
reconciliation, and regenerates swagger and the TypeScript SDK.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017sihinqYWYNmZ9K842WqDJ
…catalog endpoint
The service stops modelling agent pins: RequiredVersion, NeedsAlignment,
the alignment scan at start-up (and Manager.RunningNativeBotIDs, which only
served it) and the version_mismatch preflight reason are gone. Entries
report the copy in effect (managed → toolkit → PATH) together with the
image baseline (ImageVersion) and whether a managed overlay shadows it
(Overlay); installability follows the catalog scripts (ActionSupported,
SupportedActions, UserActions) instead of the source, so node/python/uv
overlays can be installed and removed and an agent CLI is checked upstream
like any tool. Install, update and reinstall take an optional requested
version that reaches the script as MEMOH_DEP_VERSION; the recorded version
is the one the script reports. The HTTP API exposes image_version/overlay,
accepts a {version} body, and gains the bot-independent
GET /workspace-dependencies/catalog for the Supermarket. Adds the
docker-backed test that installs, checks, updates and removes every
catalog entry against the real workspace image. Swagger and the SDK are
regenerated.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017sihinqYWYNmZ9K842WqDJ
…status Finalize every operation through a context that survives request cancellation, restore the previous record when the workspace lock or the in-memory mutex refuses an operation instead of leaving it as installing, reclaim interrupted operations during reconciliation when no instance holds the lock, and degrade the list to database records with a discovery_error instead of failing when discovery cannot run. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017sihinqYWYNmZ9K842WqDJ
sheepbox8646
force-pushed
the
workspace-deps/02-service-api
branch
from
September 3, 2026 14:18
91a9b5a to
cc72161
Compare
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第 2 层:持久化、状态机与 HTTP 面。0146_bot_dependency_installations(同步进0001_init),team RLS 四条 policy,bots 外键NOT VALID;sqlc 查询与Store契约及 Postgres 实现;集成测试纳入migrations.yml。internal/workspacedeps):install/update/reinstall/remove/rollback 状态机(内存互斥 + 数据库中间态 + stale 回收),version可选(空=最新),state.json 与 shim 由 Server 写入;三态对账(installed/missing/采纳);条目带image_version/overlay,动作集由是否有脚本与当前副本决定,底座依赖卸载=移除覆盖层;preflight(satisfied/missing/platform_unsupported);操作终态经不可取消的上下文落库,锁被占用时还原原记录,对账时回收「无人持有」的僵死中间态,discovery 失败降级为discovery_error而非 500;所有配置了 check-update 且未锁定的依赖走 24h 上游检查 worker,按 (dependency, platform) 去重扇出。/bots/{bot_id}/dependencies的 list、preflight、check-updates、script 预览、rollback,install/update/reinstall/remove 的 SSE 日志流(15s 心跳,请求断开即取消,请求体可带version);与 bot 无关的GET /workspace-dependencies/catalog;workspace_dependency.*错误码与三语文案;swagger/SDK 再生成。验证
go test ./...全绿;golangci-lint涉及包 0 issues。installSSE 真实npm install成功并生成单行state.json与 0755 shim。🤖 Generated with Claude Code
https://claude.ai/code/session_017sihinqYWYNmZ9K842WqDJ