Repository navigation
feat: :limit N (#306 PR 1) - #745
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0169pNQsLcCEn48te9X9WuZW
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0169pNQsLcCEn48te9X9WuZW
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0169pNQsLcCEn48te9X9WuZW
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0169pNQsLcCEn48te9X9WuZW
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0169pNQsLcCEn48te9X9WuZW
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0169pNQsLcCEn48te9X9WuZW
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0169pNQsLcCEn48te9X9WuZW
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0169pNQsLcCEn48te9X9WuZW
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0169pNQsLcCEn48te9X9WuZW
Conflicts: PRS-115 beside #316's PRS-119–121; verifier TOKENS gains both :limit and #316's #{ (34 tokens, filler counts 23,020 / 651,806); test counts. :limit slot mistakes follow #181: API-022 / API-024 instead of INT-033 / INT-035. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0169pNQsLcCEn48te9X9WuZW
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0169pNQsLcCEn48te9X9WuZW
# Conflicts: # CLAUDE.md # docs/TEST_COVERAGE.md
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
# Conflicts: # CLAUDE.md # docs/TEST_COVERAGE.md # src/query/engine/filter.rs
# Conflicts: # CLAUDE.md # docs/TEST_COVERAGE.md
adityamukho
added a commit
that referenced
this pull request
Oct 24, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Urda7FD9CYYoxdeGGJa11x
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR 1 of 2 for #306 (spec
docs/superpowers/specs/2026-10-24-limit-order-by-design.md, plan steps 1–9). Part of #306, which stays open until PR 2 (:order-by,:offset, top-kSort).What
:limit N/:limit $nin a query vector, any section order. It returns at most N rows of the answer, after aggregates and windows, for rule queries, cursors, prepared queries and write-transaction reads. Without:order-bywhich rows is unspecified (spec decision 2); they are always a sub-bag of the unlimited answer.Limitoperator (src/query/engine/limit.rs): passes on at most N rows, then closes its child, so nothing below reads more. Planned afterBuilder::finish, so no step can land after it.:limit 0pulls nothing.PRS-115for a value that is not an integer>= 0or a slot; a repeated:limitisINT-012and a missing valueINT-013, as for the other query options. A prepared slot takesBindValue::Val(Value::Integer(n));n < 0→PRS-115, another bind value →API-024, missing →API-022, unbound inexecute→API-010.limit_sectionintests/grammar/grammar.pest,docs/GRAMMAR.mdregenerated, corpus files; verifierTOKENSgains:limit(filler counts 20,686 / 565,267 at bounds 3 / 4) andSEMANTICwitnesses forINT-012andPRS-115.Numbers (idle 88-vCPU server, one NUMA node)
limitp50 / p99attribute_scan(same pattern, no limit) p50Acceptance (moved from #473, nightly in
smoke.yml)::limit 10over 10M facts in 0.8 ms under a 64 KiBquery_memory_limit, adding 132 KiB of RSS. The fixture is written withLogWriter(5.2 min); building it withtransacttook 42 min, over the job's 30-minute timeout.Tests
Bench machine (after merging
v3): plain 1,760 passed / 14 ignored,test-hooks1,783 / 15; with #743 merged in, 1,789 / 1,813 tests listed; grammar verifier at bound 4 clean.cargo clippy --all-features -- -D warningsclean; wasm32browserbuild OK. Release binary +3.2 KB (1,188 → 1,191 KiB locally, gate 1,200 KiB).Deviations from the plan / spec
src/cursor.rs), andLimitunit tests count the rows the child sends.PreparedQuery::slot_namesreports a:limitslot; that is a private field, not an API. The slot is collected (collect_slot_names), soexecuterejects it unbound withAPI-010, which the tests check.:limit :kwisINT-013(no value: the section ends at the next keyword), notPRS-115; the grammar rejects it either way.PRS-115text has no backticks (registry_matches_error_reference_doc_bidirectionallyreads the doc's text between backticks).:limit $nslot bound to the wrong kind isAPI-024and an unbound oneAPI-022(the spec saysINT-035/INT-033, now deprecated); a negative integer is stillPRS-115.Codex review: no findings.
🤖 Generated with Claude Code
https://claude.ai/code/session_0169pNQsLcCEn48te9X9WuZW