@lmzhen/dsh-evolution-state-storage 0.32.3 → 0.32.5
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.md +9 -26
- package/lib/index.js +15 -18
- package/lib/types/medium-declaration.d.ts +8 -11
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,36 +1,19 @@
|
|
|
1
1
|
# @lmzhen/dsh-evolution-state-storage
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
a medium — providers register here (`json` = IO-seam files, `domain` = storage-domain KV).
|
|
3
|
+
> 内部组件,保存审批/整理/运行状态。
|
|
5
4
|
|
|
6
|
-
##
|
|
5
|
+
## 你会看到
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
- **Prompt prefix / KV cache:** unchanged by this package: family-level rules single-sourced in `packages/README.md` §"Model-visible prompt prefix and the KV cache".
|
|
10
|
-
- **Mount it?** yes — the `evolution-state-storage` row, in `evolution-host`/`evolution-all`/one-click `evolution-preset`; a seam consumed by `evolution-state`, `evolution-state-json`, `evolution-state-domain` and `evolution-approval`.
|
|
7
|
+
没有命令、面板或工具入口。
|
|
11
8
|
|
|
12
|
-
##
|
|
9
|
+
## 什么时候会用到
|
|
13
10
|
|
|
14
|
-
|
|
11
|
+
只在排障状态时。
|
|
15
12
|
|
|
16
|
-
|
|
17
|
-
import { runStateProviderConsistency } from '@lmzhen/dsh-evolution-state-storage'
|
|
18
|
-
import { expect } from 'vitest' // or any runner wrapped into `ConformanceAssert`
|
|
13
|
+
## 默认 / 前提
|
|
19
14
|
|
|
20
|
-
|
|
21
|
-
```
|
|
15
|
+
随家族自动工作。
|
|
22
16
|
|
|
23
|
-
|
|
17
|
+
## 边界
|
|
24
18
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
## Known limitations
|
|
29
|
-
|
|
30
|
-
- Provider registry has no default medium. Mount `evolution-state-domain` or `evolution-state-json` before state reads.
|
|
31
|
-
|
|
32
|
-
**Runtime invariant:** No companion is published. The platform auto-assembles nothing and the family mounts no `<pkg>/invariant` cordis row, so a companion here would never execute (v37 S2.1 / I-3).
|
|
33
|
-
|
|
34
|
-
## Notes and history
|
|
35
|
-
|
|
36
|
-
- Conformance suite (S3-2 / J-5)
|
|
19
|
+
用户只需要知道数据会保存在 `$DSH_HOME`。
|
package/lib/index.js
CHANGED
|
@@ -463,17 +463,13 @@ async function comparePendingReadings(left, right) {
|
|
|
463
463
|
/**
|
|
464
464
|
* G2b/2b.3: which medium carries each record type, and what PROCESS SCOPE that medium actually gives.
|
|
465
465
|
*
|
|
466
|
-
* The
|
|
467
|
-
*
|
|
468
|
-
*
|
|
469
|
-
*
|
|
470
|
-
* capability that can be DISPROVED. processScopeViolations takes the io the provider writes through and
|
|
471
|
-
* reports every claim of cross-process that the io cannot back up.
|
|
466
|
+
* The shipped IO backend declares single-process: its transaction serializes one process only.
|
|
467
|
+
* The domain medium inherits whatever backend the platform storage facility routes, and that is also
|
|
468
|
+
* single-process in this tree. This file states the weaker truth. processScopeViolations takes the io the
|
|
469
|
+
* provider writes through and reports every claim of cross-process that the io cannot back up.
|
|
472
470
|
*
|
|
473
|
-
* MIGRATION NOTE:
|
|
474
|
-
*
|
|
475
|
-
* declares single-process. When a backend carrying its own cross-process guarantee lands, it is named here
|
|
476
|
-
* and the reasoning moves with it - one declaration, not two.
|
|
471
|
+
* MIGRATION NOTE: when a platform backend carrying its own cross-process guarantee lands, name it here and
|
|
472
|
+
* move the reasoning with it - one declaration, not two.
|
|
477
473
|
*
|
|
478
474
|
* @module @lmzhen/dsh-evolution-state-storage/medium-declaration
|
|
479
475
|
*/
|
|
@@ -482,20 +478,20 @@ const MEDIUM_PROCESS_DECLARATION = [
|
|
|
482
478
|
{
|
|
483
479
|
record: "review_state",
|
|
484
480
|
medium: "json",
|
|
485
|
-
scope: "
|
|
486
|
-
because: "the
|
|
481
|
+
scope: "single-process",
|
|
482
|
+
because: "the shipped IO backend declares single-process; no cross-process medium exists in this tree"
|
|
487
483
|
},
|
|
488
484
|
{
|
|
489
485
|
record: "curator_state",
|
|
490
486
|
medium: "json",
|
|
491
|
-
scope: "
|
|
492
|
-
because: "same provider and same
|
|
487
|
+
scope: "single-process",
|
|
488
|
+
because: "same provider and same single-process write path as review_state"
|
|
493
489
|
},
|
|
494
490
|
{
|
|
495
491
|
record: "pending",
|
|
496
492
|
medium: "json",
|
|
497
|
-
scope: "
|
|
498
|
-
because: "
|
|
493
|
+
scope: "single-process",
|
|
494
|
+
because: "the shipped IO backend has no cross-process claim primitive; a staged write is serialized only in-process"
|
|
499
495
|
},
|
|
500
496
|
{
|
|
501
497
|
record: "evolution-domain",
|
|
@@ -507,11 +503,12 @@ const MEDIUM_PROCESS_DECLARATION = [
|
|
|
507
503
|
/**
|
|
508
504
|
* Falsify the declaration against a capability reading.
|
|
509
505
|
* @param io - the io backend the medium writes through, or undefined when none is mounted.
|
|
506
|
+
* @param declaration - claims to falsify; defaults to the shipped declaration.
|
|
510
507
|
* @returns one message per claim the capability cannot back up; empty when every claim holds.
|
|
511
508
|
*/
|
|
512
|
-
function processScopeViolations(io) {
|
|
509
|
+
function processScopeViolations(io, declaration = MEDIUM_PROCESS_DECLARATION) {
|
|
513
510
|
const backed = io?.processScope === "cross-process";
|
|
514
|
-
return
|
|
511
|
+
return declaration.filter((claim) => claim.scope === "cross-process" && !backed).map((claim) => claim.record + " claims cross-process (" + claim.because + ") but the mounted io declares " + (io?.processScope ?? "no process scope"));
|
|
515
512
|
}
|
|
516
513
|
//#endregion
|
|
517
514
|
//#region lib/types/index.js
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* G2b/2b.3: which medium carries each record type, and what PROCESS SCOPE that medium actually gives.
|
|
3
3
|
*
|
|
4
|
-
* The
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* capability that can be DISPROVED. processScopeViolations takes the io the provider writes through and
|
|
9
|
-
* reports every claim of cross-process that the io cannot back up.
|
|
4
|
+
* The shipped IO backend declares single-process: its transaction serializes one process only.
|
|
5
|
+
* The domain medium inherits whatever backend the platform storage facility routes, and that is also
|
|
6
|
+
* single-process in this tree. This file states the weaker truth. processScopeViolations takes the io the
|
|
7
|
+
* provider writes through and reports every claim of cross-process that the io cannot back up.
|
|
10
8
|
*
|
|
11
|
-
* MIGRATION NOTE:
|
|
12
|
-
*
|
|
13
|
-
* declares single-process. When a backend carrying its own cross-process guarantee lands, it is named here
|
|
14
|
-
* and the reasoning moves with it - one declaration, not two.
|
|
9
|
+
* MIGRATION NOTE: when a platform backend carrying its own cross-process guarantee lands, name it here and
|
|
10
|
+
* move the reasoning with it - one declaration, not two.
|
|
15
11
|
*
|
|
16
12
|
* @module @lmzhen/dsh-evolution-state-storage/medium-declaration
|
|
17
13
|
*/
|
|
@@ -34,7 +30,8 @@ export interface ProcessScopeProbe {
|
|
|
34
30
|
/**
|
|
35
31
|
* Falsify the declaration against a capability reading.
|
|
36
32
|
* @param io - the io backend the medium writes through, or undefined when none is mounted.
|
|
33
|
+
* @param declaration - claims to falsify; defaults to the shipped declaration.
|
|
37
34
|
* @returns one message per claim the capability cannot back up; empty when every claim holds.
|
|
38
35
|
*/
|
|
39
|
-
export declare function processScopeViolations(io: ProcessScopeProbe | undefined): readonly string[];
|
|
36
|
+
export declare function processScopeViolations(io: ProcessScopeProbe | undefined, declaration?: readonly MediumProcessClaim[]): readonly string[];
|
|
40
37
|
//# sourceMappingURL=medium-declaration.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lmzhen/dsh-evolution-state-storage",
|
|
3
3
|
"description": "Provider registry seam for durable evolution state (community build)",
|
|
4
|
-
"version": "0.32.
|
|
4
|
+
"version": "0.32.5",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
],
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@lmzhen/dsh-evolution-contract": "^0.32.
|
|
29
|
+
"@lmzhen/dsh-evolution-contract": "^0.32.5"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"@deepseek-ai/cordis": "^4.0.5"
|