feat: Mode A hybrid pipeline with graceful degradation to C
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
use alpha_id::pipeline::Pipeline;
|
||||
use alpha_id::model::{Config, Filter, Mode};
|
||||
|
||||
#[test]
|
||||
fn mode_a_degrades_to_c_when_ionos_unreachable() {
|
||||
let mut cfg = Config::load("config/default.toml").unwrap();
|
||||
cfg.ionos_base_url = "http://127.0.0.1:1".into(); // refused
|
||||
let p = Pipeline::load(&cfg).unwrap();
|
||||
let res = p.suggest("Diabetes mellitus Typ 2", Mode::A, &Filter::default(), 10);
|
||||
assert!(res.diagnostics.degraded); // fell back
|
||||
assert!(!res.suggestions.is_empty()); // still answered
|
||||
assert!(res.suggestions.iter().any(|s| s.icd_code.starts_with("E11")));
|
||||
}
|
||||
Reference in New Issue
Block a user