feat(bd-3ke): add title truncation and key escaping for GitLab-to-Beads bridge
- Add truncate_title() function for bead titles (max 60 chars with ellipsis) - Add escape_project() to replace / with :: in mapping keys for filesystem safety - Add InvalidInput error code for validation errors - Add comprehensive tests for truncation, escaping, and Unicode handling Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -46,6 +46,7 @@ pub enum McErrorCode {
|
||||
// General errors
|
||||
IoError,
|
||||
InternalError,
|
||||
InvalidInput,
|
||||
}
|
||||
|
||||
impl McError {
|
||||
@@ -116,6 +117,15 @@ impl McError {
|
||||
"bv CLI not found -- is beads installed?",
|
||||
)
|
||||
}
|
||||
|
||||
/// Create an invalid input error
|
||||
pub fn invalid_input(message: impl Into<String>) -> Self {
|
||||
Self {
|
||||
code: McErrorCode::InvalidInput,
|
||||
message: message.into(),
|
||||
recoverable: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Display for McError {
|
||||
|
||||
Reference in New Issue
Block a user