@deepseek-ai/dsh-storage-json 0.1.2-alpha.5 → 0.1.3-alpha.2
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 +2 -2
- package/README.zh.md +2 -2
- package/lib/index.js +6 -6
- package/lib/types/format.d.ts +3 -3
- package/lib/types/per-record-unit.d.ts +2 -2
- package/package.json +3 -3
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-json/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: d36c6333392c3efe4462aebd82cf3ff9e76f66ae
|
|
6
|
+
README.zh.md: 9c266537945941d4bc779a2cb1a349e2409f21dc
|
package/README.md
CHANGED
|
@@ -53,9 +53,9 @@ The generated [configuration catalog](../../../docs/config-catalog.md#deepseek-a
|
|
|
53
53
|
|
|
54
54
|
### Observable behavior
|
|
55
55
|
|
|
56
|
-
A missing `single` file or `per-record` directory opens as an empty unit and materializes on the first write. In `single`, malformed content rejects with `malformed-medium`, and a different stored version rejects with `version-mismatch`. In `per-record`, each malformed
|
|
56
|
+
A missing `single` file or `per-record` directory opens as an empty unit and materializes on the first write. In `single`, malformed content rejects with `malformed-medium`, and a different stored version rejects with `version-mismatch`. In `per-record`, each malformed or unreadable document, and each document whose version is outside the descriptor's current and compatible versions, reads as an absent record, so one bad document does not reject the unit. Record keys must match `[a-zA-Z0-9_-]+`; an unsafe key rejects before any file operation. Every resolved write is durable, and operations after close reject with `closed`.
|
|
57
57
|
|
|
58
|
-
An empty `per-record` tree can initialize its declared tables from a valid `<root>/<unit>.json` whole-unit document. The backend leaves that source file unchanged. Any document path in a declared table, or a declared `global.json`, suppresses this initialization for the complete unit, even if that document is unreadable or stale.
|
|
58
|
+
An empty `per-record` tree can initialize its declared tables from a valid `<root>/<unit>.json` whole-unit document only when the source unit name matches and its version is current or declared compatible. The backend leaves that source file unchanged and stamps migrated records with the current version. A source version outside the accepted set leaves the new tree empty. Any document path in a declared table, or a declared `global.json`, suppresses this initialization for the complete unit, even if that document is unreadable or stale.
|
|
59
59
|
|
|
60
60
|
-----
|
|
61
61
|
|
package/README.zh.md
CHANGED
|
@@ -53,9 +53,9 @@ kind: "package-reference"
|
|
|
53
53
|
|
|
54
54
|
### 可观察行为
|
|
55
55
|
|
|
56
|
-
缺失的 `single` 文件或 `per-record` 目录会作为空单元打开,并在第一次写入时物化。在 `single` 中,畸形内容以 `malformed-medium` 拒绝,不同的已存版本以 `version-mismatch` 拒绝。在 `per-record`
|
|
56
|
+
缺失的 `single` 文件或 `per-record` 目录会作为空单元打开,并在第一次写入时物化。在 `single` 中,畸形内容以 `malformed-medium` 拒绝,不同的已存版本以 `version-mismatch` 拒绝。在 `per-record` 中,每份畸形或不可读的文档,以及版本不在 descriptor 当前版本和兼容版本内的文档,都读作记录不存在,因此单个坏文档不会使单元被拒绝。记录键必须匹配 `[a-zA-Z0-9_-]+`;不安全的键在任何文件操作前被拒绝。每次已完成的写入都已持久化,关闭后的操作以 `closed` 拒绝。
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
只有当源单元名称匹配,且源版本为当前版本或已声明的兼容版本时,空的 `per-record` 目录树才可以从有效的 `<root>/<unit>.json` 整单元文档初始化其已声明表。后端保持该源文件不变,并为迁移的记录写入当前版本戳。接受集合之外的源版本会使新目录树保持为空。已声明表中只要存在任意文档路径,或存在已声明的 `global.json`,就会对整个单元禁止该初始化,即使该文档不可读或版本陈旧。
|
|
59
59
|
|
|
60
60
|
-----
|
|
61
61
|
|
package/lib/index.js
CHANGED
|
@@ -134,9 +134,9 @@ function serializeRecord(version, value) {
|
|
|
134
134
|
* Parse one per-record document, validating its version stamp. A document
|
|
135
135
|
* that is malformed or stamped with an unaccepted version is FOREIGN and
|
|
136
136
|
* reads as absent — the per-record contract: one bad or stale record file
|
|
137
|
-
* must not brick the whole unit, and
|
|
138
|
-
* instead of migrating
|
|
139
|
-
* there is exactly one document).
|
|
137
|
+
* must not brick the whole unit, and an unaccepted version stamp discards the
|
|
138
|
+
* record instead of migrating it (the whole-unit format rejects instead,
|
|
139
|
+
* because there is exactly one document).
|
|
140
140
|
* @param text - Raw per-record document content.
|
|
141
141
|
* @param versions - Accepted unit versions (the current one plus the
|
|
142
142
|
* descriptor's compatibleVersions); any other stamp discards the
|
|
@@ -285,8 +285,8 @@ var SingleJsonUnit = class {
|
|
|
285
285
|
* Per-record contract: a record document that is malformed or stamped with a
|
|
286
286
|
* version outside the accepted set (the descriptor's current version plus
|
|
287
287
|
* its `compatibleVersions`) reads as an absent record — one bad or stale
|
|
288
|
-
* file never bricks the whole unit, and
|
|
289
|
-
*
|
|
288
|
+
* file never bricks the whole unit, and an unaccepted version stamp discards
|
|
289
|
+
* the record instead of migrating it. Record keys become path segments, so
|
|
290
290
|
* they must be path-safe (`[a-zA-Z0-9_-]+`); an unsafe key rejects at write.
|
|
291
291
|
*
|
|
292
292
|
* Legacy bootstrap: when the new tree has no document path, a legacy
|
|
@@ -316,7 +316,7 @@ async function openPerRecordUnit(descriptor, root, onClose) {
|
|
|
316
316
|
* Read every record document under the unit directory: each declared table's
|
|
317
317
|
* `<key>.json` files plus `global.json`. A missing directory is the empty
|
|
318
318
|
* unit (materialization defers to the first write); a foreign document
|
|
319
|
-
* (missing, malformed, or stamped with
|
|
319
|
+
* (missing, malformed, or stamped with an unaccepted version) reads as an absent
|
|
320
320
|
* record, per the per-record contract.
|
|
321
321
|
* @param descriptor - Static identity and shape of the unit.
|
|
322
322
|
* @param dir - Absolute unit directory path.
|
package/lib/types/format.d.ts
CHANGED
|
@@ -41,9 +41,9 @@ export declare function serializeRecord(version: number, value: unknown): string
|
|
|
41
41
|
* Parse one per-record document, validating its version stamp. A document
|
|
42
42
|
* that is malformed or stamped with an unaccepted version is FOREIGN and
|
|
43
43
|
* reads as absent — the per-record contract: one bad or stale record file
|
|
44
|
-
* must not brick the whole unit, and
|
|
45
|
-
* instead of migrating
|
|
46
|
-
* there is exactly one document).
|
|
44
|
+
* must not brick the whole unit, and an unaccepted version stamp discards the
|
|
45
|
+
* record instead of migrating it (the whole-unit format rejects instead,
|
|
46
|
+
* because there is exactly one document).
|
|
47
47
|
* @param text - Raw per-record document content.
|
|
48
48
|
* @param versions - Accepted unit versions (the current one plus the
|
|
49
49
|
* descriptor's compatibleVersions); any other stamp discards the
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
* Per-record contract: a record document that is malformed or stamped with a
|
|
13
13
|
* version outside the accepted set (the descriptor's current version plus
|
|
14
14
|
* its `compatibleVersions`) reads as an absent record — one bad or stale
|
|
15
|
-
* file never bricks the whole unit, and
|
|
16
|
-
*
|
|
15
|
+
* file never bricks the whole unit, and an unaccepted version stamp discards
|
|
16
|
+
* the record instead of migrating it. Record keys become path segments, so
|
|
17
17
|
* they must be path-safe (`[a-zA-Z0-9_-]+`); an unsafe key rejects at write.
|
|
18
18
|
*
|
|
19
19
|
* Legacy bootstrap: when the new tree has no document path, a legacy
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-storage-json",
|
|
3
3
|
"description": "JSON file KV storage backend for the DeepSeek Harness storage hub",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.3-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -27,14 +27,14 @@
|
|
|
27
27
|
],
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@deepseek-ai/dsh-storage": "^0.1.
|
|
30
|
+
"@deepseek-ai/dsh-storage": "^0.1.3-alpha.2",
|
|
31
31
|
"@deepseek-ai/cordis": "^4.0.2"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@deepseek-ai/schemastery": "^3.18.2"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@deepseek-ai/dsh-storage": "^0.1.
|
|
37
|
+
"@deepseek-ai/dsh-storage": "^0.1.3-alpha.2",
|
|
38
38
|
"@deepseek-ai/cordis": "^4.0.2"
|
|
39
39
|
}
|
|
40
40
|
}
|