dsh-taskbridge 1.9.0 → 1.9.2

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.
@@ -61,4 +61,5 @@ DSH TaskBridge 对本端而言是一个**黑盒代码执行服务**:底层 API
61
61
  - **轻量落盘(默认传 `receiptOnly: true`)**:**必须**调用 `delegate_review({ taskId, decision: "accepted" | "changes-requested", note, completionSummary?, receiptOnly: true })` 写回审查结论(`completionSummary` 为可选字符串,不填时直接省略该字段、切勿传 `null`;传 `receiptOnly: true` 仅返回精简持久化回执,避免全量任务快照触发大文件落盘重读;完整参数签名已在此给出可直接调用,仅在需核对 schema 细则或调用报错时再读 `delegate_review.json`),确认返回 `reviewPersistence.state === "saved"` 且 `reviewPersistence.durable === true`(若为 `saving` / `timed-out` 须如实报告落盘未确认;若为 `failed` 可重试);绝不跳过审查直接宣告完成。
62
62
  - **通过快车道 vs 返工止血车道**:
63
63
  - **若当前包通过(`accepted`)**:多子包推进时,可在**同一回合**内并行发出当前子包的 `delegate_review(..., decision: "accepted", receiptOnly: true)` 与下一就绪子包的 `invoke_subagent` 派发(或最后一个子包通过时同回合发出 `delegate_review` 与 `delegate_plan({ action: "review", ... })`),减少多包串联空转回合。
64
+ - **隔离工作树收官与回写询问(`worktree` 模式)**:当整条任务链的全部必选工作包均完成 `accepted` 落盘(含最终 `delegate_plan` 总评)后,保持 `sourcePath` 原工作目录不改动(切勿未经确认自行拷贝、打补丁或重跑测试),在最终验收汇报中给出 `executionWorkspacePath`,并用纯文本顺带询问用户是否需要将已验收改动写回原工作目录(不要调用 `ask_question` 弹窗工具);若用户确认写回,先检查 `sourcePath` 是否有未提交冲突,再由当前宿主端在本地安全同步改动(不自动 `git commit`)。
64
65
  - **若当前包需返工(`changes-requested`)**:**立即冻结所有依赖该包的后续子包**(绝不带病往下派);先把当前包内的全部违约点、失败测试与遗漏边界一次性排查清楚,调用 `delegate_review(..., decision: "changes-requested", note, receiptOnly: true })` 落盘,随后以 **`continueFromTaskId: taskId` + 原授权 `workspacePath`(及同一 `planNodeId`)** 在原会话合并发起一轮返工;返工 `prompt` 应**直接点破失败根因与具体修复方向,并明确要求已通过的接口与测试不得退化**;待当前包返工复验拿到 `accepted` 后才可解锁推进下游子包(若同一难点经 1–2 轮返工仍原地打转,应主动将该点拆得更细或给出更明确的约束,必要时向用户汇报)。
@@ -3,17 +3,18 @@ name: dsh-taskbridge
3
3
  description: >-
4
4
  Dispatch explicitly assigned Git implementation or verification to DSH through the
5
5
  dsh-delegate MCP server (delegate_* tools), wait directly and review in Codex. Activate on
6
- explicit DSH / TaskBridge delegation or $dsh-taskbridge.
6
+ explicit DSH / TaskBridge delegation or $dsh-taskbridge. When active in Code Mode, call
7
+ tools.mcp__dsh_delegate__* directly. Avoid bulk ALL_TOOLS output. Print one exact tool's
8
+ declaration if needed.
7
9
  ---
8
10
  <!-- dsh-taskbridge-managed: edits make this file operator-owned. -->
9
11
  <!-- Generated by npm run build:integrations from integrations/. -->
10
- <!-- dsh-taskbridge-version: 1.9.0 -->
12
+ <!-- dsh-taskbridge-version: 1.9.2 -->
11
13
 
12
14
  # DSH TaskBridge — Codex Native Skill
13
15
 
