Skip to content

Commit f375e71

Browse files
authored
Merge pull request #43 from kingsoftcloud/release/0.8.0-candidate-20260729
feat: release KsADK 0.8.0
2 parents 2a6f94a + 3d69fe0 commit f375e71

358 files changed

Lines changed: 41326 additions & 16480 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 101 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
test:
1313
runs-on: ubuntu-latest
1414
env:
15-
KSADK_WEB_VERSION: "0.2.19"
15+
KSADK_WEB_VERSION: "0.3.0"
1616
steps:
1717
- uses: actions/checkout@v4
1818

@@ -59,3 +59,103 @@ jobs:
5959

6060
- name: Audit wheel and sdist file lists
6161
run: make open-source-audit-dist
62+
63+
# goal-00: google-adk 多版本 matrix。依赖窗口 >=1.34.0,<3.0,
64+
# 对最低锚点 1.34.x 与最新 2.x(2.5.x)各跑一遍全量测试,防止任何一端回归。
65+
# 版本差异统一由 ksadk/compat/adk_compat.py 收口(见 docs/adk-multi-version-compat.md)。
66+
test-adk-matrix:
67+
name: full pytest (google-adk ${{ matrix.google-adk }})
68+
runs-on: ubuntu-latest
69+
env:
70+
KSADK_WEB_VERSION: "0.3.0"
71+
strategy:
72+
fail-fast: false
73+
matrix:
74+
google-adk: ["1.34.3", "2.5.0"]
75+
steps:
76+
- uses: actions/checkout@v4
77+
78+
- name: Install uv
79+
uses: astral-sh/setup-uv@v5
80+
81+
- name: Set up Python
82+
uses: actions/setup-python@v5
83+
with:
84+
python-version: "3.11"
85+
86+
- name: Install dependencies
87+
run: uv sync --extra all
88+
89+
- name: Pin google-adk for this matrix leg
90+
run: uv pip install "google-adk==${{ matrix.google-adk }}"
91+
92+
- name: Verify google-adk version
93+
run: uv run --no-sync python -c "from importlib.metadata import version; print('google-adk', version('google-adk'))"
94+
95+
# Static web assets are deliberately not tracked in the Python source
96+
# tree; fetch and verify the released npm payload before wheel build.
97+
- name: Sync KsADK Web static assets
98+
run: make public-sync-ksadk-web-static
99+
100+
# Packaging tests inspect the wheel itself; build it in each isolated ADK
101+
# environment rather than depending on an artifact from another job.
102+
- name: Build package artifacts
103+
run: uv build
104+
105+
# --no-sync: 防止 uv run 按 lock 重新同步、把上一步行覆盖的 adk 版本回退。
106+
- name: Run full test suite
107+
run: uv run --no-sync pytest tests/ -q
108+
109+
# goal-16: Windows a2a 命令 bug 回归(用户首报:"No such command 'a2a'")。
110+
# 在本机 macOS 无法闭环 Windows,故 CI 加 Windows runner 跑 CLI smoke:
111+
# `agentengine a2a -h` 退出码 0,且 a2a 命令确已注册(非 try/except ImportError 静默吞)。
112+
test-cli-windows:
113+
name: CLI smoke (windows-latest, a2a -h 注册回归)
114+
runs-on: windows-latest
115+
env:
116+
# GitHub's non-interactive Windows output can default to cp1252 while
117+
# KsADK's public CLI help includes Chinese text.
118+
PYTHONUTF8: "1"
119+
steps:
120+
- uses: actions/checkout@v4
121+
122+
- name: Install uv
123+
uses: astral-sh/setup-uv@v5
124+
125+
- name: Set up Python
126+
uses: actions/setup-python@v5
127+
with:
128+
python-version: "3.11"
129+
130+
- name: Install dependencies
131+
run: uv sync --extra all
132+
133+
- name: a2a -h exits 0
134+
run: uv run --no-sync agentengine a2a -h
135+
136+
- name: a2a command is registered (no silent ImportError swallow)
137+
run: uv run --no-sync python -c "from ksadk.cli import _register_commands, cli; _register_commands(); assert 'a2a' in cli.commands, 'a2a command was silently swallowed'; print('a2a registered OK')"
138+
139+
test-codex-native-runtime:
140+
name: Codex native ManagedRuntime (${{ matrix.os }})
141+
runs-on: ${{ matrix.os }}
142+
strategy:
143+
fail-fast: false
144+
matrix:
145+
os: [macos-latest, windows-latest, ubuntu-latest]
146+
steps:
147+
- uses: actions/checkout@v4
148+
149+
- name: Install uv
150+
uses: astral-sh/setup-uv@v5
151+
152+
- name: Set up Python
153+
uses: actions/setup-python@v5
154+
with:
155+
python-version: "3.11"
156+
157+
- name: Install KsADK and native Codex runtime
158+
run: uv sync --extra dev --extra codex
159+
160+
- name: Import platform package, resolve binary, and start local Web
161+
run: uv run --no-sync pytest tests/test_managed_runtime_native_smoke.py -q

