ygl-trees 0.83.0 → 0.83.1

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
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.83.1(2026-10-17)job 运行史持久化热修
4
+ - **`jobFinish` 漏传 runId(UPDATE 静默 no-op)**:`UPDATE runs SET finished=?,rc=?,output=? WHERE id=?` 的参数数组只有 3 个值——缺失的占位符绑定为 NULL,WHERE id=NULL 匹配 0 行且不报错。后果:**runs 运行史从未落库**(rc/output/finished 恒空,job logs 看到的 rc 全部来自 reaper 兜底);jobs 侧的 last_run/status 更新正常,掩盖了缺陷。在验证 0.83 到期巡检任务的落库输出时捕获。demo §7 增回归断言(job run 后 runs 表 rc=0 可读回)→ 114
5
+
3
6
  ## 0.83.0(2026-10-17)并发防护:指针钉住 + 半写拒绝 + 帮助面
4
7
  - **写命令长旗标钉住**(用户上报①,最重:并发会话两次劫持共享 current-project 指针,资产碎片化跨 3 项目):`research *` / `produce *`(含 task)/ `project *` 全部接受 `--project <p>` 长旗标,`node *` 接受 `--tree <t>`(短旗标 `-p`/`-t` 不变;`node import --tree` 仍是目标树名,别名不遮蔽);source/evidence/claim/task 写回执带 `· project <名>` 回显落点——写错项目当场可见,不必事后对账
5
8
  - **`source add --query` 半写防护**(上报①:attach 失败仍落源):引用不存在时**先拒绝后写入**(rc=1 点名、零落地),不再"源已落、链接失败";attach 落库后失败的路径改报已落 id + `research query attach` 重试指路
package/README.md CHANGED
@@ -300,7 +300,7 @@ ygl-trees agent ask "<question>" natural language interface
300
300
  ## 五b、开发与运维工具
301
301
 
302
302
  ```bash
303
- pnpm test # 四段制回归:unit (vitest 177 例) + build (tsc + tsdown) + demo(113 条断言)+ contract:audit(86 项)
303
+ pnpm test # 四段制回归:unit (vitest 177 例) + build (tsc + tsdown) + demo(114 条断言)+ contract:audit(86 项)
304
304
  pnpm bench # 性能基准七席(startup/写路径/检索/索引),每席含 RSS 内存端点 → tmp/bench-results.json
305
305
  node benchmarks/bench.js --quick # 缩小规模快速跑
306
306
  pnpm pack:check # 发布就绪门禁:打包 → 隔离安装 → 驱动发布产物跑命令面 + --json 纯净性
@@ -3092,7 +3092,8 @@ var Store = class {
3092
3092
  this.db.run("UPDATE runs SET finished=?, rc=?, output=? WHERE id=?", [
3093
3093
  require_text.nowIso(),
3094
3094
  rc,
3095
- output.slice(0, 8e3)
3095
+ output.slice(0, 8e3),
3096
+ runId
3096
3097
  ]);
3097
3098
  this.db.run("UPDATE jobs SET runs=runs+1, last_run=?, status=? WHERE id=(SELECT job_id FROM runs WHERE id=?)", [
3098
3099
  require_text.nowIso(),
@@ -297,7 +297,11 @@ class Store {
297
297
  return id;
298
298
  }
299
299
  jobFinish(runId, rc, output) {
300
- this.db.run("UPDATE runs SET finished=?, rc=?, output=? WHERE id=?", [(0, text_1.nowIso)(), rc, output.slice(0, 8000)]);
300
+ // 0.83.1: the UPDATE params were missing runId (3 values for 4
301
+ // placeholders → WHERE id=NULL → silent no-op). Run history (rc/output/
302
+ // finished) never persisted — only the jobs-row side updated. Caught
303
+ // while verifying the 0.83 patrol job's captured output.
304
+ this.db.run("UPDATE runs SET finished=?, rc=?, output=? WHERE id=?", [(0, text_1.nowIso)(), rc, output.slice(0, 8000), runId]);
301
305
  this.db.run("UPDATE jobs SET runs=runs+1, last_run=?, status=? WHERE id=(SELECT job_id FROM runs WHERE id=?)", [
302
306
  (0, text_1.nowIso)(),
303
307
  rc === 0 ? "ok" : "failed",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ygl-trees",
3
- "version": "0.83.0",
3
+ "version": "0.83.1",
4
4
  "description": "猿光 · 科技树 — database-centric CLI for research → production → knowledge reuse, built for AI agents.",
5
5
  "type": "commonjs",
6
6
  "main": "dist/apps/cli/index.js",
@@ -25,10 +25,10 @@
25
25
  "node-sqlite3-wasm": "^0.8.61",
26
26
  "reflect-metadata": "^0.2.2",
27
27
  "typeorm": "^1.1.2",
28
+ "@deepseek-ai/cordis-plugin-timer": "~1.1.7-alpha.2",
28
29
  "@deepseek-ai/cordis": "~4.0.5-alpha.2",
29
- "@deepseek-ai/schemastery": "~3.18.5-alpha.2",
30
30
  "@deepseek-ai/cosmokit": "~1.8.6-alpha.2",
31
- "@deepseek-ai/cordis-plugin-timer": "~1.1.7-alpha.2"
31
+ "@deepseek-ai/schemastery": "~3.18.5-alpha.2"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/node": "^20.0.0",
@@ -54,7 +54,8 @@
54
54
  ],
55
55
  "env": {
56
56
  "YGL_TEST": "1"
57
- }
57
+ },
58
+ "hookTimeout": 30000
58
59
  },
59
60
  "scripts": {
60
61
  "build": "tsc -p tsconfig.json && pnpm build:bundle:only && pnpm --filter @ygl/web build",
@@ -63,7 +64,7 @@
63
64
  "start": "node dist/bundle/bin.cjs",
64
65
  "demo": "bash examples/demo.sh",
65
66
  "test": "pnpm test:unit && pnpm build && bash examples/demo.sh && bash scripts/contract-audit.sh",
66
- "test:unit": "vitest run",
67
+ "test:unit": "vitest run --hook-timeout=30000",
67
68
  "smoke:bun": "bash scripts/bun-smoke.sh",
68
69
  "bench": "pnpm build && node benchmarks/bench.js",
69
70
  "pack:check": "bash scripts/pack-check.sh",