14
- Read this compact entry once in full. Only open [the reference](rules-reference-96027c387cb9b7587efa4aa3836235d86db1108068e007dc08196e807ca25e5d.md) from this
15
- skill's directory if you actually hit multi-stage/parallel planning, a dirty-source decision, an
16
- explicit teams choice, a continuation/worktree reuse, or a non-`ready` wait event.
16
+ Read this entry in full. Open [the reference](rules-reference-7e1f2f22aaf0e95cb9acb0aad9a9750732ba4f669ae0155925e8fcf25e9594bf.md) only for multi-stage or
17
+ parallel planning, a dirty source, an explicit teams choice, task reuse, or a non-`ready` event.
17
18
 
18
19
  ## ACTIVATION (check this before anything else)
19
20
  1. Dispatch only when the user explicitly selects this skill (`$dsh-taskbridge`) or explicitly
@@ -25,6 +26,22 @@ explicit teams choice, a continuation/worktree reuse, or a non-`ready` wait even
25
26
  code/verification tasks) without calling any `delegate_*` tool.
26
27
  3. If assignment is ambiguous, ask one short clarifying question instead of dispatching.
27
28
 
29
+ ## CODE MODE CALLS
30
+ Keep skill reads separate from large outputs. Avoid dumping `ALL_TOOLS`. For a missing field, find
31
+ one tool by exact name and print only the text from `exec tool declaration:` if present.
32
+ Omit unused optional keys. Use `const data = JSON.parse(res.content[0].text)` and handle
33
+ `res.isError` or `data.ok !== true` before acting. Keep the receipts and follow the returned `reason`.
34
+
35
+ Check status first; run read-only preflight separately:
36
+
37
+ ```js
38
+ text(await tools.mcp__dsh_delegate__delegate_status({}));
39
+ ```
40
+
41
+ ```js
42
+ text(await tools.mcp__dsh_delegate__delegate_preflight({ workspacePath }));
43
+ ```
44
+
28
45
  ## P0: COMMANDER-OWNED PLANNING AND WORK PACKETS (DECOMPOSITION & DIRECTION)
29
46
  1. Codex owns decomposition, direction, scope boundaries and acceptance — NOT line-by-line coding
30
47
  details. Inspect key entry files and specs before dispatching. Submit a cohesive task that DSH
@@ -43,8 +60,6 @@ explicit teams choice, a continuation/worktree reuse, or a non-`ready` wait even
43
60
  request and repository AGENTS.md. Never expand scope or let a verification-only packet modify
44
61
  code or rules.
45
62
 
46
- For a multi-stage or parallel goal, read the reference's planning section.
47
-
48
63
  ## DISPATCH CONTRACT
49
64
  1. **PREFLIGHT (new task chains only)**. Call `delegate_status` first (once per session); if the
50
65
  switch is off or a prerequisite is missing, report the reason and pause. Never open the switch
@@ -73,16 +88,34 @@ For a multi-stage or parallel goal, read the reference's planning section.
73
88
  workspace/session identity, and `agentTeams` / `agentTeamsOrigin` / `team.applied` /
74
89
  `team.enabled`. Pause dependent dispatches and report any mismatch.
75
90
 
76
- Read the reference's dispatch section for a dirty-source decision, an explicit teams choice, or a
77
- continuation / worktree reuse.
91
+ For a normal single repo, submit and wait in one script:
92
+
93
+ ```js
94
+ // @exec: {"yield_time_ms": 1200000}
95
+ text(await tools.mcp__dsh_delegate__delegate_submit({ workspacePath, title, prompt, autoPreflight: true, wait: true }));
96
+ ```
78
97
 
79
98
  ## WAIT & EVENTS (SINGLE DIRECT CHAIN IN THIS SESSION)
