Skip to content

dt64: bind the frame store to the lane source, not the caller - #1978

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

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

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

Problem

BindStore::bind_lanes and LaneBinding::check/lane took the FrameStore as a caller argument, separate from the LaneSource. The caller chose which store was paired with which source. A binding made over source S1 could be checked and read against a different source S2 whose lane numbers matched, and S2's values came back. The prior audit measured this: S1 [40, 41], S2 [30000, 31000], and the read returned S2's values.

Change

  • LaneSource gains a required method, frames(&self) -> &FrameStore. It returns the store that lives with the data the source borrows from.
  • bind_lanes and check (and therefore lane) refuse LaneRefusal::Frame(FrameRefusal::ForeignFrame) unless the caller's frames is that same store, compared by identity, not value. The refusal happens before any lane_of or borrow. The helper is FrameStore::same_store (pub(crate)).
  • The signatures of bind_lanes, check and lane are unchanged. No new refusal variant. No unsafe. Validation stays per call.

Implementations (all four in the repo)

impl where frames() comes from
dt64 test Source owns its store
report AbiLanes already built its store from the batch; the trait method returns it
soa64 U64Source SoaU64::frames(): swapping the SoA swaps the issuer
dir-sim Directory owns its store; a reorder advances it

Tests

New:

  • dt64 lane_socket::a_substituted_source_is_refused_not_read. The bound source reads [100, 200, 300]. The substitute (same map and lane numbers, data [30000, 31000, 32000]) is refused when paired with the bound source's store, refused when paired with its own store, and a fresh bind cannot pair the bound source with another store.
  • soa64 socket_refusals::a_source_over_swapped_data_is_refused. Equal data rebuilt is a different store, so the binding is refused with zero borrows, and the original pairing still matches the oracle.

Re-pinned:

  • report lane_source::tests::a_frame_and_store_of_another_source_bind_nothing. It used to document the gap: another source's store and frame passed DT64's check, and only the adapter left the field Unbound. DT64 now refuses with Frame(ForeignFrame) first.

Disable run

After committing, I replaced the gate with if true || frames.same_store(...) and asserted the patch applied.

  • Red: dt64 a_substituted_source_is_refused_not_read and report a_frame_and_store_of_another_source_bind_nothing.
  • Still green: soa64 a_source_over_swapped_data_is_refused. It reaches the swap through the swapped source's own store, so FrameStore::check refuses it either way. It pins the owner rule, not the gate.

The patch was then restored with git checkout.

Validation

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

  • cargo test passes for lance-graph-dt64, lance-graph-report and lance-graph-dir-sim. dir-sim is run by identity.yml.
  • cargo test --release passes for soa64-u64-lab. It has no workflow, so this was a local opt-in run.
  • cargo clippy --all-targets -D warnings is clean on dt64. Style CI has no clippy line for dt64.
  • cargo fmt was applied to all four crates.

Residual (open)

The trait cannot prove that an implementer's store issued that implementer's bytes. This PR removes the caller's choice, and the in-repo impls follow the owner rule. Implementer trust remains. Closing it needs byte authentication or a sealed trait. No external implementer is known.

Plan note: .claude/plans/d-lanesock-dr-dt64-lane-socket-v1.md, section "Source issuer".


Generated by Claude Code

LaneSource gains a required frames() returning the FrameStore that lives
with the source's data. bind_lanes and LaneBinding::check/lane refuse
Frame(ForeignFrame) unless the caller's frames argument is that store
(identity compare), before any lane_of or borrow. A binding made over one
source can no longer be checked or read against a substitute whose lane
numbers match.

The four in-repo impls follow the owner rule: dt64 test Source and dir-sim
Directory own their store, soa64 U64Source returns SoaU64::frames(), report
AbiLanes already built its store from the batch. report's
a_frame_and_store_of_another_source_bind_nothing is re-pinned: the pair is
now refused at DT64 (ForeignFrame) instead of only at the adapter (Unbound).

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: 401e511d-3b47-4fbc-aa42-7b4ae0defea4
  • 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 21:30
@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-07T21:32:04.802966Z 2a8a9bd 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.

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