weir-harness 0.0.0-stage → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. package/README.md +39 -2
  2. package/cordis.patch.yml +496 -0
  3. package/lib/client.blackboard-model.js +385 -0
  4. package/lib/client.blackboard-panel.js +1199 -0
  5. package/lib/client.capability-badge.js +255 -0
  6. package/lib/client.capability-manager.js +973 -0
  7. package/lib/client.capability-model.js +502 -0
  8. package/lib/client.capability-presets.js +1240 -0
  9. package/lib/client.chain-editor.js +141 -0
  10. package/lib/client.chain-model.js +48 -0
  11. package/lib/client.disabled-categories-editor.js +126 -0
  12. package/lib/client.edit-lock-maintenance.js +397 -0
  13. package/lib/client.edit-lock-panel.js +262 -0
  14. package/lib/client.hash-edit-model.js +205 -0
  15. package/lib/client.hash-edit-view.js +120 -0
  16. package/lib/client.js +2188 -0
  17. package/lib/client.lsp-model.js +48 -0
  18. package/lib/client.lsp-panel.js +224 -0
  19. package/lib/client.lsp-toggle.js +120 -0
  20. package/lib/client.notify-permissions.js +307 -0
  21. package/lib/client.notify-web.js +162 -0
  22. package/lib/client.robash-editor.js +95 -0
  23. package/lib/client.robash-model.js +39 -0
  24. package/lib/client.settings-page.js +960 -0
  25. package/lib/client.worktree-model.js +260 -0
  26. package/lib/client.worktree-view.js +773 -0
  27. package/lib/index.js +5 -0
  28. package/package.json +73 -4
  29. package/skills/debugging/SKILL.md +51 -0
  30. package/skills/deep-work/SKILL.md +182 -0
  31. package/skills/git-master/SKILL.md +102 -0
  32. package/skills/programming/SKILL.md +324 -0
  33. package/skills/programming/references/code-smells.md +390 -0
  34. package/skills/programming/references/go/README.md +91 -0
  35. package/skills/programming/references/logging.md +96 -0
  36. package/skills/programming/references/python/README.md +315 -0
  37. package/skills/programming/references/rust/README.md +348 -0
  38. package/skills/programming/references/rust-ub/README.md +290 -0
  39. package/skills/programming/references/typescript/README.md +196 -0
  40. package/skills/refactor/SKILL.md +341 -0
  41. package/skills/remove-ai-slops/SKILL.md +349 -0
  42. package/skills/remove-deadcode/SKILL.md +239 -0
  43. package/skills/research/SKILL.md +49 -0
  44. package/skills/review-work/SKILL.md +53 -0
  45. package/skills/work-with-pr/SKILL.md +372 -0
  46. package/src/blackboard/contracts.js +93 -0
  47. package/src/blackboard/index.js +412 -0
  48. package/src/blackboard/kernel.js +450 -0
  49. package/src/blackboard/notify.js +154 -0
  50. package/src/blackboard/promote.js +85 -0
  51. package/src/blackboard/remote.js +392 -0
  52. package/src/capabilities/apply-engine.js +664 -0
  53. package/src/capabilities/capability-remote.js +230 -0
  54. package/src/capabilities/consumer-view.js +76 -0
  55. package/src/capabilities/content-pin.js +88 -0
  56. package/src/capabilities/content-refresh.js +331 -0
  57. package/src/capabilities/defaults-transaction.js +60 -0
  58. package/src/capabilities/distribution-manifest.js +78 -0
  59. package/src/capabilities/frontmatter.js +109 -0
  60. package/src/capabilities/initial-selection.js +181 -0
  61. package/src/capabilities/isolated-exec.js +106 -0
  62. package/src/capabilities/lifecycle-preload.js +68 -0
  63. package/src/capabilities/lifecycle-snapshot.js +473 -0
  64. package/src/capabilities/mcp-admission.js +78 -0
  65. package/src/capabilities/mcp-drain.js +109 -0
  66. package/src/capabilities/mcp-facade-plugin.js +41 -0
  67. package/src/capabilities/mcp-facade.js +109 -0
  68. package/src/capabilities/mcp-gate.js +71 -0
  69. package/src/capabilities/mcp-manager.js +254 -0
  70. package/src/capabilities/mcp-mount.js +145 -0
  71. package/src/capabilities/mcp-registry.js +123 -0
  72. package/src/capabilities/portable-refs.js +120 -0
  73. package/src/capabilities/preset-invalidation.js +83 -0
  74. package/src/capabilities/preset-library.js +142 -0
  75. package/src/capabilities/preset-package-install.js +195 -0
  76. package/src/capabilities/preset-package.js +487 -0
  77. package/src/capabilities/publisher.js +129 -0
  78. package/src/capabilities/read-payloads.js +157 -0
  79. package/src/capabilities/same-name-policy.js +61 -0
  80. package/src/capabilities/selection-draft.js +225 -0
  81. package/src/capabilities/selection-notify.js +75 -0
  82. package/src/capabilities/selection-status.js +80 -0
  83. package/src/capabilities/skill-admission.js +181 -0
  84. package/src/capabilities/skill-builtin-migration.js +87 -0
  85. package/src/capabilities/skill-identity.js +34 -0
  86. package/src/capabilities/skill-inventory.js +101 -0
  87. package/src/capabilities/skill-office-adapter.js +49 -0
  88. package/src/capabilities/skill-selection-plugin.js +1137 -0
  89. package/src/capabilities/skill-selection-provider.js +197 -0
  90. package/src/capabilities/store/checked-contract.d.ts +40 -0
  91. package/src/capabilities/store/enumerate.js +90 -0
  92. package/src/capabilities/store/fs-adapter.js +78 -0
  93. package/src/capabilities/store/liveness.js +83 -0
  94. package/src/capabilities/store/lock.js +266 -0
  95. package/src/capabilities/store/paths.js +83 -0
  96. package/src/capabilities/store/record.js +64 -0
  97. package/src/capabilities/store/store.js +216 -0
  98. package/src/capabilities/update-lifecycle.js +106 -0
  99. package/src/context-guard/compaction-outcome.js +25 -0
  100. package/src/context-guard/index.js +151 -0
  101. package/src/context-guard/pressure.js +85 -0
  102. package/src/core/doctrine.js +65 -0
  103. package/src/core/index.js +39 -0
  104. package/src/creative-guide/guide.js +35 -0
  105. package/src/creative-guide/index.js +21 -0
  106. package/src/delegate/agents.js +144 -0
  107. package/src/delegate/audit-readers.js +79 -0
  108. package/src/delegate/categories.js +116 -0
  109. package/src/delegate/escalate.js +15 -0
  110. package/src/delegate/group-coordinator.js +515 -0
  111. package/src/delegate/index.js +169 -0
  112. package/src/delegate/rehydrate.js +194 -0
  113. package/src/delegate/resolver.js +116 -0
  114. package/src/delegate/robash-guard-core.js +238 -0
  115. package/src/delegate/robash-guard-pwsh.js +710 -0
  116. package/src/delegate/robash-guard.js +435 -0
  117. package/src/delegate/settings-overlay.js +198 -0
  118. package/src/delegate/spawn-adapter.js +232 -0
  119. package/src/delegate/status-tool.js +122 -0
  120. package/src/delegate/supervision-mount.js +173 -0
  121. package/src/delegate/supervision-tools.js +90 -0
  122. package/src/delegate/target-resolver.js +217 -0
  123. package/src/delegate/targets.js +114 -0
  124. package/src/delegate/tool.js +557 -0
  125. package/src/delegate/worktree-mode.js +70 -0
  126. package/src/edit-lock/adapter.js +57 -0
  127. package/src/edit-lock/admin-ledger.js +116 -0
  128. package/src/edit-lock/admin-recovery.js +143 -0
  129. package/src/edit-lock/admission.js +62 -0
  130. package/src/edit-lock/call-context.js +65 -0
  131. package/src/edit-lock/domain.js +138 -0
  132. package/src/edit-lock/domains.js +103 -0
  133. package/src/edit-lock/host.js +149 -0
  134. package/src/edit-lock/incarnations.js +150 -0
  135. package/src/edit-lock/index.js +1118 -0
  136. package/src/edit-lock/inspect.js +107 -0
  137. package/src/edit-lock/lifecycle.js +451 -0
  138. package/src/edit-lock/maintenance.js +298 -0
  139. package/src/edit-lock/manager.js +866 -0
  140. package/src/edit-lock/negotiation.js +131 -0
  141. package/src/edit-lock/operation-history.js +214 -0
  142. package/src/edit-lock/peer-client.js +79 -0
  143. package/src/edit-lock/peer-transport.js +70 -0
  144. package/src/edit-lock/peer.js +85 -0
  145. package/src/edit-lock/publisher.js +135 -0
  146. package/src/edit-lock/read-authority.js +98 -0
  147. package/src/edit-lock/recovery.js +139 -0
  148. package/src/edit-lock/remote-service.js +28 -0
  149. package/src/edit-lock/remote.js +142 -0
  150. package/src/edit-lock/request-binding.js +42 -0
  151. package/src/edit-lock/request-data.js +40 -0
  152. package/src/edit-lock/reservation.js +297 -0
  153. package/src/edit-lock/reserved-runtime.js +45 -0
  154. package/src/edit-lock/resource-identity.js +107 -0
  155. package/src/edit-lock/runtime.js +134 -0
  156. package/src/edit-lock/settle.js +144 -0
  157. package/src/edit-lock/snapshot.js +175 -0
  158. package/src/edit-lock/stale-sweep.js +103 -0
  159. package/src/edit-lock/state.js +464 -0
  160. package/src/edit-lock/store.js +317 -0
  161. package/src/edit-lock/tool-scope.js +29 -0
  162. package/src/edit-lock/view.js +156 -0
  163. package/src/edit-lock/write-scopes.js +48 -0
  164. package/src/edit-lock/write-tool.js +45 -0
  165. package/src/hashline-edit/anchors.js +60 -0
  166. package/src/hashline-edit/apply-ops.js +113 -0
  167. package/src/hashline-edit/diff.js +160 -0
  168. package/src/hashline-edit/index.js +253 -0
  169. package/src/hashline-edit/planned-fragments.js +119 -0
  170. package/src/hashline-edit/sandbox.js +157 -0
  171. package/src/hashline-edit/xxhash32.js +78 -0
  172. package/src/intent-gate/classifier.js +167 -0
  173. package/src/intent-gate/index.js +170 -0
  174. package/src/intent-gate/matcher.js +134 -0
  175. package/src/lsp/admin.d.ts +2 -0
  176. package/src/lsp/admin.js +223 -0
  177. package/src/lsp/child-process.js +540 -0
  178. package/src/lsp/client.js +141 -0
  179. package/src/lsp/index.js +258 -0
  180. package/src/lsp/manager.js +221 -0
  181. package/src/lsp/registry.js +217 -0
  182. package/src/lsp/rename.js +142 -0
  183. package/src/lsp/tools.js +309 -0
  184. package/src/lsp/uri.js +19 -0
  185. package/src/notify/commands.js +114 -0
  186. package/src/notify/index.js +264 -0
  187. package/src/notify/messages.js +97 -0
  188. package/src/notify/notifier.js +68 -0
  189. package/src/notify/permissions-admin.js +128 -0
  190. package/src/notify/permissions.js +171 -0
  191. package/src/notify/policy.js +135 -0
  192. package/src/notify/tags.js +26 -0
  193. package/src/notify/web-channel.js +186 -0
  194. package/src/settings/env-admin.d.ts +4 -0
  195. package/src/settings/env-admin.js +56 -0
  196. package/src/settings/index.js +138 -0
  197. package/src/settings/sections.js +408 -0
  198. package/src/settings/volatile.js +22 -0
  199. package/src/shared/audit.js +98 -0
  200. package/src/shared/child-scope.js +102 -0
  201. package/src/shared/content-text.js +21 -0
  202. package/src/shared/runtime-messages.js +87 -0
  203. package/src/shared/user-message.js +18 -0
  204. package/src/shared/whitelist-defaults.js +170 -0
  205. package/src/todo-driver/index.js +176 -0
  206. package/src/todo-driver/state-machine.js +233 -0
  207. package/src/vendor/THIRD-PARTY.md +19 -0
  208. package/src/vendor/cosmokit.js +421 -0
  209. package/src/vendor/schemastery.d.ts +13 -0
  210. package/src/vendor/schemastery.js +640 -0
  211. package/src/worktree/authority.js +56 -0
  212. package/src/worktree/cards.js +206 -0
  213. package/src/worktree/command.js +116 -0
  214. package/src/worktree/contract-guidance.test.js +100 -0
  215. package/src/worktree/errors.js +73 -0
  216. package/src/worktree/exclude.js +40 -0
  217. package/src/worktree/git.js +153 -0
  218. package/src/worktree/guard.js +248 -0
  219. package/src/worktree/index.js +420 -0
  220. package/src/worktree/lanes.js +1462 -0
  221. package/src/worktree/ledger.js +173 -0
  222. package/src/worktree/pkgmgr.js +125 -0
  223. package/src/worktree/projection.js +92 -0
  224. package/src/worktree/prompts.js +103 -0
  225. package/src/worktree/reconcile.js +38 -0
  226. package/src/worktree/rules.js +314 -0
  227. package/src/worktree/runner.js +161 -0
  228. package/src/worktree/state.js +160 -0
  229. package/src/worktree/tools.js +150 -0
  230. package/src/worktree/watches.js +150 -0
  231. package/whitelist-defaults.json +238 -0
package/README.md CHANGED
@@ -1,3 +1,40 @@
1
- # Temporary Holding Version
1
+ # weir-harness
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ > 文档导航:产品门面见仓库根 [README.md](../../README.md);各特性的行为/配置/设计/失败语义见 [docs/features/](../../docs/features/README.md);版本记录见 [CHANGELOG.md](../../CHANGELOG.md);开发纪律见 [AGENTS.md](../../AGENTS.md)。
4
+
5
+ Weir — 以 Orchestrator 为中心的 DSH agent 预设 bundle。声明预设 `weir`(GUI 显示名 "Weir"),落地七项设计:
6
+
7
+ | 模块 | 功能 |
8
+ |---|---|
9
+ | `weir-harness/core` | Orchestrator 协作纪律提示词 section(`orchestrator:doctrine`) |
10
+ | `weir-harness/intent-gate` | 意图门:关键词命中 → 上下文注入 / 推理提档(`agent/pre-step` + `agent/request` 瀑布);可选语义分类器(regex 默认 / llm sidecar / jev 实验,fail-open + 审计) |
11
+ | `weir-harness/delegate` | `delegate` 工具:类别路由(模型链解析)+ 精选只读代理(finder/scholar/advisor,bash 受只读白名单守卫)+ 批量 + 后台 job 道 + ESCALATE 契约 + 受监督分组(`group` 二元终态 + 异常续推 + 合并报告 + `resume_agent`/`terminate_agent`) |
12
+ | `weir-harness/todo-driver` | todo 空转续推:`turn/end` reason 区分用户打断/供应商错误,`stop_continuation` 逃生舱 |
13
+ | `weir-harness/context-guard` | 上下文压力阈值:软阈值提示 + `compact_context` 择时压缩 + 硬阈值边界强制 + 压缩后续推 |
14
+ | `weir-harness/hashline-edit` | read 锚点增强(`N#XX|`)+ fail-closed `hash_edit` 工具(预设默认唯一编辑工具,`hideStockEdit: false` 可回归共存) |
15
+ | `weir-harness/lsp` | 自研零依赖 LSP 客户端:四个只读语义工具(diagnostics/definition/references/symbols);`lsp.enabled` 能力总闸(默认关),会话面板开关 + `/lsp` 命令 + `lsp` 工具按会话启用(`weirLsp` 投影持久化);13 族社区配方注册表 + `lspServers` 用户自定义服务器 + 扩展目录可执行解析 |
16
+ | (内建采用) | 拉取式后台通知由 DSH 内建 job 道承担;本预设配置 `maxConsecutiveWakes: 8` |
17
+
18
+ 技能(`skills/`,经 `customSkillDirs` 挂载):`deep-work`、`research`、`review-work`、`debugging`、`git-master`、`refactor`、`programming`(含 references/)、`remove-ai-slops`、`work-with-pr`、`remove-deadcode`(英文正文;模板层英文、实例内容跟随会话语言)。
19
+
20
+ 另含 profile 层 `weir-harness/settings` 行:Weir 设置页(Settings 应用自动生成)+ host 层 `weirSettings` 服务(生效配置分层:模块默认 ← 行 config ← 设置值)。schema 依赖 vendored 于 `src/vendor/`(见该目录 THIRD-PARTY.md)。
21
+
22
+ ## 安装
23
+
24
+ 要求 DeepSeek Harness 版本 `>=0.2.0-rc.2 <0.3.0`(不兼容的运行时会在安装前被明确拒绝)。
25
+
26
+ CLI 一条命令:
27
+
28
+ ```sh
29
+ dsh plugin --profile web add weir-harness
30
+ ```
31
+
32
+ 或 Harness 会话内:`plugin_manager` 的 `install_bundle`,target 填 `weir-harness`(可带 `@版本`)。
33
+
34
+ 安装后在新建会话的预设选择器中选择 **Weir**;GUI 设置页出现「Weir」专页。升级到最新版:同一安装命令改填 `weir-harness@latest`。
35
+
36
+ ## 开发
37
+
38
+ 纯 ESM JavaScript,无构建步骤(`src/**/*.js` 即运行时输入)。测试:`node --test "test/**/*.test.js"`;静态检查:`pnpm run check`(tsc checkJs 覆盖强类型核心;适配层经单测覆盖)。
39
+
40
+ 开发者 link 安装:Harness 会话内 `plugin_manager install_bundle` 以本目录绝对路径安装;重复安装用 `set_bundle` 禁用/启用循环重应用。
@@ -0,0 +1,496 @@
1
+ # Agent preset weir: one `@deepseek-ai/dsh-agent-preset` declaration inserted
2
+ # by this bundle's patch. The preset is edited through bundle updates; the Web
3
+ # editor is read-only for preset rows.
4
+ # Presets own discovery and the skill tool in every host composition.
5
+ - id: skill-filesystem
6
+ disabled: true
7
+ - id: tool-skill
8
+ disabled: true
9
+ - insert:
10
+ # Profile-level settings row: one-stop Weir configuration page in the
11
+ # Settings app (auto-generated from the declared schema) plus the
12
+ # host-plane weirSettings service the preset modules overlay with.
13
+ - id: weir-settings
14
+ name: 'weir-harness/settings'
15
+ config:
16
+ # Product defaults, mirrored 1:1 from the preset modules' code
17
+ # defaults so the settings page shows EFFECTIVE values (the row is the
18
+ # composition base; user edits override it). Keep in sync with the
19
+ # module defaults on every change.
20
+ intentGateClassifier: regex
21
+ intentGateTimeoutMs: 1500
22
+ supervisionMaxRetries: 5
23
+ supervisionInitialBackoffMs: 30000
24
+ supervisionMaxBackoffMs: 300000
25
+ todoEnabled: true
26
+ todoMaxConsecutive: 8
27
+ todoErrorRetryMax: 5
28
+ todoErrorBackoffBaseMs: 30000
29
+ todoErrorBackoffCapMs: 300000
30
+ guardEnabled: true
31
+ guardSoftThreshold: 0.72
32
+ guardHardThreshold: 0.88
33
+ hashlineHideStockEdit: true
34
+ # Worktree lanes (git-worktree-lanes): capability switch, lane root,
35
+ # active-lane cap, automatic dependency setup, lane-watch timeout, and
36
+ # the global auto-approve default (manual / auto-keep / auto-clean).
37
+ worktreeEnabled: true
38
+ worktreeRoot: .weir/worktrees
39
+ worktreeMaxActive: 4
40
+ worktreeAutoSetup: true
41
+ worktreeWatchTimeoutMinutes: 360
42
+ worktreeAutoApprove: auto-clean
43
+ editLockEnabled: false
44
+ # Message-driven auto-resume (edit-lock-auto-resume-on-message): a genuine
45
+ # user message resumes a stopped session and confirms its retained files.
46
+ # Read live per message, so toggling applies without a restart.
47
+ editLockAutoResume: true
48
+ editLockStaleSweep: true
49
+ robashEnabled: true
50
+ # The five whitelist tables are NOT declared here on purpose. A patch
51
+ # row's `config` is replaced WHOLE rather than deep-merged, so a default
52
+ # that rides this row is discarded the moment a profile declares its own
53
+ # settings row — which made every later whitelist addition unreachable
54
+ # for any profile that had ever edited a list. The product defaults now
55
+ # live in the bundle's `whitelist-defaults.json`, which the plugin reads
56
+ # itself at runtime; the settings keys of the same names ADD to them.
57
+ lspEnabled: false
58
+ notifyEnabled: true
59
+ notifyOnComplete: true
60
+ notifyOnAttention: true
61
+ notifyMinTurnSeconds: 15
62
+ notifySound: true
63
+ notifyForeground: skip
64
+ # Session blackboard: write-token TTL (minutes); expiry releases the
65
+ # key and notifies its subscribers. Volatile — edits apply live.
66
+ blackboardWriteTokenTtlMinutes: 60
67
+ # System notifications (profile level, so every session is covered, not only
68
+ # Weir-preset ones): approval / question / plan-review / failure / long-turn
69
+ # completion. Pure observer of session events; settings overlay is read live.
70
+ - id: weir-notify
71
+ name: 'weir-harness/notify'
72
+ # Capability read channel (silent-capability-reads): the plugin-owned
73
+ # typert remote serving the Badge/manager READ verbs (receipt / list /
74
+ # conditions) so reads never touch the session log. Host layer by
75
+ # necessity: the typert gateway resolves the service from the host root
76
+ # (S27); the preset-layer skill-selection feeds its faces through the
77
+ # module-level bridge. Inert with a warning when typert is absent.
78
+ - id: weir-capability-remote
79
+ name: 'weir-harness/capability-remote'
80
+ # Session blackboard panel data channel (design D8): plugin-owned typert
81
+ # remote serving list/read/apply/write/remove so panel reads never touch
82
+ # the session log. Host layer for the same S27 reason as the capability
83
+ # remote above (gateway resolves from the host root); the preset-layer
84
+ # blackboard plugin feeds the kernel/TTL faces through the module-level
85
+ # bridge. Inert with a warning when typert is absent.
86
+ - id: weir-blackboard-remote
87
+ name: 'weir-harness/blackboard-remote'
88
+ # Browser half of the same package: the Weir settings page registered
89
+ # as a top-level section of the global Settings panel (./client export,
90
+ # dsh.client manifest).
91
+ - id: ui-weir-settings
92
+ name: 'weir-harness'
93
+ # Isolated reusable model picker client module (own package + own client
94
+ # export): the settings page requires it and renders it inside an error
95
+ # boundary, so a picker failure can never blank the page.
96
+ - id: ui-weir-model-picker
97
+ name: 'weir-model-picker'
98
+ - id: preset-weir
99
+ name: '@deepseek-ai/dsh-agent-preset'
100
+ config:
101
+ id: weir
102
+ name: Weir
103
+ description: Orchestrator-centric harness — intent gate, category delegation, todo driver, pull-based background jobs, auto-compaction, hashline edit.
104
+ order: 5
105
+ plugins:
106
+ - id: persona
107
+ name: '@deepseek-ai/dsh-persona'
108
+ config:
109
+ prefix: >-
110
+ You are the Orchestrator, the user's single point of collaboration, powered by the {{model}} model.
111
+ You understand intent, decompose work, delegate to specialist sub-agents, choose parallel fan-out
112
+ or sequenced waiting, verify evidence, and report results.
113
+ suffix: Your working directory is {{cwd}}.
114
+ - id: weir-core
115
+ name: 'weir-harness/core'
116
+ - id: agent-instructions
117
+ name: '@deepseek-ai/dsh-agent-instructions'
118
+ config:
119
+ maxBytes: 65536
120
+ - id: tool-bash
121
+ name: '@deepseek-ai/dsh-tool-bash'
122
+ disabled: !!js process.platform === 'win32'
123
+ - id: tool-pwsh
124
+ name: '@deepseek-ai/dsh-tool-pwsh'
125
+ disabled: !!js process.platform !== 'win32'
126
+ - id: tool-fs
127
+ name: '@deepseek-ai/dsh-tool-fs'
128
+ - id: tool-fs-search
129
+ name: '@deepseek-ai/dsh-tool-fs-search'
130
+ config:
131
+ sampleOverCapGlobResults: false
132
+ - id: tool-jobs
133
+ name: '@deepseek-ai/dsh-tool-jobs'
134
+ config:
135
+ # F5 拉取式后台:结算通知已内建为紧凑 + 边界注入 + 拉取式读取;
136
+ # 这里仅限制连续唤醒次数,防止通知唤醒风暴。
137
+ maxConsecutiveWakes: 8
138
+ # Weir capabilities: skill selection + managed MCP. The manager
139
+ # publishes weirMcpGate / weirMcpManager via reflect; preset
140
+ # services must sit in an isolate realm or the registry rejects the
141
+ # whole preset ("Preset services require isolate realms"). The
142
+ # consumer (skill-selection reads weirMcpManager for /capabilities
143
+ # list) shares the group (S11).
144
+ - id: capabilities
145
+ name: cordis:group
146
+ group: true
147
+ isolate:
148
+ weirMcpGate: true
149
+ weirMcpManager: true
150
+ config:
151
+ - id: weir-skill-selection
152
+ name: 'weir-harness/skill-selection'
153
+ config:
154
+ # preset-skill-applicability (D2): profile-supplemental roots
155
+ # used ONLY to classify apply-missing names as known-but-
156
+ # inapplicable (skip with report) vs genuinely unknown — the
157
+ # same creative root the weir-creative row enumerates.
158
+ supplementalSkillDirs:
159
+ - !!js (() => { try { const p = process.getBuiltinModule('node:path'); return p.join(p.dirname(process.getBuiltinModule('node:module').createRequire(baseUrl).resolve('@deepseek-ai/dsh-agent-preset/package.json')), 'skills') } catch { return process.getBuiltinModule('node:path').join(process.getBuiltinModule('node:os').tmpdir(), 'dsh-agent-preset-skills-unavailable') } })()
160
+ # Weir-managed MCP: runtime per-server isolated mounts with the
161
+ # proxy facade, admission gate and adopt flow (task 8.2+).
162
+ - id: weir-mcp-manager
163
+ name: 'weir-harness/mcp-manager'
164
+ - id: tool-skill
165
+ name: '@deepseek-ai/dsh-tool-skill'
166
+ - id: planning
167
+ name: cordis:group
168
+ group: true
169
+ isolate:
170
+ planMode: true
171
+ config:
172
+ - id: plan-mode
173
+ name: '@deepseek-ai/dsh-plan-mode'
174
+ config:
175
+ section: |
176
+ You are in plan mode. Stay in plan mode until exit_plan_mode succeeds or the user switches the session mode. Imperative language to implement changes means plan the implementation, not execute it. A user's conversational agreement — including an answer confirming something you asked — approves nothing and does not end plan mode; fold the confirmed decision into the plan and submit it through exit_plan_mode.
177
+
178
+ Explore first. Use non-mutating reads, searches, static analysis, and checks to ground the plan in the actual repository. Do not edit or write files, change configuration, run formatters or code generation that rewrites tracked files, commit, or otherwise carry out the plan. Prefer existing functions and patterns over new machinery.
179
+
180
+ The tool catalog stays the same across modes for request-cache stability. These plan-mode rules override any later tool description or guidance that suggests using mutation tools; those tools remain listed to keep the tool catalog unchanged. Do not use todo_write to track this planning phase: it tracks implementation after an approved plan, while the plan itself belongs in exit_plan_mode.
181
+
182
+ Resolve discoverable facts by inspection. Use ask_user_question only for user-owned choices or material ambiguity that inspection cannot answer. Do not ask the user where code lives or how current behavior works when you can find out.
183
+
184
+ Make the plan decision-complete: state the goal and success criteria; group implementation changes by subsystem; identify public API, schema, and data-flow changes; cover edge cases, failure modes, tests, acceptance criteria, and explicit assumptions. Keep it concise enough to review but detailed enough that another engineer can implement it without making design decisions.
185
+
186
+ When ready, call exit_plan_mode with the complete plan markdown, starting with a # title. Make exit_plan_mode the only and final tool call in that assistant response: it presents the plan for approval, and implementation begins only in a later step after approval. Do not paste the final plan as a plain reply or ask "should I proceed?" through prose or ask_user_question. If review rejects it, incorporate the feedback and present again. If the review channel is unavailable or aborted, stay in plan mode and ask the user to switch modes manually; do not proceed with implementation.
187
+ - id: compaction
188
+ name: cordis:group
189
+ group: true
190
+ isolate:
191
+ compaction: true
192
+ toolResultPruner: true
193
+ config:
194
+ - id: compaction-basic
195
+ name: '@deepseek-ai/dsh-compaction-basic'
196
+ - id: command-compact
197
+ name: '@deepseek-ai/dsh-command-compact'
198
+ - id: tool-result-pruner
199
+ name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
200
+ config:
201
+ thresholdChars: 8192
202
+ headChars: 4096
203
+ tailChars: 1024
204
+ # F6 自动压缩:上下文压力阈值 + 模型择时压缩 + 边界强制 + 压缩后续推。
205
+ # `compaction` 服务被本组 isolate:消费者必须与提供者同 realm(否则
206
+ # inject 永久等待,预设加载失败)。
207
+ - id: context-guard
208
+ name: 'weir-harness/context-guard'
209
+ - id: delegation
210
+ name: cordis:group
211
+ group: true
212
+ isolate:
213
+ workflowEngine: true
214
+ # 编辑锁服务:提供者 edit-lock 与消费者 todo-driver / hashline-edit /
215
+ # lsp 同在本组。预设服务必须 isolate,否则预设加载以
216
+ # "Preset services require isolate realms" 失败。
217
+ weirEditLock: true
218
+ # Worktree lanes service: provider (worktree) and consumer
219
+ # (delegate) share this realm (S24 / S26 S-A).
220
+ weirWorktreeLanes: true
221
+ # Session blackboard: provider + tool consumers (slice 1) and the
222
+ # delegate write-contract consumer (slice 2) share this realm.
223
+ weirBlackboard: true
224
+ config:
225
+ - id: tool-subagent-control
226
+ name: '@deepseek-ai/dsh-tool-subagent-control'
227
+ - id: tool-subagent-list-agents
228
+ name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
229
+ - id: tool-subagent
230
+ name: '@deepseek-ai/dsh-tool-subagent'
231
+ config:
232
+ provider: spawn
233
+ toolName: subagent
234
+ modelSelectionSettings: true
235
+ backgroundMode: continuable
236
+ - id: tool-subagent-fork
237
+ name: '@deepseek-ai/dsh-tool-subagent'
238
+ config:
239
+ provider: fork
240
+ toolName: subagent_fork
241
+ backgroundMode: continuable
242
+ - id: workflow-ptc
243
+ name: '@deepseek-ai/dsh-workflow-ptc'
244
+ config:
245
+ provider: spawn
246
+ - id: tool-workflow
247
+ name: '@deepseek-ai/dsh-tool-workflow'
248
+ - id: tool-ralph
249
+ name: '@deepseek-ai/dsh-tool-ralph'
250
+ disabled: true
251
+ config:
252
+ subagentProvider: spawn
253
+ maxRounds: 64
254
+ # F1 意图门:关键词意图 → 上下文注入 / 推理提档
255
+ - id: intent-gate
256
+ name: 'weir-harness/intent-gate'
257
+ # Worktree 车道:宿主状态机 + 车道工具 + /worktree 命令 + 面板端点;
258
+ # 提供 weirWorktreeLanes 服务(delegate 消费:绑定、车道守卫、结算)
259
+ - id: worktree
260
+ name: 'weir-harness/worktree'
261
+ # F3 分类委派:类别路由 + 精选只读代理 + 后台 job 道
262
+ - id: delegate
263
+ name: 'weir-harness/delegate'
264
+ # 会话黑板:会话级 KV + 写入权仲裁 + 五个模型工具(提供 weirBlackboard 服务)
265
+ - id: blackboard
266
+ name: 'weir-harness/blackboard'
267
+ # F4 todo 续推:空转续推 + 用户打断/供应商错误语义 + 逃生舱
268
+ - id: todo-driver
269
+ name: 'weir-harness/todo-driver'
270
+ # 编辑锁(实验,默认关):设置 editLockEnabled 开启并重启后生效。
271
+ # 必须排在 hashline-edit / lsp 之前,二者在挂载时捕获锁服务。
272
+ - id: edit-lock
273
+ name: 'weir-harness/edit-lock'
274
+ # F7 锚点编辑:read 锚点增强 + fail-closed hash_edit 工具
275
+ - id: hashline-edit
276
+ name: 'weir-harness/hashline-edit'
277
+ config:
278
+ # hash_edit 为预设默认唯一编辑工具;配置 false 回归与 stock edit 共存
279
+ hideStockEdit: true
280
+ # LSP 语义工具:能力总闸(默认关)。设置 lspEnabled 开启后,会话内
281
+ # 由面板开关或 `lsp` 工具按会话启用/禁用(新会话默认关)。
282
+ - id: lsp
283
+ name: 'weir-harness/lsp'
284
+ - id: tool-ask-user
285
+ name: '@deepseek-ai/dsh-tool-ask-user'
286
+ - id: tool-todo
287
+ name: '@deepseek-ai/dsh-tool-todo'
288
+ config:
289
+ allowParallelInProgress: true
290
+ - id: tool-web
291
+ name: '@deepseek-ai/dsh-tool-web'
292
+ config:
293
+ fetch: true
294
+ searchTimeoutMs: 60000
295
+ - id: present
296
+ name: '@deepseek-ai/dsh-tool-present'
297
+ - id: tool-plugin-manager
298
+ name: '@deepseek-ai/dsh-plugin-manager/tools'
299
+ disabled: true
300
+ # Weir 创造模式 (weir-creative): the full `weir` composition above
301
+ # fused with the DSH creative mode (cordis preset) deltas — runtime
302
+ # inspection tools, persistent plugin management, and the Cordis
303
+ # development skills. MAINTENANCE RULE: any change to the `weir`
304
+ # preset's plugin list MUST be mirrored here (guarded by
305
+ # test/preset-creative.test.js); only the three documented deltas may
306
+ # diverge.
307
+ - id: preset-weir-creative
308
+ name: '@deepseek-ai/dsh-agent-preset'
309
+ config:
310
+ id: weir-creative
311
+ name: Weir 创造模式
312
+ description: Weir creative mode — the full Weir harness fused with the DSH creative mode for debugging and experimenting with DSH itself — runtime inspection (cordis_inspect_*), persistent plugin management, and the Cordis plugin/preset development skills.
313
+ order: 6
314
+ plugins:
315
+ - id: persona
316
+ name: '@deepseek-ai/dsh-persona'
317
+ config:
318
+ prefix: >-
319
+ You are the Orchestrator, the user's single point of collaboration, powered by the {{model}} model.
320
+ You understand intent, decompose work, delegate to specialist sub-agents, choose parallel fan-out
321
+ or sequenced waiting, verify evidence, and report results.
322
+ suffix: Your working directory is {{cwd}}.
323
+ - id: weir-core
324
+ name: 'weir-harness/core'
325
+ # Creative-only: how to use the fused tooling (inspection order,
326
+ # plugin-management discipline, development skills, composition
327
+ # rules). The `weir` preset does not mount this section.
328
+ - id: creative-guide
329
+ name: 'weir-harness/creative-guide'
330
+ - id: agent-instructions
331
+ name: '@deepseek-ai/dsh-agent-instructions'
332
+ config:
333
+ maxBytes: 65536
334
+ - id: tool-bash
335
+ name: '@deepseek-ai/dsh-tool-bash'
336
+ disabled: !!js process.platform === 'win32'
337
+ - id: tool-pwsh
338
+ name: '@deepseek-ai/dsh-tool-pwsh'
339
+ disabled: !!js process.platform !== 'win32'
340
+ - id: tool-fs
341
+ name: '@deepseek-ai/dsh-tool-fs'
342
+ - id: tool-fs-search
343
+ name: '@deepseek-ai/dsh-tool-fs-search'
344
+ config:
345
+ sampleOverCapGlobResults: false
346
+ - id: tool-jobs
347
+ name: '@deepseek-ai/dsh-tool-jobs'
348
+ config:
349
+ maxConsecutiveWakes: 8
350
+ # Same capabilities group as `weir` (S11 realm structure), with
351
+ # the creative delta: customSkillDirs resolves the Cordis
352
+ # development skills shipped inside @deepseek-ai/dsh-agent-preset,
353
+ # and baselineScopes admits them into the first-session baseline.
354
+ - id: capabilities
355
+ name: cordis:group
356
+ group: true
357
+ isolate:
358
+ weirMcpGate: true
359
+ weirMcpManager: true
360
+ config:
361
+ - id: weir-skill-selection
362
+ name: 'weir-harness/skill-selection'
363
+ config:
364
+ supplementalSkillDirs:
365
+ - !!js (() => { try { const p = process.getBuiltinModule('node:path'); return p.join(p.dirname(process.getBuiltinModule('node:module').createRequire(baseUrl).resolve('@deepseek-ai/dsh-agent-preset/package.json')), 'skills') } catch { return process.getBuiltinModule('node:path').join(process.getBuiltinModule('node:os').tmpdir(), 'dsh-agent-preset-skills-unavailable') } })()
366
+ customSkillDirs:
367
+ # Same resolution as the cordis preset's skill-filesystem
368
+ # row, wrapped fail-safe: an unresolvable package degrades
369
+ # to a nonexistent path (enumerated as an empty root),
370
+ # never to a profile-load failure.
371
+ - !!js (() => { try { const p = process.getBuiltinModule('node:path'); return p.join(p.dirname(process.getBuiltinModule('node:module').createRequire(baseUrl).resolve('@deepseek-ai/dsh-agent-preset/package.json')), 'skills') } catch { return process.getBuiltinModule('node:path').join(process.getBuiltinModule('node:os').tmpdir(), 'dsh-agent-preset-skills-unavailable') } })()
372
+ baselineScopes:
373
+ - weir-builtin
374
+ - custom
375
+ - id: weir-mcp-manager
376
+ name: 'weir-harness/mcp-manager'
377
+ - id: tool-skill
378
+ name: '@deepseek-ai/dsh-tool-skill'
379
+ - id: planning
380
+ name: cordis:group
381
+ group: true
382
+ isolate:
383
+ planMode: true
384
+ config:
385
+ - id: plan-mode
386
+ name: '@deepseek-ai/dsh-plan-mode'
387
+ config:
388
+ section: |
389
+ You are in plan mode. Stay in plan mode until exit_plan_mode succeeds or the user switches the session mode. Imperative language to implement changes means plan the implementation, not execute it. A user's conversational agreement — including an answer confirming something you asked — approves nothing and does not end plan mode; fold the confirmed decision into the plan and submit it through exit_plan_mode.
390
+
391
+ Explore first. Use non-mutating reads, searches, static analysis, and checks to ground the plan in the actual repository. Do not edit or write files, change configuration, run formatters or code generation that rewrites tracked files, commit, or otherwise carry out the plan. Prefer existing functions and patterns over new machinery.
392
+
393
+ The tool catalog stays the same across modes for request-cache stability. These plan-mode rules override any later tool description or guidance that suggests using mutation tools; those tools remain listed to keep the tool catalog unchanged. Do not use todo_write to track this planning phase: it tracks implementation after an approved plan, while the plan itself belongs in exit_plan_mode.
394
+
395
+ Resolve discoverable facts by inspection. Use ask_user_question only for user-owned choices or material ambiguity that inspection cannot answer. Do not ask the user where code lives or how current behavior works when you can find out.
396
+
397
+ Make the plan decision-complete: state the goal and success criteria; group implementation changes by subsystem; identify public API, schema, and data-flow changes; cover edge cases, failure modes, tests, acceptance criteria, and explicit assumptions. Keep it concise enough to review but detailed enough that another engineer can implement it without making design decisions.
398
+
399
+ When ready, call exit_plan_mode with the complete plan markdown, starting with a # title. Make exit_plan_mode the only and final tool call in that assistant response: it presents the plan for approval, and implementation begins only in a later step after approval. Do not paste the final plan as a plain reply or ask "should I proceed?" through prose or ask_user_question. If review rejects it, incorporate the feedback and present again. If the review channel is unavailable or aborted, stay in plan mode and ask the user to switch modes manually; do not proceed with implementation.
400
+ - id: compaction
401
+ name: cordis:group
402
+ group: true
403
+ isolate:
404
+ compaction: true
405
+ toolResultPruner: true
406
+ config:
407
+ - id: compaction-basic
408
+ name: '@deepseek-ai/dsh-compaction-basic'
409
+ - id: command-compact
410
+ name: '@deepseek-ai/dsh-command-compact'
411
+ - id: tool-result-pruner
412
+ name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
413
+ config:
414
+ thresholdChars: 8192
415
+ headChars: 4096
416
+ tailChars: 1024
417
+ - id: context-guard
418
+ name: 'weir-harness/context-guard'
419
+ - id: delegation
420
+ name: cordis:group
421
+ group: true
422
+ isolate:
423
+ workflowEngine: true
424
+ weirEditLock: true
425
+ weirWorktreeLanes: true
426
+ weirBlackboard: true
427
+ config:
428
+ - id: tool-subagent-control
429
+ name: '@deepseek-ai/dsh-tool-subagent-control'
430
+ - id: tool-subagent-list-agents
431
+ name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
432
+ - id: tool-subagent
433
+ name: '@deepseek-ai/dsh-tool-subagent'
434
+ config:
435
+ provider: spawn
436
+ toolName: subagent
437
+ modelSelectionSettings: true
438
+ backgroundMode: continuable
439
+ - id: tool-subagent-fork
440
+ name: '@deepseek-ai/dsh-tool-subagent'
441
+ config:
442
+ provider: fork
443
+ toolName: subagent_fork
444
+ backgroundMode: continuable
445
+ - id: workflow-ptc
446
+ name: '@deepseek-ai/dsh-workflow-ptc'
447
+ config:
448
+ provider: spawn
449
+ - id: tool-workflow
450
+ name: '@deepseek-ai/dsh-tool-workflow'
451
+ - id: tool-ralph
452
+ name: '@deepseek-ai/dsh-tool-ralph'
453
+ disabled: true
454
+ config:
455
+ subagentProvider: spawn
456
+ maxRounds: 64
457
+ - id: intent-gate
458
+ name: 'weir-harness/intent-gate'
459
+ - id: worktree
460
+ name: 'weir-harness/worktree'
461
+ - id: delegate
462
+ name: 'weir-harness/delegate'
463
+ - id: blackboard
464
+ name: 'weir-harness/blackboard'
465
+ - id: todo-driver
466
+ name: 'weir-harness/todo-driver'
467
+ # Must precede hashline-edit / lsp (mount-time capture).
468
+ - id: edit-lock
469
+ name: 'weir-harness/edit-lock'
470
+ - id: hashline-edit
471
+ name: 'weir-harness/hashline-edit'
472
+ config:
473
+ hideStockEdit: true
474
+ - id: lsp
475
+ name: 'weir-harness/lsp'
476
+ - id: tool-ask-user
477
+ name: '@deepseek-ai/dsh-tool-ask-user'
478
+ - id: tool-todo
479
+ name: '@deepseek-ai/dsh-tool-todo'
480
+ config:
481
+ allowParallelInProgress: true
482
+ - id: tool-web
483
+ name: '@deepseek-ai/dsh-tool-web'
484
+ config:
485
+ fetch: true
486
+ searchTimeoutMs: 60000
487
+ # Creative delta 1: read-only Cordis runtime inspection tools.
488
+ - id: tool-cordis
489
+ name: '@deepseek-ai/dsh-tool-cordis'
490
+ - id: present
491
+ name: '@deepseek-ai/dsh-tool-present'
492
+ # Creative delta 2: persistent plugin management, enabled under a
493
+ # profile context exactly like the shipped creative mode.
494
+ - id: tool-plugin-manager
495
+ name: '@deepseek-ai/dsh-plugin-manager/tools'
496
+ disabled: !!js "!ctx.get('profileContext')"