.github/workflows/publish-pypi.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
ksadk_web_version:
1010
description: KsADK Web npm version to bundle
1111
required: false
12-
default: "0.2.19"
12+
default: "0.3.0"
1313
approved_source_commit:
1414
description: Reviewed source commit SHA recorded in docs/maintainer-approval-record.md
1515
required: false
@@ -37,7 +37,7 @@ jobs:
3737
environment:
3838
name: pypi
3939
env:
40-
KSADK_WEB_VERSION: ${{ github.event.inputs.ksadk_web_version || '0.2.19' }}
40+
KSADK_WEB_VERSION: ${{ github.event.inputs.ksadk_web_version || '0.3.0' }}
4141
KSADK_APPROVED_SOURCE_COMMIT: ${{ github.event.inputs.approved_source_commit || vars.KSADK_APPROVED_SOURCE_COMMIT }}
4242
PUBLISH_TARGET: ${{ github.event.inputs.publish_target || 'full' }}
4343
permissions:

.github/workflows/release-check.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ on:
66
paths:
77
- "pyproject.toml"
88
- "MANIFEST.in"
9+
- "Makefile"
910
- "ksadk/**"
1011
- "ksadk_runtime_common/**"
1112
- "scripts/open_source_audit.py"
13+
- "scripts/verify_ksadk_web_static.py"
1214
- ".github/workflows/release-check.yml"
1315

1416
jobs:
@@ -25,9 +27,19 @@ jobs:
2527
with:
2628
python-version: "3.11"
2729

30+
- name: Set up Node
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: "22"
34+
2835
- name: Install dependencies
2936
run: uv sync --extra dev
3037

38+
- name: Sync pinned KsADK Web static assets
39+
env:
40+
KSADK_WEB_VERSION: "0.3.0"
41+
run: make public-sync-ksadk-web-static
42+
3143
- name: Build artifacts
3244
run: uv build
3345

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,3 +87,4 @@ site/
8787

8888
# Legacy local UI source is owned by kingsoftcloud/ksadk-web.
8989
ksadk/server/web-ui/
90+
e2e-codex-agent/

.gitleaks.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,18 @@ paths = [
2525
'''tests/test_cmd_hermes\.py''',
2626
]
2727

28+
# Route-manifest fixture checksums are deterministic SHA-256 test data, not
29+
# credentials. The public CI scans every public branch's history, including the
30+
# superseded runtime-foundation candidate where this fixture originated.
31+
[[allowlists]]
32+
description = "Allowlist deterministic route-manifest SHA-256 test fixture"
33+
regexes = [
34+
'''ac9086d1592d69d7eecd4260c2ca4bfa06b0daaed5cdf0653c4eb409204ed84d''',
35+
]
36+
paths = [
37+
'''tests/server/test_route_manifest_parity\.py''',
38+
]
39+
2840
# ---- 历史已删文档中的 OPENAI_API_KEY (疑似真 kspmas key) ----
2941
# !!! 安全前置条件 !!!
3042
# 启用本 allowlist 之前, 必须先在金山云 kspmas 控制台 rotate (吊销并重发) 该 key,

