fix(memory): exclude orphaned entries from FTS query (LIA-370)#1040
Merged
Conversation
_fts_query (non-atom path) filtered only type!='atom', so soft-deleted entries whose entries_fts row lingered surfaced as live results. Add orphaned_at IS NULL to match _fts_atom_query. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
sliamh11
added a commit
that referenced
this pull request
Jul 17, 2026
🤖 I have created a release *beep* *boop* --- ## [1.27.0](v1.26.0...v1.27.0) (2026-07-17) ### Features * **deus-v2:** validate subscription billing through credential proxy (LIA-397) ([#1035](#1035)) ([38aa247](38aa247)) ### Bug Fixes * **admin-merge-gate:** allow admin-merge on plan-limited private repos ([#1055](#1055)) ([8d283a9](8d283a9)) * **admin-merge-gate:** exclude known-advisory checks from plan-limited fallback ([#1056](#1056)) ([8e67e6a](8e67e6a)) * **admin-merge-gate:** scope internal gh calls to the gated command's --repo ([#1054](#1054)) ([545b941](545b941)) * **code-search:** sweep orphaned rowids from vec/fts on reindex (LIA-368) ([#1042](#1042)) ([fad4885](fad4885)) * **ingress:** don't kill the OAuth refresh timer on a port-conflict retry (LIA-363) ([#1020](#1020)) ([0cf61dd](0cf61dd)) * **memory:** exclude orphaned entries from FTS query (LIA-370) ([#1040](#1040)) ([0645453](0645453)) * **memory:** re-embed nodes missing an embedding row (LIA-369) ([#1041](#1041)) ([f2855b0](f2855b0)) * **memory:** repair entries_fts write-path drift (LIA-370) ([#1043](#1043)) ([1414898](1414898)) * **runtime:** handle stream errors on tool-proxy req + container stdin (LIA-362, LIA-385) ([#1021](#1021)) ([df9df3f](df9df3f)) * **security:** fail-closed gh gate for external projects (LIA-361) ([#1013](#1013)) ([ee9b62e](ee9b62e)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
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
Audit step 3, PR-F (a query-time bug found while scoping LIA-370, split out to ship/revert cleanly).
_fts_query(the non-atom FTS search path) filtered onlytype != 'atom'. A soft-deleted entry whoseentries_ftsrow still lingered (the write-path drift fixed separately in PR-E) therefore surfaced as a live search result today.How
Add
AND e.orphaned_at IS NULLto_fts_query, matching the already-correct_fts_atom_query.Verification
New regression test
test_fts_query_excludes_orphaned_entries— verified it FAILS with the clause removed and passes with it. Native Opus + gpt + glm code-review SHIP (confirmed both FTS search paths now filter orphans; no other leak).Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com