docs: 接口文档#167
Closed
pionxe wants to merge 33 commits into
Closed
Conversation
…activity-scroll # Conflicts: # internal/tui/update.go
feat(context): 支持 reactive compact 模式
pref(provider): Config/Provider 代码质量修复 — 冗余清理与结构重构
…activity-scroll # Conflicts: # internal/tui/commands.go # internal/tui/update_test.go
…into new_Feat-manual
…-activity-scroll refactor(tui): 命令菜单/Activity/filepicker/progress 组件化并合并重复入口
feat(security/tools): 为 bash 工具接入安全执行器
feat(security/tools): 为 file/grep/glob 接入统一结果安全过滤
feat(runtime/events): 新增 PermissionRequest / PermissionResolved 运行时事件
refactor: context
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
wynxing
requested changes
Apr 6, 2026
wynxing
left a comment
Collaborator
There was a problem hiding this comment.
这批接口文档整体整理得很完整,尤其是把 Runtime / Context / Provider / Tools 的边界集中到 docs/interfaces 目录这件事本身是有价值的。不过我这边看下来,当前版本还有几个关键点把“未来目标态”写成了“当前事实”,这会直接影响 context/runtime 侧后续的接口判断,建议这一轮先收敛一下再合:
Gateway目前还没有在仓库里形成稳定实现,但主规范和 README 导航把TUI/CLI/Web -> Gateway -> Runtime写成了当前固定入口模型,和现状不一致,也和迁移表里“Gateway 最后补”有冲突。- 审批流文档写成了
permission_request -> 用户确认/拒绝 -> permission_resolved,但当前 runtime 命中ask时会直接顺序发出这两个事件,并没有真实的人机确认闭环。这里如果不区分“现状”和“目标态”,客户端会被带偏。 proactive compact现在还没有形成可落地的现有契约;当前internal/context/compact只有manual/reactive,context.BuildInput也还没有配套的预算字段和自动触发链路。对 context 模块来说,这一段很容易误导后续实现。compact_start在文档里被定义成结构化 payload,但当前 runtime 发的还是裸字符串;如果消费者按文档直接解码,会和现实现不兼容。
我的建议是:
- 把文档里的内容明确拆成“当前实现基线”和“V2 目标态 / proposed”。
- 对暂未落地的能力统一标注
proposed/future/not implemented yet,不要和 current baseline 混写。 - 对事件载荷、审批闭环、compact 触发模式这几个会直接影响联调的地方,优先以当前代码行为为准,或者显式写清楚这是待实现变更。
等这些语义收敛后,这套文档会更适合作为后续接口事实源。
Collaborator
Author
现已对当前与未实现的进行了区分 |
pref(provider):增加强构造器
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.
文档在/docs/interfaces目录下。
唯一事实源,包含 Gateway、Runtime、Context、Provider、Tools、Config、事件总线、错误语义、并发语义。
动态压缩、手动 compact、reactive compact、单次重试门禁、摘要协议。
“旧协商名 -> 当前项目名 -> V2 定名”映射,标注 deprecated。