Repository navigation
v1.6.1 — Performance, Robustness & DSH 0.2.2 Alignment
中文更新说明
本次 v1.6.1 聚焦于 60fps 交互流畅度、DSH 0.2.2 宿主源码契约对齐、执行稳健性、长期内存/磁盘卫生与后端模块化拆分,零破坏性变更。
性能与渲染优化
- 精确面板可见性检测 & 折叠零轮询:对齐 DSH 0.2.2
keepMounted机制,通过[data-dockkit-content]的aria-hidden/inert+MutationObserver+IntersectionObserver,在折叠右侧边栏、切换 Tab 或切换会话时完全暂停轮询,展开瞬间 0ms 唤醒。 workspaceFiles.stat优先探测:稳态轮询优先调用轻量stat比对元数据指纹,文件未变动或不存在(workspace-file/not-found)时 0 次read传输与 0 次JSON.parse。- 60fps 拖拽合帧与零监听器抖动:拖拽事件收敛为单次
requestAnimationFrame合帧并在松手时按实时坐标重算框选/拖线落点,消除高频指针抖动与快速甩手误差;平移期间开启 GPU 合成层willChange。 - 渲染热点隔离:图拓扑衍生计算通过
useMemo缓存;运行计时拆入独立组件LiveElapsedText;saveDoc250ms 防抖并保护未落盘编辑时间戳与首次挂载不污染localStorage。
DSH 0.2.2 契约对齐与执行稳健性
- 根治条件节点
stopReason: 'error':对齐 DSHSubagentResult.diagnostic真实错误字段;当minimal条件节点直接输出严格合法的 JSON 判决而未调用structured_output工具导致宿主改写completed → error时,第 1 次尝试即直接救援成功,零额外重试耗时。 - 上游超长输出头尾裁剪:
clipUpstreamOutput对超长上游输出保留头部结论与尾部收尾/报错并折叠中间日志,内置 UTF-16 代理对边界保护(不劈断 Emoji/生僻字)。 - 只读节点瞬态错误自动退避重试:仅对
minimal/condition只读节点在429/502/503/504/超时等瞬态错误时执行 1 次可中断退避重试(响应AbortSignal零僵尸),绝不自动重试可写standard节点。 - 原子写入与并发/输入防护:
saveStore、publishCanvas、publishRunState全部升级为唯一临时文件原子写入(writeFileAtomic);新增单会话executePlan重入互斥锁、运行/等待 Lead 拍板期间禁止自动同步冲掉进度、中文 IME 选词Escape防误关弹窗、sessionId文件名安全清洗,以及更清晰的fromNodes/canvas_generate/canvas_patch输入校验与警告。
长期卫生与模块化
- 后端内存映射全部 LRU 封顶(会话 ≤100、运行快照 ≤50、子会话槽 ≤400),自动清理超 14 天孤儿
.dsh/canvas/*.json及超 1 小时遗留*.tmp;前端localStorage持续限额淘汰旧会话草稿并严格保护全局配置键。 - 后端纯图/裁剪/补丁与复盘快照/LRU/原子写逻辑抽离为零构建 ESM 模块
lib/graph.js与lib/telemetry.js,全部历史导出 100% 向后兼容;静态检查 12/12 与单测 84/84 全部通过。
English Release Notes
v1.6.1 focuses on 60fps canvas responsiveness, source-verified DSH 0.2.2 host contract alignment, execution robustness, long-term memory/disk hygiene, and zero-build backend modularization with zero breaking changes.
Performance & Rendering
- Accurate panel visibility detection & zero idle polling while collapsed: Aligned with DSH 0.2.2
keepMountedsemantics via[data-dockkit-content](aria-hidden/inert) +MutationObserver+IntersectionObserver, pausing polling across collapsed sidebar, inactive tabs, and inactive sessions while waking on frame 0 upon expand. workspaceFiles.stat-first polling: Probes file metadata before reading bytes, eliminating redundantreadIPCs andJSON.parsework when files are unchanged or absent (workspace-file/not-found).- 60fps rAF drag coalescing & zero listener churn: Coalesces pointer moves to
requestAnimationFramewith exact mouseup coordinate resolution for fast marquee/wire flicks and GPUwillChangeduring panning. - Render isolation & debounced persistence: Memoizes graph topology derivations via
useMemo, isolates the 1s live elapsed ticker intoLiveElapsedText, and debounceslocalStoragewrites (250ms) with unflushed-edit timestamp protection.
DSH 0.2.2 Alignment & Execution Robustness
- 1-shot condition JSON rescue &
diagnosticextraction: Aligned withSubagentResult.diagnosticand DSHactivation.ts(completed → errorwhen aminimalcondition judge answers with direct JSON text instead of callingstructured_output), rescuing strict JSON verdicts on attempt #1 without a wasted retry. - Surrogate-safe head+tail upstream clipping:
clipUpstreamOutputfolds oversized upstream outputs while preserving head conclusions and tail errors without ever splitting UTF-16 surrogate pairs. - Safe read-only transient retry: Single abort-aware backoff retry strictly for read-only (
minimal/condition) nodes on transient 429/502/503/504/timeout errors; writablestandardnodes never auto-retry. - Atomic writes & concurrency/input guards: Unified
writeFileAtomicacrosssaveStore,publishCanvas, andpublishRunState; added single-sessionexecutePlanre-entrancy lock, auto-sync suppression while running/paused at Lead, CJK IMEEscapeguard,safeSessionFileBasefilename sanitization, and actionable validation errors/warnings forfromNodes,canvas_generate,canvas_patch, and/canvas-sync.
Long-Term Hygiene & Modularization
- LRU-bounded backend maps, throttled cleanup of >14-day orphaned
.dsh/canvas/*.jsonand >1-hour*.tmpfiles, and ongoinglocalStoragesession pruning preserving all global settings keys. - Extracted pure graph/prompt/patch helpers into
lib/graph.jsand telemetry/LRU/atomic-write helpers intolib/telemetry.js(100% backward-compatibleindex.jsexports;npm run check12/12 &npm test84/84 passing).