Skip to content

fix(off_record): a room handle works only in its room (FIX ROOM-LOCAL-CUSTODY 2/3) - #10003

Open
olety wants to merge 5 commits into
opus-fix-custody/room-local-custody-keptfrom
opus-fix-custody/room-local-custody-handle-scope
Open

olety wants to merge 5 commits into
opus-fix-custody/room-local-custody-keptfrom
opus-fix-custody/room-local-custody-handle-scope

Conversation

@olety

@olety olety commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

FIX ROOM-LOCAL-CUSTODY, PR 2 of 3 (stack: kept -> this PR -> save). Ruling: see PR 1.

This PR: a room handle works only in its room.

A run bound to an off-record room compares a row it holds with the call it makes again through OffRecordSession::base_known_values, which read base custody's values only. A row the room keeps a fresh key in holds its room handle, which no base value matches, so the call made again drifted: the handle did not work in its own room.

  • store/known_value_index/room.rs (new): Vault::known_values_with_room builds the matcher a compare inside the room reads: base custody's values and, beside them, each value the room keeps under its room handle and room record id, printed under base's master (or a random one while base keys no value). The prints live in that matcher alone and are wiped when it drops; the known-value index learns none. A room handle so meets its own value and no other value of its shape, as a base handle meets only its record's values (FIX REPLAY-COMPARE-KNOWN-OTHER-CALLERS).
  • OffRecordSession::base_known_values returns it, so every compare of a room's run reads it (replay cursor, dispatcher verb/receipt compares, the erase of a room's replies). Outside the room no matcher holds a room value, and every base door refuses a room handle at its parse (PR 1).

Stored change: keep.

Tests (... --test room_custody_handle_scope; red commit 65d021b on PR 1's tip, pin opus-fix-custody/room-local-custody-handle-scope-red):

  • a_room_handle_meets_its_own_value_when_the_rooms_run_calls_again (red at PR 1: drifts);
  • guards: a_base_door_refuses_a_room_handle, a_room_handle_names_nothing_of_its_room_in_another_room.
    test_doors/erased_request_identity.rs room_stored_call_is now reads the room's call through the session's matcher, as the room's run does (identical while a room keeps nothing, so erased_request_custody_identity and fenced_erase_stand_in_identity read as before).

Review round 1 (REVIEW-10003)

  • A whole field the wall lifts holds the bare room handle; the replay compare, the erased form and the shape rules now read a bare room handle as a handle.
  • A room handle is spelled r<room tag>.<ordinal> (r0123456789abcdef.1), the tag 64 random bits per room, so two rooms never spell a handle alike.
  • A room's erase (put fence and sweep) reads the room's values beside base custody's (WriterCustody::in_room, KnownValues::with_room_in_writer), so an erased request keeps the exact identity of a room value it names.
  • Resuming a sealed room's wait into base (routing/replay.rs) is the filed row ROOM-CUSTODY-ON-RECORD-CARRY (fails closed).
    Tests: three more in tests/room_custody_handle_scope.rs, red at 26ee474.

…lay and names nothing outside the room (FIX ROOM-LOCAL-CUSTODY)

The lead's ruling ROOM-LOCAL-CUSTODY = A (21 Nov): handles work only in
their room.

tests/room_custody_handle_scope.rs:
- a_room_handle_meets_its_own_value_when_the_rooms_run_calls_again (red
  at the layer below: a run bound to the room compares its stored call
  with base custody's values alone, which hold no room value, so the call
  made again with the key the room keeps drifts);
- a_base_door_refuses_a_room_handle and
  a_room_handle_names_nothing_of_its_room_in_another_room are guards (a
  base door refuses `[secret r1]` and `r1` at its parse; another room
  reads the same handle text as its own).

test_doors/erased_request_identity.rs: room_stored_call_is reads the
room's call as a run bound to the room reads it, through the session's
own matcher (OffRecordSession::base_known_values), not the vault's;
room_stored_call_holds reads the stored request's texts. While a room
keeps no secret both matchers are one, so the room tests that use it
read as before.
…eps, under their room handles (FIX ROOM-LOCAL-CUSTODY)

A run bound to an off-record room compares a row it holds with the call
it makes again through OffRecordSession::base_known_values, which read
base custody's values only. A row the room keeps a fresh key in holds
its room handle, which no base value matches, so the call made again
drifted: the room handle did not work in its own room.

store/known_value_index/room.rs: Vault::known_values_with_room builds
the matcher a compare inside the room reads: base custody's values, and
beside them each value the room keeps (SessionOverlay::kept_room_secrets),
under its room handle and the room's record id, printed under base's
master, or a random one while base keys no value. The prints live in
that matcher alone and are wiped when it drops: the known-value index
learns none. A room handle so meets the value the room keeps under it
and no other value, as a base handle meets only its record's values
(FIX REPLAY-COMPARE-KNOWN-OTHER-CALLERS). With nothing kept it is
known_values_now.

OffRecordSession::base_known_values returns it, so every compare of a
room's run (the replay cursor, the dispatcher's verb and receipt
compares, the erase of a room's replies) reads it. Outside the room no
matcher holds a room value, and every base door refuses a room handle at
its parse.

Stored change: keep.
@greptile-apps

greptile-apps Bot commented Nov 20, 2026

Copy link
Copy Markdown

Automatic reviews are disabled for this repository. Configure in Code Review Settings.

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 11 billable files and costs up to $2.75.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 55 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 151 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 8fe6fbf and e8c5cf2.

Files selected for processing: 11

  • crates/oneiron-store/src/session_overlay/overlay/room_secrets.rs
  • crates/oneiron/src/batch/secret_scan/mask/side_row.rs
  • crates/oneiron/src/batch/secret_scan/mask/text.rs
  • crates/oneiron/src/batch/secret_scan/shapes.rs
  • crates/oneiron/src/code_run/storage/overlay_erase.rs
  • crates/oneiron/src/code_run/storage/replay_bodies.rs
  • crates/oneiron/src/off_record/lifecycle/session.rs
  • crates/oneiron/src/store/known_value_index.rs
  • crates/oneiron/src/store/known_value_index/room.rs
  • crates/oneiron/src/test_doors/erased_request_identity.rs
  • crates/oneiron/tests/room_custody_handle_scope.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@olety
olety added this pull request to stack #10005 November 20, 2026 20:03
…cross rooms and through an erase (REVIEW-10003, FIX ROOM-LOCAL-CUSTODY)

Three cases the blind review of #10003 found, red on this layer:
- a field the side-row wall lifts whole (`password`) holds the bare room
  handle, and the room's run calling again with the same password does
  not meet its row (P1 text.rs:257);
- two rooms spell their first handles alike, so a handle the first room
  gave, offered in the second room's call, meets the second room's row
  (P1 room_secrets.rs:117);
- a room's erase of a gone actor's call, in its put fence and its sweep,
  keeps only the stand-in identity of a room value the request names, so
  another key of the same shape meets the erased row (P1
  overlay_erase.rs:208).

test_doors/erased_request_identity.rs: store_fields_call_in_room and
room_stored_fields_call_is, a note call held as a map of texts.
…ld and through an erase (REVIEW-10003, FIX ROOM-LOCAL-CUSTODY)

oneiron-store session_overlay/overlay/room_secrets.rs: a room handle is
the sigil, the room's tag and the handle's ordinal there
(`r0123456789abcdef.1`). The tag is 64 random bits drawn at the room's
first kept secret, so two rooms never spell a handle alike: a handle one
room gave meets nothing another room keeps, in a row or in a call (the
replay compare's `stored == offered` hit). The dot keeps it outside the
durable short-id grammar, as before.

batch/secret_scan: a whole value that is a bare room handle is a handle,
as a bare `sc12` is: the replay compare reads it as a slot (text.rs
handle_spans), the erased form stands it in (side_row.rs stand_in_text)
and the shape rules read it as no secret (shapes.rs custody_handle). A
field the wall lifts whole in a room holds the bare room handle, and the
room's run calling again with the same value now meets its row.

code_run/storage: an erase inside a room reads the room's values beside
base custody's (replay_bodies.rs WriterCustody::in_room, backed by
known_value_index/room.rs KnownValues::with_room_in_writer, which shares
its matcher with Vault::known_values_with_room): the room's put fence and
its sweep (overlay_erase.rs) keep the exact identity of a room value a
request names, as they keep a base value's.

Stored change: keep (room handles live only in a room's memory; base
holds none).

This branch has not been deployed

No deployments
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.

1 participant