fix: match list UTF-16 cuts and stored metadata order

Merged
UN
13d ago
+984-175

Full list output must preserve JavaScript UTF-16 truncation semantics and stored extra-metadata key order, while history remains canonically sorted. The remote update already merged main; this change pulls that merge without rebasing reviewed commits and repairs its 2026.10.9 integration.

All three native Rust jobs and all three release-gate jobs in run 38113052284 failed during output_parity_differential fixture initialization: a hard-coded 2026.10.7 assertion rejected the installed 2026.10.9 oracle before either parity comparison ran. The assertion now reads COMPATIBLE_PM_VERSION. No new merge conflicts remain. Lossless UTF-16 escaping, insertion-order full-list projection and canonical history sorting remain intact, as does main’s TOON 0.6.1 quoting corpus. All 24 extra-key permutations now alternate numeric-looking titles 05 and 0.

Behavioral revert proof, with tests and the locked oracle unchanged: removing only high-surrogate escape capture compiled and failed the generated UTF-16 test at byte 327014; restoring lexical sorting only in the full-list projection compiled and failed the generated metadata-order test at byte 280. Both exited 101 and production files were restored byte-for-byte. An initial historical map-type revert failed to compile and is excluded from proof evidence. Positive output differentials passed 2/2, covering 968 astral placements and all 24 key permutations.

Local validation at 0190a6b24f0a8a8b62625b45926b1ea9539a6d96: both PM-linked ordinary-HOME and disposable-HOME just release-check aggregates passed on Node 26.7.0, Rust 1.90.0 and nightly-2026-08-06. Each passed 212 ordinary and 212 instrumented tests, with zero failures or ignored tests. Fresh production-source coverage agrees at 3165/3165 lines, 286/286 functions, 4739/4739 regions and 610/610 branches, all 100% across the unchanged ten executable source files. Formatting, strict Clippy, private-item rustdoc, Cargo audit, changelog regeneration and pinned verification passed. The metadata item's own PM-linked regression passed 1/1. Source/test/manifest/gate-input hashes match both receipts. This native Rust repo has no root npm/Bun release script; just release-check is its CI aggregate. Detailed evidence: docs/OUTPUT_PARITY_2026_10_7.md.

Owner items:

Both items remain in progress and their claims are released. The PR remains open for review; local execution and native cross-platform CI are separate receipts.

Post-commit verification: identity audit passed 7/7; strict PM health with merge drivers passed under a disposable HOME matching CI; touched item history chains verify and match the current item hashes. The ordinary host health check reports an external installed pm-github extension version skew (host 2026.10.11 versus this pinned 2026.10.9 oracle); no host extension configuration was changed.

Exact pushed-head CI at 0190a6b24f0a8a8b62625b45926b1ea9539a6d96: all three native Rust jobs, all three release-gate aggregates (Ubuntu, macOS and Windows) and CodeQL passed, 7/7 required checks. CI run: https://github.com/unbraind/pm-rust/actions/runs/38122791705; CodeQL run: https://github.com/unbraind/pm-rust/actions/runs/38122791715. Substantive review and full-history privacy assurance remain separate open gates; the PR remains open and auto-merge is disabled.

Summary by Sourcery

Restore list-output parity with the published CLI for UTF-16 truncation, metadata ordering, and the current compatibility oracle.

New Features:

  • Preserve JavaScript-compatible UTF-16 truncation in serialized list output, including escaped split surrogate pairs and matching pagination fingerprints.
  • Preserve stored insertion order for unknown metadata fields in full list projections while retaining canonical ordering for history hashes and write-back.

Bug Fixes:

  • Update output parity fixture validation to use the configured compatible oracle version, restoring integration with the locked 2026.10.9 oracle.

Enhancements:

  • Expose a lossless list-output envelope that keeps wire serialization distinct from its Unicode-safe JSON value view.
  • Align list output serialization, budgeting, continuation handling, and SDK rendering with the corrected lossless output semantics.

Documentation:

  • Document the UTF-16 truncation, metadata ordering behavior, parity evidence, and updated compatibility contracts.

Tests:

  • Add generated differential coverage for 968 astral placements, all 24 metadata-key permutations, pagination continuations, and serializer failure paths.

Chores:

  • Record updated PM item history and issue metadata for the completed parity work.