Commit Graph
1194 Commits
Author SHA1 Message Date
NolanHo b4e5c62f04 fix(sidechat): swallow the keep window's leading inbox inserts (real-data e2e catch)
The real loop order writes a turn's inbox INSERT before its turn/start
and the CLAIM right after it; starting the keep window at the turn/start
kept the claim while dropping its insert, and the host's positional
durable-inbox fold rejected the seed at Session.create — caught on the
deployment's real main session during the v4 e2e re-run (thread creation
failed: invalid persisted inbox splice at session seq 7).

The keep start now swallows the contiguous agent/inbox/spliced events
preceding the skeleton root (they replay cleanly from an empty inbox),
and a new inboxSplicesValid gate mirrors the host's fold — positional
splice application with duplicate-id rejection — so any splice history
that cannot replay falls back to the full copy instead of shipping a
seed the host rejects. Pinned by a spec case in the real loop order.
2026-10-16 16:14:41 +08:00
NolanHo 98c42971a2 fix(sidechat): normalize the head skeleton and mirror the host invariant core (review round 3)
Round 3 (two fresh reviewers) converged on: the head skeleton kept the
rewritten system head's ORIGINAL step number (a mid-session rewrite can
live at turn 1 step >= 2), the relational gate lacked the host's
nextStep/pendingCalls rules (a wide head's tool/result without its call
slipped through), kept compaction metering records carried stale
shadowedRange/shadowedSeqs (violating the compaction invariant
companion), and the gate was STRICTER than the host on non-append
tool/results — so the default-loaded pruner's replacements silently
disabled the trim.

v4: the head skeleton normalizes to turn 1 step 1, rewriting only the
envelope numbers an event already carries (a user/message never gains
fields — its whole data object IS the model-visible message; the
equivalence token now mirrors the renderer's projection exactly: user
messages compare their full data, everything else data.message). The
gate mirrors the host invariant's counter and pairing core: contiguous
turns, no nested open turn, sequential steps, in-turn naming with the
host's non-append tool/result exemption, and pending-call consumption.
Compaction metering records rebase their citations; when the span they
priced did not survive, the record is dropped. A surface node that is a
kept replacement's fold TARGET is no longer skipped, so pruner
replacements replay their transition instead of degrading into an
append stranded after a closed step — that shape now trims.

Pinned by new spec cases (rewritten head, pruner-rewritten keep-window
result) and by all three review rounds' out-of-tree probes.
2026-10-16 16:14:41 +08:00
NolanHo 0f9772a0d9 fix(sidechat): renumber turns over the dropped gap and keep mid-span regions (review round 2)
Two fresh reviews converged on a new blocking: the v2 head skeleton
closes turn 1 while the keep window keeps its original turn/start{N},
so the seed's turn counter jumps (1, N) — both of the branch's own
self-checks (foldSurface equivalence, Session.create) miss it, but the
host's relational invariant throws InvariantError in sessions.create on
every host that loads the invariant companion. The spec's invariant case
passed only because its fixture put the keep window at turn 2 — the one
continuous shape.

Also from the same round: the host's compaction region boundary is only
tool-pairing balanced, so it can end mid-turn — the keep interval then
re-emits the shadowed early nodes of its first turn and the verification
fell back (measured: only turn-aligned cut points ever trimmed).

v3: renumber data.turn over the gap (first kept turn/start scanned in
the keep interval AND the tail, since a head-only survivor set leaves
the keep interval empty); skip shadowed surface events and orphaned
tool/calls inside the keep interval; gate the result with
turnSequenceValid — turn counters contiguous, steps opening/closing
inside their turn, in-turn messages naming the open turn/step — the
same semantics as the host invariant. Fixtures now use the real turn
gap (shadowed whole turn between head and keep) plus a mid-span case;
mutation-checked: turning the renumbering off reddens the real-gap
invariant case.
2026-10-16 16:14:41 +08:00
NolanHo 90d04f7aa0 fix(sidechat): keep turn/step skeletons in the compaction-tail seed (review round 1)
Two independent reviews converged on one blocking root cause: the first
construction kept only surface nodes, so the open turn's turn/start — which
an automatic compaction necessarily precedes (it fires inside the open
turn) — was dropped, silently bypassing the dangling-tool-call guard and
the synthetic interrupted-closers, and the seed violated the host's
requireOpenStep relational invariant.

Construction v2 drops only the forgotten span and keeps everything else
verbatim: the surviving head is wrapped in its enclosing turn/step
skeleton (closers recovered from the log), the checkpoint lands at its
surface slot as a plain append, and the keep window + tail keep their
skeletons — so lastTurnBoundary, the closers, and the snapshot path run on
the rebased log exactly as on the full copy. One uniform rebase for every
kept event; orphaned summaries rescan to the previous complete compaction;
the consumed group's log-only records ride out with the span they priced.

Spec rewritten to host-shaped fixtures (system/message {turn, step,
message}), adds the mid-turn automatic-compaction cases (closers +
dangling snapshot), the real relational-invariant harness, and structural
fallback assertions. Mutation-checked: skeleton wrap, remap branch, and
orphan rescan each turn their case red.
2026-10-16 16:14:41 +08:00
NolanHo b025331b99 docs(sidechat): compaction-tail seed plan; test: discriminate remap and interleave paths
- plan doc: measured problem, the surface-equivalence argument, the
  construction (surface-order head emission, tail rebase with honest
  degradation, foldSurface self-verification, full-copy fallback), the
  explicit non-goals, and the deployment e2e gate.
- spec: assert the trim fires in the remap case (a replace fully inside
  the tail must stay a REMAPPED replace, not degrade into the fallback
  copy) and pin the interleave fallback (a tail replace covering a
  surviving pre-cut node).
2026-10-16 16:14:41 +08:00
NolanHo f2443445aa test(sidechat): real-validator acceptance for the compaction-tail seed
Session.create must accept the rebased seed exactly as the routes pass it
(isSeeded + the inherited cut): this is the layer that once caught a seed
whose surfaceOp markers were stripped, so it gates every envelope decision
the rebasing makes — degraded replaces, remapped citations, kept tool
pairs. The constructor's appended end-seed marker lands as the child's
first own event, same shape as today's full-copy threads.
2026-10-16 16:14:41 +08:00
NolanHo 32e7d041ad feat(sidechat): seed from the last compaction instead of copying the whole parent log
A side-chat fork physically duplicated the parent's entire event log into
the child session (measured: a 32,674-event child on this deployment, 303k
duplicated rows across 36 seeded threads). After a summarizing compaction
the checkpoint user/message already replaces the shadowed span on the
model-visible surface, so the child only needs the surviving pre-cut
surface nodes, the checkpoint, and the post-compaction tail.

The rebased sequence is verified with the real fold (foldSurface) before
use: identical visible nodes to the parent, hence identical model context
and provider context-cache prefix. Any tail that cannot be proven
equivalent (dangling back-references, reordering replaces, no compaction)
falls back to today's verbatim full copy.
2026-10-16 16:14:41 +08:00
Menghuan1918 c765c3eb49 test: 三条负载/时序敏感用例改成确定性(同一 commit 两次跑结果相反的那三条)
1. `mount.e2e.ts` 的底部工作台入口:入口的既有产品规则是「宿主右侧栏展开时不渲染」,
   而该用例先打开右侧栏、再去等这个入口,实际是在赌 500ms 复检窗口——同一 commit
   一次绿一次红(trace 里该元素在开右侧栏前存在、之后消失)。改为「展开断言 guide →
   收起右侧栏 → 点入口 → 最后重新展开右侧栏做 shadowing 断言」,每一步都等可观测状态。
2. `perf.e2e.ts` 的 `session.cwd` 门槛:15s 窗口 / 5s 节奏下,一个轮询器本身就报 3–4
   次,而「宿主右侧栏是否真的收起了」决定是一个还是两个轮询器。改为 `< visited * 2`
   (修复前 4 个页签是 15),既不再依赖视觉状态,也仍然区分「每会话」与「每页签」。
3. `editor-host.spec.tsx` 的渲染预算 20s → 60s(describe 时钟 35s → 120s)。实测同一
   commit:绿的那次本文件 609ms、红的那次 50554ms(本机 108ms),且三条 `fs.trees`
   应答都在等待开始前就落了地——80× 的 worker 停顿,不是等待太短。断言语义不变:
   行始终不出现仍然失败。
2026-10-16 01:06:50 +08:00
Menghuan1918 57fe6e657d test: 临时目录清理统一走 removeTree(修 Windows 上的 ENOTEMPTY 竞态)
CI 在 windows lane 上红在**清理**而不是断言:
`rmSync(scratch, { recursive: true, force: true })` 抛
`ENOTEMPTY: rmdir …archives-pvpAWR`——刚被 kill 的 zip/tar 子进程(以及刚关闭的
fs.watch / 刚结束的 git 子进程)还没被系统释放句柄,删除于是失败在一个**已经通过**
的用例的 afterEach 里(那一次 2466 个用例全过,只有清理挂掉,整个 lane 变红)。

`maxRetries` + `retryDelay` 正是 Node 为这种场景提供的对策,因此新增
`tests/temp-tree.ts` 的 `removeTree()`,把 30 份 spec(175 处 `{ recursive, force }`
写法)统一换过去,并清掉随之不再使用的 `rmSync` 导入。POSIX 上首次即成功、不触发
重试,行为不变。

本地:typecheck / lint 干净,全量 210 文件 / 2524 通过。
2026-10-16 00:51:11 +08:00
Menghuan1918 a628bdd1e9 fix(git): 行数封顶后不再累加输出 + 用注入式子进程确定性钉住两道上限
CI 在 ubuntu 上抓到 new 用例红:`stops producing once the NUL field cap is reached`
断言 2500 < 2500 不成立。查下来是**产品语义与断言不符**,不只是测试问题:

- `runGit` 在 `fieldCapped` 置位并 kill 子进程之后,仍然继续把后续 chunk 累加进
  `stdout`。子进程早已把整份输出写进管道时(125 KB 的 status 在 CI 上就是如此),
  被「封顶」的调用会原样返回全部 2500 行——「封顶」只约束了 kill,没有约束调用方
  拿到的东西。现在置位后忽略后续 chunk,保留量真正有界(封顶值 + 至多一个跨越
  封顶的 chunk)。
- 真 git 那条用例的 `toBeLessThan` 本质是竞态(kill 与子进程写完谁先到),把文件名
  加长到「一个 64 KiB chunk 至多携带约 500 个字段」让上界成立,并在注释里写明这条
  推理;**kill 本身**改由 `tests/git-spawn.spec.ts` 的注入式子进程确定性钉住
  (跨过封顶的 chunk + 封顶之后才到达的尾巴 + kill 恰好一次),另补字节上限的
  rejects 用例。撤掉产品守卫该用例当场红(kill 被调两次且尾巴进了结果)。

本地门禁:typecheck / lint 干净,全量 210 文件 / 2524 通过。
2026-10-16 00:28:41 +08:00
Menghuan1918 da0d294948 fix(release): 版本常量与 Windows 路径两处 CI 红
1. src/client/service.ts 的 SIDEBAR_SERVICE_VERSION 仍是 0.26.0,而
   tests/service.spec.ts 钉住它与 package.json 同版本(设计如此,是我漏了)。
2. 新的定时器清单 spec 用 `path.slice(root.length)` 取包内相对路径,在 Windows
   上留下前导反斜杠(\\JobsDrawer.tsx)导致两边永不相等——改用
   `relative() + split(sep).join('/')`,与 AGENTS §6「按平台推导路径要用同方言的
   node:path」同规。