CHANGELOG.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,44 @@
77

88
## [Unreleased]
99

10+
## [0.8.0] - 2026-07-24
11+
12+
> **Review candidate, not a published release.** This section covers the work
13+
> merged after `0.7.0` on 2026-07-15. It does not assert that a PyPI/npm
14+
> package, tag, or GitHub Release exists.
15+
16+
### 亮点
17+
18+
- **统一 Runtime 基座**:冻结 `RuntimeEvent v1` 信封和六动词 `RuntimeAdapter`,补齐事件存储、按会话事件序号(`seq_id`)续订的订阅、共享 parser 与历史回放。ADK、LangGraph、A2A、Harness 和 Codex 新集成均以这一契约交换运行状态,而不是各自定义一套 SSE 语义。
19+
- **Hosted UI 进入 AG-UI + A2UI 轨道**:在不改变 OpenAI Responses 既有请求/响应语义的前提下,增加 capability 协商后的 AG-UI transport 和 A2UI activity 投影;无法协商时仍走 Responses fallback。
20+
- **可诊断的会话连续性**:runtime storage 成为会话状态的权威来源,补全结构化 Responses 历史投影、请求 metadata 透传、run 订阅心跳与 idle SSE 保活,刷新、续订、审批和恢复都能基于已持久化事件排查。
21+
- **可组合的运行形态**:加入 A2A wire 1.0 runtime、HarnessApp、CodexRuntime 和 Skill Space 路由;这些能力均保留本地/契约测试,生产环境互操作和真实凭证仍需按部署环境验收。
22+
23+
### 新增
24+
25+
- **事件与 adapter**:新增 RuntimeEvent schema、严格反序列化校验、RuntimeEventStore、session 级订阅、共享 projection/replay parser,以及 ADK/LangGraph 的 adapter contract tests。未知事件不能绕过事件边界进入 replay。
26+
- **AG-UI 与 A2UI**:新增 AG-UI route group、RuntimeEvent 到 activity 的投影、A2UI core/renderer/fixture viewer 和可持久化 action 记录。审批不是另一套 UI 协议,而是事件流中的受控交互状态。
27+
- **A2A**:新增 Agent Card、Protocol Runtime、PostgreSQL TaskStore、account + runtime 复合 owner identity、Task cancel/resume adapter、Space 内动态发现、credential provider、egress policy 与 A2A event adapter。AgentEngine 的托管 composition root 使用 Gateway 验证的五元目标绑定和受信 Card probe;它将 resume state 留在 Runtime 本地 durable storage,并为 `external_public` 提供 HTTPS-only、DNS/IP pin、禁代理、拒绝 3xx 的 NAT transport。app factory 直接装配 A2A 数据面路由;`external_vpc` 仍需单独的 VPC dialer。
28+
- **Harness 与 Codex**:新增声明式 HarnessApp composition root,模型/MCP/tool 配置校验和默认只读 sandbox policy;新增基于官方 app-server transport 的 CodexRuntime、生命周期 phase 映射及离线/显式 live 演示。真实 provider 凭证 E2E 不包含在本候选的发布结论中。
29+
- **框架与 App Factory**:新增 ADK `1.34.x`/`2.x` 兼容层及 CI matrix;server 创建改为 per-app factory/state,路由按职责拆组,WebSocket 也在请求上下文中运行。
30+
- **CLI 与诊断**:新增 `agentengine a2a``ksadk replay <session-id>``replay` 只读取已持久化的 RuntimeEvent,按 `--after-seq-id` / `--before-seq-id` 定位窗口并输出 text 或 JSON transcript;它不重跑模型、工具或副作用,旧式 SessionEvent 也不在此命令的回放范围内。
31+
- **Skills、工具与可观测性**:新增按 `space_id` 定向的 Skill Space 消费路径,并完成 tools、memory、sandbox 和 tracing adapter 的迁移,以便 Harness/runner 在同一运行边界消费它们。
32+
33+
### 修复与性能
34+
35+
- 修复 local/hosted session history 的投影和 metadata 边界,避免刷新后漏失正文、reasoning、tool、approval 或附件状态;恢复请求会先落盘 `resuming` 状态,避免 SSE 返回与持久化状态竞态。
36+
- 修复 run-event 订阅缺少心跳、空闲 SSE 被中间网络断开、MCP API/delete error 行为漂移、Windows ADK 安装与 create-agent streaming 兼容问题。
37+
- 修复 E2B sandbox 执行硬化、workspace 编辑工具选择、Hermes 项目创建,以及 PostgreSQL/in-memory session 后端的连续性与 fail-open 行为。
38+
- 为 agent-scoped session/event 查询增加 covering indexes,降低多会话历史和回放场景下的数据库扫描成本。
39+
- 托管 A2A 在 public-egress 最终投影缺失时按关闭处理;不把 Runtime reasoning、checkpoint handle 或 resume target 写入公开 A2A Task/Message metadata,取消成功后清除 Runtime-local resume state。
40+
41+
### 兼容性、迁移与评审边界
42+
43+
- OpenAI Responses 和 Chat Completions 兼容入口仍是默认基线。AG-UI/A2UI 是可选 Hosted UI 能力,不会要求现有 Responses 客户端改协议。
44+
- 旧版 LangChain 连续性 / HITL 路径不再是 `0.8` 的兼容性承诺。新接入应使用 LangGraph、ADK 或 `RuntimeAdapter`;迁移时先验证 checkpoint、interrupt 和工具语义。
45+
- 本候选的 Python 版本为 `0.8.0`,配套 Web 候选为 `@kingsoftcloud/ksadk-web@0.3.0`。Python release workflow 已固定请求该版本,并逐文件校验 npm tarball 的 `dist-ksadk`、同步目录和 wheel 内静态资源;在 Web `0.3.0` 经受保护 npm 流程发布前,公开 Python 发布会保持阻塞,不会回退到旧版本。
46+
- 公开发布仍被 review/sign-off、clean-export/public preflight、真实 staging evidence 与可选的 Codex provider E2E 阻塞;本条目不构成发布批准。
47+
1048
## [0.7.0] - 2026-07-15
1149

1250
### 亮点

Makefile

Lines changed: 38 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# AgentEngine Makefile
22
# 用于同步 KsADK Web static 和管理项目
33

4-
.PHONY: help install clean clean-cache clean-dist clean-static clean-offline dev test publish publish-test public-status public-init-worktree public-worktree-status public-sync-check public-secret-audit public-audit public-version-gate docs-site-build docs-site-dev public-test public-build-check public-build-alias-check public-preflight public-publish-check public-release-approval-check public-publish-gate public-release-tag public-review public-sync-ksadk-web-static open-source-audit-dist open-source-audit-alias-dist openclaw-build openclaw-push openclaw-size hermes-build hermes-push hermes-size sync-ksadk-web-static sync-hosted-ui build-frontend build-webui sync-static webui build-wheel build-all clean-frontend
4+
.PHONY: help install clean clean-cache clean-dist clean-static clean-offline dev test publish publish-test public-status public-init-worktree public-worktree-status public-sync-check public-secret-audit public-audit public-version-gate docs-site-build docs-site-dev public-test public-build-check public-build-alias-check public-preflight public-publish-check public-release-approval-check public-publish-gate public-release-tag public-review public-sync-ksadk-web-static open-source-audit-dist open-source-audit-alias-dist openclaw-build openclaw-push openclaw-size hermes-build hermes-push hermes-size sync-ksadk-web-static verify-ksadk-web-static verify-ksadk-web-wheel-static sync-hosted-ui build-frontend build-webui sync-static webui build-wheel build-all clean-frontend
55

