Skip to content

fix(off_record): a room save carries the room handles its NOTE, CLAIM and shell name into vault custody (FIX ROOM-CUSTODY-SAVED-ARTIFACTS) - #10019

Open
olety wants to merge 4 commits into
opus-fix-custody/room-local-custody-savefrom
opus-fix-custody/room-custody-saved-artifacts
Open

olety wants to merge 4 commits into
opus-fix-custody/room-local-custody-savefrom
opus-fix-custody/room-custody-saved-artifacts

Conversation

@olety

@olety olety commented Nov 20, 2026

Copy link
Copy Markdown
Member

FIX ROOM-CUSTODY-SAVED-ARTIFACTS (P3; the part of ROOM-LOCAL-CUSTODY the stack #10002-#10004 left out). Built on #10004's branch, not linked into its stack; it is retargeted to main once the stack lands.

What was wrong

An off-record room keeps a fresh key in its own custody, under a room handle ([secret r1]), and a NOTE, CLAIM or conversation shell the room holds may quote that handle. #10004 carries the room handles a saved turn's rows name into vault custody, but a selected save (vault.off_record.artifacts.save, OffRecordSession::save_artifact_as / save_artifact_by) landed its NOTE, CLAIM and shell as written: the saved row named a room handle that names nothing outside the room, and the key never reached the vault's custody. It failed closed (no value reached base).

Change

  • batch/secret_scan/mask/room_carry.rs: RoomCarry is one save's carry out of a room (RoomCarry::of). Beside a save's rows (ops_in_txn, the loop carry_room_secrets_in_txn ran before), it carries one MessagePack value (value_in_txn) and one text (text_in_txn: the carried text and each span it replaced). Each room handle takes the handle of a base custody record that holds the value: the one this save moved it to, else the record base custody holds it in, else one minted now. Only that mint teaches the known-value index the fingerprint. carry_room_secrets_in_txn stays as the turn rows' wrapper.
  • off_record/promote.rs: FloorWrites::room_carry, the carry of the room a floor saves out of.
  • off_record/lifecycle/scratch.rs: PreparedScratchSave::land carries each artifact in the save's transaction before it lands, through one carry:
    • a NOTE's live text and title (note/saved.rs PreparedSavedNote::carry_room_secrets_in_txn): the document takes each base handle the way a mask on write takes a handle (NoteDocument::mask_body at the carried spans, mask_title, with the mask's commit). The NOTE row holds no text (NoteCore). Each pin keeps the quote its hash binds;
    • a CLAIM's opaque values (val, evid, scope), before its rows are built from the body;
    • a conversation shell's row, carried the same way as a turn's rows.

Stored change: keep (a saved row names a base custody handle, as before).
No new verb, grant or attestation.

Tests

New stem crates/oneiron/tests/room_custody_saved_artifacts.rs (public doors: create_note_in_session, claim_upsert_in_session, save_artifact_as; reads through the oneiron_test_support doors of #10002):

  • a_saved_note_names_the_base_record_of_the_room_secret_it_quotes
  • a_saved_claim_names_the_base_record_of_the_room_secret_it_quotes (a second claim quoting the same room handle takes the same base record)

Red at the test commit 70c3f80 (on #10004's head), green at the head; runs booked in the lane's proof chain.
RUSTFLAGS="--cfg oneiron_test_support" cargo test --locked -p oneiron --all-features --test room_custody_saved_artifacts

…e names its base custody record (FIX ROOM-CUSTODY-SAVED-ARTIFACTS)

A selected save (vault.off_record.artifacts.save) lands a NOTE or a
CLAIM an off-record room holds. One that quotes the room handle of a key
the room keeps in its own custody must land naming the handle of a base
custody record that holds the key, never the room handle or the key, and
only that save teaches base's known-value index the fingerprint. A later
save of a claim quoting the same room handle takes the same base record.

On the stack top (cb53bdf) the saved NOTE's markdown and the saved
CLAIM's value keep the room handle as written.
… and shell name into vault custody (FIX ROOM-CUSTODY-SAVED-ARTIFACTS)

A room keeps a fresh key in its own custody, under a room handle
(`[secret r1]`), and a NOTE, CLAIM or conversation shell the room holds
may quote that handle. The room save carried the handles a saved turn's
rows name (carry_room_secrets_in_txn), but a selected save
(vault.off_record.artifacts.save) landed its NOTE, CLAIM and shell as
written: the 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: RoomCarry is one save's carry out
of a room (RoomCarry::of). Beside a save's rows (ops_in_txn, as before)
it carries one MessagePack value (value_in_txn) and one text
(text_in_txn: the carried text and each span it replaced). Each room
handle takes the handle of a base custody record holding the value: the
one this save moved it to, else the one base custody holds it in, else
one minted now; only that mint teaches the known-value index the
fingerprint. carry_room_secrets_in_txn stays the turn rows' wrapper.

off_record/promote.rs: FloorWrites::room_carry, the carry of the room a
floor saves out of.

off_record/lifecycle/scratch.rs: PreparedScratchSave::land carries each
artifact in the save's transaction before it lands, through one carry:
a NOTE's live text and title (note/saved.rs carry_room_secrets_in_txn:
the document takes each base handle as a mask on write takes a handle,
at its span, with the mask's commit; the NOTE row holds no text; each pin
keeps the quote its hash binds), a CLAIM's opaque values (val, evid,
scope) before its rows are built, and a shell's row as a turn's rows are.

Stored change: keep (a saved row names a base custody handle, as before).
@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 7 billable files and costs up to $1.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 54 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 cbf07b2 and c2bdc15.

Files selected for processing: 7

  • crates/oneiron/src/batch/secret_scan.rs
  • crates/oneiron/src/batch/secret_scan/mask.rs
  • crates/oneiron/src/batch/secret_scan/mask/room_carry.rs
  • crates/oneiron/src/note/saved.rs
  • crates/oneiron/src/off_record/lifecycle/scratch.rs
  • crates/oneiron/src/off_record/promote.rs
  • crates/oneiron/tests/room_custody_saved_artifacts.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

…ts layer (REVIEW-10003, FIX ROOM-CUSTODY-SAVED-ARTIFACTS)
…s (REVIEW-10003, FIX ROOM-CUSTODY-SAVED-ARTIFACTS)

Since REVIEW-10003 a field the side-row wall lifts whole in a room holds
the bare room handle (`r0123456789abcdef.1`), and a room's handles are
spelled with the room's own tag. RoomCarry::text_in_txn now carries a
whole text that is a bare room handle to the bare base handle of the
record that holds its value, as a field a base mask lifted whole holds
`sc12`. The row filter looks for the handles the room keeps, bare or in
a text, in place of the `[secret r` opening alone.

tests/room_custody_saved_artifacts.rs: a claim whose whole value is the
bare room handle lands holding the bare base handle of the same record.

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