80
- **Direct single-chain wait — NO `spawn_agent` / `wait_agent` wrapper**. On a new task chain,
81
- prefer `delegate_submit({ ..., autoPreflight: true, wait: true })` or `delegate_wait({ taskId })`
82
- directly in this session. Omit `waitSeconds` (default 3600 seconds, matching Codex's 3660-second
83
- tool timeout). A shorter wait is only for an explicitly requested one-off diagnostic. Never poll
84
- `delegate_status` or `delegate_result` while waiting. The observation cadence belongs to the tool,
85
- not to you.
99
+ **Direct single-chain wait — NO `spawn_agent` / `wait_agent` wrapper**. Omit `waitSeconds` (default 3600 seconds,
100
+ Codex tool timeout 3660 seconds). A shorter wait is only for an explicitly requested one-off diagnostic.
101
+ Never poll `delegate_status` or `delegate_result` during a wait. The cadence
102
+ belongs to the tool, not to you. Resume an existing task with its `taskId`.
103
+
104
+ ```js
105
+ // @exec: {"yield_time_ms": 1200000}
106
+ text(await tools.mcp__dsh_delegate__delegate_wait({ taskId }));
107
+ ```
108
+
109
+ - Prefer a direct blocking MCP call when Codex exposes one. In Code Mode, set a long outer yield
110
+ before the first call that waits, and keep it for every continuation, including waits after a
111
+ permission decision or a question answer. Where supported and allowed by the host, start the
112
+ `functions.exec` script with `// @exec: {"yield_time_ms": 1200000}`. Prefer a supported yield
113
+ that covers the full MCP wait when the host offers one.
114
+ - If Code Mode returns `Script running with cell ID`, keep the existing MCP call active. If the
115
+ host offers automatic continuation, let the tool layer resume it. Otherwise call
116
+ `functions.wait` on the same `cell_id` with the same long `yield_time_ms`. Keep waiting for the
117
+ MCP answer or agreed deadline. If the host requires short yields and model-driven continuation,
118
+ tell the operator once that waiting will wake the model at each yield.
86
119
 
87
120
  - `wait-limit` — THIS call's own wait budget ran out (`actionable: false` and `terminal: false`):
88
121
  call `delegate_wait` on the same `taskId` immediately.
@@ -95,9 +128,9 @@ not to you.
95
128
  (`reviewPersistence.durable === true`; if `saving`/`timed-out`, report honestly; if `failed`,
96
129
  retry). Consolidate defects into ONE follow-up via `continueFromTaskId`.
97
130
 
98
- Read the reference's matching event for a client timeout, `attention`, `permission`, `question`,
99
- `failed`, `cancelled`, or `interrupted`. Use its control section for an explicit inspection or stop
100
- request while the channel is blocked in `delegate_wait`.
131
+ Read the complete matching reference section for a client timeout, `attention`, `permission`,
132
+ `question`, `failed`, `cancelled`, or `interrupted`. Use its control section for an explicit
133
+ inspection or stop request during a blocking wait.
101
134
 
102
135
  ## DO NOT IMPLEMENT LOCALLY WHILE A DELEGATED WORKER RUNS
103
136
  Never commit, stash, branch, reset or edit locally while a delegated task is running, waiting or
@@ -124,8 +157,21 @@ diagnosis).
124
157
  round); record minor style preferences or out-of-spec extremes as non-blocking notes and accept
125
158
  (`accepted`).
126
159
 
127
- When `ready`, call `delegate_result({ taskId, includeDiff: false })` ONCE, then run ONE combined
128
- local check in `executionWorkspacePath` (`git rev-parse --short HEAD`, `git status --short`,
129
- `git diff --stat`, `git diff --check`, and the designated test command). Inspect changed/new
130
- production files directly; do NOT dump full diffs or boilerplate test files into stdout unless a
131
- test fails or `git status` shows suspect paths. Pass `receiptOnly: true` to `delegate_review`.
160
+ ## LOCAL VERIFICATION
161
+ After `ready`, call `tools.mcp__dsh_delegate__delegate_result({ taskId, includeDiff: false })` once.
162
+ In the same exec, check `!res.isError`, `data.ok === true`, then match the task and checkout receipt
163
+ to the authorized source and saved submission/wait receipts. Stop on missing or conflicting evidence.
164
+ Only then run one combined check in the verified `executionWorkspacePath`. Capture
165
+ `git rev-parse --short HEAD`, `git status --short`, `git diff --stat`, `git diff --check` and the
166
+ designated tests. Read relevant changed code with bounded output.
167
+
168
+ After inspecting results and changes, send the review and verify durable persistence.
169
+
170
+ ```js
171
+ text(await tools.mcp__dsh_delegate__delegate_review({ taskId, decision, note, receiptOnly: true }));
172
+ ```
173
+
174
+ In `worktree` isolation (no apply/merge tool), after durable `accepted` review (and any final
175
+ `delegate_plan` review), leave `sourcePath` untouched (no copy/patch/re-test), report
176
+ `executionWorkspacePath`, and ask in plain text (never `request_user_input`) whether to write
177
+ changes back; if confirmed, check `sourcePath` for conflicts first and sync locally without committing.
@@ -1,6 +1,6 @@
1
1
  # DSH TaskBridge — Codex rule reference
