Commit Graph
1261 Commits
Author SHA1 Message Date
Menghuan1918 2b8a4da569 chore(release): prepare alpha.0 with latest dev fixes 2026-10-17 12:02:59 +08:00
Menghuan1918 6417547bb5 merge origin/dev: include Context diagnostics and graph layout fixes
# Conflicts:
#	CHANGELOG.md
2026-10-17 11:52:48 +08:00
Menghuan1918 24d2032de1 merge fix/git-graph-fill-height: fill available Git graph height 2026-10-17 11:36:53 +08:00
Menghuan1918 38d94bdb98 fix(git): let commit graph fill available sidebar height
Replace the 460px viewport cap with flex allocation. Bound the graph section minimum so long history scrolls internally instead of stretching the outer list. Verify tall and narrow panes, preview selection, folding and long Changes lists in the mounted host.
2026-10-17 11:33:55 +08:00
Menghuan1918 0c7868cc07 Merge Context diagnostics integration into dev 2026-10-17 02:22:07 +08:00
Menghuan1918 93c43b0ac9 feat: add optional Context diagnostics navigation
Use an activation-scoped Cordis controller for session, agent, and job-owner entries. Reuse native Context tabs, cancel stale navigation, and close source overlays without canceling pending requests.

Verify optional capability lifecycle, truthful job ownership, three real dsh-context configurations, and the existing mount regression suite.
2026-10-17 02:20:53 +08:00
Menghuan1918 57722809ed merge chore/dsh-0.2.1-alpha.5-adaptation: support alpha.5 2026-10-17 02:12:44 +08:00
Menghuan1918 4ebd3e9bdd chore: adapt sidebar to DSH 0.2.1-alpha.5 2026-10-17 02:12:44 +08:00
Menghuan1918 693b4850e3 merge chore/release-0.27.0: prepare Git page release 2026-10-16 21:57:02 +08:00
Menghuan1918 b5fec8d9a2 chore(release): prepare 0.27.0 Git page integration 2026-10-16 21:57:02 +08:00
Menghuan1918 55a0fd019d merge test/isolate-scroll-fixture: avoid stale shared repositories 2026-10-16 21:49:48 +08:00
Menghuan1918 3e9eacf0cb test(e2e): isolate scroll retention fixtures per run 2026-10-16 21:49:48 +08:00
Menghuan1918 612cea242f merge fix/git-scm-layout: restore selected Git row layout 2026-10-16 21:46:54 +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 aacb2b247e docs: 移除 sidechat compaction-tail seed 设计文档 2026-10-16 21:17:13 +08:00
Menghuan1918 af2aeb2889 docs(agents): AGENTS.md 收敛为规则清单(67KB → 10.8KB),深度参考移入 docs/
- AGENTS.md 只留每次都要遵守的规则与索引:§0 分支模型、§1 硬约束、§2 挂载
  门禁与钉版禁忌、§3 版本适配与抬基线清单、§4 发版、§5 开发规则、§6 去哪找
- 原 §3.4 宿主契约第 1–12 条与 0.1.5–0.1.7 沿用至今的约束移入
  docs/host-contracts.md,**编号保持不变**——代码 / 测试 / 文档里既有的
  「AGENTS.md §3.4 第 N 条」与 `§3.10` 引用仍能命中
- 删掉测试地图长清单与 CI 取证叙事:契约本就在各 spec 头注释、docs/plans 与
  CHANGELOG 里,AGENTS.md 只留索引与那几条会真咬人的跨平台规则
- 订正过期事实:testTimeout 30s、chunk 名真源 CHUNK_NAMES、markdownTextProps
  渲染点、minimumReleaseAgeExclude 所在脚本、0.1.7 线最后支持版 v0.22.1
2026-10-16 18:35:51 +08:00
Menghuan1918 f73e6632c3 chore(changes): 清掉第三镜头的残留样式(.lens / .lens[hidden])
图谱区改挂 Git 镜头后这两条选择器没有消费者;行为无变化。
2026-10-16 17:41:33 +08:00
Menghuan1918 71c8243a2b docs: Git 页面合并车的 CHANGELOG 段、融合设计文档与接入文档/AGENTS 同步
- CHANGELOG 顶部新增 Unreleased 段(11 个 PR 的逐条说明与贡献者署名);
- 新增 docs/plans/2026-10-16-git-page-vscode-scm-merge.md(决策 D2/D5、被剔除的夹带、
  有意偏差、守住的不变量、未做清单、过程中修掉的三处 CI 红);
- guide:页签名、Source Control 视角、changes.ops 的 wait 长轮询口径、guide 条目名;
- AGENTS §5/§6:内置 tab 名与测试地图补入本批新增/改写的 spec。
2026-10-16 17:31:41 +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 6586c08bbc test(changes-ops): 对齐空窗长轮询的契约断言(#885 收尾)
- tests/unbounded-caches.spec.ts:基线拉取不再传 0 而是不传游标(0 会丢掉 seq 0 的真实事件),
  并断言 primed 之后第 4 参 wait=true、基线 false;
- tests/changes-ops-route.spec.ts:用例名/注释英文,补一条 PTC 事件对穿透路由的断言,subCallId 用 ToolCallId;
- api.ts / ChangesTab.tsx / ops-stream.ts 的说明改回英文行文(行为不变)。
2026-10-16 16:54:41 +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
Menghuan1918 49309251f3 merge pr-968 (#968 feat(changes): 页签名「文件变动」改为「Git」) into dev(@vlln) 2026-10-16 16:31:15 +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 b5e6d4daac docs(sidechat): record the round-5 atomic-drop rework and the real-data regressions it fixed 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 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
vlln ab7db3a313 docs(git-graph): 设计文档与 README 章节
`docs/plans/git-graph.md` 记录取舍:为什么第一版只读、为什么分页用不透明游标
而不是服务端游标缓存、为什么**没有**颜色图例(颜色属于泳道而不是分支,泳道可以
比创建它的分支活得更久,图例会暗示一种不存在的一一对应)、连线与徽章的配色
规则、底部面板固定的三个标签、以及 hover / 点击两档信息密度的分工。

README 中英双语各加一节 Git Graph:顶部选择入口、不 checkout / 不 fetch、
单行提交行的构成(徽章含义、✓ 表示当前分支)、统一底部面板的三个标签,以及
资源上限与分页过期的行为。
2026-10-15 20:44:33 -07:00
vlln 3edaa5aee8 test(e2e): 图谱在真实宿主上的挂载冒烟
在真实 `dsh web` 上建一个带合并的真实仓库,走完整链路:`git.graph` 路由
→ 打开 Git 页并切到 Git Graph → 渲染出合并历史 → 点合并提交(详情卡片里是
完整 hash 与两个父提交短哈希,且没有已删除的「与第一个父提交比较」提示)
→ 分支下拉框筛选后历史收窄。同时断言全程无 pageerror,且仓库的 HEAD / refs /
status 在读图前后逐字不变——这一条是「只读」最硬的证据。

选择器都锚定到具体容器:短 hash 在(隐藏的)Git 视角里也有,纯文本匹配会命中
隐藏元素;分支名 `main` 在下拉框的 option 里也有一份。
2026-10-15 20:44:33 -07: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 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