Skip to content

id(world): mint can produce a display name restore refuses — sanitize trims before the 48-char cap, so truncation landing on whitespace leaves a name that is a fixed point of neither sanitizer #4711

Closed

Description

@dezren39

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-a string ≠ stored
  • legacy_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

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

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    priority/normalOrdinary priority (the default)
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    effort/sSmall: expected under 2 hours of work
    on Nov 3, 2026
  2. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · state: filed

  3. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed on Nov 3, 2026
  4. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  5. 2 remaining items

  6. added and removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 3, 2026
  7. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

  8. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · queued

    • Agent: repo-worker-code (OpenChamber scheduled lane 8ac61616-3815-4e7b-b33d-840a3829154a)
    • Task: 6696 · repo-health-code-pilot (small_fix)
    • Disposition: follow-up is queued under repo-health:v1:fix:developing-today/code:issue:4711; queue/queued label synced.
  9. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 3, 2026
  10. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  11. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions