mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 01:10:23 +08:00
Rename local candidate resolution entrypoints
This commit is contained in:
@@ -197,7 +197,7 @@ mod tests {
|
||||
use super::super::candidate_affinity_cache::remember_scheduler_affinity_for_candidate;
|
||||
use super::super::candidate_transport_ranking_facts::resolve_cached_candidate_transport_ranking_facts;
|
||||
use super::{PlannerAppState, SchedulerMinimalCandidateSelectionCandidate};
|
||||
use crate::ai_pipeline::planner::candidate_resolution::filter_and_rank_local_execution_candidates;
|
||||
use crate::ai_pipeline::planner::candidate_resolution::resolve_and_rank_local_execution_candidates;
|
||||
use crate::data::auth::GatewayAuthApiKeySnapshot;
|
||||
use crate::data::GatewayDataState;
|
||||
use crate::tunnel::TunnelAttachmentRecord;
|
||||
@@ -997,7 +997,7 @@ mod tests {
|
||||
.expect("state should build")
|
||||
.with_data_state_for_tests(data_state);
|
||||
|
||||
let (ranked, skipped) = filter_and_rank_local_execution_candidates(
|
||||
let (ranked, skipped) = resolve_and_rank_local_execution_candidates(
|
||||
PlannerAppState::new(&state),
|
||||
vec![
|
||||
sample_priority_candidate(
|
||||
@@ -1074,7 +1074,7 @@ mod tests {
|
||||
.expect("state should build")
|
||||
.with_data_state_for_tests(data_state);
|
||||
|
||||
let (ranked, skipped) = filter_and_rank_local_execution_candidates(
|
||||
let (ranked, skipped) = resolve_and_rank_local_execution_candidates(
|
||||
PlannerAppState::new(&state),
|
||||
vec![
|
||||
sample_priority_candidate(
|
||||
@@ -1147,7 +1147,7 @@ mod tests {
|
||||
.expect("state should build")
|
||||
.with_data_state_for_tests(data_state);
|
||||
|
||||
let (ranked, skipped) = filter_and_rank_local_execution_candidates(
|
||||
let (ranked, skipped) = resolve_and_rank_local_execution_candidates(
|
||||
PlannerAppState::new(&state),
|
||||
vec![
|
||||
sample_priority_candidate(
|
||||
@@ -1207,7 +1207,7 @@ mod tests {
|
||||
.expect("state should build")
|
||||
.with_data_state_for_tests(data_state);
|
||||
|
||||
let (ranked, skipped) = filter_and_rank_local_execution_candidates(
|
||||
let (ranked, skipped) = resolve_and_rank_local_execution_candidates(
|
||||
PlannerAppState::new(&state),
|
||||
vec![
|
||||
sample_priority_candidate(
|
||||
@@ -1287,7 +1287,7 @@ mod tests {
|
||||
.expect("state should build")
|
||||
.with_data_state_for_tests(data_state);
|
||||
|
||||
let (ranked, skipped) = filter_and_rank_local_execution_candidates(
|
||||
let (ranked, skipped) = resolve_and_rank_local_execution_candidates(
|
||||
PlannerAppState::new(&state),
|
||||
vec![
|
||||
sample_priority_candidate(
|
||||
@@ -1365,7 +1365,7 @@ mod tests {
|
||||
&cached_candidate,
|
||||
);
|
||||
|
||||
let (ranked, skipped) = filter_and_rank_local_execution_candidates(
|
||||
let (ranked, skipped) = resolve_and_rank_local_execution_candidates(
|
||||
PlannerAppState::new(&state),
|
||||
vec![
|
||||
sample_priority_candidate(
|
||||
@@ -1449,7 +1449,7 @@ mod tests {
|
||||
&cached_candidate,
|
||||
);
|
||||
|
||||
let (ranked, skipped) = filter_and_rank_local_execution_candidates(
|
||||
let (ranked, skipped) = resolve_and_rank_local_execution_candidates(
|
||||
PlannerAppState::new(&state),
|
||||
vec![
|
||||
cached_candidate,
|
||||
@@ -1550,7 +1550,7 @@ mod tests {
|
||||
&cached_candidate,
|
||||
);
|
||||
|
||||
let (ranked, skipped) = filter_and_rank_local_execution_candidates(
|
||||
let (ranked, skipped) = resolve_and_rank_local_execution_candidates(
|
||||
PlannerAppState::new(&state),
|
||||
vec![
|
||||
cached_candidate,
|
||||
@@ -1651,7 +1651,7 @@ mod tests {
|
||||
&cached_candidate,
|
||||
);
|
||||
|
||||
let (ranked, skipped) = filter_and_rank_local_execution_candidates(
|
||||
let (ranked, skipped) = resolve_and_rank_local_execution_candidates(
|
||||
PlannerAppState::new(&state),
|
||||
vec![
|
||||
cached_candidate,
|
||||
|
||||
@@ -37,7 +37,7 @@ impl SkippedLocalExecutionCandidate {
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) async fn filter_and_rank_local_execution_candidates(
|
||||
pub(crate) async fn resolve_and_rank_local_execution_candidates(
|
||||
state: PlannerAppState<'_>,
|
||||
candidates: Vec<SchedulerMinimalCandidateSelectionCandidate>,
|
||||
client_api_format: &str,
|
||||
@@ -50,7 +50,7 @@ pub(crate) async fn filter_and_rank_local_execution_candidates(
|
||||
Vec<SkippedLocalExecutionCandidate>,
|
||||
) {
|
||||
let requested_model = requested_model.trim();
|
||||
filter_and_rank_local_execution_candidates_with_gate(
|
||||
resolve_and_rank_local_execution_candidates_with_gate(
|
||||
state,
|
||||
candidates,
|
||||
client_api_format,
|
||||
@@ -70,7 +70,7 @@ pub(crate) async fn filter_and_rank_local_execution_candidates(
|
||||
.await
|
||||
}
|
||||
|
||||
pub(crate) async fn filter_and_rank_local_execution_candidates_without_transport_pair_gate(
|
||||
pub(crate) async fn resolve_and_rank_local_execution_candidates_without_transport_pair_gate(
|
||||
state: PlannerAppState<'_>,
|
||||
candidates: Vec<SchedulerMinimalCandidateSelectionCandidate>,
|
||||
client_api_format: &str,
|
||||
@@ -83,7 +83,7 @@ pub(crate) async fn filter_and_rank_local_execution_candidates_without_transport
|
||||
Vec<SkippedLocalExecutionCandidate>,
|
||||
) {
|
||||
let requested_model = requested_model.map(str::trim);
|
||||
filter_and_rank_local_execution_candidates_with_gate(
|
||||
resolve_and_rank_local_execution_candidates_with_gate(
|
||||
state,
|
||||
candidates,
|
||||
client_api_format,
|
||||
@@ -102,7 +102,7 @@ pub(crate) async fn filter_and_rank_local_execution_candidates_without_transport
|
||||
.await
|
||||
}
|
||||
|
||||
async fn filter_and_rank_local_execution_candidates_with_gate<F>(
|
||||
async fn resolve_and_rank_local_execution_candidates_with_gate<F>(
|
||||
state: PlannerAppState<'_>,
|
||||
candidates: Vec<SchedulerMinimalCandidateSelectionCandidate>,
|
||||
client_api_format: &str,
|
||||
|
||||
@@ -11,7 +11,7 @@ use crate::ai_pipeline::planner::candidate_metadata::{
|
||||
LocalExecutionCandidateMetadataParts,
|
||||
};
|
||||
use crate::ai_pipeline::planner::candidate_resolution::{
|
||||
extract_pool_sticky_session_token, filter_and_rank_local_execution_candidates,
|
||||
extract_pool_sticky_session_token, resolve_and_rank_local_execution_candidates,
|
||||
SkippedLocalExecutionCandidate,
|
||||
};
|
||||
use crate::ai_pipeline::planner::common::extract_requested_model_from_request;
|
||||
@@ -107,7 +107,7 @@ pub(crate) async fn materialize_local_same_format_provider_candidate_attempts(
|
||||
current_unix_secs(),
|
||||
)
|
||||
.await?;
|
||||
let (candidates, skipped_candidates) = filter_and_rank_local_execution_candidates(
|
||||
let (candidates, skipped_candidates) = resolve_and_rank_local_execution_candidates(
|
||||
planner_state,
|
||||
candidates,
|
||||
spec_metadata.api_format,
|
||||
|
||||
@@ -14,7 +14,7 @@ use crate::ai_pipeline::planner::candidate_metadata::{
|
||||
build_local_execution_candidate_metadata,
|
||||
build_local_execution_candidate_metadata_for_candidate, LocalExecutionCandidateMetadataParts,
|
||||
};
|
||||
use crate::ai_pipeline::planner::candidate_resolution::filter_and_rank_local_execution_candidates_without_transport_pair_gate;
|
||||
use crate::ai_pipeline::planner::candidate_resolution::resolve_and_rank_local_execution_candidates_without_transport_pair_gate;
|
||||
use crate::ai_pipeline::planner::decision_input::{
|
||||
build_local_authenticated_decision_input, resolve_local_authenticated_decision_input,
|
||||
};
|
||||
@@ -90,7 +90,7 @@ pub(super) async fn materialize_local_gemini_files_candidate_attempts(
|
||||
)
|
||||
.await?;
|
||||
let (candidates, skipped_candidates) =
|
||||
filter_and_rank_local_execution_candidates_without_transport_pair_gate(
|
||||
resolve_and_rank_local_execution_candidates_without_transport_pair_gate(
|
||||
planner_state,
|
||||
candidates,
|
||||
GEMINI_FILES_CLIENT_API_FORMAT,
|
||||
|
||||
@@ -13,7 +13,7 @@ use crate::ai_pipeline::planner::candidate_metadata::{
|
||||
build_local_execution_candidate_metadata_for_candidate, LocalExecutionCandidateMetadataParts,
|
||||
};
|
||||
use crate::ai_pipeline::planner::candidate_resolution::{
|
||||
extract_pool_sticky_session_token, filter_and_rank_local_execution_candidates,
|
||||
extract_pool_sticky_session_token, resolve_and_rank_local_execution_candidates,
|
||||
SkippedLocalExecutionCandidate,
|
||||
};
|
||||
use crate::ai_pipeline::planner::decision_input::{
|
||||
@@ -153,7 +153,7 @@ async fn materialize_local_openai_image_candidate_attempts(
|
||||
input.required_capabilities.as_ref(),
|
||||
LocalCandidatePersistencePolicyKind::ImageDecision,
|
||||
);
|
||||
let (candidates, skipped_candidates) = filter_and_rank_local_execution_candidates(
|
||||
let (candidates, skipped_candidates) = resolve_and_rank_local_execution_candidates(
|
||||
state,
|
||||
candidates,
|
||||
api_format,
|
||||
|
||||
@@ -15,7 +15,7 @@ use crate::ai_pipeline::planner::candidate_metadata::{
|
||||
build_local_execution_candidate_metadata_for_candidate, LocalExecutionCandidateMetadataParts,
|
||||
};
|
||||
use crate::ai_pipeline::planner::candidate_resolution::{
|
||||
extract_pool_sticky_session_token, filter_and_rank_local_execution_candidates,
|
||||
extract_pool_sticky_session_token, resolve_and_rank_local_execution_candidates,
|
||||
SkippedLocalExecutionCandidate,
|
||||
};
|
||||
use crate::ai_pipeline::planner::common::extract_requested_model_from_request;
|
||||
@@ -165,7 +165,7 @@ async fn materialize_local_video_create_candidate_attempts(
|
||||
input.required_capabilities.as_ref(),
|
||||
LocalCandidatePersistencePolicyKind::VideoDecision,
|
||||
);
|
||||
let (candidates, skipped_candidates) = filter_and_rank_local_execution_candidates(
|
||||
let (candidates, skipped_candidates) = resolve_and_rank_local_execution_candidates(
|
||||
state,
|
||||
candidates,
|
||||
api_format,
|
||||
|
||||
@@ -14,7 +14,7 @@ use crate::ai_pipeline::planner::candidate_metadata::{
|
||||
LocalExecutionCandidateMetadataParts,
|
||||
};
|
||||
use crate::ai_pipeline::planner::candidate_resolution::{
|
||||
extract_pool_sticky_session_token, filter_and_rank_local_execution_candidates,
|
||||
extract_pool_sticky_session_token, resolve_and_rank_local_execution_candidates,
|
||||
SkippedLocalExecutionCandidate,
|
||||
};
|
||||
use crate::ai_pipeline::planner::candidate_source::auth_snapshot_allows_cross_format_candidate;
|
||||
@@ -174,7 +174,7 @@ pub(super) async fn materialize_local_standard_candidate_attempts(
|
||||
}
|
||||
}
|
||||
}
|
||||
let (candidates, skipped_candidates) = filter_and_rank_local_execution_candidates(
|
||||
let (candidates, skipped_candidates) = resolve_and_rank_local_execution_candidates(
|
||||
planner_state,
|
||||
candidates,
|
||||
spec_metadata.api_format,
|
||||
|
||||
@@ -14,7 +14,7 @@ use crate::ai_pipeline::planner::candidate_metadata::{
|
||||
LocalExecutionCandidateMetadataParts,
|
||||
};
|
||||
use crate::ai_pipeline::planner::candidate_resolution::{
|
||||
extract_pool_sticky_session_token, filter_and_rank_local_execution_candidates,
|
||||
extract_pool_sticky_session_token, resolve_and_rank_local_execution_candidates,
|
||||
SkippedLocalExecutionCandidate,
|
||||
};
|
||||
use crate::ai_pipeline::planner::materialization_policy::{
|
||||
@@ -130,7 +130,7 @@ pub(crate) async fn materialize_local_openai_chat_candidate_attempts(
|
||||
input.required_capabilities.as_ref(),
|
||||
LocalCandidatePersistencePolicyKind::OpenAiChatDecision,
|
||||
);
|
||||
let (candidates, skipped_candidates) = filter_and_rank_local_execution_candidates(
|
||||
let (candidates, skipped_candidates) = resolve_and_rank_local_execution_candidates(
|
||||
planner_state,
|
||||
candidates,
|
||||
"openai:chat",
|
||||
|
||||
@@ -18,7 +18,7 @@ use crate::ai_pipeline::planner::candidate_metadata::{
|
||||
LocalExecutionCandidateMetadataParts,
|
||||
};
|
||||
use crate::ai_pipeline::planner::candidate_resolution::{
|
||||
extract_pool_sticky_session_token, filter_and_rank_local_execution_candidates,
|
||||
extract_pool_sticky_session_token, resolve_and_rank_local_execution_candidates,
|
||||
SkippedLocalExecutionCandidate,
|
||||
};
|
||||
use crate::ai_pipeline::planner::candidate_source::auth_snapshot_allows_cross_format_candidate;
|
||||
@@ -230,7 +230,7 @@ pub(crate) async fn materialize_local_openai_responses_candidate_attempts(
|
||||
}
|
||||
}
|
||||
}
|
||||
let (candidates, skipped_candidates) = filter_and_rank_local_execution_candidates(
|
||||
let (candidates, skipped_candidates) = resolve_and_rank_local_execution_candidates(
|
||||
planner_state,
|
||||
candidates,
|
||||
spec_metadata.api_format,
|
||||
|
||||
@@ -447,8 +447,8 @@ fn ai_pipeline_planner_separates_local_candidate_resolution_from_ranking() {
|
||||
"candidate_resolution.rs should rank eligible candidates before applying pool-internal account scheduling"
|
||||
);
|
||||
for pattern in [
|
||||
"pub(crate) async fn filter_and_rank_local_execution_candidates(",
|
||||
"pub(crate) async fn filter_and_rank_local_execution_candidates_without_transport_pair_gate(",
|
||||
"pub(crate) async fn resolve_and_rank_local_execution_candidates(",
|
||||
"pub(crate) async fn resolve_and_rank_local_execution_candidates_without_transport_pair_gate(",
|
||||
"pub(crate) async fn read_candidate_transport_snapshot(",
|
||||
] {
|
||||
assert!(
|
||||
@@ -475,7 +475,7 @@ fn ai_pipeline_planner_separates_local_candidate_resolution_from_ranking() {
|
||||
for forbidden in [
|
||||
"struct SkippedLocalExecutionCandidate",
|
||||
"async fn current_local_execution_candidate_skip_reason(",
|
||||
"pub(crate) async fn filter_and_rank_local_execution_candidates(",
|
||||
"pub(crate) async fn resolve_and_rank_local_execution_candidates(",
|
||||
"resolve_transport_proxy_snapshot_with_tunnel_affinity",
|
||||
] {
|
||||
assert!(
|
||||
@@ -499,7 +499,7 @@ fn ai_pipeline_planner_separates_local_candidate_resolution_from_ranking() {
|
||||
for forbidden in [
|
||||
"apply_scheduler_candidate_ranking",
|
||||
"rank_eligible_local_execution_candidates",
|
||||
"filter_and_rank_local_execution_candidates",
|
||||
"resolve_and_rank_local_execution_candidates",
|
||||
] {
|
||||
assert!(
|
||||
!candidate_affinity_cache.contains(forbidden),
|
||||
@@ -524,7 +524,7 @@ fn ai_pipeline_planner_separates_local_candidate_resolution_from_ranking() {
|
||||
for forbidden in [
|
||||
"apply_scheduler_candidate_ranking",
|
||||
"rank_eligible_local_execution_candidates",
|
||||
"filter_and_rank_local_execution_candidates",
|
||||
"resolve_and_rank_local_execution_candidates",
|
||||
] {
|
||||
assert!(
|
||||
!candidate_transport_ranking_facts.contains(forbidden),
|
||||
@@ -1326,7 +1326,7 @@ fn ai_pipeline_specialized_files_attempts_consume_eligible_local_candidates_with
|
||||
);
|
||||
assert!(
|
||||
specialized_files_support
|
||||
.contains("filter_and_rank_local_execution_candidates_without_transport_pair_gate("),
|
||||
.contains("resolve_and_rank_local_execution_candidates_without_transport_pair_gate("),
|
||||
"specialized files support should source runtime gating from candidate_resolution"
|
||||
);
|
||||
assert!(
|
||||
|
||||
Reference in New Issue
Block a user