feat(querier): plan-time body-literal candidate matcher (RFC 0044 slice 1) - #671
Conversation
…ce 1) body_literal_candidates tokenizes a body == literal with the miner's own tokenizer and unifies it position-wise against every registered (template_id, version): Fixed tokens byte-equal, Wildcard positions capture the implied parameter values, output deterministically sorted. The result is the template arm's prunable candidate superset — exact per-record equality (separators, overflow-spilled params) settles at scan time in the compile slice. A tokenizer-rejected literal (embedded NUL) matches no template, which is exact: the parse-failure ingest path always retains such bodies, so the physical arm alone covers them. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qtny6z6cA74xPZa4qRhk4F Signed-off-by: Jens Holdgaard Pedersen <Jens@holdgaard.org>
|
Warning Review limit reached
Next review available in: 41 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR introduces the first (plan-time) building block for RFC 0044’s template-arm compilation in the querier: resolving a body == <literal> predicate into a deterministic, version-qualified set of template candidates plus implied wildcard parameters, using the miner’s tokenizer to preserve reconstruction soundness.
Changes:
- Add
body_match::body_literal_candidatesto unify a body literal against(template_id, version) → tokensfrom the tenantTemplateRegistry, producing a deterministic candidate set. - Add focused unit tests covering exact match, wildcard capture order, determinism, mismatch cases, version independence, and tokenizer-rejected literals (embedded NUL).
- Export the new module from
ourios-querier’s crate root.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/ourios-querier/src/lib.rs | Exposes the new body-match functionality from the crate root. |
| crates/ourios-querier/src/body_match.rs | Implements plan-time literal→template candidate unification + unit tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qtny6z6cA74xPZa4qRhk4F Signed-off-by: Jens Holdgaard Pedersen <Jens@holdgaard.org>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qtny6z6cA74xPZa4qRhk4F Signed-off-by: Jens Holdgaard Pedersen <Jens@holdgaard.org>
Summary
RFC 0044 slice 1 — the pure plan-time half of the template arm.
body_match::body_literal_candidatesresolves abody ==literal against the tenant'sTemplateRegistry:(template_id, version)—Fixedbyte-equal,Wildcardcaptures the implied parameter values in order,The result is deliberately a candidate superset: separators and overflow-spilled parameter values are per-record, so exact equality settles at scan time inside candidate-admitted row groups only — that split is what keeps the arm prunable. The scan-time exactness + two-arm compile is slice 2; nothing user-visible changes yet.
Verification
6 co-located unit tests (zero-param, parameterized capture, multi-template determinism, arity/fixed mismatches, independent versions, NUL). fmt clean, clippy 0 warnings, querier suite green.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Qtny6z6cA74xPZa4qRhk4F