[codex] Akashic v4:Message WAL、Turn Projection 与普通插件组合 - #536
Draft
kachofugetsu09 wants to merge 7 commits into
Draft
[codex] Akashic v4:Message WAL、Turn Projection 与普通插件组合#536kachofugetsu09 wants to merge 7 commits into
kachofugetsu09 wants to merge 7 commits into
Conversation
Owner
Author
|
CI 说明: |
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.
结论
这版 v4 把两件事放回同一张设计图里:
Session + Message:Session 是按seq追加的 Message WAL;没有持久 Turn、Run、Attempt 或第二消息载体。当前实现和历史只用来发现迁移约束,不作为“正确设计”的来源。本 PR 仍是设计提案,不授权实现、schema/data migration、正式 workspace 写入、部署、release 或 merge。
本次关键修正:Turn 是可替换 projection
用户给出的 case 不再被连续时间段或一次执行过程强行切开:
{U1,U2,A1}投影成一个 Turn。proactive=true、ProactiveTurn 或 Core 特判。U1,U2,P,A1显示;Turn 只是 group 标签,不改写 WAL,也不把 A1 移到 P 前面。最小事实与写入合同
Session = session_id + messages ordered by seq。message_id、session_id、seq、author、responds_to[]和 typedcontent[]。message_id管身份、幂等和引用;seq管顺序、缺口和客户端 cursor。两者不是重复字段。message_id;不再增加client_message_id。message_id;不再增加 ToolCallId、call_ref或 block-index identity。message_id幂等重试;失败 attempt 不进入 Session。并发基础只做
CauseOpenCAS;Turn 插件可额外请求封闭的 typed read condition。默认被动回复使用NoNewHumanInputAfter(source_seq),因此新的 U2 会拒绝只读过 U1 的旧草稿,而中间的 P 不会误伤 A1。HeadEquals只保留给极少数真的依赖全局 head 的行为。被动大链没有丢:改为普通插件组合
MESSAGE_REACTOR扩展槽。Proactive、Delivery 与删除也遵守同一模型
message_push/subagent 只是 Message 的来源或组合者,不复制执行模型。P 独立成 Turn 是因果结构的结果,不是 proactive 特判。(message_id, sink_id)的外部效果 projection;不复制正文、seq 或 digest,也没有随机 DeliveryId/settled。no_reply和 tombstone 不创建 DeliveryEffect。真实历史只作为 fixture
对 hua-home 的正式
sessions.db做了只读、脱敏检查,只查询 schema、role、相对 seq 与布尔特征,没有读取或输出正文和 session ID:[interrupted]marker;interrupt → 后续 user → interrupt → 后续 user → proactive → 后续普通 assistant。这只证明该交错值得做迁移 fixture,不证明旧 marker、attempt 或 proactive 分支正确。v4 fixture 的断言是:四条完整 Message 依次留在 WAL,Turn groups 为
{U1,U2,A1}与{P}。迁移与需要审批的破坏性语义
设计按纵向 Slice A–F 迁移:Message WAL → Turn shadow projection → ToolHost/recovery → 被动大链插件化 → Delivery/source handoff → tombstone projection。每一片都要求旧/新 oracle、crash point 和真实 fixture 对照,不一次替换所有 owner。
Phase 0 明确要求勘误或 supersede
projectneed及决策 0025、0034、0039、0050,并核对 0052 的 compaction/persistence 边界;本 PR 不把设计文字偷渡成已批准合同。改动范围
docs/design/0902-reviewed-v4.md:完整 v4 设计、真实链路证据、owner 表、迁移顺序和 Gate。docs/INDEX.md:新增设计索引入口。验证
git diff --check origin/mainpython docker/debug/gate.py run --base origin/maindocker/debug/reports/change-gate/20260903-172323-3c745373passed51f1467456881e7302abf76a931e9dfe698fef6c8b46ae70fce3aab2a5e56dee8934091497942677sourceDigest:7a1c712fdd9dc75fdc81e2b696cf85b990fab4c509d446436dc48bb331292bc8planDigest:3b2724b0d833f2df049cce3cc78924f8d547c63252a1c014e6284305c64852d9selectedScenarios=[]:docs-only structural Gate,不替代后续实现、迁移、crash 与真实 provider fixture。51f14674只读复核:PASS,无 must-fix 或 advisory。change-impact-gate:通过。check-and-test:失败于 Python collection;pytest -W error将 Starlette 导入anyio.abc.BlockingPortal时的第三方DeprecationWarning升为错误,影响test_dashboard_api.py、test_plugin_hot_reload.py、test_web_chat_channel.py。共收集 981 tests,测试体与 Web regressions 尚未运行。本 PR 只有 Markdown,不在这里越界修改依赖。审阅时请重点决定
Session + Message是唯一对话事实,失败 attempt 不入库。{U1,U2,A1}与独立{P}。CauseOpen是基础并发合同,额外隔离只用封闭 typed condition。message_id,不再引入额外 call/message 身份。精确版本与恢复点
47896b4200731183a54081e2eca77602a0881a0a51f1467456881e7302abf76a931e9dfe698fef6ccodex/add-akashic-v4-designrefs/backup/pre-tempp-review-v4-20260903→acf866b33054ff4f233c50eb918d9ad5a1c11991