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

View File

@@ -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.

View File

@@ -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,

View File

@@ -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'

View File

@@ -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}. */

View File

@@ -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. */

View File

@@ -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']

View File

@@ -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']

View File

@@ -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'

View File

@@ -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', () => {

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

View File

@@ -28,7 +28,7 @@
"license": "BSD-3-Clause",
"peerDependencies": {
"@deepseek-ai/dsh-brand": "^0.0.1",
"@deepseek-ai/dsh-domain": "^0.0.1",
"@deepseek-ai/dsh-storage-domain": "^0.0.1",
"@deepseek-ai/dsh-invariants": "^0.0.1",
"@deepseek-ai/dsh-session": "^0.0.1",
"@deepseek-ai/dsh-session-persistence": "^0.0.1",
@@ -40,7 +40,7 @@
},
"devDependencies": {
"@deepseek-ai/dsh-brand": "workspace:^",
"@deepseek-ai/dsh-domain": "workspace:^",
"@deepseek-ai/dsh-storage-domain": "workspace:^",
"@deepseek-ai/dsh-invariants": "workspace:^",
"@deepseek-ai/dsh-session": "workspace:^",
"@deepseek-ai/dsh-session-persistence": "workspace:^",

View File

@@ -10,7 +10,7 @@
import { stat } from 'node:fs/promises'
import type { SessionHeader, SessionId } from '@deepseek-ai/dsh-session'
import type { KvTable } from '@deepseek-ai/dsh-domain'
import type { KvTable } from '@deepseek-ai/dsh-storage-domain'
import type { WorkspaceRecord } from './spec.ts'
import type { Workspace, WorkspaceId } from './types.ts'
import { realpathNormalize } from './paths.ts'

View File

@@ -14,7 +14,7 @@ import type { SessionHeader, SessionId } from '@deepseek-ai/dsh-session'
// Type-only: merges `sessionPersistence` into the Context service map for the
// optional `ctx.get` lookups below.
import type {} from '@deepseek-ai/dsh-session-persistence'
import type { KvTable } from '@deepseek-ai/dsh-domain'
import type { KvTable } from '@deepseek-ai/dsh-storage-domain'
import { workspaceDomainSpec } from './spec.ts'
import type { WorkspaceRecord } from './spec.ts'
import { WorkspaceEntity } from './entity.ts'

View File

@@ -5,7 +5,7 @@
import type { Context } from 'cordis'
import type { InvariantInstaller } from '@deepseek-ai/dsh-invariants'
import type { DomainChanged } from '@deepseek-ai/dsh-domain'
import type { DomainChanged } from '@deepseek-ai/dsh-storage-domain'
import { WorkspaceId } from '@deepseek-ai/dsh-workspace'
const PACKAGE_NAME = '@deepseek-ai/dsh-workspace'

View File

@@ -7,7 +7,7 @@
import { z } from 'zod'
import { SessionId } from '@deepseek-ai/dsh-session'
import { defineDomain, domainTable } from '@deepseek-ai/dsh-domain'
import { defineDomain, domainTable } from '@deepseek-ai/dsh-storage-domain'
import type { WorkspaceId } from './types.ts'
/**

View File

@@ -1,7 +1,7 @@
import { describe, expect, it } from 'vitest'
import { Context } from 'cordis'
import InvariantService from '@deepseek-ai/dsh-invariants'
import type { DomainChanged } from '@deepseek-ai/dsh-domain'
import type { DomainChanged } from '@deepseek-ai/dsh-storage-domain'
import * as WorkspaceInvariant from '../src/invariant.ts'
import { WorkspaceId } from '../src/index.ts'

View File

@@ -5,11 +5,11 @@ import { basename, join } from 'node:path'
import { Context } from 'cordis'
import Storage from '@deepseek-ai/dsh-storage'
import type { StorageBackend } from '@deepseek-ai/dsh-storage'
import { DomainFacility } from '@deepseek-ai/dsh-domain'
import type { DomainChanged } from '@deepseek-ai/dsh-domain'
import { DomainFacility } from '@deepseek-ai/dsh-storage-domain'
import type { DomainChanged } from '@deepseek-ai/dsh-storage-domain'
import { SessionId } from '@deepseek-ai/dsh-session'
import type { SessionHeader } from '@deepseek-ai/dsh-session'
import { MemoryMediaPool, MemoryStorageBackend } from '../../../storage/domain/tests/helpers/memory-backend.ts'
import { MemoryMediaPool, MemoryStorageBackend } from '../../../storage/storage-domain/tests/helpers/memory-backend.ts'
import WorkspaceRegistry, { WorkspaceId } from '../src/index.ts'
import type { WorkspaceRecord } from '../src/index.ts'

View File

@@ -21,7 +21,7 @@
"path": "../../storage/storage"
},
{
"path": "../../storage/domain"
"path": "../../storage/storage-domain"
},
{
"path": "../../core/session"