Files
codebase-memory-mcp/tests
Andrew Hundt a4b3a71e81 fix(cypher): reject unconsumed query tokens
cbm_parse previously returned success when parse_return_item stopped before postfix list indexing or an arbitrary trailing token. A query containing labels(n)[0] could therefore ignore its alias, aggregate, ordering, and limit and execute as an unbounded projection.

Require TOK_EOF after parse_post_where in src/cypher/cypher.c and transfer the parent cursor after a recursively validated UNION tail. Route both list-index rejection paths through one diagnostic that gives supported labels(n) and n.label/count(*) rewrites.

Add parser regressions in tests/test_cypher.c. Verified 155/155 Cypher tests under ASan/UBSan, all three UNION tests, source-safety, an optimized CLI rejection, and the supported five-row node-label aggregation.

Signed-off-by: Andrew Hundt <ATHundt@gmail.com>
2026-07-18 18:50:08 -04:00
..
2026-07-08 00:05:19 +05:30