docs: full-chain AI SDK alignment design and impact map - #200
Conversation
617060f to
d8c3d15
Compare
|
先把文档状态和架构决策分开处理:
PR 先保持开放。编号/状态修正不等于接受或否决本方案,也不要让依赖栈默认替代这一步决策。 |
eric8810
left a comment
There was a problem hiding this comment.
合并前请把以下三处文档改一致:
-
修改 RFC 编号。仓库已经有 RFC-0036,这份 RFC 请使用未占用的编号,并更新正文和附录中的引用。
-
写清楚这份 RFC 替代哪些旧决策。当前 ROADMAP 和原定位 RFC 要求旧 ABI 至少共存一个 minor 版本,并将 L2 作为独立版本化的投影;这里改成全链路 V4 对齐和一次性 breaking 切换。请在本 PR 中列出被替代的章节,并同步修改旧文档中的对应说明。原路线图里的 L0 passthrough、stdio ops、auth 和 replay 计划,也请明确哪些保留、哪些调整或后置。不需要重新写整份路线图,但不能让相互矛盾的要求同时有效。
-
按 §0.4 和 §0.5 已记录的决定,修正文中旧表述。§6.4、§10 仍有 Node/Python 宿主回调本期交付的说法,与全语言宿主回调后置不一致;文末也还有已经决定却仍写成“待拍板”的事项。请逐项改成最终结论。
这次要求是把已有决定写一致,不是重新讨论已经确定的方向。以上修改完成后再合并。
Implementation design under RFC-0036 (positioning and layered architecture), placed in docs/ rather than rfc/: it does not take an RFC number and does not re-decide direction. Compared with the earlier RFC draft of the same content: - Header states the document's relation to RFC-0036 and how it takes effect (on merge; later changes edit the file). No "Accepted" status. - §0.7 lists, item by item, which ROADMAP / RFC-0036 commitments the design keeps, adjusts or postpones: L2 choice (AI SDK V4 shape, survey RFC withdrawn), the one-shot breaking switch versus the old-ABI coexistence promise, ops protocol / stdio / L0 passthrough (kept, after the switch), B track, #174/#175 auth, #167/#179 replay, #185. ROADMAP.md and the positioning RFC carry notes pointing at that table where their wording is adjusted. - §0.4 Q4, D18, §6.4 and §10 now agree: host callbacks are postponed in every language, including the Node TSFN / Python GIL bridges. - Part II's two open items are written as conclusions (no aimux-protocol crate; JSON adaptation rules adopted), and the impact-map §6.4 questions each carry the section that settles them. - docs/README.md indexes both files; links are relative to docs/. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01WGwanvo9WLU9HWD7sRR8TS
…xAI/HF chat extension Two wording fixes so the design matches the RFC-0036 §12.2 replacement list proposed in #207: - §0.7 and the ROADMAP 0.8 note no longer leave "old exports coexist one minor" to a later decision: the full-chain cutover has no coexistence period, and the old symbols replaced when the ops ABI arrives are removed on that cutover gate (RFC-0039), so the promise is withdrawn rather than deferred. - §3.3 and the rejected-finding row S4-7 state what the implementation does with xAI / Hugging Face Chat Completions: the V4 entry points only offer Responses, and the existing Chat Completions model stays as an explicit `chat_completions(id)` extension outside the `Provider` trait, registered as a product difference. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01WGwanvo9WLU9HWD7sRR8TS
d8c3d15 to
78a2876
Compare
|
按三点改好了,head 已更新:
§0.7 与 #207 增补的 §12.2 替代清单是逐行对应的,两边合入后再互相回链;#206–#212 里标为"待接受"的新增提案(0040 的 G2/G3、0042 的 T1–T5)不算本文的决定,§0.7 已注明。 第二个提交(78a2876)对着 #207 §12.2 再对了一遍:§0.7 和 ROADMAP 0.8 那句不再把“旧导出共存一个 minor”留给以后决定,直接撤销(切换没有共存期,之后 ops ABI 的旧符号也按 RFC-0039 的切换门一次替换,与 §12.2 的 C2 / C4 行一致);§3.3 和驳回表 S4-7 写清 xAI / Hugging Face 的 Chat Completions 只作 trait 外的显式扩展保留(上游没有该入口,登记为产品差异),对应 §12.3 B5 行“撤销须明示”的要求。 另外去掉了之前顺带改 ci.yml 的提交:#203 / #204 已改到 master 上,不再需要。 Generated by Claude Code |
- complete the truncated §6.4-14 ruling in the impact map (pull-style streaming ABI: not this round, stays with the async C ABI deferral) - annotate S5-1/S5-2 with the main-doc rulings (no 2→3 migration table, no rebuild_provider; live replay is registry + target-ref driven) - mark the Part II ts-rs advice as overruled by §0.5/§6.5 inline - convert 7 markdown links into the local-only aisdk-review checkout to AI:/A: code refs (reference/ is gitignored; links 404 for others) - note the local-only reference baseline in the evidence convention - annotate the 0.6 B1+C2 ROADMAP row (B1 reshaped, C2 shim cancelled) - flatten nested-paren annotations in ROADMAP #185 rows - drop the duplicate H1 title in the impact map; bump the revision date
eric8810
left a comment
There was a problem hiding this comment.
审核:Approve
前一轮 changes requested 的三项均已确认处理:无 RFC 编号(移入 docs/)、§0.7 逐项保留/调整/后置清单 + 旧文档加注、§0.4/§0.5/§6.4/§10 旧表述按已记录决定修正。
独立核验
对文中证据做了抽查(约 20 处 file:line 断言),全部精确属实,包括:
- FFI「40 个融合工厂」= 20 对
_new/_new_with_base;「123 个 extern C」=#[unsafe(no_mangle)]计数 - 「7 处
== "groq"」、response_messages.rs:31 写死["anthropic","bedrock","amazonBedrock"]、TraceLayer scope_key 读config_snapshot().base_url(layer.rs:166-184) - as:STREAM-1(1 MiB 不可配)、pu:PU-5(空串 key 回落 env)、tl:TOOLS-1(web
env:任意变量)、bd:BIND-4(Python block_on 持 GIL) - 附录统计自洽:201 = 51 redesign + 97 偏差 + 53 bug,逐模块求和对
- 主文档与 ROADMAP/RFC-0036 的加注互相回链、锚点有效;#185 相关行与 #204 一致
评审修复(22580ef)
按审核意见同步补充:
- 补全附录 §6.4-14 缺失的裁定(原文件在此截断):本期不提供 pull 式流式 ABI,C ABI 保持同步 + push callback,与异步 C ABI 一并后置
- S5-1/S5-2 就地加注:2→3 迁移表与 rebuild_provider 两条扫描期建议已被 D24/§4.3/§4.4 否决,正文标注最终形态
- 第二部分 ts-rs 建议加注:§0.5 已裁定不采纳(ts-rs 退役,descriptor + manifest 是唯一生成链)
- 7 处指向
reference/aisdk-review的可点击死链改为AI:/A:代码引用(reference/在 .gitignore,链接对其他读者 404);证据约定注明本地检出 - ROADMAP 0.6 表 B1+C2 行补加注(B1 形式调整、C2 shim 取消);#185 两处嵌套括号展平;附录去重复 H1;Date 补修订记录
未动 ROADMAP §4(留给 #205)。
Takes the design docs as merged in #200 (including the maintainer's review fixes) and keeps this branch's follow-ups on top of them: - xAI / Hugging Face expose Responses only; the Chat Completions extension recorded in the merged doc is withdrawn (§3.3, S4-7, revision note). - Presets are a runtime descriptor table (D12, D20, §0.3, §0.7, §4.1, §5, §6.5). - §3.2: redirects are handled by the helper, same-origin only for API calls; `FetchRequest` has no redirect field. - §0.3 drops NDJSON from aimux-stream; the reference-baseline header notes that fixtures are pinned by fixtures/aisdk/VERSIONS.json. - ROADMAP: the lines that still carried superseded commitments are rewritten (C2 shim, 0.7 / 0.8 version semantics, C1 coexistence, #174 / #175, #167, C4). Where the merged text already annotated a line (B1 + C2, #185, the Part II ts-rs sentence) the merged wording is kept. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01WGwanvo9WLU9HWD7sRR8TS
Summary
Design document for the full-chain AI SDK alignment (provider → model factories, call runtime, recording/replay, identity, four-layer message protocol), implementing the direction set by RFC-0036 (positioning and layered architecture). Per review, it is documentation under RFC-0036, not a new RFC: the two files live in
docs/next toai-sdk-request-pipeline.mdand take no RFC number.docs/aisdk-architecture-alignment.md— the design (Part I provider → model chain, Part II core message protocol).docs/aisdk-architecture-impact-map.md— appendix: 201 verified findings across 12 modules, cross-module coupling chains.docs/README.mdindexes both.Changes since the RFC draft (review on d8c3d15)
docs/; title and header rewritten. The header states the relation to RFC-0036 and that the file takes effect on merge (no "Accepted" status).Fetch).authcolumn kept as descriptor data; CredentialStore / TokenRefresher postponed with host callbacks.replay_fetchat the transport leaf; "ProviderRecord = registry row + protocol" withdrawn.chat_completions(id)extension outside theProvidertrait.ROADMAP.mdandrfc/0036-positioning-and-layered-architecture.mdcarry short notes pointing at §0.7 where their wording is adjusted (L2 survey RFC, Tool-call input boundary: type the raw/parsed distinction, drop the unused StreamingToolCallTracker #185 line, 0.8 coexistence sentence). The header lines and §4 of ROADMAP are untouched to stay clear of docs: 校准 roadmap 状态与近期依赖 #205.aimux-protocolcrate; JSON adaptation rules adopted). The impact map's §6.4 list of "decisions the RFC must make" now cites, per item, the section that settles it.Decisions (§0.4, unchanged in substance)
Test plan
docs/(the../reference/aisdk-review/...source links are unchanged from the draft and point at the local review checkout, as before).🤖 Generated with Claude Code
https://claude.ai/code/session_01WGwanvo9WLU9HWD7sRR8TS