Skip to content

fix(vscode): a more compact serializer outcome - #13758

Merged
WebReflection merged 1 commit into
mainfrom
compact-serializer
Sep 3, 2026
Merged

fix(vscode): a more compact serializer outcome#13758
WebReflection merged 1 commit into
mainfrom
compact-serializer

Conversation

@WebReflection

@WebReflection WebReflection commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

What Problem This Solves

The tuple serializer introduced in #13733 repeats full JavaScript type names and array wrappers for every scalar, making Agent Manager’s internal change-detection keys unnecessarily long.

Why This Change Was Made

Use compact numeric type IDs and id:payload string leaves while retaining the original recursive mapping, scalar conversion, negative-zero handling, and JSON escaping. This follows the compact-serializer discussion on #13733 without changing which supported, ordinary acyclic inputs produce equal keys.

User Impact

Reduce internal PR-signature and filesystem-stamp key sizes without changing update detection or requiring stored-state migration. There is no visible UI change.

Evidence

The tuple [0, -0, 0n, [1, 2, 3]] shrinks from 94 to 40 characters and UTF-8 bytes, approximately 57%. Every scalar occurrence saves 9–12 characters and bytes; arrays and holes add no new overhead, so array/hole-only inputs remain unchanged rather than becoming larger. Regression coverage checks scalar distinctions, exact bigints, signed zero/nonfinite numbers, escaped text, nesting, sparse holes, and structural equality across separate allocations.

A before/after differential run using Bun 1.3.14 compared 596 cases, including a deterministic 546-entry sparse-tuple corpus, against keys captured from the original export. Both directions preserved all 397 equality groups: 547 cases became shorter and 49 stayed byte-for-byte identical.

@kilo-code-bot

kilo-code-bot Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • .changeset/compact-vscode-serializer.md
  • packages/kilo-vscode/src/util/serialize.ts
  • packages/kilo-vscode/tests/unit/serialize.test.ts

Reviewed by grok-4.6 · Input: 126.7K · Output: 6.6K · Cached: 160.4K

Review guidance: REVIEW.md from base branch main

@WebReflection
WebReflection merged commit 22f6bd4 into main Sep 3, 2026
25 checks passed
@WebReflection
WebReflection deleted the compact-serializer branch September 3, 2026 16:30
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.

2 participants