Skip to content

fix(id): reject Cf in directory names and descriptions - #3945

Merged
dezren39 merged 6 commits into
mainfrom
queue/4889-1778-id-directory-cf
Nov 2, 2026
Merged

dezren39 merged 6 commits into
mainfrom
queue/4889-1778-id-directory-cf

Conversation

@dezren39

@dezren39 dezren39 commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

Fixes #1778

Summary

  • Reuse the existing shared Unicode Cf predicate in both directory cleaners.
  • Continue rejecting Cc controls and preserve the description newline allowance.
  • Add regression coverage for ZWSP/RLO rejection and normal values.

Tests

  • cargo test -p id --lib --no-default-features --features world directory::tests — 43 passed.
  • cargo test -p id --lib --no-default-features --features world invite::tests::format_characters_are_refused — passed.
  • rustfmt --check --edition 2024 src/directory.rs and git diff --check — passed.

The standalone id-core petname test target currently fails to compile on clean main due to existing test wiring (missing iroh test-utils/vt100 and a relay test API mismatch); no id-core files are changed here. CI will provide the PR gate.


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

@dezren39
dezren39 requested a review from a team as a code owner November 1, 2026 19:22
@coderabbitai

coderabbitai Bot commented Nov 1, 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 1 minute.

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: 325cc05d-cf1c-445e-8d0a-8a209fdf79f2
Commits

Reviewing files that changed from the base of the PR and between 9268223 and c1d3d68.

Files selected for processing: 1
  • pkgs/id/src/directory.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 1, 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-01T22:10:52.789388Z c1d3d68 Manual request
ℹ️ 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: eb0ca4383d

ℹ️ 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/directory.rs Resolved
…haracters

Codex P1 on PR #3945: Directory::replay passes every historical entry
through apply -> checked -> change, which invokes the same cleaners
the #1778 fix just tightened. A journal written before the fix can
legitimately contain a category-Cf character in an account/group name
or group description, and replaying it would refuse, so the world
could never reopen.

Split the cleaners into strict/mode variants and thread a
refuse_format flag from apply: new writes (apply, checked, change,
store_artifact effects) refuse Cf exactly as before, while replay
(apply_replay) keeps every other check - Cc refusal, length, trim -
but tolerates format characters in historical entries.

Regression test: replay_tolerates_pre_fix_format_characters_in_group_fields
crafts a journal whose GroupUpdated entry carries U+202E/U+200B,
asserts replay reopens with the historical values intact, and asserts
create_group still refuses a Cf name.

Tests: cargo test -p id --lib --no-default-features --features world
directory::tests 44/44 pass; petname::tests 3/3 pass; rustfmt clean.
@dezren39

dezren39 commented Nov 1, 2026

Copy link
Copy Markdown
Member Author

@codex review — new head c1d3d68 fixes the P1 replay finding (see thread reply); please re-review.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: c1d3d68408

ℹ️ 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".

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