fix(knowledge): expose search body line counts - #2188
Draft
ohdearquant wants to merge 2 commits into
Draft
Conversation
…e-exact A request read-deadline expiring during the body-line aggregate turned a completed, ranked search into a hard Internal error, contradicting the documented contract that deadline-degraded rows report body_lines null. Preserve StorageError::Timeout from the lookup as Ok(None): hits are kept, atom rows report body_lines null, the response carries a degraded.body_lines_timeout flag, and the trailing deadline re-check is skipped for the already-degraded response. Non-timeout storage errors still propagate. The aggregate also counted a terminal newline as an extra line. Pin the convention to str::lines() semantics (terminal newline adds no line, blank interior lines count, empty content is 0) in the SQL expression and the verb doc, with regressions for the expired-deadline arm and the newline convention.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
body_lineson atom search results so callers can distinguish sectionless stubs from filled recordsnullfor domain results and deadline-degraded rows where atom body sizing is unavailableTesting
cargo test -p khive-pack-knowledge --test integration search_body_lines_distinguishes_filled_atom_from_stub -- --nocapturecargo test -p khive-pack-knowledgecargo clippy -p khive-pack-knowledge --all-targets -- -D warningscargo fmt --package khive-pack-knowledgeFixes #1981