dsh-crwu-workbench 0.0.10 → 0.0.11

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/CHANGELOG.md CHANGED
@@ -7,6 +7,29 @@
7
7
  `cordis_define` + `cordis_run` 装配,版本号用 DSH 的 `pkg-N`);它已在本仓收尾时删除
8
8
  (见 `0.0.1` 一节),下面 `legacy · pkg-43` 及更早的记录是它的历史。
9
9
 
10
+ ## package · 0.0.11 · 2026-09-28
11
+
12
+ 修复「新报告一律发起不了」:审核启动报
13
+ `输入快照交接未完成,已终止本次审核(未创建子代理):输入快照交接失败(input):案例目录不存在或不是目录:<工作空间>/<流水号>`。
14
+
15
+ - 根因:`<工作空间>/<流水号>` 是 Host 自己的约定(`shared/utils/case-dir.ts` 的 `caseDirOf`),
16
+ 但**没有任何代码建过它** —— 案例内的每一个 Tool(bootstrap / `crwu_h3yun_file_get` /
17
+ `knowledge_materialize` / `oss_publish` / `dingtalk_*`)都先过 `requireCaseDir`(要求目录**已存在**),
18
+ 而 `crwu_audit_case_bootstrap` 又必须在**创建子代理之前**把输入快照落进这个目录。
19
+ 旧形态是审核子代理自己 `mkdir -p`(2026-09-25 的坑速查里记着它把材料下到 `cases/<流水号>` 那次);
20
+ 改成结构化 Tool 之后那条路没有了,于是只有**已经审过**(目录已存在)的报告能再发起,新报告永远卡在门禁上。
21
+ - 修复:`audit-start` 在交接输入快照**之前**由 Host 自己建出案例目录(`mkdir -p`,复用
22
+ `tools/case-files.ts` 的 `ensureDirectory`,workdir 是工作空间);建不出来就在创建子代理之前
23
+ 以 `创建案例目录失败:<路径>(原因)` 终止。目录已存在时是空操作,重审走同一段代码。
24
+ - 测试:`host-audit-lifecycle.test.mjs` 新增两条(trace 断言「先 mkdir → 再 bootstrap → 最后建子代理」
25
+ 的次序;shell 失败时中止且不占用门禁),并把该文件的 shell 替身从「永远失败」改成默认成功、
26
+ 可记录命令(`makeCtx` 的 `trace`)。
27
+ - 顺带修发布清单里的一个既存红项:`npm publish --dry-run` 会把 `npm_config_dry_run=true` 继承给
28
+ `pack:assert:strict` 内部那次**真正的** `npm pack` → 打不出 tarball → 严格自检报「没有产出 tarball」。
29
+ 现在那次 pack 的子进程环境显式 `npm_config_dry_run: 'false'`(`assert-pack.mjs`,
30
+ 与 `host-package.test.mjs` 同一处理),`host-bin-manifest.test.mjs` 加一条接线断言盯着它。
31
+ CI 的真实发布(`npm publish --provenance`)本来就不受影响,只是发布手册 §5.3 这一步以前过不去。
32
+
10
33
  ## package · 0.0.10 · 2026-09-27
11
34
 
12
35
  环境信息页进一步收敛普通员工不需要关注的技术说明:
package/README.en.md CHANGED
@@ -22,7 +22,9 @@ Migration history: [`PORTING.md`](PORTING.md).
22
22
  > two forms differ in RPC registration, client transport and React provisioning. That trade-off is
23
23
  > deliberate — one form, not two.
24
24
 
25
- Conventions: [`AGENTS.md`](AGENTS.md). Security model: [`SECURITY.md`](SECURITY.md).
25
+ Conventions: [`AGENTS.md`](AGENTS.md). Complete release runbook:
26
+ [`docs/releasing.md`](https://github.com/mmungdong/crwu-ai/blob/main/plugins/dsh-crwu-workbench/docs/releasing.md).
27
+ Security model: [`SECURITY.md`](SECURITY.md).
26
28
  Licensed for internal use only: [`LICENSE`](LICENSE) — do not redistribute.
27
29
 
28
30
  ## Install
@@ -126,13 +128,16 @@ and the installed Host automatically reads that packaged copy. Distribution need
126
128
 
127
129
  ## Releasing
128
130
 
129
- Never run `npm publish` by hand. The release path is tag-driven and gated:
131
+ The complete operator procedure, including authentication setup, failure recovery, and rollback, is in
132
+ [`docs/releasing.md`](https://github.com/mmungdong/crwu-ai/blob/main/plugins/dsh-crwu-workbench/docs/releasing.md).
133
+ Never run a real `npm publish` by hand. The release path is tag-driven and gated:
130
134
 
131
135
  ```bash
132
- npm run version:set 0.1.3 # package.json + VERSION + lockfile root
136
+ npm run version:set 0.1.3 # package.json + lockfile + VERSION + Host version constant
133
137
  # add a `## package · 0.1.3 · <date>` section to CHANGELOG.md
134
- npm run check && npm run pack:assert:strict
135
- git commit -am "release: 0.1.3" && git push
138
+ cd ../..
139
+ make plugin-pack
140
+ # review and commit only the release's files, then push the release commit to main
136
141
  git tag plugin-v0.1.3 && git push origin plugin-v0.1.3
137
142
  ```
138
143
 
@@ -140,11 +145,10 @@ A `plugin-v*` tag triggers the repository-root [`.github/workflows/release.yml`]
140
145
  (`v*` is reserved for the Go CLI in the same repository, keeping the two release lines apart); it asserts the
141
146
  tag matches `package.json` / `VERSION`, builds and stages both platforms' binaries in a separate job,
142
147
  recomputes every staged hash against `bin/manifest.json`, runs the full gate and the **strict** packed-artifact
143
- check, then publishes
144
- on GitHub Actions with OIDC (which attaches a provenance attestation automatically; no long-lived
145
- `NPM_TOKEN` needed). The very first release has to be published locally **without** `--provenance`,
146
- because npm only generates attestations inside a supported CI provider. `workflow_dispatch` runs the same pipeline
147
- as a dry run. `prepublishOnly` re-runs the artifact check and the gate, so a manual publish cannot skip them.
148
+ check, then publishes on GitHub Actions. The **current** workflow uses `NPM_TOKEN` for registry authentication and
149
+ `id-token: write` plus `--provenance` for the build attestation. It is not yet tokenless npm Trusted Publishing;
150
+ the runbook documents both the current setup and the recommended OIDC migration. `workflow_dispatch` runs the
151
+ same pipeline as a dry run. `prepublishOnly` re-runs the artifact check and the gate.
148
152
 
149
153
  ### One trap worth knowing: npm runs `prepare` on install too
150
154
 
package/README.md CHANGED
@@ -11,7 +11,9 @@ AI 审核子会话 → 盯住它的运行状态、可随时停止/重启 → 交
11
11
  审核流程本体不在本仓:它由 `crwu-audit` 技能族执行(见「依赖」)。本仓只负责**发起、盯状态、交付件回传**。
12
12
 
13
13
  源码在 `src/`,构建产物是 `lib/index.js` + `lib/client.js`,按 **DSH 包插件**(npm)分发安装。
14
- 维护规范见 [`AGENTS.md`](AGENTS.md),迁移历史与逐项记录见 [`PORTING.md`](PORTING.md),安全模型见 [`SECURITY.md`](SECURITY.md)。
14
+ 维护规范见 [`AGENTS.md`](AGENTS.md),完整发版步骤见
15
+ [`docs/releasing.md`](https://github.com/mmungdong/crwu-ai/blob/main/plugins/dsh-crwu-workbench/docs/releasing.md),
16
+ 迁移历史与逐项记录见 [`PORTING.md`](PORTING.md),安全模型见 [`SECURITY.md`](SECURITY.md)。
15
17
 
16
18
  > 本仓为**内部使用**软件,见 [`LICENSE`](LICENSE);发现安全问题请按 [`SECURITY.md`](SECURITY.md) 私下联系维护者,不要开公开 issue。
17
19
 
@@ -22,7 +24,7 @@ AI 审核子会话 → 盯住它的运行状态、可随时停止/重启 → 交
22
24
  | | |
23
25
  |---|---|
24
26
  | 怎么活 | `dsh plugin --profile <p> add …` 装进 profile,随 profile 启动而加载 |
25
- | 版本号 | semver(`package.json` / `VERSION` / `CHANGELOG.md` 三处一致,`npm run version:check` 强制) |
27
+ | 版本号 | semver(`package.json` / `package-lock.json` / `VERSION` / `src/host/consts.ts` 同步,`CHANGELOG.md` 有对应小节,`npm run version:check` 强制) |
26
28
  | 重启 DSH 后 | **还在**(这是它相对于旧动态形态的主要好处) |
27
29
  | 谁能改 | 任何能跑 `dsh` CLI 的人/agent 都能独立闭环;源码改动由 CI 与 `npm run check` 把关 |
28
30
  | 分发 | npm(tag → release workflow);也支持 git 安装与 tarball |
@@ -294,7 +296,8 @@ dsh plugin --profile web remove dsh-crwu-workbench
294
296
 
295
297
  ### 四条命令
296
298
 
297
- > 本机怎么开发、怎么在真实 DSH 上验、怎么发版,逐步步骤都在 [`AGENTS.md`](AGENTS.md) 第七、八节;
299
+ > 本机怎么开发、怎么在真实 DSH 上验见 [`AGENTS.md`](AGENTS.md) 第七节;完整发版流程见
300
+ > [`docs/releasing.md`](https://github.com/mmungdong/crwu-ai/blob/main/plugins/dsh-crwu-workbench/docs/releasing.md);
298
301
  > 下面只是命令速查。
299
302
 
300
303
  | 命令 | 作用 |
@@ -305,8 +308,8 @@ dsh plugin --profile web remove dsh-crwu-workbench
305
308
  | `npm run build` | tsdown 双端打包出 `lib/index.js` + `lib/client.js`(`prepare` 也走它) |
306
309
  | `npm run smoke:built` | 用**真的** `lib/index.js` 走一遍同源路由、用真的 `lib/client.js` 过一遍 `__ModuleLoader__` |
307
310
  | `npm run check` | 上面几条按顺序跑一遍(`version:check` → `typecheck` → `test` → `build` → `smoke:built`)—— **交付/提 PR 前跑这个** |
308
- | `npm run version:set 0.0.2` | 改版本号(`package.json` + `VERSION` + lockfile 根版本) |
309
- | `npm run version:check` | 校验 `package.json` / `VERSION` / `CHANGELOG.md` 版本一致 |
311
+ | `npm run version:set 0.0.2` | 同步版本号(`package.json` + `package-lock.json` 根版本 + `VERSION` + `src/host/consts.ts`) |
312
+ | `npm run version:check` | 校验版本文件、Host 版本常量与 `CHANGELOG.md` 小节一致 |
310
313
  | `npm run pack:assert` | 核对 `npm pack` 真正打进去的文件清单 + 三条加载契约(发布前必跑;CI 也跑这条) |
311
314
  | `npm run pack:assert:strict` | **发布严格模式**:真打一份 tarball、解包后按 `bin/manifest.json` 逐个重算两个平台六个二进制的 size/sha256 |
312
315
  | `npm run bin:check` | 装配过 `bin/` 时:按清单重算**最终文件**哈希(内容变了就红,不看大小) |
package/lib/client.js CHANGED
@@ -9360,7 +9360,7 @@ body[data-ds-dark-theme] .crwu-audit-root {
9360
9360
  }
9361
9361
  /** 宿主与客户端是不是同一代(不同代时**必须**拦住发起审核,见 AGENTS.md §7.12)。 */
9362
9362
  function hostIsStale(snapshot) {
9363
- return snapshot.protocol !== null && snapshot.protocol !== 15;
9363
+ return snapshot.protocol !== null && snapshot.protocol !== 16;
9364
9364
  }
9365
9365
  /**
9366
9366
  * 小标签的取值(纯函数,可单测)。