Skip to content

fix(cli): map syntext IndexNotFound and auto-build content index in query code - #243

Merged
geekgonecrazy merged 3 commits into
devfrom
fix/query-code-auto-build-content-index
Oct 8, 2026
Merged

geekgonecrazy merged 3 commits into
devfrom
fix/query-code-auto-build-content-index

Conversation

@geekgonecrazy

Copy link
Copy Markdown
Contributor

Problem

atomic vault query code failed with an "Internal error... run st index" message when the content index didn't exist. st is syntext's own CLI — its error leaked through because the From<IndexError> impl didn't map syntext 1.4's IndexError::IndexNotFound variant (it only mapped IndexError::Io(NotFound)).

Changes

  • atomic-repository/src/content_search.rs: map IndexError::IndexNotFound(_) → ContentSearchError::IndexNotFound so users get the friendly hint instead of an "internal bug" report
  • atomic-cli/src/commands/query/mod.rs: query code now auto-builds the content index (with spinner) when missing, mirroring what enrich phase 8 does

Testing

Verified on a scratch repo: fresh index build on first query code invocation, subsequent searches work.

…uery code

- Map IndexError::IndexNotFound in From<IndexError> so a missing index
  surfaces the friendly hint instead of leaking syntext's internal
  `st index` error as an internal bug
- query code now builds the content index automatically when missing
Auto-building made the command silently slow. Catch IndexNotFound and
point at `atomic vault query index` (enrich also builds it). Keep the
From<IndexError> fix so the missing index surfaces as IndexNotFound
instead of leaking syntext's `st index` internal error.
The intent-attest external-signer tests redirect the config area via
ATOMIC_CONFIG_DIR and fail on Windows with 'identity not found' —
dirs::home_dir() there resolves the profile known-folder, not HOME, so
env redirection never applied. Resolve the identity store the same way
atomic-config resolves config.toml (ATOMIC_CONFIG_DIR wins, then
~/.atomic), making the documented knob cover the whole config area.
@geekgonecrazy
geekgonecrazy merged commit 699804a into dev Oct 8, 2026
8 checks passed
@geekgonecrazy
geekgonecrazy deleted the fix/query-code-auto-build-content-index branch October 8, 2026 22:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant