clavue-v1 1.54.0 → 1.54.2

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
@@ -6,6 +6,22 @@ clavue / 克拉维 发布说明。本文件在构建时注入运行时,驱动
6
6
 
7
7
  ## Unreleased
8
8
 
9
+ ## 1.54.2 - 2026-10-18
10
+
11
+ - 代码索引不再撑爆内存:按 .gitignore(含子目录里的 .gitignore 和 .git/info/exclude)选文件,跳过 node_modules、dist、build、.venv*、site-packages、__pycache__ 等依赖与构建目录、锁文件和压缩包;内存里只留位置和向量,正文按需从 sqlite 读;大仓库(yousheng)建索引的峰值 RSS 从约 5.9 GB 降到约 0.2 GB
12
+ - 代码索引有上限:CLAVUE_CODE_INDEX_MAX_FILES(10000)、CLAVUE_CODE_INDEX_MAX_BYTES(64 MiB)、CLAVUE_CODE_INDEX_MAX_CHUNKS(60000)、CLAVUE_CODE_INDEX_MAX_FILE_BYTES(512 KiB);碰到上限时 CodebaseSearch 明确说明索引不完整
13
+ - 代码索引清理过期行改用 SELECT DISTINCT file,不再整表读进内存;写入分批提交,升级后第一次清理不再要几分钟
14
+ - 后台代理(会话笔记、记忆提取等分叉)不再把自己的消息写进主会话记录,只写自己的 subagents 文件;已经混进去的旧会话照常能打开
15
+ - 诊断、事件上报、MCP 客户端版本、/doctor、insights 导出和请求 User-Agent 报告真实版本号,不再是 dev / unknown
16
+ - 权限规则匹配遇到上级目录(..)不再抛 RangeError
17
+
18
+ ## 1.54.1 - 2026-10-18
19
+
20
+ - 文档:README 补上 1.52 以来的功能和配置:日记界面、提交到滚动历史(CLAVUE_RENDER_COMMIT=0 退回)、等待后台命令(CLAVUE_BG_WAIT / CLAVUE_BG_WAIT_MS / CLAVUE_BG_WAIT_MAX)、「还要继续几次」自动选(CLAVUE_CONTINUE_PICK_TIMEOUT_MS,连续最多 3 次)、四档分级与 /mode、模型回退链
21
+ - 文档:全部 577 个 CLAVUE_* 变量见 scripts/env-inventory.md(npm run check:env 保证和源码一致)
22
+ - 文档:开发流程先跑 npm run test:fast;架构基线、发布前检查(release:preflight)、CLAVUE_* 清单和工具 schema 检查、发布任务用 npm 11 做可信发布都写进 README 和 AGENTS.md
23
+ - 1.54.0 说明补充长时内存的稳定值;运行时代码与 1.54.0 相同
24
+
9
25
  ## 1.54.0 - 2026-10-18
10
26
 
11
27
  - 五个板块的深度复盘:回合循环、渲染与日记、模型路由与压缩、会话与后台任务、构建与发布,各自修掉一批逻辑问题;后台查询、子代理、后台会话不再改动主线程的阶段、计划、模型档位、轮询预算、请求计数和压缩游标
@@ -15,6 +31,7 @@ clavue / 克拉维 发布说明。本文件在构建时注入运行时,驱动
15
31
  - 后台任务的完成通知按(任务,状态)去重,状态变了会再通知一次;Shell 输出按合并后的文本截断
16
32
  - ctrl+o 的用量行显示前缀复用率;日记回放的标准输出只含结构计数,计时写到标准错误
17
33
  - 发布流程:已存在的 tag 拒绝发布,发布后按 shasum 核对;npm ci 遇到网络错误自动重试;新增 CLAVUE_* 变量清单检查、工具 schema 契约检查;typecheck 错误 2040 → 1974
34
+ - 长时内存(260 回合)稳定在约 404 MB,1.53.1 约 330 MB,平稳不增长;较可能的原因是默认(非全屏)界面在自动压缩后保留到上一个压缩点为止的消息(和全屏一样,`f61e2dc`),以前只留压缩边界
18
35
 
19
36
  ## 1.53.1 - 2026-10-17
20
37
 
package/README.md CHANGED
@@ -85,7 +85,7 @@ clavue-v1 --version
85
85
  Pin a version:
86
86
 
87
87
  ```bash
88
- curl -fsSL https://github.com/mycode699/clavue-public/releases/download/v1.54.0/install.sh | bash -s -- 1.54.0
88
+ curl -fsSL https://github.com/mycode699/clavue-public/releases/download/v1.54.2/install.sh | bash -s -- 1.54.2
89
89
  ```
90
90
 
91
91
  Upgrade later with `clavue-v1 update` (startup check / `/update` also prefer the public v1 release, then fall back to npm).
@@ -96,7 +96,7 @@ Upgrade later with `clavue-v1 update` (startup check / `/update` also prefer the
96
96
  npm install -g clavue-v1
97
97
  # or one-shot:
98
98
  npx -y clavue-v1
99
- npx -y clavue-v1@1.54.0 --version
99
+ npx -y clavue-v1@1.54.2 --version
100
100
  ```
101
101
 
102
102
  One-line global install via the package (npm / unpkg):
@@ -108,7 +108,7 @@ curl -fsSL https://unpkg.com/clavue-v1/install.sh | bash
108
108
  Install a specific version globally:
109
109
 
110
110
  ```bash
111
- curl -fsSL https://unpkg.com/clavue-v1@1.54.0/install.sh | bash -s -- 1.54.0
111
+ curl -fsSL https://unpkg.com/clavue-v1@1.54.2/install.sh | bash -s -- 1.54.2
112
112
  ```
113
113
 
114
114
  ```bash
@@ -283,6 +283,126 @@ This package is intended for users who want an execution-first coding CLI with d
283
283
 
284
284
  On macOS, Clavue avoids Keychain by default and stores local credentials in `~/.clavue/.credentials.json` so startup does not trigger system Keychain prompts. If you explicitly want the old Keychain behavior back, launch with `CLAVUE_USE_KEYCHAIN=1 clavue-v1`.
285
285
 
286
+ ## What Changed Since 1.52 (1.52.0 – 1.54.x)
287
+
288
+ ### Diary UI (1.52.0)
289
+
290
+ Consecutive reads, searches, commands and one-line progress notes fold into a
291
+ single diary row (`✓ 改 tools.rs、runner.rs · 运行 6 条命令 · 读 2 个文件`) with the
292
+ model's latest sentence under it. Edited files are always named; `ctrl+o` expands
293
+ everything. Model switches, first-byte fallbacks and tier changes go to the status
294
+ bar instead of the scroll area, and six common errors (first-byte timeout, busy,
295
+ login expired, quota, too long, interrupted) read as "what happened · what to do".
296
+
297
+ ```bash
298
+ CLAVUE_DIARY_VERBOSE=1 # also show maintenance rows (cache prefix, renewals, stage progress)
299
+ CLAVUE_DIARY_LEGACY=1 # 1.51 display
300
+ ```
301
+
302
+ ### Memory: commit to scrollback (1.53.0)
303
+
304
+ In the default (non-fullscreen) TTY view, finished messages are written once to
305
+ the terminal's own scrollback and then unmounted; only about one screen of live
306
+ rows stays in React. Resume draws the last 20 messages (`ctrl+o` opens the full
307
+ transcript in a virtual list). Since 1.54.0, auto-compact keeps the messages back
308
+ to the previous compaction point in this mode, as fullscreen already did, so a
309
+ long session levels off a little higher (about 404MB vs 330MB in the 260-turn
310
+ bench) but stays flat.
311
+
312
+ ```bash
313
+ CLAVUE_RENDER_COMMIT=0 # 1.52 rendering (no commit to scrollback)
314
+ CLAVUE_HEAP_SNAPSHOT_MB=1536 # heap size that triggers one diagnostics heap snapshot; 0 = off
315
+ ```
316
+
317
+ Known trade-off: rows already in scrollback are not re-wrapped after a width change.
318
+
319
+ ### Waiting on a background command (#159, 1.53.0)
320
+
321
+ When a reply ends on a deferral ("等拉取完成后再比对") while a main-thread
322
+ background shell is still running, the turn stays open and the host waits for
323
+ that shell. Its completion moves into the turn and the model does the deferred
324
+ step. Ctrl+C, a new message, a closed turn or the time limit ends the wait. After
325
+ the limit the deferral stays armed and the shell's completion wakes the session.
326
+
327
+ ```bash
328
+ CLAVUE_BG_WAIT=0 # turn the host wait off
329
+ CLAVUE_BG_WAIT_MS=600000 # in-turn limit per wait (default 10 min)
330
+ CLAVUE_BG_WAIT_MAX=3 # waits per user message, in-turn and idle together (default 3)
331
+ ```
332
+
333
+ ### Continue picker auto-pick (1.53.1)
334
+
335
+ When 还要继续几次 is left unanswered, a countdown runs on its bottom line and after
336
+ 30 s it picks the smallest option (3 runs), exactly like pressing Enter. Any key
337
+ cancels the countdown, and manual count entry never auto-picks. At most 3
338
+ auto-picks in a row without a key press or message, then it waits for you. Only
339
+ your own foreground turn opens, clears or consumes the picker; side queries,
340
+ subagents and background sessions do not.
341
+
342
+ ```bash
343
+ CLAVUE_CONTINUE_PICK_TIMEOUT_MS=30000 # default 30 s; 0 = never auto-pick
344
+ ```
345
+
346
+ ### Task tiers and `/mode` (1.51.0)
347
+
348
+ Each request is classified as simple, normal, complex or long (`/goal` runs are
349
+ long). Simple skips REVIEW and the delivery judge; normal reviews by risk; complex
350
+ and long keep the full flow. Tiers go up on wide edits, repeated failures or a
351
+ severe JEV finding, and down only at stage boundaries.
352
+
353
+ ```bash
354
+ /mode simple|normal|complex|long|auto # pin a tier for this session, or go back to auto
355
+ CLAVUE_TIERS=0 # turn tiering off
356
+ ```
357
+
358
+ ### Fallback chain
359
+
360
+ ```bash
361
+ CLAVUE_COMBO_MAIN=deepseek-v4,glm-5.3 # a comma list is the slot's fallback chain
362
+ CLAVUE_COMBO_CHAIN=0 # do not advance along the chain
363
+ CLAVUE_COMBO_FALLBACK=model-a,model-b # first-byte-timeout backups for the main thread
364
+ CLAVUE_COMBO_FALLBACK=0 # no first-byte backup; also no main-model floor for an exhausted slot
365
+ CLAVUE_COMBO_FALLBACK_STICKY_MS=300000 # how long a backup stays in place (default 5 min)
366
+ ```
367
+
368
+ A slot advances when its model is missing, overload retries run out, or 5xx errors
369
+ repeat; a timeout never advances a slot (1.54.0). With `CLAVUE_COMBO_FALLBACK`
370
+ unset, the ttqq gateway falls back to `cn:deepseek-v4.1-flash`, `cn:glm-5.3`, then
371
+ `clavue-2.1`; other gateways do not fall back. When a slot's chain is exhausted it
372
+ falls back to the main model.
373
+
374
+ ### Code index limits (1.54.2)
375
+
376
+ `CodebaseSearch` and `@symbol` mentions use a local index built in the
377
+ background at session start (`~/.clavue/index/`). It reads the repository
378
+ the way git sees it: every `.gitignore` (nested ones apply to their own
379
+ folder, `!` re-includes work) and `.git/info/exclude` are honored, and
380
+ dependency, build and virtualenv folders are skipped (`node_modules`,
381
+ `dist`, `build`, `target`, `.next`, `.venv*`, `venv*`, `site-packages`,
382
+ `__pycache__`, any folder holding `pyvenv.cfg`, and similar), as are
383
+ lockfiles, `*.min.js` and big files with very long lines (bundles, data
384
+ dumps). Only chunk locations and vectors stay in memory; chunk text is read
385
+ from the sqlite file when a search needs it.
386
+
387
+ ```bash
388
+ CLAVUE_CODE_INDEX_MAX_FILES=10000 # files indexed at most
389
+ CLAVUE_CODE_INDEX_MAX_BYTES=67108864 # total bytes of indexed files (64 MiB)
390
+ CLAVUE_CODE_INDEX_MAX_CHUNKS=60000 # chunks kept
391
+ CLAVUE_CODE_INDEX_MAX_FILE_BYTES=524288 # skip files larger than this (512 KiB)
392
+ CLAVUE_WP6_CODE_INDEX=0 # turn the index off
393
+ ```
394
+
395
+ When a limit stops the build, the index is partial and `CodebaseSearch` says
396
+ so in its result (which limit, how many files), so a miss is not read as
397
+ "not in the repo"; use Grep for the rest.
398
+
399
+ ### All `CLAVUE_*` settings
400
+
401
+ [`scripts/env-inventory.md`](scripts/env-inventory.md) lists all 581 `CLAVUE_*`
402
+ names read in source, with the files that read them and any literal default.
403
+ It is generated, and `npm run check:env` fails when a name is added or removed
404
+ without regenerating it.
405
+
286
406
  ## World Model Slot, Fanout Repair and Data Collection (1.50.0)
287
407
 
288
408
  ```bash
@@ -500,7 +620,7 @@ Version check:
500
620
 
501
621
  ```bash
502
622
  npx -y clavue-v1 --version
503
- npx -y clavue-v1@1.54.0 --version
623
+ npx -y clavue-v1@1.54.2 --version
504
624
  # available after a global install
505
625
  clavue-v1 --version
506
626
  ```
@@ -747,12 +867,18 @@ Companion desks are job contracts, not toys: `/girl` recaps and writes a handoff
747
867
 
748
868
  ## Developer Verification
749
869
 
870
+ Start every change with `npm run test:fast`: it is the quick "is this tree healthy" check, and it prints `first check before new work`.
871
+
750
872
  ```bash
873
+ npm run test:fast
874
+ npm run deps:ci
751
875
  npm run validate:repo
876
+ npm run check:env
877
+ npm run check:tool-schemas
752
878
  npm run typecheck
879
+ npm run check:architecture
753
880
  npm run lint
754
881
  npm run check:branding
755
- npm run test:fast
756
882
  npm run verify:dist
757
883
  node scripts/verify-provider-command-sidecar.mjs
758
884
  npm run verify:source-build
@@ -761,13 +887,19 @@ npm test
761
887
  npm run check
762
888
  npm run build
763
889
  npm run package:release
890
+ npm run check:worktree
891
+ npm run release:preflight
764
892
  ```
765
893
 
766
- - `npm run validate:repo`: checks package metadata, required tracked files, workflow presence, and tag/version consistency
894
+ - `npm run validate:repo`: checks package metadata, required tracked files, workflow presence, and tag/version consistency; `package-lock.json`, a `## <version>` heading in `CHANGELOG.md` and the README install pins must match `package.json`, and `engines.node` must be `>=22.18.0`
895
+ - `npm run deps:ci`: `npm ci` that retries registry and mirror network errors (CI and the release workflow use it)
896
+ - `npm run check:env`: compares every `CLAVUE_*` name in source with `scripts/env-inventory.json` / `.md`; regenerate with `node scripts/check-env-vars.mjs --write`
897
+ - `npm run check:tool-schemas`: checks each tool's input schema against its source definition
898
+ - `npm run check:architecture`: decrease-only snapshot in `scripts/architecture-baseline.json` — `src/query.ts` and every runtime file over 400 lines are frozen at their line count, and a new file crossing 400 fails; `--update-baseline` only lowers numbers
767
899
  - `npm run typecheck`: TypeScript 7 native full check (~2s) gated by a decrease-only error baseline in `scripts/typecheck-baseline.json`
768
900
  - `npm run lint`: Biome correctness rules scoped to changed files (`npm run lint:all` for the full tree)
769
901
  - `npm run check:branding`: decrease-only ratchet (`scripts/branding-baseline.json`) on user-facing upstream Claude Code references in `src/` — changelog links, `clau.de` short links, product names in copy; `--list` prints every hit
770
- - `npm run test:fast`: curated high-signal suite under a 20s wall-clock budget
902
+ - `npm run test:fast`: curated high-signal suite (query loop, rendering, compaction and the continue-picker / open-work tests first) under a 20s wall-clock budget; run it before new work
771
903
  - `npm run verify:dist`: smoke-tests `dist/cli.js`, provider setup, provider command, and release-critical sidecars
772
904
  - `node scripts/verify-provider-command-sidecar.mjs`: focused guard that fails if `dist/provider-command.js` drifts from the authored provider command source
773
905
  - `npm run verify:source-build`: rebuilds from `src/` into `experimental-dist/` and requires `--version` plus `--help` to boot under Node
@@ -776,7 +908,9 @@ npm run package:release
776
908
  - `npm run check`: full local verification gate used by CI
777
909
  - `npm run build`: runs `check` and previews the publishable npm tarball with `npm pack --dry-run`
778
910
  - `npm run package:release`: runs `check` and produces archives in `release-artifacts/`
779
- - Publishing: the `Release Clavue` workflow verifies and packages on tag push, but npm publishing currently runs from the maintainer machine: `cd "/Volumes/myhd 1/clavue-v1/clavue-v1" && npm publish --access public --registry https://registry.npmjs.org` (the explicit registry matters because the local default is an npm mirror). Configure a trusted publisher for `clavue-v1` on npmjs.com to let CI publish instead.
911
+ - `npm run check:worktree`: fails when tests left changes outside the known list in `scripts/worktree-clean-baseline.json` (CI runs it after `test:fast`)
912
+ - `npm run release:preflight`: refuses a version whose git tag (local or remote) or npm version already exists, and after publishing confirms `dist-tags.latest` and the registry shasum against the packed tarball
913
+ - Publishing: the `Release Clavue` workflow verifies and packages on tag push on Node 22.18 (the minimum supported Node), and its publish job installs npm `^11.5.1` first because npm trusted publishing needs npm >= 11.5.1 (Node 22.18 ships npm 10). npm publishing currently runs from the maintainer machine with an explicit `--registry https://registry.npmjs.org` (the local default is a mirror); configure a trusted publisher for `clavue-v1` on npmjs.com to let CI publish instead.
780
914
  - `npm run rebuild:experimental`: manual alias for `npm run verify:source-build`
781
915
  - `npm run rebuild:experimental:legacy`: older reconstruction path kept for manual investigation
782
916