powermem icon indicating copy to clipboard operation
powermem copied to clipboard

bug: PreparedContext drops quoted stopword evidence on SeekDB and OceanBase 5.0.1

Open hireview001 opened this issue 1 month ago • 0 comments

Describe the bug

On embedded SeekDB and OceanBase 5.0.1, PreparedContext returns an empty result for a same-scope Topic Memory containing the quoted stopword requested by the caller. PR #1979 promises that quoted stopwords remain searchable. Its checked-in public runtime regression independently fails at the tested commit.

Steps to reproduce

At commit 0c1dfc289b28e9f529555fb57bf771ce51103913, install the project with its test and SeekDB dependencies, then run:

POWERCONTEXT_TEST_MIGRATION_SEEKDB=1 python -m pytest 'tests/e2e/test_unified_lexical_search.py::test_prepared_topic_recall_preserves_evidence_after_stopwords[seekdb-"the"]' -q --junitxml=lexical.xml

This test owns a new local embedded database directory. It opens the public built-in runtime, creates a Scope and a Topic Memory with title "deploymentmarker", summary "the not", detail "Durable deployment evidence", then calls scoped context prepare. The query is the test's STOPWORD_PREFIX followed by the literal quoted term "the"; assembly selects topic-memory with limit 8 and max_bytes 8192. No external database or model provider is used.

Expected behavior

The result is ready and includes the stored artifact reference. Surrounding unquoted stopwords must not remove explicitly quoted evidence.

Actual behavior

Independent execution against the immutable commit:

tests/e2e/test_unified_lexical_search.py:74: AssertionError
assert result.status == "ready"
AssertionError: assert 'empty' == 'ready'
1 failed in 11.75s

Impact demonstrated here is limited to this Topic Memory PreparedContext query. Embedded SeekDB and OceanBase 5.0.1 were independently verified as described here; direct search behavior and other database versions have not been established by these reproductions.

Environment

  • PowerContext commit: 0c1dfc289b28e9f529555fb57bf771ce51103913
  • Python: 3.12.13
  • OS: Linux
  • Embedded SeekDB binding: pylibseekdb 1.4.0.post2

Additional verified backend: OceanBase 5.0.1

The same checked-in test also fails on a fresh, fixture-owned OceanBase database at the immutable tested commit. The JUnit backend identity is 5.7.25-OceanBase_CE-v5.0.1.0 (engine version 5.0.1).

Set POWERCONTEXT_TEST_MIGRATION_OCEANBASE_URL to an existing disposable management database on an isolated test tenant, with permission to create and drop the fixture's randomly named child databases, then run:

python -m pytest 'tests/e2e/test_unified_lexical_search.py::test_prepared_topic_recall_preserves_evidence_after_stopwords[oceanbase-"the"]' -q --junitxml=lexical-oceanbase.xml

The test's migration_backend fixture creates and owns a separate child database for this case. The observed failure is again assert 'empty' == 'ready' at the PreparedContext assertion. It was observed in the complete backend run and repeated in two focused replays of the failing node set, including the replay after correcting the host Node executable search path. This establishes the same failing public query on OceanBase 5.0.1 without asserting that every OceanBase version or every search operation is affected.

Are you willing to submit a PR to fix this bug?

No PR is included.

Regression-proof: ca399b0f-bf82-41c3-ae54-98dd9f377e98/53d09bffbe4786cb5e0b/lexical-stopword

hireview001 avatar Oct 31 '26 06:10 hireview001