Skip to content

Query: saved views with edge sort over Quack; views through the IAM gate (D-QRY-3) - #45

Merged
AdaWorldAPI merged 3 commits into
mainfrom
ccr-1d749cc5-q8s5qs
Oct 21, 2026
Merged

AdaWorldAPI merged 3 commits into
mainfrom
ccr-1d749cc5-q8s5qs

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

This is the saved-view half of D-QRY-3, claimed on EXO-50 in message 017. The board half shipped in #21.

hubspo-query::view

  • SavedView is data only: the object, its filter groups, at most one sort key, and the columns. Sharing and column visibility are decided at the output edge.
  • page(view, binder, offset, limit, runner) returns one page of ordinals in the view's order. Quack has no ORDER BY, so the sort happens at the edge:
    • No sort key: Agg::Rows, in storage order.
    • I32 key: bisection with Count thresholds finds the values at the page's first and last rank, at most 33 programs per bound. Only the band between those two values is materialised and sorted, which is the page plus any ties at its ends.
    • Code key: one GroupReduce Count gives a count per code. Only the codes that overlap the page are materialised.
    • Order: by value, with ties broken by ordinal ascending. Records with no value come last in both directions.
  • Runner is the caller's executor. The test implements it on mask-risc.

hubspo-compat::views::open_view

  • A filter or sort on a hidden property refuses the whole view, because the match set or the order would leak the hidden value.
  • Hidden or unknown columns are dropped.

Tests

  • tests/view_oracle.rs compares every page against a plain Rust sort over 3,000 records:
    • page sizes 1, 7, 50 and 333;
    • no sort, two I32 keys (one nullable with a narrow, tie-heavy range; one covering the full range including i32::MIN and i32::MAX), and two code keys (one nullable, one with an empty code);
    • both directions, filtered and unfiltered.
  • The program count per page is bounded and does not depend on the offset.
  • hubspo-compat has two open_view tests.
  • Workspace fmt, clippy with -D warnings, and tests all pass.

Disable runs: all eight went red.

  • reversed tie-break in descending order;
  • before count ignored;
  • nulls dropped;
  • bisection off by one;
  • code order not reversed;
  • band missing the view's filter;
  • sort missing from the gate;
  • hidden column kept.

Still open

  • A page-cost probe at 1M+ rows. Whether to ask lance-graph upstream for ORDER BY waits on it.
  • Multi-key sorts.
  • View sharing and persistence.

The board is updated: LATEST_STATE and the D-QRY-3 row on STATUS_BOARD.


Generated by Claude Code

…ate (D-QRY-3)

A SavedView is data: object, filter groups, one sort key, columns. page()
returns one page in the view's order without ORDER BY: storage order with
no key; for an I32 key the values at the page's first and last rank are
found by Count-threshold bisection and only the band between them is
sorted; for a code key one GroupReduce Count picks the codes overlapping
the page. Ties go by ordinal, records without a value last.

hubspo-compat::views::open_view refuses a view whose filter or sort reads
a hidden property and drops hidden columns.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PPcakjk7ioQsnasmNDtc5z
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PPcakjk7ioQsnasmNDtc5z
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T07:48:44.187102Z 0c64f67 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0c64f677a0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/hubspo-compat/src/views.rs
Comment thread crates/hubspo-query/src/view.rs
… authorized concept

Codex on #45: a zero-length I32 page underflowed r1 - 1, and open_view
never checked that the view's object is the concept the access was
compiled for, so an unfiltered view of another object passed. The store
now answers which concept a table holds, and anything else is refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PPcakjk7ioQsnasmNDtc5z
@AdaWorldAPI
AdaWorldAPI merged commit 7a901db into main Oct 21, 2026
2 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.

2 participants