Repository navigation
fix(off_record): a room save moves the room secrets its rows name into vault custody (FIX ROOM-LOCAL-CUSTODY 3/3) - #10004
Merged
Conversation
… into vault custody, then fingerprints it (FIX ROOM-LOCAL-CUSTODY) The lead's ruling ROOM-LOCAL-CUSTODY = A (21 Nov, "fingerprint only on save"): saving the room moves each secret into the vault's normal custody, and only then may the known-value index learn its fingerprint. tests/room_custody_save.rs: - a_save_moves_a_room_secret_into_vault_custody_and_only_then_fingerprints_it (red at the layer below: the saved MESSAGE keeps the room handle, which names nothing in base; base custody holds no record of the key and its index knows no fingerprint): a participant's message quotes the room handle of a key the room keeps, and the owner saves the turn; the saved MESSAGE names a base custody handle whose record holds the key, no row holds the room handle or the key, the index knows the key, and a second save naming the same room handle takes the same base record; - a_save_naming_no_room_handle_moves_nothing is a guard. test_doors/off_record_side_row.rs: say_in_room (one user message witnessed into the session), base_rows_hold, base_custody_handle_in_rows, vault_custody_value.
…o vault custody in the save transaction (FIX ROOM-LOCAL-CUSTODY) A room keeps a fresh key in its own custody and a row there holds its room handle; a message said in the room may quote that handle. A save replayed the room's rows into base as written, so a saved row named a room handle that names nothing outside the room, and the key never reached the vault's custody. batch/secret_scan/mask/room_carry.rs: carry_room_secrets_in_txn. In the save's own transaction, each room handle `[secret rN]` in a fresh row the save writes (each text of a Put's MessagePack body, map keys included) takes the handle of a base custody record holding the value: the one this save moved it to already, else the record base custody holds it in (the writer's known-value index), else one minted now through the vault's door (seal_whole_part_in_txn, named as found in the saved row, with the reason the wall gave in the room). Only that mint teaches the known-value index the fingerprint. A row base holds already keeps its bytes (the replay compares them; a retry never mints again). A room handle the room keeps no value under stays as written. off_record/promote.rs: FloorWrites::promote and copy_append carry the replay ops before seal_promoted_message_ops_in_txn, on a floor saving out of a room (FloorWrites::saving); a floor saving out of no room writes as before. Stored change: keep (a saved row names a base custody handle, as before).
…layer (FIX ROOM-LOCAL-CUSTODY)
…ts bytes in the room carry (FIX ROOM-LOCAL-CUSTODY) carry_room_secrets_in_txn refused the whole save when a row the save writes held a room handle's opening but did not read as one MessagePack value. Such a row now keeps its bytes, and a room handle in it stays as written, naming nothing, as one the room keeps no value under does: the save goes on and no value leaves the room.
|
Automatic reviews are disabled for this repository. Configure in Code Review Settings. |
|
Warning Review limit reached
This review includes 6 billable files and costs up to $1.50.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Or wait 35 minutes for your next included review. View limit details
|
…layer (REVIEW-10003, FIX ROOM-LOCAL-CUSTODY)
…layer (REVIEW-10003 round 2, FIX ROOM-LOCAL-CUSTODY) # Conflicts: # crates/oneiron/src/test_doors/off_record_side_row.rs
Base automatically changed from
opus-fix-custody/room-local-custody-handle-scope
to
main
November 20, 2026 21:52
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.
FIX ROOM-LOCAL-CUSTODY, PR 3 of 3 (stack: kept -> handle scope -> this PR). Ruling: see PR 1.
This PR: saving the room moves each secret a saved row names into the vault's normal custody, and only then does the known-value index learn its fingerprint.
A room keeps a fresh key in its own custody and a row there holds its room handle; a message said in the room may quote it. A save replayed the room's rows into base as written, so a saved row named a room handle that names nothing outside the room.
batch/secret_scan/mask/room_carry.rs(new):carry_room_secrets_in_txn. In the save's own transaction, each[secret rN]in a fresh row the save writes (each text of a Put's MessagePack body, map keys included) takes the handle of a base custody record holding the value: the one this save moved it to, else the record base custody already holds it in (the writer's known-value index), else one minted now through the vault's door (seal_whole_part_in_txn, named as found in the saved row, with the wall's reason from the room; the owner's found-key notice comes with it). Only that mint teaches the index the fingerprint. A row base holds already keeps its bytes (the replay compares them; a retry never mints again). A row that is no one MessagePack value, or a room handle the room keeps nothing under, stays as written.off_record/promote.rs:FloorWrites::promoteandcopy_appendcarry the replay ops beforeseal_promoted_message_ops_in_txn, on a floor saving out of a room (FloorWrites::saving).Stored change: keep (a saved row names a base custody handle, as before).
Tests (
... --test room_custody_save; red commit 732c461 on PR 2's tip, pinopus-fix-custody/room-local-custody-save-red):a_save_moves_a_room_secret_into_vault_custody_and_only_then_fingerprints_it(red at PR 2: the saved MESSAGE keeps the room handle; base holds no record and no fingerprint): the saved MESSAGE names a base handle whose record holds the key, no row holds the room handle or the key, the index knows the key, and a second save naming the same room handle takes the same record;a_save_naming_no_room_handle_moves_nothing.Not in this stack (filed, mine, next): saved notes/claims/shells ([ROOM-CUSTODY-SAVED-ARTIFACTS]), a room's on-record writes ([ROOM-CUSTODY-ON-RECORD-CARRY]), reply bodies ([ROOM-CUSTODY-REPLY-BODIES]); each fails closed today.