mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-03 09:50:21 +08:00
Unify candidate ranking pipeline
This commit is contained in:
@@ -423,6 +423,7 @@ fn ai_pipeline_planner_separates_local_candidate_eligibility_from_affinity_ranki
|
||||
for pattern in [
|
||||
"mod candidate_affinity;",
|
||||
"mod candidate_eligibility;",
|
||||
"mod candidate_resolution;",
|
||||
"mod candidate_preparation;",
|
||||
] {
|
||||
assert!(
|
||||
@@ -431,19 +432,30 @@ fn ai_pipeline_planner_separates_local_candidate_eligibility_from_affinity_ranki
|
||||
);
|
||||
}
|
||||
|
||||
let candidate_eligibility =
|
||||
read_workspace_file("apps/aether-gateway/src/ai_pipeline/planner/candidate_eligibility.rs");
|
||||
let candidate_resolution =
|
||||
read_workspace_file("apps/aether-gateway/src/ai_pipeline/planner/candidate_resolution.rs");
|
||||
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 read_candidate_transport_snapshot(",
|
||||
] {
|
||||
assert!(
|
||||
candidate_eligibility.contains(pattern),
|
||||
"planner/candidate_eligibility.rs should own {pattern}"
|
||||
candidate_resolution.contains(pattern),
|
||||
"planner/candidate_resolution.rs should own {pattern}"
|
||||
);
|
||||
}
|
||||
|
||||
let candidate_eligibility =
|
||||
read_workspace_file("apps/aether-gateway/src/ai_pipeline/planner/candidate_eligibility.rs");
|
||||
assert!(
|
||||
candidate_eligibility.contains("pub(crate) use super::candidate_resolution::*;"),
|
||||
"planner/candidate_eligibility.rs should remain a compatibility shim"
|
||||
);
|
||||
assert!(
|
||||
!candidate_eligibility.contains("async fn filter_and_rank_local_execution_candidates("),
|
||||
"planner/candidate_eligibility.rs should not keep resolution implementation"
|
||||
);
|
||||
|
||||
let candidate_affinity =
|
||||
read_workspace_file("apps/aether-gateway/src/ai_pipeline/planner/candidate_affinity.rs");
|
||||
assert!(
|
||||
@@ -1233,11 +1245,11 @@ 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("),
|
||||
"specialized files support should source runtime gating from candidate_eligibility"
|
||||
"specialized files support should source runtime gating from candidate_resolution"
|
||||
);
|
||||
assert!(
|
||||
!specialized_files_support.contains("rank_local_execution_candidates("),
|
||||
"specialized files support should not bypass candidate_eligibility with raw affinity ranking"
|
||||
"specialized files support should not bypass candidate_resolution with raw affinity ranking"
|
||||
);
|
||||
|
||||
let specialized_files_decision = read_workspace_file(
|
||||
|
||||
@@ -254,12 +254,20 @@ fn scheduler_candidate_runtime_paths_depend_on_scheduler_core_and_state_trait()
|
||||
"selection.rs should not depend on gateway-local SchedulerAffinityTarget"
|
||||
);
|
||||
assert!(
|
||||
selection.contains("reorder_candidates_by_scheduler_health_in_core"),
|
||||
"selection.rs should depend on core candidate reorder helper"
|
||||
selection.contains("enumerate_scheduler_candidates("),
|
||||
"selection.rs should delegate candidate enumeration"
|
||||
);
|
||||
assert!(
|
||||
selection.contains("collect_selectable_candidates_from_keys"),
|
||||
"selection.rs should depend on core selectable-candidate collector"
|
||||
selection.contains("read_candidate_runtime_selection_snapshot("),
|
||||
"selection.rs should delegate runtime snapshot loading"
|
||||
);
|
||||
assert!(
|
||||
selection.contains("resolve_scheduler_candidate_selectability("),
|
||||
"selection.rs should delegate selectability resolution"
|
||||
);
|
||||
assert!(
|
||||
selection.contains("rank_scheduler_candidates("),
|
||||
"selection.rs should delegate final ranking"
|
||||
);
|
||||
for pattern in [
|
||||
"async fn collect_selectable_candidates(",
|
||||
@@ -282,8 +290,10 @@ fn scheduler_candidate_runtime_paths_depend_on_scheduler_core_and_state_trait()
|
||||
"read_provider_concurrent_limits(",
|
||||
"read_provider_key_rpm_states(",
|
||||
"candidate_is_selectable_with_runtime_state",
|
||||
"collect_selectable_candidates_from_keys",
|
||||
"auth_api_key_concurrency_limit_reached",
|
||||
"build_provider_concurrent_limit_map(",
|
||||
"reorder_candidates_by_scheduler_health",
|
||||
] {
|
||||
assert!(
|
||||
!selection.contains(pattern),
|
||||
@@ -558,8 +568,8 @@ fn scheduler_candidate_runtime_paths_depend_on_scheduler_core_and_state_trait()
|
||||
let planner_candidate_affinity =
|
||||
read_workspace_file("apps/aether-gateway/src/ai_pipeline/planner/candidate_affinity.rs");
|
||||
assert!(
|
||||
planner_candidate_affinity
|
||||
.contains("aether_scheduler_core::SchedulerMinimalCandidateSelectionCandidate"),
|
||||
planner_candidate_affinity.contains("use aether_scheduler_core::{")
|
||||
&& planner_candidate_affinity.contains("SchedulerMinimalCandidateSelectionCandidate"),
|
||||
"planner/candidate_affinity.rs should depend directly on core minimal candidate DTO"
|
||||
);
|
||||
assert!(
|
||||
|
||||
Reference in New Issue
Block a user