@deepseek-ai/dsh-storage-sqlite 0.1.2-alpha.2 → 0.1.2-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.i18n.yaml +2 -2
- package/README.md +3 -3
- package/README.zh.md +3 -3
- package/package.json +4 -11
- package/lib/invariant.js +0 -25
- package/lib/types/invariant.d.ts +0 -16
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/storage/storage-sqlite/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 4744fa2a453e030ef2035e35040b158c703c5f77
|
|
6
|
+
README.zh.md: 368406f67344173d358dc5f3b32fe4dd7da79a49
|
package/README.md
CHANGED
|
@@ -75,7 +75,7 @@ The backend is a document-per-row layout over one `node:sqlite` connection, desi
|
|
|
75
75
|
|
|
76
76
|
### Open sequence
|
|
77
77
|
|
|
78
|
-
Opening the database
|
|
78
|
+
Opening the database creates the parent as `0o700`, exclusively creates a missing file as `0o600`, applies `PRAGMA foreign_keys = ON` and the journal mode, checks `user_version`, creates the `units` and `unit_globals` metadata tables, and stamps fresh databases last so a failure leaves the medium unstamped.
|
|
79
79
|
|
|
80
80
|
### Source map
|
|
81
81
|
|
|
@@ -84,7 +84,7 @@ Opening the database mirrors the session-persistence SQLite backend: `mkdir` the
|
|
|
84
84
|
| [`src/index.ts`](src/index.ts) | Plugin entry: backend registration, `path`/`journalMode` config, unit table |
|
|
85
85
|
| [`src/schema.ts`](src/schema.ts) | Open sequence, physical layout version, metadata tables, record table naming |
|
|
86
86
|
| [`src/unit.ts`](src/unit.ts) | One opened unit: prepared statements, JSON value parse, close |
|
|
87
|
-
|
|
|
87
|
+
| — | No runtime invariant companion is published; schema-version and unit-version consistency are open-time checks that reject before a unit exists, and durability needs the backend round-trip tests in the shared KV conformance suite; this package exposes no continuously observable in-process relation. |
|
|
88
88
|
|
|
89
89
|
</details>
|
|
90
90
|
|
|
@@ -129,7 +129,7 @@ These limits define when this backend is a poor fit or needs special operational
|
|
|
129
129
|
- **Synchronous driver blocks the event loop** — each write is a synchronous `DatabaseSync` call; the block lasts a single statement, which is acceptable at domain-data scale.
|
|
130
130
|
- **No busy-wait or retry policy** — a competing connection holding a write lock rejects the operation immediately instead of waiting; the domain layer's write chain serializes writes within one process, and cross-process coordination is out of scope.
|
|
131
131
|
- **Only the current physical layout version opens** — any other stamped `user_version` is rejected rather than migrated (pre-release stance).
|
|
132
|
-
- **Open sequence duplicated
|
|
132
|
+
- **Open sequence duplicated with the query provider** — `openDatabase` and `session-query-sqlite` both enforce SQLite file ownership, but each package owns a distinct application identity and schema; no shared medium helper couples them.
|
|
133
133
|
|
|
134
134
|
<a id="dev-note"></a>
|
|
135
135
|
### Dev Note
|
package/README.zh.md
CHANGED
|
@@ -75,7 +75,7 @@ kind: "package-reference"
|
|
|
75
75
|
|
|
76
76
|
### 打开顺序
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
打开数据库时会以 `0o700` 创建父目录、以 `0o600` 独占创建缺失文件、应用 `PRAGMA foreign_keys = ON` 与 journal mode、检查 `user_version`、创建 `units` 与 `unit_globals` 元数据表,并在最后给全新数据库盖戳,让失败留下未盖戳的介质。
|
|
79
79
|
|
|
80
80
|
### 源码地图
|
|
81
81
|
|
|
@@ -84,7 +84,7 @@ kind: "package-reference"
|
|
|
84
84
|
| [`src/index.ts`](src/index.ts) | 插件入口:后端注册、`path`/`journalMode` 配置、单元表 |
|
|
85
85
|
| [`src/schema.ts`](src/schema.ts) | 打开顺序、物理布局版本、元数据表、记录表命名 |
|
|
86
86
|
| [`src/unit.ts`](src/unit.ts) | 一个已打开单元:预处理语句、JSON 值解析、关闭 |
|
|
87
|
-
|
|
|
87
|
+
| — | 不发布运行时不变式伴生入口;版本是打开时检查。 |
|
|
88
88
|
|
|
89
89
|
</details>
|
|
90
90
|
|
|
@@ -129,7 +129,7 @@ kind: "package-reference"
|
|
|
129
129
|
- **同步驱动阻塞事件循环**——每次写入都是一次同步 `DatabaseSync` 调用;阻塞只持续一条语句,在领域数据规模下可以接受。
|
|
130
130
|
- **没有忙等待或重试策略**——持有写锁的竞争连接会立即拒绝操作,而不是等待;领域层的写入链在单进程内串行化写入,跨进程协调属于范围外。
|
|
131
131
|
- **只打开当前的物理布局版本**——任何其他已标记的 `user_version` 都会被拒绝而不是迁移(预发布立场)。
|
|
132
|
-
-
|
|
132
|
+
- **打开顺序与 query provider 重复**——`openDatabase` 与 `session-query-sqlite` 都强制执行 SQLite 文件 ownership,但两个 package 分别拥有不同的 application identity 与 schema;没有共享 medium helper 将其耦合。
|
|
133
133
|
|
|
134
134
|
<a id="dev-note"></a>
|
|
135
135
|
### 开发备注
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-storage-sqlite",
|
|
3
3
|
"description": "SQLite storage backend (kv facet) for the DeepSeek Harness storage hub",
|
|
4
|
-
"version": "0.1.2-alpha.
|
|
4
|
+
"version": "0.1.2-alpha.4",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -18,30 +18,23 @@
|
|
|
18
18
|
"types": "./lib/types/index.d.ts",
|
|
19
19
|
"default": "./lib/index.js"
|
|
20
20
|
},
|
|
21
|
-
"./invariant": {
|
|
22
|
-
"types": "./lib/types/invariant.d.ts",
|
|
23
|
-
"default": "./lib/invariant.js"
|
|
24
|
-
},
|
|
25
21
|
"./src/*": "./src/*",
|
|
26
22
|
"./package.json": "./package.json"
|
|
27
23
|
},
|
|
28
24
|
"files": [
|
|
29
25
|
"lib/index.js",
|
|
30
|
-
"lib/invariant.js",
|
|
31
26
|
"lib/types/**/*.d.ts"
|
|
32
27
|
],
|
|
33
28
|
"license": "MIT",
|
|
34
29
|
"peerDependencies": {
|
|
35
|
-
"@deepseek-ai/dsh-
|
|
36
|
-
"@deepseek-ai/dsh-storage": "^0.1.2-alpha.2",
|
|
30
|
+
"@deepseek-ai/dsh-storage": "^0.1.2-alpha.4",
|
|
37
31
|
"@deepseek-ai/cordis": "^4.0.2"
|
|
38
32
|
},
|
|
39
33
|
"dependencies": {
|
|
40
34
|
"@deepseek-ai/schemastery": "^3.18.2"
|
|
41
35
|
},
|
|
42
36
|
"devDependencies": {
|
|
43
|
-
"@deepseek-ai/dsh-
|
|
44
|
-
"@deepseek-ai/cordis": "^4.0.2"
|
|
45
|
-
"@deepseek-ai/dsh-storage": "^0.1.2-alpha.2"
|
|
37
|
+
"@deepseek-ai/dsh-storage": "^0.1.2-alpha.4",
|
|
38
|
+
"@deepseek-ai/cordis": "^4.0.2"
|
|
46
39
|
}
|
|
47
40
|
}
|
package/lib/invariant.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
//#region lib/types/invariant.js
|
|
2
|
-
/**
|
|
3
|
-
* Package-owned invariant companion for `@deepseek-ai/dsh-storage-sqlite`.
|
|
4
|
-
* @module @deepseek-ai/dsh-storage-sqlite/invariant
|
|
5
|
-
*/
|
|
6
|
-
const PACKAGE_NAME = "@deepseek-ai/dsh-storage-sqlite";
|
|
7
|
-
/** Cordis companion plugin name. */
|
|
8
|
-
const name = "storage-sqlite-invariant";
|
|
9
|
-
/** Service required before the companion can reserve package ownership. */
|
|
10
|
-
const inject = ["invariants"];
|
|
11
|
-
/**
|
|
12
|
-
* No runtime invariant: schema-version and unit-version consistency are
|
|
13
|
-
* open-time checks that reject before a unit exists, and durability needs the
|
|
14
|
-
* backend round-trip tests in the shared KV conformance suite; this package
|
|
15
|
-
* exposes no continuously observable in-process relation.
|
|
16
|
-
*/
|
|
17
|
-
const install = () => {};
|
|
18
|
-
/**
|
|
19
|
-
* Register this package's invariant companion.
|
|
20
|
-
* @param ctx - Cordis context carrying the invariant service.
|
|
21
|
-
* @returns the installed registration's disposer after setup succeeds.
|
|
22
|
-
*/
|
|
23
|
-
const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
|
|
24
|
-
//#endregion
|
|
25
|
-
export { apply, inject, name };
|
package/lib/types/invariant.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Package-owned invariant companion for `@deepseek-ai/dsh-storage-sqlite`.
|
|
3
|
-
* @module @deepseek-ai/dsh-storage-sqlite/invariant
|
|
4
|
-
*/
|
|
5
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
6
|
-
/** Cordis companion plugin name. */
|
|
7
|
-
export declare const name = "storage-sqlite-invariant";
|
|
8
|
-
/** Service required before the companion can reserve package ownership. */
|
|
9
|
-
export declare const inject: string[];
|
|
10
|
-
/**
|
|
11
|
-
* Register this package's invariant companion.
|
|
12
|
-
* @param ctx - Cordis context carrying the invariant service.
|
|
13
|
-
* @returns the installed registration's disposer after setup succeeds.
|
|
14
|
-
*/
|
|
15
|
-
export declare const apply: (ctx: Context) => Promise<() => void>;
|
|
16
|
-
//# sourceMappingURL=invariant.d.ts.map
|