use std::path::Path;
use super::config::Steering;
const EXPLORE_V2_SYSTEM: &str = include_str!("prompts/explore_v2.system.md");
pub fn system_prompt(_steering: Steering, _root: &Path) -> String {
EXPLORE_V2_SYSTEM.trim_end().to_string()
}
pub const NUDGE: &str = "You are almost out of tool calls. If you already have the code points you need, stop searching now and give your final answer: one location per line, like `python:django/db/models/query.py#QuerySet@326`, and nothing else.";
pub const FORCE_FINAL_ANSWER: &str = "Stop searching now — the exploration phase is over. Based ONLY on the tool outputs above, give your final answer: the code points you located, one location per line, like `python:django/db/models/query.py#QuerySet@326`, and nothing else. An empty answer scores zero — give your best-effort locations from the tool outputs above.";
pub const FORCE_STRICT: &str = "You have NO tools available — do NOT emit any tool call or any `<...>` tag text. Output ONLY the code points you already found, one location per line, like `python:django/db/models/query.py#QuerySet@326`. Give your best effort from the tool outputs above — do not return nothing.";
pub const LEAK_RETRY: &str = "Your previous message contained a tool call in an invalid format, so it did NOT run and produced no result. Re-issue that tool call now as a proper function/tool call (not text). Then continue.";
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn system_prompt_is_the_flat_v2_contract() {
let p = system_prompt(Steering::Standard, &std::env::temp_dir());
assert!(p.contains("location lines"), "v2 output contract present");
assert!(!p.contains("<final_answer>"), "no legacy final_answer wrapper");
assert!(!p.contains("[GROVE_SECTION]"), "no arm placeholder");
assert!(!p.contains("MANDATORY TOOL POLICY"), "no strict arm");
assert!(!p.contains("${WORK_DIR}"), "no template vars");
assert_eq!(p, system_prompt(Steering::Strict, &std::env::temp_dir()));
assert_eq!(p, system_prompt(Steering::Balanced, &std::env::temp_dir()));
}
#[test]
fn convergence_messages_carry_a_concrete_example() {
let example = "python:django/db/models/query.py#QuerySet@326";
assert!(NUDGE.contains(example));
assert!(FORCE_FINAL_ANSWER.contains(example));
assert!(FORCE_STRICT.contains(example));
assert!(!FORCE_FINAL_ANSWER.contains("return an empty answer"));
}
}