use std::collections::{BTreeMap, BTreeSet};
use std::path::{Path, PathBuf};
use serde::{Deserialize, Serialize};
use crate::config::Config;
const NUDGE_CLASSIFIER_FILE: &str = "nudge.toml";
const BUNDLED_NUDGE_CLASSIFIER: &str = include_str!("classifiers/nudge.toml");
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum NudgeClass {
PendingAction,
DeferredAnswer,
PlanUpdate,
FinalAnswer,
Unknown,
}
#[derive(Debug, Clone, PartialEq)]
pub struct NudgeClassification {
pub class: NudgeClass,
pub score: f32,
}
impl NudgeClassification {
pub fn is_pending_action(&self) -> bool {
matches!(
self.class,
NudgeClass::PendingAction | NudgeClass::DeferredAnswer | NudgeClass::PlanUpdate
)
}
pub fn is_plan_update(&self) -> bool {
self.class == NudgeClass::PlanUpdate
}
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct NudgeClassifierConfig {
#[serde(default = "default_classifier_version")]
pub version: u32,
#[serde(default = "default_min_score")]
pub min_score: f32,
#[serde(default = "default_min_margin")]
pub min_margin: f32,
#[serde(default)]
pub classes: BTreeMap<String, NudgeClassConfig>,
}
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
pub struct NudgeClassConfig {
#[serde(default)]
pub matchers: Vec<String>,
#[serde(default)]
pub nudge: String,
}
impl Default for NudgeClassifierConfig {
fn default() -> Self {
bundled_nudge_config()
}
}
fn default_classifier_version() -> u32 {
1
}
fn default_min_score() -> f32 {
0.28
}
fn default_min_margin() -> f32 {
0.03
}
fn bundled_nudge_config() -> NudgeClassifierConfig {
toml::from_str(BUNDLED_NUDGE_CLASSIFIER).expect("bundled nudge classifier template is valid")
}
fn bundled_nudge_classes() -> BTreeMap<String, NudgeClassConfig> {
bundled_nudge_config().classes
}
impl NudgeClassifierConfig {
pub fn load_file(path: &Path) -> anyhow::Result<Self> {
match std::fs::read_to_string(path) {
Ok(text) => {
let cfg: Self = toml::from_str(&text)?;
Ok(cfg.with_builtin_fallbacks())
}
Err(e) if e.kind() == std::io::ErrorKind::NotFound => Ok(Self::default()),
Err(e) => Err(e.into()),
}
}
pub fn load_from_dir(dir: &Path) -> anyhow::Result<Self> {
Self::load_file(&dir.join(NUDGE_CLASSIFIER_FILE))
}
fn with_builtin_fallbacks(mut self) -> Self {
let builtins = bundled_nudge_classes();
for (class, bundled) in builtins {
self.classes
.entry(class)
.and_modify(|configured| {
if configured.matchers.is_empty() {
configured.matchers = bundled.matchers.clone();
}
if configured.nudge.trim().is_empty() {
configured.nudge = bundled.nudge.clone();
}
})
.or_insert(bundled);
}
if self.min_score <= 0.0 {
self.min_score = default_min_score();
}
if self.min_margin < 0.0 {
self.min_margin = default_min_margin();
}
self
}
}
#[derive(Debug, Clone)]
pub struct NudgeClassifier {
cfg: NudgeClassifierConfig,
}
impl Default for NudgeClassifier {
fn default() -> Self {
Self::builtin()
}
}
impl NudgeClassifier {
pub fn builtin() -> Self {
Self {
cfg: NudgeClassifierConfig::default(),
}
}
pub fn from_config(cfg: NudgeClassifierConfig) -> Self {
Self {
cfg: cfg.with_builtin_fallbacks(),
}
}
pub fn load_from_dir(dir: &Path) -> anyhow::Result<Self> {
Ok(Self::from_config(NudgeClassifierConfig::load_from_dir(
dir,
)?))
}
pub fn load_default() -> Self {
#[cfg(test)]
{
Self::builtin()
}
#[cfg(not(test))]
{
let Some(dir) = classifier_config_dir() else {
return Self::builtin();
};
match Self::load_from_dir(&dir) {
Ok(classifier) => classifier,
Err(e) => {
tracing::warn!(
path = %dir.join(NUDGE_CLASSIFIER_FILE).display(),
error = %e,
"failed to load nudge classifier config; using built-ins"
);
Self::builtin()
}
}
}
}
pub fn classify(&self, text: &str) -> NudgeClassification {
let query = tokens(text);
if query.is_empty() {
return NudgeClassification {
class: NudgeClass::Unknown,
score: 0.0,
};
}
let query_words: Vec<_> = words(text).collect();
let opening = &query_words[..query_words.len().min(3)];
let deferred_prototypes: Vec<_> = self
.cfg
.classes
.iter()
.filter(|(name, _)| parse_nudge_class(name) == Some(NudgeClass::DeferredAnswer))
.flat_map(|(_, cfg)| &cfg.matchers)
.map(|example| tokens(example))
.collect();
let class_specificity = |class| {
self.cfg
.classes
.iter()
.filter(|(name, _)| parse_nudge_class(name) == Some(class))
.flat_map(|(_, cfg)| &cfg.matchers)
.filter(|example| {
class != NudgeClass::DeferredAnswer
|| words(example).take(3).eq(opening.iter().cloned())
})
.map(|example| tokens(example))
.filter(|prototype| {
class != NudgeClass::PendingAction || !deferred_prototypes.contains(prototype)
})
.map(|prototype| jaccard(&query, &prototype))
.fold(0.0_f32, f32::max)
};
let mut scored: Vec<(NudgeClass, f32)> = self
.cfg
.classes
.iter()
.filter_map(|(class, class_cfg)| {
let class = parse_nudge_class(class)?;
if class == NudgeClass::DeferredAnswer {
return None;
}
let best = class_cfg
.matchers
.iter()
.map(|example| {
let prototype = tokens(example);
if class == NudgeClass::PendingAction {
let phrase: Vec<_> = words(example).take(3).collect();
if phrase.is_empty()
|| !query_words.windows(phrase.len()).any(|part| part == phrase)
{
return jaccard(&query, &prototype);
}
}
prototype_similarity(&query, &prototype)
})
.fold(0.0_f32, f32::max);
Some((class, best))
})
.collect();
scored.sort_by(|a, b| b.1.partial_cmp(&a.1).unwrap_or(std::cmp::Ordering::Equal));
let Some((class, score)) = scored.first().copied() else {
return NudgeClassification {
class: NudgeClass::Unknown,
score: 0.0,
};
};
let runner_up = scored.get(1).map(|(_, s)| *s).unwrap_or(0.0);
if score < self.cfg.min_score || (score - runner_up) < self.cfg.min_margin {
return NudgeClassification {
class: NudgeClass::Unknown,
score,
};
}
let class = if class == NudgeClass::PendingAction
&& !text.contains('?')
&& class_specificity(NudgeClass::DeferredAnswer)
> class_specificity(NudgeClass::PendingAction) + self.cfg.min_margin
{
NudgeClass::DeferredAnswer
} else {
class
};
NudgeClassification { class, score }
}
pub fn is_pending_action(&self, text: &str) -> bool {
self.classify(text).is_pending_action()
}
pub fn direction_for(&self, class: NudgeClass) -> Option<&str> {
self.cfg
.classes
.get(nudge_class_key(class))
.map(|class_cfg| class_cfg.nudge.as_str())
.map(str::trim)
.filter(|direction| !direction.is_empty())
.or_else(|| match class {
NudgeClass::DeferredAnswer => self.direction_for(NudgeClass::PendingAction),
_ => None,
})
}
}
pub fn classifier_config_dir() -> Option<PathBuf> {
Config::user_config_dir().map(|dir| dir.join("classifiers"))
}
fn parse_nudge_class(s: &str) -> Option<NudgeClass> {
match s.trim().to_ascii_lowercase().replace('-', "_").as_str() {
"pending_action" | "continue" | "continuation" => Some(NudgeClass::PendingAction),
"deferred_answer" => Some(NudgeClass::DeferredAnswer),
"plan_update" | "update_plan" | "stale_plan" | "replan" => Some(NudgeClass::PlanUpdate),
"final_answer" | "final" | "done" => Some(NudgeClass::FinalAnswer),
_ => None,
}
}
fn nudge_class_key(class: NudgeClass) -> &'static str {
match class {
NudgeClass::PendingAction => "pending_action",
NudgeClass::DeferredAnswer => "deferred_answer",
NudgeClass::PlanUpdate => "plan_update",
NudgeClass::FinalAnswer => "final_answer",
NudgeClass::Unknown => "unknown",
}
}
fn words(s: &str) -> impl Iterator<Item = String> + '_ {
s.split(|c: char| !c.is_alphanumeric())
.filter(|raw| !raw.is_empty())
.map(str::to_ascii_lowercase)
}
fn tokens(s: &str) -> BTreeSet<String> {
words(s).filter(|t| t.len() >= 3).collect()
}
fn jaccard(a: &BTreeSet<String>, b: &BTreeSet<String>) -> f32 {
if a.is_empty() || b.is_empty() {
return 0.0;
}
let intersection = a.intersection(b).count() as f32;
let union = a.union(b).count() as f32;
if union == 0.0 {
0.0
} else {
intersection / union
}
}
fn prototype_similarity(query: &BTreeSet<String>, prototype: &BTreeSet<String>) -> f32 {
if query.is_empty() || prototype.is_empty() {
return 0.0;
}
let overlap = query.intersection(prototype).count() as f32;
let prototype_recall = overlap / prototype.len() as f32;
jaccard(query, prototype).max(prototype_recall)
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn unfinished_summary_and_tool_promises_are_pending_actions() {
let classifier = NudgeClassifier::builtin();
for text in [
"This remains a large file. Let me summarize the current state and what could be improved:",
"Let me check the current working directory and available git operations:",
] {
assert!(classifier.is_pending_action(text), "{text}: {:?}", classifier.classify(text));
}
assert!(!classifier.is_pending_action("The files were examined; everything checks out."));
}
#[test]
fn pending_handoffs_preserve_action_and_object_paraphrases() {
let classifier = NudgeClassifier::builtin();
for text in [
"Next steps: replace the redundant wrapper, then run the check.",
"Next steps: remove the duplicate helper, then run cargo check.",
] {
assert!(
classifier.is_pending_action(text),
"{text}: {:?}",
classifier.classify(text)
);
}
}
#[test]
fn embedded_verification_promises_preserve_action_paraphrases() {
let classifier = NudgeClassifier::builtin();
for text in [
"The issue is understood. Let me inspect the code before running the check.",
"Now I understand the issue. Let me verify by looking at format_rollup_detail.",
] {
assert!(
classifier.is_pending_action(text),
"{text}: {:?}",
classifier.classify(text)
);
}
}
#[test]
fn reports_and_partial_answers_do_not_become_recovery_promises() {
let classifier = NudgeClassifier::builtin();
for text in [
"partial answer before the break",
"First I checked the build and verified the result. The work is complete; the tests pass.",
"Let me summarize the completed work: the file was edited, the tests passed, and the requested result is ready.",
"The next steps are complete: the duplicate helper was removed and the check passed.",
] {
assert!(!classifier.is_pending_action(text), "{text}: {:?}", classifier.classify(text));
}
}
#[test]
fn completed_check_report_is_not_a_deferred_promise() {
let report = "Both operations executed and returned real results this turn.
## Restart Smoke Check
| Check | Result |
|---|---|
| `scrybe__state` (read-only) | MCP reachable — live state returned: active tab `report.md` (not dirty), view `both`, theme `default`, vim off, wrap on. **4 open tabs** now (the original dashboard, the project board note, the companion DRAFT, and v2). |
| `git rev-parse --is-inside-work-tree` | **`true`** — exit 0; `/workspace/project` is a valid work tree, so the `git` executable and filesystem grants are intact after restart. |
Both permanent grants (MCP and exec/fs) survived the restart. Nothing opened, edited, tested, queried, or sent. Stopping here.";
let classifier = NudgeClassifier::builtin();
assert!(
!classifier.is_pending_action(report),
"shared check/state/git nouns are not a promise: {:?}",
classifier.classify(report)
);
}
#[test]
fn nudge_classifier_builtin_matches_known_phrases() {
let classifier = NudgeClassifier::builtin();
assert!(classifier.is_pending_action(
"Plan is current — no update needed. Continuing with step 2: inserting the progressive dispatch into lib.rs."
));
assert!(classifier.is_pending_action(
"\
Summary
Progress so far: Step 2 is in progress.
Current blocker: The for loop needs to iterate over the slice directly.
The fix is to use for entry in page.entries.iter().
Next steps needed:
1. Fix the iteration type error in lib.rs.
2. Add tests.
3. Run just check."
));
assert!(classifier.is_pending_action("Now I'll add the --home flag to the Cli struct."));
assert!(classifier.is_pending_action("Let me keep editing now."));
assert!(classifier.is_pending_action(
"I found the issue - there's an extra closing brace } on line 809 of help_sections.rs that's causing a syntax error. I need to remove this stray brace."
));
assert!(classifier.is_pending_action(
"I have two issues: duplicate topic_has_rollups and a stray brace. Let me fix both — read around 490 to see what needs removing, then verify with a build check."
));
assert!(!classifier.is_pending_action("The capital of France is Paris."));
assert!(!classifier.is_pending_action("Done. Let me know if you want any further changes."));
assert!(!classifier.is_pending_action(
"The duplicate helper definitions and stray brace were removed, and the build check passed."
));
assert!(
classifier
.direction_for(NudgeClass::PendingAction)
.is_some_and(|d| d.contains("emit the tool call now")),
"bundled classifier should carry output direction text"
);
}
#[test]
fn nudge_classifier_refines_evidence_promises_without_changing_action_corpus() {
let classifier = NudgeClassifier::builtin();
for key in ["pending_action", "deferred_answer"] {
for text in &classifier.cfg.classes[key].matchers {
assert!(classifier.is_pending_action(text), "{key}: {text}");
}
}
assert_eq!(classifier.classify(
"Let me check the local branches and the top-level remote remotes to be complete."
).class, NudgeClass::DeferredAnswer);
for text in [
"Let me check the current working directory and available git operations.",
"Let me summarize the current state and what could be improved.",
"Let me verify the code before I give the answer.",
] {
assert_eq!(
classifier.classify(text).class,
NudgeClass::DeferredAnswer,
"an evidence-only promise must remain recoverable on read-only turns: {text}"
);
}
for text in [
"I found the issue: there is an extra closing brace causing a syntax error. I need to remove this stray brace.",
"Current blocker: the for loop needs a one line fix. Next steps needed: fix the iteration type error in lib.rs.",
"Next I will add the tests.",
] {
assert_eq!(classifier.classify(text).class, NudgeClass::PendingAction, "{text}");
}
assert_eq!(
classifier.direction_for(NudgeClass::DeferredAnswer),
classifier.direction_for(NudgeClass::PendingAction)
);
let mut config = NudgeClassifierConfig::default();
config.classes.get_mut("deferred_answer").unwrap().matchers =
vec!["Checking the ledger comes before answering your question.".to_string()];
config
.classes
.get_mut("pending_action")
.unwrap()
.matchers
.push("Checking the ledger comes before answering your question.".to_string());
assert_eq!(
NudgeClassifier::from_config(config)
.classify("Checking the ledger comes before answering your question.")
.class,
NudgeClass::DeferredAnswer,
"refinement uses the same configurable data"
);
}
#[test]
fn nudge_classifier_refinement_requires_the_configured_opening() {
let classifier = NudgeClassifier::builtin();
for text in [
"There are three local branches. Let me check the current implementation and identify any gaps.",
"Let me be clear: I cannot check the current implementation because access is unavailable.",
"Do not let me check the current implementation and identify any gaps.",
"The earlier reply said 'Let me check the current implementation and identify any gaps.'",
] {
assert_ne!(classifier.classify(text).class, NudgeClass::DeferredAnswer, "{text}");
}
}
#[test]
fn nudge_classifier_refines_legacy_defaults() {
let mut legacy = NudgeClassifierConfig::default();
let evidence = legacy.classes.remove("deferred_answer").unwrap().matchers;
let pending = &mut legacy.classes.get_mut("pending_action").unwrap().matchers;
for example in &evidence {
if !pending.contains(example) {
pending.push(example.clone());
}
}
pending.push(evidence[0].to_uppercase());
let classifier = NudgeClassifier::from_config(legacy.clone());
for example in &evidence {
assert_eq!(
classifier.classify(example).class,
NudgeClass::DeferredAnswer,
"old copied default: {example}"
);
}
}
#[test]
fn nudge_classifier_preserves_custom_coarse_corpus() {
let mut legacy = NudgeClassifierConfig::default();
let evidence = legacy.classes.remove("deferred_answer").unwrap().matchers;
legacy.classes.get_mut("pending_action").unwrap().matchers =
vec!["Proceeding with the patch by editing the target file.".to_string()];
let before = NudgeClassifier {
cfg: legacy.clone(),
};
let after = NudgeClassifier::from_config(legacy);
for example in evidence {
let previous = before.classify(&example);
let mut current = after.classify(&example);
if current.class == NudgeClass::DeferredAnswer {
current.class = NudgeClass::PendingAction;
}
assert_eq!(
current, previous,
"subtype fallback must not expand a configured action corpus"
);
}
}
#[test]
fn pending_action_recall_preserves_custom_exact_and_paraphrased_promises() {
let mut config = NudgeClassifierConfig::default();
config.classes.get_mut("pending_action").unwrap().matchers =
vec!["Proceeding with the patch by editing the target file.".to_string()];
let classifier = NudgeClassifier::from_config(config);
for text in [
"Proceeding with the patch by editing the target file.",
"I am editing the target file for this patch.",
"The location is confirmed. Proceeding with the patch by editing the target file.",
] {
assert!(
classifier.is_pending_action(text),
"{text}: {:?}",
classifier.classify(text)
);
}
}
#[test]
fn nudge_classifier_separates_plan_update_summaries_from_final_summaries() {
let classifier = NudgeClassifier::builtin();
let findings = "\
Summary of Findings
Across the tool calls, I observed two issues in newt-tui/src/help_sections.rs:
1. Duplicate function
2. Stray closing brace
Current Status
The build is broken due to these syntax errors. The plan was at step 2, but we need to fix the immediate compilation issues first.
Next Steps Required
To continue, I would need to remove the duplicate function using edit_file, remove the stray brace using edit_file, verify cargo check, then proceed with step 2 of the plan.
However, I've reached the tool-call limit and cannot make these edits now.";
let classified = classifier.classify(findings);
assert_eq!(classified.class, NudgeClass::PlanUpdate);
assert!(classified.is_pending_action());
assert!(classified.is_plan_update());
let resume_handoff = "\
Summary
I reached the tool-call limit. Current state of newt-tui/src/help_sections.rs:
duplicate topic_has_rollups and rollup_page_for_topic definitions need to be removed.
Recommended next action if session resumes:
1. Fix the duplicate functions.
2. Clean up the broken test block.
3. Read lib.rs and wire the progressive dispatch.
The build is currently broken due to the duplicate definitions — that's the blocker for any further progress.";
assert_eq!(
classifier.classify(resume_handoff).class,
NudgeClass::PlanUpdate
);
let final_summary =
classifier.classify("Here is a summary of what I found across the tool calls.");
assert_eq!(final_summary.class, NudgeClass::FinalAnswer);
}
#[test]
fn nudge_classifier_loads_dropin_from_classifiers_dir() {
let dir = tempfile::tempdir().unwrap();
let classifiers = dir.path().join("classifiers");
std::fs::create_dir_all(&classifiers).unwrap();
std::fs::write(
classifiers.join(NUDGE_CLASSIFIER_FILE),
r#"
version = 1
min_score = 0.20
min_margin = 0.01
[classes.pending_action]
matchers = ["Proceeding with the patch by editing the target file."]
nudge = "Call the edit tool now."
[classes.final_answer]
matchers = ["No changes are needed."]
"#,
)
.unwrap();
let classifier = NudgeClassifier::load_from_dir(&classifiers).unwrap();
assert!(
classifier.is_pending_action("Proceeding with the patch by editing the target file.")
);
assert!(!classifier.is_pending_action("No changes are needed."));
assert_eq!(
classifier.direction_for(NudgeClass::PendingAction),
Some("Call the edit tool now.")
);
assert!(
classifier
.direction_for(NudgeClass::PlanUpdate)
.is_some_and(|d| d.contains("Update the plan first")),
"partial user configs still inherit bundled nudges"
);
}
#[test]
fn classifier_dir_is_under_user_config_dir() {
let dir = classifier_config_dir().unwrap_or_else(|| PathBuf::from(".newt/classifiers"));
assert!(dir.ends_with("classifiers"));
}
}
pub fn user_turn_invites_action(task: &str) -> bool {
let t = task.trim().trim_end_matches(['!', '.', ' ']).to_lowercase();
if t.is_empty() {
return true; }
const SOCIAL: &[&str] = &[
"thanks",
"thank you",
"ok",
"okay",
"great",
"excellent",
"nice",
"cool",
"awesome",
"perfect",
"good",
"lgtm",
"sounds good",
"got it",
"you're welcome",
"no worries",
];
if t.len() <= 60 && SOCIAL.iter().any(|w| t.starts_with(w)) {
return false;
}
let mut lead = t.as_str();
for prefix in [
"please ",
"can you ",
"could you ",
"would you ",
"will you ",
"now ",
] {
if let Some(rest) = lead.strip_prefix(prefix) {
lead = rest;
}
}
const MUTATING: &[&str] = &[
"fix",
"push",
"commit",
"edit",
"create",
"make",
"write",
"build",
"run ",
"install",
"deploy",
"merge",
"delete",
"remove",
"refactor",
"implement",
"add ",
"apply",
"rebase",
"rename",
"move",
"update",
"patch",
"revert",
"release",
"publish",
"start",
"stop",
"restart",
"clean",
"format",
"test ",
];
let leads_mutating = MUTATING.iter().any(|v| lead.starts_with(v));
const REPORTING: &[&str] = &[
"give me",
"show",
"list",
"tell me",
"explain",
"summarize",
"summarise",
"describe",
"analyze",
"analyse",
"review",
"compare",
"what",
"which",
"why",
"how",
"who",
"where",
"assess",
"evaluate",
"your top",
"your take",
"thoughts on",
"read ",
];
let leads_reporting = REPORTING.iter().any(|v| lead.starts_with(v));
if leads_reporting {
return false;
}
if t.ends_with('?') {
return leads_mutating;
}
true
}
#[cfg(test)]
mod invites_action_tests {
use super::user_turn_invites_action;
#[test]
fn transcript_cases_from_the_2026_07_14_session() {
assert!(!user_turn_invites_action("excellent! Thank you!"));
assert!(!user_turn_invites_action("thank you!"));
assert!(!user_turn_invites_action(
"Give me your top 5 improvements to make LLM effectiveness better inside this harness please?"
));
assert!(!user_turn_invites_action(
"what do you think of the MCP integration story?"
));
assert!(!user_turn_invites_action(
"review the OCAP confinement model"
));
assert!(user_turn_invites_action(
"Make a branch for me to examine with your commits on them please."
));
assert!(user_turn_invites_action(
"can you push the branch to origin for me?"
));
assert!(user_turn_invites_action(
"fix the failing test in backend_probe"
));
assert!(user_turn_invites_action("continue"));
assert!(user_turn_invites_action(""));
}
}
const BARE_CONTINUATION_PHRASES: &[&str] = &[
"continue",
"please continue",
"continue please",
"yes continue",
"keep going",
"go on",
"carry on",
"resume",
"proceed",
"go ahead",
"next",
"finish",
"finish up",
"keep at it",
"don't stop",
"onward",
"retry",
"try again",
"try now",
"go",
"land it",
"ship it",
"do it",
];
pub fn is_bare_continuation(input: &str) -> bool {
let t = input.trim();
if t.is_empty() || t.contains('\n') || t.chars().count() > 48 {
return false;
}
let t = t.trim_end_matches(['.', '!', '?', '…', ' ']).to_lowercase();
let t = match t.split_once([':', '.', ')']) {
Some((head, rest)) if !head.is_empty() && head.chars().all(|c| c.is_ascii_digit()) => {
rest.trim().to_string()
}
_ => t,
};
BARE_CONTINUATION_PHRASES.iter().any(|p| *p == t)
}
#[cfg(test)]
mod bare_continuation_tests {
use super::is_bare_continuation;
#[test]
fn bare_nudges_match() {
for input in [
"continue",
"Continue.",
" keep going ",
"go ahead!",
"resume",
"1: proceed",
"2. continue",
"don't stop",
"retry",
"retry?",
"try again",
"try again?",
"try now?",
"continue?",
"go",
"land it",
"ship it",
"do it",
] {
assert!(is_bare_continuation(input), "{input:?} must link");
}
}
#[test]
fn substantive_or_ambiguous_input_stays_fresh() {
for input in [
"",
"ok",
"thanks",
"continue with the newt-tui refactor instead",
"extract the next largest module and open a PR",
"continue\nand also fix the tests",
"proceed to delete the production database",
"retry the build with --release",
"try again tomorrow?",
"what should I try now?",
] {
assert!(!is_bare_continuation(input), "{input:?} must stay fresh");
}
}
}