66
# 默认目标
77
help:
@@ -14,7 +14,7 @@ help:
1414
@echo " make test 运行测试"
1515
@echo ""
1616
@echo " \033[1;32mWeb UI 构建:\033[0m"
17-
@echo " make sync-ksadk-web-static KSADK_WEB_VERSION=latest"
17+
@echo " make sync-ksadk-web-static KSADK_WEB_VERSION=0.3.0"
1818
@echo " 从 @kingsoftcloud/ksadk-web npm 包同步 static"
1919
@echo " make build-frontend 同步 ksadk-web static"
2020
@echo ""
@@ -267,7 +267,7 @@ PUBLIC_DOCS_URL ?= https://kingsoftcloud.github.io/ksadk-python/
267267
PUBLIC_PYPI_PROJECT ?= ksadk
268268
PUBLIC_ALIAS_PYPI_PROJECT ?= agentengine-sdk-python
269269
PUBLIC_RELEASE_TAG ?= v$(V)
270-
PUBLIC_TEST_TARGETS ?= tests/test_public_release_positioning.py tests/test_config_env_registry.py
270+
PUBLIC_TEST_TARGETS ?= tests/test_public_release_positioning.py tests/test_config_env_registry.py tests/test_managed_runtime_builder.py tests/test_managed_runtime_resolution.py tests/cli/test_cmd_create_codex.py tests/runners/test_codex_runner.py
271271

272272
public-status:
273273
@echo "==> internal worktree"
@@ -329,20 +329,24 @@ public-sync-check:
329329

330330
public-secret-audit:
331331
@echo "==> secret and sensitive-file audit"
332-
@if git ls-files | grep -E '(^|/)(\.pypirc|kubeconfig|.*\.kubeconfig|id_rsa|id_ed25519)$$'; then \
333-
echo "❌ 发现禁止跟踪的敏感文件"; \
334-
exit 1; \
332+
@if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then \
333+
if git ls-files | grep -E '(^|/)(\.pypirc|kubeconfig|.*\.kubeconfig|id_rsa|id_ed25519)$$'; then \
334+
echo "❌ 发现禁止跟踪的敏感文件"; \
335+
exit 1; \
336+
fi; \
335337
fi
336338
@python3 scripts/public_secret_audit.py
337339
@echo "✅ secret audit passed"
338340

