Files
deepseek-harness/packages/storage
imccyu 507dd25a3a fix(storage,workspace): review-bot findings — emit isolation, domain ownership, null globals
- domain/changed emission is isolated from the write path: an observer
  throwing synchronously can no longer turn a committed (durable +
  in-memory) write into a rejection; the failure is logged and later
  writes proceed.
- Domain lifecycle belongs to the opening consumer: Domain gains an
  idempotent close() (drain, unit close, reservation release), the
  facility stops registering effects on its own context and instead
  closes any still-open domains on unmount; WorkspaceRegistry holds its
  domain through its own effect, so disposing and re-mounting the
  consumer no longer wedges on already-open.
- defineDomain rejects a global schema accepting null at declaration
  time: JSON null is the medium's absence sentinel, so a nullable global
  could never round-trip; failing loud at the spec keeps set(null)
  unrepresentable.

Regression tests cover all three (hostile listener, close/reopen and
consumer re-mount, nullable-global rejection).
2026-07-25 11:08:04 +08:00
..

storage/ — non-session storage family

The storage family persists everything that is not a session event log: a hub where named backends and typed data forms meet. Design record: domain KV storage Agent Note.

Package Role ctx key
storage/ The hub: named backend registry + merge-extensible data-form mounts, backend facet vocabulary, shared conformance suite ctx.storage
storage-json/ JSON backend: one human-readable file per unit, atomic whole-file rewrite registers backend json
storage-sqlite/ SQLite backend: one database hosting all routed units, document-per-row registers backend sqlite
domain/ Domain data form: zod-validated records, per-domain write chain, domain/changed events, backend routing by configuration mounts ctx.storage.domain

Backends own one medium each and expose data-shape facets (kv today; an append-log facet is reserved for the future session-backend migration). Consumers never touch backends directly — they open declared domains through the domain form.