refactor(storage): rename dsh-domain to dsh-storage-domain

The bare 'domain' name was too generic for a published package. The
directory moves to packages/storage/storage-domain, the package becomes
@deepseek-ai/dsh-storage-domain, and the plugin/invariant names follow;
the ctx surface (ctx.storage.domain), the domain/changed event, and all
runtime behavior are unchanged. References, catalogs, graphs, and the
bilingual design note move together.
This commit is contained in:
imccyu
2026-07-25 01:11:39 +08:00
parent 71923d7213
commit f5506cf35f
34 changed files with 86 additions and 86 deletions
@@ -1,4 +1,4 @@
# @deepseek-ai/dsh-domain
# @deepseek-ai/dsh-storage-domain
Domain data form for the DeepSeek Harness storage hub: mounts `ctx.storage.domain`, opening schema-validated KV domains over configured storage backends. A domain is declared once with `defineDomain` (zod record schemas, `z.infer`-derived types), opened through `DomainFacility.open`, and served from authoritative in-memory state — reads are synchronous, writes serialize on one per-domain chain, reach durability on the routed backend first, then update memory and emit `domain/changed`. The opening consumer owns the handle's lifecycle and releases it with `Domain.close()` (idempotent; typically its own `ctx.effect` disposer); domains still open when the plugin unmounts are closed by the facility.
@@ -1,5 +1,5 @@
{
"name": "@deepseek-ai/dsh-domain",
"name": "@deepseek-ai/dsh-storage-domain",
"description": "Domain data form (ctx.storage.domain): schema-validated, event-emitting KV domains over storage backends for the DeepSeek Harness",
"version": "0.0.1",
"private": true,
@@ -6,7 +6,7 @@
* backend write leaves memory untouched (no divergence between reads and the
* medium), and events carry values that equal the in-memory state at
* emission, in write order.
* @module @deepseek-ai/dsh-domain/src/domain
* @module @deepseek-ai/dsh-storage-domain/src/domain
*/
import type { Context } from 'cordis'
@@ -1,6 +1,6 @@
/**
* Error vocabulary of the domain data form.
* @module @deepseek-ai/dsh-domain/src/error
* @module @deepseek-ai/dsh-storage-domain/src/error
*/
/** Discriminant codes carried by every {@link DomainError}. */
@@ -4,7 +4,7 @@
* and an operation discriminant never the old value (a diffing consumer
* keeps its own previous snapshot). This is the event source for cross-process
* change push (RPC frames) in a later phase.
* @module @deepseek-ai/dsh-domain/src/events
* @module @deepseek-ai/dsh-storage-domain/src/events
*/
/** Shared location fields of one durable domain change. */
@@ -4,7 +4,7 @@
* layer consumers depend on this package and never touch backends directly.
* Plugin `Config` is schemastery; record schemas inside domain specs are zod
* (see `src/spec.ts` for the split rationale).
* @module @deepseek-ai/dsh-domain
* @module @deepseek-ai/dsh-storage-domain
*/
import type { Context } from 'cordis'
@@ -32,7 +32,7 @@ declare module '@deepseek-ai/dsh-storage' {
}
/** Cordis plugin name. */
export const name = 'domain'
export const name = 'storage-domain'
/** The storage hub must be present before the form can mount. */
export const inject = ['storage']
@@ -1,22 +1,22 @@
/**
* Package-owned invariant companion for `@deepseek-ai/dsh-domain`: every
* Package-owned invariant companion for `@deepseek-ai/dsh-storage-domain`: every
* `domain/changed` event must agree with the emitting domain's authoritative
* in-memory state (the owned event-stream mutable-data relationship of this
* package). Writes emit strictly after mutating memory and the write chain
* serializes them, so at emission time the event's snapshot equals the
* current read any divergence means a write path skipped the chain or
* emitted a stale value.
* @module @deepseek-ai/dsh-domain/invariant
* @module @deepseek-ai/dsh-storage-domain/invariant
*/
import type { Context } from 'cordis'
import type { InvariantFailure, InvariantInstaller } from '@deepseek-ai/dsh-invariants'
import type { DomainChanged } from './events.ts'
const PACKAGE_NAME = '@deepseek-ai/dsh-domain'
const PACKAGE_NAME = '@deepseek-ai/dsh-storage-domain'
/** Cordis companion plugin name. */
export const name = 'domain-invariant'
export const name = 'storage-domain-invariant'
/** Service required before the companion can reserve package ownership. */
export const inject = ['invariants']
@@ -5,7 +5,7 @@
* (validation, descriptor projection) derive from it. Record schemas are zod
* (`z.infer` keeps types un-duplicated and the same schemas later project to
* RPC wire schemas); plugin `Config` stays schemastery.
* @module @deepseek-ai/dsh-domain/src/spec
* @module @deepseek-ai/dsh-storage-domain/src/spec
*/
import type { ZodType } from 'zod'
@@ -3,7 +3,7 @@ import { Context } from 'cordis'
import { z } from 'zod'
import Storage from '@deepseek-ai/dsh-storage'
import InvariantService, { InvariantError } from '@deepseek-ai/dsh-invariants'
import * as DomainInvariantCompanion from '@deepseek-ai/dsh-domain/invariant'
import * as DomainInvariantCompanion from '@deepseek-ai/dsh-storage-domain/invariant'
import { DomainFacility, defineDomain, domainTable } from '../src/index.ts'
import type { DomainChanged } from '../src/events.ts'
import { MemoryStorageBackend } from './helpers/memory-backend.ts'
@@ -31,7 +31,7 @@ async function setup() {
const invariantViolation: unknown = expect.objectContaining<Partial<InvariantError>>({
code: 'INVARIANT',
packageName: '@deepseek-ai/dsh-domain',
packageName: '@deepseek-ai/dsh-storage-domain',
})
describe('domain change-event invariants', () => {
+1 -1
View File
@@ -15,7 +15,7 @@ Storage hub (`ctx.storage`) for non-session data: a named backend registry plus
| `dsh-storage` | The hub service + backend vocabulary + shared conformance suite |
| `dsh-storage-json` | JSON backend: one unit per human-readable file, atomic whole-file rewrite |
| `dsh-storage-sqlite` | SQLite backend: one database hosting all routed units, document-per-row |
| `dsh-domain` | Domain data form (`ctx.storage.domain`): typed schemas, write chain, change events |
| `dsh-storage-domain` | Domain data form (`ctx.storage.domain`): typed schemas, write chain, change events |
## Model Experience