339341
public-audit: public-secret-audit
340342
@echo "==> public source audit"
341-
@blocked=$$(git ls-files | grep -E '^(\.pypirc$$|\.zread/(wiki|site)/)' || true); \
342-
if [ -n "$$blocked" ]; then \
343-
echo "❌ blocked tracked paths:"; \
344-
echo "$$blocked"; \
345-
exit 1; \
343+
@if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then \
344+
blocked=$$(git ls-files | grep -E '^(\.pypirc$$|\.zread/(wiki|site)/)' || true); \
345+
if [ -n "$$blocked" ]; then \
346+
echo "❌ blocked tracked paths:"; \
347+
echo "$$blocked"; \
348+
exit 1; \
349+
fi; \
346350
fi
347351
@python3 scripts/open_source_audit.py --target public-repo
348352
@echo "✅ public path audit passed"
@@ -373,6 +377,7 @@ public-sync-ksadk-web-static: sync-ksadk-web-static
373377
public-build-check: clean-dist sync-ksadk-web-static
374378
@echo "==> build and twine check"
375379
@uv build
380+
@$(MAKE) verify-ksadk-web-wheel-static
376381
@uv run pytest tests/test_runtime_common_packaging.py -q
377382
@uv run --extra dev python -m twine check dist/*
378383
@$(MAKE) open-source-audit-dist
@@ -558,7 +563,10 @@ openclaw-build openclaw-push openclaw-size hermes-build hermes-push hermes-size:
558563
# ============================================================
559564

560565
STATIC_DIR := ksadk/server/static
561-
KSADK_WEB_VERSION ?= latest
566+
# The wheel must embed a published, reproducible Web bundle. 0.8.0 is coupled
567+
# to the 0.3.0 Web release; the release job must fail rather than silently
568+
# substituting an older npm package when that release is not visible yet.
569+
KSADK_WEB_VERSION ?= 0.3.0
562570
KSADK_WEB_PACKAGE ?= @kingsoftcloud/ksadk-web
563571
KSADK_WEB_TARBALL_NAME := kingsoftcloud-ksadk-web-$(patsubst v%,%,$(KSADK_WEB_VERSION)).tgz
564572
KSADK_WEB_RELEASE_URL ?=
@@ -569,7 +577,10 @@ sync-ksadk-web-static:
569577
@echo "Sync KsADK Web static assets from $(KSADK_WEB_PACKAGE)@$(KSADK_WEB_VERSION)"
570578
@rm -rf "$(KSADK_WEB_CACHE_DIR)/package"
571579
@mkdir -p "$(KSADK_WEB_CACHE_DIR)" "$(STATIC_DIR)"
572-
@if [ -n "$(KSADK_WEB_RELEASE_URL)" ]; then \
580+
@if [ -f "$(KSADK_WEB_CACHE_DIR)/$(KSADK_WEB_TARBALL_NAME)" ]; then \
581+
echo "Using cached tarball $(KSADK_WEB_TARBALL_NAME)"; \
582+
echo "$(KSADK_WEB_TARBALL_NAME)" > "$(KSADK_WEB_CACHE_DIR)/.tarball-name"; \
583+
elif [ -n "$(KSADK_WEB_RELEASE_URL)" ]; then \
573584
echo "Using explicit KSADK_WEB_RELEASE_URL=$(KSADK_WEB_RELEASE_URL)"; \
574585
curl -fL --retry 3 --retry-delay 2 --retry-all-errors "$(KSADK_WEB_RELEASE_URL)" -o "$(KSADK_WEB_CACHE_DIR)/$(KSADK_WEB_TARBALL_NAME)"; \
575586
echo "$(KSADK_WEB_TARBALL_NAME)" > "$(KSADK_WEB_CACHE_DIR)/.tarball-name"; \
@@ -592,8 +603,22 @@ sync-ksadk-web-static:
592603
@rm -rf "$(STATIC_DIR)"
593604
@mkdir -p "$(STATIC_DIR)"
594605
cp -R "$(KSADK_WEB_CACHE_DIR)/package/dist-ksadk/." "$(STATIC_DIR)/"
606+
@$(MAKE) verify-ksadk-web-static
595607
@echo "Synced KsADK Web $(KSADK_WEB_VERSION) static assets into $(STATIC_DIR)"
596608

609+
verify-ksadk-web-static:
610+
@python3 scripts/verify_ksadk_web_static.py \
611+
--expected "$(KSADK_WEB_CACHE_DIR)/package/dist-ksadk" \
612+
--actual "$(STATIC_DIR)" \
613+
--package-root "$(KSADK_WEB_CACHE_DIR)/package" \
614+
--expected-version "$(patsubst v%,%,$(KSADK_WEB_VERSION))"
615+
616+
verify-ksadk-web-wheel-static:
617+
@python3 scripts/verify_ksadk_web_static.py \
618+
--expected "$(KSADK_WEB_CACHE_DIR)/package/dist-ksadk" \
619+
--wheel "$$(ls dist/ksadk-*.whl)" \
620+
--expected-version "$(patsubst v%,%,$(KSADK_WEB_VERSION))"
621+
597622
sync-hosted-ui: sync-ksadk-web-static
598623
@echo "sync-hosted-ui is deprecated; static assets now come from $(KSADK_WEB_PACKAGE)."
599624

0 commit comments

Comments
 (0)