#[cfg(not(feature = "std"))]
use alloc::string::String;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use thiserror::Error;
#[derive(Debug, Error, PartialEq)]
pub enum ProsaicError {
#[error("missing slot `{slot}` in template `{template}`")]
MissingSlot { template: String, slot: String },
#[error("unknown template `{0}`")]
UnknownTemplate(String),
#[error("invalid pipe `{pipe}`: {reason}")]
InvalidPipe { pipe: String, reason: String },
#[error("grammar error: {0}")]
GrammarError(String),
#[error("template parse error in `{template}` at position {position}: {reason}")]
TemplateParseError {
template: String,
position: usize,
reason: String,
},
#[error("faithfulness rejected: precision {precision:.3}, polarity_match {polarity_match}")]
FaithfulnessRejection {
precision: f32,
polarity_match: bool,
},
#[error("recursive partial cycle detected: {}", cycle.join(" -> "))]
RecursivePartial { cycle: Vec<String> },
}