fix: auto-index mid-size exec output for ctx_search without intent#991
Open
niemst wants to merge 1 commit into
Open
fix: auto-index mid-size exec output for ctx_search without intent#991niemst wants to merge 1 commit into
niemst wants to merge 1 commit into
Conversation
ctx_execute/ctx_execute_file output between 5KB and 100KB was returned raw inline but never indexed, so a later ctx_search could not find it. Index it as a side effect at the 5KB threshold while still returning stdout inline; intent and >100KB pointer paths unchanged. Distinct per-call source labels (execute:<lang>:<hash>) so successive execs don't clobber each other.
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.
What / Why / How
ctx_execute/ctx_execute_fileoutput between 5 KB and 100 KB was returned raw inline but never indexed — the gap between the 5 KB intent threshold and the 100 KB pointer threshold — so a laterctx_searchcould not find it. Index that range into the FTS5 content KB as a side effect at the 5 KB threshold while still returning stdout inline; theintentsearch and >100 KB pointer paths are unchanged. Each exec gets a distinct source label (execute:<lang>:<hash>/file:<path>:<hash>) so successive execs don't clobber each other's index.Affected platforms
(core exec/index path in
src/server.ts— platform-agnostic)Test plan
Added a regression test in
tests/core/server.test.ts: a ~6 KB no-intentctx_executereturns raw inline and is retrievable via search.npm testgreen (one pre-existing macOS-locale test unrelated to this change),npm run typecheckclean,npm run buildpasses (tsc + bundle + assert-bundle + assert-asymmetric-drift).Checklist
npm testpassesnpm run typecheckpassesnextbranch