Skip to content

dt64/quack: version source-local codes and refuse a stale code space (E2a) - #1982

Merged
AdaWorldAPI merged 2 commits into
mainfrom
ccr-8062bcc7-l7lkz9-e2a
Nov 8, 2026
Merged

AdaWorldAPI merged 2 commits into
mainfrom
ccr-8062bcc7-l7lkz9-e2a

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

Problem

A query bound against a source's dictionary kept its literal codes after the dictionary was renumbered. In the swapped-dictionary oracle, a query bound in generation 1 runs against generation-2 lanes and counts 3 rows. The correct answer is 1.

Change

dt64: CodeTable<C>. This is the code-space sibling of MapTable. It tracks the mapping between canonical values and a source's local codes.

  • Storage. Each CodeSpaceId (full u32 classid plus canonical property identity) gets an append-only history of bijections between canonical ValueKeys and the source's local codes.
  • Bound to the lanes' store. The table owns no FrameStore. It is bound to the identity of the store the lanes are sealed under.
  • advance. It advances that store exactly once, so a renumbering makes every earlier lane Frame non-current (FrameStore::check). It refuses a foreign store (ForeignStore) and a change set that is not a bijection (Duplicate) before anything changes.
  • Reads. key and code take a Frame, never a bare version number. A historical frame reads the mapping in force at its version. That gives the historical meaning of a code, not the historical values of rows.

quack: CodeWitness, Draft::bind_typed, TypedQuery::admit.

  • bind_typed binds exactly as bind does and records the owner's witness for every coded field. A coded field with no witness refuses with Unwitnessed.
  • admit re-checks every witness before it hands out the query, and refuses with StaleCodeSpace if any has changed.
  • Witness. Quack never interprets it. A dt64-backed owner hands out its Frame; an owner without a store keeps its own generation.
  • Unchanged. Draft::bind and Query are as before. BindError gains two variants, and nothing in the workspace matches it exhaustively.

Not in this PR.

  • Scale attestation (ScaleMismatch) and DomainMismatch: H1.
  • Activation and SealedBasis: D.
  • Per-owner adoption (CamLabels, dir-sim, sap): E2b.
  • Reader authorization: the OGAR auth session, EXO-206.

Validation

  • cargo +1.99.0 test -p lance-graph-dt64 -p lance-graph-quack on current main (rebased onto dt64: fence MapTable::map_at as diagnose_at returning a non-executable MapDiagnostic #1981): 246 passed, 0 failed.

  • cargo +1.99.0 clippy -p lance-graph-dt64 -p lance-graph-quack --all-targets -- -D warnings: clean.

  • New tests:

    • dt64 (tests/dr.rs): frame-keyed historical reads; a foreign frame refused at an equal version; a foreign store refused with nothing changed; a duplicate change set refused with the store not advanced; advancing retires lane frames; an untouched space survives; a frame from before the first generation has no space.
    • quack: the ported red oracle (stale literal counts 3, admit refuses, a fresh bind counts 1); a coded field with no witness refuses to bind typed; an unchanged generation admits the same Query as bind.
  • Disable runs, each applied on top of the commit, each turning tests red:

    Disable Result
    admit skips the witness check the red-oracle test fails
    the foreign-store check is removed from advance the foreign-store test fails
    advance does not advance the store five dt64 tests fail

Board

STATUS_BOARD.md gains the D-SC section: E1 shipped, E2a in PR, E2b, D and H1.


Generated by Claude Code

A query bound against a source's dictionary kept its literal codes after
the dictionary was renumbered. Measured on a swapped dictionary, the
frame-1 literal counted 3 rows on frame-2 lanes where the answer is 1.

dt64 gains `CodeTable<C>`, the code-space sibling of `MapTable`: for each
`CodeSpaceId` (full classid + canonical property) an append-only history
of bijections between canonical `ValueKey`s and the source's codes.
It is bound to the identity of the FrameStore the lanes are sealed
under, and `advance` advances that store exactly once, so a renumbering
makes every earlier lane frame non-current. `advance` refuses a foreign
store and a non-bijective change set before anything changes. Reads take
a `Frame`, never a bare version, and a historical frame reads the mapping
in force at its version.

quack gains `CodeWitness`, `Draft::bind_typed` and `TypedQuery::admit`.
`bind_typed` binds exactly like `bind` and records the owner's witness
for every coded field; a coded field without a witness refuses
(`Unwitnessed`). `admit` re-checks every witness before the query is
handed out and refuses `StaleCodeSpace` otherwise. `Draft::bind` and
`Query` are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XAqKMMWgnUU9g7Ldyn6sbk
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XAqKMMWgnUU9g7Ldyn6sbk
@coderabbitai

coderabbitai Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 661b5eb0-aa29-4b88-b774-09065b553b8e
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review November 7, 2026 23:44
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T23:45:32.179684Z fba8e90 Draft marked ready
ℹ️ 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.

@AdaWorldAPI
AdaWorldAPI merged commit f005a0f into main Nov 8, 2026
21 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