Repository navigation
Query: slashes in key:value are literal (nodeType:Edu/Exercise) — regression tests + investigation - #568
Merged
Conversation
Regression coverage for the memex-cloud 2026-07-19 report that `nodeType:Edu/Exercise` / `nodeType:Store/Plugin` matched nothing. Investigation found the query tokenizer and the full Postgres query pipeline ALREADY treat a slash inside a key:value value as a literal that runs to the next whitespace — verified end-to-end AND against the live memex mesh (both slashed searches return rows). No production code change was needed; these tests pin the contract so it can't regress. - QueryParserTests.Parse_SlashedNodeTypeValue: Edu/Exercise, Store/Plugin, Store/Catalog keep the whole value, no stray free-text token. - QuerySyntaxTests: scoped + unscoped single-partition nodeType queries with slashed types return the seeded rows. - CrossPartitionSearchTests: the production cross-schema fan-out (adapter + PostgreSqlPartitionedMeshQuery) returns slashed-type nodes across every partition. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds regression coverage to confirm that structured query values containing slashes (e.g., nodeType:Edu/Exercise, nodeType:Store/Plugin) are parsed and executed literally (i.e., the slash is not treated as a delimiter), including cross-partition fan-out behavior in PostgreSQL.
Changes:
- Added
QueryParserregression tests to ensure slashednodeTypevalues remain intact and don’t leak into free-text search. - Added PostgreSQL query syntax tests validating
nodeType:Edu/ExerciseandnodeType:Store/Pluginfilters return seeded rows (scoped and unscoped). - Added cross-schema fan-out tests validating slashed
nodeTypefilters return results across partitions via both the low-level cross-schema query and the production orchestrator.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| test/MeshWeaver.Query.Test/QueryParserTests.cs | Adds parser-level regression coverage for slashed nodeType values and ensures no TextSearch token is produced. |
| test/MeshWeaver.Hosting.PostgreSql.Test/QuerySyntaxTests.cs | Seeds slashed nodeType nodes and asserts PostgreSQL query execution returns expected rows (scoped + unscoped). |
| test/MeshWeaver.Hosting.PostgreSql.Test/CrossPartitionSearchTests.cs | Validates slashed nodeType queries work with production-style cross-schema fan-out across multiple partitions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Contributor
Contributor
Contributor
Contributor
Contributor
Contributor
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.
Summary
Follow-up on the memex-cloud report (2026-07-19) that a structured query whose value contains a slash matched nothing:
nodeType:Edu/Exercise→ 0 results, though the nodes existnodeType:Store/Plugin→ 0, though the node existsThe stated hypothesis was that the query tokenizer drops/mis-splits the value at the slash.
What the investigation found
The tokenizer and the full Postgres query pipeline already treat a slash inside a
key:valuevalue as a literal that runs to the next whitespace. I could not reproduce a slash-drop anywhere in currentmain:QueryParser.Tokenize→ParseSingleValue): a value reads to the next whitespace;/is an ordinary value char (and a valid field char). Pre-existing tests already cover this (Parse_PathValueWithSlash_ParsesCorrectlyfornodeType:ACME/Project/Todo,Parse_ActivityQueryPatternfortype/Story). This behaviour has been in place since AI models show their provider's brand logo in the model picker #407 (2026-07-10), i.e. before the 2026-07-19 observation.PostgreSqlSqlGenerator):nodeType:Edu/Exercise→LOWER(n.node_type) = @p0, paramedu/exercise— parameterized, slash intact.ResolveTableByNodeType,ResolvePinnedPartition, routing hints): a slashed value is not a known satellite type and has no namespace, so it resolves tomesh_nodesand fans out across every searchable partition — no mis-pin.nodeType:Store/PluginandnodeType:Edu/Exerciseboth return rows on the live memex mesh right now.So the parser test the report expected to go RED actually goes GREEN — there is no tokenizer defect to fix. Fabricating a code change to a working parser would be a fake fix, so this PR ships regression coverage only and documents the finding.
The memex-cloud symptom was therefore almost certainly not a tokenizer bug — most likely environmental (an older deployed image, or the partition holding those nodes not yet present in
searchable_schemasat query time). That is a separate, non-slash-specific issue (a non-slashed nodeType in the same partition would fail the same way) and is out of scope here.Tests added (all green; Release +
-warnaserrorclean)QueryParserTests.Parse_SlashedNodeTypeValue—Edu/Exercise,Store/Plugin,Store/Catalogkeep the whole value; no stray free-text token.QuerySyntaxTests— scoped (path:… scope:descendants) and unscoped single-partitionnodeType:Edu/Exercise/nodeType:Store/Pluginreturn the seeded rows.CrossPartitionSearchTests— the production cross-schema fan-out (PostgreSqlStorageAdapter.QueryNodesAcrossSchemasAsyncand the fullPostgreSqlPartitionedMeshQueryorchestrator) returns slashed-type nodes across every partition.No production code changed — the PR is orthogonal to #562 (per-subject permission fold); it merged cleanly with current
main.🤖 Generated with Claude Code