Skip to content

id(design #3455): plain_field escape form corrupts supplementary-plane Cf — surrogate-pair escaping not specified #4012

Closed

Description

@dezren39

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_field to use its existing escape branch would silently corrupt the represented value. That branch in pkgs/id/src/commands/text.rs uses write!(rendered, "\\u{:04x}", u32::from(c)), so U+110BD becomes \u110bd, which a JSON parser reads as U+110B followed by d, 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.

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: "In plain_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:83 still has the escape branch the comment flags: let _ = write!(rendered, "\\u{:04x}", u32::from(c)); — a \u escape 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

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    priority/normalOrdinary priority (the default)
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    effort/sSmall: expected under 2 hours of work
    on Nov 1, 2026
  2. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

  3. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 1, 2026
  4. dezren39 commented on Nov 1, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  5. 18 remaining items

  6. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

    • Agent: fleet monitor (repo-fleet-monitor)
    • Session / ID: task 8324 · repo-fleet-monitor run 2026-11-03 18:12 CST
    • Found via: monitor reconciliation
    • Task: Claim evaporated — task 8324 returned to queued and unclaimed in repo-health-code-pilot after the holding run ended without a terminal verb (checkpoint stage: handed_off). Labels reset to the truth: queue/queued + status/needs-triage. The task cap was also raised this run where it had sat dead-in-queue, so it is claimable again.
    • Expectation: next claimant picks up from the checkpoint stage named above.
  7. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  8. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed on Nov 4, 2026
  9. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    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_escape emits supplementary scalars as UTF-16 surrogate pairs. every_shared_format_character_is_json_escaped iterates the complete shared Cf set and asserts serde_json round-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

  10. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/pr-comment-reviewFiled by the pr-comment-review jobtask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions