nx-kv 0.66.3 → 0.67.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 (100) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/assets/nx-kv/references/A02-/346/217/220/344/272/244/344/273/273/345/212/241.md +6 -7
  3. package/assets/nx-kv/references/B02-CLI/351/200/237/346/237/245.md +2 -2
  4. package/package.json +1 -1
  5. package/src/core/db/import-json/tasks.ts +10 -9
  6. package/src/core/db/import-json.ts +16 -6
  7. package/src/core/db/index.ts +1 -1
  8. package/src/core/db/verify.ts +7 -3
  9. package/src/core/topic-key.ts +5 -8
  10. package/src/core/workflow/readiness.ts +1 -1
  11. package/src/core/workflow/types.ts +1 -1
  12. package/src/modules/claim/host.ts +2 -2
  13. package/src/modules/claim/wait.ts +9 -49
  14. package/src/modules/localtask/actions/localtask-add.ts +1 -3
  15. package/src/modules/localtask/actions/localtask-boardtasks.ts +0 -1
  16. package/src/modules/localtask/actions/localtask-clone.ts +1 -1
  17. package/src/modules/localtask/infra/events.ts +5 -5
  18. package/src/modules/localtask/infra/repo/rows.ts +0 -1
  19. package/src/modules/localtask/infra/repo/topics.ts +0 -4
  20. package/src/modules/localtask/lifecycle/add.ts +2 -9
  21. package/src/modules/localtask/lifecycle/deletion.ts +7 -15
  22. package/src/modules/localtask/lifecycle/task-lifecycle.ts +2 -2
  23. package/src/modules/localtask/lifecycle/task-ops.ts +14 -56
  24. package/src/modules/localtask/lifecycle/task-view.ts +2 -3
  25. package/src/modules/localtask/lifecycle/topics.ts +0 -2
  26. package/src/modules/localtask/paths.ts +7 -17
  27. package/src/modules/localtask/service.ts +3 -7
  28. package/src/modules/localtask/ui/action-flags.ts +2 -2
  29. package/src/modules/localtask/ui/action-render.ts +4 -7
  30. package/src/modules/localtask/waiting.ts +1 -8
  31. package/src/modules/templates/scope.ts +1 -1
  32. package/src/web/frontend/App.tsx +4 -9
  33. package/src/web/frontend/api/cli-tree.json +2 -2
  34. package/src/web/frontend/api/client.generated.ts +3 -3
  35. package/src/web/frontend/api/tasks.ts +1 -1
  36. package/src/web/frontend/components/sidebar/index.tsx +52 -48
  37. package/src/web/frontend/components/sidebar/model.ts +16 -32
  38. package/src/web/frontend/components/sidebar/queue-nav.ts +3 -4
  39. package/src/web/frontend/components/sidebar/row-menu.tsx +1 -1
  40. package/src/web/frontend/components/sidebar/task-children.tsx +39 -21
  41. package/src/web/frontend/components/task-panel/task-ops.ts +3 -3
  42. package/src/web/frontend/modules/board/board-view.ts +2 -56
  43. package/src/web/frontend/modules/md/doc-store.ts +2 -3
  44. package/src/web/frontend/page/dag/head-bar.tsx +0 -1
  45. package/src/web/frontend/page/dag/index.tsx +1 -4
  46. package/src/web/frontend/page/dag/model.ts +0 -1
  47. package/src/web/frontend/page/dir/index.tsx +21 -25
  48. package/src/web/frontend/page/dir/task-actions.ts +20 -32
  49. package/src/web/frontend/page/dir/task-chain.ts +6 -10
  50. package/src/web/frontend/page/dir/task-dock-panel.tsx +2 -5
  51. package/src/web/frontend/page/dir/task-feedback.ts +9 -17
  52. package/src/web/frontend/page/dir/task-not-found.tsx +2 -3
  53. package/src/web/frontend/page/dir/task-utils.ts +0 -1
  54. package/src/web/frontend/page/dir/task.tsx +13 -17
  55. package/src/web/frontend/page/group/index.tsx +2 -3
  56. package/src/web/frontend/page/progress/index.tsx +7 -12
  57. package/src/web/frontend/panels.tsx +1 -1
  58. package/src/web/frontend/registry.ts +1 -2
  59. package/src/web/frontend/route-map.ts +0 -1
  60. package/src/web/frontend/routes/dir.ts +1 -4
  61. package/src/web/frontend/routes/keys.ts +5 -3
  62. package/src/web/frontend/svghub/catalog-nav.ts +8 -11
  63. package/src/web/public/assets/app-context-CngKv8Tc.js +1 -0
  64. package/src/web/public/assets/{bar-D7cWe7Kp.js → bar-C0Q_Qe4z.js} +1 -1
  65. package/src/web/public/assets/board-view-C8OQhkyi.js +1 -0
  66. package/src/web/public/assets/{button-3JlUeln_.js → button-Cs6w2CDi.js} +1 -1
  67. package/src/web/public/assets/{composer-launch--nJGFG35.js → composer-launch-BF3_hyn5.js} +1 -1
  68. package/src/web/public/assets/{composer-panel-Dhivt7UJ.js → composer-panel-D6vBrzCs.js} +1 -1
  69. package/src/web/public/assets/{dag-DUhHxgTk.js → dag-CZF6sV2_.js} +1 -1
  70. package/src/web/public/assets/dir-6RhnWw1E.js +1 -0
  71. package/src/web/public/assets/{doc-QBHQi1EV.js → doc-CVIVBV6n.js} +1 -1
  72. package/src/web/public/assets/group-AF62Z-_G.js +1 -0
  73. package/src/web/public/assets/index-Bposj22Z.js +3 -0
  74. package/src/web/public/assets/{list-search-B2S2g8kn.js → list-search-DFvFY408.js} +1 -1
  75. package/src/web/public/assets/{md-history-DdM6P9Gq.js → md-history-COQu16vy.js} +1 -1
  76. package/src/web/public/assets/{member-picker-BZgE3HGb.js → member-picker-CHX0nS0O.js} +1 -1
  77. package/src/web/public/assets/popup-dBtYqEM1.js +1 -0
  78. package/src/web/public/assets/progress-CDh6DY7g.js +3 -0
  79. package/src/web/public/assets/{refs-CCZgGPlL.js → refs-t79ynSY8.js} +1 -1
  80. package/src/web/public/assets/{reopen-text-BC9a8KOp.js → reopen-text-B2d9SZi0.js} +1 -1
  81. package/src/web/public/assets/{repo-form-modal-D8WabN0R.js → repo-form-modal-dZqpHyUj.js} +1 -1
  82. package/src/web/public/assets/{repos-V5xb5Kz-.js → repos-DdhOQJqF.js} +1 -1
  83. package/src/web/public/assets/{route-crumb-DX9C4jmQ.js → route-crumb-BKq2jry0.js} +1 -1
  84. package/src/web/public/assets/{settings-CAOSCF3E.js → settings-Bk3clN2f.js} +1 -1
  85. package/src/web/public/assets/task-C8nax2rT.js +13 -0
  86. package/src/web/public/assets/{task-ops-DZgza5eZ.js → task-ops-D6E_TgEC.js} +2 -2
  87. package/src/web/public/assets/task-utils-Dh33OFKe.js +1 -0
  88. package/src/web/public/assets/{templates-6ClSnYJN.js → templates-Dusbff7Z.js} +3 -3
  89. package/src/web/public/assets/{tool-bar-BYdfBQeo.js → tool-bar-DPXnjdQF.js} +1 -1
  90. package/src/web/public/assets/{use-rail-drag-BMXJ48je.js → use-rail-drag-B6J0iqFK.js} +1 -1
  91. package/src/web/public/index.html +12 -12
  92. package/src/web/public/assets/app-context-BqCBcDsx.js +0 -1
  93. package/src/web/public/assets/board-view-Cm8189wG.js +0 -1
  94. package/src/web/public/assets/dir-CkYGYT9e.js +0 -1
  95. package/src/web/public/assets/group-CfJxWA7V.js +0 -1
  96. package/src/web/public/assets/index-ByAPGidL.js +0 -3
  97. package/src/web/public/assets/popup-DZ2Khv2c.js +0 -1
  98. package/src/web/public/assets/progress-BVpSy-uF.js +0 -3
  99. package/src/web/public/assets/task-BwWlNP0i.js +0 -13
  100. package/src/web/public/assets/task-utils--WIpAwUx.js +0 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,37 @@
