Skip to content

refactor: isolate task-store sdk compat and terminal immutability#464

Merged
liujuanjuan1984 merged 5 commits intomainfrom
eval/issue-446-task-store-sdk-compat
May 3, 2026
Merged

refactor: isolate task-store sdk compat and terminal immutability#464
liujuanjuan1984 merged 5 commits intomainfrom
eval/issue-446-task-store-sdk-compat

Conversation

@liujuanjuan1984
Copy link
Copy Markdown
Collaborator

@liujuanjuan1984 liujuanjuan1984 commented May 3, 2026

Summary

  • 收敛 task persistencea2a-sdk 形状的依赖:新增 task_store_sdk_compat.py,集中封装 DatabaseTaskStore 的 schema 校验、SDK shape assertion、atomic save 与 authoritative reload。
  • 收敛 task_store.py 中分散的 SDK 依赖,让主文件只保留 terminal write policy orchestration。
  • 显式固化 terminal task immutability contract:terminal task 一旦持久化即视为不可变,最终 artifact 必须先于 terminal status 发出,最终 usage / stream metadata 必须附着在 terminal event 本身。
  • 补充回归测试,覆盖 SDK shape drift fail-fast、authoritative reload 不再依赖 _from_orm()、直接对照当前 a2a-sdk _to_orm() / _from_orm() 语义的 parity tests、streaming 最终 artifact 先于 terminal status 发出,以及 persisted terminal snapshot 已包含最终 artifact 与 usage metadata。

Validation

  • bash ./scripts/doctor.sh

Issue Relation

Review Notes

  • #446 的目标是隔离 task persistence 热路径对 a2a-sdk 内部/半内部形状的耦合;本 PR 通过 compat 层集中承接该风险,并用 parity tests 约束当前 SDK 语义漂移。
  • #444 的目标是把 terminal task immutability contract 显式化并用测试固化;本 PR 已在 coordinator、task-store policy 与英文文档中同步收口。
  • 当前实现不保留旧模块导出路径兼容层,符合本服务不考虑向旧版兼容的边界。

@liujuanjuan1984 liujuanjuan1984 changed the title refactor: isolate task-store sdk compat refactor: isolate task-store sdk compat layer May 3, 2026
@liujuanjuan1984 liujuanjuan1984 changed the title refactor: isolate task-store sdk compat layer refactor: tighten task persistence contracts May 3, 2026
@liujuanjuan1984 liujuanjuan1984 changed the title refactor: tighten task persistence contracts refactor: isolate task-store sdk compat and terminal immutability May 3, 2026
@liujuanjuan1984
Copy link
Copy Markdown
Collaborator Author

已补上剩余风险收口:新增直接对照当前 a2a-sdk _to_orm() / _from_orm() 语义的 parity tests,专门用于在 SDK 语义漂移时提前失败。

相关提交:7c4db35
验证:bash ./scripts/doctor.sh 已重新通过。

@liujuanjuan1984
Copy link
Copy Markdown
Collaborator Author

liujuanjuan1984 commented May 3, 2026

已补上剩余风险收口:新增直接对照当前 a2a-sdk / 语义的 parity tests,专门用于在 SDK 语义漂移时提前失败。相关提交:。
[doctor] smoke test built wheel 已重新通过。

@liujuanjuan1984 liujuanjuan1984 marked this pull request as ready for review May 3, 2026 06:48
@liujuanjuan1984 liujuanjuan1984 merged commit 2439003 into main May 3, 2026
3 checks passed
@liujuanjuan1984 liujuanjuan1984 deleted the eval/issue-446-task-store-sdk-compat branch May 3, 2026 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant