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:
teernisse
2026-02-26 10:58:24 -05:00
parent bd6d47dd70
commit a949f51bab
2 changed files with 164 additions and 37 deletions

View File

@@ -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 {