2
2
 
3
3
  本文件对外可见的变更。格式参考 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/)。
4
4
 
5
+ ## [0.67.0] - 2026-11-24 删除「全局任务池」(breaking)
6
+
7
+ 用户口径:「全局任务模块和功能安全删了吧,get 的时候也不需要考虑全局任务,项目也不
8
+ 需要出现全局任务的任何概念了」。
9
+
10
+ ### Breaking
11
+
12
+ - **全局任务池整条链路删除**:队列一律绑定目录,不再有跨目录共享池。
13
+ - `localtask add` / `get` 不带 `--cwd` → 落**当前工作目录**(原来进全局池);
14
+ - `localtask add --global` 参数删除(传了报未知参数);
15
+ - `wait` / `get` 领取顺序只剩「本目录队列 → 阻塞」,删除跨目录全局兜底与全局 FIFO 唤醒;
16
+ - `#/global` 深链与未知路径统一落「仓库管理」;侧栏不再有「全局任务」行;
17
+ - `topicKeyOf('')` 直接报错(不再返回 `__GLOBAL__`);
18
+ - 迁移旧数据:空 cwd 的队列行**整行跳过**(导入自检与 `db verify` 对账同步扣除)。
19
+ - 后端删除:`GLOBAL_KEY` / `GLOBAL_NAME` / `GLOBAL_CWD` / `isGlobalKey` /
20
+ `GLOBAL_TOPIC_KEY` / `TOPIC_EXT.GLOBAL` / `resolveCwd` 兜底之外的全局分支(lifecycle、
21
+ waiting、events、claim/wait、claim/host、boardtasks、action-render、action-flags);
22
+ - 前端删除:侧栏全局行与 globe 菜单、`#/global` 路由与 `registry` 视图、
23
+ `board-view` 的 `GLOBAL_KEY` / `GLOBAL_NAME` / `withGlobalRow` / `globalPlaceholderTopic`、
24
+ dir/progress/dag/group 的 `isGlobal` 分支、`routes/keys.ts` 的 `GLOBAL_KEY`;
25
+ - 文档:`A02-提交任务` 删 `--global` 投递路径、`A03` docs detach 口径、`B02-CLI速查` 同步。
26
+
27
+ ### Removed
28
+
29
+ - 库内 `__GLOBAL__` 队列及其 16 条任务(按用户决定一并删除,删除前已备份原文)。
30
+
31
+ ### Verification
32
+
33
+ - lint 0 errors、typecheck(node + web)、build、smoke 97/97、全量单测 160 文件逐个全过;
34
+ - CDP 实测侧栏无「全局任务」行、`#/global` 落仓库管理。
35
+
5
36
  ## [0.66.3] - 2026-11-23 附件挂参考仓库 + 内部资源强制访问 + 移除只解除关联(#183–#189 / #251)
6
37
 
7
38
  ### Added
@@ -27,19 +27,18 @@
27
27
 
28
28
  4. **投递**(见下)——记下返回的 `task.id`,向用户报告「投到哪个目录、第几号」。
29
29
 
30
- ## 投递:三条路,按「谁该领」选
30
+ ## 投递:两条路,按「谁该领」选
31
31
 
32
32
  ```bash
33
- # ① 投到目标目录的队列(--cwd = 接收方 agent 的工作目录,不是你的)
33
+ # ① 投到目标目录的队列(--cwd = 接收方 agent 的工作目录,不是你的;缺省 = 当前目录)
34
34
  nx-kv localtask add "<任务文本>" --cwd "<目标目录>" --json
35
35
 
36
- # ② 不限定接收方 → 全局共享池(忽略 --cwd,谁闲谁领)
37
- nx-kv localtask add "<任务文本>" --global --json
38
-
39
- # ③ 挂到项目/组(任务才会出现在对应的组面板与项目上下文里)
36
+ # ② 挂到项目/组(任务才会出现在对应的组面板与项目上下文里)
40
37
  nx-kv localtask add "<任务文本>" --project <仓库key> --board <组id> --json
41
38
  ```
42
39
 
40
+ > #190 起「全局共享池」已删除:队列一律绑定目录,`get/wait` 只在本目录队列里等。
41
+
43
42
  返回 `{ status:"ok", task:{id,…}, queued|delivered }`:`queued:true` = 已入队(目标目录正在
44
43
  wait/get 的 agent 约 0.5 秒内取走,没人等就排队);`delivered` = 已经被领走。
45
44
 
@@ -189,7 +188,7 @@ done / 被取代。已领取/已完成的任务不会再被派发,不走 reope
189
188
  | 只写「做什么」不写「怎么验证」 | ②里带上关键路径与验证入口(跑哪条命令 / 看哪张表) |
190
189
  | 长文本用引号硬拼 | `--file <文件>` 或 `--file -`(标准输入);换行逐字保留 |
191
190
  | 大需求塞成一条 | 拆成多条可独立完成的单元;顺序重要时 `reorder` 校正 |
192
- | 有依赖的步骤走 `--global` | 全局池不保顺序,必须 `--cwd` 投到同一目录队列 |
191
+ | 有依赖的步骤投到不同目录 | 依赖是队列内语义,必须 `--cwd` 投到同一目录队列 |
193
192
  | 提交完自己去 `get` | 那是接收方的事;要跟进等它 `reopen` 回来 |
194
193
  | 已领取的任务想改时间目标 | `update` 改不了(已起表);走 `reopen` 派生下一轮 |
195
194
  | 想法直接 add 进队列 | add 完立刻 `plan --to plan`,别让人领到半成品 |
@@ -12,7 +12,7 @@
12
12
  | 命令 | 关键参数 | 说明 |
13
13
  | --- | --- | --- |
14
14
  | `localtask get` | `--cwd` `--timeout N` `--no-open` `--param k=v` | **领活**。有活立即领;`--timeout` 显式给定时阻塞到上限(等不到返回 `timeout`) |
15
- | `localtask add` | `--cwd` `--global` `--summary` `--project` `--board` `--duration 2h` `--goal-prompt` `--block-by 12,13` `--gate` `--fork-of` `--fork-kind` `--file <文件|->` | 提交任务。`--project` 决定归属项目并推导落点目录;`--board` 给组(任务才出现在组面板);`--global` 进共享池(忽略 `--cwd`);**`--file` 从文件/标准输入读正文**(多行长文本不必靠引号硬拼,`-` = stdin) |
15
+ | `localtask add` | `--cwd` `--summary` `--project` `--board` `--duration 2h` `--goal-prompt` `--block-by 12,13` `--gate` `--fork-of` `--fork-kind` `--file <文件|->` | 提交任务。`--project` 决定归属项目并推导落点目录;`--board` 给组(任务才出现在组面板);`--cwd` 缺省 = 当前目录(#190 起无全局池);**`--file` 从文件/标准输入读正文**(多行长文本不必靠引号硬拼,`-` = stdin) |
16
16
  | `localtask show` | `--id N` | 看单条(只读,**不领取**) |
17
17
  | `localtask list` | — | 全部主题概览(目录、现状、等待中、待领取数) |
18
18
  | `localtask done` | `--id N` `--summary "…"` | 标完成;summary 记为本轮终态 + timegoal 日志 |
@@ -139,7 +139,7 @@ nx-kv health # 服务与版本(纯本机)
139
139
  1. `get` 是领取、`show` 是查看——两个不同子命令,别拿 `show` 当领取。
140
140
  2. `wait` 不要再用:`get --timeout N` 等价,且只有一条路可维护。
141
141
  3. `update --text` 在任务被领取后无效(先 `reopen`)。
142
- 4. `add --cwd` 是**接收方**目录;`--global` 会忽略它。
142
+ 4. `add --cwd` 是**接收方**目录,缺省 = 当前目录(#190 起没有全局共享池)。
143
143
  5. 追加附件会改写正文,连续操作一律用 `--id` 定位。
144
144
  6. `docs` 的 ref 没有路径;读文件只有附件。
145
145
  7. `repo bind` 不收 `--note`,写说明要用 `repo ref note`(落成该参考仓库的一篇文档)。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nx-kv",
3
- "version": "0.66.3",
3
+ "version": "0.67.0",
4
4
  "description": "nx-kv — 本机任务队列(localtask)+ 文档库 + 仓库登记:serve 驱动 CLI 与 Web 面板,同源同构,附带可安装 skill 供 agent 提交 / 领取 / 阻塞接收任务",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,5 +1,5 @@
1
1
  // topics / tasks 阶段:legacy localtasks.json → topics + topic_presence + tasks(含内嵌 timegoal → goals)。
2
- import { topicKeyOf, GLOBAL_TOPIC_KEY } from '../../topic-key.js';
2
+ import { topicKeyOf } from '../../topic-key.js';
3
3
  import { anyTimeMs } from '../time.js';
4
4
  import {
5
5
  jsonText,
@@ -80,14 +80,16 @@ export function importTopicsAndTasks(
80
80
  note: 'schema 一条队列一个 cwd',
81
81
  });
82
82
  }
83
- const hasTasks = Array.isArray(topic.tasks) && topic.tasks.length > 0;
84
- if (!cwd && legacyKey !== GLOBAL_TOPIC_KEY && hasTasks) {
85
- // 异常行(v1/v2 迁移来的、没 cwd 的旧等待点):挂哨兵 + cwd='' + 报告
86
- report.warnings.push({
87
- what: 'topic',
88
- why: 'cwd 为空且不是全局池(旧 slot/session 迁移残留),cwd 落空串',
89
- legacyKey,
83
+ // #190:空 cwd 的队列行(历史上的全局池)**整行跳过**(不迁移)——
84
+ // 队列必须绑定真实目录;跳过并在报告里留痕,条目数与丢弃明细都能核对。
85
+ if (!cwd) {
86
+ report.discarded.push({
87
+ what: 'topic(空 cwd / 全局池)',
88
+ key: legacyKey,
89
+ count: Array.isArray(topic.tasks) ? topic.tasks.length : 0,
90
+ note: '#190 起队列必须绑定目录,空 cwd 行不迁移',
90
91
  });
92
+ continue;
91
93
  }
92
94
  const key = topicKeyOf(cwd, '');
93
95
  let row = byNewKey.get(key);
@@ -99,7 +101,6 @@ export function importTopicsAndTasks(
99
101
  const ext: Record<string, any> = { ext_legacy_key: legacyKey };
100
102
  if (topic.summary) ext.ext_last_summary = String(topic.summary);
101
103
  if (topic.manual) ext.ext_manual = 1;
102
- if (legacyKey === GLOBAL_TOPIC_KEY) ext.ext_global = 1;
103
104
 
104
105
  const createdAt = anyTimeMs(topic.createdAt, atMs);
105
106
  const res = db.run(
@@ -31,7 +31,7 @@
31
31
  // ── 迁移口径(与 docs/research/SQLITE-REFACTOR.md §6 对齐,差异见行内注释)──
32
32
  //
33
33
  // · 哨兵仓库 `__unbound__`:legacy 队列全都对不上真实仓库(key 是目录名 sha1),
34
- // 全局池 `__GLOBAL__` 也挂它下面;`cwd = ''`。不伪造 repo key、不放松 NOT NULL。
34
+ // 空 cwd 的历史行(#190 前的全局池)不迁移。不伪造 repo key、不放松 NOT NULL。
35
35
  // · `boards` → `repos(type='group')`,key = `group/<slug(初始 name)>`(冻结,
36
36
  // name 之后可改),旧 `b_xxx` 存 `ext.ext_legacy_id`。
37
37
  // · `consumedAt → claimed_at`(75/75 有值,它就是领取时刻)。
@@ -103,11 +103,16 @@ export interface ImportLegacyOptions {
103
103
  * 正文哈希不在这一步:body 就是本条代码从 text 直接写进去的,比了也是自证。
104
104
  * 它留给 `db verify`(那时是与磁盘上的 JSON 对账,才是真校验)。
105
105
  */
106
- function validateImport(conn: DbApi, { expectedTasks }: { expectedTasks: number }): void {
106
+ function validateImport(
107
+ conn: DbApi,
108
+ { expectedTasks, skippedTasks = 0 }: { expectedTasks: number; skippedTasks?: number },
109
+ ): void {
107
110
  const problems: string[] = [];
108
111
  const taskCount = Number((conn.get('SELECT count(*) AS c FROM tasks') || {}).c || 0);
109
- if (taskCount !== expectedTasks) {
110
- problems.push(`任务行数 ${taskCount} ≠ legacy ${expectedTasks}`);
112
+ // #190:空 cwd / 全局池的队列整行跳过,它们名下的任务不计入期望值
113
+ const want = expectedTasks - skippedTasks;
114
+ if (taskCount !== want) {
115
+ problems.push(`任务行数 ${taskCount} ≠ legacy ${want}(legacy ${expectedTasks} - 跳过全局池 ${skippedTasks})`);
111
116
  }
112
117
 
113
118
  const topics = conn.all('SELECT id, key, cwd, group_key, next_seq FROM topics');
@@ -179,8 +184,13 @@ export function importLegacy(db: DbApi, { appDir, docsDir, atMs = nowMs() }: Imp
179
184
 
180
185
  // 期望的任务总数:**从 legacy 里数**,不是从写进去的行数里数 —— 后者永远相等。
181
186
  let expectedTasks = 0;
187
+ let skippedTasks = 0;
182
188
  for (const t of Object.values(((localtasksData && localtasksData.topics) || {}) as Record<string, any>)) {
183
- expectedTasks += Array.isArray(t && t.tasks) ? t.tasks.length : 0;
189
+ const n = Array.isArray(t && t.tasks) ? t.tasks.length : 0;
190
+ expectedTasks += n;
191
+ // #190:全局池 / 空 cwd 的队列不迁移,其任务数从期望值里扣掉
192
+ const cwd = String((t && (t.cwd || (Array.isArray(t.cwds) && t.cwds[0]))) || '').trim();
193
+ if (!cwd) skippedTasks += n;
184
194
  }
185
195
 
186
196
  // 顺序即外键依赖:repos(含哨兵)→ members → topics → tasks → links/deps → goals
@@ -199,7 +209,7 @@ export function importLegacy(db: DbApi, { appDir, docsDir, atMs = nowMs() }: Imp
199
209
  report
200
210
  );
201
211
 
202
- validateImport(db, { expectedTasks });
212
+ validateImport(db, { expectedTasks, skippedTasks });
203
213
 
204
214
  setMeta(db, 'migrated_from_json_at', String(atMs), atMs);
205
215
  return report;
@@ -143,5 +143,5 @@ export { openRaw, bindValue } from './driver.js';
143
143
  export { CURRENT_SCHEMA_VERSION, REQUIRED_NODE_VERSION, checkNodeVersion } from './version.js';
144
144
  export { StoreMigrationError, StoreTooNewError, NotNxKvStoreError } from './errors.js';
145
145
  export { verifyStore, tableCounts, statusDistribution, findLegacyLocalTasks } from './verify.js';
146
- export { topicKeyOf, GLOBAL_TOPIC_KEY } from '../topic-key.js';
146
+ export { topicKeyOf } from '../topic-key.js';
147
147
  export { nowMs, parseStampMs, parseIsoMs, msToStamp, stampFileTag } from './time.js';
@@ -261,12 +261,16 @@ export function verifyStore(db: DbApi, { appDir }: { appDir?: string } = {}): Ve
261
261
  const problems: Array<Record<string, any>> = [];
262
262
  let compared = 0;
263
263
  let legacyTasks = 0;
264
+ let skippedGlobal = 0;
264
265
  for (const [legacyKey, lt] of Object.entries(legacyTopics)) {
265
266
  const topic = topicByLegacyKey.get(legacyKey);
266
267
  const tasks = Array.isArray(lt && lt.tasks) ? lt.tasks : [];
267
268
  legacyTasks += tasks.length;
268
269
  if (!topic) {
269
- problems.push({ legacyKey, why: '队列未迁移' });
270
+ // #190:全局池 / 空 cwd 的队列**按设计不迁移**——不算问题,只从对账基数里扣掉
271
+ const cwd = String((lt && (lt.cwd || (Array.isArray(lt.cwds) && lt.cwds[0]))) || '').trim();
272
+ if (!cwd) skippedGlobal += tasks.length;
273
+ else problems.push({ legacyKey, why: '队列未迁移' });
270
274
  continue;
271
275
  }
272
276
  for (const task of tasks) {
@@ -298,8 +302,8 @@ export function verifyStore(db: DbApi, { appDir }: { appDir?: string } = {}): Ve
298
302
  // 不会跟 —— 要求相等会让任何真实使用过的库永远红一条(T07 裁决)。
299
303
  add(
300
304
  'legacy 任务数 ≤ 迁移后任务数(库是活数据,允许新增)',
301
- legacyTasks <= statusTotal,
302
- `${legacyTasks} vs ${statusTotal}`
305
+ legacyTasks - skippedGlobal <= statusTotal,
306
+ `${legacyTasks}${skippedGlobal ? ` - 跳过全局池 ${skippedGlobal}` : ''} vs ${statusTotal}`
303
307
  );
304
308
  } else {
305
309
  add('每条 task 的 body 哈希 = 原 text', true, hashDetail);
@@ -15,11 +15,8 @@
15
15
  // 迁移时旧 key 只写进 `topics.ext.ext_legacy_key` 作取证,不参与任何查询。
16
16
  import crypto from 'node:crypto';
17
17
 
18
- /** 全局池的固定 key:跨目录共享队列,cwd 恒为空串。 */
19
- export const GLOBAL_TOPIC_KEY = '__GLOBAL__';
20
-
21
- /** 全局池的 cwd(`ux_topics_cwd_group` 里 `cwd COLLATE NOCASE` → 空串只容得下一行)。 */
22
- export const GLOBAL_TOPIC_CWD = '';
18
+ // #190:**全局池已删除**。队列一律绑定真实目录——没有 cwd 的调用方必须先解析出
19
+ // 当前目录(CLI 层用 process.cwd()),不允许再出现「无目录共享池」这种形态。
23
20
 
24
21
  /**
25
22
  * `(cwd, groupKey)` → 外部寻址串。
@@ -27,13 +24,13 @@ export const GLOBAL_TOPIC_CWD = '';
27
24
  * 大小写折叠(`toLowerCase`)与 schema 里 `ux_topics_cwd_group` 的 `COLLATE NOCASE`
28
25
  * 同口径:D:/Work/Web 与 D:/work/web 必须算出同一个 key,否则「同一条队列两个名字」。
29
26
  *
30
- * @param cwd 本机目录(全局池传空串)
27
+ * @param cwd 本机目录(必填——#190 起不再有全局池)
31
28
  * @param groupKey 组上下文 key(无组上下文传空串/null)
32
- * @returns 全局池恒为 `__GLOBAL__`;其余为 16 位 sha1 前缀
29
+ * @returns 16 位 sha1 前缀
33
30
  */
34
31
  export function topicKeyOf(cwd: unknown, groupKey: unknown = ''): string {
35
32
  const dir = String(cwd ?? '');
36
- if (dir === '') return GLOBAL_TOPIC_KEY;
33
+ if (dir === '') throw new Error('topicKeyOf: 需要 cwd(#190 起全局池已删除,队列必须绑定目录)');
37
34
  const group = String(groupKey ?? '');
38
35
  return crypto
39
36
  .createHash('sha1')
@@ -11,7 +11,7 @@
11
11
  import { edgesFromTasks, taskToNode, isGateNode } from './types.js';
12
12
  import type { WfEdge, WfNode } from './types.js';
13
13
 
14
- /** topicKey:id —— key 允许字母数字与 _-(含 __GLOBAL__) */
14
+ /** topicKey:id —— key 允许字母数字与 _- */
15
15
  const FOREIGN_RE = /^([A-Za-z0-9_-]+):(\d+)$/;
16
16
 
17
17
  export type DepRef = { kind: 'local'; id: number } | { kind: 'foreign'; key: string; id: number };
@@ -1,7 +1,7 @@
1
1
  // workflow 契约(#34 阶段 0)—— 冻结类型;#237 引擎门(facade)已删除,仅剩写路径底座在用。
2
2
  //
3
3
  // 对照参考方案(Node+TS DAG 动态工作流)在 nx-kv 上的映射:
4
- // workflowId → 主题 key(cwd 归一化 / repos key;全局 '__GLOBAL__')
4
+ // workflowId → 主题 key(cwd 归一化 / repos key)
5
5
  // submit(init) → localtask add(只入队,不构造全图)
6
6
  // get(id,node?) → 引擎门(#237 已删除;现役领取走 localtask.get,即 claim 域)
7
7
  // Node → localtask 一条任务(id 数字;状态用 status+completedAt)
@@ -19,7 +19,7 @@
19
19
  // 「这段是哪来的」。真实领取不传 trace,行为与改造前逐字节一致。
20
20
  import { formatDuration, formatGoalTiming } from '../../core/instruction-template.js';
21
21
  import { parseFrontmatter } from '../../shared/frontmatter.js';
22
- import { isGlobalKey, pendingQueueInfo } from '../localtask/service.js';
22
+ import { pendingQueueInfo } from '../localtask/service.js';
23
23
  import { assembleDelivery, type AssembledDelivery } from './assemble.js';
24
24
  import { annotateTaskDelivery, attachTemplateCtx } from '../localtask/ops/attach.js';
25
25
  import { readGroupContext } from './groupctx.js';
@@ -87,7 +87,7 @@ export function enrichGoalTiming(g: any): any {
87
87
  // 绝不写盘:showTimegoal 走 loadRecycledStore({persist:false})——timegoals.json
88
88
  // 字节数不变,goal-expiry 单测字节比对钉着。
89
89
  async function readGoalCtx(cwd: unknown): Promise<Record<string, any> | null> {
90
- if (!cwd || isGlobalKey(cwd)) return null; // cwd 是路径,isGlobalKey 恒 false——纯防御
90
+ if (!cwd) return null; // 没有目录就没有组上下文(#190 起不再有全局池)
91
91
  try {
92
92
  const show = await timegoal.showTimegoal({ cwd });
93
93
  if (!show || !show.hasGoal) return null;
@@ -17,12 +17,9 @@ import {
17
17
  consumeCancelRequest,
18
18
  claimFirstPending,
19
19
  getSettings,
20
- GLOBAL_KEY,
21
- isGlobalKey,
22
20
  normalizeCwd,
23
21
  normalizeSummary,
24
22
  probeEffectivePresence,
25
- registerGlobalWaiter,
26
23
  registerTopicWaiter,
27
24
  repoContextIndex,
28
25
  repoCtxOf,
@@ -46,7 +43,7 @@ const POLL_MS = 500;
46
43
 
47
44
  // 等待期到点探针(只读、不写盘):返回该目录目标的截止 epoch ms;已到点/无目标 → 0
48
45
  async function readGoalDeadlineMs(key: unknown): Promise<number> {
49
- if (!key || isGlobalKey(key)) return 0;
46
+ if (!key) return 0;
50
47
  try {
51
48
  const g = await timegoal.probeGoalExpiry(key);
52
49
  if (!g || g.reached) return 0; // 已经到点的:不参与自动取消
@@ -60,7 +57,7 @@ async function readGoalDeadlineMs(key: unknown): Promise<number> {
60
57
  // ─── 阻塞等待:核心入口 ─────────────────────────────────────────────
61
58
 
62
59
  export interface WaitForTaskOptions {
63
- /** 工作目录(主题按目录名识别);缺省 → 进程当前 cwd。显式传 cwd **不会**关闭全局兜底 */
60
+ /** 工作目录(主题按目录名识别);缺省 → 进程当前 cwd */
64
61
  cwd?: unknown;
65
62
  /** 当前现状(#171 起不再必填:面板上没有对应输入界面) */
66
63
  summary?: unknown;
@@ -90,8 +87,8 @@ type WaitOutcome =
90
87
 
91
88
  /**
92
89
  * 针对某主题(工作目录)等待用户回填下一条任务。
93
- * 领取顺序:本目录队列 → 全局主题(共享池)→ 阻塞(两个来源任一到达即唤醒)。
94
- * 返回带 source: 'local' | 'global' 标明任务来自哪个队列。
90
+ * 领取顺序:本目录队列 → 阻塞(#190 起全局共享池已删除,不再跨目录兜底)。
91
+ * 返回带 source: 'local' 标明任务来自本目录队列。
95
92
  */
96
93
  export async function waitForTask({
97
94
  cwd: rawCwd,
@@ -131,33 +128,13 @@ export async function waitForTask({
131
128
  return { status: 'ok', key, cwd, name, summary, ...delivery, queued: true, source: 'local', repo: repoCtx };
132
129
  }
133
130
 
134
- // 1b. 本地空 → 去全局主题(共享池)领。这是所有领取的**无条件默认兜底**:
135
- // 与是否显式传 --cwd 无关——本地取不到就一定来全局扫一眼,全局也没有才阻塞。
136
- // (防止调用方习惯性传 cwd 导致共享池永远无人领取。)
137
- // instant(localtask get 默认形态):两处快路径都没货 → 立即返回,不进阻塞窗口。
131
+ // 1b. 本地空 → 没货了(#190 起不再去全局共享池兜底)。
132
+ // instant(localtask get 默认形态):本地没货就立即返回,不进阻塞窗口。
138
133
  // 「无任务时唤起阻塞等待」是 waitgoal(项目 getLoop)的语义,见 claim/get.ts。
139
134
  if (instant) {
140
135
  return { status: 'timeout', key, cwd, name, summary, timeoutMs: 0, instant: true };
141
136
  }
142
137
 
143
- const fromGlobal = await claimFirstPending(GLOBAL_KEY, summary, by);
144
- if (fromGlobal) {
145
- // 全局池投递渲染的仍是**等待方目录**的 goal——目标绑定在等待中的 agent 目录上,
146
- // 与任务来自哪个队列无关。
147
- const delivery = await buildTaskDelivery(fromGlobal, { source: 'global', summary, cwd, name, topicKey: key, params, getLoopEnabled, getLoopWaitMinutes });
148
- return {
149
- status: 'ok',
150
- key,
151
- cwd,
152
- name,
153
- summary,
154
- ...delivery,
155
- queued: true,
156
- source: 'global',
157
- repo: repoCtx,
158
- };
159
- }
160
-
161
138
  // 1c. 这个目录的时间目标**还在跑** → 记下它的截止时刻。
162
139
  // 等待期间一旦越过这个时刻,本轮立刻收尾(见下方 goalPoll)。
163
140
  // 目标早就过期的(reached)不记:那是"这一局已经结束了",
@@ -179,7 +156,7 @@ export async function waitForTask({
179
156
  const presence = panelInfo.running ? await probeEffectivePresence() : 0;
180
157
  const deepLink = deepLinkUrl(key, panelInfo.port || DEFAULT_PORT);
181
158
 
182
- // 3. 结果承诺:三个生产者(同进程本地 waiter / 同进程全局 FIFO / 跨进程轮询)+ 超时
159
+ // 3. 结果承诺:两个生产者(同进程本地 waiter / 跨进程轮询)+ 超时(#190 全局 FIFO 已删)
183
160
  let resolveOutcome!: (r: WaitOutcome) => void;
184
161
  const outcome = new Promise<WaitOutcome>((r) => {
185
162
  resolveOutcome = r;
@@ -187,19 +164,10 @@ export async function waitForTask({
187
164
  registerTopicWaiter(key, {
188
165
  resolve: (task: any) => resolveOutcome({ kind: 'task', task, delivered: true }),
189
166
  });
190
- // 全局兜底:同进程有人 addTask({global:true}) 时按 FIFO 唤醒本轮等待
191
- const unregisterGlobal = registerGlobalWaiter(
192
- (task: any) => resolveOutcome({ kind: 'task', task, delivered: true, source: 'global' }),
193
- summary,
194
- // by 承载 {key,cwd,name} 对象(领取后记进 task.claimedBy,见 task-ops 的 gw.by 消费);
195
- // waiters 层的 by 已按 WaiterBy 标注(曾误标 string),此处直接透传
196
- by
197
- );
198
-
199
167
  const timer = setTimeout(() => resolveOutcome({ kind: 'timeout' }), tmo);
200
168
 
201
169
  // 三个 500ms 节拍的轮询合一为一个 ticker(原 poll/cancelPoll/goalPoll 三个 setInterval):
202
- // ① 跨进程兜底轮询:先查本地,再查全局(本地优先;同轮至多 resolve 一次)
170
+ // ① 跨进程兜底轮询:只查本地队列(#190 起不再查全局池)
203
171
  // ② 关闭轮询:用户在面板点了「关闭」→ 立即收尾本轮(走与超时同一条出口,只多带
204
172
  // cancelled 标记,agent 不必认识新状态,照常结束本轮)
205
173
  // ③ 时间目标到点 → 立刻收尾本轮(等的是"下一条任务",预算用完了就没必要等)。
@@ -215,14 +183,7 @@ export async function waitForTask({
215
183
  }
216
184
  claimFirstPending(key, undefined, by)
217
185
  .then((task: any) => {
218
- if (task) {
219
- resolveOutcome({ kind: 'task', task, delivered: false, source: 'local' });
220
- return null;
221
- }
222
- return claimFirstPending(GLOBAL_KEY, undefined, by);
223
- })
224
- .then((task: any) => {
225
- if (task) resolveOutcome({ kind: 'task', task, delivered: false, source: 'global' });
186
+ if (task) resolveOutcome({ kind: 'task', task, delivered: false, source: 'local' });
226
187
  })
227
188
  .catch(() => {
228
189
  /* 瞬时读写错误,下一轮再试 */
@@ -298,7 +259,6 @@ export async function waitForTask({
298
259
  escort.stop();
299
260
  clearTimeout(timer);
300
261
  unregisterTopicWaiter(key);
301
- unregisterGlobal();
302
262
  await clearWaiting(key);
303
263
  }
304
264
  return result;
@@ -42,7 +42,6 @@ const input = z.object({
42
42
  file: z.string().optional().describe("从本机文件读任务正文(- 表示标准输入)——长文本/多行不必靠引号硬拼"),
43
43
  cwd: z.string().optional().describe("工作目录(作为主题;默认当前目录)。归属由 --project 决定:给了 --project 就用它推导落点,这里再给且不一致会报错"),
44
44
  summary: z.string().optional().describe("顺带刷新该主题的当前现状(可选)"),
45
- global: z.boolean().optional().describe("推到全局主题(共享池):任何目录的 wait 在本地空时自动领取;--cwd 被忽略"),
46
45
  board: z.string().optional().describe("工作组(看板)id / key / 名称:任务正文自动带上 frontmatter(board + 组介绍引用),该任务才会出现在组面板里;必须同时给 --project 指明归属项目"),
47
46
  project: z.string().optional().describe("归属项目(仓库 key / 名称 / 路径):任务挂在哪个项目上,落点目录由它推导,frontmatter 带上 project + 项目介绍引用;配 --board 时必须是该组成员"),
48
47
  duration: z.string().optional().describe("时间目标时长(2h / 90m / 5小时):领取即计时,未到点不许标完成"),
@@ -62,7 +61,7 @@ export class LocaltaskAddAction extends ActionBase<typeof input> {
62
61
  id: 'localtask.add',
63
62
  cli: ['localtask', 'add'],
64
63
  http: ['POST', '/api/localtasks'],
65
- summary: '向某主题(工作目录)的队列回填一条任务(正文可多行;--file <文件|-> 从文件/标准输入读,长文本不必靠引号硬拼;有 wait 在等则即时投递,否则排队);--global 推到全局共享池;--duration 给任务带时间目标(领取即计时,完成前必须 check);--board/--project 让任务带工作组语义(正文 frontmatter:board + project + 双方介绍引用),并落进该项目的队列;正文自带 frontmatter 时同样认归属——补介绍引用,落点跟到项目队列(显式给过 --cwd 时不挪窝)',
64
+ summary: '向某主题(工作目录)的队列回填一条任务(正文可多行;--file <文件|-> 从文件/标准输入读,长文本不必靠引号硬拼;有 wait 在等则即时投递,否则排队);--duration 给任务带时间目标(领取即计时,完成前必须 check);--board/--project 让任务带工作组语义(正文 frontmatter:board + project + 双方介绍引用),并落进该项目的队列;正文自带 frontmatter 时同样认归属——补介绍引用,落点跟到项目队列(显式给过 --cwd 时不挪窝)',
66
65
  args: ['text'],
67
66
  input,
68
67
  output: addView,
@@ -90,7 +89,6 @@ export class LocaltaskAddAction extends ActionBase<typeof input> {
90
89
  text: body,
91
90
  cwd: ctx.cwd,
92
91
  summary: ctx.summary,
93
- global: ctx.global,
94
92
  board: ctx.board,
95
93
  project: ctx.project,
96
94
  duration: ctx.duration,
@@ -114,7 +114,6 @@ export class LocaltaskBoardTasksAction extends ActionBase<typeof input> {
114
114
  );
115
115
  const rows: any[] = [];
116
116
  for (const t of topics) {
117
- if (t.isGlobal) continue;
118
117
  const repoKey = t.repo && t.repo.key ? String(t.repo.key) : '';
119
118
  // 成员关系按仓库 key 对(与 board.repos[].key 同一键空间);
120
119
  // 没登记仓库的目录队列不属于任何组,天然出局。
@@ -19,7 +19,7 @@ export class LocaltaskCloneAction extends ActionBase<typeof input> {
19
19
  id: 'localtask.clone',
20
20
  cli: ['localtask', 'clone'],
21
21
  http: ['POST', '/api/localtasks/clone'],
22
- summary: '克隆任务:复制正文内容为一条新任务(同主题;全局任务仍进全局池)。不带派生链、不继承时间目标与依赖——开新活用',
22
+ summary: '克隆任务:复制正文内容为一条新任务(同主题)。不带派生链、不继承时间目标与依赖——开新活用',
23
23
  input,
24
24
  render: (d: any) =>
25
25
  `已克隆 #${d.from.id} → #${d.task.id} @ ${d.name}(内容复制,无派生链;${d.delivered ? '已实时投递' : '待领取'})`,
@@ -1,7 +1,7 @@
1
1
  // (#54 自 service.js 拆出)等待生命周期事件流:轮询 store,从 waiting/waitingUntil 与
2
2
  // 已领取数的变化里派生 waiting/reminder/resolved 事件;SSE(streamEventsSSE)与
3
3
  // CLI(NDJSON)共用 watchEvents 生成器。
4
- import { isGlobalKey, normalizeCwd } from '../paths.js';
4
+ import { normalizeCwd } from '../paths.js';
5
5
  import { openLocaltaskStore as openStore, topics as topicsRepo } from './repo/index.js';
6
6
  import { deadlineMsOf } from '../lifecycle/task-view.js';
7
7
  import { addEventStreamConn } from '../ui/panel-presence.js';
@@ -123,7 +123,7 @@ export async function* watchEvents({ cwd: rawCwd, key: rawKey, pollMs = EVENT_PO
123
123
  cwd: t.cwd || '',
124
124
  name: t.name || '',
125
125
  summary: t.summary || '',
126
- isGlobal: isGlobalKey(t.key),
126
+ // #190 全局池已删除,字段保留给旧事件消费方(恒 false)
127
127
  waitingUntil: t.waitingUntil,
128
128
  remainMs: Math.max(0, deadline - now),
129
129
  replay: first,
@@ -138,7 +138,7 @@ export async function* watchEvents({ cwd: rawCwd, key: rawKey, pollMs = EVENT_PO
138
138
  cwd: t.cwd || '',
139
139
  name: t.name || '',
140
140
  summary: t.summary || '',
141
- isGlobal: isGlobalKey(t.key),
141
+ // #190 全局池已删除,字段保留给旧事件消费方(恒 false)
142
142
  waitingUntil: t.waitingUntil,
143
143
  remainSec: sec,
144
144
  remainMs: Math.max(0, st!.deadline! - now),
@@ -148,7 +148,7 @@ export async function* watchEvents({ cwd: rawCwd, key: rawKey, pollMs = EVENT_PO
148
148
  } else if (st && st.phase === 'waiting') {
149
149
  const outcome = deliveredCount(t) > st.delivered0! ? 'delivered' : 'timeout';
150
150
  state.set(t.key, { phase: 'ended' });
151
- yield { type: 'resolved', key: t.key, cwd: t.cwd || '', name: t.name || '', isGlobal: isGlobalKey(t.key), outcome };
151
+ yield { type: 'resolved', key: t.key, cwd: t.cwd || '', name: t.name || '', outcome };
152
152
  } else if (!st) {
153
153
  state.set(t.key, { phase: 'idle' });
154
154
  }
@@ -163,7 +163,7 @@ export async function* watchEvents({ cwd: rawCwd, key: rawKey, pollMs = EVENT_PO
163
163
  key: t.key,
164
164
  cwd: t.cwd || '',
165
165
  name: t.name || '',
166
- isGlobal: isGlobalKey(t.key),
166
+ // #190 全局池已删除,字段保留给旧事件消费方(恒 false)
167
167
  outcome: 'timeout',
168
168
  stale: true,
169
169
  };
@@ -44,7 +44,6 @@ export const TOPIC_EXT = Object.freeze({
44
44
  WORKFLOW_STATE: 'ext_workflow_state',
45
45
  WORKFLOW_PLUGINS: 'ext_workflow_plugins',
46
46
  TASK_ORDER: 'ext_task_order',
47
- GLOBAL: 'ext_global',
48
47
  LAST_SUMMARY: 'ext_last_summary',
49
48
  });
50
49
 
@@ -2,7 +2,6 @@
2
2
 
3
3
  import { db, txw } from './open.js';
4
4
  import { nowMs, msToStamp } from '../../../../core/db/time.js';
5
- import { GLOBAL_TOPIC_KEY } from '../../../../core/topic-key.js';
6
5
  import { TOPIC_EXT, parseExt, jsonText } from './rows.js';
7
6
  import { listTaskRowsByTopic, listAllTaskRows } from './tasks.js';
8
7
  import type { DbApi } from '../../../../core/db/driver.js';
@@ -38,7 +37,6 @@ export interface TopicObject {
38
37
  waitingUntilMs: number;
39
38
  waitingSince: string;
40
39
  cancelRequested: boolean;
41
- isGlobal: boolean;
42
40
  ext: Record<string, any>;
43
41
  tasks: TaskObject[];
44
42
  }
@@ -63,7 +61,6 @@ export function ensureTopic(key: string, { cwd = '', name = '' }: { cwd?: string
63
61
  let row: any = conn.get('SELECT id, cwd, name, ext, deleted_at FROM topics WHERE key = :key', { key });
64
62
  if (!row) {
65
63
  const ext: Record<string, any> = {};
66
- if (key === GLOBAL_TOPIC_KEY) ext[TOPIC_EXT.GLOBAL] = 1;
67
64
  conn.run(
68
65
  `INSERT INTO topics (key, repo_key, cwd, group_key, name, next_seq, ext, state, version,
69
66
  deleted_at, created_at, updated_at)
@@ -177,7 +174,6 @@ function assembleTopic(conn: DbApi, row: TopicRow, preloaded: { tasks: TaskObjec
177
174
  waitingSince: presence && Number(presence.since_ms) > 0 ? msToStamp(Number(presence.since_ms)) : '',
178
175
  // cwds(见过的路径)保持 JSON 形状:库里只有主 cwd,历史路径不再有地方放(T03 简化)
179
176
  cancelRequested: !!(presence && presence.cancel_requested),
180
- isGlobal: String(row.key) === GLOBAL_TOPIC_KEY,
181
177
  ext,
182
178
  tasks: ordered,
183
179
  };
@@ -14,7 +14,6 @@
14
14
  //
15
15
  // 至此三个任务动词(领 get / 等 wait / 派 add)同构:action 层一律一行委托,
16
16
  // 编排住在本域(add.js / update.js),队列本体只有 service.js 一处。
17
- import { badInput } from '../../../core/errors.js';
18
17
  import { addTask, normalizeCwd } from '../service.js';
19
18
  import { applyGroupFields, parseFrontmatter } from '../../../shared/frontmatter.js';
20
19
  import { resolveGroupTarget } from '../ops/board-target.js';
@@ -47,7 +46,6 @@ export interface SubmitTaskOptions {
47
46
  * 派任务统一入口。
48
47
  *
49
48
  * 落点与归属的口径(**归属决定落点,目录不参与归属推断**):
50
- * 1. 显式 `--global` → 全局共享池(--cwd 被忽略;与 --board/--project 互斥);
51
49
  * 2. 显式 `--board` / `--project` → 严格口径:resolveGroupTarget 校验(组要配项目、
52
50
  * 项目须是组成员、--cwd 与 --project 不一致直接报错),
53
51
  * frontmatter 统一落字段,落点 = 项目登记路径;
@@ -63,7 +61,6 @@ export async function submitTask({
63
61
  text: rawText,
64
62
  cwd: rawCwd,
65
63
  summary,
66
- global: toGlobal = false,
67
64
  board,
68
65
  project,
69
66
  duration,
@@ -80,9 +77,6 @@ export async function submitTask({
80
77
  const timegoal = duration || goalPrompt ? { duration, prompt: goalPrompt } : undefined;
81
78
 
82
79
  if (board || project) {
83
- if (toGlobal) {
84
- throw badInput('--global 不能与 --board/--project 同时给:全局池没有工作组/项目归属');
85
- }
86
80
  // --cwd **只在显式给了**时才参与校验(须与 --project 指向同一个项目)。
87
81
  // 没给就留空:不能拿「进程当前目录」去跟项目比对——在别的仓库里执行
88
82
  // `--project alpha` 是完全正常的用法(给了 --project 就不用再给 --cwd)。
@@ -105,8 +99,8 @@ export async function submitTask({
105
99
  text = applyGroupFields(text, target.fields as Record<string, unknown>);
106
100
  // 落点跟到解析出的项目队列——**只在调用方没显式给 cwd 时**:显式意图优先,
107
101
  // 不静默挪窝(与严格口径「cwd 与 project 冲突直接报错」同一精神,fail-open 只是
108
- // 不拦任务,不是替调用方改主意);--global 时落点本来就不看 cwd,不挪。
109
- if (target.cwd && !rawCwd && !toGlobal) cwd = target.cwd;
102
+ // 不拦任务,不是替调用方改主意)。
103
+ if (target.cwd && !rawCwd) cwd = target.cwd;
110
104
  } catch {
111
105
  /* 保留原正文与调用方落点 */
112
106
  }
@@ -118,7 +112,6 @@ export async function submitTask({
118
112
  text,
119
113
  cwd,
120
114
  summary,
121
- global: toGlobal,
122
115
  timegoal,
123
116
  blockBy,
124
117
  blocksFollowing: !!blocksFollowing,