use crate::rules::{Evidence, Finding, Rule, Stance, Trend};
use crate::session_state::Seen;
use crate::shell::Parsed;
pub const RULE: Rule = Rule {
id: "file-reread",
default_stance: Stance::Advise,
evidence: Evidence {
per_1000: 81.1,
measured: "2026-09-09",
trend: Trend::Flat(4),
},
examine,
confirm: None,
};
fn examine(_parsed: &Parsed) -> Option<Finding> {
None
}
pub fn phrase(path: &str, seen: &Seen) -> (String, String) {
let window = if seen.window == "full" {
"whole".to_string()
} else {
format!("lines {}", seen.window.replace(':', " to +"))
};
(
format!(
"`{path}` was already read {} file operation{} ago in this session ({window}, \
{} bytes) and is unchanged on disk since — what it says is already in \
context.",
seen.calls_ago,
if seen.calls_ago == 1 { "" } else { "s" },
seen.bytes
),
"Use what was read, or Read only the window you need with `offset`/`limit`. A file \
edited since is read again without comment."
.to_string(),
)
}