docs: translate remaining READMEs

This commit is contained in:
Tianyi Cui
2026-07-26 05:03:53 +08:00
parent 37bfac749b
commit 226dc7a249
559 changed files with 11227 additions and 1 deletions

View File

@@ -0,0 +1,6 @@
# Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write
README.md: c9eca7355fd63e1023e9723486c86673e4c3574b
README.zh.md: 4e848f16ea670eb4832a45eb7b7d28be3cb2da90

View File

@@ -1,5 +1,7 @@
# storage/ — non-session storage family
English | [中文](README.zh.md)
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](../../.agents/notes/proposed/architecture/2026-07-24-domain-kv-storage-and-workspace.zh.md).
| Package | Role | ctx key |

View File

@@ -0,0 +1,14 @@
# storage/:非会话存储家族
[English](README.md) | 中文
存储家族持久化会话事件日志之外的一切数据:命名后端与类型化数据形式在一个中心相接。设计记录:[领域 KV 存储 Agent Note](../../.agents/notes/proposed/architecture/2026-07-24-domain-kv-storage-and-workspace.zh.md)。
| 包 | 职责 | ctx key |
|---|---|---|
| `storage/` | 中心:命名后端注册表 + 可合并扩展的数据形式挂载、后端 facet 词汇、共享一致性测试套件 | `ctx.storage` |
| `storage-json/` | JSON 后端:每个单元一个人类可读文件,以原子方式重写整个文件 | 注册后端 `json` |
| `storage-sqlite/` | SQLite 后端:一个数据库承载所有已路由单元,每行一个文档 | 注册后端 `sqlite` |
| `domain/` | 领域数据形式:经 zod 验证的记录、逐领域写入链、`domain/changed` 事件、按配置路由后端 | `ctx.storageDomain` + `ctx.storage.domain` |
每个后端拥有一种介质,并公开数据形状 **facet**(目前为 `kv`;为未来的会话后端迁移预留 append-log facet。每个后端插件都会在注册后发布内部生命周期服务领域插件在公开自身服务前注入每个已配置的后端 key因此配置树中的行序不携带启动语义。消费方绝不直接接触后端而是注入 `storageDomain` 并通过它打开已声明的领域。

View File

@@ -0,0 +1,6 @@
# Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write
README.md: 41e777c3d9a870530593a414839f905514a27134
README.zh.md: cbef75e4ec445afae0a218259fe717fef6e23ae2

View File

@@ -1,5 +1,7 @@
# @deepseek-ai/dsh-storage-domain
English | [中文](README.zh.md)
Domain data form for the DeepSeek Harness storage hub: exposes the injectable `ctx.storageDomain` service and the matching `ctx.storage.domain` projection after every configured backend is registered. 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.
Design rationale, open semantics, and the storage/domain layer split live in the [Agent Note](../../../.agents/notes/proposed/architecture/2026-07-24-domain-kv-storage-and-workspace.zh.md).

View File

@@ -0,0 +1,35 @@
# @deepseek-ai/dsh-storage-domain
[English](README.md) | 中文
DeepSeek Harness 存储中心的领域数据形式:在每个已配置后端注册后,公开可注入的 `ctx.storageDomain` 服务及对应的 `ctx.storage.domain` 投影。一个领域通过 `defineDomain`zod 记录 schema、从 `z.infer` 派生的类型)声明一次,通过 `DomainFacility.open` 打开,并由具有最终决定权的内存状态提供服务:读取同步执行;写入在一条逐领域链上串行化,先在已路由后端达到持久状态,再更新内存并发出 `domain/changed`。打开消费方拥有 handle 的生命周期,并通过 `Domain.close()` 释放它(幂等;通常作为其自身的 `ctx.effect` disposer插件卸载时facility 会关闭仍处于打开状态的领域。
设计原理、打开语义和存储/领域分层见 [Agent Note](../../../.agents/notes/proposed/architecture/2026-07-24-domain-kv-storage-and-workspace.zh.md)。
## 配置
| key | 含义 |
| --- | --- |
| `backend` | 每个领域的默认后端名称(必填;不存在普遍正确的介质)。 |
| `routes` | 逐领域覆盖:领域名称 → 后端名称。 |
## 模型体验
### 持久领域状态
#### 模型看到的内容
无。该包不注册工具、不注入提示词,也不追加会话事件;它在 `ctx.storageDomain` 后面存储非会话数据Workspace 记录、未来的会话伴随元数据),只发出进程内 `domain/changed` 事件。只有消费方包通过自身已记录的表层渲染该事件时,它才会到达模型。
#### Token 影响
为零。该包的文本不会进入任何模型请求。
#### KV Cache 影响
相互独立:领域读写绝不触碰请求前缀,因此这里没有任何内容能使提供方 cache 复用失效。
## 已知限制与暂缓事项
- **变更只在单进程内可见**`domain/changed` 是进程内事件;在 Agent Note 暂缓的跨进程 revision 模式落地前,第二个主机进程或重新连接的 GUI 无法观察变更。
- **没有跨表事务、二级索引或多 segment key**:每次写入只触碰一条记录;这些扩展的 trigger 和返工点列在 Agent Note 的暂缓工作清单中。

