feat(#67)!: infallible Matter::to_qb64 in core (text encoding without stream)#78
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… variants Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The typos gate splits "mis-sized" on the hyphen and flags the "mis" fragment as a typo of miss/mist. "mis-sized" is a valid hyphenated compound (incorrectly sized) used in Matter::to_qb64b's doc comment; allow it the same way existing domain-term false positives are handled. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Summary
Resolves the DevX / layering wart in #67: encoding a
Matter-family primitive (Verfer,Diger,Saider,Prefixer,Signer,Cigar) to qb64 text no longer requires thestreamfeature.core:Matter<C>gains infallibleto_qb64() -> Stringandto_qb64b() -> Vec<u8>, co-located with the existing decode path (MatterBuilder::from_qualified_base64). Mirrors the siblingIndexer::to_qb64/Siger::to_qb64contract — the only failure modes are internal-invariant breaks (corrupt sizage table / mis-sized buffer), unreachable for a validatedMatter, handled viaunreachable!/assert_eq!(programmer-bug carve-out, not a data path).stream:stream::encode::matter_to_qb64removed; all consumers (3 examples, 1 bench, 1 fuzz test) migrated to the new API.examples/encode_primitivenow needs onlycore, notstream— a direct demonstration of the issue's goal.serder:to_qb64_string/identifier_to_qb64_string(and the internalseal_to_json/matters_to_json_array) are now infallible (-> String/-> Value); the misplacedSerderError::Qb64Encoding(ParseError)and its dead companionSerderError::Encoding(FromUtf8Error)are removed. Fixes the error-domain smell where a read-pathParseErrorsurfaced on a write path.Breaking changes (MINOR under 0.x — see CHANGELOG)
stream::encode::matter_to_qb64removed → useMatter::to_qb64b.serder::primitives::{to_qb64_string, identifier_to_qb64_string}returnStringinstead ofResult<String, SerderError>.SerderErrorloses theQb64EncodingandEncodingvariants (breaking for downstream exhaustivematch).Test Plan
nix flake checkgreen — all 11 checks (clippy god-level, rustfmt, taplo, audit, deny, nextest across feature combinations, doctest, wasm, no_std). 1777 tests pass.coreand run without thestreamfeature:from_qualified_base64(x) ↔ to_qb64b()/to_qb64()across fixed, variable-soft, typed/untyped codes.ls>0(lead-byte) andxs>0(xtra underscore-fill) coverage — mutation-proven: each new test fails under the corresponding one-line mutation.Closes #67.
🤖 Generated with Claude Code