refactor: centralize NUL-delimited composite keys - #13532
Merged
Conversation
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (15 files)
Reviewed by grok-4.6 · Input: 496.2K · Output: 14.2K · Cached: 91K Review guidance: REVIEW.md from base branch |
marius-kilocode
enabled auto-merge
August 28, 2026 07:52
WebReflection
approved these changes
Aug 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
NUL-delimited cache and routing keys are built repeatedly across the CLI and VS Code extension. Replacing those expressions independently can change empty fields, nullish coercion, or project/session prefix boundaries and make existing entries unreachable.
Why This Change Was Made
Add a dependency-free
zeroID(...parts)helper in core's Kilo-owned source tree, using its existing subpath export and existing consumer dependencies. Preserve domain helpers and their normalization rules while sharing the delimiter construction for local diff caches, project routing, diff state, explicit-abort scopes, and indexing worker/warning identities.The helper accepts only strings, numbers, and booleans. Callers must keep nullish fallback or string conversion explicit because
Array.joinand template literals do not coerce null and undefined identically. Short-key fast paths avoid the measured cost of a blanketjoinreplacement.Add one code-preference bullet for
Promise.withResolvers<T>()where the runtime and types support it, while retaining callback/event executors and discouraging async executors and redundant Promise wrapping.User Impact
No intended behavior or key-format change. Empty fields, numeric/boolean values, Unicode, embedded delimiters, and namespace boundaries retain their existing bytes. Git output parsing, binary formats, persistent hash inputs, and non-NUL key formats are unchanged. No runtime requirement or package dependency is added.
Evidence
Remaining candidates such as shared ACP/snapshot keys and three-part Bun callers are outside this focused refactor.