feat!: memo-policy slice — lossless typed memos in the canonical summaries - #2616
Open
zancas wants to merge 2 commits into
Open
feat!: memo-policy slice — lossless typed memos in the canonical summaries#2616zancas wants to merge 2 commits into
zancas wants to merge 2 commits into
Conversation
zancas
marked this pull request as ready for review
August 4, 2026 01:42
The three summary memo fields become zcash_protocol Memo and the text-only filters leave transaction-summary construction, so the canonical layer stops editorializing what it carries. The text-only display policy moves to zingo-perspective, which now derives transfer memos and the memo-to-self classification through its own text_memo view. zingolib's summary renderers stay bug-compatible, rendering a non-text memo exactly as the previously-dropped memo rendered, so no canonical output bytes change and every golden fixture holds byte-identical. A new derivation test pins the typed memo present on the summary while the derived value transfer hides it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Stacked on #2611 (base
viewmodel_seed; retarget todevwhen the seed merges). The second slice of the perspective migration: the canonical layer carries every memo losslessly typed, and the text-only display policy becomes an editorial fact in zingo-perspective.What this does
The three summary memo fields (
BasicNoteSummary,NoteSummary,OutgoingNoteSummary) becomezcash_protocol::memo::Memo, and the sevenif let Memo::Textfilters at transaction-summary construction are deleted — the canonical snapshot stops editorializing what it carries. The policy lands where it belongs:text_memoandreceived_text_memosin zingo-perspective drive the transfer memos and the memo-to-self classification, andreceived_memosleaves zingolib entirely (it was the policy wearing a canonical method's clothes, with the perspective crate as its only caller).By the renderer ruling, zingolib's own Display/JSON impls stay bug-compatible: a text memo renders as before, and a non-text memo renders exactly as the previously-dropped memo did (empty string in Display, null in JSON). No canonical output bytes change anywhere, and the rendering opinion stays confined to the renderers, where the future rendering slice retires it wholesale.
Contract safety
All eight golden fixtures hold byte-identical — the pin that the policy's output moved without moving. A new derivation test pins what the goldens cannot see: an arbitrary-bytes memo is present and typed on the
TransactionSummarywhile the derived value transfer shows nothing for it. The expected-summary literals in the mock-chain and unit-test-twins suites convert to typed memos; thequick_sendOption<&str>memo arguments are untouched.Verification
Workspace
--all-targets, clippy, rustfmt, and the feature combinations includingunit_test_twinsare clean. Test runs: 12/12 zingo-perspective (goldens byte-identical), 14/14 zingolib summary and mock-chain, 167/167 zingo-cli.🤖 Generated with Claude Code