Repository navigation
Pin the negation of '~or' in SQLite search (DID-matlab#237) - #107
Merged
Merged
Conversation
DID-matlab's search_doc_ids searched a '~or' as a plain 'or'; DID-matlab 2c9d8fa7 fixes that. SQLiteDB._search_doc_ids already took the complement, so no Python code changes. tests/test_negated_or.py mirrors MATLAB's new did.unittest.TestNegatedOr, and the database bridge entry moves to 2c9d8fa7 with a decision_log note saying why nothing is ported. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012MroTijyNKsCMqFHpXFbpc
This was referenced Oct 24, 2026
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.
Companion to VH-Lab/DID-matlab#238, which fixes VH-Lab/DID-matlab#237. Merge that PR first, with a merge commit, so the hash recorded here stays on DID-matlab main.
What changes
No Python code changes.
SQLiteDB._search_doc_idsalready negates a~or(universe - matched, where the universe is the candidates when the search is restricted to them), and_base_id_lookup_valuesdoesn't treat a~oras a base.id lookup. MATLAB was the one that disagreed.tests/test_negated_or.pyhas the same cases as MATLAB's newdid.unittest.TestNegatedOr: a top-level~or, a~ornested in an OR, a~orinside an AND (restricted candidate path, and the test checks that path never lists the whole branch), and a~orof base.id lookups. Each search is compared withfield_search, both with and without the search indexes. I checked that all four tests fail when the negation in_search_doc_idsis disabled.database):matlab_last_sync_hashchanges frome4e02dcto2c9d8fa7(the DID-matlab#238 commit that touchesdatabase.m). Adecision_lognote says why no Python file changed.Pre-existing issue in the bridge YAML (not fixed here)
The
databaseentry has twodecision_log:keys, at about lines 49 and 967. YAML keeps the last one, so the first block is never parsed. That first block holds the DID-matlab #229 / 0de9cf2 / #233 / #235-merge notes. I put my note in the effective (second) block, becausetest_bridge_contract's moved-hash check reads that one. Merging the two blocks is probably worth a separate small PR.Checks run locally
black --check src tests: cleanruff check src tests: cleanpytest: 845 passed, 10 skipped, 1 xfailedbin/check_bridge_coverage.py --check file/hash/status/drift/member/missingagainst an unshallowed DID-matlab checkout ofclaude/did-negated-or: 0 problems eachGenerated by Claude Code