Repository navigation
Conversation
samgbafa
force-pushed
the
skgbafa/tc-887-r5-fs-sealed
branch
from
November 8, 2026 00:41
11728ac to
203ea34
Compare
samgbafa
force-pushed
the
skgbafa/tc-887-r4-kv-sealed
branch
from
November 8, 2026 00:41
78fd3e6 to
0fa782d
Compare
Sealed names v1/{space_tag}/{object}[@n] with same-directory .tc-stage-
publish, plaintext quota reservations, and reads/ranges that serve only
authenticated plaintext. Core storage traits get prepares/prepare_read/
prepare_write; a writing invocation prepares its spaces after the TC-735
preupload transaction authorized it, before any upload or write lock, and
work under the writer lock runs in at_rest::write_locked. Orphan removal
deletes both copies and waits while keys are locked. The FileSystem store
declares the blocks seal path.
samgbafa
force-pushed
the
skgbafa/tc-887-r5-fs-sealed
branch
from
November 8, 2026 00:53
203ea34 to
b9733be
Compare
samgbafa
force-pushed
the
skgbafa/tc-887-r4-kv-sealed
branch
from
November 8, 2026 00:53
0fa782d to
2c35d3f
Compare
This branch has not been deployed
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.
TC-887, part 5 of the refreshed at-rest stack (base: #518). Replaces #333 (
skgbafa/tc-887-s3b-fs-sealed), ported onto current main.What
encrypt/strictwith the gate open, a block is sealed (TCE1) into a.tc-stage-file beside its sealed name{blocks}/v1/{space_tag}/{object}[@N]and renamed into place, under main's per-generation operation lock and with main's reserve/settle/refund quota flow (charged in plaintext bytes). Reads and ranges serve only authenticated plaintext, with plaintext totals; legacy is read inoff/encrypt, refused instrict; locked keys answer 503 for anything that may be sealed. Modeofftakes main's legacy path unchanged.ImmutableReadStore::{prepares, prepare_read}andImmutableWriteStore::prepare_write(defaults: no-op), forwarded byBoxandEither.prepare_writefor written spaces (creates the data key),prepare_readfor spaces akv/getreads inside the transaction (restores a lost data key from the mirror). Work under the writer lock runs inat_rest::write_locked: the protected legacy upload (which holds the locks across persist) andget_kvin the transaction. Ordinary uploads stay lock-free and outside it.tests/at_rest_fs_store.rs::a_refused_put_creates_no_data_key_or_mirror_object, and the core ordering test below.invoke_read_only(deviation from the plan, on purpose): read-only invocations and the KV GET routes hold no writer lock, so the keyring restores a lost data key on first use there; preparing would add a database query per read. Covered bya_lost_data_key_row_is_restored_before_the_writer_lock(a read after the row is lost restores it).remove,cleanup_stages) handles both names: it removes the sealed copy and the legacy copy of the generation, and refuses (503, the collector retries) while keys are set up but locked, so a sealed object is never left unnamed..tc-stage-files underv1/are charged their stored bytes and tracked like main's stages in space directories.storage::attach_at_restruns inlib.rsbeforeorphan_store = block_store.clone(); for the FileSystem store it attaches the runtime and callsdeclare_seal_path(SealPath::Blocks). S3 declares nothing yet (next PR).encrypt/strictstill boot only once SQL artifacts declare their seal path too.docs/at-rest/INTERFACES.md§7 (prepare ordering, removal, accepted residuals); CHANGELOG.Tests
storage::file_system::sealed_tests(ported + new: generation names, removal of both copies and refusal while locked, crashed sealed stage cleanup/refund, failed persist leaves no files and refunds).tests/at_rest_fs_store.rs(new, runs in CI):SpaceDatabase+ FileSystem store + a realAtRestKeyringon SQLite with the FS key mirror: only TCE1 underv1/names, plaintext and range reads; a refused put creates no key row and no mirror object; a lost data-key row is restored before the writer lock for a protected legacy write (would beNotPrepared503 otherwise).tinycloud-coredb::test::storage_prepares_spaces_after_authorization_and_before_the_writer_lock: hook order and lock state for an unhosted put, an ordinary put, a protected legacy put, and a get beside a put.tests/at_rest_fs_node.rs(ported, app level): the fourencrypttests are#[ignore = "needs the SQL artifact seal path too (TC-887)"]because the app refusesencryptuntil both seal paths exist:an_encrypting_filesystem_node_seals_kv_values_and_serves_plaintext,a_refused_put_creates_no_data_key_or_mirror_object,an_unauthorized_put_to_a_hosted_space_creates_no_data_key,a_mixed_read_and_delete_after_losing_the_data_key_row_completes.an_off_node_still_stores_plaintext_under_legacy_namesruns.Verification (run locally)
cargo fmt --all;RUSTFLAGS=-Dwarnings cargo clippy --locked -p tinycloud-node -p tinycloud-core --all-targets: cleancargo test --locked -p tinycloud-node --lib: 1024/1025 passed; the one failure wasegress::tests::tc1132_tls_connect_stall_is_bounded_before_total_timeout(a wall-clock bound, on a loaded host; an earlier run of the same suite failed threepolicy_v3::account_alias_testsinstead, which pass alone and withpolicy_v3::as a module). Neither touches storage.cargo test --locked -p tinycloud-node --lib storage::: 72 passedcargo test --locked -p tinycloud-node --test at_rest_fs_store --test at_rest_fs_node --test at_rest_ceremony --test did_resolution_single_entry --test space_size_restart --test kv_invoke_replay --test kv_batch_read: all passed (4 ignored as listed)cargo test --locked -p tinycloud-core --lib: 1087 passed