clavue-v1 1.81.0 → 1.82.0

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
@@ -4,6 +4,13 @@ clavue / 克拉维 发布说明。本文件在构建时注入运行时,驱动
4
4
 
5
5
  格式约定(`parseChangelog` 依赖):二级标题为 `## <版本> - <日期>`,条目以 `- ` 开头,一行一条,命令与模型名保留英文。
6
6
 
7
+ ## 1.82.0 - 2026-11-22
8
+
9
+ - **Shell 防挂死、编码安全截断、管道真退出码、全破坏性守卫与终端状态恢复(Round 1):** `Shell.ts` 默认注入 `NON_INTERACTIVE_SHELL_ENV`(`GIT_PAGER=cat`、`PAGER=cat`、`GH_PAGER=cat`、`GIT_TERMINAL_PROMPT=0`、`DEBIAN_FRONTEND=noninteractive`、`PIP_NO_INPUT=1`、`HOMEBREW_NO_AUTO_UPDATE=1`、`NPM_CONFIG_UPDATE_NOTIFIER=false`,同时保留 `envOverrides` 显式覆盖优先),根治分页器与交互提示挂死;`BashTool/utils.ts` 新增 UTF-16 代理对安全切片(`safeSliceHead`/`safeSliceTail`)杜绝 emoji/生僻汉字截断触发 API `HTTP 400`,检测并摘要高 NUL/二进制输出且清理残留 `\x00`,并为 `$TMPDIR/clavue-cmd-logs/` 增加 64 文件 / 24h TTL 自动回收(`pruneSpillLogs`);`verifyTee.ts` + `BashTool.tsx` 新增 `ensurePipefailForCheckPipeline`,为 `npm test | tail -n 20`、`cargo test | tee out.log` 等管道验收命令自动启用 `set -o pipefail`(避开 `head` 防 `SIGPIPE` 误伤),终结管道掩盖失败退出码 `0` 的假绿漏洞;`destructiveActionGuard.ts` 补齐 `git reset --hard`、`git clean -fd`/`-fdx`、`git push --force`/`-f`、`git checkout -- .`/`git restore .`、`chmod -R 777`、`curl|sh`/`wget|bash` 与数据库 `DROP`/`TRUNCATE`/`redis-cli FLUSHALL` 确认守卫;`gracefulShutdown.ts` 退出时安全恢复 `process.stdin.setRawMode(false)` 并注册幂等 `process.once('exit')` 兜底防止异常退出卡死终端。
10
+ - **文件状态机零漏洞与并发 Git Lock 重试 / 脏主树保护(Round 2):** 范围 `Read`(`<= 4MB`)现同步计算完整文件 `contentHash`,`FileWriteTool` 的 `validateInput` 与 `call` 全面接入 `isWriteTargetStale` 堵死 1s-mtime 同秒外部改写覆写漏洞;`FileEditTool` / `multiHunkApply` / `ApplyEditTool` / `FastApplyTool` 全链路无损保留 UTF-8 BOM(`\uFEFF`)并支持首行无感匹配;`FileStateCache` 在 macOS/Windows 大小写不敏感文件系统自动折算查找键并保留原始路径大小写;`writeFileSyncAndFlush_DEPRECATED` 原子临时文件引入随机十六进制后缀(`makeAtomicTempPath`)消除同毫秒碰撞;`ApplyEditTool` / `FastApplyTool` 在调用快改模型前拦截压缩占位符与陈旧文件(`errorCode: 7`)避免白跑一轮 LLM;`planAtomicMultiHunkEdits` 增加 `<= 64` 块上限与重复 hunk 零写入原子拒收;新增 `gitLockRetry.ts` 为 `v1WorktreeLand` / `arenaRunner` / `worktreePool` 注入瞬态 `.git/index.lock` 指数抖动退避重试,`landWorktreeBranches` 合入前先检查 `repoRoot` 未提交改动是否与目标车道重叠,避免破坏本地未提交代码。
11
+ - **全厂商上下文溢出与限流 `Retry-After` 恢复、跨零点 KV 缓存锁、预算前置熔断与 EPIPE/Schema 加固(Round 3):** `errors.ts` 与 `retryClassification.ts` 全面扩展识别 Gemini/Vertex、AWS Bedrock、DeepSeek、Qwen/DashScope、OpenRouter/Grok、Ollama/llama.cpp 与 SGLang 的上下文溢出报错,自动走压缩恢复而非盲目重试或崩盘;`retryDelay.ts` 与 `withRetry.ts` 支持小数秒与 RFC 7231 HTTP-date 格式 `Retry-After`,并按优先级解析 `retry-after-ms`、`retry-after`、`x-ratelimit-reset-requests` 与 `x-ratelimit-reset-tokens`(Go 时长格式);`context.ts` 按会话锁定 `currentDate`(`getPinnedLocalISODate`),仅在 `/clear` 或 `/compact` 时刷新,防止长程跨零点任务静默击穿 KV 前缀缓存;`QueryEngine.ts` 新增请求前 `isUsdBudgetExhausted` 预算门禁杜绝超支后再多发一轮 API 请求,且 `runReceiptExtras.ts` 稳定映射 `budget_usd`/`max_turns`;`process.ts` 幂等处理 `EPIPE`/`ERR_STREAM_DESTROYED` 安静退出管道,`SyntheticOutputTool` 精确输出 `enum`/`additionalProperties`/`required` 缺失与非法字段明细。
12
+ - English: Hardening milestone closing all 20 top competitor pain points & overlooked edge-case details across three rounds: (Round 1) non-interactive `Shell` env defaults (`GIT_PAGER`/`PAGER`/`GH_PAGER`/`GIT_TERMINAL_PROMPT`/`DEBIAN_FRONTEND`/`PIP_NO_INPUT`/`HOMEBREW_NO_AUTO_UPDATE`/`NPM_CONFIG_UPDATE_NOTIFIER`), UTF-16 surrogate-safe truncation (`safeSliceHead`/`safeSliceTail`), binary/NUL output sanitization + bounded spill-log pruning (`pruneSpillLogs`), automatic `set -o pipefail` for piped verify commands (`ensurePipefailForCheckPipeline`, excluding `head` to avoid SIGPIPE), expanded `destructiveActionGuard` (destructive `git`, `chmod -R 777`, `curl|sh`, SQL `DROP`/`TRUNCATE`, Redis `FLUSH*`), and idempotent stdin `setRawMode(false)` + exit fallback in `gracefulShutdown`; (Round 2) ranged-read full-file `contentHash` (`<= 4MB`), `isWriteTargetStale` in `FileWriteTool`/`ApplyEditTool`/`FastApplyTool`, lossless UTF-8 BOM (`\uFEFF`) preservation across `Edit`/`MultiHunk`/`ApplyEdit`/`FastApply`, case-insensitive `FileStateCache` lookup on darwin/win32, collision-free random atomic temp paths (`makeAtomicTempPath`), pre-hop compaction-stub & staleness guards in `ApplyEdit`/`FastApply`, `MAX_MULTI_HUNK_EDITS = 64` + duplicate-hunk rejection, and transient `.git/index.lock` backoff retry (`gitLockRetry.ts`) + dirty `repoRoot` overlap precheck in `landWorktreeBranches`; (Round 3) universal multi-provider context-overflow recognition (Gemini/Vertex, Bedrock, DeepSeek, Qwen/DashScope, OpenRouter/Grok, Ollama/llama.cpp, SGLang), fractional-second & RFC 7231 HTTP-date `Retry-After` + `retry-after-ms` & `x-ratelimit-reset-*` header support, session-pinned `currentDate` preventing midnight KV prefix cache invalidation, pre-request `isUsdBudgetExhausted` guard in `QueryEngine` + `budget_usd` classification, and idempotent `EPIPE`/`ERR_STREAM_DESTROYED` + rich `StructuredOutput` field diagnostics.
13
+
7
14
  ## 1.81.0 - 2026-11-22
8
15
 
9
16
  - **真闭环 `--self-heal`、确定性 `--arena` 赛马、热池全局单点彻底清零与全链路脱敏(Wave A):** 新增 `selfHealState.ts` 持久化 `self-heal-state.json`(跨多轮修补与 `--resume` 续接 `iteration`/`consecutiveFailures`/`escalationsUsed`),在 `print.ts` 与 ACP 真正驱动 `retry_muscle -> escalate_brain -> accept` 闭环自修;新增 `arenaCandidateExec.ts` 为 `--arena` 与 `architect` 自动兜底提供真实 CLI 候选执行器、APFS/reflink CoW(+ symlink 兜底)`node_modules` 依赖注入与孤儿 worktree 清理,`arenaRunner.ts` 强制 `try/finally` 分支回收并修复无验证命令时虚报 `ranTests: true` 的诚实性缺陷;默认将 `arena-worktrees`、`arena` 凭据与 `eval-graph` 迁移至仓库外 `~/.clavue/projects/<repoHash>/` 绝不污染用户工作树;`postRunSelfHealAndArena.ts` 改为异步按本会话变更文件精准 `git diff` 杜绝并发串判与事件循环阻塞;将 `work/controller`、`work/phases`、`work/infoGain` 与 `v1ReviewPolicy.carriedV1Review` 全部纳入 `SessionContext` 隔离并支持多块 `edits[]`/`ApplyEdit`/`FastApply` 控制流风险识别;统一 `receipt.json`/`scorecard.json`/`arena/*.json`/`eval-graph/` 走 `redactSecretsForPersistence` 脱敏,`install.sh` 增补 `SHA256SUMS` 校验。
package/README.md CHANGED
@@ -95,7 +95,7 @@ clavue-v1 --version
95
95
  Pin a version:
96
96
 
97
97
  ```bash
98
- curl -fsSL https://github.com/mycode699/clavue-public/releases/download/v1.81.0/install.sh | bash -s -- 1.81.0
98
+ curl -fsSL https://github.com/mycode699/clavue-public/releases/download/v1.82.0/install.sh | bash -s -- 1.82.0
99
99
  ```
100
100
 
101
101
  Upgrade later with `clavue update` or `clavue-v1 update` (startup check / `/update` also prefer the public v1 release, then fall back to npm).
@@ -106,7 +106,7 @@ Upgrade later with `clavue update` or `clavue-v1 update` (startup check / `/upda
106
106
  npm install -g clavue-v1
107
107
  # or one-shot:
108
108
  npx -y clavue-v1
109
- npx -y clavue-v1@1.81.0 --version
109
+ npx -y clavue-v1@1.82.0 --version
110
110
  ```
111
111
 
112
112
  One-line global install via the package (npm / unpkg):
@@ -118,7 +118,7 @@ curl -fsSL https://unpkg.com/clavue-v1/install.sh | bash
118
118
  Install a specific version globally:
119
119
 
120
120
  ```bash
121
- curl -fsSL https://unpkg.com/clavue-v1@1.81.0/install.sh | bash -s -- 1.81.0
121
+ curl -fsSL https://unpkg.com/clavue-v1@1.82.0/install.sh | bash -s -- 1.82.0
122
122
  ```
123
123
 
124
124
  ```bash