Repository navigation
V4 alignment: Decision model vs upstream DecisionModelV4 #233
Copy link
Copy link
Open
Description
Conventions
doc=docs/aisdk-architecture-alignment.mdon master a8e3a99.PIPE=docs/ai-sdk-request-pipeline.md(RFC-0031).R35=rfc/0035-host-side-tool-call-repair.md.m:= master a8e3a99.v4:= the V4 code from the Draft stack refactor(core)!: align public core types with the AI SDK V4 shapes #219 → feat(providers)!: AI SDK-shaped provider factories, request layer and replay tests #214 → fix(providers)!: align vendor packages with upstream and add missing model families #220 → refactor(core)!: public JSON equals the AI SDK JSON, one provider construction path #225 → refactor(providers)!: data-only provider configuration and stream structs #227, as combined in the split layers (D2fb0f79e5+ E28ae9b2e7). Line numbers can be off by a few lines against refactor(providers)!: data-only provider configuration and stream structs #227's head.- Layers A1 … E2 are the planned split of that Draft stack into small PRs to master (branches
rfc-0036/<layer>). "Fixed in: layer X" means the fix goes into that layer's PR. - Upstream is quoted from the npm tarballs:
ai@7.0.122,@ai-sdk/provider@4.0.19,@ai-sdk/provider-utils@5.0.51, and so on, newer versions named where they matter. V4 pins ai 7.0.127, provider 4.0.21, provider-utils 5.0.53 (fixtures/aisdk/VERSIONS.json). - Item keys (B*, C*, U*, N*, S2-*) are ids from our per-requirement check of the merged RFCs against upstream; they are kept so items can be traced.
- small master PR: an independent fix to master. alignment migration: the code lags a correct doc; this is the AI SDK alignment work itself.
Why.
- Upstream shipped this feature first as
EvaluationModelV4/experimental_evaluate:@ai-sdk/provider@4.0.19and4.0.21:src/evaluation-model/v4/;ai@7.0.122and7.0.127:src/evaluate/.
@ai-sdk/provider@4.0.22(2026-10-05) renamed it toDecisionModelV4.ai@7.0.128is the firstairelease on that provider.- aimux has its own Decision API on master (feat: support official decision providers, candidate scoring, and native media #226, RFC-0037/0038).
- Layer C2 added a second, parallel
EvaluationModelthat mirrors the pre-rename upstream. The tree now has two models for one feature, and neither matches the current upstream shape.
Fixed in.
- The alignment migration.
- The bindings' decision exports move with the binding migration (D6, last).
- Doc side: the planned alignment-doc PR updates the §5 row and the four "Evaluation out of scope" lines.
Related. RFC-0037 (Decision API) and RFC-0038 (decision providers).
Existing fixes. None.
Checklist
- C29:
Provider::evaluation_modelsits on the coreProvidertrait, and there is no evaluate operation.- Evidence:
v4: aimux-core/src/provider.rs:109, :192,provider_registry.rs:13,aimux-core/src/evaluation_model.rs:237, :249(EvaluationModel/do_evaluate, added in layer C2). - Doc: doc:86, :392, :705, :1142, :1591. Upstream:
@ai-sdk/provider@4.0.19 provider-v4.tshas no evaluation member.
- Evidence:
- N4: bump the baseline to a provider release with
DecisionModelV4.- Evidence:
fixtures/aisdk/VERSIONS.jsonpins provider 4.0.21 and ai 7.0.127, both before the rename. - Upstream:
@ai-sdk/provider@4.0.22 src/decision-model/v4/decision-model-v4.ts:7, :11, :13(specificationVersion 'v4',supportedQuestionTypes,doDecide).
- Evidence:
- N5: rename
EvaluationModeltoDecisionModel(V4 shape):do_decideandsupported_question_types.- Upstream:
decision-model-v4-call-options.ts:9-10:state: Input,questions: Record<string, Question>, plusabortSignal?,headers?,providerOptions?.decision-model-v4-question.ts: the union ischoice{instructions, criteria: Record<string, Input|null>},score{instructions, criteria: (Input|null)[]}andboolean{instructions, criteria?{true?, false?}}.decision-model-v4-result.ts:answers: Record<string, Answer>,rounding?,usage?,warnings,providerMetadata?,response?.
- Upstream:
- N6: fold the existing aimux Decision API onto that shape.
- Differences in
m: aimux-core/src/decision_model.rs:- questions are a
Vecof id'd questions (:162), not a keyed record; - extra
images(:161),max_retries(:167),timeout(:169) andrecording_context(:158); DecisionCapabilities(:321) replacessupportedQuestionTypes;- answers carry
probability_source(:330,:379).
- questions are a
- Each extra becomes
providerOptions/providerMetadata, or a documented product difference.
- Differences in
- N7: delete the duplicate model, so one decision model remains in core and in the registry (
provider_registry.rs:13). - N8: re-record the decision fixtures and replay (RFC-0037:119-125) against the new shape. Keep the recording identity-only, as the layers already do.
- N9: decision recordings stop storing
input.decision_capabilities. Supported question types are a model property, rebuilt from the host registry on replay, as upstreamDecisionModelV4.supportedQuestionTypes(@ai-sdk/provider@4.0.22 src/decision-model/v4/decision-model-v4.ts:11).- Evidence:
v4: aimux-core/src/recording.rs:158-162(InputRecord.decision_capabilities),:187-196(from_decision_optionscopies the capabilities into the recording). - Expected: drop the field from the recording input; replay looks the model up in the registry. Do it together with N6 and N8.
- Evidence:
Acceptance. A type fixture comparison against @ai-sdk/provider@4.0.22 decision-model/v4. The Jev and OpenAI decision providers pass with the new trait. A single decision_model lookup remains in the registry.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
cunninghamcard-bit commentedon Oct 14, 2026
按 #255 当前 head
22db0867对齐条目状态:DecisionModel/decide,questions/answers 使用 ID maps,扩展迁至providerOptions/providerMetadata,绑定随之迁移,录制不再保存能力快照。4.0.22;aipin 仍为7.0.127,decide实现参照7.0.128。公开 JSON 的 camelCase 由 Draft #256 承载;
decidetelemetry 按已登记范围后置。以上仅据远程源码核对,本次未运行测试。