docs: make technical prose concrete

This commit is contained in:
Turtle
2026-08-09 15:27:21 +08:00
parent 673e7cddc5
commit a27efdef36
459 changed files with 1342 additions and 1329 deletions
+1 -1
View File
@@ -65,7 +65,7 @@ export function domainTable<K extends string, V>(schema: ZodType<V>): DomainTabl
}
/**
* Identity helper that pins a spec's literal types and validates its shape.
* Identity helper that pins a spec's literal types and validates its fields.
* Misconfiguration fails loud at the owning package's module load, before any
* medium is touched: a domain or table name outside `UNIT_NAME_RE`, a version
* that is not a non-negative integer, or a global schema that accepts `null`
+6 -6
View File
@@ -1,21 +1,21 @@
/**
* Backend-facing vocabulary of the storage hub: a backend owns one medium
* (a file-tree root, a database file) and exposes data-shape facets over it.
* This module is the normative contract text for backend implementers; the
* shared conformance suite in `tests/contract.ts` asserts every clause.
* (a file-tree root, a database file) and exposes operation groups over it.
* This module defines the normative contract text for backend implementers; the shared
* conformance suite in `tests/contract.ts` checks every rule.
* @module @deepseek-ai/dsh-storage/src/backend
*/
/** Allowed shape for unit and table names: safe as a file name and as a SQL identifier segment without escaping. */
/** Allowed format for unit and table names: safe as a file name and as a SQL identifier segment without escaping. */
export const UNIT_NAME_RE = /^[a-z][a-z0-9_]*$/
/**
* One registered backend. A backend owns exactly one medium and shares its
* lifecycle across all facets; facets are optional members — a backend that
* cannot serve a shape simply omits it, and resolution fails loud instead.
* cannot serve a data kind simply omits it, and resolution fails loud instead.
*/
export interface StorageBackend {
/** Key-value data shape; absent when this backend cannot serve it. */
/** Key-value operations; absent when this backend cannot serve them. */
readonly kv?: KvFacet
/**