Skip to content

fix(lab-ops-hub): return the ASCII dot for literal UTS-46 separator spellings in the container validator (#660) - #664

Merged
dezren39 merged 1 commit into
mainfrom
sweep/660-literal-root-dot
Oct 23, 2026
Merged

dezren39 merged 1 commit into
mainfrom
sweep/660-literal-root-dot

Conversation

@dezren39

@dezren39 dezren39 commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Fixes #660

Problem

PR #657 fixed #647 for percent-encoded root-dot spellings, but literal UTS-46 label-separator spellings (U+3002 。, U+FF0E ., U+FF61 。) still returned the fullwidth form from the container validator:

  • http://example.com。/ → container http://example.com。/, Worker http://example.com./
  • http://example.com。:8080/, http://user@example.com。/ same pattern
  • Interior spellings too: http://example。com/ → container verbatim, Worker http://example.com/

validate_crawl_url judges the UTS-46-mapped host (separators translated to .), but the non-percent return path returned raw verbatim, so the mapped dot never reached the returned URL. The same target was therefore recorded under two different URLs depending on spelling, defeating cross-crawler dedup/comparison — exactly the #647 harm, surviving for the literal spellings.

Solution

  • Capture has_literal_separator on the (possibly percent-decoded) host before the UTS-46 mapping translates the separators away.
  • The DNS return path now rebuilds from the mapped host when percent_decoded or has_literal_separator, exactly as it already did for percent-decoded hosts. That re-attaches the root dot (host + "." if has_root_dot) and carries interior dots in the mapped host itself.
  • Judging is unchanged: the mapped host was already the judged host. IP literals still take the canonical-address return (WHATWG serializes them without a root dot).
  • Updated the one pre-existing control that pinned the old verbatim return (münchen。de in test_refuses_mapped_spellings_of_blocked_targets) to expect münchen.de — the U-label is kept, only the separator changes (lab-ops-hub: container validator returns the raw U-label host for IDN targets — Worker returns the punycode A-label form it judged #659 covers the A-label form).

Verification

  • Reproduced on main 36a592f3: all issue spellings returned the fullwidth form; blocked spellings (localhost。, 127.0.0.1。) were already refused for the right reason.
  • Post-fix: Python 60/60, TS 40/40 (1 new test each).
  • Differential vs the real Worker validator under Bun over 396 generated spellings (6 separator spellings × 4 host templates × 8 tails × userinfo variants, plus blocked/double-separator cases) = zero diffs in verdict or returned URL.
  • Ablation: with only app.py reverted, exactly the new Python test and the updated münchen。de control fail, both with the fullwidth-form divergence.
  • ruff format clean.
  • Single-repo: git grep validate_crawl_url/validateCrawlUrl finds no copy in the opencode/openchamber/nix clones.

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 October 23, 2026 12:03
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 23, 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-10-23T12:05:37.374083Z c6e910e 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.

@coderabbitai

coderabbitai Bot commented Oct 23, 2026

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ 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: 68609ba6-afe4-4e71-b9b3-5d18b4cfad2b
📥 Commits

Reviewing files that changed from the base of the PR and between 36a592f and c6e910e.

📒 Files selected for processing: 3
  • pkgs/lab-ops-hub/container/app.py
  • pkgs/lab-ops-hub/test/lib.test.ts
  • pkgs/lab-ops-hub/test/test_container_validate.py
+-----------------------------------------------+
| I'm approving this in spirit, but not in Git. |
+-----------------------------------------------+
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • 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

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

@dezren39
dezren39 merged commit 6da9110 into main Oct 23, 2026
4 of 5 checks passed
@dezren39
dezren39 deleted the sweep/660-literal-root-dot branch October 23, 2026 12:05
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