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:
@@ -157,17 +157,17 @@ fn hybrid_snapshot_run_1() {
|
||||
.join("hybrid")
|
||||
.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();
|
||||
eprintln!("[snapshot] regenerated {}", fixture.display());
|
||||
// Fail loudly so that accidentally setting KB_UPDATE_SNAPSHOTS
|
||||
// Fail loudly so that accidentally setting KEBAB_UPDATE_SNAPSHOTS
|
||||
// in CI surfaces as a test failure rather than a silent
|
||||
// overwrite + green run. Same fail-loud-instead-of-silent-pass
|
||||
// philosophy as P3-2's `SNAPSHOT_HASH_BASELINE = 0` and P3-3's
|
||||
// placeholder fixture guards.
|
||||
panic!(
|
||||
"[snapshot] regenerated {}, re-run without KB_UPDATE_SNAPSHOTS to verify pin",
|
||||
"[snapshot] regenerated {}, re-run without KEBAB_UPDATE_SNAPSHOTS to verify pin",
|
||||
fixture.display()
|
||||
);
|
||||
}
|
||||
@@ -176,7 +176,7 @@ fn hybrid_snapshot_run_1() {
|
||||
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",
|
||||
KEBAB_UPDATE_SNAPSHOTS=1 to create",
|
||||
fixture.display()
|
||||
)
|
||||
}))
|
||||
@@ -189,14 +189,14 @@ fn hybrid_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-search -- --ignored hybrid_snapshot`.",
|
||||
`KEBAB_UPDATE_SNAPSHOTS=1 cargo test -p kb-search -- --ignored hybrid_snapshot`.",
|
||||
fixture.display()
|
||||
);
|
||||
}
|
||||
|
||||
assert_eq!(
|
||||
actual, expected,
|
||||
"hybrid snapshot drift; rerun with KB_UPDATE_SNAPSHOTS=1 to regenerate"
|
||||
"hybrid snapshot drift; rerun with KEBAB_UPDATE_SNAPSHOTS=1 to regenerate"
|
||||
);
|
||||
|
||||
// Independent guard: fusion scores must be non-increasing across
|
||||
|
||||
@@ -29,7 +29,7 @@ impl Env {
|
||||
config.storage.data_dir = temp.path().to_string_lossy().into_owned();
|
||||
let store = SqliteStore::open(&config).expect("open store");
|
||||
store.run_migrations().expect("run migrations");
|
||||
let db_path = temp.path().join("kb.sqlite");
|
||||
let db_path = temp.path().join("kebab.sqlite");
|
||||
Self {
|
||||
_temp: temp,
|
||||
store: Arc::new(store),
|
||||
@@ -618,7 +618,7 @@ fn lexical_snapshot_run_1() {
|
||||
// `Vec<SearchHit>` for a fixed query is checked verbatim against
|
||||
// `tests/fixtures/search/lexical/run-1.json`. Update both sides in
|
||||
// the same commit when intentional changes ship.
|
||||
// Stable because rusqlite ships bundled SQLite — a tokenizer/bm25 algorithm change in a future SQLite bump will require regenerating run-1.json via `KB_UPDATE_SNAPSHOTS=1`.
|
||||
// Stable because rusqlite ships bundled SQLite — a tokenizer/bm25 algorithm change in a future SQLite bump will require regenerating run-1.json via `KEBAB_UPDATE_SNAPSHOTS=1`.
|
||||
let env = Env::new();
|
||||
let conn = env.raw_conn();
|
||||
insert_document(&conn, &id32("d"), "notes/snap.md", "Snap", "en", "primary", &[]);
|
||||
@@ -656,11 +656,11 @@ fn lexical_snapshot_run_1() {
|
||||
|
||||
let baseline_path =
|
||||
std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("tests/fixtures/search/lexical/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::write(&baseline_path, serde_json::to_string_pretty(&actual).unwrap()).unwrap();
|
||||
}
|
||||
let baseline_text = std::fs::read_to_string(&baseline_path)
|
||||
.expect("baseline snapshot must exist; run with KB_UPDATE_SNAPSHOTS=1 to seed");
|
||||
.expect("baseline snapshot must exist; run with KEBAB_UPDATE_SNAPSHOTS=1 to seed");
|
||||
let expected: serde_json::Value = serde_json::from_str(&baseline_text).unwrap();
|
||||
assert_eq!(actual, expected, "lexical run-1 snapshot drift");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user