Skip to content

Add architecture skill for the index query engine#5467

Merged
habdelra merged 2 commits into
mainfrom
index-query-engine-architecture-skill
Jul 10, 2026
Merged

Add architecture skill for the index query engine#5467
habdelra merged 2 commits into
mainfrom
index-query-engine-architecture-skill

Conversation

@habdelra

Copy link
Copy Markdown
Contributor

What

Adds a Claude skill documenting the architecture of the index query engine, and a comment on IndexQueryEngine pointing readers to it. No behavior changes — one code comment plus a new markdown file.

Why

index-query-engine.ts compiles Query filter trees into SQL that must run identically on Postgres and SQLite, and most of its design constraints are invisible at any single call site: the two-pass (async definition-driven, then mechanical) compilation, why plural fields route through json_tree() with a fullkey-confinement predicate, which differences belong in-band vs in the SQLite adjustSQL text rewrites, the existential semantics of table-valued fan-out under GROUP BY (including how types conditions compose — and don't), filter polarity, synthetic search-doc keys, and the parity contract with the client-side instance-filter-matcher.ts.

The skill (.claude/skills/index-query-engine/SKILL.md) captures those invariants in one place so changes to the engine — new filter operators, new synthetic keys, changes to path compilation — are made with the whole contract in view.

🤖 Generated with Claude Code

Distills the query engine's design into .claude/skills/index-query-engine/
SKILL.md — the two-pass compilation pipeline, the Postgres/SQLite dual-adapter
constraints, table-valued fan-out semantics, filter polarity, synthetic
search-doc keys, and the parity contract with instance-filter-matcher.ts — and
points to it from a comment on IndexQueryEngine.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds contributor-facing documentation for the IndexQueryEngine architecture by introducing a new Claude skill document and linking to it from the engine source, with no runtime behavior changes.

Changes:

  • Added an inline comment in IndexQueryEngine pointing readers to centralized architectural guidance before making semantic changes.
  • Added a new skill document describing the index query engine’s two-pass compilation pipeline, adapter parity constraints, and client-side matcher contract.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/runtime-common/index-query-engine.ts Adds a pointer comment directing future edits to the new architecture doc.
.claude/skills/index-query-engine/SKILL.md New architecture skill documenting invariants/constraints of the index query engine.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .claude/skills/index-query-engine/SKILL.md Outdated
Expands the skill with a dedicated section on plural-path compilation: the
shared fullkey dialect between sqlite json_tree and the custom pg jsonb_tree,
a worked example of the anchor predicate, the alias-collapse rule that binds
the value test and its anchor to one tree row, its composition consequences,
and the container-row anchoring used for null checks. Also prefixes module
paths with packages/ so file references are navigable from the repo root.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Host Test Results

    1 files      1 suites   2h 52m 3s ⏱️
3 454 tests 3 439 ✅ 15 💤 0 ❌
3 473 runs  3 458 ✅ 15 💤 0 ❌

Results for commit 7fdb35d.

Realm Server Test Results

    1 files      1 suites   11m 27s ⏱️
1 814 tests 1 814 ✅ 0 💤 0 ❌
1 893 runs  1 893 ✅ 0 💤 0 ❌

Results for commit 7fdb35d.

@habdelra
habdelra merged commit d40a122 into main Jul 10, 2026
66 of 67 checks passed
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.

3 participants