Merge branch 'worktree/ci-native-windows-20260808' into worktree/ci-native-windows-coverage-20260808
# Conflicts: # packages/subagent/subagent-codex/README.i18n.yaml # packages/subagent/subagent-codex/README.md # packages/subagent/subagent-codex/README.zh.md
This commit is contained in:
@@ -2,5 +2,5 @@
|
||||
# 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 packages/storage/storage-sqlite/README.md
|
||||
README.md: efc1b3ca54181a43c067594cc339ccc3a8fea510
|
||||
README.zh.md: bcbccf388cda3955fe6cd6501fd9ffb63e4c2a50
|
||||
README.md: 48aae14aa8613886d69652c39194878c190259cf
|
||||
README.zh.md: d95da614deb2fe4b6380532aa43836441a0db01c
|
||||
|
||||
@@ -8,7 +8,7 @@ SQLite backend for the [storage hub](../storage/README.md): registers as backend
|
||||
|
||||
Document-per-row: each unit table becomes a physical `"u_<unit>_<table>" (key TEXT PRIMARY KEY, value TEXT)` STRICT table whose `value` is the record's JSON text, so one key updates one row (the reason to route a high-churn domain here instead of the JSON backend). Unit identity lives in two metadata tables — `units` stamps each unit's format version at first open and rejects a differing descriptor with `version-mismatch`; `unit_globals` holds each unit's global singleton row. The physical layout version lives in `PRAGMA user_version`; any other stamped value rejects (unreleased format, no migrations). Unit and table names are validated against the hub's `UNIT_NAME_RE` before they reach DDL, so no external input is ever interpolated into SQL identifiers.
|
||||
|
||||
Every write primitive is a single prepared statement — SQLite's per-statement atomicity satisfies the KV contract without explicit transactions, and write ordering stays the caller's responsibility (the domain layer's write chain). Missing directories and database files are created owner-only (`0o700`/`0o600`), matching the session-persistence SQLite backend, whose open sequence this package copies verbatim until the planned media-layer extraction.
|
||||
Every write primitive is a single prepared statement — SQLite's per-statement atomicity satisfies the KV contract without explicit transactions, and write ordering stays the caller's responsibility (the domain layer's write chain). Missing directories and database files are created owner-only (`0o700`/`0o600`), matching the session-persistence SQLite backend.
|
||||
|
||||
## Configuration (schemastery)
|
||||
|
||||
@@ -38,6 +38,6 @@ None — the backend never touches live request prefixes.
|
||||
## Known Limitations and Deferred Work
|
||||
|
||||
- **`DatabaseSync` is synchronous** — each write blocks the event loop for its (single-statement) duration; acceptable at domain-data scale.
|
||||
- **No busy-wait or retry policy** — another connection holding a write transaction rejects the operation immediately; multi-process write protection is on the design's future-work list.
|
||||
- **No busy-wait or retry policy** — another connection holding a write transaction rejects the operation immediately; there is no multi-process write protection.
|
||||
- **Only the current `STORAGE_SQLITE_SCHEMA_VERSION` opens** — any other stamped version is rejected rather than migrated (pre-release stance).
|
||||
- **`openDatabase` duplicates the session-persistence SQLite open sequence** — extraction into a shared media layer is deferred to the planned session-backend migration (see the Agent Note's reuse audit).
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
每行一个文档:每个单元表都会成为一个物理 STRICT 表 `"u_<unit>_<table>" (key TEXT PRIMARY KEY, value TEXT)`,其中 `value` 是记录的 JSON 文本,因此一个 key 只更新一行(高频变更领域路由到这里而非 JSON 后端的原因)。单元标识位于两个元数据表中:`units` 在单元首次打开时标记其格式版本,描述符不同时以 `version-mismatch` 拒绝;`unit_globals` 保存每个单元的全局单例行。物理布局版本位于 `PRAGMA user_version`;其他任何标记值都会被拒绝(未发布格式,不迁移)。单元名和表名在进入 DDL 之前依据中心的 `UNIT_NAME_RE` 进行验证,因此不会把外部输入插值到 SQL 标识符中。
|
||||
|
||||
每个写入原语都是一条预处理语句:SQLite 的逐语句原子性无需显式事务即可满足 KV 约定,写入顺序仍由调用方负责(领域层写入链)。缺失目录和数据库文件会以仅所有者可访问的权限创建(`0o700`/`0o600`),与 session-persistence SQLite 后端一致;在计划的介质层提取完成前,该包逐字复用了后者的打开顺序。
|
||||
每个写入原语都是一条预处理语句:SQLite 的逐语句原子性无需显式事务即可满足 KV 约定,写入顺序仍由调用方负责(领域层写入链)。缺失目录和数据库文件会以仅所有者可访问的权限创建(`0o700`/`0o600`),与 session-persistence SQLite 后端一致。
|
||||
|
||||
## 配置(schemastery)
|
||||
|
||||
@@ -38,6 +38,6 @@ interface Config {
|
||||
## 已知限制与暂缓事项
|
||||
|
||||
- **`DatabaseSync` 是同步的**:每次写入都会在单条语句执行期间阻塞事件循环;在领域数据规模下可以接受。
|
||||
- **没有忙等待或重试策略**:另一个连接持有写事务时,该操作会立即被拒绝;多进程写入保护列在设计文档的未来工作清单中。
|
||||
- **没有忙等待或重试策略**:另一个连接持有写事务时,该操作会立即被拒绝;没有多进程写入保护。
|
||||
- **只打开当前的 `STORAGE_SQLITE_SCHEMA_VERSION`**:其他任何已标记版本都会被拒绝而不是迁移(预发布立场)。
|
||||
- **`openDatabase` 重复了 session-persistence SQLite 打开顺序**:提取到共享介质层的工作暂缓至计划的会话后端迁移(见 Agent Note 的复用审计)。
|
||||
|
||||
Reference in New Issue
Block a user