Skip to content

fix(memory): exclude orphaned entries from FTS query (LIA-370)#1040

Merged
sliamh11 merged 2 commits into
mainfrom
worktree-lia-fts-query-filter
Jul 15, 2026
Merged

fix(memory): exclude orphaned entries from FTS query (LIA-370)#1040
sliamh11 merged 2 commits into
mainfrom
worktree-lia-fts-query-filter

Conversation

@sliamh11

Copy link
Copy Markdown
Owner

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 only type != 'atom'. A soft-deleted entry whose entries_fts row 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 NULL to _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

_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
sliamh11 merged commit 0645453 into main Jul 15, 2026
14 checks passed
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant