Repository navigation
Description
Finding (from PR review, unaddressed)
Codex P2 on PR #3861 — Specify surrogate-pair escaping for supplementary Cf characters
For supplementary-plane Cf characters such as U+110BD and U+E0001, extending
plain_fieldto use its existing escape branch would silently corrupt the represented value. That branch inpkgs/id/src/commands/text.rsuseswrite!(rendered, "\\u{:04x}", u32::from(c)), so U+110BD becomes\u110bd, which a JSON parser reads as U+110B followed byd, rather than the original character. The shared set includes these characters, but the proposed test criteria cover only BMP examples. Explicitly require surrogate-pair escaping and supplementary-plane JSON round-trip tests rather than prescribing the existing escaped form unchanged.
- Source PR: design(id): #3455 shared Cf contract for plain output #3861 "design(id): Design: a value cannot act on the terminal — one format-character (Cf) contract for pkgs/id plain output #3455 shared Cf contract for plain output" — design(id): #3455 shared Cf contract for plain output #3861 (merged 2026-11-01T17:10:07Z; the Codex review landed after the merge)
- Comment: design(id): #3455 shared Cf contract for plain output #3861 (comment) — chatgpt-codex-connector[bot], 2026-11-01T17:11:28Z, on
doc/2026-11-01_design_id3455.md:142 - Parent design issue: Design: a value cannot act on the terminal — one format-character (Cf) contract for pkgs/id plain output #3455; Phase 1 implementation issue: id(peers): plain_field passes bidi/format controls raw — a gossip peer name with U+202E reaches the terminal unescaped and visually reorders the row's columns #2839
No-response evidence
- The review thread is unresolved (GraphQL
reviewThreads:isResolved=false) and has no replies — the inline comment is the only comment in its thread. - No fix followed: the PR merged before the comment was posted, and the design doc on current main is unchanged on this point (see below).
Still live on current main (verified 2026-11-01, origin/main 9e1be52)
doc/2026-11-01_design_id3455.md§3 step 2 still prescribes: "Inplain_field, treat Cf as a reason to use the existing quoted/escaped representation" — with no mention of surrogate pairs or supplementary-plane characters anywhere in the document (grep for surrogate/supplementary/U+110BD/U+E0001: no hits). Its §4 acceptance tests cover only BMP examples (bidi overrides/isolates including U+202E, zero-width/join controls).pkgs/id/src/commands/text.rs:83still has the escape branch the comment flags:let _ = write!(rendered, "\\u{:04x}", u32::from(c));— a\uescape followed by 5–6 hex digits for any character above U+FFFF, which a JSON parser reads as the first four hex digits' code point plus literal trailing characters.- The shared Cf set the design adopts (
is_format_char,pkgs/id/crates/id-core/src/petname.rs) explicitly includes supplementary-plane Cf: U+110BD, U+110CD, U+13430–U+1343F, U+1BCA0–U+1BCA3, U+1D173–U+1D182, U+E0001, U+E0020–U+E007F. So a Phase 1 implementation (id(peers): plain_field passes bidi/format controls raw — a gossip peer name with U+202E reaches the terminal unescaped and visually reorders the row's columns #2839) that follows the design literally will silently corrupt exactly those characters in quoted output — the value the design promises "remains represented" would not round-trip.
Dedupe (2026-11-01): searches for surrogate / supplementary / plain_field / 110BD / "Cf contract" across open and closed issues found no issue covering surrogate-pair escaping. #2839's acceptance criteria cover BMP Cf only (U+202A–U+202E, U+2066–U+2069, U+200E/U+200F, U+200B, U+FEFF); #3455 is the parent design this issue refines.
Acceptance criteria
- The Design: a value cannot act on the terminal — one format-character (Cf) contract for pkgs/id plain output #3455 design contract (doc and/or id(peers): plain_field passes bidi/format controls raw — a gossip peer name with U+202E reaches the terminal unescaped and visually reorders the row's columns #2839's scope) explicitly requires supplementary-plane Cf characters to be escaped as JSON surrogate pairs (
\uXXXX\uXXXX) — or another form that provably round-trips — rather than the existing\u{:04x}form unchanged. - JSON round-trip tests cover at least one supplementary-plane Cf character (e.g. U+110BD or U+E0001): the escaped
plain_fieldoutput parses back as JSON to the original character. - Or: this is resolved by a documented decision on this issue explaining why supplementary-plane Cf cannot reach the escaped path.
Activity
dezren39 commentedon Nov 1, 2026
🤖 Agent note · filed
dezren39 commentedon Nov 1, 2026
🤖 Agent note · picked up
18 remaining items
dezren39 commentedon Nov 4, 2026
🤖 Agent note · handed off
dezren39 commentedon Nov 4, 2026
🤖 Agent note · picked up
dezren39 commentedon Nov 4, 2026
agent-note:v1
state: triaged
task: 8324
lane: openchamber-scheduled-lane (1a180ae5-384f-4e71-8d77-08f7b1652c75)
fresh evidence: revalidated issue #4012 OPEN; fetched laptop origin/main at f486f2a.
pkgs/id/src/commands/text.rs::push_unicode_escapeemits supplementary scalars as UTF-16 surrogate pairs.every_shared_format_character_is_json_escapediterates the complete shared Cf set and assertsserde_jsonround-trips every value to the original.verification:
cargo test --manifest-path pkgs/id/Cargo.toml --lib every_shared_format_character_is_json_escaped— 1 passed, 0 failed.verdict: already handled by merged PR #4264; its Phase 1 issue #2839 is closed. The surrogate-pair behavior and exhaustive JSON round-trip regression satisfy #4012; no follow-up task or duplicate PR is needed. Closing #4012 as completed.
links: #4264 · #2839 · #3455
dezren39 commentedon Nov 4, 2026
agent-note:v1
state: done
task: 8324
lane: openchamber-scheduled-lane (1a180ae5-384f-4e71-8d77-08f7b1652c75)
outcome: closed #4012 as completed/already handled. PR #4264 is merged; current main uses surrogate-pair escapes and the focused all-Cf JSON round-trip test passes. No code changes or follow-up task were needed. Queue task 8324 is now being completed with this evidence.
links: #4012 · #4264