View File

@@ -0,0 +1,6 @@
# Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write
README.md: c3417846a70f8a227a19a5abf834156d530e3597
README.zh.md: 6a566aa1c2cdeac18760ec6e5964a623a3643928

View File

@@ -1,5 +1,7 @@
# @deepseek-ai/dsh-storage-json
English | [中文](README.zh.md)
JSON backend for the [storage hub](../storage/README.md): one human-readable `<unit>.json` file per unit under a configured root, registered as backend `json`. Design: [domain KV storage Agent Note](../../../.agents/notes/proposed/architecture/2026-07-24-domain-kv-storage-and-workspace.zh.md).
## Model

View File

@@ -0,0 +1,38 @@
# @deepseek-ai/dsh-storage-json
[English](README.md) | 中文
[存储中心](../storage/README.md)的 JSON 后端:配置根目录下每个单元使用一个人类可读的 `<unit>.json` 文件,注册为后端 `json`。设计见[领域 KV 存储 Agent Note](../../../.agents/notes/proposed/architecture/2026-07-24-domain-kv-storage-and-workspace.zh.md)。
## 模型
- 内存中的单元状态具有最终决定权;每个写入原语都会通过临时写入 + fsync + 原子 `rename()` 替换重新发布整个文件。单元文件始终是完整的当前净状态:可读性是该后端存在的理由,规模问题则属于 SQLite 后端。
- 缺失文件会作为空单元打开,并在第一次写入时物化。外部或无法解析的文件以 `malformed-medium` 拒绝;已存版本与 descriptor 不同时以 `version-mismatch` 拒绝(预发布立场,不迁移)。
- 跨调用的写入顺序属于调用方(领域层的写入链);每个单独调用具备原子性,并在 resolve 后持久。
## 配置
| Key | 类型 | 默认值 | 含义 |
| --- | --- | --- | --- |
| `root` | string | 必填无默认值cwd 回退会让文件散落各处) | 保存单元文件的目录;按需以 `0o700` 创建 |
## 模型体验
### 已存领域记录
#### 模型看到的内容
无。该后端不贡献提示词、工具或 schema它在 `ctx.storage` 后面持久化非会话领域数据,只供主机侧消费方使用。
#### Token 影响
实时请求 token 为零。
#### KV Cache 影响
无:该后端从不触碰实时请求前缀。
## 已知限制与暂缓事项
- Windows 持久性依赖 libuv 的 `rename()`(使用替换的 `MoveFileExW`),没有显式 write-through 标志append-log facet 落地时,计划把会话日志后端更严格的 Win32 write-through 发布辅助函数下移到此处(见 Agent Note 的迁移章节)。
- 没有跨进程写锁:两个进程写入同一根目录时,可能交错执行整文件替换(最后写入者胜出)。当前消费方采用单主机进程部署;多进程方案按 Agent Note 的范围外表格暂缓。

View File

@@ -0,0 +1,6 @@
# Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write
README.md: efc1b3ca54181a43c067594cc339ccc3a8fea510
README.zh.md: bcf2dd44c5334ec0c2b6623d22244b3b6b77f18e

View File

@@ -1,5 +1,7 @@
# @deepseek-ai/dsh-storage-sqlite
English | [中文](README.zh.md)
SQLite backend for the [storage hub](../storage/README.md): registers as backend `sqlite`, serving the `kv` facet over one `node:sqlite` database file (or `:memory:`). Design and trade-offs: [domain KV storage Agent Note](../../../.agents/notes/proposed/architecture/2026-07-24-domain-kv-storage-and-workspace.zh.md).
## Storage model

View File

