use crate::brain::agent::service::{has_investigative_intent, has_phantom_tool_intent_no_tools};
#[test]
fn user_reported_phrase_2026_05_28() {
let text = "I need to read the actual code before writing concrete task descriptions.";
assert!(
has_phantom_tool_intent_no_tools(text),
"verbatim 2026-05-28 user report must trigger the no-tools phantom detector"
);
assert!(
has_investigative_intent(text),
"must also surface as investigative intent for upstream loop-detection"
);
}
#[test]
fn english_i_need_to_check_triggers() {
let text = "I need to check the configuration before changing it.";
assert!(has_phantom_tool_intent_no_tools(text));
}
#[test]
fn english_i_have_to_verify_triggers() {
let text = "I have to verify the current state of the database schema first.";
assert!(has_phantom_tool_intent_no_tools(text));
}
#[test]
fn english_i_must_update_triggers() {
let text = "I must update the version field before tagging the release.";
assert!(has_phantom_tool_intent_no_tools(text));
}
#[test]
fn english_i_should_investigate_triggers() {
let text = "I should investigate the failure logs before suggesting a fix.";
assert!(has_phantom_tool_intent_no_tools(text));
}
#[test]
fn spanish_necesito_leer_triggers() {
let text = "¿Necesito leer el código real? Sí, primero el año pasado de configuración antes de escribir las descripciones.";
assert!(
has_phantom_tool_intent_no_tools(text),
"Spanish 'necesito leer' must trigger like English 'I need to read'"
);
}
#[test]
fn portuguese_preciso_ler_triggers() {
let text = "Preciso ler o código real antes de escrever as descrições concretas das tarefas.";
assert!(
has_phantom_tool_intent_no_tools(text),
"Portuguese 'preciso ler' must trigger"
);
}
#[test]
fn french_je_dois_lire_triggers() {
let text = "Je dois lire le vrai code avant d'écrire des descriptions de tâches concrètes.";
assert!(
has_phantom_tool_intent_no_tools(text),
"French 'je dois lire' must trigger"
);
}
#[test]
fn russian_mne_nuzhno_prochitat_triggers() {
let text = "Мне нужно прочитать актуальный код, прежде чем писать конкретные описания задач.";
assert!(
has_phantom_tool_intent_no_tools(text),
"Russian 'мне нужно прочитать' must trigger"
);
}
#[test]
fn legitimate_prose_does_not_trigger() {
let text = "The configuration is loaded from disk and merged into the runtime state.";
assert!(
!has_phantom_tool_intent_no_tools(text),
"prose without intent phrases must not trigger"
);
}
#[test]
fn quoted_user_query_about_reading_does_not_trigger() {
let text = "Sure, the answer is in the documentation under section 3.2.";
assert!(!has_phantom_tool_intent_no_tools(text));
}