2
2
 
3
- Read the section for the current decision.
3
+ Read the complete section for the current decision.
4
4
 
5
5
  ## Multi-stage planning
6
6
 
@@ -15,13 +15,46 @@ Read the section for the current decision.
15
15
  subtasks pass); on `changes-requested`, freeze dependent downstream packets until fixed via
16
16
  `continueFromTaskId`. A single cohesive task needs no plan tree.
17
17
 
18
+ Code Mode examples. For a single node, pass `title` at the top level. For a batch,
19
+ use `nodes` in place of top-level `title` and `goalDescription`. Each node has a title;
20
+ choose at most one of `parentKey` (within the batch) and `parentNodeId` (existing parent).
21
+
22
+ ```js
23
+ text(await tools.mcp__dsh_delegate__delegate_plan({ action: 'create', workspacePath, title }));
24
+ ```
25
+
26
+ ```js
27
+ text(await tools.mcp__dsh_delegate__delegate_plan({
28
+ action: 'create', workspacePath, nodes: [
29
+ { key: 'root', title: goalTitle },
30
+ { parentKey: 'root', title: packetTitle },
31
+ ],
32
+ }));
33
+ ```
34
+
35
+ Once the required children are accepted, record the plan review.
36
+
37
+ ```js
38
+ text(await tools.mcp__dsh_delegate__delegate_plan({ action: 'review', nodeId, decision, note }));
39
+ ```
40
+
18
41
  ## Dispatch details
19
42
 
20
43
  - `isolation: "block"` with `decisionRequired: true` (`PREFLIGHT_DIRTY_NEEDS_DECISION`):
21
44
  Do NOT downgrade to shared isolation silently. Inspect the reported changed paths; when
22
45
  in-place execution is safe, state the reason, call `delegate_preflight` again with
23
- `allowShared: true`. For a `shared` decision, pass only `overrides = { isolation = "shared" }`.
46
+ `allowShared: true`. After that separate preflight confirms `shared`, submit with
47
+ `overrides: { isolation: "shared" }` and omit `allowShared`. On `delegate_submit`,
48
+ `allowShared` requires `autoPreflight: true`. After deciding to allow shared execution,
49
+ you can also combine the authorized preflight and submit by passing both flags as `true`.
24
50
  If risk or ownership is unclear, ask one focused question.
51
+
52
+ ```js
53
+ // @exec: {"yield_time_ms": 1200000}
54
+ text(await tools.mcp__dsh_delegate__delegate_submit({
55
+ workspacePath, title, prompt, autoPreflight: true, allowShared: true, wait: true,
56
+ }));
57
+ ```
25
58
  - `agentTeams`: pass `true` or `false` ONLY when the user explicitly stated a choice for this
