Read-only goal-tree status strip above the composer: planners see the full node tree, workers see their claimed node, and worker reports call back to the planner session.
Install
# from a prebuilt release tarball
dsh plugin --profile web add -w "https://github.com/YaphetHayate/codeRDD/releases/latest/download/dsh-rdd-goal-tree.tgz"
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:YaphetHayate/codeRDD#path:/dsh/rdd-goal-tree
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
This plugin publishes its README in Chinese only.
独立的 DSH Profile Bundle:把 rdd-engine 的 goal-tree 运行状态做成输入框上方的只读状态条(conversation.input.dock 插槽,order 30,排在 todo/goal/queue 之后)。双半边:
- 宿主半边(exports
.,经cordis.patch.yml插入插件行):inject ['webServer'],注册GET /rdd-goal-tree/runs?cwd=<会话工作区>;按 dsh 的项目根规则(向上找.git)定位仓库,纯文件读取聚合.rdd/goal-trees/<run-id>/{manifest.json, state/tree.json, state/round-log.jsonl}。 - 浏览器半边(exports
./client,经 package.jsondsh.client: {platform:'web'}进 boot graph,浏览器从/plugins/@coderrdd/dsh-rdd-goal-tree/client.js加载):ctx.slots.inject('conversation.input.dock')注册GoalTreeDock;useSessions取当前会话 cwd,fetch 轮询(15s + 可见性恢复),渲染运行徽章、轮次 x/y、节点预算、状态计数与可展开的节点树。
只读边界:不触碰 goal-tree 的任何写原语(锁/账本/审计由规划者会话的 CLI 独占);无 run、加载中、cwd 缺失一律渲染空。@deepseek-ai/* 导入中仅 @deepseek-ai/dsh-llm(createUserMessage)与 @deepseek-ai/dsh-agent(agents 注册表服务)是运行时依赖,其余 type-only——两者均为 DSH 核心包,经 profile 的 hoisted store 解析。
Worker 结构化文档行(v0.4.0,node-doc-links)
桥接 run 节点的 node.task 由引擎 New-NodeTaskText 冻结模板合成(目标句 + 需求/设计文档指针 + 归档名)。宿主半边按同一模板把它结构化分解(parseNodeTask,与引擎侧 Get-NodeTaskBrief 同款正则)并 join 出绝对路径与存在性(.rdd/changes/archive/<归档名>/ 下 stat),经 wire 的 nodes[].docs 透出:
{ "goal": "完成「…」的 DEV 阶段(编码实现)。", "stage": "DEV", "duty": "(编码实现)",
"requirement": { "rel": "requirements/x.md", "abs": "D:\\…\\requirements\\x.md", "exists": true },
"designs": [ { "rel": "design/x-cto.md", "abs": "…", "exists": true },
{ "rel": "design/x-qa.md", "abs": "…", "exists": false } ] }
Worker 视图据此渲染三个独立展示位——目标句、需求文档、设计文档;文档为可点 chip,点击经 ctx.workspaces.openPath(浏览器半边新增 inject ['workspaces'])用宿主 OS 默认应用打开——与 DSH 会话内文件路径(工具行 / 产物文件)同一通道。未产出的设计文档(designDocs[].status=pending,归档下无此文件)渲染为虚线灰 chip 标注“未产出”,不可点。零退化契约:任何不匹配模板的 task(普通 goal-tree run、legacy 形态、旧英文签名)docs 为 null,Worker 视图回落原有单行任务文本,行为不变。仅升级插件即可(引擎侧零改动——解析的是既有落盘文本)。
UX 视觉稿行(v0.5.0,ux-mockup-links)
UX 的 Phase 2.5 视觉稿落盘在任务归档的约定目录 design/mockups/(final.html 定稿 / index.html 对比页 / 方向探索素材 / images/ 参考图),不注册 task.json designDocs(那里只有规格 .md),因此从不在 node.task 文本里。宿主半边在聚合时按约定枚举该目录(listMockupLinks,ux-mockup-links):只收视觉产物扩展名 .html / .png(manifest.json 是对比页数据源,不收),确定性排序(final.html → index.html → 其余按名序),每节点 chip 上限 8、目录遍历护栏 256 条,经 wire 的 nodes[].docs.mockups 透出;同一归档每次聚合只枚举一次(阶段链 UX→DEV→QA 节点共享缓存)。
Worker 视图在需求/设计文档行之后渲染**「视觉稿」行**(可换行 chip 容器)——chip 点击同样经 ctx.workspaces.openPath 打开:.html 视觉稿用默认浏览器直接渲染,.png 用系统看图器。零退化契约沿用:归档无 design/mockups/ 目录 → mockups: [] → 不渲染该行;非桥接节点 docs 为 null,行为与 v0.4.0 逐字节一致。引擎侧零改动(枚举的是 UX 既有落盘约定)。
v0.5.1(头部溢出修复):卡片头部行的
id · 任务标题(.rdgt-run)与轮次/runId 等元信息(.rdgt-meta)原为flex:none不可收缩、无省略号——长任务标题或长 runId 会把内容顶出卡片圆角框。两者改为flex:0 1 auto+min-width:0+ 单行省略号:空间不足时按需截断(完整任务文本仍在头部悬停 tooltip 里),不再溢出。
/runs 慢响应根治(v0.6.0,plugin-perf 三层)
症状:条带轮询 GET /rdd-goal-tree/runs 慢到等不到应答(11 run × ~84 节点 ≈ 300+ 次串行 fs 操作 ≈ 3s/请求,条带 + liveness 探针 + watcher 扫描全都触发全量聚合)。三层修复(产物行为对客户端兼容:字段只增不减语义):
- L1 并行化(
aggregateOneRun):run 之间Promise.all;run 内 manifest/tree/round-log/planner/claims 并发读;全部节点的 doc-link stat 与 mockup 目录游走并发解析(mockupsByArchive缓存 in-flight Promise,阶段链兄弟节点共享同一次游走)。输出与串行管线一致(同视图、同排序、同容错)。 - L2 缓存 + liveness 捷径:per-run 聚合缓存,键 =
manifest.json/state/tree.json/state/round-log.jsonl/state/planner.json/state/claims/*的 mtime+size 指纹(任一变化才重聚合),2s TTL 防抖 floor(窗口内直接复用缓存对象,零 stat);缓存只覆盖 run 状态文件——归档侧文档/视觉稿的出现随下一次 tree.json 写入(claim/settle/prune/graft 必写)生效。节点键 liveness 探针改直读state/claims/<node>.json副车(不再全量聚合);state/ledger.jsonl与统一决策账本decisions.jsonl每次现读(不进指纹,追加即生效)——决策账本自 planner-midrun-derive 起位于归档根.rdd/changes/archive/<归档名>/(旧 run 目录位置仅作 legacy 兜底),路径经该 run 的bridge.json→archive_rel解析:watcher 必须读引擎实际写入的同一份账本,否则 AutoMode 升级投递会静默断链。 - L3 载荷瘦身:
/runs默认只返回摘要——run 级标量全保留(state/census/budget/updatedAt),节点只带 census 字段(id/title/type/status/claimedBy/claimSessionId/blockedBy/parent/depth,视图门控与树列表所需),重字段(task 全文/docs/verdict/confidence)仅「有活跃 claim 会话的 run」(claim 副车会话在 agents 注册表存活——worker 视图要渲染;历史 claim/死会话的 run 一律 slim)或?run=<runId>详情表单返回;响应加detail: true|false标记。老客户端仍可用(所读字段全在,slim 节点只是树列表 tooltip 退化到标题);新客户端对展开的 slim run 经&run=回填详情(useRunDetail,按 runId 校验防串树——旧宿主应答全量列表时安全降级)。
构建环境修复(挂账⑤):包内 devDependencies 固定 typescript@5.9.3 + @types/node(此前检出链回退到 DSH checkout 的 tsc 6.x,报 baseUrl 弃用),host tsconfig 加 "types": ["node"]。
会话绑定与视图(v0.3.0,按会话角色收敛)
引擎在 dsh 环境里额外写两个增量 sidecar(文件仍是唯一权威):
state/planner.json—goal-tree.cmd start/delivery-bridge.cmd promulgate发起时的DSH_SESSION_ID。state/claims/<node>.json—goal-tree-leaf.cmd claim/ bridge claim 认领时的DSH_SESSION_ID。
条带按会话角色分档(判定表为无依赖纯函数 pickGoalTreeView,顺序敏感:Worker > 规划者 > 退化 > 不渲染):
- Worker 视图:当前会话认领了任一 run 的某节点 → 只显示"我的节点"(节点 id/标题/任务全文/状态/回报下一步),整棵树折叠在"查看整棵树"之后。
- 规划者视图:当前会话是任一 run 的发起者(全表扫 planner sidecar,首个命中——非首位 run 的发起者也看到自己的树)→ 全树条带 + 有
reported未裁定时加一行高亮提示(◆ n 待裁定 → settle / prune)。 - 退化视图(普通全树):仅当排序最高 run(
runs[0])无 planner sidecar(旧 run / 非 dsh 终端发起)时,其余会话保持全树条带;不向后续 run 回退。 - 不渲染:有 sidecar 的 run 下,与该 run 无关的会话不再渲染树条带(收敛项)。
同一会话既发起又认领时 Worker 视图胜出(判定表顺序)。
Worker 回调(v0.2.0)
宿主半边带一个 ledger 监视器(默认 5s,仅扫描该端点服务过的仓库,LRU 上限 8 个;扫描互斥——慢扫描(冷缓存/夹具 run 洪峰)超过周期间时丢弃重叠节拍,不并发重入投递臂):发现新的 report 账目行或(纯自动模式 run 的)open 升级条目且该 run 绑定了规划者会话时,经 agent.send(msg, 'next-turn', true)(goal round driver 同款持久队列边界 + 唤醒驱动)向规划者会话投递一条插件消息——report 为节点/worker/verdict/confidence/账目号 + settle/prune/graft 行动提示;升级为 checkpoint/风险/规则 + 呈用户与 decide -Kind resolution 回填指引(decision <id> 去重命名空间,与 ledger L<n> 天然隔离)。投递送达即唤醒:空闲的规划者会话被立即唤醒开轮消费(送达但不唤醒 = 无人值守时回调永久积压,已裁决为交付缺陷);按 entry 幂等——内存 set + 规划者 pending inbox 扫描(精确 token 匹配:ledger L2 不再误配 ledger L21 的前缀子串)+ run 级 .callback-delivered.json 持久 marker(按 run 串行 + 临时文件原子替换:并发写不再互相覆盖丢 marker、崩溃不再留下半文件导致重启全量重放)三重去重,插件/宿主重启不重放;共享同一归档账本的多条 run(replan/midrun-derive)对同一升级只投一次(按账本文件去重,首条 run 承载)。
构建与冒烟(codeRDD 仓)
node scripts\build-dsh-goal-tree.mjs # tsc ×2 → client bundle 包装 → npm pack → dist/plugin/dsh-rdd-goal-tree.tgz
node dsh\rdd-goal-tree\tests\smoke.mjs # 聚合(自播种 legacy demo run)+ 回调产物行 + 视图分档判定表 + watcher 投递 harness(唤醒/幂等/重启去重)+ bundle 格式断言
node scripts\build-dsh-goal-tree.mjs --check # 产物形状校验
构建期类型经 tsconfig paths 指向 DSH checkout 的 lib/types/*.d.ts,@types/react 以 junction 指入 checkout 的 pnpm store——不修改 DSH checkout 的任何文件。DSH_CHECKOUT 环境变量可覆盖 checkout 路径。
安装(标准 DSH)
dsh plugin --profile web add dsh-rdd-goal-tree.tgz # 装一次,该 profile 打开的任何项目可用
# 重启 profile(重开 dsh web / 新会话)后生效;项目侧零要求、零 rdd-engine 依赖
dsh plugin --profile web remove @coderrdd/dsh-rdd-goal-tree # 卸载
升级 = 新版 tarball 重跑 add;回滚 = 旧版重跑。
Config
| 字段 | 默认 | 说明 |
|---|---|---|
repoRoot |
按请求从 cwd 向上找 .git |
仓库根覆盖(一般不需要) |
notifyPlanner |
true |
Worker report 后向规划者会话投递回调消息 |
scanIntervalMs |
5000 |
ledger 扫描周期(毫秒);<= 0 关闭监视器 |
已知边界
- 插件升级需重启 profile 才双半边齐换:宿主半边(
/rdd-goal-tree/runs)随dsh web进程启动时加载进内存,浏览器半边(client.js)每次页面刷新从磁盘现取——进程运行中重跑plugin add会造成「新 client + 旧 host」偏斜:0.8.0 起 client 渲染 wake 徽章[k/K]·duty,旧 host 的 wire 不带这三个字段,0.8.1 及之前会显示成[undefined/undefined]·undefined(守卫!== null放过 undefined);0.8.2 起字段缺失一律退化为不显徽章。治本 = 重启 profile 让宿主半边同版。 - 条带按 cwd 解析仓库:会话 cwd 不是 git 仓库时落到 cwd 本身(与 dsh-rdd-explore 同规则)。
- 多 run 并存时显示排序最高者(running 优先、updatedAt 新者优先);完整列表切换留二期。
- 多 run 退化边界:
runs[0]为有 sidecar 的新 run 时,无关会话不向后续旧 run 回退(特定组合下旁观者看不到旧 run 全树——已裁定语义,随旧 run 清退归零)。 - 集群/远程工作区未经测试:本插件假设宿主与仓库同机(本机单用户 GUI 语义)。
- 会话绑定依赖补丁后的引擎脚本与新的认领/发起:旧 run(sidecar 缺失)退化为普通视图、无回调;Worker/规划者会话须与本插件同属一个
dsh web进程(回调经该进程的 agents 注册表投递)。 - 引擎脚本
goal-tree.ps1/goal-tree-leaf.ps1为 UTF-8 带 BOM(powershell.exe5.1 按 ANSI 读无 BOM 的含中文脚本会解析失败)——改动这两个文件务必保持 BOM。
迁移说明(Manager→PLANNER 更名)
- 配置键
notifyManager已更名notifyPlanner(零兼容策略,旧键不再识别):曾显式设置notifyManager: false的环境升级后需改配notifyPlanner: false,否则回调回落默认开启。 - 引擎与插件需同版本升级:
state/planner.jsonsidecar 由新版goal-tree.ps1写入,旧引擎 + 新插件的组合读不到 sidecar,表现为视图退化(普通视图、无回调),不报错。 - 存量旧 run(含
state/manager.json)不做兼容读取:按零兼容策略落入 legacy 降级分支(普通视图、无回调)。
Links
More in this category
zhu1090093659/dsh-web#packages/dsh-task-board★ 10686
Task board for the dsh web GUI: a sidebar multi-column kanban whose cards run in real DSH agent sessions and can also be scheduled with cron expressions, executed host-side even with the browser closed.
zhu1090093659/dsh-web#packages/dsh-web-all★ 10686
Plugin and skin collection for the DSH Web UI: task board, Git graph, right-side panel, remote mobile UI, pet, live token stats, and a skin center.
ccch1mneyyy/dsh-TUI★ 8436
Claude Code-style full-screen terminal UI: pixel-whale header, live status line, and streaming thought expansion.
MeteorNOX/DeepSeek-Balance-Whale-Widget★ 7504
A fixed-corner whale widget for the DSH web GUI — balance, today's usage and per-turn cost with peak/off-peak pricing, editable balance-alert and daily-budget bubbles, a module-based custom bubble queue with A/B weighted choices and random lines or images, 30+ vendor templates (OpenAI, OpenRouter, Kimi, SiliconFlow, Ark, Zhipu, MiniMax and more) with per-model balance and subscription quota, plus task-end sound, imported audio, custom roles and a resource manager. Local-only, no telemetry.
omdsh-dev/DSH-better-sidebar★ 5379
Full sidebar workbench with file rendering and editing, terminal, Git, and subagents; third-party plugins can register new tabs.
omdsh-dev/dsh-genui★ 1076
Interactive UI components rendered inline in replies: layout, charts, forms, quizzes, mermaid, 3D scenes, and an action event loop back to the model.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.