Skip to content

[codex] 迁移 Citation 到组合 API - #2

Merged
kachofugetsu09 merged 3 commits into
mainfrom
codex/citation-v3
Aug 21, 2026
Merged

[codex] 迁移 Citation 到组合 API#2
kachofugetsu09 merged 3 commits into
mainfrom
codex/citation-v3

Conversation

@kachofugetsu09

@kachofugetsu09 kachofugetsu09 commented Aug 14, 2026

Copy link
Copy Markdown
Member

目标

把 Citation 的 prompt、回答预处理、持久 metadata 与 cleanup 行为迁到 v3 组合 API;本层暂留 v2 phase 实现,只作为同文件差分 oracle。后续清理 PR 会物理删除 v2。

依赖 Core kachofugetsu09/akashic-agent#438 及其 stacked 前置 PR。

实现

  • 模块导出 api_version = 3nameversioninjectapply(ctx, config)
  • 三个 typed serial lifecycle listener 复用原领域函数
  • cited IDs 进入 AfterReasoningCtx.persist_assistant_metadata
  • Citation 自己提供 citation.protocol Service,Core 无 Citation 特判
  • Service 最后发布,使依赖插件先卸载、Citation listener 后清理
  • CitationPlugin 和 phase modules 仅保留到下一层清理 PR

行为等价

  • prompt section 内容与位置相同
  • §cited 提取、meme tag 暂留、inline memory ref 清理相同
  • recall_memory tool-chain fallback 相同
  • cleanup 后对外 reply 相同
  • legacy slot 与 v3 metadata 的 cited_memory_ids 相同

精确依赖

  • Core: a047470a39d4f7d2e6be1d2a8e2824916d52fad1
  • plugin-contracts: 4dd69dd621e029e51e99aa428443fa3a4ec1f6cf

验证

  • current Core pytest: 6 passed
  • v3 contract: passed,报告 api_version=3entrypoint=module,同时校验迁移期 CitationPlugin
  • 真实 PluginManager 从 source 副本加载为 ComposablePlugin: passed
  • legacy/v3 lifecycle 差分: passed
  • BasedPyright: 0 errors(现有 v2/stub 路径有 70 warnings)
  • compileall / git diff --check: passed

恢复点

  • Git tag: backup/citation-v3-before-current-core-20260816
  • 原始 PR head: 7527251b88c7530b20685f38b5dbab6107fc1f5b

@kachofugetsu09
kachofugetsu09 merged commit a9abeb3 into main Aug 21, 2026
2 checks passed
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