Skip to content

dt64: fence MapTable::map_at as diagnose_at returning a non-executable MapDiagnostic - #1981

Merged
AdaWorldAPI merged 1 commit into
mainfrom
ccr-8062bcc7-l7lkz9-e1
Nov 7, 2026
Merged

AdaWorldAPI merged 1 commit into
mainfrom
ccr-8062bcc7-l7lkz9-e1

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

Problem

MapTable::map_at(version, tile) returned an executable TileMap for a bare version number, without checking who issued that version.

Take a frame from another table that happens to carry the same version number:

  • map(frame) refuses it with Stale(ForeignFrame).
  • map_at(version) answers with this table's layout, which is the wrong one for that frame.

xlog implements MidMap for any TileMap (lance-graph-xlog/src/lib.rs:83), so a map obtained by bare version number could be executed.

Change

  • map_at becomes diagnose_at(version, tile) -> Result<MapDiagnostic<'_>, MapRead>.
  • MapDiagnostic wraps TileMap but exposes only width, len, is_empty, local, global and digest. It has no Deref, no Into<TileMap> and no MidMap impl, so a diagnostic cannot be handed to anything that executes a map.
  • map(frame) is unchanged. It remains the only executable read, and it checks the issuer.
  • No unsafe.

No production caller used map_at. The 6 diagnostic call sites in tests/dr.rs and the one in the d-global-where probe (falsify.rs) are ported to diagnose_at. Board documents that mention map_at are append-only history and are left alone.

Tests

  • p9_equal_version_foreign_frame_is_not_executable: map(frame_b) refuses the foreign frame. diagnose_at shows A's layout (local(10)=0, where the issuer gives 1) with a different digest.
  • A compile_fail doctest checks that the result of diagnose_at cannot be passed where a TileMap is required.
  • The 6 existing map_at tests are ported.

Disable run (after commit). I restored the TileMap return type and asserted that the patch applied. The compile_fail fence went red, because the code compiles again. P9 stayed green, because it uses only local and digest, which both types provide. The type fence is therefore what carries this PR, and the doctest is its falsifier.

Validation

All runs used CARGO_PROFILE_DEV_DEBUG=0 CARGO_PROFILE_TEST_DEBUG=0 CARGO_INCREMENTAL=0.

  • cargo test -p lance-graph-dt64 -p lance-graph-xlog: green. dt64 passes 98 tests, 0 failed (re-run independently).
  • cargo clippy --all-targets -D warnings on dt64: clean. fmt: applied.
  • The d-global-where probe builds.

Part of the semantic-continuity plan (E1). It does not depend on #1978, #1979 or #1980.


Generated by Claude Code

A bare RouteVersion carries no issuer, so map_at answered a foreign
frame's equal version with this table's layout, and the returned TileMap
is executable through xlog's MidMap. Rename to diagnose_at and return a
MapDiagnostic newtype with no conversion into TileMap, so only
map(frame) yields an executable map. map(frame) is unchanged. Callers
were tests and the d-global-where probe; none in production.

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: 1a66dc89-9358-4c97-9125-388321552e57
  • 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

@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:10:52.729782Z 0283e82 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.

@AdaWorldAPI
AdaWorldAPI merged commit 7c301f5 into main Nov 7, 2026
10 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