2026-10-16 00:15:45 +08:00
Menghuan1918 38d4308a28 chore(release): v0.26.1 —— 版本号、CHANGELOG 定版(中英)与 README 最新版同步
稳态开销治理的补丁版:修掉 v0.25 引入的常驻轮询、每 tab 成本与 keepMounted 的
无界复利(社区反馈「0.24 没问题,之后就会卡」)。中英 CHANGELOG 各落一段,
README / README_ZH 的「最近更新」按既有约定在顶部加 v0.26.1 块并保留 v0.26.0,
dsh.plugin.json 版本与 package.json 同步(manifest-consistency 守护)。
2026-10-16 00:06:25 +08:00
Menghuan1918 29c77212c9 merge fix/perf-steady-state into dev(稳态开销治理:0.25 引入的常驻轮询、每 tab 成本与 keepMounted 的无界复利 + #935 遗留项)
社区反馈「0.24 没问题、之后就会卡」的分界线经产物级 A/B 落在 v0.25.0,v0.26.0 的
git 轮询修复没触及这些机制。真机挂载 lane 实测(4 个访问过的 tab、15s 空闲窗):
活着的 500ms 表 3→1、5s 表 5→0、空闲窗 session.cwd 15→0、命中测试 1620→0、
强制布局 rect 5190→30。设计与全部数字见 docs/plans/2026-10-15-perf-steady-state.md。

门禁:typecheck / lint / 全量 test(210 文件 2522 用例)/ perf lane 的 steady-state
用例(before 侧真机失败、after 侧通过)/ 新增跨模块 tests/steady-state.spec.tsx
(含客户端 setInterval 站点清单绊线)。
2026-10-15 23:05:52 +08:00
Menghuan1918 3f7ce178b4 docs: 稳态开销治理设计文档 + CHANGELOG Unreleased + AGENTS §5 硬规则
设计文档收录:产物级 A/B(0.24.1 无这些机制 / 0.25.0 引入 / 0.26.0 未动)、四份
只读审计的结论、microbench 与宿主解析器的实测数字、用户确认的四条决策、实施清单、
落地偏差(可见性来源逐个交代、TTL 与 pathspec 的语义代价、ops-stream 为何选 LRU
而非删除、GitLens 为何用同值保持而非挪早退)、真机 before/after 表、明确未做清单,
以及「本机 dsh 是 Desktop shim,硬写 DSH_HOME,不可用于隔离测量」这条踩坑记录。

AGENTS §5 新增硬规则「稳态开销:周期任务必须先答『它什么时候停』」:可见性门控
(含重新可见必须立刻补刷,且不得停掉事件驱动刷新)、单例归属(绝不按页签/按挂载
body 复制)、有界缓存(淘汰不碰在用项与在飞请求)、宿主路由要按最坏输入估成本。
2026-10-15 23:05:43 +08:00
Menghuan1918 ebfb207f08 test(perf): 稳态门禁(跨模块计时器/布局/请求 + 客户端定时器清单)
单模块用例各盯自己的 hook;这条只问跨模块的问题:把真实 Sidebar 壳挂起来、
什么都不给看时,它手里还握着多少会自己跑起来的东西。

- 非 blank 会话只允许存在**一条** 500ms 表(共享的宿主面板展开态),且不得存在 5s
  表(每 tab 轮询已收敛为按会话 + 可见性);收起工作台时壳自己不得发 session.cwd;
  隐藏页面时那条 500ms 表也必须消失,恢复即可重挂。
- 兜底入口在非 blank 会话渲染 null:宿主角落控件在场(measure() 能走到让位走查)
  时命中测试必须为 0——before 侧真机实测 1620 次,after 侧 0。
- 末节是**客户端 setInterval 站点清单**:8 个站点逐一登记「它什么时候停」,新增未
  登记的周期任务即红,登记了门控词却把门控删掉也红(绊线)。
- perf lane 新增 steady-state 指标与两条硬断言(兜底入口不渲染即不得命中测试、
  session.cwd 必须按会话而非按访问过的页签计数)。真机 A/B:500ms 表 3→1、
  5s 表 5→0、空闲窗 session.cwd 15→0、命中测试 1620→0、rect 5190→30。
2026-10-15 23:05:43 +08:00
Menghuan1918 ea3a016161 perf(client): 有界缓存与每秒再渲染收敛(#935 遗留项)
keepMounted 下「只增不减」的模块级表等于内存单调增长;每秒换新对象的 setState
等于每秒重建整份列表。

- git-status:槽位参与淘汰——释放归零即删(有在飞请求则等它结算),mint 顺序上限
  256,只淘汰 visible===0 && 无在飞 的槽;retain 会重新登记被遗忘的槽对象,
  同一键永不出现两条轮询器。30s 基线 / 退档 / poll:false 不持表 / 空闲不 notify 不变。
- ops-stream:streams 加 LRU 32(只淘汰无成员的记录),保留 seq/primed 游标——
  parked 页签回来仍能折到错过的那次写操作;被挤出去才重新基线(与刷新同代价)。
- TextEditor.previewScrollMemory 64、GitLens.commitDrafts 32(提交失败仍保留草稿)、
  markdown-navigation.pendingAnchors 改为写入时按 TTL 清扫。
- JobsDrawer:1s 时钟抽成自持 state 的 memo 组件并按 visible + document.hidden 门控,
  行列表不再依赖走秒值;行的无障碍名不再逐秒变化。
- SubagentView:同值保持引用 + published ref 拦掉 dispatch(实测仅靠 updater 形式
  React 仍会提交一次),模型/图派生因此不再每 tick 重算。
- GitLens:silent tick 改为「同值不换引用」而不是把 setWorktrees 挪到早退之后——
  后者会让中途新建的 linked checkout 在 silent tick 上永远冻结。

测试:扩展 git-status-poll / subagent-live-polling / subagent-jobs-view,新增
unbounded-caches;每条都用「临时回退→变红→还原」验过。
2026-10-15 23:05:36 +08:00
Menghuan1918 3e5576ffbb perf(host): cwd 解析加在飞去重与 TTL 对齐、numstat 加 pathspec 与输出上限
src/active-worktree.ts 是 v0.25 新文件,却插进了 12 条 /sidebar/* 路由共用的
cwdOf():实测每次缓存未命中 9.6–44.7ms、1–4 次真实 git spawn,而 TTL 3s 与客户端
新的 5s 每-tab 轮询错配——每次轮询必然未命中。

- active-worktree:(session, base) 整链与 base 探针都加在飞去重(并发 8 次只 spawn
  一次);ACTIVE_ROOT_TTL_MS 3s→15s(跟随 worktree 的延迟代价写进注释);三个模块级
  缓存加 LRU 上界 512/512/256,负结果仍缓存但可淘汰。
- git.ts:两条 --numstat 加 pathspec(非 ?? 路径 + R/C 的 origin,必须
  --literal-pathspecs;未跟踪路径不参与 ⇒ 未忽略的大目录从两条全仓库 diff 变成零条;
  路径超 8KB 回退整仓库 diff)、runGit 加 8MiB 输出上限、状态行上限改在产出侧生效。
- fs-tree:折叠探测每层封顶 32 且截断层不探测(折叠是纯装饰)。
- index.ts:单层 fs.tree 补 ProbeGate;teardown 主动关闭三个 noServer WSS 的已接受
  连接(ws@8 的 close() 不终止在连 socket,句柄会活到浏览器断开)。
- sidechat-routes:冷线程日志按 (childId, revision, size) memo(16 线程,句柄照旧
  open/close,只有结果被缓存)。
- agent-opens:每会话队列封顶 64,最旧的丢弃,FIFO 与 drainAll 语义不变。

测试:扩展 active-worktree / git-worktree / fs-tree-probe-gate / sidechat-routes /
smoke / agent-opens;14 项「临时回退→变红→还原」突变全部被捕获。
2026-10-15 23:05:32 +08:00
Menghuan1918 43742be658 perf(client): 每 tab 轮询收敛为按会话共享,keepMounted 加上界
v0.25 起原生 tab 一律 keepMounted:每个访问过的 body 都是永久的,于是
useSessionRoot 的 5s 轮询、目录 watch 的 socket、侧聊推送都按「挂载过的页签数」
永久复制。真机实测(4 个访问过的 tab、15s 空闲):活着的 5s 表 5 条、
session.cwd 请求 15 次;宿主那个解析器每次未命中要 spawn git 并回扫 4000 条事件。

- use-session-root:重写为模块级按会话引用计数的 store——一条 5s 表,只在 ≥1 个
  可见订阅者时存在;页面隐藏停表;恢复可见/聚焦/取消 park 立刻补刷一次;focus 与
  refresh-files 监听全 store 一份;parked body 保留上次答案。
- 消费点传真实可见性:native body 用 nativeTab.visible,壳用 bottomOpen。
- FileTree/use-dir-watch:已有的 visible 接进目录 watch——parked 或展开集为空时不建
  socket、不重列,恢复时重连并强制补刷一次(宿主按连接持有 ≤64 个 fs.watch 句柄)。
- use-sidechat-push/SideChatView:订阅按可见性门控,lastThreadBySession 加 LRU 并
  合并 localStorage 写入。
- state.bySession 加 LRU 32(当前会话永不淘汰,淘汰前先落盘),getSessionStates()
  不再每次整份复制(syncExpanded 原先每次 store notify 都 O(会话数) 复制),
  新增定向 getSessionState(id);FileTree 的 appsCacheRef 加上界。
2026-10-15 23:05:26 +08:00
Menghuan1918 c24d99168b perf(client): 常驻 500ms 表按可见性门控 + 观察者合帧(v0.25 回归)
产物级 A/B:0.24.1 的 lib/client.js 里没有这两个 500ms 表、没有 elementsFromPoint
走查;0.25.0 引入、0.26.0 未动。实测合成页面单 tick 0.1→9.7ms、最坏约 3500 次
强制布局读取/秒,且**无论是否可见都在跑**。

- right-panel-open:改全模块一条共享表(引用计数 0→1 起表并立刻读一次、1→0 停表),
  隐藏时 clearInterval(不是 tick 内早退),visibilitychange 回可见先读一次再起表;
  读法收敛成「先量收起态,命中即返回」,不建临时数组、不量输的那一组。
- dock-fallback:500ms 重对齐表拆进独立 effect,只在入口真的渲染时存在(此前注册在
  early return 之前,渲染 null 也照跑);隐藏时不测量不写 state;让位走查 400→100 步。
- settings-nav-icon:观察者回调 rAF 合帧并去掉 characterData——它是全插件唯一
  「每次 DOM 变更都触发且回调做全文档查询」的地方,流式 token 下按微任务触发。
- use-center-column:1.5s 兜底表只在「一列都没有」时 armed(周期与复核窗口等长,
  注释声称的 query-free 快路径此前永不生效),观察者仍是恢复路径。
- session-phase:隐藏时不发请求,值未变不 setState(blank 会话不再每秒重渲染)。

测试:新增 right-panel-open / session-phase 两份 spec,扩展 dock-fallback /
settings-nav-icon / center-column-locator;每条都用「临时回退→变红→还原」验过判别力。
2026-10-15 23:05:22 +08:00
Menghuan1918 80d2b0f56f merge docs/readme-zh-split into dev(README 中英分文件 + 锚点守卫改用固定 fixture) 2026-10-15 21:52:59 +08:00
Menghuan1918 99db903255 docs(readme): README 拆成英文默认版 + 中文 README_ZH.md,锚点守卫改用固定 fixture
- README.md 改为英文默认版,README_ZH.md 承接原中文 README,删除 README_EN.md;package.json 的 files 清单同步
- CHANGELOG.md / CHANGELOG_EN.md 顶部「最新版摘要」链接改指 README_ZH.md
- 特性区重排为表格布局并换用仓库内截图(docs/screenshots/*.png),README 里的目录(TOC)整块去掉
- 两条锚点守卫用例原本拿仓库 README 当真实文档(emoji 标题 + TOC 锚点 0/16 的回归),README 去掉目录后改用 tests/fixtures/github-toc-anchors.md 承载同一形状(emoji 标题 / U+FE0F 变体选择符 / & 转双横线):markdown-slug 只换文档来源,markdown-surface 的 CRLF 与「逐锚点点击真的滚动」两条同样改读 fixture,判别力不变
- tests/install-powershell.spec.ts 的 README 清单同步(README_EN.md → README_ZH.md)

维护者收尾:合并 origin/main(454afaf)后把「微信群二维码换新资源」移植到 README.md / README_ZH.md(旧资源 5d727d52 已换成 e9c77c37)
2026-10-15 21:52:59 +08:00
Menghuan1918 124e23e33a merge origin/main into dev(同步 main 的 README 修订:安装对照表删掉 4 条过时行、微信群二维码换新资源) 2026-10-15 21:36:16 +08:00
Atlas Zeng 454afaf8b0 Update README.md 2026-10-14 23:43:22 +08:00
Menghuan1918 2bcee4c635 docs(changelog): 补齐 v0.26.0 段缺失的贡献者归属(#881 / #910 / #911 / #926)
仓库的归属口径是「(贡献者 PR #N @handle)」,而 #926(@eleven-lings 的底部
工作台多终端)与 #881(@HuanLinOTO 的音频插件收录)**完全没有**这行标注——后者
还是本版新写的条目;#910 / #911(@UNscientific-9)只链了 PR 号、没写人。

补完后本段的外部 PR 归属一一对应:#881 / #910 / #911 / #926 新增,
#901 / #912 / #916 原有,涉及的贡献者是 @UNscientific-9(4 个 PR)、
@yanzhaohui1999、@eleven-lings、@HuanLinOTO。

核对口径:`git log v0.25.0..v0.26.0` 的全部非维护者提交只有这四位作者,
外部的 merge 提交也只有这 7 个 PR(其余 #919/#924/#925/#930/#946 是维护者
自己的)。上一版 v0.25.0 之所以有约 50 位贡献者,是因为它一次性滚入了
v0.24.1 以来积压的社区 PR(该区间 153 个非维护者提交)。
2026-10-13 23:12:16 +08:00
Atlas Zeng 9323f48d09 Merge pull request #946 from omdsh-dev/dev
release: v0.26.0 —— 流式传输 / JSONL 与大文件预览 / 侧边对话实时化 / 任务面板重构 / git 轮询收敛
2026-10-13 23:01:15 +08:00
Menghuan1918 e12cfd9d72 docs(readme): 支持线说明收回一句——alpha 通道不在本版范围
本版就钉 rc 线(npm `latest` / `next` = 0.2.0-rc.2)。原文把 0.2.1-alpha.x 的
不兼容写成了安装章节的一段警告,与「正式版适配 rc」的口径不符;改为一句括注,
表格里的 `0.2.0-rc.2+` 仍然说明一切。README_EN 同步。
2026-10-13 22:45:24 +08:00
Menghuan1918 8171beb5a2 chore(release): v0.26.0 —— 版本号、CHANGELOG 定版与补齐、README 与指南同步
**版本号三处同步**:`package.json` / `dsh.plugin.json` / `src/client/service.ts`
的 `SIDEBAR_SERVICE_VERSION` 0.25.0 → 0.26.0(`tests/manifest-consistency.spec.ts`
钉住前两者一致;service.ts 里其余 `v0.25.0+` 是历史功能标注,未动)。

**CHANGELOG**:`### Unreleased` 定版为 `### v0.26.0`;删掉任务面板那批的**首轮
旧稿重复块**(61–75 行与定稿重复且措辞互相矛盾,合并遗留);补上此前完全缺失的
三条——
- PR #925 侧边对话整批(实时推送 / 排队可见 / per-thread 模型选择 / 幽灵输入精确
  清扫 / 底栏重构);
- 文件树的「加载中」占位把子树永久卡死(占位所有权跟着请求走 + 丢弃时补发一次);
- `.jsonl` 预览谎报「文件过大」(阈值决定提示,不是组件决定);
- 预览插件目录收录音频预览插件(#881)。
另外把 `.delta/` 排除那条工具修复并入 git 轮询条目的测试小节。

**README / README_EN**:修掉「v0.24.1 起要求 0.2.0-rc.2+」这处事实错误(v0.24.1 的
peer 是 `^0.2.0-rc.1`,v0.25.0 才是 `^0.2.0-rc.2`)、跟着过时的「`latest` 仍是
0.1.7-rc.2」、以及支持线表格与徽章 alt 里的旧版本号;**补上此前从未写过的 v0.25.0
条目**并新增 v0.26.0 条目(四件大事 + 性能段)。README_EN 同步。

**CHANGELOG_EN**:停在 v0.24.1 已两版(无门禁守护),补 v0.26.0 与 v0.25.0,
并把头部说明改成「中文 CHANGELOG 为逐条权威、本文件是英文摘要且历史上滞后」。

**指南**:§4.4 内置清单的 viewer 数 3 → 4(补 `jsonl`);`terminal-bottom` 的
`single` 列与实际不符(#926 已去掉 `single`、改为 `createTab` 每次铸新 id),
两处「`contentId` 恒定」同步订正为每页签一个实例。
2026-10-13 22:44:05 +08:00
Menghuan1918 0f59d8f65a merge fix/git-poll-ladder into dev(git 状态轮询收敛:gutter 不再持有轮询、基线 30 s + 按实测退档、空闲轮询不通知、worktree 清单单命令计数) 2026-10-13 22:35:47 +08:00
Menghuan1918 a1cf80ef89 chore(test): vitest/eslint 排除 .delta/ 检出——本地门禁假红的根因
`.delta/worktrees/` 是 DSH worktree 通道的陈旧检出,`.git/info/exclude`
忽略它,但 vitest 与 eslint 只读各自的配置,于是本地 `pnpm test` 会收集那些
别的分支的副本、`pnpm lint` 会走进去:实测一次 6 文件 / 7 用例假红与 1115
errors,全部来自 10 月 4–5 日的旧树,而仓库自己的代码是干净的。两处各加一条
排除项(保留既有全部条目——vitest 的 `exclude` 是整体替换语义)。

顺带订正 eslint 配置里「点开头目录默认也不进」这处注释:ESLint 只默认排除
`node_modules`,`.worktrees/` 一直是显式列出的,`.delta/` 漏了。
2026-10-13 13:12:04 +08:00
Menghuan1918 751720f4f0 perf(git): 状态轮询基线降到 30 s 并按实测退档;编辑器 gutter 不再持有轮询
一次抓取是 `git status --untracked-files=all` 加两条全仓库 `--numstat`(4 个
进程)。在未忽略的大目录上(嵌套 node_modules、pnpm store——根锚定
`/node_modules` 盖不住子目录那种仓库)实测 59,631 条 / 9.24 MB / 0.131 s,
而 `GIT_STATUS_LIMIT = 2000` 是在整份输出产出、拼进字符串、切成五万多个对象
之后才截断的。三处一起收:

- **编辑器 gutter 不再持有轮询**:它此前把功能开关当作页签可见性传进共享
  store,而那个参数正是启动定时器的开关;原生页签 `keepMounted` 又让编辑器
  切走不卸载,于是打开过任何一个 `code` / `jsonl` 文件之后,整页生命周期都在
  每 2.5 s 跑一次那个扫描。现在订阅改为 `{ visible: active, poll: false }`,
  只在换文件或保存时各 `refresh()` 一次,页签不可见时连订阅都不建立。
- **基线 30 s + 按实测退档**:往返超 750 ms / 2 s / 5 s 依次退到 60 s /
  180 s / 停止自动轮询;tier 是最近一次耗时的纯函数,快响应自动回落,事件
  驱动刷新(暂存、提交、丢弃、保存、手动刷新)永远即时,也是恢复通道。
- **空闲轮询不再通知**:`notify()` 原先无条件自增 `slot.version`,而它就是
  `useSyncExternalStore` 的 snapshot,于是每个消费者每 tick 整体重渲染一次
  (文件树那一列逐行重算 git 状态也在其中),即便数据一字未变。
- **linked-checkout 清单改单命令计数**:变动页的 worktree 选择器每 30 s 为
  每个 checkout 跑一次完整 `status()` 只为读条目数,现为一条轻量
  `status --untracked-files=normal`。一处刻意的语义变化:未跟踪目录计 1
  (此前展开计入每个文件,且数字被 2000 上限悄悄截断)。

消费方 API 零变化;`FileViewerProps` / `ctx.betterSidebar` 均未动。文件树与
文件变动页的条目与配色语义不变,只是刷新节奏变慢。

测试:新增 `tests/git-status-poll.spec.tsx`(7 例,含「非轮询消费者不得启动
定时器」「空闲同结果不通知(snapshot 恒等)」「慢往返退档与快响应回落」);
`tests/editor-git-gutter.spec.tsx` +3;`tests/git-worktree.spec.ts` +1;
`tests/git-view-worktree.spec.tsx` 的计数重发布用例跟着新节奏推进假时钟。
判别性已逐条实测:回退空闲守卫、`poll` 归属、gutter 的 `poll: false`,
对应用例当场红。

设计、实测数据与普查后续项见
docs/plans/2026-10-13-git-poll-ladder-and-idle-notify.md。
2026-10-13 13:12:00 +08:00
Menghuan1918 62594a7f78 merge fix/file-tree-perf into dev(补:smoke 共享 gate 断言的类型修正) 2026-10-13 00:38:43 +08:00
Menghuan1918 0ba1b000d6 test(smoke): fs.trees 共享 gate 断言的转换改走 unknown(本地 invoke 把 value 标成 cwd 探针,直接转换不重叠) 2026-10-13 00:38:42 +08:00
Menghuan1918 e45b45e2b5 merge fix/file-tree-perf into dev(文件树:折叠链预加载与渲染共用 32 链上限;fs.trees 整批共享一个探测预算) 2026-10-13 00:37:58 +08:00
Menghuan1918 695379f183 docs(changelog): 文件树两处性能收敛的 Unreleased 条目(折叠链预加载上限 + fs.trees 探测预算) 2026-10-13 00:37:55 +08:00
Menghuan1918 4fe8b8a054 perf(filetree): 折叠链预加载与渲染共用 32 链上限;fs.trees 整批共享一个探测预算
核查用户列出的性能断言后,两处「真实存在」的放大被收敛(其余项按用户选择不动,
逐条结论与不做的理由见 docs/plans/2026-10-13-file-tree-perf-fold-preload-and-probe-budget.md)。

- 客户端:compactLoadTargets 改为从渲染根(cwd + expanded)沿 compactChain 下行,
  上限天然继承 MAX_COMPACT_DEPTH。此前它扫描所有已加载层:渲染在 32 停手,预加载
  却继续请求第 33、34… 节,每节一次串行 POST 加一次全树 render。顺带订正
  MAX_COMPACT_DEPTH 上方「健康缓存永不触及」的不准确注释(合法深链会触及;
  循环守卫是 compactChain 的 visited)。
- 宿主:新增 PROBE_BUDGET / ProbeGate / createProbeGate,listDirectory 增加可选
  gate 参数(只在真实 fs 探测外层取槽,缓存命中不花),fs.trees 每请求建一个 gate
  传给它的所有层。此前 64 路径 × 每层 32 路可同开约 2048 个 opendir;单层与
  fs.tree 单路径行为逐字不变。

测试:新增 tests/fs-tree-probe-gate.spec.ts(gate 在飞上界 / 排队任务抛错后释放且
FIFO / limit<1 夹紧;listDirectory 每个目录探测恰花一槽、缓存命中不花;三层共享
一个 gate 计 9 次);file-tree-compact(-fold) 新增「到上限即停」用例(把实现回退
即变红,判别力已实测);smoke 增加「一次 fs.trees 只建一个 gate」的路由级断言。
不动虚拟化、watch 提示与全局句柄、DirRow chain identity。
2026-10-13 00:36:19 +08:00
Atlas Zeng fc09a72f3f Merge pull request #919 from omdsh-dev/chore/issue-triage-board-sync
fix(skill): board-sync 清掉失效的继承优先级 + 认「dev 已修待发版」清单
2026-10-12 21:02:06 +08:00
Menghuan1918 49c5f088f6 Merge remote-tracking branch 'origin/dev' into chore/issue-triage-board-sync 2026-10-12 20:56:14 +08:00
Atlas Zeng f969e16f44 Merge pull request #930 from omdsh-dev/test/editor-host-render-budget
fix(filetree): 被丢弃的列表应答释放「加载中」占位(修 CI 上「文件树永远停在 Loading」的 flake)
2026-10-12 20:56:09 +08:00
Menghuan1918 ade04f8f5e test(editor-host): 渲染等待预算 10s→20s、套件时钟 35s/30s,失败时吐出证据
同一天的 CI 失败三次烧光 `waitForTreeRow` 的整个 10s 预算(断言在 10008/10025ms 报
failed),本机同文件只用 ~1s——原来的预算与诊断都不足以定位(这也是这次绕远路的原因)。

- `RENDER_WAIT_MS` 10s → 20s,受影响 describe 给 35s 时钟:断言仍先于测试时钟失败;
- 全局 `testTimeout` 15s → 30s(同一天 `tests/fs-watch.spec.ts` 在本机堆受限时撞掉
  15s 时钟,真 `fs.watch` + 150ms 去抖实际只需 ~1s);
- 等待超时时打印 names / fsTrees 调用与落地时刻 / DOM 片段,并再看 5s 区分「饿死但最终
  渲染」与「始终不渲染」——正是这份转储把根因指到了 FileTree 的占位回收上。

测试 hook:`treeAnswers()`(调用计数与落地时刻)与 `treeScript()`(按调用序号延迟/挂死,
供上面那条丢弃应答的回归用例使用)。
2026-10-12 20:50:29 +08:00
Menghuan1918 56e3855d34 fix(filetree): 被丢弃的列表应答必须释放它写下的「加载中」占位
根因(本机已确定性复现,见下面的用例):`loadLevels` 对非强制加载会先写一个
`{}` 占位(渲染即「加载中」行),而应答被世代守卫丢弃时(刷新 tick / 排除列表变化 /
卸载都会 bump 世代)**那个占位没人回收**。之后任何非强制加载都把「缓存里有条目」
当成已加载(注释里明确写着「空 `{}` 占位也算命中,避免重复请求」),于是这一层
再也不会被重新请求——子树就永远停在 Loading 行,直到下一次强制刷新或重挂。

CI 上的表现正是这个形状:应答都到了(`landedAtMs=[283]`)、`names=["tmp"]`、
DOM 是 `…tmp@fileLoading…`、之后 5s 一行都不出。

修法(只动这一条路径):
- 新增 `pendingRef`(path → 写下占位的世代),占位的**所有权**跟着请求走;
- 应答被丢弃时调用 `releasePlaceholders`:只回收**本次调用仍持有**、且仍是空占位的
  层(已有列表或错误的一律不动,丢弃的应答不得清空屏上的行),并**补发一次**该批请求
  (每次调用最多补发一次),让丢弃自愈而不是等下一次 tick;
- 应答正常落地时清掉所有权。

回归用例:`tests/editor-host.spec.tsx` 的「a listing dropped by a refresh tick does not
strand the level on Loading…」——首答延迟 300ms、tick 在飞行中到达使其失效、tick 触发的
强制重列人为挂死(谁都settle不了它)。去掉本修复该用例红(并打印上面那份现场),保留则绿。
2026-10-12 20:50:29 +08:00
Menghuan1918 b561bfeb3d fix(skill): 看板认「dev 已修待发版」清单,Done 不再被同步算回去
问题:看板的 Status 由「标签 + 是否有 open PR」推导,PR 一合并就变成「等待开发」;
手工改成 Done 会被下一次同步覆盖,verify 也会判它不符——2026-10-12 同步前有 7 条
(#826 #898 #899 #900 #914 #915 #927)正处在这个状态。

- 新增 references/fixed-pending-release.json(机器可读唯一来源),board-sync 读它把
  这些 issue 的 Status 钉成 Done;发版后清空对应号。
- references/taxonomy.md 补「dev 已修待发版」一节的收录标准与理由。
- 验证:dry-run 后实跑,verify: board items=263 expected=154 missing=0 mismatched=0
  multi-P-label=0 → OK(7 条 Done 未被算回)。
2026-10-12 17:58:22 +08:00
Menghuan1918 42caf090db docs(changelog): 多终端条目补上 issue #927 的链接(可追溯到原始报告) 2026-10-12 17:12:34 +08:00
Atlas Zeng de3231f861 Merge pull request #926 from eleven-lings/feat/bottom-terminal-multi-tab
feat(terminal): 底部工作台支持多个终端 Tab
2026-10-12 16:53:32 +08:00
Menghuan1918 1be21965f3 merge origin/dev into feat/bottom-terminal-multi-tab(#926 多终端 Tab:合上 dev 并修掉「新建终端」丢实例)
dev 侧(#924/#925 之后)把底栏终端的身份收敛成**一个值**:`view(sessionId, key,
contentId)` 的 key 与 contentId 同源,`bottomTerminalKey` 已被删除,`TerminalView`
与 `closeBottomTerminal` 都只看 `bottomTerminalContentId(run)`。冲突按「保留 dev 的
结构 + 把 instance 穿进去」解开:不再恢复那个重复的 helper,实例前缀拼在 run 后缀之前。

**并修掉一处会让多终端串台的缺陷**:`nextTerminalMeta()` 原来只回 `{ terminalRun: run+1 }`,
而 `patchTab` 是**整份替换 meta** —— 于是点过「新建终端」的 tab 会丢掉 `terminalInstance`、
掉回旧命名空间,两个都换过进程的 tab 撞在同一个 `…terminal-bottom#1` 上;宿主按
`(sessionId, key)` 记忆 model,两个 tab 会拿到**同一个 shell**。现在实例随 run 一起保留
(没有实例的旧 tab 仍然不长出实例,身份逐字节不变)。

测试:`tests/terminal-tab.spec.tsx` +3 判别性用例(实例跨 bump 保留 / 两个实例各自 #1
不撞 / 两个实例渲染出两个宿主终端)与关闭钩子的带实例断言;把 `nextTerminalMeta` 退回
旧写法即红(实测 2 failed)。设计文档标注「一个终端」的限制已放开,CHANGELOG 补条目。
2026-10-12 16:40:18 +08:00
Menghuan1918 77854af361 docs: 独立验证后的收尾(#915 条目事实性修正 + 补 #910/#911/#901 条目 + updateTab 的 JSDoc 合并)
独立验证(3 个未参与解冲突的 agent)在这批合入后抓出的问题:

- CHANGELOG #915 条目里「写回时保留该页签自己的拼写」与实现矛盾:记录写的是调用方
  给的新名(绝对拼写),保留旧拼写的是**改名标记**的 from(tree-mutations.ts:186-191)。
- #910 / #911 / #901 三条用户可见修复在本批合入时都没有 CHANGELOG 条目,补上(按合入
  顺序「新在上」:901 → 915 → 916 → 911 → 910)。
- #915 条目里「原生枚举没有进消费插件的公开面」措辞过强:本批确实新增了 3 个导出成员
  (NativePathTab / SidebarSurface.pathTabs? / @internal 的 nativePathTabs),改成
  「没有当成消费 API 宣传」。
- src/client/service.ts 的 updateTab 上叠了两个 JSDoc 块,TSDoc 只挂最后一块、解释
  sessionId 的那块成了浮空注释——合并成一块(原文档面)。
- 指南 §7 的 updateTab 签名补上第三个参数 sessionId?(该行此前就漏了)。

typecheck 干净,全量 2432 passed / 17 skipped。
2026-10-12 02:00:52 +08:00
Menghuan1918 8bfca968f4 merge docs/tier1-915-docs into dev(#915 的 CHANGELOG 条目 + 指南 §7 原生承载面行为说明) 2026-10-12 01:52:52 +08:00
Menghuan1918 db7216eac8 docs: 补 #915 的 CHANGELOG 条目与指南 §7 的原生承载面行为说明(#912 未带文档面)
- CHANGELOG:`### Unreleased` 置顶补 #915 条目(按 #912 的实际实现写;被取代的
  PR #917 那段里的 `ctx.betterSidebar.pathTabs()` / `store.reduceFor` / 「标题只在
  派生自文件名时跟随」三处说法与实现不符,未照搬)。
- 指南 §7:`updateTab` 的 JSDoc 补「写入在原生承载面上是稳的」(导航门控)与
  「文件树改名/删除调解覆盖原生页签」——AGENTS §5 要求 service.ts 的行为变更
  同批同步指南;§7 的接口块在 ```ts 围栏内,所以写成 JSDoc 续行而不是散文段。\n
2026-10-12 01:52:52 +08:00
Atlas Zeng b01f51fd62 Merge pull request #901 from UNscientific-9/fix/p1-draft-rename-encoding
fix: 草稿守卫按会话记账 / 折叠行重命名落链尾 / 16 位小端数据不再当文本(另附 dev 新增代码精简)
2026-10-12 01:49:42 +08:00
Menghuan1918 a8bb438028 merge origin/dev into fix/p1-draft-rename-encoding(#901 合上 dev 的 #911/#916/#912 与流式/任务批)
#912 把 src/client/tree-mutations.ts 整份重写(两承载面改名/删除调解),#901 的那处
改动落在它的重写区里,冲突按「取 #912 的重写 + 把 #901 的意图重新表达为关闭时传本页
座位自己的 scopeSessionId」解开:草稿注册表按 sessionId::tabId 记账,而原生页签的
编辑器 scope 来自文件地址(scopeSessionId),传座位 id 会在座位≠scope 时静默放行、
把未保存草稿丢掉。
2026-10-12 01:41:08 +08:00
Atlas Zeng 963bef89f0 Merge pull request #912 from UNscientific-9/fix/native-tab-path-reconcile
fix(tabs): 改名/删除的页签调解覆盖右侧栏原生页签,并让改名不再重载文档
2026-10-12 01:40:02 +08:00