Repository navigation
fix(id): restore refuses Issued display names mint could not produce (#2960) - #4279
Conversation
…2960) WorldCore::restore inserted journaled participants verbatim, so a hand-edited or fork-copied journal could restore empty, control-bearing, or over-length display names that mint (which sanitizes and refuses empty results) can never produce — and checkpointing then re-journaled them permanently. Refuse the whole restore when a journaled name is empty or differs from sanitize_display_name(name), beside the existing participant-0 refusal. Legitimately minted journals always carry sanitized names, so none are affected. Tests beside restore_refuses_an_issued_participant_zero: empty, control-bearing, 49-char, untrimmed, and control-only names refused; a minted journal restores fine.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 52 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
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: 30573041bf
ℹ️ 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".
Codex P2 on #4279: journals minted before 872aa09 (#2112) used a control-only display-name sanitizer, so legitimate names with ZWJ/ZWNJ (family emoji) are not fixed points of the current sanitizer and the #2960 restore check would have rejected those whole worlds. Restore now accepts a fixed point of either sanitizer; names no mint version could produce (empty, control-bearing, >48 chars, untrimmed) are still refused. Adds legacy_sanitize_display_name (the exact pre-#2112 function), a util test, and a restore test for a ZWJ family-emoji name.
fix(id): restore refuses Issued display names mint could not produce (#2960)
Closes #2960 (queue task 5500).
Problem.
WorldCore::restoreinserted journaledParticipants verbatim, includingdisplay_name.mintruns every name throughsanitize_display_name(control/format characters stripped, 48-char cap, trimmed) and refuses an empty result — so a hand-edited, corrupted, or fork-copied journal could restore empty, control-bearing, or over-length names that no live path can produce, and the next checkpoint re-journaled them permanently.Change. In restore's
Issuedarm, beside the existing participant-0 refusal (#2972), refuse the whole restore when a journaled display name is empty or differs fromsanitize_display_name(name)— exactly the set of names mint could never have produced. This is the pinned rule: refuse (matching restore's "a bad journal is refused, never partially applied" contract) rather than sanitize-and-keep. Legitimately produced journals always carry already-sanitized names (checkpoint_entriesre-emits participants that all came throughmint), so no legitimate shape is affected.Tests. New
restore_refuses_issued_display_names_mint_could_not_producebesiderestore_refuses_an_issued_participant_zeroinpkgs/id/src/world/tests.rs: empty, control-bearing (101 chars), 49-char, untrimmed, and control-only names are each refused with an error naming the display-name rule; a legitimately minted journal restores fine. Targetedcargo test --lib restore_refusesrun on the laptop; CI runs the full suites on this PR.Need help on this PR? Tag
@codesmith-botwith what you need.