p0-1: address review (drop unused thiserror dep, document kb-core reserve)

- Cargo.toml: remove `thiserror` from kb-config, kb-parse-types, kb-app
  (unused — none of those crates' src trees reference thiserror; CoreError
  in kb-core is the only consumer).
- kb-config keeps the `kb-core` dep with a one-line comment marking
  CoreError reserved for P1-* config-error wiring per the review thread.
- ids.rs: switch `validate_hex32` from a hand-rolled `matches!` byte range
  to `is_ascii_hexdigit()` so the hex check is the canonical idiom (and
  satisfies `clippy::manual_is_ascii_check` under `-D warnings`).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-30 08:55:39 +00:00
parent d91b60325e
commit d2c8728095
5 changed files with 2 additions and 10 deletions

3
Cargo.lock generated
View File

@@ -283,7 +283,6 @@ dependencies = [
"kb-core",
"serde",
"serde_json",
"thiserror 2.0.18",
"toml",
"tracing",
"tracing-appender",
@@ -311,7 +310,6 @@ dependencies = [
"kb-core",
"serde",
"serde_json",
"thiserror 2.0.18",
"toml",
]
@@ -335,7 +333,6 @@ version = "0.1.0"
dependencies = [
"kb-core",
"serde",
"thiserror 2.0.18",
]
[[package]]

View File

@@ -11,7 +11,6 @@ description = "Facade — orchestrates components for kb-cli/tui/desktop"
kb-core = { path = "../kb-core" }
kb-config = { path = "../kb-config" }
anyhow = { workspace = true }
thiserror = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
tracing = { workspace = true }

View File

@@ -8,9 +8,9 @@ repository = { workspace = true }
description = "Config schema + XDG path resolution"
[dependencies]
# kb-core::CoreError reserved for P1-* config errors
kb-core = { path = "../kb-core" }
anyhow = { workspace = true }
thiserror = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
toml = "0.8"

View File

@@ -53,10 +53,7 @@ fn validate_hex32(s: &str) -> Result<(), CoreError> {
s.len()
)));
}
if !s
.bytes()
.all(|b| matches!(b, b'0'..=b'9' | b'a'..=b'f' | b'A'..=b'F'))
{
if !s.bytes().all(|b| b.is_ascii_hexdigit()) {
return Err(CoreError::InvalidId(format!(
"non-hex character in {s:?}"
)));

View File

@@ -10,4 +10,3 @@ description = "Parser intermediate representations (no parser libs allowed)"
[dependencies]
kb-core = { path = "../kb-core" }
serde = { workspace = true }
thiserror = { workspace = true }