Commit Graph
819 Commits
Author SHA1 Message Date
Menghuan1918 b5fec8d9a2 chore(release): prepare 0.27.0 Git page integration 2026-10-16 21:57:02 +08:00
Menghuan1918 0ba7edf444 fix(git): keep selected change rows inside their groups
Restore selection declarations removed with logRow during graph integration. Dangling selectors had inherited absolute positioning and borders from indent guides. Add parsed CSS and mounted browser regression coverage for staged, unstaged and conflict rows.
2026-10-16 21:45:57 +08:00
Menghuan1918 e523f832cc merge pr-964 (#964 侧边对话子会话改为从最后一次 summarizing compaction 起种,不再全量复制父日志) into dev(@NolanHo) 2026-10-16 21:27:48 +08:00
Menghuan1918 f73e6632c3 chore(changes): 清掉第三镜头的残留样式(.lens / .lens[hidden])
图谱区改挂 Git 镜头后这两条选择器没有消费者;行为无变化。
2026-10-16 17:41:33 +08:00
Menghuan1918 88ded478de merge pr-969 (#969 feat(git-graph): 只读提交图) into dev(@vlln)
融合(D5):#969 的图谱引擎作为 Git 镜头内的「提交图」区上线,不再新增第三个镜头。
- 保留:src/git-graph.ts(有界路由 + graph-stale/graph-limit)、graph-layout.ts、
  graph.module.css、CommitDetails、DiffPane 的 PaneTabStrip 与 details/content/diff 分签、
  hover 卡片、引用徽章、分支筛选、无限滚动、e2e 与设计文档;
- 落位:GitGraphLens → GitGraphSection(挂在 GitLens 的 Graph 区,目标读镜头自己的
  仓库/worktree 选择,不再自持选择器);行右键接回 #944 的提交菜单(查看/复制/revert/cherry-pick);
- 去掉:第三镜头与 changesGraphLens 键、#944 的 GitGraph.tsx(及随之无消费者的
  log 行样式与 historyLoadError/changesNoHistory 词典键);
- 镜头常驻保留(hidden 切换):Graph 的滚动/选中、Changes 的展开与草稿切走不丢,
  同时 store 槽位与轮询按「可见 + 在屏」分别门控(切回不闪 loading);
- 两套重写过的测试按新契约对齐(底部面板分签、图谱区与 Git 镜头的关系、图行/历史断言)。
2026-10-16 17:30:44 +08:00
Menghuan1918 40ed740f3a merge pr-944 (#944 feat(git): Git 内容区改为 VS Code Source Control 结构) into dev(@hairyf)
冲突解决(按 D4 与仓库现役不变量):
- status() 改为 porcelain v2(branch/upstream/ahead-behind/detached/operation 一次读回),
  但保留 dev 的行/字段上限、pathspec 化 numstat 与 #909 的分侧计数;v2 记录遍历抽成
  porcelainV2Tokens,状态解析与 pathspec 提取共用同一份字段知识;
- GitLens 的 Merge/Staged/Changes 三组取 #944,两组各读自己那一侧(#909),
  Merge 组不印行数(冲突不是行数故事,也不许把某一侧当「这个数」);
  sideEntries 保留(每组只读自己那一半的 XY 字母);
- ChangesTab 保留 #939 的官方 Tabs 外观与 a11y 包装、刷新按 #944 只留给本轮文件镜头;
- 测试:git.spec 导入取并集、rmSync 清理改回 removeTree、smoke 的 branch/detached 断言
  按 porcelain v2 语义改写,其余用例按新契约微调(band 顺序、changesOps 第 4 参 wait)。

剔除夹带(D4):.agents/skills/handle/SKILL.md、eslint/vitest 的 soruce/vscode 忽略项、
webRuntime→connection.requestRejection 栅栏与 ownEntryId 放宽(index.ts / context-types.ts
取 dev)、栅栏类测试桩与注释一并回退,栅栏归属留给 0.2.1 兼容批。
2026-10-16 17:14:06 +08:00
Menghuan1918 172ca849dd fix(git): BFS 发现根与 rev-parse 的路径拼法统一(#607 收尾)
macOS 的 tmpdir 是软链(/var → /private/var),Windows 上 join 出的是反斜杠而
`rev-parse --show-toplevel` 用正斜杠:两种拼法都会让同一个检出在仓库选择器里出现两次,
CI 的 canonical() 断言先红。发现根现在走 realpath +(Windows 才做的)分隔符折叠。

在 5b6f7319 的 ci-windows 上实测到 5 条 git.spec.ts 失败(全是分隔符)。
2026-10-16 16:54:39 +08:00
Menghuan1918 bd65b41e9d merge pr-885 (#885 fix: 减少 changes.ops 空窗重复请求) into dev(@wang-kaopu)
冲突解决:保留 #885 的路由抽取(src/changes-ops.ts + 'changes.ops': changesOps),
把 dev 的现役内容搬进新模块:PTC 四种事件类型、-1 游标下限、会话/持久化双读与 4000 窗口;
index.ts 的 import 块取 dev(只补 ServerResponse),订阅回调按仓内惯例restate 最小结构切片。
测试:路由 spec 加一条 PTC 事件穿透断言,用例名与注释统一英文。
2026-10-16 16:44:20 +08:00
Menghuan1918 db2a87f360 merge pr-921 (#921 fix: 修复 PTC 模式下本轮文件列表为空) into dev(@wang-kaopu)
冲突解决:extractFileOps 的文档注释与实现合并「PTC 事件对 + 会话 cwd 路径解析」两半,
参数解析抽成 ptcArgs(PTC 的 arguments 已是对象);测试保留 PTC 四例并按 #940 去掉分组名。
host 路由 / ops-stream 头注释恢复英文行文(行为不变),README_EN.md 保持删除、README.md 取 dev。
2026-10-16 16:41:11 +08:00
Menghuan1918 bb23b47fa5 merge pr-886 (#886 fix(changes): 本轮文件按会话 cwd 解析完整路径) into dev(@wang-kaopu)
冲突解决:README.md 取 dev、README_EN.md 保持删除、CHANGELOG 里误落 v0.25.0 段的条目删掉(发版段统一在收尾批处理);
#886 的用例去掉 groupByFile(#940 已删除该分组函数),改断言解析后的完整路径。
2026-10-16 16:39:50 +08:00
Menghuan1918 9f630d1618 merge pr-940 (#940 fix(changes): 本轮文件操作改为平铺行) into dev(@hairyf)
冲突解决:README.md 取 dev(PR 基于拆分前的旧中英双 README,改动目标已不存在),
README_EN.md 保持删除;guide 的 usage: git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--no-lazy-fetch]
           [--no-optional-locks] [--no-advice] [--bare] [--git-dir=<path>]
           [--work-tree=<path>] [--namespace=<name>] [--config-env=<name>=<envvar>]
           <command> [<args>]

These are common Git commands used in various situations:

start a working area (see also: git help tutorial)
   clone      Clone a repository into a new directory
   init       Create an empty Git repository or reinitialize an existing one

work on the current change (see also: git help everyday)
   add        Add file contents to the index
   mv         Move or rename a file, a directory, or a symlink
   restore    Restore working tree files
   rm         Remove files from the working tree and from the index

examine the history and state (see also: git help revisions)
   bisect     Use binary search to find the commit that introduced a bug
   diff       Show changes between commits, commit and working tree, etc
   grep       Print lines matching a pattern
   log        Show commit logs
   show       Show various types of objects
   status     Show the working tree status

grow, mark and tweak your common history
   backfill   Download missing objects in a partial clone
   branch     List, create, or delete branches
   commit     Record changes to the repository
   history    EXPERIMENTAL: Rewrite history
   merge      Join two or more development histories together
   rebase     Reapply commits on top of another base tip
   reset      Set `HEAD` or the index to a known state
   switch     Switch branches
   tag        Create, list, delete or verify tags

collaborate (see also: git help workflows)
   fetch      Download objects and refs from another repository
   pull       Fetch from and integrate with another repository or a local branch
   push       Update remote refs along with associated objects

'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.
See 'git help git' for an overview of the system. 行合并「平铺措辞 + 下划线 Tabs 说明」;
editor-host.spec.tsx 的 RENDER_WAIT_MS 注释保留 dev 的 CI 史,并补记 PR 的夹具泄漏结论。
2026-10-16 16:38:37 +08:00
Menghuan1918 5b6f7319f9 merge pr-909 (#909 fix(changes): 变更面板两侧行数不再相加,各分组各读自己那一侧) into dev(@UNscientific-9)
冲突解决:删除 addLineCounts,状态读数改为分侧(staged/unstaged 各自一张表),
保留 dev 的 pathspec 化 numstat 读取(--literal-pathspecs + 原路径 + 行/字段上限)。
同批带上 #607 落地后暴露的两处适配:
- discoverRepoRoots 的 BFS 发现根改走 realpath(macOS tmpdir 的 /var → /private/var 别名,
  否则 rev-parse 的根与扫描根是同一仓库的两种拼法,dev 的 canonical() 断言当场红);
- tests/git-worktree 的 numstat pathspec 用例按分侧形状断言(合计仍为 +3/−0)。
2026-10-16 16:35:59 +08:00
Menghuan1918 15665f1ff3 merge pr-607 (#607 feat(git): 工作区根为仓库时仍探测并展示子目录独立仓库) into dev(@iasiv5) 2026-10-16 16:33:40 +08:00
Menghuan1918 f132c69cb0 merge pr-827 (#827 fix(git): 自动应答 dubious ownership 守卫,单命令注入 safe.directory) into dev(@yanzhaohui1999)
冲突解决:保留 dev 的 runGit 三道护栏(8 MiB 输出上限 / maxNulFields 行数上限 / core.quotePath=false),
把 #827 的 spawnGit + safe.directory 重试叠在其上;GIT_ENV 取并集(GIT_OPTIONAL_LOCKS=0 + LC_ALL=C)。
不复活已被 ebc5d0b6 删除的 runGitRaw(无调用者)。
2026-10-16 16:33:38 +08:00
Menghuan1918 1de5e44394 merge pr-939 (#939 fix(changes): 镜头切换器改用官方 Tabs 样式) into dev(@hairyf) 2026-10-16 16:31:17 +08:00
NolanHo 37e0354d15 fix(sidechat): drop a command/done whose citation fell in the dropped span (round 5, F2)
The round-5 final report pinned a real bad-seed path on cc11ce4 and
verified my in-flight atomic drops did not cover it: a command/done
whose run SURVIVES while its numeric sourceEventSeq cites an earlier
NON-command event in the dropped span kept the parent seq — a stale
citation the host's commands invariant rejects (the contract: the
citation names an earlier non-command event, never the run). Their
real-data oracle found three such seeds among the forty genuinely
trimming production sessions.

The pre-decision now drops the done when either its run's commandId or
its cited source seq is not in the emitted set (the run staying behind
is legal — an open command), and rebaseEvent's runtime belt returns
DROPPED for an unmappable citation instead of leaving the parent value.
The spec's both-kept fixture is rewritten against the host contract:
unique commandId per run and a citation pointing at the user message,
asserting the remapped citation names a non-command event. A mutation
that removes the droppedGroups filter reddens the mid-keep-group case,
so the atomic-drop chain and the bracket gate now have an in-repo pin.
2026-10-16 16:14:41 +08:00
NolanHo f320cdee83 fix(sidechat): drop grouped records atomically and honor the host's optional removedCount (round 5)
The round-5 delta review and the real-data re-run exposed two v5
regressions that disabled the optimization exactly where it matters.

First, the new bracket gate fell back on real multi-group sessions: a
mid-keep compaction group's summary cites nodes a later group
re-shadowed, so record-level dropping stranded its successful
compaction/end and the gate rejected the whole tail — the deployment's
main session forked at 9,077 ms with seed 35,993 (the full copy). The
fix is the reviewers' other option, now data-backed: decide the
emitted-seq set BEFORE emission and drop unmatched groups ATOMICALLY —
a compaction bracket goes as a whole, a command/done losing its run
goes alone. The fuzz suite recovers from 108 to 129 clean trims per
3000 cases (every one passing the real session, compaction, and
commands invariants plus the real inbox projection), and the round-4
cascade counterexample flips from fallback to a clean trim.

Second, v5 treated a missing removedCount as invalid, but the host
contract makes it optional and defaults it to 0 — the host's own writer
omits it for pure inserts, 54% of production splices are like that,
and 38 of 89 real compaction sessions (including the e2e main session)
fell back purely on this. Restored the ?? 0 default while keeping the
rest of the host-fold strictness.

The round-4 spec case is rewritten against the host's chained-replace
semantics (the consumed group swallows the surface span as it exists
at ITS fold moment), which turned it from an empty test — the fixture
could not fold at all, so it pinned nothing — into a real pin: the
atomic drop trims with the earlier group's records gone entirely.
Final second-instance e2e on the real main session: 953 ms, seed
3,457 (10.4x), and a cold-context answer that only the compaction
summaries could contain.
2026-10-16 16:14:41 +08:00
NolanHo a106e1964e fix(sidechat): keep grouped records atomic and pin them with host-oracle tests (review round 4)
Round 4 (two fresh reviewers, pinned to both 657dcd5 and 196fa11)
could not falsify the core equivalence (2100 generated shapes, 113
trims all passing the real session invariant, Session.create, the real
durable-inbox projection, and node-by-node deriveEventMessage wire
comparison; every non-trim byte-identical to the legacy full copy) but
both votes converged on one root cause: host GROUPED records were
split by record-level dropping. A kept compaction group could lose its
summary to the dropped span and strand a successful compaction/end the
host's compaction invariant companion rejects; a command/done could
outlive its command/run the commands companion rejects — invisible to
all three existing self-checks. The inbox fix from the e2e (196fa11)
was verified: the positional durable-inbox projection is the layer the
host rejects at, and the walk-back plus inboxSplicesValid hold.

v5: bracketsValid mirrors the host's grouped-record rules (a successful
compaction/end requires its compaction/summary; a command/done requires
its prior command/run) so a split group falls back to the full copy;
command/done.sourceEventSeq remaps onto the rebased run;
expectedFirstKeptTurn is derived from the skeleton's actual turn/start
(out-of-turn heads no longer renumber against a phantom turn 1); and
inboxSplicesValid matches the host fold's strictness (known targets,
numeric start/removedCount, array inserts, string ids). The spec's
oracle now uses the host's own deriveEventMessage so a projection bug
cannot hide from the equivalence cases, and two new cases pin the
round-4 shapes (same-turn double compaction, command bracket split and
its both-kept control with a remapped sourceEventSeq).
2026-10-16 16:14:41 +08:00
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 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
vlln a64f5cd8e9 feat(git-graph): 图谱视图与统一的底部面板(详情 / 内容 / 差异)
**图谱视图**(`GitGraphLens`):分支下拉框只筛选历史,不做任何写操作;提交行
是一行 28px——泳道连线 + 引用徽章 + 标题。徽章带图标(本地分支 = 分支图标、
远程跟踪分支 = 地球),`HEAD` 不单独成徽章,而是折叠进当前分支的徽章里做前置
✓;徽章的颜色就是它所在车道的颜色,和连线、圆点走同一个五色映射。行上不再
有短 hash 与作者时间:hover 350 ms 弹一张中等密度的卡片(标题、徽章、作者·
相对时间、短 hash + 绝对日期),点击后看到的「详情」才是完整信息(完整 hash、
父提交、Markdown 正文)。列表到底自动加载下一页(IntersectionObserver +
在飞守卫),并保留手动按钮作为兜底。

**底部面板**:三个视角共用同一个可拖拽区域,标签集合**固定**为
`提交详情 / 内容 / 差异`,不随上方视角或选中项变化;没有内容的标签显示空态
(未选择提交 / 读取没有差异 / 此视图暂无内容)而不是消失——此前按选中项推导
标签集合,同一个面板看起来像三个不同的面板。选择、高度、激活标签都持久化。

**内容视图**:操作记录(read 的带行号源码;md/html/pdf 用插件自己的渲染器)
与 git 工作区文件(`fs.read` 读文件本身,二进制/超大走既有下载面板)并列。
读取是懒加载的:只为看 diff 打开文件时不会去读整个文档。md 默认渲染,html
默认源码、点了才渲染 iframe(沿用「选中不自动加载 iframe」的沙箱契约)。

**配色**:五个色槽全部用状态色令牌(business/success/warn/error + 次级灰)。
原来槽位 0 用 `brand-primary`,实测在深色主题下是 rgb(15,17,21),主线几乎
不可见——状态色是给细线和小字设计的,两种主题下都能读。

顺带:Git 视角把当前仓库 / 工作树报给父组件(`onTargetChange`),图谱与预览
才能跟着同一个目标走。

测试:`tests/git-graph-ui.spec.tsx`(19 项:请求时机、错误与重试、分页游标、
竞态与中止、行结构、HEAD 折叠、hover 卡片、自动加载)、`tests/changes-tab.spec.tsx`
(固定三标签在各视角一致、内容视图懒加载、箭头键在标签间移动)、
`tests/markdown-surface.spec.tsx`(内容视图里的 markdown 链接认领)。
2026-10-15 20:44:33 -07:00
vlln ff373c81ed feat(git-graph): 泳道布局与连线几何
`layoutGraph` 把「子先于父」的提交前缀排成泳道:首父尽量继承父提交的车道与
颜色,新分支与断开的 tip 单调分配色号,空闲车道复用但活着的车道永不平移
(跨分页每一行逐字不变,宽度与悬空边也一样)。

连线几何单独放在 `edgePath` 里,一个弯只拐一次,并且拐在哪儿决定了每条线的
颜色是否统一:

- **开启新线的边**(合并提交的第二父)从节点水平出线、圆角拐进自己的新车道;
- **并入既有线的边**(分叉收尾)沿**自己**的车道一路向下,再在行边界横切进
  目标车道——反过来画就会把这条分支的颜色涂到它并入的主线上(实测报过
  「红线上仍然有一段绿」);
- 横切段的中心放在行边界上方半个描边宽(`STROKE_INSET`):行是后绘制的兄弟
  元素,溢出行外的半条描边会被下一行的背景吃掉,实测 8× 像素扫描只有 0.75px
  (正常 1.5px),内缩之后下边缘正好落在边界上,与下一行的竖线无缝相接。

布局还给每条出边记了 `join` 标记(这条边是并入还是开启),颜色与几何都由它
决定;同一条出边不会在目标车道里留下垂直线段。

测试:`tests/graph-layout.spec.ts` 覆盖空图 / 孤立根、线性历史的稳定颜色、
合并只与共同祖先汇合、octopus 与重复父提交、断开 tip 不接顺路车道、任意
分页边界逐行稳定、冻结输入与调用间无共享状态、随机 DAG 的连续性走查,以及
上面三条几何契约(含「同一行同一车道不得出现两种颜色」的全组合断言)。
2026-10-15 20:44:33 -07:00
vlln 1508487442 feat(git-graph): 只读提交图的读取器与路由
新增一条 `git.graph` 路由:本地分支、远程跟踪分支与 HEAD 的提交图,纯读取
(不 checkout、不 fetch、不改任何 ref),沿用 Git 视角当前选择的仓库 / 工作树。

读取是有界的,任何一项超限都明确报错而不是悄悄截断或拖垮宿主:

- 每页最多 200 条(默认 50),游标偏移最多 10,000,分支最多 1,000;
- 每个 git 进程 10 s 超时、输出 8 MiB 上限;
- 历史按「钉住的 tip OID 集合」做 `--topo-order` 走查,分页游标是不透明字符串;
- 响应带快照指纹:分页期间 refs 变了就返回 `graph-stale`,客户端重取第一页,
  绝不把两份历史拼在一起。

错误码单独建了两条(`graph-stale` / `graph-limit`)并映射到 409 / 400:共用的
Git 错误映射会把它们压成通用的 `git-error`,客户端就失去了「游标过期、请刷新」
这个唯一可区分的信号。

测试:`tests/git-graph.spec.ts` 用真实仓库覆盖合并父提交、分支装饰、完整
message 与稳定分页,refs 移动 / 换筛选条件导致的过期,以及选中容器仓库与
linked worktree 的 HEAD;`tests/smoke.spec.ts` 新增一条路由级用例,钉住
「按选中的仓库与工作树路由、陈旧游标映射成 409」。
2026-10-15 20:44:33 -07:00
vlln 1718d2bdfa feat(changes): 页签名「文件变动」改为「Git」
这个页签装的就是仓库视角(暂存 / 提交 / 历史 / 工作树),「文件变动」这个名字
没有把它和文件树区分开;改成「Git」后一眼能认出这是 Git 面板,也和里面第一个
镜头名对齐。21 份词典里的页签名是同一个语言中立的值,一起改。

- README 中英双语的徽章、能力表与特性条目同步(顺带把图片 alt 也改成 Git,
  否则无障碍名还在念旧标题)。
- `tests/locales.spec.ts` 里那条「切换 zh 后读到中文」的断言换了个键:
  `changes` 现在是语言中立值,两种词典相同,拿它证明不了语言已切到中文,
  改用 `explorer`(资源管理器)这个仍然分语言的键,断言意图不变。
- `tests/builtins.spec.ts` 新增一条页签标题断言,把这个名字钉住。
- `tests/e2e/tree-scroll.e2e.ts` 的页签选择器改走宿主的 tab strip
  (`[data-dockkit-strip] [role="tab"]`)而不是纯文本匹配:页签名变成 "Git"
  之后,页签内部的镜头切换器上也有同一个词,纯文本过滤会数出两个元素。
2026-10-15 20:19:35 -07: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 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
iasiv5 d311798565 feat(git): 有界深度 BFS 扫描,发现二/三层嵌套的子目录独立仓库
v1 只扫描 cwd 下一层目录,且每个子目录用 `git rev-parse --show-toplevel`
解析——该命令只沿父目录向上找 toplevel、从不向下探测,因此复合工作区根
目录下嵌套两层及以上的独立仓库(如 group/project、group/project/vendor-lib)
结构性不可见。

将一层扫描替换为有界深度 BFS:

- 新常量 DISCOVERY_MAX_DEPTH = 4(BFS 层数):检出深度 = 层数 − 1 = 3,
  覆盖三层嵌套;第 4 层 frontier 只收集、不再展开,成本被深度 ≤ 3 的
  目录数约束。
- 每个访问目录只做一次 readdir,以 dirent 的 `.git` 存在性判定是否为
  仓库(目录 / 文件 / symlink 三态,覆盖 worktree 与 submodule 的 `.git`
  文件形态),子目录探测零 git 子进程——#369 那种"数百个 git 子进程
  串行卡死面板"的模式结构上不可能回归。
- 发现 .git 后仍继续下钻,非 submodule 的嵌入仓库(repo 套 repo)同样可见。
- 跳过隐藏目录、symlink 目录与 node_modules;每层保留 DISCOVERY_LIMIT
  上限;pathIdentity 去重不变。

典型复合工作区(访问深度 ≤ 3 目录约 336 个)实测全部仓库根检出耗时约
12–17ms。
2026-10-14 06:19:57 +08:00
iasi 19320814c4 feat(git): discover root and child repos when workspace is also a git repo 2026-10-14 06:19:57 +08:00
hairyf 812f1e9e70 fix(git): stage with the plus glyph and restore the tree indent guides
The per-row and per-directory stage action drew the unstage minus in every
group (vscode splits these as $(add) / $(remove)), and the SCM tree lost the
indent guides the pre-SCM nested tree drew. Staging rows now carry the host's
Plus, unstaging rows the minus, and every level above a row paints its 1px
border-l1 hairline in the same 12px column as before.
2026-10-14 00:09:47 +08:00
hairyf 98a5cb36c4 fix(git): let the remote action error be dismissed
Git's stderr for a rejected push is a screenful of help text that grew the docked footer and had no way out until the next action. The error now keeps its full height and carries a dismiss control.
2026-10-14 00:01:17 +08:00
hairyf 5efc7beae0 Merge remote-tracking branch 'origin/dev' into feat/git-scm-941
# Conflicts:
#	eslint.config.js
2026-10-13 23:19:26 +08:00
hairyf 4e1056fe66 fix(git): drop the redundant untracked note, square the count pill, pin the footer
The U badge already says a row is untracked, so the extra 新文件 note is a second label for the same fact; git never diffs those rows and the binary mark still covers blobs. The group count pill now takes the kit's sm control radius (--dsw-radius-sm) instead of a 20px circle. The branch/sync footer keeps its flex docking and is additionally sticky bottom:0, so a host tab body that scrolls the whole tab cannot carry the branch control off the bottom of the pane (#941).
2026-10-13 23:13:00 +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
hairyf 228b753ad2 fix(git): finalize reviewed SCM groups and scope-safe actions 2026-10-13 22:42:16 +08:00
hairyf 0f9472b57f fix(host): resolve settings namespace for file-mounted plugin 2026-10-13 22:41:06 +08:00
hairyf 428347da13 fix(host): use native connection admission for HTTP and WebSocket routes 2026-10-13 20:37:43 +08:00
hairyf f0ce77b401 feat(git): replace Git interior with SCM changes and parent graph 2026-10-13 20:36:55 +08:00
hairyf 403a43cadc fix(changes): space session rows and isolate editor CI fixtures 2026-10-13 16:42:50 +08:00
hairyf 3a1cf3d4b7 fix(changes): flatten session operation rows 2026-10-13 16:18:07 +08:00
hairyf 872a975e15 fix(changes): reuse official conversation Tabs styling 2026-10-13 15:49: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 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