Skip to content

[L-09] M3 Audit - #1741

Merged
ericnordelo merged 1 commit into
fix/m3-audit-L-08from
fix/m3-audit-L-09
Aug 25, 2026
Merged

[L-09] M3 Audit#1741
ericnordelo merged 1 commit into
fix/m3-audit-L-08from
fix/m3-audit-L-09

Conversation

@ericnordelo

@ericnordelo ericnordelo commented Aug 7, 2026

Copy link
Copy Markdown
Member

JSON-escapes custom type and member names before hashing and safely escapes generated debug output.

Summary by CodeRabbit

  • Bug Fixes

    • Improved type-hash handling for names containing quotes, backslashes, braces, control characters, and null bytes.
    • Prevented malformed generated formatting output when special characters appear in type or member names.
  • Tests

    • Added coverage for special-character escaping in struct names, member names, and enum variants.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 56dd5e89-6169-4064-ad84-c27edb508528

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

Type-hash generation now JSON-escapes type and member names, including control characters. Debug output also escapes backslashes and braces. Unit and snapshot tests cover these cases.

Changes

Type-hash escaping

Layer / File(s) Summary
JSON encoding for type-hash names
packages/macros/src/attribute/type_hash/parser.rs, packages/macros/src/tests/test_type_hash.rs
Type and member names use JSON string encoding. Tests cover quotes, backslashes, control characters, null bytes, struct names, member names, and enum variants.
Generated debug output escaping
packages/macros/src/attribute/type_hash/definition.rs
Debug type-hash strings now escape backslashes and braces before interpolation into generated Rust formatting code.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

I’m a rabbit guarding names in code,
With escaped paths along the road.
Quotes and braces hop safely through,
Backslashes behave as rabbits do.
Tests shine bright in snapshots new.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title identifies an audit but does not describe the main change: adding JSON escaping for type and member names and generated debug output. Use a specific title such as "Escape type-hash names and debug output".
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/m3-audit-L-09

Comment @coderabbitai help to get the list of available commands.

@ericnordelo ericnordelo changed the title fix: L-09 [L-09] M3 Audit Aug 7, 2026
@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@immrsd

immrsd commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@bidzyyys bidzyyys linked an issue Aug 7, 2026 that may be closed by this pull request
@immrsd
immrsd self-requested a review August 12, 2026 12:32

@immrsd immrsd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@ericnordelo
ericnordelo merged commit 6bc3911 into main Aug 25, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[L-09]: User-provided names are not JSON-escaped in the encoded type

2 participants