fix: separate canonical model metadata from route policy#2367
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
jolestar
commented
Jul 21, 2026
jolestar
left a comment
Collaborator
Author
There was a problem hiding this comment.
Review by holon-reviewer ✅
Summary
This PR introduces a clean separation between canonical built-in model metadata and endpoint-specific route policy. The design is sound — BuiltInModelRoutePolicy as a sparse overlay that can only narrow (not widen) intrinsic capabilities is the right abstraction.
Code Review
Correctness:
field_diff+ double-Option pattern for nullable sparse fields is clean and correctvalidate_narrowingenforcement at catalog construction (panic on violation) is appropriate for built-in data integrityapply_route_capability_constraintcorrectly handles post-resolution narrowing with properEndpointPolicyconstraint evidenceresolve_capability_fieldsignature simplified by removingroute_builtin— capabilities now resolve from model_builtin only, with route constraints applied separately. Cleaner separation of concerns.- Legacy adapter path (
from_legacy_route_entry) provides smooth migration without breaking existing provider catalogs
Design:
- The sparse policy design (None = inherit, Some(value) = override) is idiomatic and well-documented
- StepFun migration to canonical metadata with empty route policies correctly inherits identical metadata without duplication
ModelMetadataConstraintSource::EndpointPolicyproperly distinguishes route policy constraints from transport constraints in evidence
Tests:
route_policy_cannot_enable_an_intrinsic_capability— validates narrowing invariant ✅capability_precedence_treats_discovered_false_as_unknown_but_preserves_explicit_false— tests new constraint-as-narrowing semantics with evidence ✅- StepFun registration test verifies default/plan route parity ✅
Documentation:
- Decision doc 099, RFC updates consistent with implementation ✅
Minor observation (non-blocking):
reasoning_effort_optionsfiltering changed: old code filtered empty lists, new code treatsSome(vec![])as a valid sparse override. Correct for sparse policy semantics but a subtle behavioral change to be aware of.
Verdict: No blocking issues. Ready to merge once CI passes.
Contributor
Holon Run Report
|
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.
Summary
models.catalogThis is the first narrow implementation PR for #2363. The remaining provider catalog audit and migration will follow separately, so this PR does not close the issue.
Verification
cargo fmt --all -- --checkcargo test model_catalogRUSTFLAGS="-D warnings" cargo check --all-targets