Skip to content

Let actor storage own both KV surfaces - #26

Merged
MiguelsPizza merged 1 commit into
mainfrom
alex/maintainable-typescript-cleanup
Aug 23, 2026
Merged

Let actor storage own both KV surfaces#26
MiguelsPizza merged 1 commit into
mainfrom
alex/maintainable-typescript-cleanup

Conversation

@MiguelsPizza

Copy link
Copy Markdown
Contributor

Why

The synchronous and asynchronous Durable Object storage views share one SQLite owner, codec, and list compiler. Splitting the sync view into a second module created an import cycle, duplicate types, and forwarding helpers with no independent responsibility.

What changed

  • Colocated SyncKvStorage with DurableObjectStorage and deleted the separate sync-kv module.
  • Removed the single-implementation owner interface, duplicate list options, pass-through codec helpers, and custom iterator machinery.
  • Kept compiler, codec, transaction, and pinned-check details private.
  • Reused native generators and centralized generic narrowing in the decoder.

Net result: 106 fewer lines and the actor-state/sync-kv import cycle is gone.

Validation

  • pnpm typecheck
  • pnpm test:unit — 27 files, 799 tests
  • fallow audit --base origin/main — pass; zero introduced dead code, complexity, duplication, or dependency cycles
  • git diff --check

Related work

  • Builds on the compile-time continuation transform in do-runtime#24.
  • Lets the Rook cutover remove more consumer-side machinery in rook#143.

Draft only; do not merge without Alex explicit approval.

The synchronous and asynchronous storage views share one SQLite owner, codec, and list compiler. Keeping the sync view in a separate module created an import cycle, duplicate types, and forwarding helpers with no independent responsibility. Colocate the implementation with DurableObjectStorage, use native iteration, and keep compiler and codec details private.
@MiguelsPizza
MiguelsPizza marked this pull request as ready for review August 23, 2026 15:11
@MiguelsPizza
MiguelsPizza merged commit e36bdc9 into main Aug 23, 2026
1 check passed
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.

1 participant