Skip to content

lab(dr256): persist and reopen the existing OrderIndex (D-DRDT-SPLIT-1 S3) - #2020

Merged
AdaWorldAPI merged 2 commits into
mainfrom
ccr-ca0562e7-hudvlz-s3-order-store
Nov 11, 2026
Merged

AdaWorldAPI merged 2 commits into
mainfrom
ccr-ca0562e7-hudvlz-s3-order-store

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

S3 of dr-widefieldmask-dt-classview-v1.md §5. order_store writes the OrderIndex that OrderIndex::by_i32 builds to a file and reopens it as the same index. It has no sort of its own; on load it only checks the order.

What the file holds

  • the permutation and the cached keys
  • the key lane (KeyLane::Field(u8) or Computed(u64))
  • the tie-break rule TIE_KEY_THEN_FRAME_POSITION: ascending key, then the row's position in the bound frame
  • the table identity (class, population, rows), the mapping and source revisions, and the presence version

Refusals

attest refuses the reopened index when any of these changed: the table, the mapping, the key, the presence version, or the source content. The last one holds even when the mapping is unchanged, because an order index depends on content (EXO-255). from_bytes refuses a bad magic, an unknown layout, an unknown tie-break or key kind, a wrong length, a non-permutation, and keys out of order or ties out of frame-position order.

Evidence

  • cargo test -p dr256-ternlog-lab: all suites pass, 17 of them in tests/order_store.rs. clippy -D warnings and fmt are clean.
  • The expected sequences in the tests are hand-written literals. T1 and T2 compare the reopened index against the real by_i32 index: permutation, keys, between over five ranges, gt, and the prepare_order count.
  • the_module_never_sorts asserts that the source contains no .sort.
  • 19 disable runs, one per guard, each turned its test red. Each anchor was asserted to occur exactly once, and the file was restored afterwards. Examples:
    • the reversed write order and the reversed keys on reopen (T1, T2)
    • each attest guard short-circuited (T3–T7)
    • each from_bytes guard short-circuited (T8–T12)
    • the key-lane and origin checks in seal (T13, T14, T17)
    • the IO refusal mapped to another error (T15)
    • a .sort() added to the module (T16)

Not verified

  • No timing was taken. Reopening reads the file once and verifies it in O(n).
  • The real-path count checks use the lab's own fixtures only.

Generated by Claude Code

order_store seals the OrderIndex built by OrderIndex::by_i32 into a file
(permutation, cached keys, key lane, tie-break key-then-frame-position,
mapping and source revisions) and reopens it as the same index. It never
sorts: from_bytes only verifies the order. attest refuses another table, a
moved mapping, another key or presence version, and a content change with
the mapping unchanged (EXO-255: an order index depends on content).

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

coderabbitai Bot commented Nov 11, 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: 26e704e4-790c-4936-870a-224a7c5bb369
  • 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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XAqKMPJjVvasjwqhjJ6c9p
@AdaWorldAPI
AdaWorldAPI marked this pull request as ready for review November 11, 2026 19:57
@chatgpt-codex-connector

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-11T19:58:37.454078Z 13e189e 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 e31eddb into main Nov 11, 2026
8 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