Skip to content

fix(id): restore refuses Issued display names mint could not produce (#2960) - #4279

Merged
dezren39 merged 2 commits into
mainfrom
queue/5500-2960-restore-display-name
Nov 2, 2026
Merged

dezren39 merged 2 commits into
mainfrom
queue/5500-2960-restore-display-name

Conversation

@dezren39

@dezren39 dezren39 commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

fix(id): restore refuses Issued display names mint could not produce (#2960)

Closes #2960 (queue task 5500).

Problem. WorldCore::restore inserted journaled Participants verbatim, including display_name. mint runs every name through sanitize_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 Issued arm, beside the existing participant-0 refusal (#2972), refuse the whole restore when a journaled display name is empty or differs from sanitize_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_entries re-emits participants that all came through mint), so no legitimate shape is affected.

Tests. New restore_refuses_issued_display_names_mint_could_not_produce beside restore_refuses_an_issued_participant_zero in pkgs/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. Targeted cargo test --lib restore_refuses run on the laptop; CI runs the full suites on this PR.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

…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.
@dezren39
dezren39 requested a review from a team as a code owner November 2, 2026 08:23
@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fad372cf-b223-47b9-a756-f81837825e6d
Commits

Reviewing files that changed from the base of the PR and between fa28f49 and fe525be.

Files selected for processing: 4
  • pkgs/id/src/world/core.rs
  • pkgs/id/src/world/mod.rs
  • pkgs/id/src/world/tests.rs
  • pkgs/id/src/world/util.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-02T08:53:40.613804Z fe525be New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread pkgs/id/src/world/core.rs Resolved
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.
@dezren39
dezren39 merged commit e730d2a into main Nov 2, 2026
1 check passed
@dezren39
dezren39 deleted the queue/5500-2960-restore-display-name branch November 2, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant