dsh-plugin-t-expert 0.2.14 → 0.2.15

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.
Files changed (2) hide show
  1. package/README.md +23 -1
  2. package/package.json +3 -2
package/README.md CHANGED
@@ -185,13 +185,35 @@ npm install # 装开发期依赖(.npmrc 里开了 legacy-peer-deps,
185
185
  npm run typecheck # 类型检查(tsconfig.json 只覆盖自研 Host 文件,不碰并入的引擎)
186
186
  npm run verify # 自检套件(现 511 项断言):插件契约、工具、remote、客户端产物、播种与快照,
187
187
  # 外加「发布包自洽」(真打一份 tgz、解开、再用插件解析器读一遍)
188
+ npm run invariants # 引擎不变量门禁:真 cordis + 真 lib/teams + 桩 Agent,只报「违反集 D」
188
189
  npm run build # 构建客户端产物(lib/client.js)
189
190
  npm run sync-data # 把运行时数据同步进包内 data/
190
191
  ```
191
192
 
192
193
  `tools/` 里的构建 / 自检 / 同步脚本**随仓库走**,所以干净 clone 就能跑 `typecheck` 与 `verify`;
193
194
  需要运维台(`tz.sh`、`add-expert.py`)的那几节在本机没有运维目录时会**显式打印 skip**,不会
194
- 静默少跑。推送与 PR 由 `.github/workflows/ci.yml` 跑同一套门禁。
195
+ 静默少跑。推送与 PR 由 `.github/workflows/ci.yml` 跑同一套门禁(含 `npm run invariants`)。
196
+
197
+ ### 引擎不变量(`npm run invariants`)
198
+
199
+ `lib/teams/**` 是内置的团队引擎(约 9,600 行)。它没有「读一遍代码」的判据,所以这里用
200
+ **可执行探针**把引擎声称永远成立的契约钉住,只看**违反集 D**:`D = ∅` 即本轮干净。
201
+
202
+ | 不变量 | 钉住什么 |
203
+ | --- | --- |
204
+ | `INV-1` | 任务被转交/重试后**旧 `attempt_id` 必须失效**(旧主人与伪造令牌都被拒) |
205
+ | `INV-2` | 两个未完成的**写**任务不得共用同一 `inScope` 路径;`implementation` 必须带 `inScope` |
206
+ | `INV-3` | 一成员同时只能有一个未完成任务(顺序与**并发**都成立,并发恰好 1 胜) |
207
+ | `INV-4` | `halted` 语义:停→取消未完成任务并拒新单;`resume` 必须带非空 reason,之后才恢复派发 |
208
+ | `INV-5` | 并发写不丢更新:N 次并发建单全部落盘、id 唯一、状态文件始终可解析 |
209
+ | `INV-6` | `review` 必须带 `reviewedTaskId`;`needs_revision` 走 `failed` 且自动生成 `repair`;`verdict=pass` 才算完成 |
210
+ | `INV-7` | 质量类建单契约:`implementation` 必须带 `objective`/`acceptance`/`inScope`/`verify` |
211
+ | `INV-8` | 调度器契约:`approve` 后 pending 任务会被自动派给空闲成员(不是停在池里等人 claim) |
212
+
213
+ 探针基座的三条忠告写在 `tools/invariants.mjs` 的文件头(成员 id 要 approve 后才出现、团队 id
214
+ 会被 slug 化、工具执行上下文必须带 `signal` 且成员 agent 要有 `status`/`whenIdle`)——它们都是
215
+ 写这个门禁时踩出来的,改探针前先读那段。
216
+
195
217
 
196
218
  四条容易踩的开发约定:
197
219
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-t-expert",
3
- "version": "0.2.14",
3
+ "version": "0.2.15",
4
4
  "type": "module",
5
5
  "description": "T Expert — a 316-expert, 22-division roster with full Chinese translations, as a standalone DeepSeek Harness plugin, with a built-in multi-agent team engine (T Team).",
6
6
  "license": "MIT",
@@ -71,7 +71,8 @@
71
71
  "build": "node tools/build-client.mjs",
72
72
  "verify": "node tools/verify.mjs",
73
73
  "sync-data": "node tools/sync-data.mjs",
74
- "prepublishOnly": "npm run typecheck && npm run build && npm run verify && node tools/sync-data.mjs --check"
74
+ "prepublishOnly": "npm run typecheck && npm run build && npm run verify && npm run invariants && node tools/sync-data.mjs --check",
75
+ "invariants": "node tools/invariants.mjs"
75
76
  },
76
77
  "peerDependencies": {
77
78
  "@deepseek-ai/cordis": "^4.0.1",