Repository navigation
Description
Summary
Mint can produce a participant display name that journal restore then refuses as one "mint could not have produced" — so a world that accepted the participant can no longer be restored at all.
sanitize_display_name (pkgs/id/src/world/util.rs:69-77) orders its steps: filter control/format characters → trim() → take(48). The trim runs before the 48-character cap, so when truncation lands exactly on a whitespace character, the stored name ends in whitespace:
- Input: 47 ×
a+" "+ 10 ×b(58 chars) - Minted/stored name: 47 ×
a+" "— exactly 48 chars, ending in a space
That stored name is a fixed point of neither sanitizer:
sanitize_display_name(stored)trims the trailing space → the 47-astring ≠ storedlegacy_sanitize_display_name(stored)(util.rs:86-94: filter →take(48)→trim()) also trims it → ≠ stored
Restore's #2960 check (pkgs/id/src/world/core.rs:388-398) accepts an Issued display name only when it is non-empty and equal to one of those two sanitizations, and refuses the whole restore otherwise ("participant {} has a display name mint could not have produced"). Mint itself is at core.rs:1220 (let display_name = sanitize_display_name(display_name);) and accepts this shape: the result is non-empty, so the participant is issued, the Issued entry is journaled — and every later restore of that journal fails.
The same shape works with any trim-removed whitespace at position 48 (two spaces at 47–48, or a U+00A0 no-break space at 48 — all probed below). This is the residual edge of two closed fixes colliding: #3709 moved the trim before take(48) (fixing leading padding spending the budget), and #2960 made restore demand a fixed point of one of the two sanitizers; neither order is trimmed after truncation.
Evidence (verified this run, origin/main 4ee46c0ea; world/util.rs md5 ffd968e6fd638d1ac2229c7e5f668725)
Laptop probe ~/git/fleet/probe-2026-11-02-laneA-sanitizefixedpoint/ — sanitize_display_name, legacy_sanitize_display_name, and is_format_char extracted verbatim from origin/main (util.rs.orig / unicode.rs.orig saved alongside), plus a restore_accepts helper mirroring the core.rs:388-398 condition exactly:
| case | minted | restore accepts minted? |
|---|---|---|
Bob (control) |
Bob |
yes |
48 × x (control) |
48 × x |
yes |
| family emoji (legacy control) | sanitized name | yes |
47 × a + + 10 × b |
47 × a + (48 chars, ends in space) |
no — fixed point of neither sanitizer |
46 × a + + 10 × b |
46 × a + (48 chars, ends in spaces) |
no |
47 × a + U+00A0 + 10 × b |
47 × a + U+00A0 (48 chars) |
no |
Why it matters
- A display name is user-chosen text arriving at a join/delegate mint; a >48-char name whose 48th character is a space is ordinary (e.g. a long full name or a phrase). The participant joins successfully — nothing fails at mint time — and the poisoned name is written into the journal.
- The failure surfaces later and out of proportion: restore refuses the whole journal, so the world cannot be reopened/restored from that journal at all, and the error text actively misleads diagnosis by claiming the name is one mint could not have produced.
- Any fix must consider journals already written by the current mint: changing only the sanitizer leaves already-journaled trailing-whitespace names refused by restore, so the restore side (or a migration of the check) needs a deliberate decision in the fix packet.
Acceptance criteria
-
sanitize_display_name's output is always a fixed point of itself: re-sanitizing any minted name returns it unchanged (in particular, no minted name ends in whitespace; truncation is followed by a final trim or equivalent). - A participant minted with the probed shapes (space / double space / U+00A0 at the 48-char boundary) restores successfully from its journal — including a journal entry carrying the exact name the current mint produces, if the fix keeps restore strict.
- The id(world): sanitize_display_name takes its 48 characters before trimming — leading spaces spend the budget, so a padded name is truncated to its first letters or refused as empty #3709 cases still hold: leading padding does not spend the 48-char budget (48 spaces +
Bob→Bob; 1 space + a 48-char name keeps all 48 chars), and the 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 refusal still rejects names no mint path could produce (empty, control-bearing, over-length). - Regression tests cover the boundary shapes above at the sanitizer level and, if practical, at the mint → journal → restore level.
Related: #2960 (closed — the restore fixed-point check), #3709 (closed — trim/take ordering for leading padding), #2112 (closed — Cf stripping in this sanitizer). Distinct from all three: this is the trailing-whitespace-at-truncation shape their combination leaves behind, verified against current main.
Found by new-issue-creator-code-a (lane A) this run.
Activity
dezren39 commentedon Nov 3, 2026
🤖 Agent note · state: filed
dezren39 commentedon Nov 3, 2026
🤖 Agent note · picked up
2 remaining items
dezren39 commentedon Nov 3, 2026
🤖 Agent note · done
b882c9d5; the 48-character boundary result is accepted by mint but is a fixed point of neither sanitizer. id(world): sanitize_display_name takes its 48 characters before trimming — leading spaces spend the budget, so a padded name is truncated to its first letters or refused as empty #3709/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 are closed; no open fix PR found.dezren39 commentedon Nov 3, 2026
🤖 Agent note · queued
repo-health:v1:fix:developing-today/code:issue:4711;queue/queuedlabel synced.dezren39 commentedon Nov 3, 2026
🤖 Agent note · picked up
dezren39 commentedon Nov 3, 2026
🤖 Agent note · done