@deepseek-ai/dsh-invariants 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 +5 -5
- package/README.zh.md +5 -5
- package/package.json +1 -6
- package/lib/invariant.js +0 -23
- 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/runtime-diagnostics/invariants/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: e825ef2ae01824d90f47f4789ece2cdfcaad83cb
|
|
6
|
+
README.zh.md: 52cf48783915b9c340acb578d3f57daa1025fe23
|
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ Mount the registry when a composition should verify its own runtime contracts, t
|
|
|
29
29
|
|
|
30
30
|
### When to use it
|
|
31
31
|
|
|
32
|
-
Use the registry for compositions that want live diagnostics.
|
|
32
|
+
Use the registry for compositions that want live diagnostics. [`dsh-sdk-minimal`](../../bundle/sdk-minimal/README.md) mounts it with the four core stateful companions — `dsh-session`, `dsh-agent`, `dsh-scope`, and `dsh-agent-loop`; `dsh-base` deliberately omits runtime diagnostics. Custom compositions mount the registry and add companions for any other loaded package whose contracts they want checked. Loading the registry alone installs no checks: it ships no product checks of its own, so a composition that never mounts a companion observes no diagnostic behavior.
|
|
33
33
|
|
|
34
34
|
### Enabling checks and selecting packages
|
|
35
35
|
|
|
@@ -65,10 +65,10 @@ Each companion protects relationships its package owns, and a companion installs
|
|
|
65
65
|
| `dsh-permission-presets`, `dsh-user-approval`, `dsh-commands` | Preset references to live presets, approval asked/decided pairing, command run/done pairing |
|
|
66
66
|
| `dsh-jobs`, `dsh-tool-todo`, `dsh-time-context` | Job snapshot field relationships, whole-list todo shape, durable clock readings |
|
|
67
67
|
| `dsh-credentials`, `dsh-settings`, `dsh-storage-domain`, `dsh-workspace` | Commit events against the live service or memory state, entity-cache mirroring |
|
|
68
|
-
| `dsh-agent-presets`, `dsh-session-title`, `dsh-plan-mode`, `dsh-schedule
|
|
68
|
+
| `dsh-agent-presets`, `dsh-session-title`, `dsh-plan-mode`, `dsh-schedule` | Preset mount placement, title source citation, plan-mode payload, schedule stream |
|
|
69
69
|
| `dsh-client-hmr`, `dsh-client-modules`, `dsh-client-runtime` | Browser/node-half stat-watcher lifecycle, boot entry graph, slot mutation versioning |
|
|
70
70
|
|
|
71
|
-
Every other workspace package
|
|
71
|
+
Every other workspace package omits the companion and states the package-specific reason in its README.
|
|
72
72
|
|
|
73
73
|
### Adding a companion to a custom composition
|
|
74
74
|
|
|
@@ -104,14 +104,14 @@ This section explains the design behind the registry; the observable behavior is
|
|
|
104
104
|
- **Product-independent registry.** The service imports no session, agent, scope, or agent-loop package and contains none of their checks; companions carry checks next to their owners.
|
|
105
105
|
- **Real relationships, not synthetic assertions.** A companion checks an event-stream or mutable-data relationship its package owns; confirming a method, plugin name, injection, or fixed pure result is a type, load, or unit-test concern, never a runtime invariant.
|
|
106
106
|
- **Registration reserves ownership.** A package name is reserved even when filters keep its installer inactive, so two plugins can never silently claim the same name.
|
|
107
|
-
- **
|
|
107
|
+
- **Companion wiring is mechanically enforced.** `pnpm run verify-package-invariants` rejects empty installers, installers that omit or ignore the reporter, wrong registration names, incomplete publication wiring, and stale wiring for omitted companions ([companion-omission note](../../../.agents/notes/implemented/simplification/2026-08-28-omit-unneeded-invariant-companions.md)).
|
|
108
108
|
|
|
109
109
|
### Source map
|
|
110
110
|
|
|
111
111
|
| File | Role |
|
|
112
112
|
|---|---|
|
|
113
113
|
| [`src/index.ts`](src/index.ts) | Plugin entry: `Config` schema, `InvariantRegistry` service, selection, registration, `InvariantError` |
|
|
114
|
-
|
|
|
114
|
+
| — | No runtime invariant companion is published; registration ownership and child lifecycle are the service's mutation boundary itself; observing them from the same registry would only duplicate its implementation. |
|
|
115
115
|
|
|
116
116
|
### Selection and registration lifecycle
|
|
117
117
|
|
package/README.zh.md
CHANGED
|
@@ -29,7 +29,7 @@ kind: "package-reference"
|
|
|
29
29
|
|
|
30
30
|
### 何时使用
|
|
31
31
|
|
|
32
|
-
需要实时诊断的组合请使用注册表。[`
|
|
32
|
+
需要实时诊断的组合请使用注册表。[`dsh-sdk-minimal`](../../bundle/sdk-minimal/README.zh.md) 挂载它及四个核心有状态配套入口——`dsh-session`、`dsh-agent`、`dsh-scope` 与 `dsh-agent-loop`;`dsh-base` 刻意省略运行时诊断。自定义组合挂载注册表,并为任何其他已加载、且希望检查其约定的包添加配套入口。单独加载注册表不会安装任何检查:它自身不携带任何产品检查,因此从不挂载配套入口的组合不会观察到任何诊断行为。
|
|
33
33
|
|
|
34
34
|
### 启用检查与选择包
|
|
35
35
|
|
|
@@ -65,10 +65,10 @@ kind: "package-reference"
|
|
|
65
65
|
| `dsh-permission-presets`、`dsh-user-approval`、`dsh-commands` | preset 引用指向活动 preset、审批询问/决定配对、命令运行/完成配对 |
|
|
66
66
|
| `dsh-jobs`、`dsh-tool-todo`、`dsh-time-context` | 任务快照字段关系、整表 todo 形状、持久时钟读数 |
|
|
67
67
|
| `dsh-credentials`、`dsh-settings`、`dsh-storage-domain`、`dsh-workspace` | 提交事件对照活动服务或内存状态、实体缓存镜像 |
|
|
68
|
-
| `dsh-agent-presets`、`dsh-session-title`、`dsh-plan-mode`、`dsh-schedule
|
|
68
|
+
| `dsh-agent-presets`、`dsh-session-title`、`dsh-plan-mode`、`dsh-schedule` | preset 挂载位置、标题来源引用、plan-mode 载荷、schedule 流 |
|
|
69
69
|
| `dsh-client-hmr`、`dsh-client-modules`、`dsh-client-runtime` | 浏览器/node 侧 stat-watcher 生命周期、启动入口图、slot 变更版本化 |
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
其余工作区包省略伴生入口,并在各自 README 中说明包级原因。
|
|
72
72
|
|
|
73
73
|
### 向自定义组合添加配套入口
|
|
74
74
|
|
|
@@ -104,14 +104,14 @@ ctx.plugin(SessionInvariant)
|
|
|
104
104
|
- **与产品无关的注册表。** 服务不导入任何 session、agent、scope 或 agent-loop 包,也不包含它们的检查;配套入口把检查放在其归属者旁边。
|
|
105
105
|
- **真实关系,而非人为断言。** 配套入口只检查其包拥有的事件流或可变数据关系;确认方法、插件名、注入或固定纯函数结果是类型、加载或单元测试关注点,绝不是运行时不变量。
|
|
106
106
|
- **注册保留归属。** 即使过滤器让 installer 保持非活动,包名也会被保留,因此两个插件永远不会静默认领同一个名字。
|
|
107
|
-
-
|
|
107
|
+
- **伴生入口接线由机械规则强制。** `pnpm run verify-package-invariants` 拒绝空 installer、省略或忽略 reporter 的 installer、错误注册名、不完整的发布接线,以及省略伴生入口后残留的接线([省略伴生入口笔记](../../../.agents/notes/implemented/simplification/2026-08-28-omit-unneeded-invariant-companions.zh.md))。
|
|
108
108
|
|
|
109
109
|
### 源码地图
|
|
110
110
|
|
|
111
111
|
| 文件 | 职责 |
|
|
112
112
|
|---|---|
|
|
113
113
|
| [`src/index.ts`](src/index.ts) | 插件入口:`Config` schema、`InvariantRegistry` 服务、选择、注册、`InvariantError` |
|
|
114
|
-
|
|
|
114
|
+
| — | 不发布运行时不变式伴生入口;注册归属本身就是服务的变更边界。 |
|
|
115
115
|
|
|
116
116
|
### 选择与注册生命周期
|
|
117
117
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-invariants",
|
|
3
3
|
"description": "Registry service for package-owned DeepSeek Harness runtime invariants",
|
|
4
|
-
"version": "0.1.2-alpha.
|
|
4
|
+
"version": "0.1.2-alpha.4",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -18,16 +18,11 @@
|
|
|
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",
|
package/lib/invariant.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
//#region lib/types/invariant.js
|
|
2
|
-
/**
|
|
3
|
-
* Package-owned invariant companion for `@deepseek-ai/dsh-invariants`.
|
|
4
|
-
* @module @deepseek-ai/dsh-invariants/invariant
|
|
5
|
-
*/
|
|
6
|
-
const PACKAGE_NAME = "@deepseek-ai/dsh-invariants";
|
|
7
|
-
/** Cordis companion plugin name. */
|
|
8
|
-
const name = "invariants-invariant";
|
|
9
|
-
/** Service required before the companion can reserve package ownership. */
|
|
10
|
-
const inject = ["invariants"];
|
|
11
|
-
/**
|
|
12
|
-
* No runtime invariant: registration ownership and child lifecycle are the service's mutation
|
|
13
|
-
* boundary itself; observing them from the same registry would only duplicate its implementation.
|
|
14
|
-
*/
|
|
15
|
-
const install = () => {};
|
|
16
|
-
/**
|
|
17
|
-
* Register this package's invariant companion.
|
|
18
|
-
* @param ctx - Cordis context carrying the invariant service.
|
|
19
|
-
* @returns the installed registration's disposer after setup succeeds.
|
|
20
|
-
*/
|
|
21
|
-
const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
|
|
22
|
-
//#endregion
|
|
23
|
-
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-invariants`.
|
|
3
|
-
* @module @deepseek-ai/dsh-invariants/invariant
|
|
4
|
-
*/
|
|
5
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
6
|
-
/** Cordis companion plugin name. */
|
|
7
|
-
export declare const name = "invariants-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
|