26
59
  dispatch; otherwise omit it (new tasks follow the TaskBridge default; continuations inherit
27
60
  the chain's choice, and if that task recorded no choice at all, the plugin writes nothing so
@@ -36,7 +69,16 @@ Read the section for the current decision.
36
69
  unrelated task. For a new dependent subtask that starts a fresh DSH Session on an earlier
37
70
  finished isolated worktree, pass `reuseWorktreeFromTaskId` instead (never combine with
38
71
  `continueFromTaskId`). If a continuation or worktree reuse is refused, report it and do not
39
- retry as a new task.
72
+ retry as a new task. In Code Mode, keep `// @exec: {"yield_time_ms": 1200000}` (not 60000 ms)
73
+ whenever a continuation or subtask submission waits (`wait: true` or `delegate_wait`).
74
+ Continue with the original source and omit `autoPreflight` on either reuse path.
75
+
76
+ ```js
77
+ // @exec: {"yield_time_ms": 1200000}
78
+ text(await tools.mcp__dsh_delegate__delegate_submit({
79
+ workspacePath, title, prompt, continueFromTaskId, wait: true,
80
+ }));
81
+ ```
40
82
 
41
83
  ## Wait events
42
84
 
@@ -69,9 +111,12 @@ Read the section for the current decision.
69
111
  bounded single calls required by the current packet with complete evidence; `reject` (with a
70
112
  short `reason`) any out-of-scope path, destructive command, unauthorized external network or
71
113
  data exfiltration, credential/config edit, incomplete/redacted evidence or non-null
72
- `allowBlocked`. Quote the exact `fingerprint` and call `delegate_permission_decide`
73
- (`allow-once` or `reject`, short `reason`, and `waitAfterDecision: true` when supported; if
74
- not supported, decide first and then call `delegate_wait` on the SAME task). Omit `scope`
114
+ `allowBlocked`. Copy `requestId` and the exact `fingerprint` from the pending request.
115
+ `allow-once` requires a fingerprint. For `reject`, omit that field if none was supplied.
116
+ Pass your checked `decision` (`allow-once` or `reject`) and a short `reason` to
117
+ `delegate_permission_decide` with `waitAfterDecision: true` when supported. Otherwise
118
+ decide first and then call `delegate_wait` on the SAME task. In Code Mode,
119
+ keep `// @exec: {"yield_time_ms": 1200000}` on the waiting call, not 60000 ms. Omit `scope`
75
120
  and review each new request independently, including repeated commands. In `decisionReceipt`,
76
121
  `applied: true` is claimed ONLY when the harness confirmed the SAME task, request and operation.
77
122
  An applied receipt can include `waitError`, which means the DECISION SUCCEEDED and only the FOLLOWING WAIT
@@ -81,12 +126,29 @@ Read the section for the current decision.
81
126
  `error.details.decisionReceipt`): read the task
82
127
  with `delegate_result` before sending anything again and never resend automatically.
83
128
  Each allow covers one call only (`scope: "once"`), and the request you just decided is never re-asked.
129
+
130
+ ```js
131
+ // @exec: {"yield_time_ms": 1200000}
132
+ text(await tools.mcp__dsh_delegate__delegate_permission_decide({
133
+ taskId, requestId, decision, reason, waitAfterDecision: true,
134
+ ...(fingerprint ? { fingerprint } : {}),
135
+ }));
136
+ ```
84
137
  - `question`: answer every asked question via `delegate_question_answer({ taskId, requestId,
85
- answers, waitAfterAnswer: true })`. `grantsAccess` is always false; never answer omitted or
86
- redacted questions (`questionAnswerable: false`). Read `answerReceipt`: if `applied: true`
87
- and `waitError` is also returned, the answer WAS applied — never resend it, resume with
88
- `delegate_wait`; if `applied: null` with `confirmation: "unknown"`, read the task with
89
- `delegate_result` before sending anything again.
138
+ answers, waitAfterAnswer: true })` (in Code Mode, keep `// @exec: {"yield_time_ms": 1200000}`
139
+ on `waitAfterAnswer: true` and any `delegate_wait` resume, not 60000 ms). `grantsAccess` is
140
+ always false; never answer omitted or redacted questions (`questionAnswerable: false`). Read
141
+ `answerReceipt`: if `applied: true` and `waitError` is also returned, the answer WAS applied —
142
+ never resend it, resume with `delegate_wait`; if `applied: null` with
143
+ `confirmation: "unknown"`, read the task with `delegate_result` before sending anything again.
144
+ Use one answer per question ID with offered labels in `selected` and/or allowed `custom` text.
145
+
146
+ ```js
147
+ // @exec: {"yield_time_ms": 1200000}
148
+ text(await tools.mcp__dsh_delegate__delegate_question_answer({
149
+ taskId, requestId, answers: [{ id, selected: [label] }], waitAfterAnswer: true,
150
+ }));
151
+ ```
90
152
  - `failed` / `cancelled`: call `delegate_result` ONCE and report. For a transient DSH outage
91
153
  or transport failure, make up to 3 sequential retries on the failing stage: for an unconfirmed
92
154
  submission, first check read-only facts to verify whether a task was created or is live