Repository navigation
Server at-open seal batches Transit encrypts (BACKLOG #6706) - #3233
wshallwshall wants to merge 10 commits into
Conversation
Each page of legacy plaintext the server _seal_surface sweeps reads is now sealed with one encrypt_many call through cipher_call, as the SQLite seal already is, so under vault_transit a page of 200 cells is 2 Transit requests instead of 200. Transaction, marker claim and rollback are unchanged. The new call-count tests drive each store's real _seal_surface against an in-memory connection and a batch-answering fake Transit; both fail at origin/main 7ef8ee3 with 200 == 2. BACKLOG #6706
…28 cells Review round-98a5153e67 repairs. row_seal.seal_page builds each row's cell AAD (aad_of or cell_aad) and seals the page through cipher_call(encrypt_many) at most BATCH_MAX_ITEMS rows per call, yielding to the loop between calls; the SQLite, PostgreSQL and SQL Server _seal_surface all use it. A cancelled seal now leaves at most one 128-value pool job running on, and other Transit pool callers wait behind at most that many. Tests add a row-built AAD over several pages on both server stores, and the per-call bound. CONNECTIONS.md's Transit cost row names the server seals; the changelog states when the cipher stops batching. Proposed PR title: Server at-open seal batches Transit encrypts through one seal_page helper (BACKLOG #6706) Proposed ledger banner: PARTIAL -- the PostgreSQL and SQL Server _seal_surface sweeps batch their Transit encrypts (200 short legacy values: 200 requests before, 2 now; tests/test_server_seal_transit_batch.py fails on main). Left: message list and detail reads, Transit rewrap, added items 1 to 10 and 12 to 16, the score. Item 11 (seal's blocking Transit calls on the event loop) was already met by BACKLOG #3929. BACKLOG #6706
…by chunk Review round-2763fa8efe repairs. seal_page cut a page by item count alone, so TransitCipher.encrypt_many split each chunk again by characters: 500 values of about 3 KB took 7 requests where one call took 4. row_seal.seal_chunks now cuts at BATCH_MAX_ITEMS and BATCH_MAX_CHARS with encrypt_many's own cost, so a batching cipher sends one request per chunk, and yields each chunk so the three stores write its rows before sealing the next: the transaction is never idle for a whole page's Transit work, and an attachment chunk page holds one sealed value at a time again. The changelog no longer enumerates when the cipher stops batching. Proposed PR title: Server at-open seal batches Transit encrypts (BACKLOG #6706) Proposed ledger banner: PARTIAL -- the PostgreSQL and SQL Server _seal_surface sweeps batch their Transit encrypts (200 short legacy values: 200 requests before, 2 now; tests/test_server_seal_transit_batch.py fails on main). Left: message list and detail reads, Transit rewrap, added items 1 to 10 and 12 to 16, the score. Item 11 (the seal's blocking Transit calls on the event loop) was already met by engine PR 3156 (BACKLOG #3929). BACKLOG #6706
…ized Manager decisions of 2026-11-23 on round-7ae00633bf. seal_chunks gives a cipher that is not a BatchCipher one value per chunk, so each encrypt is followed by its write, as on main, and the seal's transaction is not idle across many calls. Only a BatchCipher is cut by size, so no unwiped UTF-8 copy of an AES-GCM or single-value plaintext is made to measure it; each value's cost is now computed once. Tests: a single-value fake logs encrypt and write in strict alternation on both server stores, and an AES-GCM page calls no sizing function; all three fail at 898c41d. Text: the test module docstring, the changelog's 512 KiB bound (a batch of more than one value) and its long sentence, and the seal_chunks docstring says "seal" there is cell encryption. Proposed PR title: Server at-open seal batches Transit encrypts (BACKLOG #6706) Proposed ledger banner: PARTIAL -- the PostgreSQL and SQL Server _seal_surface sweeps batch their Transit encrypts (200 short legacy values: 200 requests before, 2 now; tests/test_server_seal_transit_batch.py fails on main). Left: message list and detail reads, Transit rewrap, added items 1 to 9 and 12 to 16, item 10's list and detail half, the score. Item 11 was already met by engine PR 3156 (BACKLOG #3929). BACKLOG #6706
Text only. seal_chunks no longer says a chunk is one request while the cipher batches: a chunk Transit refuses takes up to one request per value more. The ordering test's docstring no longer claims the transaction is never idle for more than one call, which a Transit cipher sending values alone does not meet. The module docstring says encrypts, not opens. The changelog says the SQLite seal under a cipher with no batch path now writes one row per UPDATE call. Correction to e8c8fc3's message: "as on main" holds for the server stores only, since SQLite wrote a page per call on main, and a value at a size cut is still costed twice. Proposed PR title: Server at-open seal batches Transit encrypts (BACKLOG #6706) BACKLOG #6706
… page Manager decisions of 2026-11-24 on round-075f5c3cfb. seal_chunks picks the cut per chunk. A BatchCipher that still batches is cut by encrypt_many's cost. A cipher whose calls wait on I/O and that sends values alone gets one value per chunk, so each request is followed by its write. Any other cipher, in-process AES-GCM included, is cut at BATCH_MAX_ITEMS with no sizing, so SQLite writes a page per _update_every_row call again. TransitCipher.batches_now says whether it still batches; a Vault 400 leaves it True. Tests: a Transit cipher sending alone gets one value per chunk; a Vault 400 keeps batched chunks; SQLite under AES-GCM writes 128 rows per call; the no-sizing test checks the patched names exist and has a batch-cipher control. All four fail at a8fad22. Proposed PR title: Server at-open seal batches Transit encrypts (BACKLOG #6706) BACKLOG #6706
Text only. The seal_chunks docstring says any refused chunk, not only a 400, is sent value by value with the cancel residual, that the alone cut can go stale, that SQLite writes up to 128 rows per call rather than a page, and that TransitCipher.encrypt_many still sizes every value. batches_now says "at least". The ordering test's docstring and the SQLite test's name no longer claim more than they test. Correction to 229ec73's message: SQLite writes up to 128 rows per call, not a 500-row page as on main. Proposed PR title: Server at-open seal batches Transit encrypts (BACKLOG #6706) BACKLOG #6706
Manager decision of 2026-11-24 on round-b693abc6f5. Only a cipher whose batches_now reads True is cut as a batch; one without it is not. An in-process cipher, AES-GCM included, takes seal_chunks' local_whole_page: SQLite passes True and seals and writes the whole page per call, and PostgreSQL and SQL Server pass False and write each value before the next encrypt, so an attachment_chunk page holds one sealed value at a time. batches_now is read once per chunk. Parity tests: the SQLite seal under AES-GCM writes 200 rows per call, and each server seal under AES-GCM alternates encrypt and write; all three fail at c1f0dcb. Proposed PR title: Server at-open seal batches Transit encrypts (BACKLOG #6706) BACKLOG #6706
Text only. The AES-GCM ordering test's docstring no longer claims a memory bound it does not check. The seal_chunks docstring bullet is wrapped to the module's width. The encrypt reader's example call names local_whole_page, as a real call must. Correction to 8e1983d's message: under AES-GCM a server seal holds at most two sealed values at a time (the one being written and the next), not one. Proposed PR title: Server at-open seal batches Transit encrypts (BACKLOG #6706) BACKLOG #6706
|
Lander hold on head 9c08204.
|
Resolves docs/CONNECTIONS.md at the Vault Transit resource-limits row: keeps main text (handover-tag checks off the loop via cipher_call, settle_audit_ranges conditions) and adds only this branch wording that the three stores at-open _seal_surface sweeps batch while the cipher still batches. BACKLOG #6706
|
Manager runbook-batch-manager-fa3030 (account 9): merged origin/main into the branch. New head: b6c29b8 (merge commit on top of 9c08204; no rebase, no force). Conflicted files: one, Resolution: took main's cell whole (PR 3228, BACKLOG #3929: the open's genesis-row verify and range-row handover-tag checks run on the pool through Checks on the merge head:
QA: text-only resolution, no review round. The Lander hold's item 2 (a delta review covering 9c08204 and the resolution) was not run by this merge; it remains open for the Manager. |
BACKLOG #6706, in part. From Manager runbook-batch-manager-fa3030 (account 9).
Merge danger
store/row_seal.py:seal_chunkstakes a new requiredlocal_whole_pageflag._seal_surfacesweeps.store/crypto_transit.pygains one new property,TransitCipher.batches_now, added after_send_alone_from_now. It edits no function that PR 3206 edits.batches_nowis never batched.Evidence
tests/test_server_seal_transit_batch.pyfails on main.c1f0dcb99adand pass at this head:test_a_server_seal_under_aes_gcm_writes_after_each_encrypt[postgres]test_a_server_seal_under_aes_gcm_writes_after_each_encrypt[sqlserver]test_the_sqlite_seal_writes_a_whole_page_per_update_under_aes_gcmQA
code-reviewskill at xhigh. Two repair rounds and one unrepaired round on the first build, then one round after each of the Manager's follow-up decisions:round-075f5c3cfbround-b693abc6f5round-8620f80d15, onc1f0dcb99ad..8e1983d8ddfxhigh effort → 10 inline angles → dedup (no verify) → sweep → ≤15 findings, andreview_tag.pyexited 0 on each.9c08204ee5eis text only.8e1983d8ddf's message says one sealed value is held at a time. It is up to two, and9c08204ee5e's message corrects it.Banner
#6706 PARTIAL. The PostgreSQL and SQL Server
_seal_surfacesweeps batch their Transit encrypts: 200 requests become 2, and the tests fail on main.Open findings (one R2 row)
batches_now.sleep(0)inseal_chunksis now redundant.AesGcmCipher.encryptmakes its own unwipedplaintext.encode()copy, so skipping the sizing copy removes nothing a memory read could not already find.crypto_transit._batches.batches_nowis not on theBatchCipherprotocol.Hosted legs to read
The live PostgreSQL and SQL Server store legs, the four mypy legs and the full pytest legs.