fix: write namespace to [[scan]] block in generated TOMLs (#51) #53

Closed
mik-tf wants to merge 0 commits from development_fix_namespace_mismatch into development
Owner

Problem

When importing a git repo via the Import UI, vectors get stored under the namespace selected in the form (e.g. cybercity), but the library/search uses a different namespace derived from the git URL org (e.g. znzcybercity). Search returns zero results.

Root Cause

convert_ebooks_to_toml() generates [[scan]] blocks with git_url but never writes the namespace field. When export_books_for_serving() later reads these TOMLs, ScanConfig.get_namespace() finds no explicit namespace and falls back to derive_namespace_from_git_url(), producing a different namespace than what was used for the embedder.

Fix

Explicitly write namespace = "..." into both the git_url and local path branches of the scan block generation in convert_ebooks_to_toml().

  • ScanConfig already has pub namespace: Option<String> with #[serde(default)] — deserializes correctly
  • get_namespace() returns explicit namespace when set, only falls through to git-URL derivation when None
  • Backward compatible: existing TOMLs without namespace continue to auto-derive

Fixes #51

## Problem When importing a git repo via the Import UI, vectors get stored under the namespace selected in the form (e.g. `cybercity`), but the library/search uses a different namespace derived from the git URL org (e.g. `znzcybercity`). Search returns zero results. ## Root Cause `convert_ebooks_to_toml()` generates `[[scan]]` blocks with `git_url` but never writes the `namespace` field. When `export_books_for_serving()` later reads these TOMLs, `ScanConfig.get_namespace()` finds no explicit namespace and falls back to `derive_namespace_from_git_url()`, producing a different namespace than what was used for the embedder. ## Fix Explicitly write `namespace = "..."` into both the git_url and local path branches of the scan block generation in `convert_ebooks_to_toml()`. - `ScanConfig` already has `pub namespace: Option<String>` with `#[serde(default)]` — deserializes correctly - `get_namespace()` returns explicit namespace when set, only falls through to git-URL derivation when `None` - Backward compatible: existing TOMLs without `namespace` continue to auto-derive Fixes #51
fix: write namespace to [[scan]] block in generated TOMLs
All checks were successful
Test / test (pull_request) Successful in 3m16s
Test / integration (pull_request) Successful in 6m1s
cabb6a8dfe
When importing a repo via the Import UI, convert_ebooks_to_toml()
generates [[scan]] blocks but omits the namespace field. Downstream,
ScanConfig.get_namespace() falls back to derive_namespace_from_git_url(),
producing a different namespace than what was used for the embedder
vectors. Search then returns zero results.

Fix: explicitly write namespace = "..." into both the git_url and
local path branches of the scan block generation.

Fixes #51
Author
Owner

Closing: all changes from this PR are already present in development branch (verified via git merge-base --is-ancestor). Work consolidated into a new PR covering build system alignment and remaining features.

Closing: all changes from this PR are already present in `development` branch (verified via `git merge-base --is-ancestor`). Work consolidated into a new PR covering build system alignment and remaining features.
mik-tf closed this pull request 2026-02-19 01:10:52 +00:00
All checks were successful
Test / test (pull_request) Successful in 3m16s
Test / integration (pull_request) Successful in 6m1s

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_books!53
No description provided.