pub fn memory_named_not_found(name: &str) -> String {
format!("memory '{name}' not found")
}
pub fn memory_named_not_found_in_namespace(name: &str, namespace: &str) -> String {
format!("memory '{name}' not found in namespace '{namespace}'")
}
pub fn memory_id_in_other_namespace(id: i64, actual: &str, requested: &str) -> String {
format!("memory id {id} exists but belongs to namespace '{actual}', not '{requested}'")
}
pub fn entity_named_not_found(name: &str) -> String {
format!("entity '{name}' not found")
}
pub fn entity_named_not_found_in_namespace(name: &str, namespace: &str) -> String {
format!("entity '{name}' not found in namespace '{namespace}'")
}
pub fn entity_named_not_found_with_suggestions(
name: &str,
namespace: &str,
suggestions: &str,
) -> String {
format!(
"entity '{name}' not found in namespace '{namespace}'. Did you mean: {suggestions}? \
Re-run with --fuzzy to auto-resolve a clear match, or pass the canonical name."
)
}
pub fn entity_id_not_found_in_namespace(id: i64, namespace: &str) -> String {
format!("entity id={id} not found in namespace '{namespace}'")
}
pub fn source_entity_not_found_in_namespace(name: &str, namespace: &str) -> String {
format!("source entity '{name}' not found in namespace '{namespace}'")
}
pub fn target_entity_not_found_in_namespace(name: &str, namespace: &str) -> String {
format!("target entity '{name}' not found in namespace '{namespace}'")
}
pub fn edge_not_found_in_namespace(
source: &str,
relation: &str,
target: &str,
namespace: &str,
) -> String {
format!("edge '{source}' --[{relation}]--> '{target}' not found in namespace '{namespace}'")
}
pub fn relationship_id_not_found(id: i64) -> String {
format!("relationship {id} not found")
}
pub fn chunk_id_not_found_in_namespace(id: i64, namespace: &str) -> String {
format!("chunk {id} not found in namespace '{namespace}'")
}
pub fn slot_not_held(slot_id: u32, path: &str) -> String {
format!("slot {slot_id} is not held (no file at {path})")
}
pub fn api_key_fingerprint_not_found(fingerprint: &str) -> String {
format!("no key with fingerprint {fingerprint}")
}
#[cfg(test)]
pub(crate) fn catalog_samples() -> Vec<String> {
vec![
memory_named_not_found("alpha"),
memory_named_not_found_in_namespace("alpha", "global"),
memory_id_in_other_namespace(7, "other", "global"),
entity_named_not_found("beta"),
entity_named_not_found_in_namespace("beta", "global"),
entity_named_not_found_with_suggestions("beta", "global", "beta-one, beta-two"),
entity_id_not_found_in_namespace(9, "global"),
source_entity_not_found_in_namespace("beta", "global"),
target_entity_not_found_in_namespace("gamma", "global"),
edge_not_found_in_namespace("beta", "uses", "gamma", "global"),
relationship_id_not_found(42),
chunk_id_not_found_in_namespace(3, "global"),
slot_not_held(2, "/tmp/slot-2.lock"),
api_key_fingerprint_not_found("ab12cd34"),
]
}