Repository navigation
fix(cli): honor UTEKE_HOME as store path override - #1107
Merged
Merged
Conversation
The CLI resolved its store from --store or uteke.toml only, ignoring UTEKE_HOME — so an isolated-looking invocation silently opened the default (often production) database. During v0.16.0 pre-release QA this caused accidental v16+v17 schema migrations on a live DB. Resolution order is now --store > UTEKE_HOME > uteke.toml > default, via a shared resolve_store_path() used by both main and repair --rebuild (the latter resolves index paths independently and is the most destructive command to mis-target). Verified empirically: UTEKE_HOME=<empty dir> uteke doctor now reports DB=0 in that dir instead of the default store's 8045 memories. Closes #1105
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
What (description of the change)
The
utekeCLI resolved its store from--storeoruteke.tomlonly, ignoringUTEKE_HOME— so an isolated-looking invocation silently opened the default (often production) database:--storeflag >UTEKE_HOMEenv >uteke.toml [store].path> default, implemented as a sharedresolve_store_path()in the CLI cratemainandrepair --rebuild(which resolved index paths independently — the most destructive command to mis-target)#[test]to avoid the parallel env-mutation race pattern seen in ort_init)Why
Operator trap with real consequences: during v0.16.0 pre-release QA this caused accidental v16+v17 schema migrations on a live DB (additive, non-destructive, but proves the risk). Also fixes an inconsistency:
uteke-servehonorsUTEKE_HOMEfor the DB while the CLI did not.Testing
cargo test --workspace→ 11/11 suites green (55 uteke-cli tests, incl. the new precedence test, 3x stable)UTEKE_HOME=<empty dir> ./target/debug/uteke doctor→DB: 0 memoriesin that dir (previously: 8045 from prod default)cargo fmt+clippy --workspace --all-targets -D warningscleanCloses #1105