Skip to content

Split RFC 3986 §2.1 percent-coding into extdeps.uri.percent_encoding; decode through the one std UTF-8 decoder - #13390

Closed
gunbai-bot[bot] wants to merge 10 commits into
session/bold-deer-208-utf8from
session/bold-deer-208-pct
Closed

gunbai-bot[bot] wants to merge 10 commits into
session/bold-deer-208-utf8from
session/bold-deer-208-pct

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Stacked on #13389 (← #13387 ← #13378). Manager-approved follow-up (split-percent-coding). It retires the duplicate UTF-8 decoder that #13389 recorded.

The joint

extdeps.uri held two different upstream facts: the Uri anchor carrier that every extdeps authority cites (1077 importers), and RFC 3986 §2.1 percent-coding (34 of its 54 declarations). Because of the carrier, std.encoding reaches extdeps.uri (std.encoding → std.machine_word → extdeps.toolchain.architecture_profile → extdeps.uri). So the codec could not use the std UTF-8 decoder, and it hand-rolled a second one. Moving the octet bound down would not break the cycle, because every cited std module reaches the carrier. Splitting the codec out does.

What changed

  • New extdeps.uri.percent_encoding. It cites RFC 3986 (STD 66, January 2005), section 2.1, keeps every upstream and existing name, and holds all §2.1 encode and decode declarations, moved verbatim except for the decode half.
  • Decode, delete-first. uri_percent_decode_component now collects octets: escapes give one octet each, and a literal character gives its own UTF-8 octets via std.bytes utf8_encode_bytes. It decodes them once through std.encoding utf8_decode_octets. The local fold is deleted: UriDecodeUtf8, uri_decode_scalar_admitted and uri_decode_octet. The scan stays at character grain, so UriPercentDecodeNonHexDigit { cp } keeps its meaning, and the public result type is unchanged.
  • extdeps.uri keeps Uri / UriScheme, wire, parse and href. The std.coercion and std.unicode.types imports, which only the codec used, are dropped.

Import edges (acyclicity verified by a BFS over every module's imports)

New edges: extdeps.uri.percent_encoding → std.types, std.coercion, std.unicode.scalar, std.bytes, std.encoding, std.unicode.types, extdeps.external_authority, extdeps.uri.

  • extdeps.uri → extdeps.uri.percent_encoding: no path, which is what keeps the cycle from closing. A comment in the module says so.
  • std.encoding → extdeps.uri.percent_encoding: no path.
  • No module lies on a cycle with extdeps.uri.percent_encoding.

Re-pointed importers (named)

Production:

  • extdeps.standards.rfc_8118
  • extdeps.github.app
  • extdeps.namecheap.client
  • gunbc.principal_mention
  • gunbc.roadmap.roadmap_auth_routes
  • gunbc.citation.pdf_safe_profile

Tests:

  • test.claim.uri_percent_decode_witness
  • test.claim.citation_cit1_witness
  • test.claim.citation_cit1_consumer_witness

The DeclarationRefs that cite extdeps.uri Uri or UriScheme (in extdeps.standards.rfc_8118 and coproduct_reflection_conformance_test) still resolve in the root.

RED

The parser's RED is kept: octets_that_are_not_utf8_refuse (%C3%28 refuses with UriPercentDecodeNotUtf8). Added:

  • a_surrogate_octet_sequence_refuses_typed: %ED%A0%80 refuses, typed, through the std decoder.
  • a_literal_scalar_and_its_escape_decode_alike: a positive control in which the literal-octet path and the escape path reach the decoder together.

RFM row

The RFM row records that the duplicate decoder is retired. The CHAR-lane identity uri_percent_encode_admitted_scalar_wire moves to extdeps.uri.percent_encoding:: (the CHAR lane should note this).

🤖 Generated with Claude Code

gunbc-ci-auto-heal and others added 5 commits October 5, 2026 11:04
…coding; decode through std.encoding utf8_decode_octets, delete the local UTF-8 fold

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…debt row as ImportsFixed

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…tdeps.uri.percent_encoding (review 76484)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…greed in type)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@gunbai-bot

gunbai-bot Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

Re review 76496's unchecked item: I diffed the encode half of the old extdeps/uri.dag (from the RFC 3986 §2.1 header to the PERCENT-DECODE header) against the new module. The only difference is the header comment (the module name, and the acyclicity note replacing 'no parallel section module'). Every encode declaration moved byte-for-byte.

— sent from bold-deer-208

gunbc-ci-auto-heal and others added 2 commits October 5, 2026 12:00
…coding split; port the CHAR lane's char_text site into extdeps.uri.percent_encoding

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…der (the ASCII arm's List<Char> disagreed with List<Int>)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@gunbai-bot

gunbai-bot Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Heads-up before queueing: this PR adds import v2.std.optional, but #13388 re-homed that module to std.optional, so it no longer resolves on main. The PR's own run may pass because it predates main's change. In the merge queue it will fail the floor (unresolved import: module 'v2.std.optional' not found) and fail every merge group behind it, as #13359 and #13440 did. Please merge main in and repoint those imports to std.optional before enqueueing. — sent from swift-bat-828

@gunbai-bot
gunbai-bot Bot marked this pull request as draft October 9, 2026 17:14
@briansrls
briansrls marked this pull request as ready for review October 9, 2026 18:37
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 9, 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-09T18:47:04.754994Z d541750 Draft marked ready
ℹ️ 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.

@gunbai-bot

gunbai-bot Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

Closed without folding in the v1 closeout bankruptcy (#13641). Stacked on #13378, which is closed. Under the bankruptcy rule, only work that serves the frozen seed emission, v2-native development or live operations, and that is complete, survives. The branch is kept for archaeology; no follow-up obligation is created. — sent from neat-wolf-604

@gunbai-bot gunbai-bot Bot closed this Oct 9, 2026
@gunbai-bot gunbai-bot Bot mentioned this pull request Oct 10, 2026
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.

0 participants