Repository navigation
dt64: fence MapTable::map_at as diagnose_at returning a non-executable MapDiagnostic - #1981
Merged
Merged
Conversation
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
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Problem
MapTable::map_at(version, tile)returned an executableTileMapfor 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 withStale(ForeignFrame).map_at(version)answers with this table's layout, which is the wrong one for that frame.xlog implements
MidMapfor anyTileMap(lance-graph-xlog/src/lib.rs:83), so a map obtained by bare version number could be executed.Change
map_atbecomesdiagnose_at(version, tile) -> Result<MapDiagnostic<'_>, MapRead>.MapDiagnosticwrapsTileMapbut exposes onlywidth,len,is_empty,local,globalanddigest. It has noDeref, noInto<TileMap>and noMidMapimpl, 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.unsafe.No production caller used
map_at. The 6 diagnostic call sites intests/dr.rsand the one in the d-global-where probe (falsify.rs) are ported todiagnose_at. Board documents that mentionmap_atare append-only history and are left alone.Tests
p9_equal_version_foreign_frame_is_not_executable:map(frame_b)refuses the foreign frame.diagnose_atshows A's layout (local(10)=0, where the issuer gives1) with a different digest.compile_faildoctest checks that the result ofdiagnose_atcannot be passed where aTileMapis required.map_attests are ported.Disable run (after commit). I restored the
TileMapreturn type and asserted that the patch applied. Thecompile_failfence went red, because the code compiles again. P9 stayed green, because it uses onlylocalanddigest, 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 warningson dt64: clean. fmt: applied.Part of the semantic-continuity plan (E1). It does not depend on #1978, #1979 or #1980.
Generated by Claude Code