Repository navigation
feat(mcpl): stamp each inbound item's delivered-body and stored-copy digests #252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
antra-tess
merged 11 commits into
anima-research:main
from
nissa-seru:feat/ingestion-stamps
Oct 21, 2026
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
6c927de
feat(mcpl): stamp each inbound item's delivered-body and stored-copy …
711b400
fix(mcpl): take the stored-copy digest at each storage site, over the…
d36a5ad
fix(mcpl): every stored push gets the host's delivered-body digest; e…
88a24e6
Merge the integrated #247 (1d6d2bb) into feat/ingestion-stamps: bring…
4c73d3f
Merge #247's 315d12c into feat/ingestion-stamps
a2accc1
fix(mcpl): digest a body as the store keeps it, so an untouched store…
d981e49
test(mcpl): pin every branch of the copied raster sniffer with a misl…
97d860d
test(digests): every storage site and store normalization is pinned, …
e0e11fd
Merge #247's sweep round (7cc9c21) into feat/ingestion-stamps
7ce228e
test(digests): the store refuses an undefined array element, and cano…
c500f22
Merge main into feat/ingestion-stamps
antra-tess File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| - **Delivered-body digests on every stored MCPL inbound item.** Both MCPL | ||
| lanes stamp two fields, outside the frozen source envelope (console and API | ||
| input, and the host's own notices, carry neither): | ||
| - `metadata.sourceBodyDigest` is the version identity of the body as | ||
| delivered, taken at ingestion, after MCPL conversion and before any host | ||
| decoration or storage sharding. It is the SHA-256 (hex) of `[blocks]` | ||
| as canonical JSON (keys sorted at every level, `undefined` object entries | ||
| dropped, and an `undefined` array element written as `null` as JSON | ||
| writes it, though the store refuses a body holding one), with the blocks | ||
| as the store keeps them: inline media as | ||
| the store hands it back (base64 re-encoded from its bytes, an image's | ||
| media type taken from its bytes' signature, only `type` and `source` | ||
| kept), strings well-formed (a lone surrogate as U+FFFD) and an entry | ||
| whose key isn't well-formed dropped, as the store's append drops it. So | ||
| the body hashes alike as delivered, as handed to storage and as read | ||
| back, and an undecorated, unsharded stored copy hashes to it. | ||
| - `metadata.storedBodyDigest` uses the same function over exactly the | ||
| blocks handed to storage, decorations included, taken where each path | ||
| stores. | ||
|
|
||
| Both are always the host's own: values an adapter supplies are replaced. | ||
| A stored copy, read back with its blobs resolved, that no longer hashes to | ||
| its `storedBodyDigest` was changed after it arrived (`editMessage` keeps | ||
| metadata). That check is of an unsharded copy: a body the store shards | ||
| (context-manager's adaptive ingress chunking) carries the whole body's two | ||
| digests on every shard (`bodyGroupId` and `shardIndex` mark them), and no | ||
| shard hashes to them. A `blob_ref` block is digested as given, while the | ||
| store resolves it on read, so a copy holding one doesn't match; the MCPL | ||
| lanes never store one. `sourceBodyDigest(blocks)` is exported from the | ||
| package root as the one implementation consumers share; it carries the | ||
| framing and the store's normalization, so check a copy with it rather than | ||
| hashing your own serialization. |
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.