Repository navigation
fix(identity): stream member content identity with one method for every size - #5659
Conversation
|
You have reached your Codex usage limits for security reviews. Please try again later. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 68248a96cd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
This also resolves two earlier Codex P1 findings about a byte-digest fallback whose identity kind was not persisted: #5308 ( |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9b31e8ac65
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c7d2a591a0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 14dd441b1d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ry size Payloads above 256 MiB used to take the SHA-256 of their bytes instead of their structural identity, so two serializations of the same large member got different identities while smaller ones matched. The byte route now streams every payload through one tokenizer and hashes objects as sorted (key, value-digest) entries, so no document is held whole and no size changes the definition. The decoded-value route computes the same digest. Lone surrogate escapes, byte-order marks, duplicate keys and number forms resolve as the in-memory decoder resolves them. The identity domain moves to v2. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
A string value longer than 8 MiB is no longer handed to the tokenizer: its raw content goes to a scratch file and is unescaped, NFC-normalized and hashed in windows cut at escape, surrogate-pair, UTF-8 and composition boundaries, so no scalar is held whole. The surrogate-escape scan matches backslash runs possessively and stays linear. A non-finite number poisons only its own member, so a later duplicate key that replaces it keeps the document structural, as the decoder does; a Decimal the tokenizer cannot represent falls back to the byte digest like any non-finite number. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
An object past 100,000 members moves its entries to a scratch table that applies last-key-wins and orders them, so object size costs no memory. A complete invalid escape in a spilled string is rejected when it is read. A number, object key or unbroken combining sequence longer than SQLite's compiled maximum value length raises a typed ContentIdentityRefusal, not an out-of-memory failure or a byte-digest substitute. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
A token past SQLite's value limit is refused only after the whole member parses as JSON; opaque members keep their byte identity. Keys and combining sequences are measured by decoded UTF-8 size, with the unbroken-sequence scan linear. A refused member is a recorded per-member gap in every ZIP acquisition route instead of failing the whole ZIP, and ZIP replay reuses the identity acquisition already computed. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4
…ames Codex review round on the streaming member identity: - production baseline: a ContentIdentityRefusal becomes a typed `content_identity_refused` member fault instead of aborting the cold-build baseline. - live ZIP expansion: refused members are recorded as `live_ingest_admission` convergence debt on the ZIP (cleared by a later clean expansion), so the missing member is a durable, visible gap after the cursor advances. - streaming identity: a run of directly nested arrays shares one frame and object frames allocate their hasher and member table lazily, so deep nesting no longer costs a hasher and table per level. - a BOM-bearing UTF-16 member is transcoded before tokenizing, matching the source decoder, instead of falling back to its byte digest. - census the scratch SQLite table in content_identity.py and report the source-acquisition refusal through a structured event. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01P8nGdByCWAzpk78ko2xza6
14dd441 to
73576f9
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 73576f9b49
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- a BOM-bearing UTF-32 member (either byte order) is transcoded like UTF-16; the UTF-32-LE mark is matched before UTF-16's, which it begins with. - a spilled object row now holds the raw key's hash instead of the raw key, and a key too long to share a row with the hash and digest stays in memory and is merged in order on encode, so no key within the value limit raises sqlite3.DataError. The scratch connection pins its length limit to physical_value_limit(). Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01P8nGdByCWAzpk78ko2xza6
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cd6baca582
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…s decoded - a member's text is chosen exactly as decode_json_bytes chooses it: the first of JSON_TEXT_ENCODINGS (now owned by content_identity and used by decoder_json) under which the whole payload decodes, with NULs and leading byte-order marks dropped, else UTF-8 ignoring errors. BOM-less UTF-16/32 members the decoder reads now share their UTF-8 identity; a JSON failure still decodes the rest before settling, as the decoder picks an encoding by decodability, not by parse. - a spilled long key reaches the hasher as a marker for its decoded text instead of being re-escaped into the token stream. - open containers are bounded at 2^20 (array runs count once): far past the depth the source decoder can recurse, so no decodable member is affected; a deeper member takes its byte identity. - test: retarget the source-only ZIP test's monkeypatch from the removed _detect_provider_from_raw_bytes (inherited failure from #5557) to detect_provider_from_path_sample_evidence. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01P8nGdByCWAzpk78ko2xza6
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ef3e49b011
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- object members are held against one per-document memory budget (estimated bytes, key length included) instead of a per-object count, and spilled objects share one scratch connection keyed by object id, so long keys or deep nesting of small objects cannot multiply the working set or the scratch connections. - a payload no strict encoding decodes keeps its byte identity: the source decoder's lossy UTF-8 fallback can read such bytes as a clean document's text, and the identity must not share that document's. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01P8nGdByCWAzpk78ko2xza6
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 494522dc94
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…he shared budget A key too large for a scratch row is kept in memory after an object has spilled, but its cost was never added to the shared per-document budget: several such keys under one admitted object could pile up ungoverned, and other sibling objects sharing the same budget stayed unspilled longer than they should. The fallback path now charges the budget like every other retained entry, and a spilled object's close() releases it -- the previous close() only ever released the pre-spill charge, leaking the fallback charge for the life of the document. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
# Conflicts: # tests/unit/sources/test_export_member_addressing.py
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b5e14fca58
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A refused value (overlong number or combining sequence) is recorded on its own object member, so a later duplicate key replaces it as the decoder does; a refused key still refuses the document. A ZIP member's split enumeration records a refused element and keeps emitting the elements after it, then reports the refusal as the member's gap. The shared member-budget test now exercises the budget it claims. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d8afea8a9d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ed blobs An overlong key refuses the object holding it rather than the document, so an outer duplicate can replace it. Replay keeps the elements acquired beside a refused split element, a grouped element always takes its split index, and a refused preserved member discards its queued publication. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aa27780efe
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…lobs Each refusal travels with the value it refused, so the exception raised names the token that survived last-key-wins. The grouped ZIP capture path discards a refused member's queued publication like the preserved path does. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8697aa69b3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
Content identity decoded members with the lenient detection decoder, which drops NULs, so bytes the record parser rejects took a clean document's identity. It now uses the encoding json.detect_encoding picks and keeps every character. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 68d22a15da
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…for a row Normalization streams by holding only the text after the last starter (the only part later input can change), so a long run of composable characters is normalized in windows instead of refused, and a key is measured by its NFC size. A key too long for a scratch row beside its hash and digest is spooled to its own scratch file with a bounded in-memory prefix instead of being held. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9cdfd3a699
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The emitter captures the elements after a refused one and reports the refusal as the member's gap; the baseline's revision replay refuses a whole member whose content identity acquisition refuses. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 12827028a4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 19a273d851
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… does Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5001fea70f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…refusal Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c774ad0b89
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…sions Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
Master's content-identity refusal (#5659) and streamed member revisions now meet the acquisition boundary: - One receipt-keyed discard (discard_pending_receipt) replaces both discard_queued and discard_pending_hash; identity refusals release through release_refused_capture. - A split member's validated siblings survive a content-identity refusal, in acquisition and in the production baseline. - The streamed member-revision reader opens the member through the boundary, and retirement of an earlier acceptance streams the member instead of reading it whole. - The boundary census also covers write_from_writer/prepare_from_writer. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
Summary
Member content identity no longer changes method by payload size (polylogue-vus7y).
Problem
bounded_payload_content_identityreturned the payload's SHA-256 byte digest aboveSTRUCTURAL_IDENTITY_MAX_BYTES(256 MiB) and the structural identity below it. Two serializations of the same large member (different key order or whitespace) therefore got two identities, while the same content under 256 MiB got one. The ceiling existed because structural identity decoded the whole document.Solution
core/content_identity.py: one definition (domainmember-content:v2). Arrays are delimited instead of count-prefixed and objects are sorted(key, value-digest)entries, so a document can be hashed as it streams.stream_payload_content_identitytokenizes in 1 MiB windows (ijson C backend) and holds only each open object's entries and the current scalar.payload_content_identityand every acquisition, replay, backup and integrity caller use it for all sizes.\\uD800escape to?; a scanner that tracks backslash-run parity across windows detects lone surrogate escapes and re-reads with ijson's exact Python backend.CONTENT_IDENTITY_SKIPPED_OVERSIZE, thecontent_identity_skipped_reasonplumbing and the two skip events.Verification
tests/unit/core/test_content_identity_streaming.py: hypothesis property (streamed identity == decoded-value identity for generated documents under bothensure_asciimodes), 17 edge cases, lone-surrogate vs?distinctness, a multi-window document whose two serializations share one identity (red with any size ceiling), and surrogate escapes straddling a read window.tests/unit/sources/test_unbounded_probe_ceilings.py: the identity reads only bounded windows and is structural for a 3 MiB payload.devtools testover the 29 test files touching content identity, acquisition and ZIP decoding: running on the shared pytest pool; result in a comment.core/content_identity.py,sources/source_acquisition_components.py,sources/decoder_zip.py,sources/parsers/base_models.pyare IN. Every stored member identity changes (v1 → v2), so this lands before the fresh build; the old archive is inert salvage and is not compared.🤖 Generated with Claude Code
https://claude.ai/code/session_013Vn4qhKjhyaVBG4aPiqNW4