@lmzhen/dsh-evolution-state-storage 0.3.82 → 0.4.0
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 +13 -20
- package/lib/index.js +13 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,30 +1,20 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @lmzhen/dsh-evolution-state-storage
|
|
2
2
|
|
|
3
|
-
Provider registry seam for durable evolution state
|
|
3
|
+
Provider registry seam for durable evolution state: the consumer (`evolution-state`) never touches
|
|
4
|
+
a medium — providers register here (`json` = IO-seam files, `domain` = storage-domain KV).
|
|
4
5
|
|
|
6
|
+
## Model surface
|
|
5
7
|
|
|
6
|
-
|
|
8
|
+
- **Model-visible:** nothing of its own: the consumer rows own the injection.
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
#### What the model sees
|
|
11
|
-
|
|
12
|
-
`@deepseek-ai/dsh-evolution-state-storage` registers no direct prompt or tool schema itself. Model-visible effects are owned by the packages that consume this service.
|
|
13
|
-
|
|
14
|
-
#### Token effect
|
|
15
|
-
|
|
16
|
-
Zero direct token effect from this package; consumers add any model-visible tokens.
|
|
17
|
-
|
|
18
|
-
#### KV Cache effect
|
|
19
|
-
|
|
20
|
-
Independent of request-prefix construction. This package does not alter the assembled prompt or tool list.
|
|
21
|
-
|
|
22
|
-
## Conformance suite (S3-2 / J-5)
|
|
12
|
+
## Conformance suite
|
|
23
13
|
|
|
24
14
|
The package publishes `runStateProviderConsistency(provider, assert)` — the whole seam contract as one call: field-complete pending round-trips, claim/resolve rollback, refusals at the write boundary, clone/alias independence, unknown-field preservation, and the two caps (resolved pending tail, review-state session rows). A third-party provider checks itself by running the suite against its own instance:
|
|
25
15
|
|
|
26
16
|
```ts
|
|
27
|
-
import { runStateProviderConsistency } from '@
|
|
17
|
+
import { runStateProviderConsistency } from '@lmzhen/dsh-evolution-state-storage'
|
|
28
18
|
import { expect } from 'vitest' // or any runner wrapped into `ConformanceAssert`
|
|
29
19
|
|
|
30
20
|
await runStateProviderConsistency(myProvider, expect)
|
|
@@ -32,10 +22,13 @@ await runStateProviderConsistency(myProvider, expect)
|
|
|
32
22
|
|
|
33
23
|
The assertion surface is INJECTED rather than imported, which is what lets this module ship: it carries no test-runner dependency, so loading the package never loads vitest. Both shipped providers run the same suite (`evolution-state-json` / `evolution-state-domain` `tests/provider-consistency.spec.ts`), and `consistency-forge.spec.ts` proves the suite fails when a single field is forged.
|
|
34
24
|
|
|
35
|
-
## Known Limitations and Deferred Work
|
|
36
25
|
|
|
26
|
+
## Known limitations
|
|
37
27
|
|
|
38
28
|
- Provider registry has no default medium. Mount `evolution-state-domain` or `evolution-state-json` before state reads.
|
|
39
29
|
|
|
40
30
|
**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).
|
|
41
31
|
|
|
32
|
+
## Notes and history
|
|
33
|
+
|
|
34
|
+
- Conformance suite (S3-2 / J-5)
|
package/lib/index.js
CHANGED
|
@@ -254,6 +254,19 @@ async function runStateProviderConsistency(provider, assert) {
|
|
|
254
254
|
lastSummary: "updated",
|
|
255
255
|
paused: false
|
|
256
256
|
});
|
|
257
|
+
await provider.transactCuratorState((current) => {
|
|
258
|
+
if (current !== null) {
|
|
259
|
+
current.runCount = 999;
|
|
260
|
+
current.paused = true;
|
|
261
|
+
}
|
|
262
|
+
return null;
|
|
263
|
+
});
|
|
264
|
+
assert(await provider.loadCuratorState()).toEqual({
|
|
265
|
+
lastRunAt: 10,
|
|
266
|
+
runCount: 0,
|
|
267
|
+
lastSummary: "updated",
|
|
268
|
+
paused: false
|
|
269
|
+
});
|
|
257
270
|
const live = pendingOf("c-live");
|
|
258
271
|
await provider.savePending(live);
|
|
259
272
|
assert((await provider.listPending("pending")).map((record) => record.id)).toContain("c-live");
|