Skip to content

feat(filterquery): add schema-agnostic boolean filter core - #734

Draft
jiashuoz wants to merge 15 commits into
mainfrom
feat/filter-query-language-core
Draft

feat(filterquery): add schema-agnostic boolean filter core#734
jiashuoz wants to merge 15 commits into
mainfrom
feat/filter-query-language-core

Conversation

@jiashuoz

Copy link
Copy Markdown
Member

Summary

  • define the q filter language and its AIP-160-style boolean precedence
  • add a schema-agnostic lexer, parser, public AST, validation registry, and parameterized SQL emitter
  • enforce parser/traversal caps, fixed identifiers, LIKE escaping, and injection invariants
  • add golden conformance vectors, precedence enumeration, fuzz coverage, and manual-AST hardening tests

Why

This establishes a reusable, safe filter-language core before binding it to the messages API. Schema-specific fields and transport integration are intentionally isolated in the follow-up stacked PR.

Validation

  • go test ./internal/filterquery/... -count=1
  • 30-second parser fuzz run
  • independent correctness review: approved
  • adversarial security/contract review: approved

Stack

PR 1 of 2. The follow-up branch feat/filter-query-language targets this branch and adds message-store/API/SDK/CLI/MCP integration.

jiashuoz and others added 15 commits July 26, 2026 12:55
Also corrects the spec's precedence note (NOT > OR > implicit AND > explicit AND, per the AIP-160 EBNF).

Co-Authored-By: Kimi <noreply@moonshot.ai>
Co-Authored-By: Kimi <noreply@moonshot.ai>
Co-Authored-By: Kimi <noreply@moonshot.ai>
Co-Authored-By: Kimi <noreply@moonshot.ai>
Co-Authored-By: Kimi <noreply@moonshot.ai>
Co-Authored-By: Kimi <noreply@moonshot.ai>
Co-Authored-By: Kimi <noreply@moonshot.ai>
Co-Authored-By: Kimi <noreply@moonshot.ai>
Co-Authored-By: Kimi <noreply@moonshot.ai>
Co-Authored-By: Kimi <noreply@moonshot.ai>
Co-Authored-By: Kimi <noreply@moonshot.ai>
Co-Authored-By: Kimi <noreply@moonshot.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant