Skip to content

[P3][lens] Handle lone UTF-16 surrogate string keys in kv/doc ids #35

Description

@cevheri

Summary

String keys containing lone UTF-16 surrogates encode to UTF-8 replacement or collide after utf8.encode in kv/doc id paths — distinct strings can map to same bytes.

Audit ID: Section 4 Low — Wave 3
Location: src/lens/kv.ts:62 and shared utf8 helpers

Options

  1. Reject invalid Unicode in string keys/ids at API boundary (throw).
  2. Document that keys must be valid UTF-8 strings; surrogate pairs only.

Acceptance criteria

  • Documented or rejected with test vectors.
  • Changeset if throwing new errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/lensesPre-announcement auditbugSomething isn't workingpriority/lowPre-announcement audit

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions