refactor(rename): kb → kebab — binary, env vars, XDG paths, file renames
두 번째 commit. 사용자 facing surface (CLI binary, env vars, XDG paths) + 코드 안 single-letter token (`KB_`, `kb.sqlite`, `/kb/`, tracing target) 일괄 rename. 그리고 3 개 file rename: - 디자인 doc `2026-04-27-kb-final-form-design.md` → `2026-04-27-kebab-final-form-design.md` - 최초 보고서 `kb_local_rust_report.md` → `kebab_local_rust_report.md` - workspace ignore `.kbignore` → `.kebabignore` ## 변경 - `crates/kebab-cli/Cargo.toml`: `[[bin]] name = "kb"` → `"kebab"`. - `crates/kebab-cli/src/main.rs`: `#[command(name = "kb", …)]` → `name = "kebab"`. - 모든 `KB_*` env var (코드 + doc + 테스트) → `KEBAB_*`. apply_env prefix 매칭 + 30+ 개 setting 키 모두. - XDG paths: `~/.config/kb` / `~/.local/share/kb` / `~/.cache/kb` / `~/.local/state/kb` → `~/.config/kebab` 등. config defaults + expand_path tests + paths.rs 의 hardcode 모두. - SQLite filename: `kb.sqlite` → `kebab.sqlite` (`SQLITE_FILE` const + 테스트 hardcode 모두). - tracing target: `target: "kb-*"` → `"kebab-*"` (10+ 곳). - snapshot fixture: `.kbignore` → `.kebabignore` (`fixtures/source-fs/ tree-1.snapshot.json` 갱신). ## 검증 - `cargo test --workspace -j 1` clean (linker OOM 회피 위해 직렬). - `cargo clippy --workspace --all-targets -- -D warnings` clean. 다음 commit 에서 docs sweep. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
//! serializes vector ops, and current-thread saves the two worker
|
||||
//! threads a multi-thread runtime spawns by default.
|
||||
//!
|
||||
//! See `docs/superpowers/specs/2026-04-27-kb-final-form-design.md`
|
||||
//! See `docs/superpowers/specs/2026-04-27-kebab-final-form-design.md`
|
||||
//! §5.6 (embedding_records DDL), §6.3 (lancedb table naming),
|
||||
//! §7.2 (VectorStore), §9 (versioning).
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ impl LanceVectorStore {
|
||||
})?;
|
||||
|
||||
tracing::debug!(
|
||||
target: "kb-store-vector",
|
||||
target: "kebab-store-vector",
|
||||
vector_dir = %vector_dir.display(),
|
||||
"opened LanceVectorStore"
|
||||
);
|
||||
@@ -141,7 +141,7 @@ impl LanceVectorStore {
|
||||
.await
|
||||
.context("create_empty_table")?;
|
||||
tracing::info!(
|
||||
target: "kb-store-vector",
|
||||
target: "kebab-store-vector",
|
||||
table = table_name,
|
||||
dim,
|
||||
"created Lance table"
|
||||
@@ -275,7 +275,7 @@ impl VectorStore for LanceVectorStore {
|
||||
.context("phase 3: mark embedding_records committed")?;
|
||||
|
||||
tracing::info!(
|
||||
target: "kb-store-vector",
|
||||
target: "kebab-store-vector",
|
||||
table = %table_name,
|
||||
rows = recs.len(),
|
||||
"upsert committed"
|
||||
@@ -306,7 +306,7 @@ impl VectorStore for LanceVectorStore {
|
||||
Some(name) => name,
|
||||
None => {
|
||||
tracing::debug!(
|
||||
target: "kb-store-vector",
|
||||
target: "kebab-store-vector",
|
||||
dim,
|
||||
"search: no Lance table matches query dim — returning empty"
|
||||
);
|
||||
@@ -477,7 +477,7 @@ fn decode_lance_hits(batches: &[RecordBatch]) -> Result<Vec<LanceCandidate>> {
|
||||
fn score_from_distance(distance: f32) -> f32 {
|
||||
if distance.is_nan() {
|
||||
tracing::warn!(
|
||||
target: "kb-store-vector",
|
||||
target: "kebab-store-vector",
|
||||
"NaN cosine distance from Lance — coercing to score 0"
|
||||
);
|
||||
return 0.0;
|
||||
@@ -515,7 +515,7 @@ async fn find_matching_table(
|
||||
}
|
||||
Err(e) => {
|
||||
tracing::warn!(
|
||||
target: "kb-store-vector",
|
||||
target: "kebab-store-vector",
|
||||
table = %name,
|
||||
error = %e,
|
||||
"search: skipped unopenable table"
|
||||
|
||||
@@ -73,7 +73,7 @@ fn vector_hits_snapshot_run_1() {
|
||||
.join("vector")
|
||||
.join("run-1.json");
|
||||
|
||||
if std::env::var_os("KB_UPDATE_SNAPSHOTS").is_some() {
|
||||
if std::env::var_os("KEBAB_UPDATE_SNAPSHOTS").is_some() {
|
||||
std::fs::create_dir_all(fixture.parent().unwrap()).unwrap();
|
||||
std::fs::write(&fixture, serde_json::to_string_pretty(&actual).unwrap())
|
||||
.unwrap();
|
||||
@@ -83,7 +83,7 @@ fn vector_hits_snapshot_run_1() {
|
||||
let expected: serde_json::Value =
|
||||
serde_json::from_str(&std::fs::read_to_string(&fixture).unwrap_or_else(
|
||||
|_| panic!(
|
||||
"missing snapshot fixture at {}; run with KB_UPDATE_SNAPSHOTS=1 to create",
|
||||
"missing snapshot fixture at {}; run with KEBAB_UPDATE_SNAPSHOTS=1 to create",
|
||||
fixture.display()
|
||||
),
|
||||
))
|
||||
@@ -97,14 +97,14 @@ fn vector_hits_snapshot_run_1() {
|
||||
panic!(
|
||||
"snapshot fixture is a placeholder — regenerate on AVX hardware then commit. \
|
||||
Path: {}. To regenerate: \
|
||||
`KB_UPDATE_SNAPSHOTS=1 cargo test -p kb-store-vector -- --ignored snapshot`.",
|
||||
`KEBAB_UPDATE_SNAPSHOTS=1 cargo test -p kb-store-vector -- --ignored snapshot`.",
|
||||
fixture.display()
|
||||
);
|
||||
}
|
||||
|
||||
assert_eq!(
|
||||
actual, expected,
|
||||
"snapshot drift; rerun with KB_UPDATE_SNAPSHOTS=1 to regenerate"
|
||||
"snapshot drift; rerun with KEBAB_UPDATE_SNAPSHOTS=1 to regenerate"
|
||||
);
|
||||
|
||||
// Independent guard: scores must be non-increasing.
|
||||
|
||||
Reference in New Issue
Block a user