8000 feat(query): Filter/Bind, pseudo-attributes, cross-kind constants on the engine (#544, PR 2 of 3) by adityamukho · Pull Request #590 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

feat(query): Filter/Bind, pseudo-attributes, cross-kind constants on the engine (#544, PR 2 of 3) - #590

Merged
adityamukho merged 3 commits into
v3from
feat/544-exprs
Oct 14, 2026
Merged

adityamukho merged 3 commits into
v3from
feat/544-exprs

Conversation

@adityamukho
Copy link
Copy Markdown
Collaborator

Part of #544 (streaming engine 2/9, #473). PR 2 of 3: plan steps 7–9 in docs/superpowers/plans/2026-10-14-544-operator-core.md.

What runs on the engine now

  • Filter / Bind (src/query/engine/filter.rs): expression clauses after the scan pattern, in optimizer::plan order. A binding expression overwrites a bound variable at the same point the executor does ([(+ ?v 1) ?v] is accepted by the parser); a failing expression drops the row. Registered predicates run through the same eval_expr.
  • Pseudo-attributes: :db/valid-from, :db/valid-to, :db/tx-count, :db/tx-id on the scan pattern's entity become integer columns the scan fills (tx-id only when asked for; committed rows look it up through the new KeySource::tx_id_of).
  • Cross-kind value constants, with the executor's matching rules: a keyword reads its own AVET range and the range of refs to the entity it names; a UUID reads its ref range and the attribute's keywords (keeping those that name it); a float reads the attribute's floats, kept within f64::EPSILON. ValueKind / attribute_kind_prefix come from perf: attribute+value patterns scan the whole attribute; AVET index is never read #518's parked branch.
  • INT-026 and QRY-007 are raised before the engine runs, by the executor's own checks (check_clauses); the executor path keeps its error order.

Stays on the executor (deviations, recorded in the plan)

Tests

  • query::engine::tests: new shapes over the random history (keyword/UUID/float constants against keywords, refs and UUID-named keywords; filters, binds, rebinding, failing expressions; every pseudo-attribute, constants, repeated variables, pseudo + expression), all compared with the executor by the oracle at several :as-of/valid times, in memory, across checkpoints and after reopen; the perf: attribute+value patterns scan the whole attribute; AVET index is never read #518 branch's cross-kind test ported as an engine test with expected entities; routing (what stays on the executor) and error order (INT-026, QRY-007); a registered predicate.
  • Mutations checked: float epsilon, tx-id lookup, UUID-named keyword matching, misaligned bind columns — each fails the suite.
  • cargo test and cargo test --features test-oracle: 1471 passed, 10 ignored. Engine tests also pass with --features wasm (no join reordering). Clippy clean (native all-features, wasm32-unknown-unknown --features browser, wasm32-wasip1).
  • Codex review: no divergences found.

No public API change, no new error code: no binding cascade.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HyLscCUuJ1GQpdAeX79EdR

adityamukho and others added 3 commits October 14, 2026 14:54
…the engine (#544)

The engine now runs expression clauses and per-fact pseudo-attribute
patterns after its scan pattern, in optimizer::plan order, and keyword,
UUID and float value constants, reading only the AVET ranges they can
match (attribute_kind_prefix from #518's branch). :db/valid-at stays on
the executor (a join, #545). INT-026 and QRY-007 are raised before the
engine runs, by the executor's own checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HyLscCUuJ1GQpdAeX79EdR
Its && asserts left failure branches the coverage gate counts: keys.rs
branches 76.4% < 80% floor; now 81.7%.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HyLscCUuJ1GQpdAeX79EdR
@adityamukho
adityamukho merged commit ce2e320 into v3 Oct 14, 2026
24 checks passed
@adityamukho
adityamukho deleted the feat/544-exprs branch October 14, 2026 09:51
@codecov
codecov Bot commented Oct 14, 2026
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.90941% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/query/engine/plan.rs 96.29% 4 Missing ⚠️
src/query/engine/scan.rs 97.43% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

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

0