Skip to content

fix(id/world): keep minted display names restorable at the 48-char boundary - #4727

Merged
dezren39 merged 1 commit into
mainfrom
queue/6696-4711-display-name-fixed-point
Nov 3, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/6696-4711-display-name-fixed-point

Conversation

@dezren39

@dezren39 dezren39 commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Fixes #4711 (task 6696).

Problem

sanitize_display_name trimmed before the 48-char cap, so truncation landing on a whitespace character minted a 48-char name ending in whitespace — a fixed point of neither sanitizer — and the #2960 restore check then refused the whole journal ("a display name mint could not have produced").

Change

  • sanitize_display_name now trims again after truncation, via the extracted pre_fix_sanitize_display_name (the old algorithm, kept for journal compatibility), so every minted name is a fixed point of itself.
  • Restore's id(world): journal restore never sanitizes Issued display names — empty, control-bearing, and over-length names restore verbatim, though mint refuses or strips all three #2960 check additionally accepts is_pre_fix_mint_display_name: an exact characterization of pre-fix mint outputs (no control/format chars, no leading whitespace, ≤48 chars, and fully trimmed unless exactly 48 chars). Journals already written with boundary names stay restorable; empty, control-bearing, over-length, and short-but-untrimmed names are still refused.
  • Note: boundary names are not fixed points of the pre-fix sanitizer (re-applying it trims them), which is why restore uses the producibility predicate rather than a third sanitizer equality — the first version of this PR's tests caught exactly that.

Tests (laptop, pkgs/id, cargo test --lib)


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

…undary (#4711)

sanitize_display_name now trims after the 48-char truncation, so every minted name is a fixed point of the sanitizer (previously a name whose 48th char was whitespace was minted with trailing whitespace and then refused by the #2960 restore check, bricking the journal). Restore also accepts names the pre-fix mint could have produced (is_pre_fix_mint_display_name) so journals already written with boundary names remain restorable, while still refusing empty, control-bearing, over-length, and otherwise unproducible names.

Tests: sanitizer boundary shapes (space / double space / U+00A0 at the cap), pre-fix producibility predicate, and restore-level cases for pre-fix boundary journals and freshly minted boundary inputs.
@dezren39
dezren39 requested a review from a team as a code owner November 3, 2026 02:11
@coderabbitai

coderabbitai Bot commented Nov 3, 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 39 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: d71f00d5-dd56-41ed-829e-a751a54016d0
Commits

Reviewing files that changed from the base of the PR and between 22fd4a3 and 4896d30.

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

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 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-03T02:13:21.683633Z 4896d30 PR opened
ℹ️ 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.

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