@@ -0,0 +1,43 @@
# @deepseek-ai/dsh-storage-sqlite
[English](README.md) | 中文
[存储中心](../storage/README.md)的 SQLite 后端:注册为后端 `sqlite`,通过一个数据库文件提供 `kv` facet该文件使用 `node:sqlite`(也可以是 `:memory:`)。设计与取舍见[领域 KV 存储 Agent Note](../../../.agents/notes/proposed/architecture/2026-07-24-domain-kv-storage-and-workspace.zh.md)。
## 存储模型
每行一个文档:每个单元表都会成为一个物理 STRICT 表 `"u_<unit>_<table>" (key TEXT PRIMARY KEY, value TEXT)`,其中 `value` 是记录的 JSON 文本,因此一个 key 只更新一行(高频变更领域路由到这里而非 JSON 后端的原因)。单元标识位于两个元数据表中:`units` 在单元首次打开时标记其格式版本descriptor 不同时以 `version-mismatch` 拒绝;`unit_globals` 保存每个单元的全局 singleton 行。物理布局版本位于 `PRAGMA user_version`;其他任何标记值都会被拒绝(未发布格式,不迁移)。单元名和表名在进入 DDL 之前依据中心的 `UNIT_NAME_RE` 接受验证,因此不会把外部输入插值到 SQL 标识符中。
每个写入原语都是一条 prepared statementSQLite 的逐语句原子性无需显式事务即可满足 KV 契约,写入顺序仍由调用方负责(领域层写入链)。缺失目录和数据库文件会以仅 owner 可访问的权限创建(`0o700``0o600`),与 session-persistence SQLite 后端一致;在计划的介质层提取完成前,该包逐字复用了后者的打开顺序。
## 配置schemastery
```ts
interface Config {
path: string // SQLite database file path, or ':memory:' for an in-process DB
journalMode?: 'wal' | 'delete' | 'truncate' | 'persist' // journal_mode pragma; default 'wal'
}
```
## 模型体验
### 已存领域记录
#### 模型看到的内容
无。该后端不贡献提示词、工具或 schema它在 `ctx.storage` 后面持久化非会话领域数据Workspace 记录、未来的会话伴随元数据),只供主机侧消费方使用。
#### Token 影响
实时请求 token 为零。
#### KV Cache 影响
无:该后端从不触碰实时请求前缀。
## 已知限制与暂缓事项
- **`DatabaseSync` 是同步的**:每次写入会在其持续时间内阻塞事件循环(一条语句);在领域数据规模下可以接受。
- **没有 busy-wait 或重试策略**:另一个连接持有写事务时,该操作会立即被拒绝;多进程写入保护列在设计的未来工作清单中。
- **只打开当前的 `STORAGE_SQLITE_SCHEMA_VERSION`**:其他任何已标记版本都会被拒绝而不是迁移(预发布立场)。
- **`openDatabase` 重复了 session-persistence SQLite 打开顺序**:提取到共享介质层的工作暂缓至计划的会话后端迁移(见 Agent Note 的复用审计)。

View File

@@ -0,0 +1,6 @@
# Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
# side as of the last confirmed-consistent state. Both languages carry equal authority;
# after editing either side, bring the other along and re-record with:
# pnpm run verify-translation-pairing --write
README.md: 994285842925539e73f8f11780f19495f71d0280
README.zh.md: 43cf542ceec7284228495e563dfa69b5c9af3157

View File

@@ -1,5 +1,7 @@
# @deepseek-ai/dsh-storage
English | [中文](README.zh.md)
Storage hub (`ctx.storage`) for non-session data: a named backend registry plus mounted data-form facilities. The hub performs no IO itself — backends own media, data forms own semantics. Design and trade-offs: [domain KV storage Agent Note](../../../.agents/notes/proposed/architecture/2026-07-24-domain-kv-storage-and-workspace.zh.md).
## Shape

View File

@@ -0,0 +1,41 @@
# @deepseek-ai/dsh-storage
[English](README.md) | 中文
非会话数据的存储中心(`ctx.storage`):命名后端注册表加已挂载的数据形式 facility。中心自身不执行 IO后端拥有介质数据形式拥有语义。设计与取舍见[领域 KV 存储 Agent Note](../../../.agents/notes/proposed/architecture/2026-07-24-domain-kv-storage-and-workspace.zh.md)。
## 形状
- `ctx.storage.backend`:名称 → 后端表。多个后端并排保持挂载(`json``sqlite`);为消费方提供服务的后端由该消费方自身的配置决定(领域层的路由表),绝非中心的全局选择。`register()` 返回 disposer重复名称和未知 lookup 会高声失败。
- `ctx.storage.mount(form, facility)``ctx.storage.form(form)`:数据形式挂载。`StorageForms` 可合并扩展;领域层合并 `domain`,并通过 `ctx.storage.domain` 访问。
- 后端拥有一种介质(文件树根、数据库文件),并公开可选的数据形状 **facet**:目前为 `kv`;为未来的会话后端迁移预留 append-log facet。`src/backend.ts` 是规范契约文本;`tests/contract.ts` 导出每个后端都会运行的共享一致性测试套件。
## 该分组中的包
| 包 | 职责 |
| --- | --- |
| `dsh-storage` | 中心服务 + 后端词汇 + 共享一致性测试套件 |
| `dsh-storage-json` | JSON 后端:每个单元一个人类可读文件,以原子方式重写整个文件 |
| `dsh-storage-sqlite` | SQLite 后端:一个数据库承载所有已路由单元,每行一个文档 |
| `dsh-storage-domain` | 领域数据形式(`ctx.storage.domain`):类型化 schema、写入链、变更事件 |
## 模型体验
### 后端与形式注册
#### 模型看到的内容
无。`ctx.storage` 是主机侧注册表;中心不注册工具、不注入提示词,也不写入会话事件。
#### Token 影响
每次请求的直接 token 为零。
#### KV Cache 影响
与实时请求相互独立:中心绝不触碰请求前缀,因此无法使提供方 cache 复用失效。
## 已知限制与暂缓事项
- **`kv` 是唯一的数据形状**:设计记录为未来的会话后端迁移预留了 append-log facet但尚未定义后端目前恰好只有一个 facet 需要实现。
- **形式惰性解析**:在领域插件挂载前读取 `ctx.storage.domain` 会抛出 `form-not-mounted`;组装会按相应顺序排列插件(错误配置会高声失败,而不是静默等待)。