CultLib/packages/cultcache-ts/CHANGELOG.md
Meta Vens f2b3569822 Merge main at cultlib-unity-v2.0.0 (42dce361) into C2a: one owner per collision
Identity: C2a's StoredSchemaId/StoredVersion owns; main's PersistedSchemaId, PersistedIdentity and both MarkWritten are deleted. Stamp rule: ReadStore judges the stamp before the body. Flush over damage refuses (merge-r1-precedence). Mesh single-file writes route through SingleFileMessagePackBackingStore. TS: store-file.ts commits, C2a's header handling kept. Rust: C2a's readable_store_format in front of the grown decoder. Build not yet verified at this commit.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-22 20:35:33 +02:00

2.5 KiB

Changelog

All notable changes to @gamecult/cultcache-ts are recorded here, following Keep a Changelog.

Unreleased

Breaking

  • A single-file store refuses a zero-byte file as StoreUnreadableError; only a path with nothing at it is an empty store. A header this runtime does not read is refused, and the refusal echoes the header only as cultcache.store.v<digits>.
  • A dangling symbolic link at the store path is an I/O error with code ENOENT, not an empty store.

Added

  • readSingleFileStore(path), the one synchronous reader of a single-file store, for consumers that must read a store file rather than decode it themselves. pullAll, push, delete and pushAll ask the same reader.
  • StoreUnreadableError for a store file this runtime cannot read, SchemaConflictError for a write the catalog cannot describe, and schemaIdentityOf.
  • A soft pushAll writes only where nothing is at the path, leaves a store it can read byte for byte, and refuses what the reader refuses.

[0.14.2]

Added

  • SingleFileMessagePackBackingStore takes a cross-process write lock on <file>.lock, interoperable with the C# and Rust runtimes (flock on Unix, LockFileEx on Windows). push and delete read the current file, merge and replace it under the lock, so concurrent TypeScript and Rust writers no longer lose each other's records across those calls. A full pushAll still replaces the whole store, so records a concurrent writer added are lost to it. C# writes are not all alike: a conditional commit on a clean store lands onto the file as it is, but C# writers can still overwrite records a concurrent TypeScript writer added.
  • The staged file is fsynced before the replace, and on Unix the directory after it. A directory sync failure after the replace is reported as replaced but not durable.

Changed

  • The Windows replace is a POSIX-semantics rename first (it lands while C# and Rust readers hold the store open), falling back to a write-through MoveFileExW, with 25 attempts 20 ms apart on errors 5, 32 and 33. Writers wait up to 30 s for the lock.
  • Opening a legacy store that needs healing rewrites it under the lock, from a read taken under the lock.

Dependencies

  • koffi 3.3.0, loaded only on the first write.

[0.14.1]

Added

  • checkPayloadDepth is re-exported from @gamecult/cultcache-ts/document, so dependents (cultnet-ts/content) bound payload nesting with the same check the cache applies on decode.