Files
deepseek-harness/packages/util/chunked-list
Turtle e7def469e1 feat(i18n): key translation pairing records by heading section (#5036)
* feat(i18n): key translation pairing records by heading section

Replace the whole-file blob hashes in *.i18n.yaml with one entry per
heading section that still holds language-specific content, keyed by the
English heading-slug path. Blocks identical across the pair (generated
table rows, code blocks, shared regions) stay out of the hash, so edits to
different sections and identical regenerations merge with Git's default
text merge, including on GitHub.

Remove the dsh-translation-pairing merge driver, its resolver command and
installer wiring; gen-translation-brief recovers last-confirmed text from
commit history. Migrate all active records, archive the superseded Agent
Note, and record the replayed conflict reduction in the new one.

* test(i18n): refresh translation prompt snapshot for the terminology note

* feat(i18n): exclude only code blocks and generated regions from pairing records

Replace byte-equality masking with an explicit rule: a record hash skips
fenced code blocks and BEGIN/END GENERATED regions, the two kinds of
content the pairing gate already requires to be identical on both sides.

Move generated data into regions written into both pages:
gen-config-catalog renders both languages and the record with per-package
regions labelled by code identifiers; gen-module-graph keeps its table in a
region; gen-doc-graphs splices the event matrix regions into the Chinese
page. Add a generic region splice beside the region grammar.
2026-09-23 22:32:06 +08:00
..
2026-09-23 20:47:45 +08:00

description, kind
description kind
Immutable append-only lists for projection state, with bounded append copying, insertion-order iteration, and Zod checkpoint validation. package-library

@deepseek-ai/dsh-chunked-list

English | 中文

Summary

dsh-chunked-list lets callers append values while retaining earlier list versions without copying the whole collection. Callers can iterate every value in insertion order and validate JSON checkpoints with their own value schema. The subagent catalog uses it for immutable projection state.

Table of Contents


Use this package

Use this list when an append-only collection needs immutable versions and JSON-compatible storage. An empty list is undefined; appending returns a new head without modifying existing nodes. The list shares stored values by reference, so callers must treat them as immutable.

import { appendChunkedList, iterateChunkedList } from '@deepseek-ai/dsh-chunked-list'

const first = appendChunkedList(undefined, 'first')
const second = appendChunkedList(first, 'second')
console.log([...iterateChunkedList(second)])

The example produces ['first', 'second']; first still contains only its original value. chunkedListSchema(valueSchema) validates JSON checkpoints and rejects unknown fields, invalid values, and empty or oversized chunks. Use .optional() on the schema when the containing field also permits an empty list. See the source contracts for the operations.


Understand the implementation

Implementation internals — click to expand

The newest chunk stores up to 64 values. Appends copy at most that chunk and share older nodes, taking bounded O(1) work. The capacity controls storage layout, not total list length. Iteration visits all N values in O(N) time and uses O(N / 64) scratch space to visit chunks from oldest to newest. A single capacity constant governs append rollover and recursive Zod validation.

File Role
src/index.ts Persistent list operations and checkpoint validation
tests/chunked-list.spec.ts Version isolation, ordering, structural sharing, and checkpoint acceptance

No runtime invariant companion is published because this library has no independently changing observations; its operations return caller-owned immutable values.


Further Exploration


Model Experience

None, as this collection registers nothing model-facing.

KV Cache effect

Nothing here enters a model request, so provider cache reuse is unaffected.

Known Limitations and Deferred Work

  • Append-only access — callers needing removal or random access need another collection.
  • Recursive checkpoints — JSON serialization and schema validation remain subject to runtime nesting limits. Stored values must themselves support the caller's serialization format.

Dev Note

Working context for maintainers — click to expand

None.