Skip to content

feat(workspacedeps): cached Supermarket catalog, lifecycle service and HTTP API - #1137

Draft
sheepbox8646 wants to merge 6 commits into
workspace-deps/01-corefrom
workspace-deps/02-service-api
Draft

feat(workspacedeps): cached Supermarket catalog, lifecycle service and HTTP API#1137
sheepbox8646 wants to merge 6 commits into
workspace-deps/01-corefrom
workspace-deps/02-service-api

Conversation

@sheepbox8646

@sheepbox8646 sheepbox8646 commented Sep 2, 2026

Copy link
Copy Markdown
Member

Server 从 Supermarket 加载依赖目录并持久缓存经过验证的 release/artifact,不再因远端暂时不可用而阻塞启动。每次 install/update/reinstall/remove/check 解析最新配方;脚本预览返回 definition_revision,执行使用同一 revision。软件 version 与配方 revision 分离,rollback 在本地恢复上一版本、entrypoints 和发布来源。

增加安装记录及目录缓存的 PostgreSQL 表、team RLS、generation CAS 和来源隔离,同步 canonical 0001 与未合入的 0147。下架条目不再提供新安装,已有安装仍可使用缓存管理。HTTP/SSE 输出稳定错误码、缓存新鲜度和 revision;图标由公开的 digest 地址返回已验证缓存。Swagger 与 SDK 已重新生成。

栈第 3/6 层:#1135 → 本 PR → #1138。发布端:supermarket#20

验证:此层独立 Go 测试通过;PostgreSQL 集成测试及 down/up/重复 up 通过。最终栈的真实 API 已验证五个依赖的生命周期、发布端新增依赖无需修改 Memoh、旧预览在新发布后仍执行旧配方、下一次操作使用最新配方、回滚恢复原 revision,以及停止 Supermarket 并重启 Memoh 后的持久缓存与 preflight。

⚠️ No human QA — this PR has not been verified by a human yet. Remove this line once a human confirms the happy path.

@sheepbox8646 sheepbox8646 changed the title workspace deps/02 service api feat(workspacedeps): installation records, dependency service and HTTP API Sep 2, 2026
@sheepbox8646
sheepbox8646 force-pushed the workspace-deps/02-service-api branch from 37e76ad to ce75591 Compare September 3, 2026 08:00
@sheepbox8646
sheepbox8646 force-pushed the workspace-deps/02-service-api branch from ce75591 to f3e877c Compare September 3, 2026 09:32
@sheepbox8646
sheepbox8646 force-pushed the workspace-deps/02-service-api branch 2 times, most recently from 33a8263 to 91a9b5a Compare September 3, 2026 12:19
@sheepbox8646
sheepbox8646 force-pushed the workspace-deps/02-service-api branch from 91a9b5a to cc72161 Compare September 3, 2026 14:18
@sheepbox8646
sheepbox8646 force-pushed the workspace-deps/02-service-api branch 2 times, most recently from 2495efa to b7fe458 Compare September 7, 2026 15:45
@sheepbox8646 sheepbox8646 changed the title feat(workspacedeps): installation records, dependency service and HTTP API feat(workspacedeps): cached Supermarket catalog, lifecycle service and HTTP API Sep 7, 2026
sheepbox8646 and others added 6 commits September 7, 2026 23:56
…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
…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
sheepbox8646 force-pushed the workspace-deps/02-service-api branch from b7fe458 to b881f3b Compare September 7, 2026 15:58
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.

1 participant